New upstream version 0.6.4 upstream/0.6.4
authorgregor herrmann <gregoa@debian.org>
Fri, 8 Dec 2017 14:27:24 +0000 (15:27 +0100)
committergregor herrmann <gregoa@debian.org>
Fri, 8 Dec 2017 14:27:24 +0000 (15:27 +0100)
16 files changed:
ChangeLog
NEWS
data/confclerk.1
data/confclerk.png
src/app/appsettings.cpp
src/app/appsettings.h
src/global.pri
src/gui/mainwindow.cpp
src/gui/mainwindow.ui
src/gui/settingsdialog.cpp
src/gui/settingsdialog.ui
src/gui/urlinputdialog.cpp
src/orm/ormrecord.h
src/sql/schedulexmlparser.cpp
src/sql/sqlengine.cpp
src/sql/sqlengine.h

index 83744ff097614a19e3158840a75766216658d34c..33d67e6d29f7bf7e2c6773a0067051bdc845e03f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,64 @@
+2017-12-08  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       update NEWS before release of version 0.6.4
+
+2017-10-07  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       Make toolbar in main window non-movable
+       to prevent accidentally pulling it out.
+
+2017-10-06  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       Settings (dialog): add username/password options for proxy server
+       Cf. #59
+
+2017-10-05  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       update comment on default proxy value as we use QNetworkProxy::ProxyType instead of int now
+
+2017-10-05  Philipp Spitzer  <philipp@spitzer.priv.at>
+
+       AppSettings returns the proxy type as QNetworkProxy instead of int now.
+
+2017-10-05  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       Settings (dialog): add HTTP+SOCKS5 radio buttons and use them
+       Hopefully fixes: #59
+
+       Add ProxyType setting in preparation of SOCKS5 proxy support.
+
+2017-10-03  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       Settings dialog: set port range to 1-65535 and right-align.
+
+       Settings dialog: change heading to "HTTP proxy settings".
+       Fixes: #59
+
+2017-10-02  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       schedulexmlparser.cpp: add missing #include
+       Found when building with gcc 4.2.1 under Maemo5.
+
+2017-10-02  Philipp Spitzer  <philipp@spitzer.priv.at>
+
+       C++98 compatibility: Variable initialization in SqlEngine class.
+
+       C++98 compatibility: Variable initialization in TransactionRaii class.
+
+       C++98 compatibility: Use throw() in destructor of std exceptions.
+
+       C++98 compatibility: QDialogButtonBox::StandardButton::Open -> QDialogButtonBox::Open.
+
+2017-10-02  gregor herrmann  <gregor@toastfreeware.priv.at>
+
+       Make sure we build with -std=c++98 (under Unix and Qt4)
+       because gcc 4.2.1 on Maemo5 doesn't know c++11, and with this setting we can
+       prevent accidents also when building the Qt4 variant with a modern compiler.
+
 2017-10-01  gregor herrmann  <gregor@toastfreeware.priv.at>
 
+       bump version after release
+
        update NEWS before release of version 0.6.3
 
 2017-09-27  Philipp Spitzer  <philipp@spitzer.priv.at>
diff --git a/NEWS b/NEWS
index c163847c2cfcaf8a38cb383a6ce9048895da3de2..4fddcb6b1b870c6c61d78ad4cf1d9f809dc75125 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
 This is the NEWS file for ConfClerk. ConfClerk is the successor of
 fosdem-schedule; cf. docs/fosdem-schedule for the historic documentation.
 
