def popup_dialog(self, label, notes): logger.debug("schedulerqt: popup_dialog: " + label + " " + notes) message = "<b>%s</b><br/><br/>%s" % (label, notes) self.dialog = QMessageBox(QMessageBox.Information, 'Remindor-Qt', message, QMessageBox.Close) self.dialog.setIconPixmap(QPixmap(get_data_file("media", "remindor-qt.png"))) self.dialog.show()
def popup_dialog(self, label, notes): logger.debug("schedulerqt: popup_dialog: " + label + " " + notes) message = "<b>%s</b><br/><br/>%s" % (label, notes) self.dialog = QMessageBox(QMessageBox.Information, 'Remindor-Qt', message, QMessageBox.Close) self.dialog.setIconPixmap( QPixmap(get_data_file("media", "remindor-qt.png"))) self.dialog.show()
def __init__(self, dbus_service = None, parent = None): super(RemindorQtWindow,self).__init__(parent) self.dbus_service = dbus_service helpers.setup_ui(self, "RemindorQtWindow.ui", True) self.resize(700, 300) self.action_add = self.findChild(QAction, "action_add") self.action_quick_add = self.findChild(QAction, "action_quick_add") self.action_edit = self.findChild(QAction, "action_edit") self.action_postpone = self.findChild(QAction, "action_postpone") self.action_delete = self.findChild(QAction, "action_delete") self.action_preferences = self.findChild(QAction, "action_preferences") self.action_news = self.findChild(QAction, "action_news") self.action_help = self.findChild(QAction, "action_help") self.action_close = self.findChild(QAction, "action_close") self.action_quit = self.findChild(QAction, "action_quit") self.action_refresh = self.findChild(QAction, "action_refresh") self.action_clear_icon = self.findChild(QAction, "action_clear_icon") self.action_bugs = self.findChild(QAction, "action_bugs") self.action_request = self.findChild(QAction, "action_request") self.action_translate = self.findChild(QAction, "action_translate") self.action_donate = self.findChild(QAction, "action_donate") self.action_ask = self.findChild(QAction, "action_ask") self.action_website = self.findChild(QAction, "action_website") self.action_about = self.findChild(QAction, "action_about") self.action_stop = self.findChild(QAction, "action_stop") self.translate() self.info = ManageWindowInfo(helpers.database_file()) self.active_icon = QIcon(helpers.get_data_file("media", "remindor-qt-active.svg")) self.app_icon = QIcon(helpers.get_data_file("media", "remindor-qt.svg")) self.attention_icon = QIcon.fromTheme("remindor-qt-attention", QIcon(helpers.get_data_file("media", "remindor-qt-attention.svg"))) self.tray_icons = [QIcon.fromTheme("remindor-qt-active", self.active_icon), self.active_icon, QIcon(helpers.get_data_file("media", "remindor-qt-active_dark.svg")), QIcon.fromTheme("remindor-qt", self.app_icon)] self.reminder_tree = self.findChild(QTreeWidget, "reminder_tree") self.reminder_tree.setColumnWidth(0, 200) edit = QAction(QIcon.fromTheme("gtk-edit", QIcon(":/icons/edit.png")), _("Edit"), self) edit.triggered.connect(self.on_action_edit_triggered) self.reminder_tree.addAction(edit) postpone = QAction(QIcon.fromTheme("go-jump", QIcon(":/icons/postpone.png")), _("Postpone"), self) postpone.triggered.connect(self.on_action_postpone_triggered) self.reminder_tree.addAction(postpone) delete = QAction(QIcon.fromTheme("edit-delete", QIcon(":/icons/delete.png")), _("Delete"), self) delete.triggered.connect(self.on_action_delete_triggered) self.reminder_tree.addAction(delete) self.news_action = self.findChild(QAction, "action_news") self.tray_menu = QMenu() self.tray_menu.addAction(QIcon.fromTheme("add", QIcon(":/icons/add.png")), _("Add"), self, SLOT("on_action_add_triggered()")) self.tray_menu.addAction(QIcon.fromTheme("media-playback-start", QIcon(":/icons/wand.png")), _("Simple Add"), self, SLOT("on_action_simple_add_triggered()")) self.tray_menu.addAction(QIcon.fromTheme("media-skip-forward", QIcon(":/icons/quick.png")), _("Quick Add"), self, SLOT("on_action_quick_add_triggered()")) self.tray_menu.addAction(QIcon.fromTheme("media-playback-stop", QIcon(":/icons/delete.png")), _("Stop Sound"), self, SLOT("on_action_stop_triggered()")) self.tray_menu.addAction(QIcon.fromTheme("stock_properties", QIcon(":/icons/manage.png")), _("Manage"), self, SLOT("show()")) self.tray_menu.addAction(QIcon.fromTheme("exit", QIcon(":/icons/quit.png")), _("Quit"), self, SLOT("on_action_quit_triggered()")) #TODO: change this when reimplementing x-close button self.tray_icon = QSystemTrayIcon(self.tray_icons[self.info.indicator_icon], self) self.tray_icon.setContextMenu(self.tray_menu) self.tray_icon.show() self.tray_icon.activated.connect(self.tray_activated) self.scheduler = SchedulerQt(self.tray_icon, self.attention_icon, self.update_slot, helpers.database_file()) if not self.dbus_service == None: self.scheduler.add_dbus_service(self.dbus_service) self.update() self.updater = QTimer(self) self.updater.setInterval(1000 * 60 * 60 * 6) #update everything every 1/4 day self.updater.timeout.connect(self.update_schedule) b = BlogReader(rssfeed, helpers.database_file()) b.start() for reminder in self.info.missed_reminders: self.scheduler.run_alarm(reminder)
def __init__(self, dbus_service=None, parent=None): super(RemindorQtWindow, self).__init__(parent) self.dbus_service = dbus_service helpers.setup_ui(self, "RemindorQtWindow.ui", True) self.resize(700, 300) self.action_add = self.findChild(QAction, "action_add") self.action_quick_add = self.findChild(QAction, "action_quick_add") self.action_edit = self.findChild(QAction, "action_edit") self.action_postpone = self.findChild(QAction, "action_postpone") self.action_delete = self.findChild(QAction, "action_delete") self.action_preferences = self.findChild(QAction, "action_preferences") self.action_news = self.findChild(QAction, "action_news") self.action_help = self.findChild(QAction, "action_help") self.action_close = self.findChild(QAction, "action_close") self.action_quit = self.findChild(QAction, "action_quit") self.action_refresh = self.findChild(QAction, "action_refresh") self.action_clear_icon = self.findChild(QAction, "action_clear_icon") self.action_bugs = self.findChild(QAction, "action_bugs") self.action_request = self.findChild(QAction, "action_request") self.action_translate = self.findChild(QAction, "action_translate") self.action_donate = self.findChild(QAction, "action_donate") self.action_ask = self.findChild(QAction, "action_ask") self.action_website = self.findChild(QAction, "action_website") self.action_about = self.findChild(QAction, "action_about") self.action_stop = self.findChild(QAction, "action_stop") self.translate() self.info = ManageWindowInfo(helpers.database_file()) self.active_icon = QIcon( helpers.get_data_file("media", "remindor-qt-active.svg")) self.app_icon = QIcon(helpers.get_data_file("media", "remindor-qt.svg")) self.attention_icon = QIcon.fromTheme( "remindor-qt-attention", QIcon(helpers.get_data_file("media", "remindor-qt-attention.svg"))) self.tray_icons = [ QIcon.fromTheme("remindor-qt-active", self.active_icon), self.active_icon, QIcon(helpers.get_data_file("media", "remindor-qt-active_dark.svg")), QIcon.fromTheme("remindor-qt", self.app_icon) ] self.reminder_tree = self.findChild(QTreeWidget, "reminder_tree") self.reminder_tree.setColumnWidth(0, 200) edit = QAction(QIcon.fromTheme("gtk-edit", QIcon(":/icons/edit.png")), _("Edit"), self) edit.triggered.connect(self.on_action_edit_triggered) self.reminder_tree.addAction(edit) postpone = QAction( QIcon.fromTheme("go-jump", QIcon(":/icons/postpone.png")), _("Postpone"), self) postpone.triggered.connect(self.on_action_postpone_triggered) self.reminder_tree.addAction(postpone) delete = QAction( QIcon.fromTheme("edit-delete", QIcon(":/icons/delete.png")), _("Delete"), self) delete.triggered.connect(self.on_action_delete_triggered) self.reminder_tree.addAction(delete) self.news_action = self.findChild(QAction, "action_news") self.tray_menu = QMenu() self.tray_menu.addAction( QIcon.fromTheme("add", QIcon(":/icons/add.png")), _("Add"), self, SLOT("on_action_add_triggered()")) self.tray_menu.addAction( QIcon.fromTheme("media-playback-start", QIcon(":/icons/wand.png")), _("Simple Add"), self, SLOT("on_action_simple_add_triggered()")) self.tray_menu.addAction( QIcon.fromTheme("media-skip-forward", QIcon(":/icons/quick.png")), _("Quick Add"), self, SLOT("on_action_quick_add_triggered()")) self.tray_menu.addAction( QIcon.fromTheme("media-playback-stop", QIcon(":/icons/delete.png")), _("Stop Sound"), self, SLOT("on_action_stop_triggered()")) self.tray_menu.addAction( QIcon.fromTheme("stock_properties", QIcon(":/icons/manage.png")), _("Manage"), self, SLOT("show()")) self.tray_menu.addAction( QIcon.fromTheme("exit", QIcon(":/icons/quit.png")), _("Quit"), self, SLOT("on_action_quit_triggered()") ) #TODO: change this when reimplementing x-close button self.tray_icon = QSystemTrayIcon( self.tray_icons[self.info.indicator_icon], self) self.tray_icon.setContextMenu(self.tray_menu) self.tray_icon.show() self.tray_icon.activated.connect(self.tray_activated) self.scheduler = SchedulerQt(self.tray_icon, self.attention_icon, self.update_slot, helpers.database_file()) if not self.dbus_service == None: self.scheduler.add_dbus_service(self.dbus_service) self.update() self.updater = QTimer(self) self.updater.setInterval(1000 * 60 * 60 * 6) #update everything every 1/4 day self.updater.timeout.connect(self.update_schedule) b = BlogReader(rssfeed, helpers.database_file()) b.start() for reminder in self.info.missed_reminders: self.scheduler.run_alarm(reminder)