From fa00547507566a646db2baffea114104b1ffd567 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 5 Feb 2013 00:36:25 -0500 Subject: First version of automatic updates for Mac diff --git a/appcast-snapshots.xml.in b/appcast-snapshots.xml.in new file mode 100644 index 0000000..3103565 --- /dev/null +++ b/appcast-snapshots.xml.in @@ -0,0 +1,18 @@ + + + + OpenSCAD Development Snapshots + http://openscad.org/appcast-snapshots.xml + en + + OpenSCAD @VERSION@ + @VERSIONDATE@ + https://raw.github.com/openscad/openscad/master/RELEASE_NOTES + + + + diff --git a/appcast.xml.in b/appcast.xml.in new file mode 100644 index 0000000..e375fae --- /dev/null +++ b/appcast.xml.in @@ -0,0 +1,18 @@ + + + + OpenSCAD Updates + http://openscad.org/appcast.xml + en + + OpenSCAD @VERSION@ + @VERSIONDATE@ + https://raw.github.com/openscad/openscad/openscad-@VERSION@/RELEASE_NOTES + + + + diff --git a/doc/release-checklist.txt b/doc/release-checklist.txt index c51c919..db5b696 100644 --- a/doc/release-checklist.txt +++ b/doc/release-checklist.txt @@ -44,7 +44,8 @@ o Notify package managers Build and Upload Release Binaries --------------------------------- -$ export VERSION= +$ export VERSIONDATE= +$ export VERSION= # If development snapshot, you don't need version is the same as VERSIONDATE $ tar xzf openscad-$VERSION.src.tar.gz $ cd openscad-$VERSION diff --git a/icons/prefsUpdate.png b/icons/prefsUpdate.png new file mode 100644 index 0000000..a7dc02e Binary files /dev/null and b/icons/prefsUpdate.png differ diff --git a/mjau.gdb b/mjau.gdb index 7b8e029..6d39411 100644 --- a/mjau.gdb +++ b/mjau.gdb @@ -1 +1,2 @@ set environment DYLD_LIBRARY_PATH=/Users/kintel/code/OpenSCAD/libraries/install/lib +set environment DYLD_FRAMEWORK_PATH=/Users/kintel/code/OpenSCAD/libraries/install/lib diff --git a/openscad.pro b/openscad.pro index a7088ec..c624b2e 100644 --- a/openscad.pro +++ b/openscad.pro @@ -68,7 +68,7 @@ macx { APP_RESOURCES.path = Contents/Resources APP_RESOURCES.files = OpenSCAD.sdef QMAKE_BUNDLE_DATA += APP_RESOURCES - LIBS += -framework Carbon + LIBS += -framework Cocoa -framework Sparkle } else { TARGET = openscad @@ -320,8 +320,14 @@ SOURCES += src/cgalutils.cc \ macx { HEADERS += src/AppleEvents.h \ - src/EventFilter.h - SOURCES += src/AppleEvents.cc + src/EventFilter.h \ + src/AutoUpdater.h \ + src/SparkleAutoUpdater.h \ + src/CocoaInitializer.h + SOURCES += src/AppleEvents.cc \ + src/AutoUpdater.cc + OBJECTIVE_SOURCES += src/SparkleAutoUpdater.mm \ + src/CocoaInitializer.mm } isEmpty(PREFIX):PREFIX = /usr/local diff --git a/openscad.qrc b/openscad.qrc index 84745e9..28b6a72 100644 --- a/openscad.qrc +++ b/openscad.qrc @@ -4,6 +4,7 @@ icons/prefsAdvanced.png icons/prefs3DView.png icons/prefsEditor.png + icons/prefsUpdate.png icons/flattr.png src/AboutDialog.html diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh index e22e5bd..f9c693b 100755 --- a/scripts/publish-macosx.sh +++ b/scripts/publish-macosx.sh @@ -1,10 +1,13 @@ #!/bin/sh -# NB! To build a release build, the VERSION environment variable needs to be set. +# NB! To build a release build, the VERSION and VERSIONDATE environment variables needs to be set. # See doc/release-checklist.txt +if test -z "$VERSIONDATE"; then + VERSIONDATE=`date "+%Y.%m.%d"` +fi if test -z "$VERSION"; then - VERSION=`date "+%Y.%m.%d"` + VERSION=$VERSIONDATE COMMIT=-c SNAPSHOT=true fi @@ -18,21 +21,33 @@ export OPENSCAD_LIBRARIES=$PWD/../libraries/install # Make sure that the correct Qt tools are used export PATH=$OPENSCAD_LIBRARIES/bin:$PATH -`dirname $0`/release-common.sh -v $VERSION $COMMIT -if [[ $? != 0 ]]; then - exit 1 -fi +#`dirname $0`/release-common.sh -v $VERSION $COMMIT +#if [[ $? != 0 ]]; then +# exit 1 +#fi echo "Sanity check of the app bundle..." -`dirname $0`/macosx-sanity-check.py OpenSCAD.app/Contents/MacOS/OpenSCAD -if [[ $? != 0 ]]; then - exit 1 +#`dirname $0`/macosx-sanity-check.py OpenSCAD.app/Contents/MacOS/OpenSCAD +#if [[ $? != 0 ]]; then +# exit 1 +#fi + +if [[ $VERSION == $VERSIONDATE ]]; then + APPCASTFILE=appcast-snapshots.xml +else + APPCASTFILE=appcast.xml +fi +echo "Creating appcast $APPCASTFILE..." +sed -e "s,@VERSION@,$VERSION,g" -e "s,@VERSIONDATE@,$VERSIONDATE,g" -e "s,@FILESIZE@,$(stat -f "%z" OpenSCAD-$VERSION.dmg),g" $APPCASTFILE.in > $APPCASTFILE +cp $APPCASTFILE ../openscad.github.com +if [[ $VERSION == $VERSIONDATE ]]; then + cp $APPCASTFILE ../openscad.github.com/appcast-snapshots.xml fi echo "Uploading..." -LABELS=OpSys-OSX,Type-Executable -if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi -`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS +#LABELS=OpSys-OSX,Type-Executable +#if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi +#`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS # Update snapshot filename on wab page -`dirname $0`/update-web.sh OpenSCAD-$VERSION.dmg +#`dirname $0`/update-web.sh OpenSCAD-$VERSION.dmg diff --git a/scripts/release-common.sh b/scripts/release-common.sh index de14cb1..a30d43a 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -9,10 +9,12 @@ # # Usage: release-common.sh [-v ] [-c] [-x32] # -v Version string (e.g. -v 2010.01) +# -d Version date (e.g. -d 2010.01.23) # -c Build with commit info # -mingw32 Cross-compile for win32 using MXE # -# If no version string is given, todays date will be used (YYYY-MM-DD) +# If no version string or version date is given, todays date will be used (YYYY-MM-DD) +# If only verion date is given, it will be used also as version string. # If no make target is given, release will be used on Windows, none one Mac OS X # # The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT @@ -23,7 +25,7 @@ printUsage() { - echo "Usage: $0 -v -c -mingw32 + echo "Usage: $0 -v -d -c -mingw32 echo echo " Example: $0 -v 2010.01 } @@ -59,16 +61,20 @@ else exit fi -while getopts 'v:c' c +while getopts 'v:d:c' c do case $c in v) VERSION=$OPTARG;; + d) VERSIONDATE=$OPTARG;; c) OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"` esac done +if test -z "$VERSIONDATE"; then + VERSIONDATE=`date "+%Y.%m.%d"` +fi if test -z "$VERSION"; then - VERSION=`date "+%Y.%m.%d"` + VERSION=$VERSIONDATE fi @@ -102,7 +108,7 @@ if [ -d .git ]; then git submodule update fi -echo "Building openscad-$VERSION $CONFIGURATION..." +echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIGURATION..." case $OS in LINUX|MACOSX) @@ -230,6 +236,7 @@ echo "Creating archive.." case $OS in MACOSX) + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSIONDATE" OpenSCAD.app/Contents/Info.plist macdeployqt OpenSCAD.app -dmg -no-strip mv OpenSCAD.dmg OpenSCAD-$VERSION.dmg hdiutil internet-enable -yes -quiet OpenSCAD-$VERSION.dmg diff --git a/setenv_mjau.sh b/setenv_mjau.sh index 943ae6b..7976c60 100644 --- a/setenv_mjau.sh +++ b/setenv_mjau.sh @@ -1,5 +1,6 @@ export OPENSCAD_LIBRARIES=$PWD/../libraries/install export DYLD_LIBRARY_PATH=$OPENSCAD_LIBRARIES/lib +export DYLD_FRAMEWORK_PATH=$OPENSCAD_LIBRARIES/lib export QMAKESPEC=macx-g++ #export OPENCSGDIR=$PWD/../OpenCSG-1.3.0 diff --git a/src/AutoUpdater.cc b/src/AutoUpdater.cc new file mode 100644 index 0000000..b64cc82 --- /dev/null +++ b/src/AutoUpdater.cc @@ -0,0 +1,3 @@ +#include "AutoUpdater.h" + +AutoUpdater *AutoUpdater::updater_instance = NULL; diff --git a/src/AutoUpdater.h b/src/AutoUpdater.h new file mode 100644 index 0000000..18527c8 --- /dev/null +++ b/src/AutoUpdater.h @@ -0,0 +1,25 @@ +#ifndef AUTOUPDATER_H_ +#define AUTOUPDATER_H_ + +#include + +class AutoUpdater +{ +public: + virtual ~AutoUpdater() {} + + virtual void checkForUpdates() = 0; + virtual void setAutomaticallyChecksForUpdates(bool on) = 0; + virtual bool automaticallyChecksForUpdates() = 0; + virtual void setEnableSnapshots(bool on) = 0; + virtual bool enableSnapshots() = 0; + virtual QString lastUpdateCheckDate() = 0; + + static AutoUpdater *updater() { return updater_instance; } + static void setUpdater(AutoUpdater *updater) { updater_instance = updater; } + +protected: + static AutoUpdater *updater_instance; +}; + +#endif diff --git a/src/MainWindow.h b/src/MainWindow.h index a4835c2..033ef49 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -91,6 +91,7 @@ private: class QMessageBox *openglbox; private slots: + void actionUpdateCheck(); void actionNew(); void actionOpen(); void actionOpenRecent(); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index f71ac96..4b1639b 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -223,6 +223,7 @@ + @@ -611,6 +612,9 @@ + + true + About @@ -676,6 +680,14 @@ Library info + + + false + + + Check for Update.. + + diff --git a/src/Preferences.cc b/src/Preferences.cc index ec66094..fe7462a 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -29,7 +29,9 @@ #include #include #include +#include #include "PolySetCache.h" +#include "AutoUpdater.h" #ifdef ENABLE_CGAL #include "CGALCache.h" #endif @@ -88,6 +90,7 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) QActionGroup *group = new QActionGroup(this); group->addAction(prefsAction3DView); group->addAction(prefsActionEditor); + group->addAction(prefsActionUpdate); group->addAction(prefsActionAdvanced); connect(group, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered(QAction*))); @@ -155,6 +158,9 @@ Preferences::actionTriggered(QAction *action) else if (action == this->prefsActionEditor) { this->stackedWidget->setCurrentWidget(this->pageEditor); } + else if (action == this->prefsActionUpdate) { + this->stackedWidget->setCurrentWidget(this->pageUpdate); + } else if (action == this->prefsActionAdvanced) { this->stackedWidget->setCurrentWidget(this->pageAdvanced); } @@ -186,6 +192,27 @@ void Preferences::on_fontSize_editTextChanged(const QString &size) emit fontChanged(getValue("editor/fontfamily").toString(), intsize); } +void Preferences::on_updateCheckBox_toggled(bool on) +{ + if (AutoUpdater *updater =AutoUpdater::updater()) { + updater->setAutomaticallyChecksForUpdates(on); + } +} + +void Preferences::on_snapshotCheckBox_toggled(bool on) +{ + if (AutoUpdater *updater =AutoUpdater::updater()) { + updater->setEnableSnapshots(on); + } +} + +void Preferences::on_checkNowButton_clicked() +{ + if (AutoUpdater *updater =AutoUpdater::updater()) { + updater->checkForUpdates(); + } +} + void Preferences::on_openCSGWarningBox_toggled(bool state) { @@ -289,6 +316,12 @@ void Preferences::updateGUI() this->fontSize->setEditText(fontsize); } + if (AutoUpdater *updater = AutoUpdater::updater()) { + this->updateCheckBox->setChecked(updater->automaticallyChecksForUpdates()); + this->snapshotCheckBox->setChecked(updater->enableSnapshots()); + this->lastCheckedLabel->setText(updater->lastUpdateCheckDate()); + } + this->openCSGWarningBox->setChecked(getValue("advanced/opencsg_show_warning").toBool()); this->enableOpenCSGBox->setChecked(getValue("advanced/enable_opencsg_opengl1x").toBool()); this->cgalCacheSizeEdit->setText(getValue("advanced/cgalCacheSize").toString()); diff --git a/src/Preferences.h b/src/Preferences.h index 48e07b4..4656793 100644 --- a/src/Preferences.h +++ b/src/Preferences.h @@ -30,6 +30,9 @@ public slots: void on_polysetCacheSizeEdit_textChanged(const QString &); void on_opencsgLimitEdit_textChanged(const QString &); void on_forceGoldfeatherBox_toggled(bool); + void on_updateCheckBox_toggled(bool); + void on_snapshotCheckBox_toggled(bool); + void on_checkNowButton_clicked(); signals: void requestRedraw() const; diff --git a/src/Preferences.ui b/src/Preferences.ui index 9b4671a..d67db6a 100644 --- a/src/Preferences.ui +++ b/src/Preferences.ui @@ -6,10 +6,16 @@ 0 0 - 531 - 418 + 473 + 320 + + + 0 + 0 + + Preferences @@ -173,6 +179,150 @@ + + + + + + + + + + Automatically check for updates + + + true + + + + + + + Include development snapshots + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Check Now + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + 11 + + + + Last checked: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 89 + + + + + + @@ -227,9 +377,6 @@ - openCSGWarningBox - enableOpenCSGBox - forceGoldfeatherBox @@ -317,6 +464,7 @@ + @@ -355,6 +503,18 @@ Editor + + + true + + + + :/icons/prefsUpdate.png:/icons/prefsUpdate.png + + + Update + + diff --git a/src/SparkleAutoUpdater.h b/src/SparkleAutoUpdater.h new file mode 100644 index 0000000..786a190 --- /dev/null +++ b/src/SparkleAutoUpdater.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 Remko Troncon. BSD license + * Copyright (C) 2013 Marius Kintel. BSD license + */ +#ifndef SPARKLEAUTOUPDATER_H +#define SPARKLEAUTOUPDATER_H + +#include + +#include "AutoUpdater.h" + +class SparkleAutoUpdater : public AutoUpdater +{ +public: + SparkleAutoUpdater(); + ~SparkleAutoUpdater(); + + void checkForUpdates(); + void setAutomaticallyChecksForUpdates(bool on); + bool automaticallyChecksForUpdates(); + void setEnableSnapshots(bool on); + bool enableSnapshots(); + QString lastUpdateCheckDate(); + +private: + void updateFeed(); + + class Private; + Private *d; +}; + +#endif diff --git a/src/SparkleAutoUpdater.mm b/src/SparkleAutoUpdater.mm new file mode 100644 index 0000000..5176e80 --- /dev/null +++ b/src/SparkleAutoUpdater.mm @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 Remko Troncon. BSD license + * Copyright (C) 2013 Marius Kintel. BSD license + */ + +#include "SparkleAutoUpdater.h" + +#include +#include + +NSString *const SUEnableSnapshotsKey = @"SUEnableSnapshots"; + +class SparkleAutoUpdater::Private +{ +public: + SUUpdater* updater; +}; + +SparkleAutoUpdater::SparkleAutoUpdater() +{ + d = new Private; + + d->updater = [SUUpdater sharedUpdater]; + [d->updater retain]; + + updateFeed(); +} + +SparkleAutoUpdater::~SparkleAutoUpdater() +{ + [d->updater release]; + delete d; +} + +void SparkleAutoUpdater::checkForUpdates() +{ + [d->updater checkForUpdatesInBackground]; +} + +void SparkleAutoUpdater::setAutomaticallyChecksForUpdates(bool on) +{ + [d->updater setAutomaticallyChecksForUpdates:on]; +} + +bool SparkleAutoUpdater::automaticallyChecksForUpdates() +{ + return [d->updater automaticallyChecksForUpdates]; +} + +void SparkleAutoUpdater::setEnableSnapshots(bool on) +{ + [[NSUserDefaults standardUserDefaults] setBool:on forKey:SUEnableSnapshotsKey]; + updateFeed(); +} + +bool SparkleAutoUpdater::enableSnapshots() +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:SUEnableSnapshotsKey]; +} + +QString SparkleAutoUpdater::lastUpdateCheckDate() +{ + NSString *datestring = [NSString stringWithFormat:@"Last checked: %@", + [d->updater lastUpdateCheckDate]]; + return QString::fromUtf8([datestring UTF8String]); +} + +void SparkleAutoUpdater::updateFeed() +{ + NSString *urlstring = [NSString stringWithFormat:@"http://openscad.org/appcast%@.xml", enableSnapshots() ? @"-snapshots" : @""]; + [d->updater setFeedURL:[NSURL URLWithString:urlstring]]; +} diff --git a/src/mainwin.cc b/src/mainwin.cc index 17b9ef7..a05a4d4 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -48,6 +48,7 @@ #include "ProgressWidget.h" #include "ThrownTogetherRenderer.h" #include "csgtermnormalizer.h" +#include "AutoUpdater.h" #include #include @@ -205,6 +206,16 @@ MainWindow::MainWindow(const QString &filename) animate_panel->hide(); + // Application menu +#ifdef DEBUG + this->appActionUpdateCheck->setEnabled(false); +#else +#ifdef Q_OS_MAC + this->appActionUpdateCheck->setMenuRole(QAction::ApplicationSpecificRole); + this->appActionUpdateCheck->setEnabled(true); + connect(this->appActionUpdateCheck, SIGNAL(triggered()), this, SLOT(actionUpdateCheck())); +#endif +#endif // File menu connect(this->fileActionNew, SIGNAL(triggered()), this, SLOT(actionNew())); connect(this->fileActionOpen, SIGNAL(triggered()), this, SLOT(actionOpen())); @@ -781,6 +792,13 @@ void MainWindow::compileCSG(bool procevents) } } +void MainWindow::actionUpdateCheck() +{ + if (AutoUpdater *updater =AutoUpdater::updater()) { + updater->checkForUpdates(); + } +} + void MainWindow::actionNew() { #ifdef ENABLE_MDI diff --git a/src/openscad.cc b/src/openscad.cc index 880aa0d..e0b4a68 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -54,6 +54,7 @@ #ifdef Q_WS_MAC #include "EventFilter.h" #include "AppleEvents.h" +#include "SparkleAutoUpdater.h" #endif #include @@ -386,6 +387,14 @@ int main(int argc, char **argv) installAppleEventHandlers(); #endif +#ifndef DEBUG +#ifdef Q_WS_MAC + AutoUpdater *updater = new SparkleAutoUpdater; + AutoUpdater::setUpdater(updater); + if (updater->automaticallyChecksForUpdates()) updater->checkForUpdates(); +#endif +#endif + QString qfilename; if (filename) qfilename = QString::fromStdString(boosty::stringy(boosty::absolute(filename))); -- cgit v0.10.1 From 5d2bc53dbf11ffdc8ebb20943c48656e274c0aea Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 5 Feb 2013 00:36:35 -0500 Subject: cleanup diff --git a/doc/checklist-macosx.txt b/doc/checklist-macosx.txt deleted file mode 100644 index a72a8d3..0000000 --- a/doc/checklist-macosx.txt +++ /dev/null @@ -1,20 +0,0 @@ -NB! This is the Mac OS X deployment checklist. - See build-macosx.txt for how to build a development build of - OpenSCAD for your system only without manually compiling all - dependencies. - -o Macports: - sudo port install cmake ImageMagick - -o Qt4 - - Download and install the combined 32-bit and 64-bit build for 10.5-10.6 from here: - http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x - -o Build dependencies from source - - scripts/macosx-build-dependencies.sh - -o Build and Deploy OpenSCAD - -# Update VERSION in publish-macosx.sh - scripts/publish-macosx.sh -- cgit v0.10.1 From 9f31ebd65766cec0e640f2667c9c620419f5e928 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 5 Feb 2013 00:38:05 -0500 Subject: Reenable building - upload still disabled diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh index f9c693b..2fe85d4 100755 --- a/scripts/publish-macosx.sh +++ b/scripts/publish-macosx.sh @@ -21,16 +21,16 @@ export OPENSCAD_LIBRARIES=$PWD/../libraries/install # Make sure that the correct Qt tools are used export PATH=$OPENSCAD_LIBRARIES/bin:$PATH -#`dirname $0`/release-common.sh -v $VERSION $COMMIT -#if [[ $? != 0 ]]; then -# exit 1 -#fi +`dirname $0`/release-common.sh -v $VERSION $COMMIT +if [[ $? != 0 ]]; then + exit 1 +fi echo "Sanity check of the app bundle..." -#`dirname $0`/macosx-sanity-check.py OpenSCAD.app/Contents/MacOS/OpenSCAD -#if [[ $? != 0 ]]; then -# exit 1 -#fi +`dirname $0`/macosx-sanity-check.py OpenSCAD.app/Contents/MacOS/OpenSCAD +if [[ $? != 0 ]]; then + exit 1 +fi if [[ $VERSION == $VERSIONDATE ]]; then APPCASTFILE=appcast-snapshots.xml @@ -49,5 +49,5 @@ echo "Uploading..." #if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi #`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS -# Update snapshot filename on wab page +# Update snapshot filename on web page #`dirname $0`/update-web.sh OpenSCAD-$VERSION.dmg -- cgit v0.10.1 From 1a60a607b12c69d512ede6ce2babb61518cddd29 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 5 Feb 2013 01:18:43 -0500 Subject: Added CFShortVersionString diff --git a/Info.plist b/Info.plist index 66fc02d..0f7c9b5 100644 --- a/Info.plist +++ b/Info.plist @@ -12,6 +12,8 @@ OpenSCAD CFBundleIdentifier org.openscad.OpenSCAD + CFBundleShortVersionString + @SHORT_VERSION@ CFBundleDocumentTypes -- cgit v0.10.1 From 3c19224eb6bc29ae6f1dc6637b7238f538230f12 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 5 Feb 2013 01:19:12 -0500 Subject: Correctly add CFBundleVersion to Info.plist diff --git a/scripts/release-common.sh b/scripts/release-common.sh index a30d43a..abfdeb8 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -236,7 +236,7 @@ echo "Creating archive.." case $OS in MACOSX) - /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSIONDATE" OpenSCAD.app/Contents/Info.plist + /usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $VERSIONDATE" OpenSCAD.app/Contents/Info.plist macdeployqt OpenSCAD.app -dmg -no-strip mv OpenSCAD.dmg OpenSCAD-$VERSION.dmg hdiutil internet-enable -yes -quiet OpenSCAD-$VERSION.dmg -- cgit v0.10.1 From f7fd58de8aea0e2336e0c1216452254462203dde Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 6 Feb 2013 14:32:59 -0500 Subject: Fail on external non-system dependency diff --git a/scripts/macosx-sanity-check.py b/scripts/macosx-sanity-check.py index 3938d74..22c2af0 100755 --- a/scripts/macosx-sanity-check.py +++ b/scripts/macosx-sanity-check.py @@ -107,6 +107,9 @@ if __name__ == '__main__': deps = find_dependencies(dep) assert(deps) for d in deps: + if not re.match(executable_path, d): + print "Error: External dependency " + d + sys.exit(1) absfile = lookup_library(d) if absfile == None: print "Not found: " + d -- cgit v0.10.1 From c50fd1dc7d48203abb18a5b8ec59b38b901638cb Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 6 Feb 2013 15:08:22 -0500 Subject: Bug in previous commit: Check the absolute path, not the relative diff --git a/scripts/macosx-sanity-check.py b/scripts/macosx-sanity-check.py index 22c2af0..4927de9 100755 --- a/scripts/macosx-sanity-check.py +++ b/scripts/macosx-sanity-check.py @@ -107,10 +107,10 @@ if __name__ == '__main__': deps = find_dependencies(dep) assert(deps) for d in deps: - if not re.match(executable_path, d): + absfile = lookup_library(d) + if not re.match(executable_path, absfile): print "Error: External dependency " + d sys.exit(1) - absfile = lookup_library(d) if absfile == None: print "Not found: " + d print " ..required by " + str(processed[dep]) -- cgit v0.10.1 From 648b9a28bff5e5c1974fda4bde81a2fad0727835 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 7 Feb 2013 12:29:07 -0500 Subject: Added CFBundleShortVersionString and CFBundleName, both needed for Sparkle to work correctly diff --git a/Info.plist b/Info.plist index 0f7c9b5..a1fcb5b 100644 --- a/Info.plist +++ b/Info.plist @@ -2,6 +2,8 @@ + CFBundleName + OpenSCAD CFBundleIconFile @ICON@ CFBundlePackageType @@ -12,6 +14,8 @@ OpenSCAD CFBundleIdentifier org.openscad.OpenSCAD + CFBundleVersion + @SHORT_VERSION@ CFBundleShortVersionString @SHORT_VERSION@ CFBundleDocumentTypes -- cgit v0.10.1 From ac4cd5835424ae55f870e342efd0a88e66649dbe Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 7 Feb 2013 12:29:54 -0500 Subject: bugfix: Actually use Set instead of Add after we added the key to Info.plist manually diff --git a/scripts/release-common.sh b/scripts/release-common.sh index abfdeb8..a30d43a 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -236,7 +236,7 @@ echo "Creating archive.." case $OS in MACOSX) - /usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $VERSIONDATE" OpenSCAD.app/Contents/Info.plist + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSIONDATE" OpenSCAD.app/Contents/Info.plist macdeployqt OpenSCAD.app -dmg -no-strip mv OpenSCAD.dmg OpenSCAD-$VERSION.dmg hdiutil internet-enable -yes -quiet OpenSCAD-$VERSION.dmg -- cgit v0.10.1 From a7b80d64dd5775ff10253eb1a8b17cf4c2aeaeeb Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 7 Feb 2013 12:35:47 -0500 Subject: Specify VERSIONDATE in addition to VERSION when building releases diff --git a/doc/release-checklist.txt b/doc/release-checklist.txt index db5b696..321eb7b 100644 --- a/doc/release-checklist.txt +++ b/doc/release-checklist.txt @@ -3,9 +3,12 @@ OpenSCAD Release Checklist (See bottom of this file for how to build release binaries) -o Update VERSION environment variable +o Set VERSION and VERSIONDATE environment variable + (VERSIONDATE is new and used to identify releases. VERSION is for humans. + For development builds, set VERSION and VERSIONDATE to the same value) export VERSION=2013.01 + export VERSIONDATE=2013.01.17 It will be used by the commands below, as well as these files: -- cgit v0.10.1 From 4bd23c90916c181fe8ef4788ebe8d3d916758a0a Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 7 Feb 2013 15:01:31 -0500 Subject: Support Sparkle's Install on Quit diff --git a/openscad.pro b/openscad.pro index c624b2e..a467820 100644 --- a/openscad.pro +++ b/openscad.pro @@ -323,11 +323,12 @@ macx { src/EventFilter.h \ src/AutoUpdater.h \ src/SparkleAutoUpdater.h \ - src/CocoaInitializer.h + src/CocoaInitializer.h \ + src/CocoaUtils.h SOURCES += src/AppleEvents.cc \ src/AutoUpdater.cc OBJECTIVE_SOURCES += src/SparkleAutoUpdater.mm \ - src/CocoaInitializer.mm + src/CocoaUtils.mm } isEmpty(PREFIX):PREFIX = /usr/local diff --git a/src/CocoaUtils.h b/src/CocoaUtils.h new file mode 100644 index 0000000..8543d84 --- /dev/null +++ b/src/CocoaUtils.h @@ -0,0 +1,10 @@ +#ifndef COCOAUTILS_H_ +#define COCOAUTILS_H_ + +class CocoaUtils +{ +public: + static void endApplication(); +}; + +#endif diff --git a/src/CocoaUtils.mm b/src/CocoaUtils.mm new file mode 100644 index 0000000..2ac8aef --- /dev/null +++ b/src/CocoaUtils.mm @@ -0,0 +1,9 @@ +#include "CocoaUtils.h" +#import + +void CocoaUtils::endApplication() +{ + [[NSNotificationCenter defaultCenter] + postNotificationName:@"NSApplicationWillTerminateNotification" + object:nil]; +} diff --git a/src/mainwin.cc b/src/mainwin.cc index a05a4d4..7db7878 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -49,6 +49,9 @@ #include "ThrownTogetherRenderer.h" #include "csgtermnormalizer.h" #include "AutoUpdater.h" +#ifdef Q_OS_MAC +#include "CocoaUtils.h" +#endif #include #include @@ -1843,6 +1846,9 @@ void MainWindow::quit() QApplication::sendEvent(QApplication::instance(), &ev); if (ev.isAccepted()) QApplication::instance()->quit(); // FIXME: Cancel any CGAL calculations +#ifdef Q_OS_MAC + CocoaUtils::endApplication(); +#endif } void MainWindow::consoleOutput(const std::string &msg, void *userdata) -- cgit v0.10.1 From 747e52438d5d16027ee98c18ac099098e66cad70 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 19:14:02 -0500 Subject: Added Sparkle to build script diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh index bfe0ede..57dd3bf 100755 --- a/scripts/macosx-build-dependencies.sh +++ b/scripts/macosx-build-dependencies.sh @@ -325,6 +325,30 @@ build_eigen() make install } +build_sparkle() +{ + # Let Sparkle use the default compiler + unset CC + unset CXX + version=$1 + echo "Building Sparkle" $version "..." + cd $BASEDIR/src + rm -rf Sparkle-$version + if [ ! -f Sparkle-$version.zip ]; then + curl -o Sparkle-$version.zip https://nodeload.github.com/andymatuschak/Sparkle/zip/$version + fi + unzip -q Sparkle-$version.zip + cd Sparkle-$version + patch -p1 < $OPENSCADDIR/patches/sparkle.patch + if $OPTION_32BIT; then + SPARKLE_EXTRA_FLAGS="-arch i386" + fi + xcodebuild -project Sparkle.xcodeproj -scheme Sparkle -configuration Release -arch x86_64 $SPARKLE_EXTRA_FLAGS + rm -r $DEPLOYDIR/lib/Sparkle.framework + cp -Rf build/Release/Sparkle.framework $DEPLOYDIR/lib/ + install_name_tool -id $DEPLOYDIR/lib/Sparkle.framework/Versions/A/Sparkle $DEPLOYDIR/lib/Sparkle.framework/Sparkle +} + if [ ! -f $OPENSCADDIR/openscad.pro ]; then echo "Must be run from the OpenSCAD source root directory" exit 0 @@ -391,3 +415,4 @@ build_boost 1.51.0 build_cgal 4.1 build_glew 1.9.0 build_opencsg 1.3.2 +build_sparkle 0ed83cf9f2eeb425d4fdd141c01a29d843970c20 \ No newline at end of file -- cgit v0.10.1 From 3a517e4a3f60f98ec423ef49a8d856f69731ebba Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 21:43:46 -0500 Subject: Don't print last updated date if it's null diff --git a/src/SparkleAutoUpdater.mm b/src/SparkleAutoUpdater.mm index 5176e80..c52e2bb 100644 --- a/src/SparkleAutoUpdater.mm +++ b/src/SparkleAutoUpdater.mm @@ -60,8 +60,8 @@ bool SparkleAutoUpdater::enableSnapshots() QString SparkleAutoUpdater::lastUpdateCheckDate() { - NSString *datestring = [NSString stringWithFormat:@"Last checked: %@", - [d->updater lastUpdateCheckDate]]; + NSDate *date = [d->updater lastUpdateCheckDate]; + NSString *datestring = date ? [NSString stringWithFormat:@"Last checked: %@", date] : @""; return QString::fromUtf8([datestring UTF8String]); } -- cgit v0.10.1 From f3731d8ce177ef2791ffb3ad41891fac2fcad52e Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 21:44:48 -0500 Subject: Added support for signing binaries diff --git a/Info.plist b/Info.plist index a1fcb5b..0719c14 100644 --- a/Info.plist +++ b/Info.plist @@ -41,5 +41,7 @@ OSAScriptingDefinition OpenSCAD.sdef + SUPublicDSAKeyFile + dsa_pub.pem diff --git a/appcast-snapshots.xml.in b/appcast-snapshots.xml.in index 3103565..f46c814 100644 --- a/appcast-snapshots.xml.in +++ b/appcast-snapshots.xml.in @@ -11,6 +11,7 @@ diff --git a/appcast.xml.in b/appcast.xml.in index e375fae..f61710c 100644 --- a/appcast.xml.in +++ b/appcast.xml.in @@ -11,6 +11,7 @@ diff --git a/dsa_pub.pem b/dsa_pub.pem new file mode 100644 index 0000000..f0aee27 --- /dev/null +++ b/dsa_pub.pem @@ -0,0 +1,12 @@ +-----BEGIN PUBLIC KEY----- +MIIBtjCCASsGByqGSM44BAEwggEeAoGBAMP6y57wSCnUvfwehhit5K8EU4W3uf6s +zCFUGWIxWaweWjkezHIZLz7pTv0dLm5Va0vKTIWgrNseTtdTaJ491lyGAHWlu9sP +LAe/vG+UpIA6uNZX3gB7dDxunRUenTczYgnVoQWSIVRhZUEjci9WgbJJrguTPQvi +cCfuI6Hox6cDAhUA3duJXWi3eaOIMqCfm6RpEt/fRC8CgYApHNQB5Ar/SIPobxtJ +Ox05xhhgm/YOJbGUcSZjsMgEP6rj+269vCBnYG+eE3nelXfOA5SXbOfY6Ju6+RBS +OdPeNbWZah88QJK8bqBH7KS/EkMaiEXerPEIEIC5xOjKjYXs1z8AtNGUGORwWwjm +85et2nY/WXvIJkUQtET/bWEYPQOBhAACgYB7hBLdC5rXpV0nqEmI4QYYt63OdP4D +Lf2XISyKi9H1F+6mwoeU4It7fMdGC1MBXyx/3sv8U1YbYIeDHB+lDy6QN2UxSBTN +VI9UPUqdcoYZwQiaHHgqWcoyPDqzEVsFtHi3/pXLckuszA19NT8980o+7noiKxUm +3pDa4C+oANPFCQ== +-----END PUBLIC KEY----- diff --git a/openscad.pro b/openscad.pro index a467820..7b55a14 100644 --- a/openscad.pro +++ b/openscad.pro @@ -66,7 +66,7 @@ macx { ICON = icons/OpenSCAD.icns QMAKE_INFO_PLIST = Info.plist APP_RESOURCES.path = Contents/Resources - APP_RESOURCES.files = OpenSCAD.sdef + APP_RESOURCES.files = OpenSCAD.sdef dsa_pub.pem QMAKE_BUNDLE_DATA += APP_RESOURCES LIBS += -framework Cocoa -framework Sparkle } @@ -323,7 +323,6 @@ macx { src/EventFilter.h \ src/AutoUpdater.h \ src/SparkleAutoUpdater.h \ - src/CocoaInitializer.h \ src/CocoaUtils.h SOURCES += src/AppleEvents.cc \ src/AutoUpdater.cc diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh index 2fe85d4..306f1cd 100755 --- a/scripts/publish-macosx.sh +++ b/scripts/publish-macosx.sh @@ -32,13 +32,15 @@ if [[ $? != 0 ]]; then exit 1 fi +SIGNATURE=$(openssl dgst -sha1 -binary < OpenSCAD-$VERSION.dmg | openssl dgst -dss1 -sign dsa_priv.pem | openssl enc -base64) + if [[ $VERSION == $VERSIONDATE ]]; then APPCASTFILE=appcast-snapshots.xml else APPCASTFILE=appcast.xml fi echo "Creating appcast $APPCASTFILE..." -sed -e "s,@VERSION@,$VERSION,g" -e "s,@VERSIONDATE@,$VERSIONDATE,g" -e "s,@FILESIZE@,$(stat -f "%z" OpenSCAD-$VERSION.dmg),g" $APPCASTFILE.in > $APPCASTFILE +sed -e "s,@VERSION@,$VERSION,g" -e "s,@VERSIONDATE@,$VERSIONDATE,g" -e "s,@DSASIGNATURE@,$SIGNATURE,g" -e "s,@FILESIZE@,$(stat -f "%z" OpenSCAD-$VERSION.dmg),g" $APPCASTFILE.in > $APPCASTFILE cp $APPCASTFILE ../openscad.github.com if [[ $VERSION == $VERSIONDATE ]]; then cp $APPCASTFILE ../openscad.github.com/appcast-snapshots.xml -- cgit v0.10.1 From 4756a519fc4b12b19944644ac9d03bc55af9bf04 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 21:45:25 -0500 Subject: Minor patch to Sparkle to deal with version numbered app bundles diff --git a/patches/sparkle.patch b/patches/sparkle.patch new file mode 100644 index 0000000..11e86e0 --- /dev/null +++ b/patches/sparkle.patch @@ -0,0 +1,12 @@ +--- Sparkle-0ed83cf9f2eeb425d4fdd141c01a29d843970c20/SUConstants.h 2013-02-04 08:18:48.000000000 -0500 ++++ Sparkle-new/SUConstants.h 2013-02-06 17:47:31.000000000 -0500 +@@ -24,7 +24,7 @@ + // If your app file on disk is named "MyApp 1.1b4", Sparkle usually updates it + // in place, giving you an app named 1.1b4 that is actually 1.2. Turn the + // following on to always reset the name back to "MyApp": +-#define NORMALIZE_INSTALLED_APP_NAME 0 ++#define NORMALIZE_INSTALLED_APP_NAME 1 + + + #define TRY_TO_APPEND_VERSION_NUMBER 1 +diff -ru Sparkle-0ed83cf9f2eeb425d4fdd141c01a29d843970c20/SUPlainInstallerInternals.m Sparkle-new/SUPlainInstallerInternals.m -- cgit v0.10.1 From b87e574e093fd29e6e3f2c3443018948ce890e24 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 21:50:53 -0500 Subject: Added document icon for Mac diff --git a/Info.plist b/Info.plist index 0719c14..144dd69 100644 --- a/Info.plist +++ b/Info.plist @@ -33,6 +33,8 @@ OpenSCAD Design CFBundleTypeRole Editor + CFBundleTypeIconFile + SCAD.icns LSIsAppleDefaultForType diff --git a/icons/SCAD.icns b/icons/SCAD.icns new file mode 100644 index 0000000..12abb48 Binary files /dev/null and b/icons/SCAD.icns differ diff --git a/openscad.pro b/openscad.pro index 7b55a14..475d55a 100644 --- a/openscad.pro +++ b/openscad.pro @@ -66,7 +66,7 @@ macx { ICON = icons/OpenSCAD.icns QMAKE_INFO_PLIST = Info.plist APP_RESOURCES.path = Contents/Resources - APP_RESOURCES.files = OpenSCAD.sdef dsa_pub.pem + APP_RESOURCES.files = OpenSCAD.sdef dsa_pub.pem icons/SCAD.icns QMAKE_BUNDLE_DATA += APP_RESOURCES LIBS += -framework Cocoa -framework Sparkle } -- cgit v0.10.1 From 89f15f72b9c5f7cef05b1f106111f80f0cc37cce Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 21:52:36 -0500 Subject: sync diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 1e0a737..9dede0f 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -4,6 +4,8 @@ OpenSCAD 2013.XX Features: o Console output is now enabled on Windows through the openscad.com executable o Added basic syntax highlighting in the editor +o Mac: Added document icon +o Mac: Added auto-update check Bugfixes: o OpenCSG rendering sometimes crashed when rendering large models -- cgit v0.10.1 From 9c23c1e8b8d7828acba96d4b4985566701331249 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Feb 2013 21:54:18 -0500 Subject: Put back commented-out upload while testing diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh index 306f1cd..3aeeaf9 100755 --- a/scripts/publish-macosx.sh +++ b/scripts/publish-macosx.sh @@ -47,9 +47,9 @@ if [[ $VERSION == $VERSIONDATE ]]; then fi echo "Uploading..." -#LABELS=OpSys-OSX,Type-Executable -#if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi -#`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS +LABELS=OpSys-OSX,Type-Executable +if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi +`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS # Update snapshot filename on web page -#`dirname $0`/update-web.sh OpenSCAD-$VERSION.dmg +`dirname $0`/update-web.sh OpenSCAD-$VERSION.dmg -- cgit v0.10.1 From 4948c2457f16110c10a2daa416e8fff84824ec69 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 12 Feb 2013 23:16:23 -0500 Subject: Added support for more paths in OPENSCADPATH, also search in HOME/Documents/OpenSCAD/libraries on Mac diff --git a/src/CocoaUtils.h b/src/CocoaUtils.h index 8543d84..ad5518b 100644 --- a/src/CocoaUtils.h +++ b/src/CocoaUtils.h @@ -1,10 +1,13 @@ #ifndef COCOAUTILS_H_ #define COCOAUTILS_H_ +#include + class CocoaUtils { public: static void endApplication(); + static std::string documentsPath(); }; #endif diff --git a/src/CocoaUtils.mm b/src/CocoaUtils.mm index 2ac8aef..295ceb9 100644 --- a/src/CocoaUtils.mm +++ b/src/CocoaUtils.mm @@ -1,5 +1,6 @@ #include "CocoaUtils.h" #import +#include void CocoaUtils::endApplication() { @@ -7,3 +8,8 @@ void CocoaUtils::endApplication() postNotificationName:@"NSApplicationWillTerminateNotification" object:nil]; } + +std::string CocoaUtils::documentsPath() +{ + return std::string([[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] UTF8String]); +} diff --git a/src/parsersettings.cc b/src/parsersettings.cc index 3dda132..54f9713 100644 --- a/src/parsersettings.cc +++ b/src/parsersettings.cc @@ -2,7 +2,9 @@ #include #include #include "boosty.h" +#include #include // Needed for Q_ defines - move the offending code somewhere else +#include "CocoaUtils.h" namespace fs = boost::filesystem; @@ -28,15 +30,24 @@ std::string locate_file(const std::string &filename) void parser_init(const std::string &applicationpath) { - // Add path from OPENSCADPATH before adding built-in paths - const char *openscadpath = getenv("OPENSCADPATH"); - if (openscadpath) { - add_librarydir(boosty::absolute(fs::path(openscadpath)).string()); + // Add paths from OPENSCADPATH before adding built-in paths + const char *openscadpaths = getenv("OPENSCADPATH"); + if (openscadpaths) { + std::string paths(openscadpaths); + typedef boost::split_iterator string_split_iterator; + for (string_split_iterator it = + make_split_iterator(paths, first_finder(":", boost::is_iequal())); + it != string_split_iterator(); + ++it) { + add_librarydir(boosty::absolute(fs::path(boost::copy_range(*it))).string()); + } } - // FIXME: Support specifying more than one path in OPENSCADPATH // FIXME: Add ~/.openscad/libraries - // FIXME: Add ~/Documents/OpenSCAD/libraries on Mac? +#ifdef __APPLE__ + fs::path docdir(CocoaUtils::documentsPath()); + add_librarydir(boosty::stringy(docdir / "OpenSCAD" / "libraries")); +#endif std::string librarydir; fs::path libdir(applicationpath); -- cgit v0.10.1 From 493041101ca70abe4f4f6822c1fc6a68e8dacfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 14 Feb 2013 09:21:40 +0100 Subject: Notify package managers: Fedora Added myself as a Fedora contact diff --git a/doc/release-checklist.txt b/doc/release-checklist.txt index 321eb7b..f5bb759 100644 --- a/doc/release-checklist.txt +++ b/doc/release-checklist.txt @@ -41,6 +41,7 @@ o Update external resources: - http://en.wikipedia.org/wiki/OpenSCAD o Notify package managers - Ubuntu: https://launchpad.net/~chrysn + - Fedora: Miro HronĨok or - MacPorts: -- cgit v0.10.1 From 09edcdf822c599ffd7685519abe7e192b4b598b9 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 17 Feb 2013 04:48:30 +0100 Subject: fix build errors, display 'not implemented' message on win32/linux diff --git a/openscad.pro b/openscad.pro index 475d55a..06107d6 100644 --- a/openscad.pro +++ b/openscad.pro @@ -229,7 +229,8 @@ HEADERS += src/version_check.h \ src/linalg.h \ src/system-gl.h \ src/stl-utils.h \ - src/svg.h + src/svg.h \ + src/AutoUpdater.h SOURCES += src/version_check.cc \ src/ProgressWidget.cc \ @@ -276,6 +277,7 @@ SOURCES += src/version_check.cc \ src/OpenCSGWarningDialog.cc \ src/editor.cc \ src/glview.cc \ + src/AutoUpdater.cc \ \ src/builtin.cc \ src/export.cc \ @@ -321,11 +323,9 @@ SOURCES += src/cgalutils.cc \ macx { HEADERS += src/AppleEvents.h \ src/EventFilter.h \ - src/AutoUpdater.h \ src/SparkleAutoUpdater.h \ src/CocoaUtils.h - SOURCES += src/AppleEvents.cc \ - src/AutoUpdater.cc + SOURCES += src/AppleEvents.cc OBJECTIVE_SOURCES += src/SparkleAutoUpdater.mm \ src/CocoaUtils.mm } diff --git a/src/Preferences.cc b/src/Preferences.cc index fe7462a..7c7aee4 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -26,6 +26,7 @@ #include "Preferences.h" +#include #include #include #include @@ -192,10 +193,19 @@ void Preferences::on_fontSize_editTextChanged(const QString &size) emit fontChanged(getValue("editor/fontfamily").toString(), intsize); } +void unimplemented_msg() +{ + QMessageBox mbox; + mbox.setText("Sorry, this feature is not implemented on your Operating System"); + mbox.exec(); +} + void Preferences::on_updateCheckBox_toggled(bool on) { if (AutoUpdater *updater =AutoUpdater::updater()) { updater->setAutomaticallyChecksForUpdates(on); + } else { + unimplemented_msg(); } } @@ -203,6 +213,8 @@ void Preferences::on_snapshotCheckBox_toggled(bool on) { if (AutoUpdater *updater =AutoUpdater::updater()) { updater->setEnableSnapshots(on); + } else { + unimplemented_msg(); } } @@ -210,6 +222,8 @@ void Preferences::on_checkNowButton_clicked() { if (AutoUpdater *updater =AutoUpdater::updater()) { updater->checkForUpdates(); + } else { + unimplemented_msg(); } } -- cgit v0.10.1