X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fpreferences.cpp;h=5a2fa2e83220a5cbdb0fceabc2f8de65f39ec407;hb=760ee4fac3ca5d3b43c18c417348d53741105e1e;hp=a21214701a44ce4dba190e5c948552a9bd323ca8;hpb=90113a8a9a2977db705071fa954b236baa4f5511;p=presencevnc diff --git a/src/preferences.cpp b/src/preferences.cpp index a212147..5a2fa2e 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -18,7 +18,7 @@ */ #include -#ifdef Q_WS_HILDON +#ifdef Q_WS_MAEMO_5 #include #include #endif @@ -31,9 +31,13 @@ void migrateConfiguration() { QSettings settings; int config_ver = settings.value("config_version", 0).toInt(); - const int current_ver = 2; + const int current_ver = 3; if(config_ver == current_ver) //config file up-to-date return; + if(config_ver > current_ver) { + std::cout << "Warning: Config file was created by a newer version of Presence VNC. This may break things.\n"; + return; + } if(settings.allKeys().isEmpty()) { //no config file settings.setValue("config_version", current_ver); @@ -66,6 +70,20 @@ void migrateConfiguration() config_ver = 2; } + if(config_ver == 2) { + bool rescale = settings.value("rescale", false).toBool(); + settings.remove("rescale"); + + int zoomlevel; + if(rescale) + zoomlevel = 0; + else + zoomlevel = 95; + + settings.setValue("zoomlevel", zoomlevel); + + config_ver = 3; + } Q_ASSERT(config_ver == current_ver); settings.setValue("config_version", config_ver); settings.sync(); @@ -80,7 +98,7 @@ Preferences::Preferences(QWidget *parent): QHBoxLayout *layout1 = new QHBoxLayout(); QVBoxLayout *layout2 = new QVBoxLayout(); -#ifdef Q_WS_HILDON +#ifdef Q_WS_MAEMO_5 QMaemo5ValueButton *rotation = new QMaemo5ValueButton(tr("Screen Rotation"), this); rotation_selector = new QMaemo5ListPickSelector(this); QStandardItemModel *model = new QStandardItemModel(0, 1, this); @@ -123,6 +141,14 @@ Preferences::Preferences(QWidget *parent): layout2->addWidget(disable_tapping); #endif + always_show_local_cursor = new QCheckBox(tr("Always show local cursor"), this); + always_show_local_cursor->setChecked(settings.value("always_show_local_cursor", false).toBool()); + layout2->addWidget(always_show_local_cursor); + + zoom_to_cursor = new QCheckBox(tr("Zoom to cursor"), this); + zoom_to_cursor->setChecked(settings.value("zoom_to_cursor", true).toBool()); + layout2->addWidget(zoom_to_cursor); + QPushButton *ok = new QPushButton(tr("Done")); ok->setMaximumWidth(100); @@ -139,12 +165,14 @@ Preferences::Preferences(QWidget *parent): void Preferences::save() { -#ifdef Q_WS_HILDON +#ifdef Q_WS_MAEMO_5 settings.setValue("screen_rotation", rotation_selector->currentIndex()); settings.setValue("left_zoom", leftzoom_selector->currentIndex()); settings.setValue("right_zoom", rightzoom_selector->currentIndex()); settings.setValue("disable_tapping", disable_tapping->isChecked()); #endif + settings.setValue("always_show_local_cursor", always_show_local_cursor->isChecked()); + settings.setValue("zoom_to_cursor", zoom_to_cursor->isChecked()); settings.sync(); }