+version 0.6.4, 2017-12-08
+* Improve proxy dialog and add support for SOCKS5 proxies.
+  Thanks to intrigeri for the bug report.
+  (Fixes: #59)
+* Make toolbar in main window non-movable to prevent accidentally
+  pulling it out.
+
 version 0.6.3, 2017-10-01
 * Support Qt5 and Qt4.
   (Fixes: #57)
index 44a63b773ca50a18f19be5bc75221f4100fad0d8..d616506cee3345dfb1ef65973259869faab4bc4c 100644 (file)
@@ -67,7 +67,7 @@
 .\" ========================================================================
 .\"
 .IX Title "CONFCLERK 1"
-.TH CONFCLERK 1 "2017-08-30" "Version 0.6.3" "Offline conference scheduler"
+.TH CONFCLERK 1 "2017-08-30" "Version 0.6.4" "Offline conference scheduler"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
index 41551c239e13f17de66ce145f74befdeb317b6db..16411cece7a3bc3ce99f1c1554200b264abbc05d 100644 (file)
Binary files a/data/confclerk.png and b/data/confclerk.png differ
index b98060dd6d893d8c6d041a8c724d0490fa8a4582..f92c17e9b87d92943d554ea31da0861f626699e2 100644 (file)
 
 const QString PROXY_ADDRESS_SETTING ("proxyAddress"); 
 const QString PROXY_PORT_SETTING ("proxyPort"); 
-const QString PROXY_ISDIRECT_SETTING ("proxyIsDirectConnection"); 
+const QString PROXY_TYPE_SETTING ("proxyType");
+const QString PROXY_USERNAME_SETTING ("proxyUsername");
+const QString PROXY_PASSWORD_SETTING ("proxyPassword");
+const QString PROXY_ISDIRECT_SETTING ("proxyIsDirectConnection");
 
 QSettings AppSettings::mSettings("Toastfreeware", "ConfClerk");
 
@@ -35,6 +38,24 @@ quint16 AppSettings::proxyPort()
     return mSettings.value(PROXY_PORT_SETTING).toUInt();
 }
 
+QNetworkProxy::ProxyType AppSettings::proxyType()
+{
+    bool ok;
+    int proxyType = mSettings.value(PROXY_TYPE_SETTING).toInt(&ok);
+    if (!ok || proxyType < 0 || proxyType > 5) return QNetworkProxy::DefaultProxy;
+    return QNetworkProxy::ProxyType(proxyType);
+}
+
+QString AppSettings::proxyUsername()
+{
+    return mSettings.value(PROXY_USERNAME_SETTING).toString();
+}
+
+QString AppSettings::proxyPassword()
+{
+    return mSettings.value(PROXY_PASSWORD_SETTING).toString();
+}
+
 bool AppSettings::isDirectConnection()
 {
     return mSettings.value(PROXY_ISDIRECT_SETTING).toBool();
@@ -50,6 +71,21 @@ void AppSettings::setProxyPort(const quint16 aPort)
     mSettings.setValue(PROXY_PORT_SETTING, aPort);
 }
 
+void AppSettings::setProxyType(QNetworkProxy::ProxyType aProxyType)
+{
+    mSettings.setValue(PROXY_TYPE_SETTING, aProxyType);
+}
+
+void AppSettings::setProxyUsername(const QString &aUsername)
+{
+    mSettings.setValue(PROXY_USERNAME_SETTING, aUsername);
+}
+
+void AppSettings::setProxyPassword(const QString &aPassword)
+{
+    mSettings.setValue(PROXY_PASSWORD_SETTING, aPassword);
+}
+
 void AppSettings::setDirectConnection(bool aDirectConnection)
 {
     mSettings.setValue(PROXY_ISDIRECT_SETTING, aDirectConnection);
index 8e5822e01d5c8a2163ed91262d7f3d49bb9aaba9..f116f18c2f6c22a868265ff7a700d5d39d4fe83c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <QString>
 #include <QSettings>
+#include <QNetworkProxy>
 
 class AppSettings
 {
@@ -35,10 +36,16 @@ class AppSettings
 
         static QString proxyAddress();
         static quint16 proxyPort();
+        static QNetworkProxy::ProxyType proxyType();
+        static QString proxyUsername();
+        static QString proxyPassword();
         static bool isDirectConnection();
 
         static void setProxyAddress(const QString &aAddress);
         static void setProxyPort(const quint16 aPort);
+        static void setProxyType(QNetworkProxy::ProxyType aProxyType);
+        static void setProxyUsername(const QString &aUsername);
+        static void setProxyPassword(const QString &aPassword);
         static void setDirectConnection(bool aDirectConnection);
         static int preEventAlarmSec() {return 60*15;} ///< seconds that alarm should ring before an event starts
 };
index fc4a0e6561e0f7f30e9f5d629bc3bb1ece8cd50d..27e691453aa9ec2330803dd7a60248d4267d5cfe 100644 (file)
@@ -4,7 +4,7 @@
 # USAGE: include(./global.pri)
 
 # VERSION
-VERSION = 0.6.3
+VERSION = 0.6.4
 DEFINES += VERSION=\\\"$$VERSION\\\"
 
 # Define 'MAEMO' specific CONFIG/DEFINE
@@ -24,3 +24,12 @@ contains( DISTRO, [Ii]nternet ) {
     }
 }
 
+# gcc 4.2.1 on Maemo doesn't understand anything newer then c++98.
+# make sure we explicitly add the flag even when building
+# with a modern compiler.
+# Only under Qt4 because Qt5 needs c++11
+unix: {
+    equals( QT_MAJOR_VERSION, 4 ) {
+        QMAKE_CXXFLAGS += -std=c++98
+    }
+}
index 3b2582a213eab1f72b0a87d5ac4e5c4283005957..918134382b7caaaa0661c9c3c9c49f2aed5d23f1 100644 (file)
@@ -49,9 +49,6 @@
 #include "tabcontainer.h"
 #include "appsettings.h"
 
-const QString PROXY_USERNAME;
-const QString PROXY_PASSWD;
-
 MainWindow::MainWindow(QWidget* parent): QMainWindow(parent) {
     setupUi(this);
 
@@ -82,11 +79,11 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent) {
         AppSettings::setDirectConnection(true);
 
     QNetworkProxy proxy(
-            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
+            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : (QNetworkProxy::ProxyType)AppSettings::proxyType(),
             AppSettings::proxyAddress(),
             AppSettings::proxyPort(),
-            PROXY_USERNAME,
-            PROXY_PASSWD);
+            AppSettings::proxyUsername(),
+            AppSettings::proxyPassword());
     QNetworkProxy::setApplicationProxy(proxy);
 
     // event details have changed
@@ -363,11 +360,11 @@ void MainWindow::on_settingsAction_triggered()
     if (dialog.exec() == QDialog::Accepted) {
         dialog.saveDialogData();
         QNetworkProxy proxy(
-                AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
+                AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : (QNetworkProxy::ProxyType)AppSettings::proxyType(),
                 AppSettings::proxyAddress(),
                 AppSettings::proxyPort(),
-                PROXY_USERNAME,
-                PROXY_PASSWD);
+                AppSettings::proxyUsername(),
+                AppSettings::proxyPassword());
         QNetworkProxy::setApplicationProxy(proxy);
     }
 }
