[Pkg-running-devel] [openambit] 44/131: Added Early beta warning at startup Fixes issue #11

Christian Perrier bubulle at moszumanska.debian.org
Thu Jul 17 20:19:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

bubulle pushed a commit to branch master
in repository openambit.

commit 8c97e314b5afe2b40c5517a0e88609ddd4624072
Author: Marco Bernasocchi <marco at opengis.ch>
Date:   Mon Jan 13 15:39:26 2014 +0100

    Added Early beta warning at startup Fixes issue #11
---
 src/openambit/mainwindow.cpp     | 13 +++++++++++++
 src/openambit/mainwindow.h       |  2 ++
 src/openambit/openambit.pro      |  9 ++++++---
 src/openambit/settingsdialog.cpp |  8 ++++++++
 src/openambit/settingsdialog.ui  | 14 +++++++++++++-
 5 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/src/openambit/mainwindow.cpp b/src/openambit/mainwindow.cpp
index e7f5c24..f0beab4 100644
--- a/src/openambit/mainwindow.cpp
+++ b/src/openambit/mainwindow.cpp
@@ -53,6 +53,19 @@ MainWindow::MainWindow(QWidget *parent) :
     ui->buttonSyncNow->setHidden(true);
     ui->syncProgressBar->setHidden(true);
 
+
+    //check if there is a settings to skip the beta check
+    settings.beginGroup("generalSettings");
+    bool skip;
+    skip = settings.value("skipBetaCheck", false).toBool();
+    if (! skip){
+        confirmBetaDialog = new ConfirmBetaDialog(this);
+        if (confirmBetaDialog->exec() == false){
+            // exit if user doesn't accept the early beta dialog
+            exit(1);
+        }
+    }
+
     connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
 
     // System tray icon
diff --git a/src/openambit/mainwindow.h b/src/openambit/mainwindow.h
index 2a54470..5bfb8ee 100644
--- a/src/openambit/mainwindow.h
+++ b/src/openambit/mainwindow.h
@@ -24,6 +24,7 @@
 
 #include "devicemanager.h"
 #include "settingsdialog.h"
+#include "confirmbetadialog.h"
 #include "movescount.h"
 #include <QMainWindow>
 #include <QThread>
@@ -79,6 +80,7 @@ private:
 
     Settings settings;
     SettingsDialog *settingsDialog;
+    ConfirmBetaDialog *confirmBetaDialog;
     DeviceManager *deviceManager;
     LogStore logStore;
     MovesCountXML movesCountXML;
diff --git a/src/openambit/openambit.pro b/src/openambit/openambit.pro
index 00cda6d..d667be7 100644
--- a/src/openambit/openambit.pro
+++ b/src/openambit/openambit.pro
@@ -22,7 +22,8 @@ SOURCES += main.cpp\
     movescountxml.cpp \
     movescountjson.cpp \
     movescount.cpp \
-    udevlistener.cpp
+    udevlistener.cpp \
+    confirmbetadialog.cpp
 
 HEADERS  += mainwindow.h \
     devicemanager.h \
@@ -33,10 +34,12 @@ HEADERS  += mainwindow.h \
     movescountxml.h \
     movescountjson.h \
     movescount.h \
-    udevlistener.h
+    udevlistener.h \
+    confirmbetadialog.h
 
 FORMS    += mainwindow.ui \
-    settingsdialog.ui
+    settingsdialog.ui \
+    confirmbetadialog.ui
 
 INCLUDEPATH += ../libambit
 QMAKE_LIBDIR += ../libambit-build
diff --git a/src/openambit/settingsdialog.cpp b/src/openambit/settingsdialog.cpp
index 583f2b6..3e2bf34 100644
--- a/src/openambit/settingsdialog.cpp
+++ b/src/openambit/settingsdialog.cpp
@@ -67,6 +67,10 @@ void SettingsDialog::showHideUserSettings()
 
 void SettingsDialog::readSettings()
 {
+    settings.beginGroup("generalSettings");
+    ui->checkBoxSkipBetaCheck->setChecked(settings.value("skipBetaCheck", false).toBool());
+    settings.endGroup();
+
     settings.beginGroup("syncSettings");
     ui->checkBoxSyncTime->setChecked(settings.value("syncTime", true).toBool());
     ui->checkBoxSyncOrbit->setChecked(settings.value("syncOrbit", true).toBool());
@@ -82,6 +86,10 @@ void SettingsDialog::readSettings()
 
 void SettingsDialog::writeSettings()
 {
+    settings.beginGroup("generalSettings");
+    settings.setValue("skipBetaCheck", ui->checkBoxSkipBetaCheck->isChecked());
+    settings.endGroup();
+
     settings.beginGroup("syncSettings");
     settings.setValue("syncTime", ui->checkBoxSyncTime->isChecked());
     settings.setValue("syncOrbit", ui->checkBoxSyncOrbit->isChecked());
diff --git a/src/openambit/settingsdialog.ui b/src/openambit/settingsdialog.ui
index a91f9e2..423d07d 100644
--- a/src/openambit/settingsdialog.ui
+++ b/src/openambit/settingsdialog.ui
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>682</width>
+    <width>729</width>
     <height>438</height>
    </rect>
   </property>
@@ -87,6 +87,9 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
          <widget class="QWidget" name="generalSettingsPage">
           <layout class="QVBoxLayout" name="verticalLayout_5">
            <item>
@@ -94,6 +97,15 @@
              <property name="title">
               <string>General settings</string>
              </property>
+             <layout class="QFormLayout" name="formLayout_3">
+              <item row="0" column="0">
+               <widget class="QCheckBox" name="checkBoxSkipBetaCheck">
+                <property name="text">
+                 <string>Skip Beta check at startup</string>
+                </property>
+               </widget>
+              </item>
+             </layout>
             </widget>
            </item>
           </layout>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/openambit.git



More information about the Pkg-running-devel mailing list