half baked auto update (won't affect compile anyway)
update wscript, fix typos in c and mm files
Change-Id: I5eab74662c53d39cd91d621b20c0506da019c09b
diff --git a/gui/chronosharegui.cpp b/gui/chronosharegui.cpp
index cbcafe2..d37b985 100644
--- a/gui/chronosharegui.cpp
+++ b/gui/chronosharegui.cpp
@@ -41,6 +41,9 @@
#ifdef ADHOC_SUPPORTED
, m_executor (1)
#endif
+#ifdef SPARKLE_SUPPORTED
+ , m_autoUpdate(0)
+#endif
{
setWindowTitle("Settings");
@@ -147,6 +150,9 @@
#ifdef ADHOC_SUPPORTED
delete m_wifiAction;
#endif
+#ifdef SPARKLE_SUPPORTED
+ delete m_autoUpdate;
+#endif
delete m_openFolder;
delete m_viewSettings;
delete m_changeFolder;
@@ -208,6 +214,11 @@
connect (m_wifiAction, SIGNAL (toggled(bool)), this, SLOT(onAdHocChange(bool)));
#endif
+#ifdef SPARKLE_SUPPORTED
+ m_autoUpdate = new QAction (tr("Check For Updates"), this);
+ connect (m_autoUpdate, SIGNAL(triggered()), this, SLOT(onCheckForUpdates()));
+#endif
+
// create the "quit program" action
m_quitProgram = new QAction(tr("&Quit"), this);
connect(m_quitProgram, SIGNAL(triggered()), qApp, SLOT(quit()));
@@ -279,6 +290,14 @@
#endif
}
+#ifdef SPARKLE_SUPPORTED
+void
+ChronoShareGui::onCheckForUpdates()
+{
+ m_autoUpdate->checkForUpdates();
+}
+#endif
+
void ChronoShareGui::setIcon()
{
// set the icon image
diff --git a/gui/chronosharegui.h b/gui/chronosharegui.h
index eba4c12..8403a66 100644
--- a/gui/chronosharegui.h
+++ b/gui/chronosharegui.h
@@ -25,6 +25,11 @@
#include "adhoc.h"
+#if __APPLE__ && HAVE_SPARKLE
+#define SPARKLE_SUPPORTED 1
+#include "auto-update.h"
+#endif
+
#include <QtGui>
#include <QWidget>
#include <QSystemTrayIcon>
@@ -70,7 +75,9 @@
// click on adhoc button
void onAdHocChange (bool state); // cannot be protected with #ifdef. otherwise something fishy with QT
-
+#ifdef SPARKLE_SUPPORTED
+ void onCheckForUpdates();
+#endif
private:
// create actions that result from clicking a menu option
@@ -109,6 +116,7 @@
QAction* m_viewSettings; // chronoShare settings
QAction* m_changeFolder; // change the shared folder action
QAction* m_quitProgram; // quit program action
+ QAction *m_checkForUpdates;
QAction *m_wifiAction;
@@ -133,6 +141,9 @@
Executor m_executor;
#endif
+#ifdef SPARKLE_SUPPORTED
+ AutoUpdate *m_autoUpdate;
+#endif
// QString m_settingsFilePath; // settings file path
// QString m_settings;
};