def __init__(self, title, todo_item=None): """TODO: to be defined. """ BaseDialog.__init__(self, title, None, ok_button=True, cancel_button=True) self.todo_item = todo_item if todo_item: self.text.set_text(todo_item.text) if todo_item.priority: select_value_in_combo(self.priority, ord(todo_item.priority) - 65) else: select_value_in_combo(self.priority, -1) if todo_item.projects: self.projects.set_active_items(todo_item.projects) if todo_item.contexts: self.contexts.set_active_items(todo_item.contexts) for key in todo_item.tags: for tag_widget in self.tags: if tag_widget.name == key: if type(tag_widget) == CheckCalendar: tag_widget.set_date(todo_item.tags[key]) elif type(tag_widget) == Gtk.CheckButton: tag_widget.set_active( string2bool(todo_item.tags[key])) else: tag_widget.set_text(todo_item.tags[key]) break else: select_value_in_combo(self.priority, -1)
def init_ui(self): BaseDialog.init_ui(self) label = Gtk.Label.new(_("Tag name:")) label.set_property("halign", Gtk.Align.START) self.grid.attach(label, 0, 0, 1, 1) self.text = Gtk.Entry.new() self.grid.attach(self.text, 1, 0, 1, 1) label = Gtk.Label.new(_("Type:")) label.set_property("halign", Gtk.Align.START) self.grid.attach(label, 0, 1, 1, 1) type_store = Gtk.ListStore(str, str) type_store.append([_("Boolean"), "boolean"]) type_store.append([_("Date"), "date"]) type_store.append([_("String"), "string"]) self.type = Gtk.ComboBox.new() self.type.set_model(type_store) cell1 = Gtk.CellRendererText() self.type.pack_start(cell1, True) self.type.add_attribute(cell1, "text", 0) self.grid.attach(self.type, 1, 1, 1, 1)
def __init__(self): """TODO: to be defined. """ BaseDialog.__init__(self, _("Add Project"), None, ok_button=True, cancel_button=True)
def __init__(self, lat=39.36873, lon=-2.417274645879): self.lat = lat self.lon = lon BaseDialog.__init__(self, _('Forecast'), ok_button=False, cancel_button=False)
def init_ui(self): BaseDialog.init_ui(self) self.contributors = ListBoxContributors() self.contributors.set_size_request(300, 500) self.grid.attach(self.contributors, 0, 0, 1, 1) box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 5) self.grid.attach(box, 1, 0, 1, 2) button_add = Gtk.Button.new_with_label(_('Add contributor')) button_add.connect('clicked', self.on_button_add_clicked) box.add(button_add) button_edit = Gtk.Button.new_with_label(_('Edit contributor')) button_edit.connect('clicked', self.on_button_edit_clicked) box.add(button_edit) button_remove = Gtk.Button.new_with_label(_('Remove contributor')) button_remove.connect('clicked', self.on_button_remove_clicked) box.add(button_remove) button_clear = Gtk.Button.new_with_label(_('Clear contributor')) button_clear.connect('clicked', self.on_button_clear_clicked) box.add(button_clear)
def __init__(self): """TODO: to be defined. """ BaseDialog.__init__(self, _('Add Context'), None, ok_button=True, cancel_button=True)
def __init__(self): BaseDialog.__init__(self, _('List of tasks'), None, ok_button=True, cancel_button=True) self.load()
def init_ui(self): BaseDialog.init_ui(self) notebook = Gtk.Notebook.new() self.grid.attach(notebook, 0, 0, 1, 1) self.boxGeneral = BoxGeneral() notebook.append_page(self.boxGeneral, Gtk.Label.new(_('General'))) self.boxDescription = BoxText(_('Description:'), True) notebook.append_page(self.boxDescription, Gtk.Label.new(_('Description'))) self.boxDependencies = BoxText(_('Prerequisites:'), True) notebook.append_page(self.boxDependencies, Gtk.Label.new(_('Prerequisites'))) self.boxInstalling = BoxText(_('Installing:'), True) notebook.append_page(self.boxInstalling, Gtk.Label.new(_('Installing'))) self.boxUsing = BoxText(_('Using:'), True) notebook.append_page(self.boxUsing, Gtk.Label.new(_('Using'))) self.boxContributing = BoxText(_('Contibuting:'), True) notebook.append_page(self.boxContributing, Gtk.Label.new(_('Contributing'))) self.boxContributors = BoxContributors(_('Contributors:'), True) notebook.append_page(self.boxContributors, Gtk.Label.new(_('Contributors'))) self.init_headbar()
def __init__(self, contributors=[]): BaseDialog.__init__(self, _('List of contributors'), None, ok_button=True, cancel_button=True) self.load(contributors)
def init_ui(self): BaseDialog.init_ui(self) label = Gtk.Label.new(_('Tag name:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 0, 1, 1) self.text = Gtk.Entry.new() self.grid.attach(self.text, 1, 0, 1, 1) label = Gtk.Label.new(_('Type:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 1, 1, 1) type_store = Gtk.ListStore(str, str) type_store.append([_('Boolean'), 'boolean']) type_store.append([_('Date'), 'date']) type_store.append([_('String'), 'string']) self.type = Gtk.ComboBox.new() self.type.set_model(type_store) cell1 = Gtk.CellRendererText() self.type.pack_start(cell1, True) self.type.add_attribute(cell1, 'text', 0) self.grid.attach(self.type, 1, 1, 1, 1)
def init_ui(self): BaseDialog.init_ui(self) self.grid.set_row_spacing(0) self.grid.set_column_spacing(0) forecast = self.weather['forecasts'] self.table = Gtk.Table(rows=9, columns=5, homogeneous=False) self.table.set_col_spacings(10) self.create_labels() if self.ws == 'yahoo': total = 2 if self.ws == 'wunderground': total = 4 else: total = 5 for i in range(0, total): self.create_forecast_dor_day(forecast, i) if self.ws == 'yahoo': filename = comun.YAHOOLOGO web = comun.YAHOOWEB elif self.ws == 'worldweatheronline': filename = comun.WOLRDWEATHERONLINE web = comun.WOLRDWEATHERONLINEWEB elif self.ws == 'openweathermap': filename = comun.OPENWEATHERMAPLOGO web = comun.OPENWEATHERMAPWEB elif self.ws == 'wunderground': filename = comun.UNDERGROUNDLOGO web = comun.UNDERGROUNDWEB image = load_image(filename, size=64) image.set_alignment(0.5, 0.5) button = Gtk.Button() button.set_image(image) button.connect('clicked', (lambda x: webbrowser.open(web)))
def init_ui(self): BaseDialog.init_ui(self) self.grid.attach(Gtk.Label.new(_('Theme light:')), 0, 0, 1, 1) self.theme_light = Gtk.Switch.new() self.grid.attach(self.theme_light, 1, 0, 1, 1) self.grid.attach(Gtk.Label.new(_('Start actived:')), 0, 1, 1, 1) self.start_actived = Gtk.Switch.new() self.grid.attach(self.start_actived, 1, 1, 1, 1) self.grid.attach(Gtk.Label.new(_('Autostart:')), 0, 2, 1, 1) self.autostart = Gtk.Switch.new() self.grid.attach(self.autostart, 1, 2, 1, 1) self.grid.attach(Gtk.Label.new(_('Colors')), 0, 3, 2, 1) self.grid.attach(Gtk.Label.new(_('Distance')), 0, 4, 1, 1) color = Gdk.RGBA() color.parse('#445c3c') self.distance_color = Gtk.ColorButton() self.grid.attach(self.distance_color, 1, 4, 1, 1) self.grid.attach(Gtk.Label.new(_('Clics')), 0, 5, 1, 1) color.parse('#445c3c') self.clics_color = Gtk.ColorButton.new_with_rgba(color) self.grid.attach(self.clics_color, 1, 5, 1, 1) self.grid.attach(Gtk.Label.new(_('Keys')), 0, 6, 1, 1) color.parse('#445c3c') self.keys_color = Gtk.ColorButton() self.keys_color.set_rgba(color) self.grid.attach(self.keys_color, 1, 6, 1, 1)
def __init__(self): BaseDialog.__init__(self, _('Preferences'), None, ok_button=True, cancel_button=True) self.load()
def __init__(self): """TODO: to be defined. """ BaseDialog.__init__(self, _('Readme Maker. Create README'), None, ok_button=False, cancel_button=False) self.filename = None
def __init__(self): """TODO: to be defined. """ BaseDialog.__init__(self, _('Add Tag'), None, ok_button=True, cancel_button=True) select_value_in_combo(self.type, 'string')
def __init__(self): BaseDialog.__init__( self, _("Waiting for keybind"), None, ok_button=True, cancel_button=True, )
def __init__(self, title='', subtitle=''): self.title = _(title) self.configuration = Configuration() preferences = self.configuration.get('preferences') todo_file = Path(os.path.expanduser(preferences['todo-file'])) self.todo_file = todo_file.as_posix() self.subtitle = _(subtitle) BaseDialog.__init__(self, title, None, ok_button=False, cancel_button=False)
def __init__(self, hook): self.hook = hook self.changed = False BaseDialog.__init__(self, _("List of tasks"), None, ok_button=True, cancel_button=True) self.load()
def init_ui(self): BaseDialog.init_ui(self) label = Gtk.Label.new(_('Context name:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 0, 1, 1) self.text = Gtk.Entry.new() self.grid.attach(self.text, 1, 0, 1, 1)
def init_ui(self): BaseDialog.init_ui(self) label = Gtk.Label.new(_("Project name:")) label.set_property("halign", Gtk.Align.START) self.grid.attach(label, 0, 0, 1, 1) self.text = Gtk.Entry.new() self.text.set_hexpand(True) self.grid.attach(self.text, 1, 0, 1, 1)
def init_ui(self): BaseDialog.init_ui(self) self.notebook = Gtk.Notebook.new() self.grid.attach(self.notebook, 0, 0, 1, 1) self._build_page_general() self._build_page_projects() self._build_page_contexts() self._build_tags() self._build_behaviors()
def init_ui(self): BaseDialog.init_ui(self) scrolledwindow = Gtk.ScrolledWindow() scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.grid.attach(scrolledwindow, 0, 0, 1, 1) self.viewer = WebKit2.WebView() scrolledwindow.add(self.viewer) scrolledwindow.set_size_request(900, 600) self.viewer.connect('load-changed', self.load_changed) self.viewer.load_uri('file://' + comun.HTML) self.set_focus(self.viewer)
def init_ui(self): BaseDialog.init_ui(self) self.grid.attach(LeftLabel(_('Message:')), 0, 0, 1, 1) frame = Gtk.Frame() scroll = Gtk.ScrolledWindow() scroll.set_hexpand(True) scroll.set_border_width(3) self.message = Gtk.TextView.new() scroll.add(self.message) frame.add(scroll) frame.set_size_request(400, 200) self.grid.attach(frame, 0, 1, 2, 2)
def init_ui(self): BaseDialog.init_ui(self) label = Gtk.Label.new(_('Nick name:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 0, 1, 1) self.nickname = Gtk.Entry.new() self.grid.attach(self.nickname, 1, 0, 1, 1) button_import = Gtk.Button.new_with_label(_('Import from GitHub')) button_import.connect('clicked', self.on_button_import_clicked) self.grid.attach(button_import, 0, 1, 2, 1) label = Gtk.Label.new(_('Name:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 2, 1, 1) self.name = Gtk.Entry.new() self.grid.attach(self.name, 1, 2, 1, 1) label = Gtk.Label.new(_('Url:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 3, 1, 1) self.url = Gtk.Entry.new() self.grid.attach(self.url, 1, 3, 1, 1) label = Gtk.Label.new(_('Avatar url:')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 4, 1, 1) self.avatar_url = Gtk.Entry.new() self.grid.attach(self.avatar_url, 1, 4, 1, 1) label = Gtk.Label.new(_('Role')) label.set_property('halign', Gtk.Align.START) self.grid.attach(label, 0, 5, 1, 1) role_store = Gtk.ListStore(str, str) role_store.append(['π - {}'.format(_('Bug')), 'π']) role_store.append(['π» - {}'.format(_('Code')), 'π»']) role_store.append(['π¨ - {}'.format(_('Design')), 'π¨']) role_store.append(['π - {}'.format(_('Documentation')), 'π']) role_store.append(['π€ - {}'.format(_('Ideas')), 'π€']) role_store.append(['π - {}'.format(_('Translation')), 'π']) self.role = Gtk.ComboBox.new() self.role.set_model(role_store) cell1 = Gtk.CellRendererText() self.role.pack_start(cell1, True) self.role.add_attribute(cell1, 'text', 0) self.grid.attach(self.role, 1, 5, 1, 1)
def init_ui(self): BaseDialog.init_ui(self) self.scrolledwindow1 = Gtk.ScrolledWindow() self.scrolledwindow1.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC ) self.grid.attach(self.scrolledwindow1, 0, 0, 1, 1) self.viewer = WebKit2.WebView() self.scrolledwindow1.add(self.viewer) self.scrolledwindow1.set_size_request(1300, 600) self.viewer.load_uri("file://" + config.HTML_GRAPH) self.viewer.connect("load-changed", self.load_changed) self.set_focus(self.viewer)
def init_ui(self): BaseDialog.init_ui(self) label_waiting = Gtk.Label.new(_('Capturing new keybind')) label_waiting.set_property('halign', Gtk.Align.START) label_waiting.set_property('can_focus', False) self.grid.attach(label_waiting, 0, 0, 1, 1) self.key_pressed = [] self.key_unpressed = [] self.shortcut_hits = 0 self.label = Gtk.Label(label="") self.update_label_text() self.grid.attach(self.label, 0, 1, 1, 1) self.connect("key-press-event", self.on_key_press_event) self.connect("key-release-event", self.on_key_release_event)
def __init__(self, contributor=None): """TODO: to be defined. """ BaseDialog.__init__(self, _('Add task'), None, ok_button=True, cancel_button=True) self.contributor = contributor if contributor: self.nickname.set_text(self.contributor.get_nickname()) self.name.set_text(self.contributor.get_name()) self.url.set_text(self.contributor.get_url()) self.avatar_url.set_text(self.contributor.get_avatar_url()) select_in_combo(self.role, self.contributor.get_role()) else: select_in_combo(self.role, -1)
def init_ui(self): BaseDialog.init_ui(self) self.grid.attach(Gtk.Label.new(_('Theme light:')), 0, 0, 1, 1) self.theme_light = Gtk.Switch.new() self.grid.attach(self.theme_light, 1, 0, 1, 1) self.grid.attach(Gtk.Label.new(_('Start actived:')), 0, 1, 1, 1) self.start_actived = Gtk.Switch.new() self.grid.attach(self.start_actived, 1, 1, 1, 1) self.grid.attach(Gtk.Label.new(_('Autostart:')), 0, 2, 1, 1) self.autostart = Gtk.Switch.new() self.grid.attach(self.autostart, 1, 2, 1, 1) self.grid.attach(Gtk.Separator(), 0, 3, 2, 1) label = Gtk.Label(_('Units')) label.set_alignment(0, 0.5) self.grid.attach(label, 0, 4, 1, 1) units_store = Gtk.ListStore(str, str) units_store.append([_('meters'), 'meters']) units_store.append([_('feets'), 'feets']) self.units = Gtk.ComboBox.new() self.units.set_model(units_store) cell1 = Gtk.CellRendererText() self.units.pack_start(cell1, True) self.units.add_attribute(cell1, 'text', 0) self.grid.attach(self.units, 1, 4, 1, 1) self.grid.attach(Gtk.Separator(), 0, 5, 2, 1) self.grid.attach(Gtk.Label.new(_('Colors')), 0, 6, 2, 1) self.grid.attach(Gtk.Label.new(_('Distance')), 0, 7, 1, 1) color = Gdk.RGBA() color.parse('#445c3c') self.distance_color = Gtk.ColorButton() self.grid.attach(self.distance_color, 1, 7, 1, 1) self.grid.attach(Gtk.Label.new(_('Clicks')), 0, 8, 1, 1) color.parse('#445c3c') self.clics_color = Gtk.ColorButton.new_with_rgba(color) self.grid.attach(self.clics_color, 1, 8, 1, 1) self.grid.attach(Gtk.Label.new(_('Keys')), 0, 9, 1, 1) color.parse('#445c3c') self.keys_color = Gtk.ColorButton() self.keys_color.set_rgba(color) self.grid.attach(self.keys_color, 1, 9, 1, 1)
def __init__(self, title='', subtitle='', days='', distance='', clics='', keys=''): self.title = title self.subtitle = subtitle self.days = days self.distance = distance self.clics = clics self.keys = keys BaseDialog.__init__(self, title, None, ok_button=False, cancel_button=False)
def __init__(self, title='', subtitle='', currencies=[], days=[], c0=[], c1=[], c2=[], c3=[], c4=[]): self.title = title self.subtitle = subtitle self.currencies = currencies self.days = days self.c0 = c0 self.c1 = c1 self.c2 = c2 self.c3 = c3 self.c4 = c4 BaseDialog.__init__(self, title, None, ok_button=False, cancel_button=False)