File wallch-4.15-remove-unity-dependency.patch of Package wallch
=== modified file 'src/gui/mainwindow.cpp'
--- src/gui/mainwindow.cpp 2015-08-25 17:06:39 +0000
+++ src/gui/mainwindow.cpp 2016-01-04 13:58:41 +0000
@@ -286,9 +286,11 @@
gv.potdOnlineUrlB = settings->value("potd_online_urlB", POTD_ONLINE_URL_B).toString();
gv.liveEarthOnlineUrl = settings->value("line_earth_online_url", LIVEARTH_ONLINE_URL).toString();
gv.liveEarthOnlineUrlB = settings->value("live_earth_online_urlB", LIVEARTH_ONLINE_URL_B).toString();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
gv.unityProgressbarEnabled = settings->value("unity_progressbar_enabled", false).toBool();
-#endif
+#else
+ gv.unityProgressbarEnabled = false;
+#endif //#ifdef WITH_UNITY
gv.independentIntervalEnabled = settings->value("independent_interval_enabled", true).toBool();
gv.rotateImages = settings->value("rotation", false).toBool();
@@ -542,11 +544,11 @@
globalParser_->resetSleepProtection(secondsLeft_);
updateSeconds();
stopButtonsSetEnabled(true);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityPauseAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
-#endif
+#endif //#ifdef WITH_UNITY
previousAndNextButtonsSetEnabled(false);
ui->timeForNext->setFormat(ui->timeForNext->format()+" - Paused.");
}
@@ -709,11 +711,11 @@
updateSecondsTimer_->start(1000);
if(ui->timeForNext->isHidden()){
ui->timeForNext->show();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
globalParser_->setUnityProgressBarEnabled(true);
}
-#endif
+#endif //#ifdef WITH_UNITY
}
}
@@ -734,11 +736,11 @@
void MainWindow::setProgressbarsValue(short value){
ui->timeForNext->setValue(value);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
globalParser_->setUnityProgressbarValue((float)(value/100.0));
}
-#endif
+#endif //#ifdef WITH_UNITY
}
void MainWindow::imageTransition(bool wallpaperClock, const QString &filename /*=QString()*/)
@@ -1219,11 +1221,11 @@
hideProgress_->start(400);
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
globalParser_->setUnityProgressBarEnabled(show);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
ui->timeForNext->setGraphicsEffect(opacityEffect_);
QPropertyAnimation* anim = new QPropertyAnimation(this);
@@ -2203,7 +2205,7 @@
ui->screen_label_text->setText(text);
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void MainWindow::unityProgressbarSetEnabled(bool enabled){
if(gv.wallpapersRunning || gv.liveEarthRunning || gv.potdRunning || gv.wallpaperClocksRunning || gv.liveWebsiteRunning ){
globalParser_->setUnityProgressBarEnabled(enabled);
@@ -2213,7 +2215,7 @@
}
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
void MainWindow::updateColorButton(QImage image)
{
@@ -2318,12 +2320,12 @@
}
gv.processPaused=false;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
dbusmenu_menuitem_property_set_bool(gv.unityPauseAction, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
globalParser_->setUnityProgressBarEnabled(true);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalRecreateTray();
if(gv.pauseOnBattery){
@@ -2352,7 +2354,7 @@
stoppedBecauseOnBattery_=false;
ui->startButton->setText(tr("&Start"));
ui->startButton->setIcon(QIcon::fromTheme("media-playback-start", QIcon(":/images/media-playback-start.png")));
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityPauseAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
@@ -2397,12 +2399,14 @@
gv.wallpapersRunning=false;
globalParser_->updateStartup();
#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityLauncherEntry){
dbusmenu_menuitem_property_set_bool(gv.unityPauseAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
globalParser_->setUnityProgressBarEnabled(false);
}
+#endif //#ifdef WITH_UNITY
if(gv.pauseOnBattery){
if(batteryStatusChecker_->isActive()){
batteryStatusChecker_->stop();
@@ -3013,34 +3017,34 @@
void MainWindow::startButtonsSetEnabled(bool enabled)
{
ui->startButton->setEnabled(enabled);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityLauncherEntry){
dbusmenu_menuitem_property_set_bool(gv.unityPauseAction, DBUSMENU_MENUITEM_PROP_VISIBLE, !enabled);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
void MainWindow::stopButtonsSetEnabled(bool enabled)
{
ui->stopButton->setEnabled(enabled);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityLauncherEntry){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, enabled && !gv.wallpapersRunning);
dbusmenu_menuitem_property_set_bool(gv.unityPauseAction, DBUSMENU_MENUITEM_PROP_VISIBLE, enabled);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
void MainWindow::previousAndNextButtonsSetEnabled(bool enabled){
ui->next_Button->setEnabled(enabled); ui->previous_Button->setEnabled(enabled);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityLauncherEntry){
dbusmenu_menuitem_property_set_bool(gv.unityNextAction, DBUSMENU_MENUITEM_PROP_VISIBLE, enabled);
dbusmenu_menuitem_property_set_bool(gv.unityPreviousAction, DBUSMENU_MENUITEM_PROP_VISIBLE, enabled);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
void MainWindow::monitor(const QStringList &finalListOfPaths){
@@ -3692,11 +3696,11 @@
ui->deactivate_livearth->setEnabled(true);
gv.liveEarthRunning=true;
globalParser_->updateStartup();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalRecreateTray();
setProgressbarsValue(100);
startUpdateSeconds();
@@ -3726,11 +3730,11 @@
ui->activate_livearth->setEnabled(true);
stoppedBecauseOnBattery_=false;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalUncheckRunningFeatureOnTray();
}
@@ -3781,11 +3785,11 @@
}
animateProgressbarOpacity(1);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalRecreateTray();
startUpdateSeconds();
updatePotdProgress();
@@ -3810,11 +3814,11 @@
ui->deactivate_potd->setEnabled(false);
stoppedBecauseOnBattery_=false;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalUncheckRunningFeatureOnTray();
}
@@ -4151,11 +4155,11 @@
gv.wallpaperClocksRunning=true;
globalParser_->updateStartup();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalRecreateTray();
calculateSecondsLeftForWallClocks();
@@ -4196,11 +4200,11 @@
ui->activate_clock->setEnabled(true);
stoppedBecauseOnBattery_=false;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalUncheckRunningFeatureOnTray();
}
@@ -4473,11 +4477,11 @@
gv.liveWebsiteRunning=true;
globalParser_->updateStartup();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalRecreateTray();
setProgressbarsValue(100);
animateProgressbarOpacity(1);
@@ -4507,11 +4511,11 @@
}
ui->live_website_login_widget->setEnabled(true);
animateProgressbarOpacity(0);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
dbusmenu_menuitem_property_set_bool(gv.unityStopAction, DBUSMENU_MENUITEM_PROP_VISIBLE, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
Q_EMIT signalUncheckRunningFeatureOnTray();
disconnect(websiteSnapshot_->asQObject(), SIGNAL(resultedImage(QImage*,short)), this, SLOT(liveWebsiteImageCreated(QImage*,short)));
ui->deactivate_website->setEnabled(false); ui->activate_website->setEnabled(true);
@@ -5449,9 +5453,9 @@
connect(preferences_, SIGNAL(intervalTypeChanged()), this, SLOT(intervalTypeChanged()));
connect(preferences_, SIGNAL(changeThemeTo(QString)), this, SLOT(changeCurrentThemeTo(const QString&)));
connect(preferences_, SIGNAL(maxCacheChanged(qint64)), cacheManager_, SLOT(setMaxCache(qint64)));
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
connect(preferences_, SIGNAL(unityProgressbarChanged(bool)), this, SLOT(unityProgressbarSetEnabled(bool)));
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
preferences_->setWindowFlags(Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
preferences_->show();
preferences_->activateWindow();
=== modified file 'src/gui/mainwindow.h'
--- src/gui/mainwindow.h 2015-08-25 17:06:39 +0000
+++ src/gui/mainwindow.h 2016-01-04 13:58:41 +0000
@@ -65,7 +65,9 @@
#include <glib-object.h>
#include <gtk/gtk.h>
-#include <unity/unity/unity.h>
+# ifdef WITH_UNITY
+# include <unity/unity/unity.h>
+# endif //#ifdef WITH_UNITY
#else
@@ -371,9 +373,9 @@
void strongShowApp();
void hideOrShow();
void picturesLocationsChanged();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void unityProgressbarSetEnabled(bool enabled);
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
void preferencesDestroyed();
void statisticsDestroyed();
void lePointDestroyed();
=== modified file 'src/gui/preferences.cpp'
--- src/gui/preferences.cpp 2015-08-24 14:22:52 +0000
+++ src/gui/preferences.cpp 2016-01-04 13:58:41 +0000
@@ -66,7 +66,7 @@
ui->showPreview_checkBox->setChecked(gv.previewImagesOnScreen);
ui->startup_timeout_spinbox->setValue(settings->value("startup_timeout", 3).toInt());
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
ui->unity_prog_checkbox->setChecked(settings->value("unity_progressbar_enabled", false).toBool());
short curDe = settings->value("de", 0).toInt();
if(curDe>=ui->de_combo->count()){
@@ -283,11 +283,13 @@
}
#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.unityProgressbarEnabled!=ui->unity_prog_checkbox->isChecked()){
gv.unityProgressbarEnabled=ui->unity_prog_checkbox->isChecked();
Q_EMIT unityProgressbarChanged(gv.unityProgressbarEnabled);
}
settings->setValue("unity_progressbar_enabled", gv.unityProgressbarEnabled);
+#endif //#ifdef WITH_UNITY
settings->setValue("de", ui->de_combo->currentIndex());
#endif
@@ -400,7 +402,7 @@
//Integration
ui->theme_combo->setCurrentIndex(2);
ui->de_combo->setCurrentIndex(0);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
ui->unity_prog_checkbox->setChecked(false);
}
@@ -527,7 +529,7 @@
return QString::number(niceData, 'f', 2)+" "+dataTypes.at(counter);
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void Preferences::on_de_combo_currentIndexChanged(int index)
{
DesktopEnvironment::Value curEnv = static_cast<DesktopEnvironment::Value>(index);
=== modified file 'src/gui/preferences.h'
--- src/gui/preferences.h 2015-08-23 16:51:21 +0000
+++ src/gui/preferences.h 2016-01-04 13:58:41 +0000
@@ -63,7 +63,7 @@
void on_page_3_advanced_clicked();
void on_theme_combo_currentIndexChanged(int index);
void on_rotate_checkBox_clicked(bool checked);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void on_de_combo_currentIndexChanged(int index);
#endif
void on_startupCheckBox_clicked(bool checked);
=== modified file 'src/tools/glob.cpp'
--- src/tools/glob.cpp 2015-08-25 14:34:01 +0000
+++ src/tools/glob.cpp 2016-01-04 13:58:41 +0000
@@ -58,7 +58,7 @@
Global::Global(){}
Global::~Global(){}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void Global::setUnityProgressBarEnabled(bool state){
if(!gv.unityLauncherEntry){
gv.unityLauncherEntry = unity_launcher_entry_get_for_desktop_id(APP_DESKTOP_NAME);
@@ -73,7 +73,7 @@
}
unity_launcher_entry_set_progress(gv.unityLauncherEntry, percent);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
bool Global::runsOnBattery(){
#ifdef Q_OS_UNIX
=== modified file 'src/tools/glob.h'
--- src/tools/glob.h 2015-08-24 17:15:53 +0000
+++ src/tools/glob.h 2016-01-04 13:58:41 +0000
@@ -38,7 +38,7 @@
#include "time.h"
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
#include "unity/unity/unity.h"
#endif //#ifdef Q_OS_UNIX
@@ -196,19 +196,19 @@
QDateTime runningTimeOfProcess;
QDateTime timeToFinishProcessInterval;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
//unity launcher shortcuts
UnityLauncherEntry *unityLauncherEntry;
DbusmenuMenuitem *unityStopAction, *unityNextAction, *unityPreviousAction, *unityPauseAction;
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
//variable initialization
GlobalVar() : homePath(QDir::homePath()), currentTheme("ambiance"), preferencesDialogShown(false), independentIntervalEnabled(true),
typeOfInterval(0), randomImagesEnabled(false), firstTimeout(false), symlinks(false), processPaused(false),
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
unityProgressbarEnabled(false), currentDE(DesktopEnvironment::UnityGnome), unacceptedDesktopValues(QStringList() << "" << "default.desktop" << "X-Cinnamon" << "default"),
-#endif
+#endif //#ifdef WITH_UNITY
saveHistory(true), randomTimeFrom(300), randomTimeTo(1200), doNotToggleRadiobuttonFallback(false), previewImagesOnScreen(true), pauseOnBattery(false), amPmEnabled(false),
mainwindowLoaded(false), setAverageColor(false), websiteLoginEnabled(false), websiteCropEnabled(false), wallpapersChangedCurrentSession(0), timeLaunched(QDateTime::currentDateTime()),
showNotification(false), wallpaperClocksRunning(false), liveWebsiteRunning(false), potdRunning(false), liveEarthRunning(false), wallpapersRunning(false),
@@ -256,8 +256,10 @@
static void debug(const QString &message);
static QString getPrimaryColor();
#ifdef Q_OS_UNIX
+# ifdef WITH_UNITY
static void setUnityProgressBarEnabled(bool state);
static void setUnityProgressbarValue(float percent);
+# endif // #ifdef WITH_UNITY
static QString gsettingsGet(const QString &schema, const QString &key);
static QString getSecondaryColor();
static void setPrimaryColor(const QString &colorName);
=== modified file 'src/tools/nonguimanager.cpp'
--- src/tools/nonguimanager.cpp 2015-08-25 14:34:01 +0000
+++ src/tools/nonguimanager.cpp 2016-01-04 13:58:41 +0000
@@ -263,7 +263,7 @@
exit(exitCode);
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
static void stop_fake_callback_main(DbusmenuMenuitem *, guint, gpointer){
nongui->doAction("--stop");
}
@@ -320,16 +320,16 @@
dbusmenu_menuitem_property_set_bool(gv.unityPreviousAction, DBUSMENU_MENUITEM_PROP_VISIBLE, previousState);
}
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
void NonGuiManager::waitForInternetConnection(){
Global::debug("Checking for internet connection...");
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
setUnityShortcutsState(true, false, false, false);
}
-#endif
+#endif //#ifdef WITH_UNITY
if(gv.potdRunning){
continueWithPotd();
}
@@ -414,11 +414,11 @@
}
}
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.unityProgressbarEnabled && gv.currentDE == DesktopEnvironment::UnityGnome){
Global::setUnityProgressbarValue((float) secondsLeft_/totalSeconds_);
}
-#endif
+#endif //#ifdef WITH_UNITY
secondsLeft_--;
}
@@ -453,18 +453,18 @@
generalTimer_->start(59500);
}
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
updatePotdProgressMain();
#endif
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void NonGuiManager::updatePotdProgressMain(){
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
Global::setUnityProgressbarValue((float) (Global::getSecondsTillHour("00:00")/86400.0));
}
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
void NonGuiManager::connectToUpdateSecondsSlot(){
if(generalTimer_ == NULL){
@@ -477,11 +477,11 @@
{
connect(generalTimer_, SIGNAL(timeout()), this, SLOT(updateSeconds()));
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
Global::setUnityProgressBarEnabled(true);
}
-#endif
+#endif //#ifdef WITH_UNITY
}
void NonGuiManager::disconnectFromSlot(){
@@ -679,13 +679,13 @@
}
this->disconnectFromSlot();
this->connectToUpdateSecondsSlot();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
if(gv.unityProgressbarEnabled){
Global::setUnityProgressBarEnabled(true);
}
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
generalTimer_->start(1000);
return true;
}
@@ -707,10 +707,10 @@
{
potdSetSameImage();
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
updatePotdProgressMain();
gv.doNotToggleRadiobuttonFallback=false;
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
generalTimer_->start(59500);
}
@@ -949,6 +949,7 @@
nongui->doAction("--stop");
}
+# ifdef WITH_UNITY
void NonGuiManager::unityProgressbarSetEnabled(bool enabled){
if(generalTimer_->isActive()){
Global::setUnityProgressBarEnabled(enabled);
@@ -957,6 +958,7 @@
}
}
}
+# endif
#endif //#ifdef Q_OS_UNIX
//System tray icon Code
@@ -1375,14 +1377,14 @@
secondsLeft_=totalSeconds_=LIVEARTH_INTERVAL;
Global::resetSleepProtection(secondsLeft_);
generalTimer_->start(1000);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
if(gv.unityProgressbarEnabled){
Global::setUnityProgressBarEnabled(true);
}
setUnityShortcutsState(true, false, false, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
else if(message == "--potd"){
if(mainWindowLaunched_){
@@ -1422,11 +1424,11 @@
}
this->disconnectFromSlot();
this->continueWithPotd();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setUnityShortcutsState(true, false, false, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
else if(message == "--clock")
{
@@ -1465,11 +1467,11 @@
}
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setUnityShortcutsState(true, false, false, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
else if(message == "--website"){
if(mainWindowLaunched_){
@@ -1508,14 +1510,14 @@
this->disconnectFromSlot();
secondsLeft_=0;
this->continueWithWebsite();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
if(gv.unityProgressbarEnabled){
Global::setUnityProgressBarEnabled(true);
}
setUnityShortcutsState(true, false, false, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
else if(message == "--start"){
@@ -1569,7 +1571,7 @@
secondsLeft_=0;
Global::resetSleepProtection(secondsLeft_);
generalTimer_->start(1000);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
if(gv.unityProgressbarEnabled){
Global::setUnityProgressBarEnabled(true);
@@ -1577,7 +1579,7 @@
setUnityShortcutsState(true, true, true, true);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
}
else if(message == "--change"){
@@ -1619,19 +1621,18 @@
Global::debug("Pausing the Wallpapers process.");
generalTimer_->stop();
gv.processPaused=true;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setUnityShortcutsState(true, false, false, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
}
else
{
Global::resetSleepProtection(secondsLeft_);
Global::debug("Continuing from the pause...");
gv.processPaused=false;
-#ifdef Q_OS_UNIX
-
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setUnityShortcutsState(true, true, true, true);
}
@@ -1645,7 +1646,7 @@
return;
}
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome && gv.unityProgressbarEnabled){
Global::setUnityProgressBarEnabled(false);
}
@@ -1687,7 +1688,7 @@
gv.wallpapersRunning=gv.liveEarthRunning=gv.potdRunning=gv.wallpaperClocksRunning=gv.liveWebsiteRunning=false;
Global::updateStartup();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setUnityShortcutsState(false, false, false, false);
}
@@ -1755,7 +1756,7 @@
preferences_->setModal(true);
preferences_->setAttribute(Qt::WA_DeleteOnClose);
connect(preferences_, SIGNAL(destroyed()), this, SLOT(preferencesDestroyed()));
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
connect(preferences_, SIGNAL(unityProgressbarChanged(bool)), this, SLOT(unityProgressbarSetEnabled(bool)));
#endif
preferences_->show();
@@ -1950,7 +1951,7 @@
//checks all needed settings
gv.pauseOnBattery=settings->value("pause_on_battery", false).toBool();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
gv.unityProgressbarEnabled=settings->value("unity_progressbar_enabled", false).toBool();
#endif
@@ -1960,7 +1961,7 @@
gv.potdDescriptionFont = settings->value("potd_description_font", "Ubuntu").toString();
gv.potdDescriptionColor = settings->value("potd_text_color", "#FFFFFF").toString();
gv.potdDescriptionBackgroundColor = settings->value("potd_background_color", "#000000").toString();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
gv.potdDescriptionLeftMargin = settings->value("potd_description_left_margin", (gv.currentDE == DesktopEnvironment::UnityGnome ? 60 : 0)).toInt();
#else
gv.potdDescriptionLeftMargin = settings->value("potd_description_left_margin", (0)).toInt();
@@ -2286,11 +2287,11 @@
connectToServer();
setupTray();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
mainWindowLaunched_=true;
MainWindow *mainWindow = new MainWindow(alreadyRunsMem_, globalParser_, imageFetcher_, websiteSnapshot_, wallpaperManager_, 0, 0);
connectMainwindowWithExternalActions(mainWindow);
@@ -2339,7 +2340,7 @@
}
connectToServer();
setupTray();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
if(gotPicLocation){
@@ -2350,7 +2351,7 @@
setUnityShortcutsState(false, false, false, false);
}
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
if(gotPicLocation){
generalTimer_->start(1000);
}
@@ -2377,7 +2378,7 @@
connectToServer();
setupTray();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
setUnityShortcutsState(true, false, false, false);
@@ -2405,12 +2406,12 @@
connectToServer();
setupTray();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
setUnityShortcutsState(true, false, false, false);
}
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
continueWithClock();
startStatisticsTimer();
@@ -2433,7 +2434,7 @@
checkSettings(true);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
setUnityShortcutsState(true, false, false, false);
@@ -2465,7 +2466,7 @@
websiteSnapshot_ = new WebsiteSnapshot();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
if(gv.currentDE == DesktopEnvironment::UnityGnome){
setupUnityShortcuts();
setUnityShortcutsState(true, false, false, false);
=== modified file 'src/tools/nonguimanager.h'
--- src/tools/nonguimanager.h 2015-08-24 17:15:53 +0000
+++ src/tools/nonguimanager.h 2016-01-04 13:58:41 +0000
@@ -97,9 +97,9 @@
bool propertiesShown_ = false;
bool justUpdatedPotd_ = false;
bool currentFolderIsAList_ = false;
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
DbusmenuMenuitem *unityMenu_;
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
QSystemTrayIcon *trayIcon_;
QMenu *trayIconMenu_;
@@ -127,7 +127,7 @@
QTimer *doubleClick_;
void setupTray();
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void updatePotdProgressMain();
void setUnityShortcutsState(bool stopState, bool pauseState, bool nextState, bool previousState);
void setupUnityShortcuts();
@@ -169,9 +169,9 @@
void dirChanged();
void researchDirs();
void onlineBackgroundReady(QString image);
-#ifdef Q_OS_UNIX
+#ifdef WITH_UNITY
void unityProgressbarSetEnabled(bool enabled);
-#endif //#ifdef Q_OS_UNIX
+#endif //#ifdef WITH_UNITY
void trayActionShowWindow();
void trayActionCopyPath();
=== modified file 'wallch.pro'
--- wallch.pro 2015-08-25 14:34:01 +0000
+++ wallch.pro 2016-01-04 13:58:41 +0000
@@ -19,7 +19,12 @@
QMAKE_TARGET_COPYRIGHT = "GNU General Public License"
} else {
CONFIG += link_pkgconfig
- PKGCONFIG += unity libnotify libexif gtk+-2.0
+ PKGCONFIG += libnotify libexif gtk+-2.0
+ UNAME = $$system(uname -a)
+ contains(UNAME, "Ubuntu"): {
+ PKGCONFIG += unity
+ DEFINES += "WITH_UNITY=1"
+ }
}
isEmpty(PREFIX) {