# # # add_file "guitone/src/util/CocoaUtil.h" # content [023ccba6801d260542c9311a01e3ca39e20b69c5] # # add_file "guitone/src/util/CocoaUtil.mm" # content [122f1726e6d7f1289c48a51074063ebb753bf26e] # # patch "README" # from [67ea13ff8c14d180e244d04c5967b29422bb7bda] # to [d6f2ff74aa5555af54f944c6bd9327a4aa0dab25] # # patch "guitone/guitone.pro" # from [159ee4bd8f31bbd72ad80397de9a45054bc76aa5] # to [385a99b8d611c6c3eece333dd1e8add6438d9f33] # # patch "guitone/res/forms/main_window.ui" # from [e4f7de13795e9cb65247203bb4d62da67995ba14] # to [47bc6a1094496073f1befd61a20d5b2fed5f5f39] # # patch "guitone/res/osx/README" # from [5bbab9346e0334662f457cdc79314983fa48a621] # to [6fd3c254ceb688d59ae6ab8e35093f1071c8739d] # # patch "guitone/src/Guitone.cpp" # from [429342eb3c190c0350629dfa1d822848a100e3b3] # to [6913449e1cc80aaedc4f4b70d4e49db43f4faa85] # # patch "guitone/src/view/MainWindow.cpp" # from [3d713da4f0ef02fb7a34fd7839cfc67d7b4a1876] # to [e80f15193271437547c136a59a25e9d29bc37f40] # # patch "guitone/src/view/MainWindow.h" # from [1d9646474da2a667ec9b56ce3f30a8fc933b6969] # to [b662cc90c17734984e6a62fa323d2168def713ba] # # patch "guitone/src/view/dialogs/About.cpp" # from [e879667edfb7c92c92ed11e36ee1506aa6dea660] # to [7aa243f1a142f1d2c27fc09fe5361a7675da596c] # # patch "guitone/src/view/dialogs/About.h" # from [c07a76d51189ad026cf5336fbfe91d223b21156d] # to [8787b762fe83ed617d364e18ff0de7337fd233d4] # ============================================================ --- guitone/src/util/CocoaUtil.h 023ccba6801d260542c9311a01e3ca39e20b69c5 +++ guitone/src/util/CocoaUtil.h 023ccba6801d260542c9311a01e3ca39e20b69c5 @@ -0,0 +1,19 @@ +/* + * taken from the Axel project (http://excalibur.inria.fr/), + * licensed under GPL + */ +#ifndef COCOAUTIL_H +#define COCOAUTIL_H + +#include + +class SUUpdater; + +namespace CocoaUtil +{ + void initialize(); + void checkForUpdates(); +}; + +#endif + ============================================================ --- guitone/src/util/CocoaUtil.mm 122f1726e6d7f1289c48a51074063ebb753bf26e +++ guitone/src/util/CocoaUtil.mm 122f1726e6d7f1289c48a51074063ebb753bf26e @@ -0,0 +1,20 @@ +/* + * taken from the Axel project (http://excalibur.inria.fr/), + * licensed under GPL + */ +#include +#include +#include "CocoaUtil.h" + +void CocoaUtil::initialize() +{ + NSApplicationLoad(); + SUUpdater * updater = [SUUpdater alloc]; + [updater checkForUpdatesInBackground]; +} + +void CocoaUtil::checkForUpdates() +{ + SUUpdater * updater = [SUUpdater alloc]; + [updater checkForUpdates:nil]; +} ============================================================ --- README 67ea13ff8c14d180e244d04c5967b29422bb7bda +++ README d6f2ff74aa5555af54f944c6bd9327a4aa0dab25 @@ -16,14 +16,18 @@ $ cd /path/to/guitone $ ./build.sh -On MacOS X you can build guitone also with Xcode. For this to work you should -have a recent version of XCode installed (>= 2.3 because of gcc) which is -usually found somewhere on the installation DVD. Then you can create a XCode +On Mac OS X you need the Sparkle framework (http://sparkle.andymatuschak.org/) +installed to build guitone. Make sure it does reside outside +/System/Library/Frameworks if you plan to build with the univsersal SDK +(the default). +You can also build guitone with Xcode on OSX. For this to work you should +have a recent version of Xcode installed (>= 2.3 because of gcc bugs) which is +usually found somewhere on the installation DVD. Then you can create a Xcode project file with $ qmake -spec macx-xcode -and open this with XCode. If you need to tweak settings (i.e. architecture) +and open this with Xcode. If you need to tweak settings (i.e. architecture) in the Qt project file (guitone.pro), remember to redo this step. The created binary can be found in guitone/bin. ============================================================ --- guitone/guitone.pro 159ee4bd8f31bbd72ad80397de9a45054bc76aa5 +++ guitone/guitone.pro 385a99b8d611c6c3eece333dd1e8add6438d9f33 @@ -1,12 +1,13 @@ # # Common configuration # -TEMPLATE = app -TARGET = guitone -CONFIG += qt debug +GUITONE_VERSION = "0.6-dev" +TEMPLATE = app +TARGET = guitone +CONFIG += qt debug +DEFINES += GUITONE_VERSION=\\\"$${GUITONE_VERSION}\\\" - INCLUDEPATH = src/ \ src/view \ src/view/dialogs \ @@ -148,7 +149,8 @@ win32:LIBS += shell32.lib Advapi32.lib win32:LIBS += shell32.lib Advapi32.lib -# Libs for static build on windows, I don't know if I can test for static. I comment that in and out atm. +# Libs for static build on windows, I don't know if I can test for static. +# I comment that in and out atm. # win32:LIBS += gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib uuid.lib user32.lib advapi32.lib msimg32.lib shell32.lib macx | unix { @@ -160,11 +162,22 @@ macx { # macx { - # copy i18n resources into the final app bundle - QMAKE_POST_LINK = cp -R res/osx/Resources bin/guitone.app/Contents + # add sources for Sparkle + HEADERS += src/util/CocoaUtil.h + OBJECTIVE_SOURCES += src/util/CocoaUtil.mm + + # add the Sparkle framework + QMAKE_LFLAGS += -framework Sparkle + + # osx application info file + QMAKE_INFO_PLIST = res/osx/Info.plist - # osx application icon - ICON = res/osx/guitone.icns + # copy i18n resources into the final app bundle and + # put the current version number into Info.plist + QMAKE_POST_LINK = cp -R res/osx/Resources bin/guitone.app/Contents && \ + cat bin/guitone.app/Contents/Info.plist | \ + sed -e s/@@version@@/$${GUITONE_VERSION}/g \ + > bin/guitone.app/Contents/Info.plist # add x86, ppc or both to build for either or both platforms (universal)^ CONFIG += x86 #ppc ============================================================ --- guitone/res/forms/main_window.ui e4f7de13795e9cb65247203bb4d62da67995ba14 +++ guitone/res/forms/main_window.ui 47bc6a1094496073f1befd61a20d5b2fed5f5f39 @@ -123,7 +123,7 @@ or File > Open Database for a database r 0 0 713 - 24 + 22 @@ -159,6 +159,28 @@ or File > Open Database for a database r + + + Window + + + + + + + Database + + + + + + + + Workspace + + + + File @@ -184,31 +206,10 @@ or File > Open Database for a database r + - - - Window - - - - - - - Database - - - - - - - - Workspace - - - - @@ -238,7 +239,7 @@ or File > Open Database for a database r - Preferences.... + Preferences... Ctrl+P @@ -467,17 +468,22 @@ or File > Open Database for a database r Ctrl+C + + + Check for updates + + - InventoryView + AttributesView QTreeView -
../InventoryView.h
+
../AttributesView.h
- AttributesView + InventoryView QTreeView -
../AttributesView.h
+
../InventoryView.h
Splitter ============================================================ --- guitone/res/osx/README 5bbab9346e0334662f457cdc79314983fa48a621 +++ guitone/res/osx/README 6fd3c254ceb688d59ae6ab8e35093f1071c8739d @@ -8,3 +8,6 @@ guitone.icns guitone.icns OSX application icon +Info.plist + Application info template which is later copied into the + created bundle ============================================================ --- guitone/src/Guitone.cpp 429342eb3c190c0350629dfa1d822848a100e3b3 +++ guitone/src/Guitone.cpp 6913449e1cc80aaedc4f4b70d4e49db43f4faa85 @@ -24,6 +24,10 @@ #include "Preferences.h" #include "Settings.h" +#ifdef Q_WS_MAC +#include "CocoaUtil.h" +#endif + #include #include #include @@ -39,6 +43,10 @@ bool Guitone::init() bool Guitone::init() { +#ifdef Q_WS_MAC + CocoaUtil::initialize(); +#endif + MainWindow * mainWnd = addWindow(); if (!addMonotoneInstance(mainWnd)) { ============================================================ --- guitone/src/view/MainWindow.cpp 3d713da4f0ef02fb7a34fd7839cfc67d7b4a1876 +++ guitone/src/view/MainWindow.cpp e80f15193271437547c136a59a25e9d29bc37f40 @@ -30,6 +30,7 @@ #include "UpdateWorkspace.h" #include "CommitRevision.h" #include "CheckoutRevision.h" +#include "Platform.h" #include "Preferences.h" #include "KeyManagement.h" #include "About.h" @@ -37,6 +38,10 @@ #include "ChangesetBrowser.h" #include "Guitone.h" +#ifdef Q_WS_MAC +#include "CocoaUtil.h" +#endif + #include #include #include @@ -604,6 +609,15 @@ void MainWindow::on_actionAbout_Qt_trigg qApp->aboutQt(); } +void MainWindow::on_actionCheck_for_updates_triggered() +{ +#ifdef Q_WS_MAC + CocoaUtil::checkForUpdates(); +#else + Platform::openFile(this, "http://guitone.thomaskeller.biz"); +#endif +} + void MainWindow::invalidWorkspaceFormat(const QString & error) { QString workspacePath = MTN(this)->getNormalizedWorkspacePath(); ============================================================ --- guitone/src/view/MainWindow.h 1d9646474da2a667ec9b56ce3f30a8fc933b6969 +++ guitone/src/view/MainWindow.h b662cc90c17734984e6a62fa323d2168def713ba @@ -73,6 +73,7 @@ private slots: void on_actionAbout_Qt_triggered(); void on_actionChangeset_browser_triggered(); void on_actionBring_all_to_front_triggered(); + void on_actionCheck_for_updates_triggered(); void openRecentWorkspace(); void openRecentDatabase(); ============================================================ --- guitone/src/view/dialogs/About.cpp e879667edfb7c92c92ed11e36ee1506aa6dea660 +++ guitone/src/view/dialogs/About.cpp 7aa243f1a142f1d2c27fc09fe5361a7675da596c @@ -20,16 +20,13 @@ #include "About.h" -const int About::VersionMajor = 0; -const int About::VersionMinor = 5; - -About::About(QWidget* parent) : Dialog(parent) +About::About(QWidget * parent) : Dialog(parent) { setupUi(this); Dialog::init(); aboutText->setText( - tr("Version %1.%2").arg(VersionMajor).arg(VersionMinor) + + tr("Version %1").arg(GUITONE_VERSION) + tr("

Authors: " "Thomas Keller, " "Ingo Maindorfer and " ============================================================ --- guitone/src/view/dialogs/About.h c07a76d51189ad026cf5336fbfe91d223b21156d +++ guitone/src/view/dialogs/About.h 8787b762fe83ed617d364e18ff0de7337fd233d4 @@ -29,9 +29,6 @@ public: Q_OBJECT public: - static const int VersionMajor; - static const int VersionMinor; - About(QWidget*); ~About(); };