index 17ce90aa04b7a41f739ee23a78639b28166b1d5d..e3b4fa1b2a4690f956409377c086d8fbb7ad9d63 100644 (file)
      <x>0</x>
      <y>0</y>
      <width>903</width>
-     <height>23</height>
+     <height>22</height>
     </rect>
    </property>
    <property name="layoutDirection">
    <property name="windowTitle">
     <string>toolBar</string>
    </property>
+   <property name="movable">
+    <bool>false</bool>
+   </property>
    <attribute name="toolBarArea">
     <enum>RightToolBarArea</enum>
    </attribute>
index 13e4e1d8436eac5986f3b852785a53f89e07c837..0262d91935b119a3c8902a741c60038f41cdb1f6 100644 (file)
@@ -35,6 +35,11 @@ void SettingsDialog::loadDialogData()
     // deserialize dialog data
     address->setText(AppSettings::proxyAddress());
     port->setValue(AppSettings::proxyPort());
+    const QNetworkProxy::ProxyType proxyType = AppSettings::proxyType();
+    proxyTypeHTTP->setChecked(proxyType != QNetworkProxy::Socks5Proxy); // we enable QNetworkProxy::HttpProxy by default unless we have QNetworkProxy::Socks5Proxy
+    proxyTypeSOCKS5->setChecked(proxyType == QNetworkProxy::Socks5Proxy);
+    username->setText(AppSettings::proxyUsername());
+    password->setText(AppSettings::proxyPassword());
     directConnection->setChecked(AppSettings::isDirectConnection());
     proxyWidget->setDisabled(directConnection->isChecked());
 }
@@ -45,6 +50,9 @@ void SettingsDialog::saveDialogData()
     // serialize dialog data
     AppSettings::setProxyAddress(address->text());
     AppSettings::setProxyPort(port->value());
+    AppSettings::setProxyType(proxyTypeHTTP->isChecked() ? QNetworkProxy::HttpProxy : proxyTypeSOCKS5->isChecked() ? QNetworkProxy::Socks5Proxy : QNetworkProxy::DefaultProxy);
+    AppSettings::setProxyUsername(username->text());
+    AppSettings::setProxyPassword(password->text());
     AppSettings::setDirectConnection(directConnection->isChecked());
 }
 
index 05829f6e113f1cb5c5e93f04147021ed8a1263f4..7fa6da6a16aec67aaae8c135da4d6042e521f597 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>500</width>
-    <height>152</height>
+    <height>168</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -29,7 +29,7 @@
    <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Proxy Settings</string>
+      <string>Proxy settings</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
       </item>
       <item>
        <widget class="QFrame" name="proxyWidget">
-        <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <layout class="QVBoxLayout" name="verticalLayout_3">
          <item>
-          <widget class="QLabel" name="label">
-           <property name="text">
-            <string>Address: </string>
-           </property>
-          </widget>
+          <layout class="QHBoxLayout" name="horizontalLayout">
+           <item>
+            <widget class="QLabel" name="label">
+             <property name="text">
+              <string>Address: </string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="address"/>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_2">
+             <property name="text">
+              <string>Port:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QSpinBox" name="port">
+             <property name="alignment">
+              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+             </property>
+             <property name="minimum">
+              <number>1</number>
+             </property>
+             <property name="maximum">
+              <number>65535</number>
+             </property>
+             <property name="value">
+              <number>8080</number>
+             </property>
+            </widget>
+           </item>
+          </layout>
          </item>
          <item>
-          <widget class="QLineEdit" name="address"/>
-         </item>
-         <item>
-          <widget class="QLabel" name="label_2">
-           <property name="text">
-            <string>Port:</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="port">
-           <property name="maximum">
-            <number>9999</number>
-           </property>
-           <property name="value">
-            <number>8080</number>
-           </property>
-          </widget>
+          <layout class="QHBoxLayout" name="horizontalLayout_2">
+           <item>
+            <widget class="QLabel" name="label_3">
+             <property name="text">
+              <string>Proxy type:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="proxyTypeHTTP">
+             <property name="text">
+              <string>HTTP proxy</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="proxyTypeSOCKS5">
+             <property name="text">
+              <string>SOCKS5 proxy</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_3">
+            <item>
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Optional: Username:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLineEdit" name="username">
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="label_5">
+              <property name="text">
+               <string>Password:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLineEdit" name="password">
+              <property name="echoMode">
+               <enum>QLineEdit::Password</enum>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
         </layout>
        </widget>
       </item>
index 23a36b988c90d08ee3dc8d01162cc124d7118a94..61e62dc8d0a4546e098dc09bd1b14b66ffbb1039 100644 (file)
@@ -50,7 +50,7 @@ void UrlInputDialog::openFileClicked()
 
 void UrlInputDialog::textChanged(const QString& text)
 {
-    buttons->button(QDialogButtonBox::StandardButton::Open)->setEnabled(!text.isEmpty());
+    buttons->button(QDialogButtonBox::Open)->setEnabled(!text.isEmpty());
 }
 
 void UrlInputDialog::acceptClicked()
index 30f569a947d2afe0fd905f51b36d44d08a14764d..fbdfb699e202cfc5b07fed524294a128c84aab47 100644 (file)
 #include <QDebug>
 #include <stdexcept>
 
-class OrmException : public std::runtime_error
+class OrmException: public std::runtime_error
 {
 public:
     OrmException(const QString& text) : std::runtime_error(text.toStdString()), mText(text) {}
-    virtual ~OrmException(){}
+    virtual ~OrmException() throw() {}
     virtual const QString& text() const { return mText; }
 private:
     QString mText;
@@ -43,14 +43,14 @@ class OrmNoObjectException : public OrmException
 {
 public:
     OrmNoObjectException() : OrmException("SQL query expects one record but found none."){}
-    ~OrmNoObjectException(){}
+    ~OrmNoObjectException() throw() {}
 };
 
 class OrmSqlException : public OrmException
 {
 public:
     OrmSqlException(const QString& text) : OrmException( QString("Sql error: ") + text ) {}
-    ~OrmSqlException(){}
+    ~OrmSqlException() throw() {}
 };
 
 template <typename T>
index bba8626c53313b98963cd1782a6c66c2869b1cf2..6f5e5086c68788a975372c8afdeb93fc48eaa099 100644 (file)
@@ -27,6 +27,7 @@
 #include "../gui/errormessage.h"
 
 #include <QDebug>
+#include <stdexcept>
 
 ScheduleXmlParser::ScheduleXmlParser(SqlEngine* sqlEngine, QObject *aParent): QObject(aParent),sqlEngine(sqlEngine) {
 }
index 5a5c09bfd4b91265ff73e06b102c34e694964b74..c156476772f95c56c5ed7ecf11047d4e9e8dcd77 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <QDebug>
 
-SqlEngine::SqlEngine(QObject *aParent): QObject(aParent) {
+SqlEngine::SqlEngine(QObject *aParent): QObject(aParent), DATE_FORMAT("yyyy-MM-dd"), TIME_FORMAT("hh:mm") {
 #if QT_VERSION >= 0x050000
     QDir dbPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
 #else
index 68d0679c1daa07725e8123e14f519f3d0208e123..71c7777d762b747d1a9b951d6c6281c1fc0a6bf3 100644 (file)
@@ -28,8 +28,8 @@
 class SqlEngine : public QObject {
     Q_OBJECT
     public:
-        const QString DATE_FORMAT = "yyyy-MM-dd";
-        const QString TIME_FORMAT = "hh:mm";
+        const QString DATE_FORMAT; // "yyyy-MM-dd"
+        const QString TIME_FORMAT; // "hh:mm"
 
         QString dbFilename; ///< database filename including path
         QSqlDatabase db; ///< this may be private one day...
@@ -85,9 +85,9 @@ class SqlEngine : public QObject {
 
 class TransactionRaii {
     SqlEngine& sqlEngine;
-    bool committed = false;
+    bool committed;
 public:
-    TransactionRaii(SqlEngine& sqlEngine): sqlEngine(sqlEngine) {
+    TransactionRaii(SqlEngine& sqlEngine): sqlEngine(sqlEngine), committed(false) {
         sqlEngine.beginTransaction();
     }