def __init__(self, bus): VBox.__init__(self) self.bus = bus logger.debug('Running...') self.label = Label(_('Looking for Presence Service...')) self.errors = ListStore(str) errors_tree = TreeView(model=self.errors) errors_tree.insert_column_with_attributes(0, _('Log'), CellRendererText(), text=0) scroller = ScrolledWindow() scroller.add(errors_tree) self.paned = VPaned() self.paned.pack1(scroller) self.pack_start(self.label, False, False) self.pack_end(self.paned) bus.watch_name_owner(PS_NAME, self.on_name_owner_change) self.ps_watcher = Label('-') self.paned.pack2(self.ps_watcher) self.show_all()
def __init__(self, parent, backend): self.backend = backend self.dialog = GtkAboutDialog() self.dialog.set_transient_for(parent) self.dialog.set_modal(True) self.dialog.set_name(_("Subscription Manager")) self.dialog.set_license(LICENSE) self.dialog.set_wrap_license(True) self.dialog.set_website("https://fedorahosted.org/subscription-manager/") self.dialog.set_copyright(_("Copyright (c) 2012 Red Hat, Inc.")) self.dialog.set_logo(gdk.pixbuf_new_from_file_at_size(LOGO_PATH, 100, 100)) rhsm_version_label = Label() backend_version_label = Label() context_box = self.dialog.vbox.get_children()[0] context_box.pack_end(rhsm_version_label) context_box.pack_end(backend_version_label) # Set the component versions. server_versions = get_server_versions(self.backend.uep) client_versions = get_client_versions() self.dialog.set_version(client_versions['subscription-manager']) rhsm_version_label.set_markup(_("<b>python-rhsm version:</b> %s" % \ client_versions['python-rhsm'])) backend_version_label.set_markup(_("<b>subscription management service version:</b> %s" % \ server_versions['candlepin'])) self.dialog.connect("response", self._handle_response) self.dialog.show_all()
def __init__(self, value=None): super(MDSplusMethodWidget, self).__init__(rows=4, columns=2, homogeneous=False) self.device = Entry() self.method = Entry() self.args = list() self.argTable = Table(rows=8, columns=2, homogeneous=False) for i in range(8): self.args.append(Entry()) self.argTable.attach(Label("Arg %d: " % (i + 1, )), 0, 1, i, i + 1, 0, 0) self.argTable.attach(self.args[i], 1, 2, i, i + 1, EXPAND | FILL, 0) self.scrolledWindow = ScrolledWindow() self.scrolledWindow.add_with_viewport(self.argTable) self.scrolledWindow.set_policy(POLICY_NEVER, POLICY_ALWAYS) adj = self.scrolledWindow.get_vadjustment() adj.connect("changed", adj_changed) self.timeout = Entry() self.attach(Label("Device:"), 0, 1, 0, 1, 0, 0) self.attach(self.device, 1, 2, 0, 1, EXPAND | FILL, 0) self.attach(Label("Method:"), 0, 1, 1, 2, 0, 0) self.attach(self.method, 1, 2, 1, 2, EXPAND | FILL, 0) self.attach(self.scrolledWindow, 0, 2, 2, 3) self.attach(Label("Timeout:"), 0, 1, 3, 4, 0, 0) self.attach(self.timeout, 1, 2, 3, 4, EXPAND | FILL, 0) self.set_row_spacings(5) self.value = value
def __init__(self): HBox.__init__(self) self.set_spacing(3) #hour spin self.__hour_spin = SpinButton() self.__hour_spin.set_range(00, 99) self.__hour_spin.set_width_chars(2) self.__hour_spin.set_increments(1, 1) self.__hour_spin.set_numeric(True) self.__hour_spin.set_update_policy(UPDATE_IF_VALID) self.__hour_spin.set_snap_to_ticks(True) self.__hour_spin.connect("output", self._on_spin_output) self.__hour_spin_handler = (self.__hour_spin.connect( "value-changed", self.hour_spin_changed)) self.pack_start(self.__hour_spin) self.__hour_spin.show() #separator sep = Label(":") self.pack_start(sep, expand=False) sep.show() #minute spin self.__minute_spin = SpinButton() self.__minute_spin.set_range(00, 59) self.__minute_spin.set_width_chars(2) self.__minute_spin.set_increments(1, 1) self.__minute_spin.set_numeric(True) self.__minute_spin.set_wrap(True) self.__minute_spin.set_update_policy(UPDATE_IF_VALID) self.__minute_spin.set_snap_to_ticks(True) self.__minute_spin.connect("output", self._on_spin_output) self.__minute_spin.connect("wrapped", self._on_minute_wrap) self.__minute_spin_handler = (self.__minute_spin.connect( "value-changed", self.minute_spin_changed)) self.pack_start(self.__minute_spin) self.__minute_spin.show() #separator self.__second_sep = Label(":") self.pack_start(self.__second_sep, expand=False) self.__second_sep.show() #seconds spin self.__second_spin = SpinButton() self.__second_spin.set_range(00, 59) self.__second_spin.set_width_chars(2) self.__second_spin.set_increments(1, 1) self.__second_spin.set_numeric(True) self.__second_spin.set_wrap(True) self.__second_spin.set_update_policy(UPDATE_IF_VALID) self.__second_spin.set_snap_to_ticks(True) self.__second_spin.connect("output", self._on_spin_output) self.__second_spin.connect("wrapped", self._on_second_wrap) self.__second_spin_handler = (self.__second_spin.connect( "value-changed", self.second_spin_changed)) self.pack_start(self.__second_spin) self.__second_spin.show()
def __init__(self): VBox.__init__(self) self.status_label = Label('blank') self.source_label = Label('blank') self.pack_start(self.status_label, FALSE, FALSE, 0) self.pack_end(self.source_label, FALSE, FALSE, 0) self.status_label.show() self.source_label.show() self.show()
def __init__(self, item, name='ItemLabel'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.vlabel = Label(self._val_) self.pack_start(self.label, 0, 0, 0) self.pack_end(self.vlabel, 0, 0, 0) map(lambda x: x.show(), [self.label, self.vlabel]) self.show()
def __init__(self,value=None): super(MDSplusRangeWidget,self).__init__(rows=3,columns=2,homogeneous=False) self.begin=Entry() self.ending=Entry() self.delta=Entry() self.attach(Label("Begin: "),0,1,0,1,0,0) self.attach(self.begin,1,2,0,1,EXPAND|FILL,0) self.attach(Label("Ending: "),0,1,1,2,0,0) self.attach(self.ending,1,2,1,2,EXPAND|FILL,0) self.attach(Label("Delta:"),0,1,2,3,0,0) self.attach(self.delta,1,2,2,3,EXPAND|FILL,0) self.set_row_spacings(5) self.value=value
def __init__(self,value=None): super(MDSplusWindowWidget,self).__init__(rows=3,columns=2,homogeneous=False) self.startIdx=Entry() self.endIdx=Entry() self.timeAt0=Entry() self.attach(Label("StartIdx: "),0,1,0,1,0,0) self.attach(self.startIdx,1,2,0,1,EXPAND|FILL,0) self.attach(Label("EndIdx: "),0,1,1,2,0,0) self.attach(self.endIdx,1,2,1,2,EXPAND|FILL,0) self.attach(Label("TimeAt0:"),0,1,2,3,0,0) self.attach(self.timeAt0,1,2,2,3,EXPAND|FILL,0) self.set_row_spacings(5) self.value=value
def add(self, child, label=None): if label == None: label = 'New Document ' + str(self.documentCount) self.documentCount += 1 self.append_page(child, Label(label)) self.show_all()
def __init__(self, message, name='Dialog'): _GenDialog.__init__(self, name=name) self.set_name(name) self.label = Label(message) self.vbox.pack_start(self.label, FALSE, TRUE, 0) self.vbox.set_homogeneous(FALSE) self.label.show()
def __init__(self, value=None): super(MDSplusSequentialWidget, self).__init__( rows=4, columns=2, homogeneous=False) self.ident = Entry() self.phase = Entry() self.sequence = Entry() self.event = Entry() self.attach(Label("Server: "), 0, 1, 0, 1, 0, 0) self.attach(self.ident, 1, 2, 0, 1, EXPAND | FILL, 0) self.attach(Label("Phase: "), 0, 1, 1, 2, 0, 0) self.attach(self.phase, 1, 2, 1, 2, EXPAND | FILL, 0) self.attach(Label("Sequence:"), 0, 1, 2, 3, 0, 0) self.attach(self.sequence, 1, 2, 2, 3, EXPAND | FILL, 0) self.attach(Label("Event: "), 0, 1, 3, 4, 0, 0) self.attach(self.event, 1, 2, 3, 4, EXPAND | FILL, 0) self.set_row_spacings(5) self.value = value
def setupChannels(self): for child in self.table.get_children(): child.destroy() if self.incNidOffset > -1: columns = 6 else: columns = 5 self.table.resize(self.numChannels + 1, columns) self.table.attach(Label(""), 0, 1, 0, 1, 0, 0, 10, 0) self.table.attach(Label("On"), 1, 2, 0, 1, 0, 0, 10, 0) self.table.attach(Label("StartIdx"), 2, 3, 0, 1, EXPAND | FILL, 0, 10, 0) self.table.attach(Label("EndIdx"), 3, 4, 0, 1, EXPAND | FILL, 0, 10, 0) if self.incNidOffset > -1: self.table.attach(Label("Increment"), 4, 5, 0, 1, EXPAND | FILL, 0, 10, 0) self.table.attach(Label("Path"), columns - 1, columns, 0, 1, 0, 0, 10, 0) self.channels = list() for chan in range(self.numChannels): channel = dict() self.channels.append(channel) channel['number'] = Label("%d" % (chan + 1, )) self.table.attach(channel['number'], 0, 1, chan + 1, chan + 2, 0, 0, 10, 0) channel['on'] = CheckButton('') self.table.attach(channel['on'], 1, 2, chan + 1, chan + 2, 0, 0, 10, 0) channel['startIdx'] = Entry() self.table.attach(channel['startIdx'], 2, 3, chan + 1, chan + 2, EXPAND | FILL, 0, 10, 0) channel['endIdx'] = Entry() self.table.attach(channel['endIdx'], 3, 4, chan + 1, chan + 2, EXPAND | FILL, 0, 10, 0) if self.incNidOffset > -1: channel['inc'] = Entry() self.table.attach(channel['inc'], 4, 5, chan + 1, chan + 2, EXPAND | FILL, 0, 10, 0) channel['path'] = Label(' ') self.table.attach(channel['path'], columns - 1, columns, chan + 1, chan + 2, 0, 0, 10, 0) self.show_all() if not guibuilder: for chan in range(self.numChannels): chanNidOffset = self.node.nid + chan * self.nodesPerChannel channel = self.channels[chan] channel['dataNode'] = TreeNode( chanNidOffset + self.dataNidOffset, self.node.tree) channel['startIdxNode'] = TreeNode( chanNidOffset + self.startIdxNidOffset, self.node.tree) channel['endIdxNode'] = TreeNode( chanNidOffset + self.endIdxNidOffset, self.node.tree) if self.incNidOffset > -1: channel['incNode'] = TreeNode( chanNidOffset + self.incNidOffset, self.node.tree)
def __init__(self, item, name='ItemButton'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.button = Button(label=self._val_) self.pack_start(self.label, 0, 0, 0) self.pack_end(self.button, 1, 1, 5) map(lambda x: x.show(), [self.label, self.button]) self.show()
def add_tab(self, widget, tab_name, label): """Adds a tab object to the notebook.""" log.debug('add tab: %s', tab_name) self.tabs[tab_name] = widget scrolled = ScrolledWindow() scrolled.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) scrolled.add(widget) self.notebook.insert_page(scrolled, Label(label), -1) scrolled.show_all() self.after_update()
def __init__(self, item, name='ItemEntry'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.entry = Entry() self.entry.set_text(self._val_) self.pack_start(self.label, 0, 0, 0) self.pack_end(self.entry, 0, 0, 0) map(lambda x: x.show(), [self.label, self.entry]) self.show()
def __init__(self, name, default=None): HBox.__init__(self) self.set_name(name) self.label = Label(name) self.entry = Entry() self.pack_start(self.label, TRUE, TRUE, 0) self.add(self.entry) self.label.show() self.entry.show() if default: self.set(default) self.show()
def __init__(self, queue): HBox.__init__(self) self.thread = DlWorker(queue, self.progress, self.set_url) self.label = Label('hello') self.pbar = ProgressBar() self.pack_start(self.label, FALSE, FALSE, 0) self.pack_end(self.pbar, FALSE, FALSE, 0) self.label.show() self.pbar.show() self.show() self._done = False self._started = False
def __init__(self): HBox.__init__(self) MDSplusWidget.__init__(self) HBox.set_homogeneous(self, False) self.node_state = CheckButton('') self.button = Button() HBox.pack_start(self, self.node_state, False, False, 0) HBox.pack_start(self, self.button, False, False, 0) HBox.pack_start(self, Label(''), True, False, 0) if not guibuilder: self.button.connect("clicked", self.popupXd) self.button.connect("realize", self.setButtonLabel)
def __init__(self, parent, backend): self.backend = backend self.dialog = GtkAboutDialog() self.dialog.set_transient_for(parent) self.dialog.set_modal(True) self.dialog.set_name(_("Subscription Manager")) self.dialog.set_license(LICENSE) self.dialog.set_wrap_license(True) if not get_running_as_firstboot(): self.dialog.set_website( "https://fedorahosted.org/subscription-manager/") self.dialog.set_copyright(_("Copyright (c) 2012 Red Hat, Inc.")) self.dialog.set_logo_icon_name("subscription-manager") self.dialog.set_icon_name("subscription-manager") next_update_label = Label() rhsm_version_label = Label() backend_version_label = Label() context_box = self.dialog.vbox.get_children()[0] context_box.pack_end(next_update_label) context_box.pack_end(rhsm_version_label) context_box.pack_end(backend_version_label) self._set_next_update(next_update_label) # Set the component versions. server_versions = get_server_versions( self.backend.cp_provider.get_consumer_auth_cp()) client_versions = get_client_versions() self.dialog.set_version(client_versions['subscription-manager']) rhsm_version_label.set_markup( _("<b>%s version:</b> %s") % ("python-rhsm", client_versions['python-rhsm'])) backend_version_label.set_markup( _("<b>subscription management service version:</b> %s") % server_versions['candlepin']) self.dialog.connect("response", self._handle_response) self.dialog.show_all()
def __init__(self, item, name='ItemEntry'): if len(item) != 2: raise Error, 'ItemEntry needs item not %s' % item field, value = item HBox.__init__(self) self.set_name(name) self.label = Label(field) self.pack_start(self.label, FALSE, FALSE, 0) self.entry = Entry() self.set(str(value)) self.pack_end(self.entry, TRUE, TRUE, 0) self.label.show() self.entry.show() self.show()
def __init__(self, info): Table.__init__(self, 4, 1) self.info = info self.objs = ( image_new_from_file("img/found/%s.png" % (str(self.info['found']), )), image_new_from_file("img/wpt/%s.png" % (self.info['type'][0], )), Label(self.info['id']), Label("%s by %s" % (self.info['name'], self.info['creator'])) ) self.objs[0].set_tooltip_text("Found" if self.info['found'] else "Not found") self.objs[1].set_tooltip_text(self.info['type'][1]) self.objs[2].set_size_request(80, 32) self.objs[3].set_justify(JUSTIFY_LEFT) self.objs[3].set_ellipsize(ELLIPSIZE_END) self.attach(self.objs[0], 0, 1, 0, 1, FILL, FILL) self.attach(self.objs[1], 1, 2, 0, 1, FILL, FILL) self.attach(self.objs[2], 2, 3, 0, 1, FILL, FILL, FILL, FILL) self.attach(self.objs[3], 3, 4, 0, 1)
def __init__(self, url, path): VBox.__init__(self) self.label = Label(path) self.label.show() self.pack_start(self.label, FALSE, FALSE, 0) self.pbar = ProgressBar() self.pack_end(self.pbar, FALSE, FALSE, 0) self.pbar.show() self.show() self._done = 0 #self.thread = DownloadThread(url, path, self.progress) self.thread = DownloadThread(url, path, self.progress) #self.button = Button('start') #self.button.connect('clicked', self.start) #self.button.show() #self.pack_end(self.button, FALSE, FALSE, 0) self._started = False
def on_name_owner_change(self, owner): try: if owner: self.label.set_text( 'Presence Service running: unique name %s' % owner) if self.ps_watcher is not None: self.paned.remove(self.ps_watcher) self.ps_watcher = PresenceServiceWatcher( self.bus, owner, self.log) self.paned.pack2(self.ps_watcher) self.show_all() else: self.label.set_text('Presence Service not running') if self.ps_watcher is not None: self.paned.remove(self.ps_watcher) self.ps_watcher = Label('-') self.paned.pack2(self.ps_watcher) except Exception, e: self.log('ERROR: %s', e)
def __init__(self): Window.__init__(self) self.model = ListStore(str, str) self.aboutWindow = None self.helper = Helper(None) self.set_title('Gnome Custom Shortcuts') self.set_icon_from_file(join(data_path, 'icon.svg')) self.set_border_width(5) self.set_size_request(400, 400) list = TreeView() list.append_column(TreeViewColumn('')) list.append_column(TreeViewColumn('Command')) list.append_column(TreeViewColumn('Shortcut')) closeButton = Button(None, STOCK_CLOSE) aboutButton = Button(None, STOCK_ABOUT) buttonsBox = HButtonBox() buttonsBox.pack_start(aboutButton, False, False, 0) buttonsBox.pack_start(Label(''), True, True, 0) buttonsBox.pack_start(closeButton, False, False, 0) box = VBox(False, 5) box.pack_start(list, True, True, 0) box.pack_start(buttonsBox, False, False, 0) self.connect('destroy', main_quit, None) closeButton.connect('clicked', main_quit, None) aboutButton.connect('clicked', self.show_about, None) self.add(box) self.show_all()
def __init__(self, objectives, new): Expander.__init__(self) self.connect("enter-notify-event", self.onEnterNotifyEvent) self.connect("leave-notify-event", self.onLeaveNotifyEvent) vBox = VBox() self.add(vBox) # Data model self.model = ListStore(str, float) # Title bar hBox = HBox() self.set_property("label-widget", hBox) self.title = Label() hBox.pack_start(self.title) # Alternatives treeView = TreeView(self.model) # treeView.set_headers_visible(False) vBox.pack_start(treeView) listStore_objectives = ListStore(str) for name in objectives: listStore_objectives.append((name, )) def combo_changed(_, path, text, model): model[path][0] = text cellRenderer = CellRendererCombo() cellRenderer.connect("edited", combo_changed, self.model) cellRenderer.set_property("text-column", 0) cellRenderer.set_property("editable", True) cellRenderer.set_property("has-entry", True) cellRenderer.set_property("model", listStore_objectives) treeViewColumn = TreeViewColumn("Alternative", cellRenderer, text=0) # treeViewColumn = TreeViewColumn(None,cellRenderer,text=0) treeView.append_column(treeViewColumn) def spin_changed(_, path, value, model): model[path][1] = float(value.replace(",", ".")) cellRenderer = CellRendererSpin() cellRenderer.connect("edited", spin_changed, self.model) cellRenderer.set_property("adjustment", Adjustment(1, 0, 100, 1, 10, 0)) cellRenderer.set_property("editable", True) cellRenderer.set_property("digits", 2) treeViewColumn = TreeViewColumn(None, cellRenderer, text=1) treeView.append_column(treeViewColumn) # Add/remove alternative button box # hButtonBox = HButtonBox() # vBox.pack_start(hButtonBox, False) # Add alternative button = Button("gtk-add") button.connect("clicked", self.on_btnAdd_Alternative_clicked) button.set_use_stock(True) # hButtonBox.pack_start(button) vBox.pack_start(button, False) # # Remove alternative # button = Button("gtk-remove") # button.connect("clicked",self.on_btnDel_Alternative_clicked) # button.set_use_stock(True) # hButtonBox.pack_start(button) # Expand the requeriment and add an alternative if it's new if new: self.set_expanded(True) self.model.append((None, 1.0)) # Show requeriment self.show_all() # Delete requeriment button (default is hidden) self.imgRemove = Image() self.imgRemove.connect("button-press-event", self.onDelRequeriment) self.imgRemove.set_from_stock("gtk-cancel", ICON_SIZE_MENU) hBox.pack_start(self.imgRemove)
def __get_label(self): from gtk import Label label = Label() label.set_property("single-line-mode", True) label.set_property("use-markup", True) return label
def __init__(self, bus, unique_name, log): VBox.__init__(self) self.bus = bus self.unique_name = unique_name self.proxy = bus.get_object(unique_name, PS_PATH) self.iface = dbus.Interface(self.proxy, PS_IFACE) self.log = log self.activities = None self.iface.connect_to_signal('ActivityAppeared', self._on_activity_appeared) self.iface.connect_to_signal('ActivityDisappeared', self._on_activity_disappeared) self.iface.GetActivities(reply_handler=self._on_get_activities_success, error_handler=self._on_get_activities_failure) self.buddies = None self.iface.connect_to_signal('BuddyAppeared', self._on_buddy_appeared) self.iface.connect_to_signal('BuddyDisappeared', self._on_buddy_disappeared) self.iface.GetBuddies(reply_handler=self._on_get_buddies_success, error_handler=self._on_get_buddies_failure) # keep this in sync with the ACT_COL_ constants self.activities_list_store = ListStore( str, # object path int, # weight (bold if new) bool, # strikethrough (dead) str, # ID str, # color str, # type str, # name str, # conn str, # channels str, # buddies ) self.pack_start(Label('Activities:'), False, False) self.activities_list = TreeView(self.activities_list_store) c = self.activities_list.insert_column_with_attributes( 0, 'Object path', CellRendererText(), text=ACT_COL_PATH, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(ACT_COL_PATH) c = self.activities_list.insert_column_with_attributes( 1, 'ID', CellRendererText(), text=ACT_COL_ID, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(ACT_COL_ID) c = self.activities_list.insert_column_with_attributes( 2, 'Color', CellRendererText(), text=ACT_COL_COLOR, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(ACT_COL_COLOR) c = self.activities_list.insert_column_with_attributes( 3, 'Type', CellRendererText(), text=ACT_COL_TYPE, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(ACT_COL_TYPE) c = self.activities_list.insert_column_with_attributes( 4, 'Name', CellRendererText(), text=ACT_COL_NAME, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(ACT_COL_NAME) c = self.activities_list.insert_column_with_attributes( 5, 'Connection', CellRendererText(), text=ACT_COL_CONN, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(ACT_COL_CONN) c = self.activities_list.insert_column_with_attributes( 6, 'Channels', CellRendererText(), text=ACT_COL_CHANNELS, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) c = self.activities_list.insert_column_with_attributes( 7, 'Buddies', CellRendererText(), text=ACT_COL_BUDDIES, weight=ACT_COL_WEIGHT, strikethrough=ACT_COL_STRIKE) c.set_resizable(True) scroller = ScrolledWindow() scroller.add(self.activities_list) self.pack_start(scroller) # keep this in sync with the BUDDY_COL_ constants self.buddies_list_store = ListStore(str, int, bool, str, bool, str, str, str, str, str, str) self.pack_start(Label('Buddies:'), False, False) self.buddies_list = TreeView(self.buddies_list_store) c = self.buddies_list.insert_column_with_attributes( 0, 'Object path', CellRendererText(), text=BUDDY_COL_PATH, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_PATH) c = self.buddies_list.insert_column_with_attributes( 1, 'Pubkey', CellRendererText(), text=BUDDY_COL_KEY_ID, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_KEY_ID) c = self.buddies_list.insert_column_with_attributes( 2, 'Nick', CellRendererText(), text=BUDDY_COL_NICK, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_NICK) c = self.buddies_list.insert_column_with_attributes( 3, 'Owner', CellRendererToggle(), active=BUDDY_COL_OWNER) c = self.buddies_list.insert_column_with_attributes( 4, 'Color', CellRendererText(), text=BUDDY_COL_COLOR, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_OWNER) c = self.buddies_list.insert_column_with_attributes( 5, 'IPv4', CellRendererText(), text=BUDDY_COL_IP4, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_IP4) c = self.buddies_list.insert_column_with_attributes( 6, 'CurAct', CellRendererText(), text=BUDDY_COL_CUR_ACT, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_CUR_ACT) c = self.buddies_list.insert_column_with_attributes( 7, 'Activities', CellRendererText(), text=BUDDY_COL_ACTIVITIES, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_ACTIVITIES) c = self.buddies_list.insert_column_with_attributes( 8, 'Handles', CellRendererText(), text=BUDDY_COL_HANDLES, weight=BUDDY_COL_WEIGHT, strikethrough=BUDDY_COL_STRIKE) c.set_resizable(True) c.set_sort_column_id(BUDDY_COL_HANDLES) scroller = ScrolledWindow() scroller.add(self.buddies_list) self.pack_start(scroller) self.iface.connect_to_signal('ActivityInvitation', self._on_activity_invitation) self.iface.connect_to_signal('PrivateInvitation', self._on_private_invitation)
def __init__(self,node=None,value=None): Window.__init__(self) MDSplusWidget.__init__(self) if node is not None: self.node=node else: self.value=value hbtop=HBox(homogeneous=False) self.on=CheckButton(label="On") self.parent_on=CheckButton(label="Parent") self.parent_on.set_sensitive(False) self.path=MDSplusPathWidget() if node is not None: self.path._node=self._node hbtags=HBox(homogeneous=False) self.tags=Entry() self.tags.set_width_chars(60) expression_menu=self.dtype_menu(tuple(),varname='dtype_expression',no_show=True) axis_menu=self.dtype_menu(('Range',),varname='dtype_axis',no_show=True) window_menu=self.dtype_menu(('Window',),varname='dtype_window',no_show=True) dispatch_menu=self.dtype_menu(('Dispatch',),varname='dtype_dispatch',no_show=True) action_menu=self.dtype_menu(('Action',),varname='dtype_action',no_show=True) task_menu=self.dtype_menu(('Method','Routine'),varname='dtype_task',no_show=True) any_menu=self.dtype_menu(('Range','Window','Dispatch','Action','Method','Routine'),varname='dtype_any',no_show=True) menus=(self.dtype_expression,self.dtype_axis,self.dtype_dispatch,self.dtype_action,self.dtype_task,self.dtype_window,self.dtype_any) hbtop.pack_start(self.on,False,False,10) hbtop.pack_start(self.parent_on,False,False,10) hbtop.pack_start(self.path,False,False,0) hbtags.pack_start(Label("Tags:"),False,False,10) hbtags.pack_start(self.tags,False,False,0) self.action=MDSplusActionWidget() self.windoww=MDSplusWindowWidget() self.sequential=MDSplusSequentialWidget() self.expression=MDSplusExpressionWidget() self.method=MDSplusMethodWidget() self.routine=MDSplusRoutineWidget() self.dispatch=MDSplusDispatchWidget() self.range=MDSplusRangeWidget() self.widgets=(self.action,self.sequential,self.expression,self.method,self.routine,self.dispatch,self.range,self.windoww) self.ok=Button(stock=STOCK_OK) self.cancel=Button(stock=STOCK_CANCEL) self.redo=Button(stock=STOCK_REDO) self.ok.connect("clicked",self.do_ok) self.cancel.connect("clicked",self.do_cancel) self.redo.connect("clicked",self.do_redo) hb2=HBox() hb2.add(self.ok) hb2.add(self.redo) hb2.add(self.cancel) vb=VBox(homogeneous=False) vb.set_border_width(10) vb.pack_start(hbtop,False,False,0) vb.pack_start(hbtags,False,False,0) vb.pack_start(expression_menu,False,False,0) vb.pack_start(axis_menu,False,False,0) vb.pack_start(window_menu,False,False,0) vb.pack_start(dispatch_menu,False,False,0) vb.pack_start(action_menu,False,False,0) vb.pack_start(task_menu,False,False,0) vb.pack_start(any_menu,False,False,0) for w in self.widgets: w.set_no_show_all(True) vb.pack_start(w,False,False,0) vb.pack_start(hb2,False,False,20) self.add(vb) self.do_redo(self.redo) self.putOnApply = True self.nidOffset = -1
def append_page(self, child, label): self.pages.append((label, child)) self.nbook.append_page(child, Label(label))
def append_page(self, child, label): self._pages.append((label, child)) Notebook.append_page(self, child, Label(label)) self._set_pages()