diff --git a/README.md b/README.md index 7b0b451..991532f 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ UMWP Autochanger is a little tool for [UltraMon](http://www.realtimesoft.com/ult * randomly and periodically change the wallpaper of all your monitors, * manage sets of wallpapers, allowing you to quickly change which images are used. -Version : 1.7 -Release date : 01/08/2014 +Version : 1.8 +Release date : 10/11/2014 Author : Damien "Mistic" Sorel Website : http://www.strangeplanet.fr/work/umwp-autochanger License : GNU General Public License Version 3 @@ -32,19 +32,18 @@ The application is currently available in English and French. [A translation pag ## Configuration -* Double-click on a set to edit it. You can change its name, its style (one image for each monitor or one image for the whole desktop) and the transformation style for images (center, tile or stretch). +* Double-click on a set to edit it. You can change its name, its style (one image for each monitor or one image for the whole desktop), the transformation style for images (center, tile or stretch) and the hotkey. * On the "Options" dialog you can choose the delay, change the behavior of the tool and configure the hotkeys. Hotkeys are a way to interact with the application while it is hidden in the system bar. Hotkeys can also be defined for each individual sets. +* On the "Manage monitors" dialog you can disable the wallpaper on specific monitor, as well as choosing their background color. + ## Troubleshouting Q: When I launch UMWP Autochanger, the window doesn't appear. A: When you have already registered sets, the window automatically minimize to the system bar, double-click on the icon (or right-click => "Show") to open it. This behavior can be changed on the "Options" menu. -Q: Can I edit a set ? -A: Yes. Double-click on it's name, you can set the name, the type and the style of wallpaper and the hotkey of the set. - Q: How hotkeys work ? A: There are two kind of hotkeys: the ones defined in the "Options" dialog allow to show/hide the application window, refresh the wallpaper and start/pause the timer. The ones defined in the set edit dialog allow to change the current set. You can assign the same hotkey to multiple sets. @@ -60,9 +59,9 @@ You will need Qt 4.8.4 and libqxt 0.6.2 ## Changelog -* 1.8 - * new: disable wallpaper support on specific monitors - * new: choose background of each monitor +* [1.8 (10/11/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.7) + * new: can disable wallpaper support on specific monitors + * new: choose background color of each monitor * new: "Delete" button on "Active files" dialog * new: auto-update process * fixed: crash after changing delay diff --git a/installer/data/readme.txt b/installer/data/readme.txt index e984698..991532f 100644 --- a/installer/data/readme.txt +++ b/installer/data/readme.txt @@ -1,131 +1,122 @@ UltraMon Wallpaper Autochanger +================ -Version : 1.7 -Release date : 01/08/2014 -Author : Damien "Mistic" Sorel -Website : http://www.strangeplanet.fr -License : GNU General Public License Version 3 - - -Description -=========== -UMWP Autochanger is a little tool for UltraMon users. I has two main features : - - randomly and periodically change the wallpaper of all your monitors, - - manage sets of wallpapers, allowing you to quickly change which images are used. - - -Requirement -=========== -UltraMon 3.2.1 or higher -Windows 7/8 32/64 bits - - -Installation -============ - 1. Install and configure UltraMon on your computer. - - 2. Launch "UMWP Autochanger.exe". - - 2.1. Depending on your configuration, you might be asked to locate "UltraMonDesktop.exe". - - 3. Click on the plus button to add a new set. A set is basically a directory - containing JPEG/PNG/BMP files. UMWP Autochanger will browse this directory - recursively up to 3 levels searching for image files. - - 4. Once you have added your sets, the wallpaper will randomly change - every 60 seconds (default delay). - - -Configuration -============= - * Double-click on a set to edit it. You can change its name, its style - (one image for each monitor or one image for the whole desktop) and the - transformation style for images (center, tile or stretch). - - * On the "Options" dialog you can choose the delay, change the behavior of - the tool and configure the hotkeys. - Hotkeys are a way to interact with the application while it is hidden - in the system bar. Hotkeys can also be defined for each individual sets. - - -Troubleshouting -=============== - Q: When I launch UMWP Autochanger, the window doesn't appear. - A: When you have already registered sets, the window automatically minimize - to the system bar, double-click on the icon (or right-click => "Show") - to open it. This behavior can be changed on the "Options" menu. - - Q: Can I edit a set ? - A: Yes. Double-click on it's name, you can set the name, the type and the style of wallpaper. - - Q: How hotkeys work ? - A: There are two kind of hotkeys: the ones defined in the "Options" dialog allow - to show/hide the application window, refresh the wallpaper and start/pause the timer. - The ones defined in the set edit dialog allow to change the current set. - You can assign the same hotkey to multiple sets. - In both cases, click on the input box and press the desired keys combinination. - You must at least use one modifier (Ctrl, Shift, Alt, Win) and some keys are - not available (Esc, Tab, Backspace, ...). - - Q: Can I reorder sets ? - A: Yes. Simply drag & drop them. - - -Changelog -========= - ---- 1.7 (01/08/2014) - - new: add "Fill" mode - - new: create default.wallpaper file if not present - - change: don't delete missing sets but highlight them - ---- 1.6 (08/03/2014) - - change: Alt-F4 effectively closes application without prompt - - fixed: application closes when closing dialog window while main window is hidden - - fixed: delay input with wrong display format - - fixed: set parameters randomly resetted - ---- 1.5 (12/02/2014) - - new: export and import XML configuration file - - new: check UltraMon version - - new: add logger for debuging purposes - - new: "Active files" dialog with cliquable thumbnails for direct access to files - - fixed: better detection of UltraMon executable - - fixed: no more freeze when updating wallpaper - ---- 1.4 (06/01/2014) - - new: more flexibility for hot keys + new hotkeys for refresh, start/pause, show/hide - - new: permanently save last used directory - ---- 1.3 (03/12/2013) - - new: can choose the type of wallpaper ('monitor' or 'desktop') and the style - ('center', 'tile', 'stretch', 'stretch proportional') - - new: icons for main buttons (add, [de]activate, delete) - - change: dedicated configuration dialog - - change: use a cache to speed up startup - - change: random images are taken from the same (random too) set if more than one is active - - fixed: refresh issue of the list when deleting sets +UMWP Autochanger is a little tool for [UltraMon](http://www.realtimesoft.com/ultramon/) users. I has two main features : +* randomly and periodically change the wallpaper of all your monitors, +* manage sets of wallpapers, allowing you to quickly change which images are used. + +Version : 1.8 +Release date : 10/11/2014 +Author : Damien "Mistic" Sorel +Website : http://www.strangeplanet.fr/work/umwp-autochanger +License : GNU General Public License Version 3 + + +## Requirement +* UltraMon 3.2.1 or higher +* Windows 7/8 32/64 bits + +## Translation +The application is currently available in English and French. [A translation page](https://www.transifex.com/projects/p/umwp-autochanger) has been created on Transifex, feel free to register and contribute. + + +## Installation +1. Install and configure UltraMon on your computer. + +2. Launch "UMWP Autochanger.exe". + * Depending on your configuration, you might be asked to locate "UltraMonDesktop.exe". + +3. Click on the plus button to add a new set. A set is basically a directory containing JPEG/PNG/BMP files. UMWP Autochanger will browse this directory recursively up to 3 levels searching for image files. + +4. Once you have added your sets, the wallpaper will randomly change every 60 seconds (default delay). + + +## Configuration +* Double-click on a set to edit it. You can change its name, its style (one image for each monitor or one image for the whole desktop), the transformation style for images (center, tile or stretch) and the hotkey. + +* On the "Options" dialog you can choose the delay, change the behavior of the tool and configure the hotkeys. +Hotkeys are a way to interact with the application while it is hidden in the system bar. Hotkeys can also be defined for each individual sets. + +* On the "Manage monitors" dialog you can disable the wallpaper on specific monitor, as well as choosing their background color. + + +## Troubleshouting +Q: When I launch UMWP Autochanger, the window doesn't appear. +A: When you have already registered sets, the window automatically minimize to the system bar, double-click on the icon (or right-click => "Show") to open it. This behavior can be changed on the "Options" menu. + +Q: How hotkeys work ? +A: There are two kind of hotkeys: the ones defined in the "Options" dialog allow to show/hide the application window, refresh the wallpaper and start/pause the timer. +The ones defined in the set edit dialog allow to change the current set. You can assign the same hotkey to multiple sets. +In both cases, click on the input box and press the desired keys combinination. You must at least use one modifier (Ctrl, Shift, Alt, Win) and some keys are not available (Esc, Tab, Backspace, ...). + +Q: Can I reorder sets ? +A: Yes. Simply drag & drop them. + + +## Compiling +You can compile the application yourself with Qt Designer. +You will need Qt 4.8.4 and libqxt 0.6.2 + + +## Changelog +* [1.8 (10/11/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.7) + * new: can disable wallpaper support on specific monitors + * new: choose background color of each monitor + * new: "Delete" button on "Active files" dialog + * new: auto-update process + * fixed: crash after changing delay ---- 1.2 (09/09/2013) - - new: system-wide hotkeys for quick change - - new: reorder sets with drag'n'drop - - new: integrated help - ---- 1.1 (13/05/2013) - - fixed: use better shuffle - - fixed: remember last used directory - - fixed: accept files with .jpeg extension - - new: add version checker - - new: add quick switch menu in tray con - - code optimizations - ---- 1.0 (02/03/2013) - - fixed: multi delete doesn't work correclty - ---- 1.0 alpha2 (28/02/2013) - - fixed: autorun shortcut not starting in the good working directory - - fixed: delay spinbox no initialized correctly - - new: multiple selection - ---- 1.0 alpha1 (27/02/2013) - - first version \ No newline at end of file +* [1.7 (01/08/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.7) + * new: add "Fill" mode + * new: create default.wallpaper file if not present + * change: don't delete missing sets but highlight them + +* [1.6 (08/03/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.6) + * change: Alt-F4 effectively closes application without prompt + * fixed: application closes when closing dialog window while main window is hidden + * fixed: delay input with wrong display format + * fixed: set parameters randomly resetted + +* [1.5 (12/02/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.5) + * new: export and import XML configuration file + * new: check UltraMon version + * new: add logger for debuging purposes + * new: "Active files" dialog with cliquable thumbnails for direct access to files + * fixed: better detection of UltraMon executable + * fixed: no more freeze when updating wallpaper + +* [1.4 (06/01/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.4) + * new: more flexibility for hot keys + new hotkeys for refresh, start/pause, show/hide + * new: permanently save last used directory + +* [1.3 (03/12/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.3) + * new: can choose the type of wallpaper ('monitor' or 'desktop') and the style ('center', 'tile', 'stretch', 'stretch proportional') + * new: icons for main buttons (add, [de]activate, delete) + * change: dedicated configuration dialog + * change: use a cache to speed up startup + * change: random images are taken from the same (random too) set if more than one is active + * fixed: refresh issue of the list when deleting sets + +* [1.2 (09/09/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.2) + * new: system-wide hotkeys for quick change + * new: reorder sets with drag'n'drop + * new: integrated help + +* [1.1 (13/05/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.1) + * fixed: use better shuffle + * fixed: remember last used directory + * fixed: accept files with .jpeg extension + * new: add version checker + * new: add quick switch menu in tray con + * code optimizations + +* [1.0 (02/03/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.0) + * fixed: multi delete doesn't work correclty + +* [1.0 alpha2 (28/02/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.0a2) + * fixed: autorun shortcut not starting in the good working directory + * fixed: delay spinbox no initialized correctly + * new: multiple selection + +* [1.0 alpha1 (27/02/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.0a1) + * first version diff --git a/installer/package.bat b/installer/package.bat index a62744c..0d79631 100644 --- a/installer/package.bat +++ b/installer/package.bat @@ -1 +1 @@ -"C:\Program Files\7-Zip\7z.exe" a UMWP_Autochanger_1.7.zip ./data/* -x!*.ico \ No newline at end of file +"C:\Program Files\7-Zip\7z.exe" a UMWP_Autochanger_1.8.zip ./data/* -x!*.ico \ No newline at end of file diff --git a/src/constants.h b/src/constants.h index 965395e..8e023d4 100644 --- a/src/constants.h +++ b/src/constants.h @@ -16,8 +16,8 @@ #define APP_MAX_TRAVERSAL 3 #define APP_HOMEPAGE "http://www.strangeplanet.fr/work/umwp-autochanger" -#define APP_VERSION_URL "http://www.strangeplanet.fr/work/umwp-autochanger/last-version-2.txt" -#define APP_INSTALLER_SIZE 5203022 +#define APP_VERSION_URL "http://www.strangeplanet.fr/work/umwp-autochanger/last-version.txt" +#define APP_INSTALLER_SIZE 5228000 #define APP_INSTALLER_FILENAME "installer.exe" #define APP_MIN_WIDTH 440 diff --git a/src/controller.cpp b/src/controller.cpp index 930b8f0..35589d6 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -31,8 +31,7 @@ void Controller::checkVersion() if (m_settings->get("check_updates").toBool()) { VersionChecker* checker = new VersionChecker(); - connect(checker, SIGNAL(newVersionAvailable(const QString, const QString)), - this, SLOT(onNewVersion(const QString, const QString))); + connect(checker, SIGNAL(newVersionAvailable(const NewVersion)), this, SLOT(onNewVersion(const NewVersion))); QThread* thread = new QThread(this); checker->moveToThread(thread); @@ -51,9 +50,9 @@ void Controller::checkVersion() * @param string _version * @param string _link */ -void Controller::onNewVersion(const QString &_version, const QString &_link) +void Controller::onNewVersion(const NewVersion _version) { - m_enviro->setNewVersion(_version, _link); + m_enviro->setNewVersion(_version); emit newVersionAvailable(); } diff --git a/src/controller.h b/src/controller.h index 176050d..3f3ebf1 100644 --- a/src/controller.h +++ b/src/controller.h @@ -56,7 +56,7 @@ public slots: void onUpdate(bool _forceRefresh=false); private slots: - void onNewVersion(const QString &_ver, const QString &_link); + void onNewVersion(const NewVersion _version); signals: void listChanged(bool); // true to reset QListWidget selection diff --git a/src/environment.cpp b/src/environment.cpp index a2118b9..bbd4268 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -20,6 +20,8 @@ Environment::Environment(Settings* _settings) : m_env["umversion"] = ""; m_env["startlinkpath"] = QVariant(); m_env["nb_monitors"] = 0; + + qRegisterMetaType("NewVersion"); } /** @@ -38,17 +40,6 @@ const bool Environment::isAutostart() const return QFile::exists(m_env["startlinkpath"].toString()); } -/** - * @brief Save data of the new version available - * @param string _ver - * @param string _link - */ -void Environment::setNewVersion(const QString &_ver, const QString &_link) -{ - m_newVersion.first = _ver; - m_newVersion.second = _link; -} - /** * @brief Dump whole env in the log */ diff --git a/src/environment.h b/src/environment.h index 05f0e3f..86770ca 100644 --- a/src/environment.h +++ b/src/environment.h @@ -7,6 +7,17 @@ #include "settings.h" +/** + * @brief Store data about new version + */ +struct NewVersion { + QString code; + QString link; +}; + +Q_DECLARE_METATYPE(NewVersion) + + /** * @brief Holds environment state */ @@ -18,7 +29,7 @@ class Environment QHash m_env; // environnement variables QHash m_wpSizes; QByteArray m_header; - QPair m_newVersion; + NewVersion m_newVersion; public: Environment(Settings* _settings); @@ -34,10 +45,10 @@ class Environment const int nbMonitors() const { return get("nb_monitors").toInt(); } const QScreen wpSize(int _i) const { return m_wpSizes.value(_i); } const QByteArray &header() const { return m_header; } - const QPair newVersion() { return m_newVersion; } + const NewVersion newVersion() const { return m_newVersion; } // setters - void setNewVersion(const QString &_ver, const QString &_link); + void setNewVersion(const NewVersion &_version) { m_newVersion = _version; } // shortcut const bool isAutostart() const; diff --git a/src/gui/configdialog.cpp b/src/gui/configdialog.cpp index 78236db..3923277 100644 --- a/src/gui/configdialog.cpp +++ b/src/gui/configdialog.cpp @@ -123,7 +123,7 @@ void ConfigDialog::done(int result) if (!error.isEmpty()) { qxtLog->error(error); - QMessageBox::critical(this, tr("Error"), error, QMessageBox::Ok, QMessageBox::Ok); + QMessageBox::critical(this, tr("Error"), error, QMessageBox::Ok, QMessageBox::Ok); } else { diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index da1f231..db284cb 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -449,7 +449,7 @@ void MainWindow::onHotkey() */ void MainWindow::onNewVersion() { - QString _version = m_ctrl->enviro()->newVersion().first; + QString _version = m_ctrl->enviro()->newVersion().code; // message in status bar QPushButton* statusLabel = new QPushButton(tr("A new version is available : %1").arg(_version)); diff --git a/src/gui/newversiondialog.cpp b/src/gui/newversiondialog.cpp index 5369c20..3de25c2 100644 --- a/src/gui/newversiondialog.cpp +++ b/src/gui/newversiondialog.cpp @@ -20,7 +20,7 @@ NewVersionDialog::NewVersionDialog(QWidget* _parent, Controller* _ctrl) : m_version = m_ctrl->enviro()->newVersion(); ui->progressBar->setVisible(false); - ui->label->setText(tr("A new version is available : %1").arg(m_version.first)); + ui->label->setText(tr("A new version is available : %1").arg(m_version.code)); } /** @@ -49,10 +49,10 @@ void NewVersionDialog::on_updateButton_clicked() errorMessage(); } - ui->label->setText(tr("Downloading UMWP_Autochanger_%1_Setup.exe ...").arg(m_version.first)); + ui->label->setText(tr("Downloading UMWP_Autochanger_%1_Setup.exe ...").arg(m_version.code)); QNetworkAccessManager* manager = new QNetworkAccessManager(); - m_reply = manager->get(QNetworkRequest(QUrl(m_version.second))); + m_reply = manager->get(QNetworkRequest(QUrl(m_version.link))); connect(m_reply, SIGNAL(readyRead()), this, SLOT(onDataReady())); connect(m_reply, SIGNAL(finished()), this, SLOT(onDownloadFinished())); @@ -64,9 +64,7 @@ void NewVersionDialog::on_updateButton_clicked() */ void NewVersionDialog::errorMessage() { - QMessageBox msgBox; - msgBox.setText(tr("Unable to download installer file.")); - msgBox.exec(); + QMessageBox::critical(this, tr("Error"), tr("Unable to download installer file."), QMessageBox::Ok, QMessageBox::Ok); done(0); } @@ -85,7 +83,8 @@ void NewVersionDialog::onDataReady() */ void NewVersionDialog::onDownloadProgress(qint64 _received, qint64 _total) { - if (_total == -1) { + if (_total == -1) + { _total = qMax(_received, (qint64) APP_INSTALLER_SIZE); } @@ -111,7 +110,8 @@ void NewVersionDialog::onDownloadFinished() m_file.remove(); errorMessage(); } - else { + else + { qxtLog->trace("Download finished"); ui->progressBar->setValue(100); diff --git a/src/gui/newversiondialog.h b/src/gui/newversiondialog.h index d09ae7d..cfa27cf 100644 --- a/src/gui/newversiondialog.h +++ b/src/gui/newversiondialog.h @@ -13,6 +13,9 @@ namespace Ui { } +/** + * @brief Dialog to download new installer + */ class NewVersionDialog : public QDialog { Q_OBJECT @@ -21,7 +24,7 @@ class NewVersionDialog : public QDialog Ui::NewVersionDialog* ui; Controller* m_ctrl; - QPair m_version; + NewVersion m_version; QFile m_file; QNetworkReply* m_reply; diff --git a/src/gui/screensdialog.cpp b/src/gui/screensdialog.cpp index 68102ca..2cf74d2 100644 --- a/src/gui/screensdialog.cpp +++ b/src/gui/screensdialog.cpp @@ -20,7 +20,7 @@ ScreensDialog::ScreensDialog(QWidget* _parent, Controller* _ctrl) : { ui->setupUi(this); - for (int i=0, l=m_ctrl->enviro()->get("nb_monitors").toInt(); ienviro()->nbMonitors(); isettings()->monitor(i)); } @@ -55,6 +55,8 @@ void ScreensDialog::done(int result) if (!one) { + qxtLog->error("At least one monitor must be enabled"); + QMessageBox::critical(this, tr("Error"), tr("At least one monitor must be enabled"), QMessageBox::Ok, QMessageBox::Ok); } else @@ -73,7 +75,7 @@ void ScreensDialog::done(int result) */ void ScreensDialog::save() { - for (int i=0, l=m_ctrl->enviro()->get("nb_monitors").toInt(); ienviro()->nbMonitors(); isettings()->setMonitor(i, m_monitors[i]); } @@ -98,7 +100,7 @@ void ScreensDialog::initScene() m_scene->setSceneRect(rect); m_scene->addRect(rect, Qt::NoPen, QBrush(Qt::gray)); - for (int i=0, l=m_ctrl->enviro()->get("nb_monitors").toInt(); ienviro()->nbMonitors(); ienviro()->wpSize(i)); } diff --git a/src/versionchecker.h b/src/versionchecker.h index cfa3cfd..e2b2567 100644 --- a/src/versionchecker.h +++ b/src/versionchecker.h @@ -6,6 +6,7 @@ #include #include "main.h" +#include "environment.h" /** @@ -31,13 +32,14 @@ private slots: { if (_reply->error() == QNetworkReply::NoError) { - QString version = _reply->readLine().trimmed(); - QString link = _reply->readLine().trimmed(); + NewVersion version; + version.code = _reply->readLine().trimmed(); + version.link = _reply->readLine().trimmed(); - if (version.compare(QString::fromAscii(APP_VERSION)) > 0) + if (version.code.compare(QString::fromAscii(APP_VERSION)) > 0) { - qxtLog->debug("New version detected: "+version); - emit newVersionAvailable(version, link); + qxtLog->debug("New version detected: "+version.code); + emit newVersionAvailable(version); } } @@ -48,7 +50,7 @@ private slots: } signals: - void newVersionAvailable(const QString, const QString); + void newVersionAvailable(const NewVersion); void finished(); };