Skip to content

Instantly share code, notes, and snippets.

@Korvox
Created May 20, 2013 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Korvox/5614695 to your computer and use it in GitHub Desktop.
Save Korvox/5614695 to your computer and use it in GitHub Desktop.
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