59 lines
1.9 KiB
Diff
59 lines
1.9 KiB
Diff
|
--- src/mainwindow.cpp.orig 2013-09-06 16:22:58.000000000 +0200
|
||
|
+++ src/mainwindow.cpp 2013-10-11 16:22:09.078721507 +0200
|
||
|
@@ -52,6 +52,7 @@
|
||
|
#else
|
||
|
#include "searchlineedit.h"
|
||
|
#endif
|
||
|
+#include <QProcess>
|
||
|
#include <iostream>
|
||
|
#ifdef APP_EXTRA
|
||
|
#include "extra.h"
|
||
|
@@ -1034,11 +1035,13 @@
|
||
|
pauseAct->setIcon(Utils::icon("media-playback-pause"));
|
||
|
pauseAct->setText(tr("&Pause"));
|
||
|
pauseAct->setStatusTip(tr("Pause playback") + " (" + pauseAct->shortcut().toString(QKeySequence::NativeText) + ")");
|
||
|
+ inhibitScreensaver(new QString("suspend"));
|
||
|
// stopAct->setEnabled(true);
|
||
|
break;
|
||
|
|
||
|
case Phonon::StoppedState:
|
||
|
pauseAct->setEnabled(false);
|
||
|
+ inhibitScreensaver(new QString("resume"));
|
||
|
// stopAct->setEnabled(false);
|
||
|
break;
|
||
|
|
||
|
@@ -1047,6 +1050,7 @@
|
||
|
pauseAct->setIcon(Utils::icon("media-playback-start"));
|
||
|
pauseAct->setText(tr("&Play"));
|
||
|
pauseAct->setStatusTip(tr("Resume playback") + " (" + pauseAct->shortcut().toString(QKeySequence::NativeText) + ")");
|
||
|
+ inhibitScreensaver(new QString("resume"));
|
||
|
// stopAct->setEnabled(true);
|
||
|
break;
|
||
|
|
||
|
@@ -1063,6 +1067,14 @@
|
||
|
}
|
||
|
}
|
||
|
|
||
|
+void MainWindow::inhibitScreensaver(QString *action) {
|
||
|
+ QStringList arguments;
|
||
|
+ QString s = QString::number(winId());
|
||
|
+ arguments << *action << s;
|
||
|
+ QProcess *screensaver = new QProcess();
|
||
|
+ screensaver->start("xdg-screensaver", arguments);
|
||
|
+}
|
||
|
+
|
||
|
void MainWindow::stop() {
|
||
|
mediaView->stop();
|
||
|
showHome();
|
||
|
--- src/mainwindow.h.orig 2013-09-06 16:22:58.000000000 +0200
|
||
|
+++ src/mainwindow.h 2013-10-11 16:23:38.412274795 +0200
|
||
|
@@ -103,7 +103,7 @@
|
||
|
void setDefinitionMode(QString definitionName);
|
||
|
void toggleDefinitionMode();
|
||
|
void clearRecentKeywords();
|
||
|
-
|
||
|
+ void inhibitScreensaver(QString *action);
|
||
|
// volume shortcuts
|
||
|
void volumeUp();
|
||
|
void volumeDown();
|