def __init__(self, parent=None): super(AboutDialog, self).__init__(parent) helpers.setup_ui(self, "AboutDialog.ui") self.license_label = self.findChild(QLabel, "license_label") self.version_label = self.findChild(QLabel, "version_label") self.version_label.setText(get_version()) self.credits_button = self.findChild(QPushButton, "credits_button") self.close_button = self.findChild(QPushButton, "close_button") self.translate()
def __init__(self, parent = None): super(AboutDialog, self).__init__(parent) helpers.setup_ui(self, "AboutDialog.ui") self.license_label = self.findChild(QLabel, "license_label") self.version_label = self.findChild(QLabel, "version_label") self.version_label.setText(get_version()) self.credits_button = self.findChild(QPushButton, "credits_button") self.close_button = self.findChild(QPushButton, "close_button") self.translate()
def __init__(self, command="", parent=None): super(CommandDialog, self).__init__(parent) helpers.setup_ui(self, "CommandDialog.ui") self.insert_button = self.findChild(QPushButton, "insert_button") self.insert_combo = self.findChild(QComboBox, "insert_combo") self.command_label = self.findChild(QLabel, "command_label") self.command_edit = self.findChild(QLineEdit, "command_edit") self.command_edit.setText(command) self.cancel_button = self.findChild(QPushButton, "cancel_button") self.ok_button = self.findChild(QPushButton, "ok_button") self.translate()
def __init__(self, command = "", parent = None): super(CommandDialog, self).__init__(parent) helpers.setup_ui(self, "CommandDialog.ui") self.insert_button = self.findChild(QPushButton, "insert_button") self.insert_combo = self.findChild(QComboBox, "insert_combo") self.command_label = self.findChild(QLabel, "command_label") self.command_edit = self.findChild(QLineEdit, "command_edit") self.command_edit.setText(command) self.cancel_button = self.findChild(QPushButton, "cancel_button") self.ok_button = self.findChild(QPushButton, "ok_button") self.translate()
def __init__(self, date_s="", parent=None): super(DateDialog, self).__init__(parent) helpers.setup_ui(self, "DateDialog.ui") self.info = DateDialogInfo(date_s, helpers.database_file()) self.cancel_button = self.findChild(QPushButton, "cancel_button") self.ok_button = self.findChild(QPushButton, "ok_button") self.date_label = self.findChild(QLabel, "date_label") self.date_combo = self.findChild(QComboBox, "date_combo") self.on_label = self.findChild(QLabel, "on_label") self.on_combo = self.findChild(QComboBox, "on_combo") self.on_date = self.findChild(QDateEdit, "on_date") self.every_label = self.findChild(QLabel, "every_label") self.every_combo = self.findChild(QComboBox, "every_combo") self.every_label2 = self.findChild(QLabel, "every_label2") self.every_spin = self.findChild(QSpinBox, "every_spin") self.days_label = self.findChild(QLabel, "days_label") self.from_label = self.findChild(QLabel, "from_label") self.from_date = self.findChild(QDateEdit, "from_date") self.from_check = self.findChild(QCheckBox, "from_check") self.to_label = self.findChild(QLabel, "to_label") self.to_date = self.findChild(QDateEdit, "to_date") self.error_label = self.findChild(QLabel, "error_label") self.error_label.hide() self.translate() self.on_date.setDisplayFormat(self.info.qt_date_format) self.on_date.setDate( QDate.fromString(self.info.once_date, self.info.qt_date_format)) self.from_date.setDisplayFormat(self.info.qt_date_format) self.from_date.setDate( QDate.fromString(self.info.from_date, self.info.qt_date_format)) self.from_check.setChecked(self.info.check) self.to_date.setDisplayFormat(self.info.qt_date_format) self.to_date.setDate( QDate.fromString(self.info.to_date, self.info.qt_date_format)) self.date_combo.setCurrentIndex(self.info.active) self.every_combo.setCurrentIndex(self.info.every_active) self.every_spin.setValue(self.info.every_spin) self.on_date_combo_currentIndexChanged()
def __init__(self, time_s="", parent=None): super(TimeDialog, self).__init__(parent) helpers.setup_ui(self, "TimeDialog.ui") self.info = TimeDialogInfo(time_s, helpers.database_file()) self.cancel_button = self.findChild(QPushButton, "cancel_button") self.ok_button = self.findChild(QPushButton, "ok_button") self.time_label = self.findChild(QLabel, "time_label") self.time_combo = self.findChild(QComboBox, "time_combo") self.error_label = self.findChild(QLabel, "error_label") self.error_label.hide() self.at_label = self.findChild(QLabel, "at_label") self.at_time = self.findChild(QTimeEdit, "at_time") self.every_label = self.findChild(QLabel, "every_label") self.every_spin = self.findChild(QSpinBox, "every_spin") self.mh_label = self.findChild(QLabel, "mh_label") self.from_label = self.findChild(QLabel, "from_label") self.from_time = self.findChild(QTimeEdit, "from_time") self.from_check = self.findChild(QCheckBox, "from_check") self.to_label = self.findChild(QLabel, "to_label") self.to_time = self.findChild(QTimeEdit, "to_time") self.translate() self.at_time.setDisplayFormat(self.info.qt_time_format) self.at_time.setTime( QTime.fromString(self.info.once_s, self.info.qt_time_format)) self.from_time.setDisplayFormat(self.info.qt_time_format) self.from_time.setTime( QTime.fromString(self.info.from_s, self.info.qt_time_format)) self.to_time.setDisplayFormat(self.info.qt_time_format) self.to_time.setTime( QTime.fromString(self.info.to_s, self.info.qt_time_format)) self.from_check.setChecked(self.info.check) self.time_combo.setCurrentIndex(self.info.active) self.every_spin.setValue(self.info.every) #setup window self.on_time_combo_currentIndexChanged() self.validate_from_to()
def __init__(self, date_s = "", parent = None): super(DateDialog, self).__init__(parent) helpers.setup_ui(self, "DateDialog.ui") self.info = DateDialogInfo(date_s, helpers.database_file()) self.cancel_button = self.findChild(QPushButton, "cancel_button") self.ok_button = self.findChild(QPushButton, "ok_button") self.date_label = self.findChild(QLabel, "date_label") self.date_combo = self.findChild(QComboBox, "date_combo") self.on_label = self.findChild(QLabel, "on_label") self.on_combo = self.findChild(QComboBox, "on_combo") self.on_date = self.findChild(QDateEdit, "on_date") self.every_label = self.findChild(QLabel, "every_label") self.every_combo = self.findChild(QComboBox, "every_combo") self.every_label2 = self.findChild(QLabel, "every_label2") self.every_spin = self.findChild(QSpinBox, "every_spin") self.days_label = self.findChild(QLabel, "days_label") self.from_label = self.findChild(QLabel, "from_label") self.from_date = self.findChild(QDateEdit, "from_date") self.from_check = self.findChild(QCheckBox, "from_check") self.to_label = self.findChild(QLabel, "to_label") self.to_date = self.findChild(QDateEdit, "to_date") self.error_label = self.findChild(QLabel, "error_label") self.error_label.hide() self.translate() self.on_date.setDisplayFormat(self.info.qt_date_format) self.on_date.setDate(QDate.fromString(self.info.once_date, self.info.qt_date_format)) self.from_date.setDisplayFormat(self.info.qt_date_format) self.from_date.setDate(QDate.fromString(self.info.from_date, self.info.qt_date_format)) self.from_check.setChecked(self.info.check) self.to_date.setDisplayFormat(self.info.qt_date_format) self.to_date.setDate(QDate.fromString(self.info.to_date, self.info.qt_date_format)) self.date_combo.setCurrentIndex(self.info.active) self.every_combo.setCurrentIndex(self.info.every_active) self.every_spin.setValue(self.info.every_spin) self.on_date_combo_currentIndexChanged()
def __init__(self, parent=None): super(QuickDialog, self).__init__(parent) helpers.setup_ui(self, "QuickDialog.ui") self.info = QuickDialogInfo(helpers.database_file()) self.label_label = self.findChild(QLabel, "label_label") self.label_edit = self.findChild(QLineEdit, "label_edit") self.label_edit.setText(self.info.label) self.value_label = self.findChild(QLabel, "value_label") self.value_label.setNum(self.info.minutes) self.in_label = self.findChild(QLabel, "in_label") self.in_slider = self.findChild(QSlider, "in_slider") self.in_slider.setValue(self.info.minutes) self.in_label2 = self.findChild(QLabel, "in_label2") self.in_spin = self.findChild(QSpinBox, "in_spin") self.in_spin.setValue(self.info.minutes) self.unit_combo = self.findChild(QComboBox, "unit_combo") self.unit_combo2 = self.findChild(QComboBox, "unit_combo2") self.info_label = self.findChild(QLabel, "info_label") self.info_label.setText(self.info.info) if not self.info.show_info: self.info_label.hide() if self.info.show_slider: self.in_spin.hide() self.findChild(QLabel, "in_label2").hide() #self.findChild(QLabel, "minutes_label2").hide() self.unit_combo.hide() else: self.in_slider.hide() self.value_label.hide() self.findChild(QLabel, "in_label").hide() #self.findChild(QLabel, "minutes_label2").hide() self.unit_combo2.hide() self.translate() self.unit_combo.setCurrentIndex(self.info.unit) self.unit_combo2.setCurrentIndex(self.info.unit)
def __init__(self, parent=None): super(SimpleDialog, self).__init__(parent) helpers.setup_ui(self, "SimpleDialog.ui") self.info = SimpleDialogInfo(helpers.database_file()) self.reminder_edit = self.findChild(QLineEdit, "reminder_edit") self.reminder_label = self.findChild(QLabel, "reminder_label") self.reminder_error = self.findChild(QToolButton, "reminder_error") self.reminder_error.hide() self.help_button = self.findChild(QPushButton, "help_button") self.cancel_button = self.findChild(QPushButton, "cancel_button") self.add_button = self.findChild(QPushButton, "add_button") self.translate() self.info = SimpleDialogInfo(helpers.database_file()) self.show_label_error = False
def __init__(self, time_s = "", parent = None): super(TimeDialog, self).__init__(parent) helpers.setup_ui(self, "TimeDialog.ui") self.info = TimeDialogInfo(time_s, helpers.database_file()) self.cancel_button = self.findChild(QPushButton, "cancel_button") self.ok_button = self.findChild(QPushButton, "ok_button") self.time_label = self.findChild(QLabel, "time_label") self.time_combo = self.findChild(QComboBox, "time_combo") self.error_label = self.findChild(QLabel, "error_label") self.error_label.hide() self.at_label = self.findChild(QLabel, "at_label") self.at_time = self.findChild(QTimeEdit, "at_time") self.every_label = self.findChild(QLabel, "every_label") self.every_spin = self.findChild(QSpinBox, "every_spin") self.mh_label = self.findChild(QLabel, "mh_label") self.from_label = self.findChild(QLabel, "from_label") self.from_time = self.findChild(QTimeEdit, "from_time") self.from_check = self.findChild(QCheckBox, "from_check") self.to_label = self.findChild(QLabel, "to_label") self.to_time = self.findChild(QTimeEdit, "to_time") self.translate() self.at_time.setDisplayFormat(self.info.qt_time_format) self.at_time.setTime(QTime.fromString(self.info.once_s, self.info.qt_time_format)) self.from_time.setDisplayFormat(self.info.qt_time_format) self.from_time.setTime(QTime.fromString(self.info.from_s, self.info.qt_time_format)) self.to_time.setDisplayFormat(self.info.qt_time_format) self.to_time.setTime(QTime.fromString(self.info.to_s, self.info.qt_time_format)) self.from_check.setChecked(self.info.check) self.time_combo.setCurrentIndex(self.info.active) self.every_spin.setValue(self.info.every) #setup window self.on_time_combo_currentIndexChanged() self.validate_from_to()
def __init__(self, parent=None): super(PreferencesDialog, self).__init__(parent) helpers.setup_ui(self, "PreferencesDialog.ui") self.info = PreferencesDialogInfo(helpers.database_file()) self.settings = self.info.settings self.boxcar_original = self.settings.boxcar_token self.stack_widget = self.findChild(QStackedWidget, "stack") self.list_widget = self.findChild(QListWidget, "list") self.label_label = self.findChild(QLabel, "label_label") self.time_label = self.findChild(QLabel, "time_label") self.date_label = self.findChild(QLabel, "date_label") self.command_label = self.findChild(QLabel, "command_label") self.postpone_label = self.findChild(QLabel, "postpone_label") self.label_edit = self.findChild(QLineEdit, "label_edit") self.label_edit.setText(self.settings.label) self.time_edit = self.findChild(QLineEdit, "time_edit") self.time_edit.setText(self.settings.time) self.date_edit = self.findChild(QLineEdit, "date_edit") self.date_edit.setText(self.settings.date) self.command_edit = self.findChild(QLineEdit, "command_edit") self.command_edit.setText(self.settings.command) self.postpone_spin = self.findChild(QSpinBox, "postpone_spin") self.postpone_spin.setValue(int(self.settings.postpone)) self.time_button = self.findChild(QPushButton, "time_button") self.date_button = self.findChild(QPushButton, "date_button") self.command_button = self.findChild(QPushButton, "command_button") self.time_error = self.findChild(QToolButton, "time_error") self.time_error.hide() self.date_error = self.findChild(QToolButton, "date_error") self.date_error.hide() self.popup_label = self.findChild(QLabel, "popup_label") self.dialog_label = self.findChild(QLabel, "dialog_label") self.change_icon_label = self.findChild(QLabel, "change_icon_label") self.popup_check = self.findChild(QCheckBox, "popup_check") self.popup_check.setChecked(self.settings.popup) self.dialog_check = self.findChild(QCheckBox, "dialog_check") self.dialog_check.setChecked(self.settings.dialog) self.change_icon_check = self.findChild(QCheckBox, "change_icon_check") self.change_icon_check.setChecked(self.settings.change_indicator) self.file_label = self.findChild(QLabel, "sound_label") self.length_label = self.findChild(QLabel, "length_label") self.length_label2 = self.findChild(QLabel, "length_label2") self.loop_label = self.findChild(QLabel, "loop_label") self.time_loop_label = self.findChild(QLabel, "time_loop_label") self.file_edit = self.findChild(QLineEdit, "file_edit") self.file_edit.setText(self.settings.sound_file) self.length_spin = self.findChild(QSpinBox, "length_spin") self.length_spin.setValue(int(self.settings.sound_play_length)) self.loop_check = self.findChild(QCheckBox, "loop_check") self.loop_check.setChecked(self.settings.sound_loop) self.time_loop_spin = self.findChild(QSpinBox, "time_loop_spin") self.time_loop_spin.setValue(self.settings.sound_loop_times) self.quick_label_label = self.findChild(QLabel, "quick_label_label") self.quick_minutes_label = self.findChild(QLabel, "quick_minutes_label") self.quick_unit_label = self.findChild(QLabel, "quick_unit_label") self.quick_slider_label = self.findChild(QLabel, "quick_slider_label") self.quick_popup_label = self.findChild(QLabel, "quick_popup_label") self.quick_dialog_label = self.findChild(QLabel, "quick_dialog_label") self.quick_sound_label = self.findChild(QLabel, "quick_sound_label") self.quick_info_label = self.findChild(QLabel, "quick_info_label") self.quick_label_edit = self.findChild(QLineEdit, "quick_label_edit") self.quick_label_edit.setText(self.settings.quick_label) self.quick_minutes_spin = self.findChild(QSpinBox, "quick_minutes_spin") self.quick_minutes_spin.setValue(self.settings.quick_minutes) self.quick_unit_combo = self.findChild(QComboBox, "quick_unit_combo") self.quick_slider_check = self.findChild(QCheckBox, "quick_slider_check") self.quick_slider_check.setChecked(self.settings.quick_slider) self.quick_popup_check = self.findChild(QCheckBox, "quick_popup_check") self.quick_popup_check.setChecked(self.settings.quick_popup) self.quick_dialog_check = self.findChild(QCheckBox, "quick_dialog_check") self.quick_dialog_check.setChecked(self.settings.quick_dialog) self.quick_sound_check = self.findChild(QCheckBox, "quick_sound_check") self.quick_sound_check.setChecked(self.settings.quick_sound) self.quick_info_check = self.findChild(QCheckBox, "quick_info_check") self.quick_info_check.setChecked(self.settings.quick_info) self.simple_popup_label = self.findChild(QLabel, "simple_popup_label") self.simple_dialog_label = self.findChild(QLabel, "simple_dialog_label") self.simple_sound_label = self.findChild(QLabel, "simple_sound_label") self.simple_popup_check = self.findChild(QCheckBox, "simple_popup_check") self.simple_popup_check.setChecked(self.settings.simple_popup) self.simple_dialog_check = self.findChild(QCheckBox, "simple_dialog_check") self.simple_dialog_check.setChecked(self.settings.simple_dialog) self.simple_sound_check = self.findChild(QCheckBox, "simple_sound_check") self.simple_sound_check.setChecked(self.settings.simple_sound) self.today_label = self.findChild(QLabel, "today_label") self.future_label = self.findChild(QLabel, "future_label") self.past_label = self.findChild(QLabel, "past_label") self.new_label = self.findChild(QLabel, "new_label") self.icon_label = self.findChild(QLabel, "icon_label") self.hide_label = self.findChild(QLabel, "hide_label") self.today_color = self.settings.today_color self.today_color_rgb = self.info.today_color_rgb r = self.today_color_rgb[0] g = self.today_color_rgb[1] b = self.today_color_rgb[2] self.today_button = self.findChild(QPushButton, "today_button") self.today_button.setStyleSheet( "QPushButton { color:rgb(%d, %d, %d) }" % (r, g, b)) self.today_button.setText("(%d, %d, %d)" % (r, g, b)) self.future_color = self.settings.future_color self.future_color_rgb = self.info.future_color_rgb r = self.future_color_rgb[0] g = self.future_color_rgb[1] b = self.future_color_rgb[2] self.future_button = self.findChild(QPushButton, "future_button") self.future_button.setStyleSheet( "QPushButton { color:rgb(%d, %d, %d) }" % (r, g, b)) self.future_button.setText("(%d, %d, %d)" % (r, g, b)) self.past_color = self.settings.past_color self.past_color_rgb = self.info.past_color_rgb r = self.past_color_rgb[0] g = self.past_color_rgb[1] b = self.past_color_rgb[2] self.past_button = self.findChild(QPushButton, "past_button") self.past_button.setStyleSheet( "QPushButton { color:rgb(%d, %d, %d) }" % (r, g, b)) self.past_button.setText("(%d, %d, %d)" % (r, g, b)) self.new_check = self.findChild(QCheckBox, "new_check") self.new_check.setChecked(self.settings.show_news) self.icon_combo = self.findChild(QComboBox, "icon_combo") self.hide_check = self.findChild(QCheckBox, "hide_check") self.hide_check.setChecked(self.settings.hide_indicator) self.hide_start = self.settings.hide_indicator if not use_dbus: self.hide_check.setChecked(False) self.hide_check.setDisabled(True) self.hide_label.setDisabled(True) self.time_format_label = self.findChild(QLabel, "time_format_label") self.date_format_label = self.findChild(QLabel, "date_format_label") self.time_format_combo = self.findChild(QComboBox, "time_format_combo") self.date_format_combo = self.findChild(QComboBox, "date_format_combo") self.boxcar_token_button = self.findChild(QCommandLinkButton, "boxcar_token_button") self.boxcar_notification_label = self.findChild( QLabel, "boxcar_notification_label") self.boxcar_token_edit = self.findChild(QLineEdit, "boxcar_token_edit") self.boxcar_token_edit.setText(self.settings.boxcar_token) self.boxcar_notification_check = self.findChild( QCheckBox, "boxcar_notification_check") self.boxcar_notification_check.setChecked(self.settings.boxcar_notify) self.pushbullet_button = self.findChild(QCommandLinkButton, 'pushbullet_button') self.pushbullet_device_label = self.findChild( QLabel, 'pushbullet_device_label') self.pushbullet_api_key_edit = self.findChild( QLineEdit, 'pushbullet_api_key_edit') self.pushbullet_api_key_edit.setText(self.settings.pushbullet_api_key) self.pushbullet_device_edit = self.findChild(QComboBox, 'pushbullet_device_edit') self.pushbullet_refresh = self.findChild(QPushButton, 'pushbullet_refresh') self.refresh_pushbullet_combobox(self.settings.pushbullet_devices) self.pushbullet_valid = self.settings.pushbullet_api_key self.help_button = self.findChild(QPushButton, "help_button") self.cancel_button = self.findChild(QPushButton, "cancel_button") self.save_button = self.findChild(QPushButton, "save_button") self.translate() self.icon_combo.setCurrentIndex(self.settings.indicator_icon) self.time_format_combo.setCurrentIndex(self.settings.time_format) self.date_format_combo.setCurrentIndex(self.settings.date_format) self.quick_unit_combo.setCurrentIndex(self.settings.quick_unit)
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, parent=None): super(ReminderDialog, self).__init__(parent) helpers.setup_ui(self, "ReminderDialog.ui") self.help_button = self.findChild(QPushButton, "help_button") self.cancel_button = self.findChild(QPushButton, "cancel_button") self.add_button = self.findChild(QPushButton, "add_button") self.save_button = self.findChild(QPushButton, "save_button") self.save_button.hide() self.tabs = self.findChild(QTabWidget, "tabs") self.label_label = self.findChild(QLabel, "label_label") self.time_label = self.findChild(QLabel, "time_label") self.date_label = self.findChild(QLabel, "date_label") self.command_label = self.findChild(QLabel, "command_label") self.notes_label = self.findChild(QLabel, "notes_label") self.label_edit = self.findChild(QLineEdit, "label_edit") self.time_edit = self.findChild(QLineEdit, "time_edit") self.date_edit = self.findChild(QLineEdit, "date_edit") self.command_edit = self.findChild(QLineEdit, "command_edit") self.notes_edit = self.findChild(QPlainTextEdit, "notes_edit") self.time_button = self.findChild(QPushButton, "time_button") self.date_button = self.findChild(QPushButton, "date_button") self.command_button = self.findChild(QPushButton, "command_button") self.insert_button = self.findChild(QPushButton, "notes_button") self.time_error = self.findChild(QToolButton, "time_error") self.time_error.hide() self.date_error = self.findChild(QToolButton, "date_error") self.date_error.hide() self.popup_check = self.findChild(QCheckBox, "popup_check") self.dialog_check = self.findChild(QCheckBox, "dialog_check") self.boxcar_check = self.findChild(QCheckBox, "boxcar_check") self.boxcar_label = self.findChild(QLabel, "boxcar_label") self.boxcar_label.hide() self.pushbullet_device_label = self.findChild( QLabel, 'pushbullet_device_label') self.pushbullet_device_edit = self.findChild(QComboBox, 'pushbullet_device_edit') self.pushbullet_info_label = self.findChild(QLabel, 'pushbullet_info_label') self.pushbullet_refresh = self.findChild(QPushButton, 'pushbullet_refresh') self.sound_label = self.findChild(QLabel, "sound_label") self.file_label = self.findChild(QLabel, "file_label") self.length_label = self.findChild(QLabel, "length_label") self.loop_label = self.findChild(QLabel, "loop_label") self.length_label2 = self.findChild(QLabel, "length_label2") self.sound_check = self.findChild(QCheckBox, "sound_check") self.file_edit = self.findChild(QLineEdit, "file_edit") self.length_spin = self.findChild(QSpinBox, "length_spin") self.loop_check = self.findChild(QCheckBox, "loop_check") self.insert_combo = self.findChild(QComboBox, "insert_combo") self.info = ReminderDialogInfo(helpers.database_file()) self.set_data(self.info.label, self.info.time, self.info.date, self.info.command, self.info.notes, self.info.popup, self.info.dialog, self.info.boxcar, self.info.pushbullet_device, self.info.sound_file, self.info.sound_length, self.info.sound_loop) self.translate()
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, parent = None): super(ReminderDialog, self).__init__(parent) helpers.setup_ui(self, "ReminderDialog.ui") self.help_button = self.findChild(QPushButton, "help_button") self.cancel_button = self.findChild(QPushButton, "cancel_button") self.add_button = self.findChild(QPushButton, "add_button") self.save_button = self.findChild(QPushButton, "save_button") self.save_button.hide() self.tabs = self.findChild(QTabWidget, "tabs") self.label_label = self.findChild(QLabel, "label_label") self.time_label = self.findChild(QLabel, "time_label") self.date_label = self.findChild(QLabel, "date_label") self.command_label = self.findChild(QLabel, "command_label") self.notes_label = self.findChild(QLabel, "notes_label") self.label_edit = self.findChild(QLineEdit, "label_edit") self.time_edit = self.findChild(QLineEdit, "time_edit") self.date_edit = self.findChild(QLineEdit, "date_edit") self.command_edit = self.findChild(QLineEdit, "command_edit") self.notes_edit = self.findChild(QPlainTextEdit, "notes_edit") self.time_button = self.findChild(QPushButton, "time_button") self.date_button = self.findChild(QPushButton, "date_button") self.command_button = self.findChild(QPushButton, "command_button") self.insert_button = self.findChild(QPushButton, "notes_button") self.time_error = self.findChild(QToolButton, "time_error") self.time_error.hide() self.date_error = self.findChild(QToolButton, "date_error") self.date_error.hide() self.popup_check = self.findChild(QCheckBox, "popup_check") self.dialog_check = self.findChild(QCheckBox, "dialog_check") self.boxcar_check = self.findChild(QCheckBox, "boxcar_check") self.boxcar_label = self.findChild(QLabel, "boxcar_label") self.boxcar_label.hide() self.pushbullet_device_label = self.findChild(QLabel, 'pushbullet_device_label') self.pushbullet_device_edit = self.findChild(QComboBox, 'pushbullet_device_edit') self.pushbullet_info_label = self.findChild(QLabel, 'pushbullet_info_label') self.pushbullet_refresh = self.findChild(QPushButton, 'pushbullet_refresh') self.sound_label = self.findChild(QLabel, "sound_label") self.file_label = self.findChild(QLabel, "file_label") self.length_label = self.findChild(QLabel, "length_label") self.loop_label = self.findChild(QLabel, "loop_label") self.length_label2 = self.findChild(QLabel, "length_label2") self.sound_check = self.findChild(QCheckBox, "sound_check") self.file_edit = self.findChild(QLineEdit, "file_edit") self.length_spin = self.findChild(QSpinBox, "length_spin") self.loop_check = self.findChild(QCheckBox, "loop_check") self.insert_combo = self.findChild(QComboBox, "insert_combo"); self.info = ReminderDialogInfo(helpers.database_file()) self.set_data(self.info.label, self.info.time, self.info.date, self.info.command, self.info.notes, self.info.popup, self.info.dialog, self.info.boxcar, self.info.pushbullet_device, self.info.sound_file, self.info.sound_length, self.info.sound_loop) self.translate()
def __init__(self, parent = None): super(PreferencesDialog, self).__init__(parent) helpers.setup_ui(self, "PreferencesDialog.ui") self.info = PreferencesDialogInfo(helpers.database_file()) self.settings = self.info.settings self.boxcar_original = self.settings.boxcar_token self.stack_widget = self.findChild(QStackedWidget, "stack") self.list_widget = self.findChild(QListWidget, "list") self.label_label = self.findChild(QLabel, "label_label") self.time_label = self.findChild(QLabel, "time_label") self.date_label = self.findChild(QLabel, "date_label") self.command_label = self.findChild(QLabel, "command_label") self.postpone_label = self.findChild(QLabel, "postpone_label") self.label_edit = self.findChild(QLineEdit, "label_edit") self.label_edit.setText(self.settings.label) self.time_edit = self.findChild(QLineEdit, "time_edit") self.time_edit.setText(self.settings.time) self.date_edit = self.findChild(QLineEdit, "date_edit") self.date_edit.setText(self.settings.date) self.command_edit = self.findChild(QLineEdit, "command_edit") self.command_edit.setText(self.settings.command) self.postpone_spin = self.findChild(QSpinBox, "postpone_spin") self.postpone_spin.setValue(int(self.settings.postpone)) self.time_button = self.findChild(QPushButton, "time_button") self.date_button = self.findChild(QPushButton, "date_button") self.command_button = self.findChild(QPushButton, "command_button") self.time_error = self.findChild(QToolButton, "time_error") self.time_error.hide() self.date_error = self.findChild(QToolButton, "date_error") self.date_error.hide() self.popup_label = self.findChild(QLabel, "popup_label") self.dialog_label = self.findChild(QLabel, "dialog_label") self.change_icon_label = self.findChild(QLabel, "change_icon_label") self.popup_check = self.findChild(QCheckBox, "popup_check") self.popup_check.setChecked(self.settings.popup) self.dialog_check = self.findChild(QCheckBox, "dialog_check") self.dialog_check.setChecked(self.settings.dialog) self.change_icon_check = self.findChild(QCheckBox, "change_icon_check") self.change_icon_check.setChecked(self.settings.change_indicator) self.file_label = self.findChild(QLabel, "sound_label") self.length_label = self.findChild(QLabel, "length_label") self.length_label2 = self.findChild(QLabel, "length_label2") self.loop_label = self.findChild(QLabel, "loop_label") self.time_loop_label = self.findChild(QLabel, "time_loop_label") self.file_edit = self.findChild(QLineEdit, "file_edit") self.file_edit.setText(self.settings.sound_file) self.length_spin = self.findChild(QSpinBox, "length_spin") self.length_spin.setValue(int(self.settings.sound_play_length)) self.loop_check = self.findChild(QCheckBox, "loop_check") self.loop_check.setChecked(self.settings.sound_loop) self.time_loop_spin = self.findChild(QSpinBox, "time_loop_spin") self.time_loop_spin.setValue(self.settings.sound_loop_times) self.quick_label_label = self.findChild(QLabel, "quick_label_label") self.quick_minutes_label = self.findChild(QLabel, "quick_minutes_label") self.quick_unit_label = self.findChild(QLabel, "quick_unit_label") self.quick_slider_label = self.findChild(QLabel, "quick_slider_label") self.quick_popup_label = self.findChild(QLabel, "quick_popup_label") self.quick_dialog_label = self.findChild(QLabel, "quick_dialog_label") self.quick_sound_label = self.findChild(QLabel, "quick_sound_label") self.quick_info_label = self.findChild(QLabel, "quick_info_label") self.quick_label_edit = self.findChild(QLineEdit, "quick_label_edit") self.quick_label_edit.setText(self.settings.quick_label) self.quick_minutes_spin = self.findChild(QSpinBox, "quick_minutes_spin") self.quick_minutes_spin.setValue(self.settings.quick_minutes) self.quick_unit_combo = self.findChild(QComboBox, "quick_unit_combo") self.quick_slider_check = self.findChild(QCheckBox, "quick_slider_check") self.quick_slider_check.setChecked(self.settings.quick_slider) self.quick_popup_check = self.findChild(QCheckBox, "quick_popup_check") self.quick_popup_check.setChecked(self.settings.quick_popup) self.quick_dialog_check = self.findChild(QCheckBox, "quick_dialog_check") self.quick_dialog_check.setChecked(self.settings.quick_dialog) self.quick_sound_check = self.findChild(QCheckBox, "quick_sound_check") self.quick_sound_check.setChecked(self.settings.quick_sound) self.quick_info_check = self.findChild(QCheckBox, "quick_info_check") self.quick_info_check.setChecked(self.settings.quick_info) self.simple_popup_label = self.findChild(QLabel, "simple_popup_label") self.simple_dialog_label = self.findChild(QLabel, "simple_dialog_label") self.simple_sound_label = self.findChild(QLabel, "simple_sound_label") self.simple_popup_check = self.findChild(QCheckBox, "simple_popup_check") self.simple_popup_check.setChecked(self.settings.simple_popup) self.simple_dialog_check = self.findChild(QCheckBox, "simple_dialog_check") self.simple_dialog_check.setChecked(self.settings.simple_dialog) self.simple_sound_check = self.findChild(QCheckBox, "simple_sound_check") self.simple_sound_check.setChecked(self.settings.simple_sound) self.today_label = self.findChild(QLabel, "today_label") self.future_label = self.findChild(QLabel, "future_label") self.past_label = self.findChild(QLabel, "past_label") self.new_label = self.findChild(QLabel, "new_label") self.icon_label = self.findChild(QLabel, "icon_label") self.hide_label = self.findChild(QLabel, "hide_label") self.today_color = self.settings.today_color self.today_color_rgb = self.info.today_color_rgb r = self.today_color_rgb[0] g = self.today_color_rgb[1] b = self.today_color_rgb[2] self.today_button = self.findChild(QPushButton, "today_button") self.today_button.setStyleSheet("QPushButton { color:rgb(%d, %d, %d) }" % (r, g, b)) self.today_button.setText("(%d, %d, %d)" % (r, g, b)) self.future_color = self.settings.future_color self.future_color_rgb = self.info.future_color_rgb r = self.future_color_rgb[0] g = self.future_color_rgb[1] b = self.future_color_rgb[2] self.future_button = self.findChild(QPushButton, "future_button") self.future_button.setStyleSheet("QPushButton { color:rgb(%d, %d, %d) }" % (r, g, b)) self.future_button.setText("(%d, %d, %d)" % (r, g, b)) self.past_color = self.settings.past_color self.past_color_rgb = self.info.past_color_rgb r = self.past_color_rgb[0] g = self.past_color_rgb[1] b = self.past_color_rgb[2] self.past_button = self.findChild(QPushButton, "past_button") self.past_button.setStyleSheet("QPushButton { color:rgb(%d, %d, %d) }" % (r, g, b)) self.past_button.setText("(%d, %d, %d)" % (r, g, b)) self.new_check = self.findChild(QCheckBox, "new_check") self.new_check.setChecked(self.settings.show_news) self.icon_combo = self.findChild(QComboBox, "icon_combo") self.hide_check = self.findChild(QCheckBox, "hide_check") self.hide_check.setChecked(self.settings.hide_indicator) self.hide_start = self.settings.hide_indicator if not use_dbus: self.hide_check.setChecked(False) self.hide_check.setDisabled(True) self.hide_label.setDisabled(True) self.time_format_label = self.findChild(QLabel, "time_format_label") self.date_format_label = self.findChild(QLabel, "date_format_label") self.time_format_combo = self.findChild(QComboBox, "time_format_combo") self.date_format_combo = self.findChild(QComboBox, "date_format_combo") self.boxcar_token_button = self.findChild(QCommandLinkButton, "boxcar_token_button") self.boxcar_notification_label = self.findChild(QLabel, "boxcar_notification_label") self.boxcar_token_edit = self.findChild(QLineEdit, "boxcar_token_edit") self.boxcar_token_edit.setText(self.settings.boxcar_token) self.boxcar_notification_check = self.findChild(QCheckBox, "boxcar_notification_check") self.boxcar_notification_check.setChecked(self.settings.boxcar_notify) self.pushbullet_button = self.findChild(QCommandLinkButton, 'pushbullet_button') self.pushbullet_device_label = self.findChild(QLabel, 'pushbullet_device_label') self.pushbullet_api_key_edit = self.findChild(QLineEdit, 'pushbullet_api_key_edit') self.pushbullet_api_key_edit.setText(self.settings.pushbullet_api_key) self.pushbullet_device_edit = self.findChild(QComboBox, 'pushbullet_device_edit') self.pushbullet_refresh = self.findChild(QPushButton, 'pushbullet_refresh') self.refresh_pushbullet_combobox(self.settings.pushbullet_devices) self.pushbullet_valid = self.settings.pushbullet_api_key self.help_button = self.findChild(QPushButton, "help_button") self.cancel_button = self.findChild(QPushButton, "cancel_button") self.save_button = self.findChild(QPushButton, "save_button") self.translate() self.icon_combo.setCurrentIndex(self.settings.indicator_icon) self.time_format_combo.setCurrentIndex(self.settings.time_format) self.date_format_combo.setCurrentIndex(self.settings.date_format) self.quick_unit_combo.setCurrentIndex(self.settings.quick_unit)