Subversion Repositories public

Rev

Rev 232 | Go to most recent revision | Details | Compare with Previous | 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"
283 andreas 28
#include "wmsselectorwidget.h"
153 andreas 29
 
232 andreas 30
wmsbase::wmsbase ( QWidget* parent, Qt::WFlags fl )
31
		: QDialog(parent, fl), Ui::wmsWidgetBase ()
153 andreas 32
{
33
QDir dir = QDir::home();
232 andreas 34
QString path = dir.absolutePath();
153 andreas 35
 
232 andreas 36
	setupUi (this);
153 andreas 37
	// Load the config parameters
232 andreas 38
	KConfig cfg (QString("sportwatcher.rc"), KConfig::SimpleConfig);
39
	KConfigGroup ic (&cfg, "WMS");
40
	edServerURL->setUrl (ic.readEntry("ServerURL", "http://onearth.jpl.nasa.gov/wms.cgi"));
283 andreas 41
	edLayer->setText (ic.readEntry("Layer", QString("modis,global_mosaic")));
232 andreas 42
	cbSRS->setCurrentIndex (ic.readEntry("SRS", 0));
43
	cbCRS->setCurrentIndex (ic.readEntry("CRS", 0));
44
	edBands->setValue (ic.readEntry("Bands", 3));
45
	cbImage->setCurrentIndex (ic.readEntry("Image", 2));
46
	cbVersion->setCurrentIndex (ic.readEntry("Version", 0));
47
	edStyles->setText (ic.readEntry("Styles", QString("")));
48
	cbTile->setCurrentIndex (ic.readEntry("Tile", 2));
49
	edDepth->setValue (ic.readEntry("Depth", 2));
50
	edOverview->setValue (ic.readEntry("Overview", 10));
51
	chSquare->setChecked (ic.readEntry("Square", false));
52
	chOffline->setChecked (ic.readEntry("Offline", false));
283 andreas 53
	chAdvice->setChecked (ic.readEntry("Advice", true));
54
	chVerify->setChecked (ic.readEntry("Verify", false));
232 andreas 55
	edCorrX->setValue (ic.readEntry("CorrX", 0));
56
	edCorrY->setValue (ic.readEntry("CorrY", 0));
153 andreas 57
}
58
 
59
wmsbase::~wmsbase()
60
{
61
}
62
 
63
/*$SPECIALIZATION$*/
283 andreas 64
void wmsbase::slotGetCapabilities()
65
{
66
wmsSelectorWidget *dlg = new wmsSelectorWidget(this);
67
 
68
	if (dlg->exec() == QDialog::Accepted)
69
	{
70
	}
71
}
72
 
153 andreas 73
void wmsbase::bpCancelSlot()
74
{
75
	done(QDialog::Rejected);
76
}
77
 
78
void wmsbase::bpSaveSlot()
79
{
232 andreas 80
	KConfig cfg (QString("sportwatcher.rc"), KConfig::SimpleConfig);
81
	KConfigGroup ic (&cfg, "WMS");
153 andreas 82
	// Put the data into the config file
232 andreas 83
	ic.writeEntry("ServerURL", edServerURL->url());
84
	ic.writeEntry("Layer", edLayer->text());
85
	ic.writeEntry("SRS", cbSRS->currentIndex());
86
	ic.writeEntry("CRS", cbCRS->currentIndex());
87
	ic.writeEntry("Bands", edBands->value());
88
	ic.writeEntry("Image", cbImage->currentIndex());
89
	ic.writeEntry("Version", cbVersion->currentIndex());
90
	ic.writeEntry("Styles", edStyles->text());
91
	ic.writeEntry("Tile", cbTile->currentIndex());
92
	ic.writeEntry("Depth", edDepth->value());
93
	ic.writeEntry("Overview", edOverview->value());
94
	ic.writeEntry("Square", chSquare->isChecked());
95
	ic.writeEntry("Offline", chOffline->isChecked());
96
	ic.writeEntry("Advice", chAdvice->isChecked());
97
	ic.writeEntry("Verify", chVerify->isChecked());
98
	ic.writeEntry("CorrX", edCorrX->value());
99
	ic.writeEntry("CorrY", edCorrY->value());
153 andreas 100
	done(QDialog::Accepted);
101
}
102
 
103
 
104
 
105
#include "wmsbase.moc"
106