Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Diff patch to kaffeine to put it in the system tray when you have scheduled (or active) recordings.
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f96af22..915515c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -36,6 +36,8 @@
#include <KTabBar>
#include <KToolBar>
#include "dvb/dvbtab.h"
+#include "dvb/dvbmanager.h"
+#include "dvb/dvbrecording.h"
#include "playlist/playlisttab.h"
#include "configuration.h"
#include "configurationdialog.h"
@@ -729,3 +731,12 @@ void MainWindow::leaveEvent(QEvent *event)
KMainWindow::leaveEvent(event);
}
+
+bool MainWindow::queryClose()
+{
+ if(dvbTab->getManager()->getRecordingModel()->hasRecordings()) {
+ hide();
+ return false;
+ }
+ return true;
+}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 6b5c0cd..cf74db9 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -75,6 +75,7 @@ private:
bool event(QEvent *event);
void keyPressEvent(QKeyEvent *event);
void leaveEvent(QEvent *event);
+ bool queryClose();
KActionCollection *collection;
KRecentFilesAction *actionOpenRecent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment