release 0.5
[presencevnc] / src / preferences.cpp
index a212147..212be34 100644 (file)
@@ -18,7 +18,7 @@
 */
 #include <QtGui>
 
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
 #include <QMaemo5ValueButton>
 #include <QMaemo5ListPickSelector>
 #endif
@@ -34,6 +34,10 @@ void migrateConfiguration()
        const int current_ver = 2;
        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);
@@ -80,7 +84,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 +127,10 @@ 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);
+
        QPushButton *ok = new QPushButton(tr("Done"));
        ok->setMaximumWidth(100);
 
@@ -139,12 +147,13 @@ 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.sync();
 }