Subversion Repositories public

Rev

Rev 274 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 274 Rev 276
Line 13... Line 13...
13
#include "config.h"
13
#include "config.h"
14
#include "shapewidget.h"
14
#include "shapewidget.h"
15
#include <KConfig>
15
#include <KConfig>
16
#include <KUrlRequester>
16
#include <KUrlRequester>
17
#include <KLineEdit>
17
#include <KLineEdit>
-
 
18
#include <KMessageBox>
18
#include <QDir>
19
#include <QDir>
19
 
20
 
20
shapeWidget::shapeWidget (QWidget* parent, Qt::WFlags fl)
21
shapeWidget::shapeWidget (QWidget* parent, Qt::WFlags fl)
21
		: QDialog (parent, fl), Ui::shapeWidgetBase()
22
		: QDialog (parent, fl), Ui::shapeWidgetBase()
22
{
23
{
23
QString basePath;
24
QString basePath;
24
QDir dir = QDir::home();
25
QDir dir = QDir::home();
25
QString path = dir.absolutePath();
26
QString path = dir.absolutePath();
26
 
27
 
-
 
28
	__maptype = MAP_SHAPE;		// default map type
27
	setupUi (this);
29
	setupUi (this);
28
	// Make sure we are useing only existing files on the local system.
30
	// Make sure we are useing only existing files on the local system.
29
	edShapeFileSet->setMode(KFile::ExistingOnly | KFile::LocalOnly);
31
	edShapeFileSet->setMode(KFile::ExistingOnly | KFile::LocalOnly);
30
	edPluginPath->setMode(KFile::ExistingOnly | KFile::LocalOnly);
32
	edPluginPath->setMode(KFile::ExistingOnly | KFile::LocalOnly);
31
	edFontPath->setMode(KFile::ExistingOnly | KFile::LocalOnly);
33
	edFontPath->setMode(KFile::ExistingOnly | KFile::LocalOnly);
Line 74... Line 76...
74
shapeWidget::~shapeWidget()
76
shapeWidget::~shapeWidget()
75
{
77
{
76
}
78
}
77
 
79
 
78
/*$SPECIALIZATION$*/
80
/*$SPECIALIZATION$*/
-
 
81
void shapeWidget::setMapType(maptype mt)
-
 
82
{
-
 
83
	switch (mt)
-
 
84
	{
-
 
85
	   case MAP_SHAPE:
-
 
86
	      label->setText(i18n("Path to shape file set"));
-
 
87
	   break;
-
 
88
 
-
 
89
	   case MAP_GIS:
-
 
90
	      label->setText(i18n("Domain of machine with database"));
-
 
91
	   break;
-
 
92
 
-
 
93
	   case MAP_OSM:
-
 
94
	      label->setText(i18n("Path and name of OSM file"));
-
 
95
	   break;
-
 
96
 
-
 
97
	   default:
-
 
98
	      KMessageBox::error(this, i18n("Internal error: Unknown map type was set!"));
-
 
99
	}
-
 
100
}
-
 
101
 
79
void shapeWidget::accept()
102
void shapeWidget::accept()
80
{
103
{
81
	KConfig cfg (QString("sportwatcher.rc"), KConfig::SimpleConfig);
104
	KConfig cfg (QString("sportwatcher.rc"), KConfig::SimpleConfig);
82
	KConfigGroup ic (&cfg, "SportWatcher");
105
	KConfigGroup ic (&cfg, "SportWatcher");
83
	KConfigGroup sh (&cfg, "ShapeFile");
106
	KConfigGroup sh (&cfg, "ShapeFile");