From edb40bbfb6e0a206e7d080740919717040733183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 10 Jun 2014 01:15:26 +0200 Subject: [PATCH] Notify about dom0 updates (#824) Tray notifications from cron job (outside of session) didn't worked well. --- qubesmanager/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index e5cff64..c888551 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -116,6 +116,9 @@ class QubesManagerFileWatcher(ProcessEvent): event.path = qubes_clipboard_info_file self.process_IN_CLOSE_WRITE(event) wm.add_watch(qubes_clipboard_info_file, EventsCodes.OP_FLAGS.get('IN_CLOSE_WRITE')) + elif event.name == os.path.basename(table_widgets\ + .qubes_dom0_updates_stat_file): + trayIcon.showMessage("Qubes dom0 updates available.", msecs=0) @@ -1573,6 +1576,10 @@ class QubesTrayIcon(QSystemTrayIcon): .arguments()) > 1: self.tray_notifier_type = srv_info.arguments()[1] + if os.path.exists(table_widgets.qubes_dom0_updates_stat_file): + self.showMessage("Qubes dom0 updates available.", msecs=0) + + def update_blk_menu(self): global manager_window @@ -1885,6 +1892,8 @@ def main(): wm.add_watch(os.path.dirname(system_path["qubes_store_filename"]), EventsCodes.OP_FLAGS.get('IN_MOVED_TO')) wm.add_watch(qubes_clipboard_info_file, EventsCodes.OP_FLAGS.get('IN_CLOSE_WRITE')) wm.add_watch(os.path.dirname(qubes_clipboard_info_file), EventsCodes.OP_FLAGS.get('IN_CREATE')) + wm.add_watch(os.path.dirname(table_widgets.qubes_dom0_updates_stat_file), + EventsCodes.OP_FLAGS.get('IN_CREATE')) global system_bus system_bus = QDBusConnection.systemBus()