예제 #1
0
QStringList TKeyboard::getKeyboards(TSettings &settings, const QString &section)
{
	QStringList keyboards;

	settings.beginGroup(section);

	if(!settings.contains("keyboard1")) {
		keyboards += settings.getValue("keyboard1", "a b c d e  f g h i j  k l m n o  p q r s t  u v w x y  z SPACE <- CAPS ALT").toString();
		keyboards += settings.getValue("keyboard2", "1 2 3 4 5  6 7 8 9 0  ( ) [ ] {  } + - = _  / % * ! @  $ SPACE <- CAPS ALT").toString();
	} else {
		int i = 1;
		QString num = QString::number(i);

		while(settings.contains("keyboard" + num)) {
			keyboards += settings.getValue("keyboard" + num, "").toString();
			i++;
			num = QString::number(i);
		}
	}

	settings.endGroup();

	int i;
	for(i = 0; i < keyboards.size(); i ++) {
		keyboards[i] = prepareLayoutString(keyboards[i]);
	}

	return keyboards;
}
예제 #2
0
void TMapCentering::configure(TSettings &settings, const QString &section)
{
	settings.beginGroup(section);
	_zoomMax = settings.getValue("maxautozoom", 18).toInt();
	_elasticityStartZoom = settings.getValue("elasticitystartzoom", 12).toInt();
	_elasticitySpeed = settings.getValue("elasticityspeed", 10).toInt();
	_elasticityTopBorder = settings.getValue("elasticitytopborder", 130).toInt();
	_elasticityBottomBorder = settings.getValue("elasticitybottomborder", 80).toInt();
	_elasticityRightBorder = settings.getValue("elasticityrightborder", 80).toInt();
	_elasticityLeftBorder = settings.getValue("elasticityleftborder", 80).toInt();
	settings.endGroup();
}
예제 #3
0
void TTileServerDirect::configure(TSettings &settings, const QString &server, const QString &cache)
{
	QStringList serverNames;
	QString defaultServer;
	bool empty;

	settings.beginGroup(server);
	empty = !settings.contains("httpservers");
	settings.endGroup();

	if(empty) {
		defaultServer = TTileHttpName::initDefault(settings);
	}

	settings.beginGroup(server);
	serverNames = settings.getValue("httpservers", defaultServer).toStringList();
	_online = settings.getValue("startonline", true).toBool();
	settings.endGroup();

	_http.configure(settings, serverNames);
	_container.configure(settings, cache);
}
예제 #4
0
void TTraceRecorder::configure(TSettings &settings, const QString &section)
{
	settings.beginGroup(section);

	_dir = settings.getValue("recorddir", "/media/card/NeronGPS/traces/records").toString();
	_tmpDir = settings.getValue("tempdir", "/media/card/NeronGPS/traces/temp").toString();

	bool record = settings.getValue("autorecord", "true").toBool();

	settings.endGroup();

	QDir::current().mkpath(_dir);
	QDir::current().mkpath(_tmpDir);

	if(record) {
		QMessageBox dialog(QMessageBox::Question, "Auto-recording enabled", "Start recording?", QMessageBox::Yes | QMessageBox::No);
		if(dialog.exec() == QMessageBox::Yes) {
			slotRecord(true);
		}
	}
}