Subversion Repositories public

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
153 andreas 1
/***************************************************************************
2
 *   Copyright (C) 2007, 2008 by Andreas Theofilu                          *
3
 *   andreas@theosys.at                                                    *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation version 3 of the License.                *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
19
 
20
#include <ksimpleconfig.h>
21
#include <knuminput.h>
22
#include <kcombobox.h>
23
#include <kurlrequester.h>
24
#include <klineedit.h>
25
#include <qdir.h>
26
#include <qcheckbox.h>
27
#include "wmsbase.h"
28
 
29
wmsbase::wmsbase ( QWidget* parent, const char* name, bool modal, WFlags fl )
30
		: wmswidgetbase ( parent,name, modal,fl )
31
{
32
KHistoryCombo *cb;
33
QDir dir = QDir::home();
34
QString path = dir.absPath();
35
 
36
	// Load the config parameters
37
 
38
	KSimpleConfig *cfg = new KSimpleConfig(QString("sportwatcher.rc"), true);
39
	cfg->setGroup(QString("WMS"));
40
	edServerURL->setURL (cfg->readEntry("ServerURL", "http://localhost/cgi-bin/mapnik"));
41
	edLayer->setText (cfg->readEntry("Layer"));
42
	cbSRS->setCurrentItem (cfg->readNumEntry("SRS", 0));
43
	cbCRS->setCurrentItem (cfg->readNumEntry("CRS", 0));
44
	edBands->setValue (cfg->readNumEntry("Bands", 3));
45
	cbImage->setCurrentItem (cfg->readNumEntry("Image", 2));
46
	cbVersion->setCurrentItem (cfg->readNumEntry("Version", 0));
47
	edStyles->setText (cfg->readEntry("Styles"));
48
	cbTile->setCurrentItem (cfg->readNumEntry("Tile", 2));
49
	edDepth->setValue (cfg->readNumEntry("Depth", 2));
50
	edOverview->setValue (cfg->readNumEntry("Overview", 10));
51
	chOffline->setChecked (cfg->readBoolEntry("Offline", false));
52
	chAdvice->setChecked (cfg->readBoolEntry("Advice", false));
53
	chVerify->setChecked (cfg->readBoolEntry("Verify", true));
54
	delete cfg;
55
}
56
 
57
wmsbase::~wmsbase()
58
{
59
}
60
 
61
/*$SPECIALIZATION$*/
62
void wmsbase::bpCancelSlot()
63
{
64
	done(QDialog::Rejected);
65
}
66
 
67
void wmsbase::bpSaveSlot()
68
{
69
	KSimpleConfig *cfg = new KSimpleConfig(QString("sportwatcher.rc"));
70
	cfg->setGroup(QString("WMS"));
71
	// Put the data into the config file
72
	cfg->writeEntry("ServerURL", edServerURL->url());
73
	cfg->writeEntry("Layer", edLayer->text());
74
	cfg->writeEntry("SRS", cbSRS->currentItem());
75
	cfg->writeEntry("CRS", cbCRS->currentItem());
76
	cfg->writeEntry("Bands", edBands->value());
77
	cfg->writeEntry("Image", cbImage->currentItem());
78
	cfg->writeEntry("Version", cbVersion->currentItem());
79
	cfg->writeEntry("Styles", edStyles->text());
80
	cfg->writeEntry("Tile", cbTile->currentItem());
81
	cfg->writeEntry("Depth", edDepth->value());
82
	cfg->writeEntry("Overview", edOverview->value());
83
	cfg->writeEntry("Offline", chOffline->isChecked());
84
	cfg->writeEntry("Advice", chAdvice->isChecked());
85
	cfg->writeEntry("Verify", chVerify->isChecked());
86
	cfg->sync();
87
	delete cfg;
88
	done(QDialog::Accepted);
89
}
90
 
91
 
92
 
93
#include "wmsbase.moc"
94