def render(self): try: view = self.getApplication().getLocalObjectById(self.viewId) except GenericObjectStoreException: self.destroy() return site = view.getPage() if self.spaceId is not None: # In case, this space is a real space spaceName = site.getNameOfSpace(self.spaceId) self.framelabel.setText(_("Space: ")+spaceName) spaceWidgetMapping = view.getSpaceWidgetMapping() try: widgetId = spaceWidgetMapping[str(self.spaceId)] except KeyError: widget = None widgetId = None else: widget = view.getViews().getSkarphed().getModules().getWidgetById(widgetId) else: #In case this space is only part of a box self.framelabel.setText(_("BoxSpace")) boxmapping = self.getPar().getPar().getTemporaryBoxContent() try: widgetId = boxmapping[self.orderNumber] except KeyError: widget = None widgetId = None else: widget = view.getViews().getSkarphed().getModules().getWidgetById(widgetId) self.widgetId = widgetId self.widget_combo.setSelected(widget) self.param_widget.setWidget(widget) self.param_widget.render()
def __init__(self, parent): gtk.Frame.__init__(self, _("Create a new profile")) self.par = parent self.fixed = gtk.Fixed() self.l_user = gtk.Label(_("User")) self.e_user = DefaultEntry(default_message=_("username")) self.l_password = gtk.Label(_("Password")) self.e_password = gtk.Entry() self.l_password_r = gtk.Label(_("Repeat password")) self.e_password_r = gtk.Entry() self.ok = gtk.Button(stock=gtk.STOCK_OK) self.e_password.set_invisible_char("●") self.e_password_r.set_invisible_char("●") self.e_password.set_visibility(False) self.e_password_r.set_visibility(False) self.fixed.put(self.l_user, 10, 10) self.fixed.put(self.e_user, 110, 10) self.fixed.put(self.l_password, 10, 35) self.fixed.put(self.e_password, 110, 35) self.fixed.put(self.l_password_r, 10, 60) self.fixed.put(self.e_password_r, 110, 60) self.fixed.put(self.ok, 110, 85) self.add(self.fixed) self.ok.connect("clicked", self.cb_OK)
def __init__(self, par, menu=None): gtk.TreeView.__init__(self) self.par = par self.menuId = menu.getLocalId() self.store = MenuItemStore(gtk.gdk.Pixbuf,str,int,int,parent=self.par, objectStore = self.getApplication().getObjectStore(),menu=menu) self.set_model(self.store) self.col_name = gtk.TreeViewColumn(_("MenuItem")) self.col_order = gtk.TreeViewColumn(_("Order")) self.append_column(self.col_name) self.append_column(self.col_order) self.renderer_icon = gtk.CellRendererPixbuf() self.renderer_name = gtk.CellRendererText() self.renderer_order = gtk.CellRendererText() self.renderer_name.set_property('editable',True) self.col_name.pack_start(self.renderer_icon,False) self.col_name.pack_start(self.renderer_name,True) self.col_order.pack_start(self.renderer_order,True) self.col_name.add_attribute(self.renderer_icon,'pixbuf',0) self.col_name.add_attribute(self.renderer_name,'text',1) self.col_order.add_attribute(self.renderer_order,'text',3) self.renderer_name.connect('edited', self.renamedCallback) self.set_reorderable(True) self.col_order.set_sort_column_id(2) self.col_order.set_sort_order(gtk.SORT_DESCENDING) self.store.emit("sort_column_changed") self.set_search_column(1)
def __init__(self, par, server): self.par = par gtk.Frame.__init__(self, _("Skarphed Admin :: Register Database")) self.serverId = server.getLocalId() self.table = gtk.Table(4, 2, False) self.instruction = gtk.Label(_("Please enter DBA-Credentials here:")) self.dba_user_label = gtk.Label(_("DBA-User:"******"Password:"******"SYSDBA") self.dba_pass_entry = DefaultEntry(default_message=_("password")) self.buttonhbox = gtk.HBox() self.cancel = gtk.Button(stock=gtk.STOCK_CLOSE) self.ok = gtk.Button(stock=gtk.STOCK_OK) self.buttonhbox.add(self.cancel) self.buttonhbox.add(self.ok) self.table.attach(self.instruction, 0, 2, 0, 1) self.table.attach(self.dba_user_label, 0, 1, 1, 2) self.table.attach(self.dba_user_entry, 1, 2, 1, 2) self.table.attach(self.dba_pass_label, 0, 1, 2, 3) self.table.attach(self.dba_pass_entry, 1, 2, 2, 3) self.table.attach(self.buttonhbox, 1, 2, 3, 4) self.ok.connect("clicked", self.cb_Ok) self.cancel.connect("clicked", self.cb_Cancel) self.connect("delete-event", self.cb_Cancel) server.addCallback(self.render) self.table.set_border_width(10) self.add(self.table) self.getApplication().getMainWindow().openDialogPane(self)
def __init__(self,parent): gtk.Menu.__init__(self) self.par = parent self.objId = None ca_image = gtk.Image() ca_image.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU) ca_item = gtk.ImageMenuItem() ca_item.set_image(ca_image) gtk.MenuItem.__init__(ca_item, _("Close all tabs")) ca_item.connect("activate", self.closeAll) self.append(ca_item) ct_image = gtk.Image() ct_image.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU) ct_item = gtk.ImageMenuItem() ct_item.set_image(ct_image) gtk.MenuItem.__init__(ct_item, _("Close this tab")) ct_item.connect("activate", self.closeThis) self.append(ct_item) co_image = gtk.Image() co_image.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU) co_item = gtk.ImageMenuItem() co_item.set_image(co_image) gtk.MenuItem.__init__(co_item, _("Close other tabs")) co_item.connect("activate", self.closeOther) self.append(co_item) self.show_all()
def render(self): try: view = self.getApplication().getLocalObjectById(self.viewId) except GenericObjectStoreException: self.destroy() return site = view.getPage() if self.spaceId is not None: # In case, this space is a real space spaceName = site.getNameOfSpace(self.spaceId) self.framelabel.setText(_("Space: ") + spaceName) spaceWidgetMapping = view.getSpaceWidgetMapping() try: widgetId = spaceWidgetMapping[str(self.spaceId)] except KeyError: widget = None widgetId = None else: widget = view.getViews().getSkarphed().getModules( ).getWidgetById(widgetId) else: #In case this space is only part of a box self.framelabel.setText(_("BoxSpace")) boxmapping = self.getPar().getPar().getTemporaryBoxContent() try: widgetId = boxmapping[self.orderNumber] except KeyError: widget = None widgetId = None else: widget = view.getViews().getSkarphed().getModules( ).getWidgetById(widgetId) self.widgetId = widgetId self.widget_combo.setSelected(widget) self.param_widget.setWidget(widget) self.param_widget.render()
def __init__(self, par, skarphed): ActionRenderContext.__init__(self, par,skarphed) self.addAction(_('Destroy...'), IconStock.DELETE, self.destroyInstance) self.addAction(_('Remove...'), IconStock.DELETE, self.removeInstance) self.addAction(_('CSS Editor...'), IconStock.CSS, self.cssEditor) self.addAction(_('Update Modules'), IconStock.MODULE_UPDATEABLE, self.updateModules)
def __init__(self,par,server): self.par = par gtk.Frame.__init__(self, _("Skarphed Admin :: Register Database")) self.serverId = server.getLocalId() self.table = gtk.Table(4,2,False) self.instruction = gtk.Label(_("Please enter DBA-Credentials here:")) self.dba_user_label = gtk.Label(_("DBA-User:"******"Password:"******"SYSDBA") self.dba_pass_entry = DefaultEntry(default_message=_("password")) self.buttonhbox = gtk.HBox() self.cancel = gtk.Button(stock=gtk.STOCK_CLOSE) self.ok = gtk.Button(stock=gtk.STOCK_OK) self.buttonhbox.add(self.cancel) self.buttonhbox.add(self.ok) self.table.attach(self.instruction,0,2,0,1) self.table.attach(self.dba_user_label,0,1,1,2) self.table.attach(self.dba_user_entry,1,2,1,2) self.table.attach(self.dba_pass_label,0,1,2,3) self.table.attach(self.dba_pass_entry,1,2,2,3) self.table.attach(self.buttonhbox,1,2,3,4) self.ok.connect("clicked", self.cb_Ok) self.cancel.connect("clicked", self.cb_Cancel) self.connect("delete-event", self.cb_Cancel) server.addCallback(self.render) self.table.set_border_width(10) self.add(self.table) self.getApplication().getMainWindow().openDialogPane(self)
def __init__(self, par, repo): self.par = par gtk.ScrolledWindow.__init__(self) self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.treeview = gtk.TreeView() self.store = gtk.ListStore(gtk.gdk.Pixbuf, str, str, str, int) self.treeview.set_model(self.store) self.repoId = repo.getLocalId() self.col_name = gtk.TreeViewColumn(_("Template")) self.col_description = gtk.TreeViewColumn(_("Description")) self.col_author = gtk.TreeViewColumn(_("Author")) self.ren_icon = gtk.CellRendererPixbuf() self.ren_name = gtk.CellRendererText() self.ren_description = gtk.CellRendererText() self.ren_author = gtk.CellRendererText() self.col_name.pack_start(self.ren_icon, False) self.col_name.pack_start(self.ren_name, False) self.col_description.pack_start(self.ren_description, True) self.col_author.pack_start(self.ren_author, False) self.col_name.add_attribute(self.ren_icon, 'pixbuf', 0) self.col_name.add_attribute(self.ren_name, 'text', 1) self.col_description.add_attribute(self.ren_description, 'text', 2) self.col_author.add_attribute(self.ren_author, 'text', 3) self.treeview.append_column(self.col_name) self.treeview.append_column(self.col_description) self.treeview.append_column(self.col_author) self.add(self.treeview) repo.addCallback(self.render) self.show_all() self.render()
def __init__(self, par, repo): self.par = par gtk.ScrolledWindow.__init__(self) self.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC) self.treeview = gtk.TreeView() self.store= gtk.ListStore(gtk.gdk.Pixbuf, str, str, str, int) self.treeview.set_model(self.store) self.repoId = repo.getLocalId() self.col_name = gtk.TreeViewColumn(_("Template")) self.col_description = gtk.TreeViewColumn(_("Description")) self.col_author = gtk.TreeViewColumn(_("Author")) self.ren_icon = gtk.CellRendererPixbuf() self.ren_name = gtk.CellRendererText() self.ren_description = gtk.CellRendererText() self.ren_author = gtk.CellRendererText() self.col_name.pack_start(self.ren_icon,False) self.col_name.pack_start(self.ren_name,False) self.col_description.pack_start(self.ren_description,True) self.col_author.pack_start(self.ren_author,False) self.col_name.add_attribute(self.ren_icon, 'pixbuf',0) self.col_name.add_attribute(self.ren_name, 'text', 1) self.col_description.add_attribute(self.ren_description, 'text', 2) self.col_author.add_attribute(self.ren_author, 'text', 3) self.treeview.append_column(self.col_name) self.treeview.append_column(self.col_description) self.treeview.append_column(self.col_author) self.add(self.treeview) repo.addCallback(self.render) self.show_all() self.render()
def __init__(self, par, module): ActionRenderContext.__init__(self, par, module) self.addAction(_('Create Widget...'), IconStock.WIDGET, self.createWidget) self.addAction(_('CSS Editor...'), IconStock.CSS, self.cssEditor) if module.isUpdateable(): self.addAction(_('Update'), IconStock.UPDATE, self.update)
def __init__(self, parent): gtk.Frame.__init__(self, _("Create a new profile")) self.par=parent self.fixed = gtk.Fixed() self.l_user = gtk.Label(_("User")) self.e_user = DefaultEntry(default_message=_("username")) self.l_password = gtk.Label(_("Password")) self.e_password = gtk.Entry() self.l_password_r = gtk.Label (_("Repeat password")) self.e_password_r = gtk.Entry() self.ok = gtk.Button(stock=gtk.STOCK_OK) self.e_password.set_invisible_char("●") self.e_password_r.set_invisible_char("●") self.e_password.set_visibility(False) self.e_password_r.set_visibility(False) self.fixed.put(self.l_user,10,10) self.fixed.put(self.e_user,110,10) self.fixed.put(self.l_password,10,35) self.fixed.put(self.e_password,110,35) self.fixed.put(self.l_password_r,10,60) self.fixed.put(self.e_password_r,110,60) self.fixed.put(self.ok,110,85) self.add(self.fixed) self.ok.connect("clicked", self.cb_OK)
def __init__(self, par, schema): ActionRenderContext.__init__(self, par, schema) self.addAction(_('Unregister Schema...'), IconStock.DELETE, self.unregisterSchema) self.addAction(_('Destroy Schema...'), IconStock.DELETE, self.destroySchema)
def __init__(self, par, database): ActionRenderContext.__init__(self, par, database) self.addAction(_('Register Schema...'), IconStock.SCHEMA, self.registerSchema) self.addAction(_('Create Schema...'), IconStock.SCHEMA, self.createSchema)
def __init__(self, parent, view, spaceId=None, boxId=None, orderNumber=None): gtk.Frame.__init__(self) self.par = parent self.viewId = view.getLocalId() self.spaceId = spaceId self.boxId = boxId self.orderNumber = orderNumber self.widgetId = None self.vbox = gtk.VBox() self.hbox = gtk.HBox(spacing=10) self.framelabel = FrameLabel(self,_("Space: "), SPACE) self.set_label_widget(self.framelabel) self.spacelabel = gtk.Label(_("Widget in this Space:")) self.widget_combo = ObjectCombo(self, "Widget", virtualRootObject=view.getViews().getSkarphed().getModules(), noneElement=True) self.expander = gtk.Expander() self.expander.set_label_widget(gtk.Label(_("Edit Widget Parameters"))) self.param_widget = ParamWidget(self, view) self.expander.add(self.param_widget) self.hbox.pack_start(self.spacelabel,False) self.hbox.pack_start(self.widget_combo,False) self.vbox.pack_start(self.hbox,False) self.vbox.pack_start(self.expander,False) self.add(self.vbox) self.show_all() self.render()
def __init__(self, par, menu): ObjectPageAbstract.__init__(self, par, menu) self.info = PageFrame(self, _("Name"), IconStock.SITE) self.infobox = gtk.HBox() self.info_labelName = gtk.Label(_("Name:")) self.info_entryName = gtk.Entry() self.info_saveName = gtk.Button(stock=gtk.STOCK_SAVE) self.infobox.pack_start(self.info_labelName, False) self.infobox.pack_start(self.info_entryName, True) self.infobox.pack_start(self.info_saveName, False) self.info_saveName.connect("clicked", self.renameCallback) self.info.add(self.infobox) self.pack_start(self.info, False) self.edit = PageFrame(self, _("Edit Items"), IconStock.MENU) self.editbox = gtk.HPaned() self.edit_left_box = gtk.VBox() self.edit_toolbar = gtk.Toolbar() self.addbutton = gtk.ToolButton() self.addbutton.set_stock_id(gtk.STOCK_ADD) self.addbutton.connect("clicked", self.cb_Add) self.removebutton = gtk.ToolButton() self.removebutton.set_stock_id(gtk.STOCK_REMOVE) self.removebutton.connect("clicked", self.cb_Remove) self.increasebutton = gtk.ToolButton() self.increasebutton.set_stock_id(gtk.STOCK_GO_UP) self.increasebutton.connect("clicked", self.cb_Increase) self.decreasebutton = gtk.ToolButton() self.decreasebutton.set_stock_id(gtk.STOCK_GO_DOWN) self.decreasebutton.connect("clicked", self.cb_Decrease) self.topbutton = gtk.ToolButton() self.topbutton.set_stock_id(gtk.STOCK_GOTO_TOP) self.topbutton.connect("clicked", self.cb_Top) self.bottombutton = gtk.ToolButton() self.bottombutton.set_stock_id(gtk.STOCK_GOTO_BOTTOM) self.bottombutton.connect("clicked", self.cb_Bottom) self.edit_toolbar.add(self.addbutton) self.edit_toolbar.add(self.removebutton) self.edit_toolbar.add(self.increasebutton) self.edit_toolbar.add(self.decreasebutton) self.edit_toolbar.add(self.topbutton) self.edit_toolbar.add(self.bottombutton) self.edit_menutree = MenuItemTree(self, menu) self.edit_right_box = gtk.Frame(_("Actions")) self.actionListItem = None self.edit_left_box.pack_start(self.edit_toolbar, False) self.edit_left_box.pack_start(self.edit_menutree, True) self.editbox.add(self.edit_left_box) self.editbox.add(self.edit_right_box) self.edit.add(self.editbox) self.pack_start(self.edit) self.edit_menutree.connect("cursor-changed", self.menuItemChangeCallback) self.show_all()
def __init__(self, par, server): ActionRenderContext.__init__(self, par, server) self.addAction(_('Remove...'), IconStock.DELETE, self.removeServer) self.addAction(_('Connect...'), IconStock.WIDGET, self.connectServer) self.addAction(_('Properties...'), IconStock.SERVER, self.Properties) self.addAction(_('Create Instance...'), IconStock.SKARPHED, self.createInstance) self.addAction(_('Register Database...'), IconStock.DATABASE, self.registerDatabase)
def __init__(self, par, skarphed): ActionRenderContext.__init__(self, par, skarphed) self.addAction(_('Destroy...'), IconStock.DELETE, self.destroyInstance) self.addAction(_('Remove...'), IconStock.DELETE, self.removeInstance) self.addAction(_('CSS Editor...'), IconStock.CSS, self.cssEditor) self.addAction(_('Update Modules'), IconStock.MODULE_UPDATEABLE, self.updateModules)
def errorMessage(msgId): msgs = (_("This is not a valid int number"), _("Empty input is not valid") ) dia = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, \ buttons=gtk.BUTTONS_OK, message_format=msgs[msgId]) dia.run() dia.destroy()
def __init__(self, par, menu): ObjectPageAbstract.__init__(self,par,menu) self.info = PageFrame(self, _("Name"), IconStock.SITE) self.infobox = gtk.HBox() self.info_labelName = gtk.Label(_("Name:")) self.info_entryName = gtk.Entry() self.info_saveName = gtk.Button(stock=gtk.STOCK_SAVE) self.infobox.pack_start(self.info_labelName,False) self.infobox.pack_start(self.info_entryName,True) self.infobox.pack_start(self.info_saveName,False) self.info_saveName.connect("clicked",self.renameCallback) self.info.add(self.infobox) self.pack_start(self.info,False) self.edit = PageFrame(self, _("Edit Items"), IconStock.MENU) self.editbox = gtk.HPaned() self.edit_left_box = gtk.VBox() self.edit_toolbar = gtk.Toolbar() self.addbutton=gtk.ToolButton() self.addbutton.set_stock_id(gtk.STOCK_ADD) self.addbutton.connect("clicked", self.cb_Add) self.removebutton=gtk.ToolButton() self.removebutton.set_stock_id(gtk.STOCK_REMOVE) self.removebutton.connect("clicked", self.cb_Remove) self.increasebutton=gtk.ToolButton() self.increasebutton.set_stock_id(gtk.STOCK_GO_UP) self.increasebutton.connect("clicked", self.cb_Increase) self.decreasebutton=gtk.ToolButton() self.decreasebutton.set_stock_id(gtk.STOCK_GO_DOWN) self.decreasebutton.connect("clicked", self.cb_Decrease) self.topbutton=gtk.ToolButton() self.topbutton.set_stock_id(gtk.STOCK_GOTO_TOP) self.topbutton.connect("clicked", self.cb_Top) self.bottombutton=gtk.ToolButton() self.bottombutton.set_stock_id(gtk.STOCK_GOTO_BOTTOM) self.bottombutton.connect("clicked", self.cb_Bottom) self.edit_toolbar.add(self.addbutton) self.edit_toolbar.add(self.removebutton) self.edit_toolbar.add(self.increasebutton) self.edit_toolbar.add(self.decreasebutton) self.edit_toolbar.add(self.topbutton) self.edit_toolbar.add(self.bottombutton) self.edit_menutree = MenuItemTree(self,menu) self.edit_right_box = gtk.Frame(_("Actions")) self.actionListItem = None self.edit_left_box.pack_start(self.edit_toolbar,False) self.edit_left_box.pack_start(self.edit_menutree,True) self.editbox.add(self.edit_left_box) self.editbox.add(self.edit_right_box) self.edit.add(self.editbox) self.pack_start(self.edit) self.edit_menutree.connect("cursor-changed",self.menuItemChangeCallback) self.show_all()
def __init__(self, par, action): self.par = par gtk.Table.__init__(self, 4, 4, False) self.actionId = action.getLocalId() self.radio_url = gtk.RadioButton(None, _("URL:")) self.radio_widgetSpaceConstellation = gtk.RadioButton( self.radio_url, _("Widget into Space:")) self.radio_view = gtk.RadioButton(self.radio_url, _("Other View:")) self.entry_url = DefaultEntry( default_message=_("http://www.example.org")) self.entry_widget = ObjectCombo( self, "Widget", selectFirst=True, virtualRootObject=action.getActionList().getMenuItem().getMenu( ).getSite().getSkarphed()) self.entry_space = SpaceCombo( self, action.getActionList().getMenuItem().getMenu().getSite()) self.entry_view = ObjectCombo( self, "View", selectFirst=True, virtualRootObject=action.getActionList().getMenuItem().getMenu( ).getSite().getSkarphed()) self.entry_url.connect("focus-in-event", self.focusCallback) self.entry_widget.connect("popup", self.focusCallback) self.entry_widget.connect("changed", self.focusCallback) self.entry_space.connect("focus-in-event", self.focusCallback) self.entry_view.connect("popup", self.focusCallback) self.entry_widget.connect("changed", self.focusCallback) self.deleteButton = gtk.Button(stock=gtk.STOCK_DELETE) self.increaseOrderButton = gtk.Button(stock=gtk.STOCK_GO_UP) self.decreaseOrderButton = gtk.Button(stock=gtk.STOCK_GO_DOWN) self.saveButton = gtk.Button(stock=gtk.STOCK_SAVE) self.deleteButton.connect("clicked", self.deleteCallback) self.increaseOrderButton.connect("clicked", self.increaseOrderCallback) self.decreaseOrderButton.connect("clicked", self.decreaseOrderCallback) self.saveButton.connect("clicked", self.saveCallback) self.attach(self.radio_url, 0, 1, 0, 1) self.attach(self.entry_url, 1, 3, 0, 1) self.attach(self.radio_widgetSpaceConstellation, 0, 1, 1, 2) self.attach(self.entry_widget, 1, 2, 1, 2) self.attach(self.entry_space, 2, 3, 1, 2) self.attach(self.radio_view, 0, 1, 2, 3) self.attach(self.entry_view, 1, 3, 2, 3) self.attach(self.deleteButton, 0, 1, 3, 4) self.attach(self.increaseOrderButton, 1, 2, 3, 4) self.attach(self.decreaseOrderButton, 2, 3, 3, 4) self.attach(self.saveButton, 3, 4, 3, 4) action.addCallback(self.render) self.show_all() self.render()
def __init__(self,*args,**kwargs): '''Constructor --''' assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.TreeStore.__init__(self,*args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] self.objectStore.setMainTreeCallback(self.render) self.busy = False # Prevent threadcollisions root = self.append(None,(IconStock.SKARPHED,_("Skarphed Infrastructure"),-2))
def __init__(self, *args, **kwargs): '''Constructor --''' assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.TreeStore.__init__(self, *args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] self.objectStore.setMainTreeCallback(self.render) self.busy = False # Prevent threadcollisions root = self.append( None, (IconStock.SKARPHED, _("Skarphed Infrastructure"), -2))
def render(self): try: action = self.getApplication().getLocalObjectById(self.actionId) except GenericObjectStoreException: self.getPar().destroy() return if action.data['type'] == 'url': self.actionDisplay.set_text(_('Goto URL: ')+str(action.data['url'])) elif action.data['type'] == 'widgetSpaceConstellation': self.actionDisplay.set_text(_('Move Widget ')+str(action.data['widgetId'])+_(' into Space ')+str(action.data['space'])) elif action.data['type'] == 'site': self.actionDisplay.set_text(_('Goto Site ')+str(action.data['siteId']))
def __init__(self,parent,role): ObjectPageAbstract.__init__(self,parent,role) role.fetchPermissions() self.headline = gtk.Label() self.pack_start(self.headline,False) self.info = PageFrame(self,_("Information"), gui.IconStock.ROLE) self.infobox = gtk.VBox() self.info.add(self.infobox) self.pack_start(self.info,False) self.perm = PageFrame(self,_("Permissions"), gui.IconStock.PERMISSION) self.permbox = gtk.Table(1,2,False) self.permbox.set_row_spacings(10) self.permbox.set_col_spacings(10) self.permbox.set_border_width(10) self.perm_permlabel = FrameLabel(self,_("Please choose the Permissions you want to assign to the user here:"), gui.IconStock.PERMISSION) self.perm_permlistview = gtk.TreeView() self.perm_permlist = gtk.ListStore(int, str,str) self.perm_permlistview.set_model(self.perm_permlist) self.perm_permlist_col_checkbox = gtk.TreeViewColumn('') self.perm_permlist_col_identifier = gtk.TreeViewColumn(_('Permission Identifier')) self.perm_permlist_col_name = gtk.TreeViewColumn(_('Permission Name')) self.perm_permlistview.append_column(self.perm_permlist_col_checkbox) self.perm_permlistview.append_column(self.perm_permlist_col_identifier) self.perm_permlistview.append_column(self.perm_permlist_col_name) self.perm_permlist_renderer_checkbox= gtk.CellRendererToggle() self.perm_permlist_renderer_identifier = gtk.CellRendererText() self.perm_permlist_renderer_name = gtk.CellRendererText() self.perm_permlist_col_checkbox.pack_start(self.perm_permlist_renderer_checkbox) self.perm_permlist_col_identifier.pack_start(self.perm_permlist_renderer_identifier) self.perm_permlist_col_name.pack_start(self.perm_permlist_renderer_name) self.perm_permlist_col_checkbox.add_attribute(self.perm_permlist_renderer_checkbox,'active',0) self.perm_permlist_col_identifier.add_attribute(self.perm_permlist_renderer_identifier,'text',1) self.perm_permlist_col_name.add_attribute(self.perm_permlist_renderer_name,'text',2) self.perm_permlist_renderer_checkbox.set_activatable(True) self.perm_permlist_renderer_checkbox.connect("toggled",self.toggledRight) self.permbox.attach(self.perm_permlabel,0,1,0,1) self.permbox.attach(self.perm_permlistview,0,1,1,2) self.perm.add(self.permbox) self.pack_start(self.perm,False) self.show_all() self.render()
def __init__(self, par, action): self.par = par gtk.Table.__init__(self,4,4,False) self.actionId = action.getLocalId() self.radio_url = gtk.RadioButton(None, _("URL:")) self.radio_widgetSpaceConstellation = gtk.RadioButton(self.radio_url, _("Widget into Space:")) self.radio_view = gtk.RadioButton(self.radio_url, _("Other View:")) self.entry_url = DefaultEntry(default_message=_("http://www.example.org")) self.entry_widget = ObjectCombo(self, "Widget", selectFirst=True, virtualRootObject=action.getActionList().getMenuItem().getMenu().getSite().getSkarphed()) self.entry_space = SpaceCombo(self,action.getActionList().getMenuItem().getMenu().getSite()) self.entry_view = ObjectCombo(self, "View", selectFirst=True, virtualRootObject=action.getActionList().getMenuItem().getMenu().getSite().getSkarphed()) self.entry_url.connect("focus-in-event",self.focusCallback) self.entry_widget.connect("popup",self.focusCallback) self.entry_widget.connect("changed",self.focusCallback) self.entry_space.connect("focus-in-event",self.focusCallback) self.entry_view.connect("popup",self.focusCallback) self.entry_widget.connect("changed",self.focusCallback) self.deleteButton = gtk.Button(stock=gtk.STOCK_DELETE) self.increaseOrderButton = gtk.Button(stock=gtk.STOCK_GO_UP) self.decreaseOrderButton = gtk.Button(stock=gtk.STOCK_GO_DOWN) self.saveButton = gtk.Button(stock=gtk.STOCK_SAVE) self.deleteButton.connect("clicked", self.deleteCallback) self.increaseOrderButton.connect("clicked", self.increaseOrderCallback) self.decreaseOrderButton.connect("clicked", self.decreaseOrderCallback) self.saveButton.connect("clicked", self.saveCallback) self.attach(self.radio_url,0,1,0,1) self.attach(self.entry_url,1,3,0,1) self.attach(self.radio_widgetSpaceConstellation,0,1,1,2) self.attach(self.entry_widget,1,2,1,2) self.attach(self.entry_space,2,3,1,2) self.attach(self.radio_view,0,1,2,3) self.attach(self.entry_view,1,3,2,3) self.attach(self.deleteButton,0,1,3,4) self.attach(self.increaseOrderButton,1,2,3,4) self.attach(self.decreaseOrderButton,2,3,3,4) self.attach(self.saveButton,3,4,3,4) action.addCallback(self.render) self.show_all() self.render()
def __init__(self, par, obj): gtk.Window.__init__(self) self.par = par self.objId = obj.getLocalId() self.set_title(_("Skarphed Admin :: CssEditor :: ") + obj.getName()) self.set_icon(CSS) self.set_size_request(600, 500) self.set_border_width(10) self.cssframe = PageFrame(self, _("Css-Properties"), CSS) self.label = gtk.Label(_("Edit CSS Settings for ") + obj.getName()) self.store = CssStore(str, str, str, bool, bool, parent=self) self.listview = CssView(self) self.listview.set_model(self.store) self.listviewscroll = gtk.ScrolledWindow() self.listviewscroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.vbox = gtk.VBox() self.framevbox = gtk.VBox() self.toolbar = gtk.Toolbar() self.tool_add = gtk.ToolButton() self.tool_add.set_stock_id(gtk.STOCK_ADD) self.tool_add.connect("clicked", self.addCallback) self.toolbar.add(self.tool_add) self.tool_save = gtk.ToolButton() self.tool_save.set_stock_id(gtk.STOCK_SAVE) self.tool_save.connect("clicked", self.saveCallback) self.toolbar.add(self.tool_save) self.vbox.pack_start(self.toolbar, False) self.tool_refresh = gtk.ToolButton() self.tool_refresh.set_stock_id(gtk.STOCK_REFRESH) self.tool_refresh.connect("clicked", self.refreshCallback) self.toolbar.add(self.tool_refresh) self.listviewscroll.add(self.listview) self.framevbox.pack_start(self.label, False) self.framevbox.pack_start(self.listviewscroll, True) self.cssframe.add(self.framevbox) self.vbox.pack_start(self.cssframe, True) self.add(self.vbox) self.connect("delete-event", self.closeCallback) self.show_all() obj.addCallback(self.render) obj.loadCssPropertySet()
def __init__(self, par, obj): gtk.Window.__init__(self) self.par = par self.objId = obj.getLocalId() self.set_title(_("Skarphed Admin :: CssEditor :: ")+obj.getName()) self.set_icon(CSS) self.set_size_request(600,500) self.set_border_width(10) self.cssframe = PageFrame(self,_("Css-Properties"),CSS) self.label = gtk.Label(_("Edit CSS Settings for ")+obj.getName()) self.store = CssStore(str, str, str, bool, bool, parent=self) self.listview = CssView(self) self.listview.set_model(self.store) self.listviewscroll = gtk.ScrolledWindow() self.listviewscroll.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC) self.vbox = gtk.VBox() self.framevbox = gtk.VBox() self.toolbar = gtk.Toolbar() self.tool_add=gtk.ToolButton() self.tool_add.set_stock_id(gtk.STOCK_ADD) self.tool_add.connect("clicked",self.addCallback) self.toolbar.add(self.tool_add) self.tool_save = gtk.ToolButton() self.tool_save.set_stock_id(gtk.STOCK_SAVE) self.tool_save.connect("clicked",self.saveCallback) self.toolbar.add(self.tool_save) self.vbox.pack_start(self.toolbar,False) self.tool_refresh = gtk.ToolButton() self.tool_refresh.set_stock_id(gtk.STOCK_REFRESH) self.tool_refresh.connect("clicked",self.refreshCallback) self.toolbar.add(self.tool_refresh) self.listviewscroll.add(self.listview) self.framevbox.pack_start(self.label,False) self.framevbox.pack_start(self.listviewscroll,True) self.cssframe.add(self.framevbox) self.vbox.pack_start(self.cssframe,True) self.add(self.vbox) self.connect("delete-event",self.closeCallback) self.show_all() obj.addCallback(self.render) obj.loadCssPropertySet()
def __init__(self, parent, server=None): '''Constructor --''' gtk.TreeView.__init__(self) self.par = parent #self.context = MatchTreeContextMenu(self.app,self) if server is not None: self.serverId = server.getLocalId() self.store = OperationStore(gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, str,str ,int, parent=self.par, server=server, objectStore=self.getApplication().getObjectStore()) #Icon, Name, ID, type else: self.serverId = None self.store = OperationStore(gtk.gdk.Pixbuf, gtk.gdk.Pixbuf, str,str ,int, parent=self.par, objectStore=self.getApplication().getObjectStore()) #Icon, Name, ID, type self.context = TreeContextMenu(self) self.set_model(self.store) self.col_active = gtk.TreeViewColumn('') self.col_name = gtk.TreeViewColumn(_("Operation")) self.col_invoked = gtk.TreeViewColumn(_("Invoked")) self.append_column(self.col_active) self.append_column(self.col_name) self.append_column(self.col_invoked) self.renderer_active = gtk.CellRendererPixbuf() self.renderer_name = gtk.CellRendererText() self.renderer_icon = gtk.CellRendererPixbuf() self.renderer_invoked = gtk.CellRendererText() self.col_active.pack_start(self.renderer_active,False) self.col_name.pack_start(self.renderer_icon,False) self.col_name.pack_start(self.renderer_name,True) self.col_invoked.pack_start(self.renderer_invoked,True) self.col_active.add_attribute(self.renderer_active,'pixbuf',0) self.col_name.add_attribute(self.renderer_icon,'pixbuf',1) self.col_name.add_attribute(self.renderer_name,'text',2) self.col_invoked.add_attribute(self.renderer_invoked,'text',3) #self.col_name.set_cell_data_func(self.renderer_id,self.renderId) self.col_name.set_sort_column_id(1) self.col_invoked.set_resizable(True) self.col_name.set_resizable(True) self.set_search_column(1) self.set_rules_hint(True) #self.connect("row-activated",self.cb_RowActivated) #self.connect("row-expanded",self.cb_RowExpanded) self.connect("button_press_event",self.cb_ButtonPressed)
def __init__(self, par, message, callback): gtk.Frame.__init__(self, _("Yes/No")) self.par = par self.hbox = gtk.HBox() self.vbox = gtk.VBox() self.dummy = gtk.Label("") self.label = gtk.Label(message) self.yes = gtk.Button(stock=gtk.STOCK_YES) self.no = gtk.Button(stock=gtk.STOCK_NO) self.hbox.pack_start(self.yes) self.hbox.pack_start(self.no) self.vbox.pack_start(self.label, False) self.vbox.pack_start(self.hbox, False) self.vbox.pack_start(self.dummy, True) self.vbox.set_spacing(30) self.alignment = gtk.Alignment(0.5, 0.5, 0.5, 0.5) self.alignment.add(self.vbox) self.add(self.alignment) self.callback = callback self.yes.connect('clicked', self.yes_callback) self.no.connect('clicked', self.no_callback) self.getApplication().getMainWindow().openDialogPane(self)
def __init__(self, entry=None): gtk.Button.__init__(self) self.set_label(_("View Passwords")) self.entries = [] if entry is not None: self.entries.append(entry) self.connect("clicked", self.cb)
def render(self): user = self.getMyObject() if not user: return self.headline.set_markup( _("<b>Settings for User: "******"</b>") if user.permissiondata is not None: self.perm_permlist.clear() for permission in user.permissiondata: self.perm_permlist.append( (int(permission['granted']), str(permission['right']), '')) if user.roledata is not None: self.perm_rolelist.clear() for role in user.roledata: self.perm_rolelist.append( (int(role['granted']), str(role['name']), '', role['id'])) alter_pw_permitted = user.getUsers().getSkarphed().checkPermission( "skarphed.users.alter_password") is_active_user = user.getUsers().getSkarphed().getUsername( ) == user.getName() if alter_pw_permitted or is_active_user: self.alterpw.set_visible(True) self.alterpw_oldpw_entry.set_visible(is_active_user) self.alterpw_oldpw_label.set_visible(is_active_user) else: self.alterpw.set_visible(False)
def errorMessage(msgId): msgs = (_("This URL cannot be resolved"), ) dia = gtk.MessageDialog(parent=self.getPar().getPar(), flags=0, type=gtk.MESSAGE_WARNING, \ buttons=gtk.BUTTONS_OK, message_format=msgs[msgId]) dia.run() dia.destroy()
def __init__(self,*args,**kwargs): '''Constructor --''' assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.TreeStore.__init__(self,*args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] if kwargs['server'] is not None: self.server = kwargs['server'] self.server.getOperationManager().addCallback(self.render) else: self.server = None self.objectStore.addCallback(self.render) self.busy = False # Prevent threadcollisions self.root = self.append(None,(IconStock.ERROR,IconStock.OPERATION,_("Operationtree"),"",-2))
def __init__(self, par, message, callback): gtk.Frame.__init__(self, _("Yes/No")) self.par = par self.hbox = gtk.HBox() self.vbox = gtk.VBox() self.dummy = gtk.Label("") self.label = gtk.Label(message) self.yes = gtk.Button(stock=gtk.STOCK_YES); self.no = gtk.Button(stock=gtk.STOCK_NO) self.hbox.pack_start(self.yes) self.hbox.pack_start(self.no) self.vbox.pack_start(self.label,False) self.vbox.pack_start(self.hbox,False) self.vbox.pack_start(self.dummy,True) self.vbox.set_spacing(30) self.alignment = gtk.Alignment(0.5,0.5,0.5,0.5) self.alignment.add(self.vbox) self.add(self.alignment) self.callback = callback self.yes.connect('clicked', self.yes_callback) self.no.connect('clicked', self.no_callback) self.getApplication().getMainWindow().openDialogPane(self)
def render(self): user = self.getMyObject() if not user: return self.headline.set_markup(_("<b>Settings for User: "******"</b>") if user.permissiondata is not None: self.perm_permlist.clear() for permission in user.permissiondata: self.perm_permlist.append((int(permission['granted']),str(permission['right']),'')) if user.roledata is not None: self.perm_rolelist.clear() for role in user.roledata: self.perm_rolelist.append((int(role['granted']), str(role['name']), '', role['id'])) alter_pw_permitted = user.getUsers().getSkarphed().checkPermission("skarphed.users.alter_password") is_active_user = user.getUsers().getSkarphed().getUsername() == user.getName() if alter_pw_permitted or is_active_user: self.alterpw.set_visible(True) self.alterpw_oldpw_entry.set_visible(is_active_user) self.alterpw_oldpw_label.set_visible(is_active_user) else: self.alterpw.set_visible(False)
def render(self): try: action = self.getApplication().getLocalObjectById(self.actionId) except GenericObjectStoreException: self.getPar().destroy() return if action.data['type'] == 'url': self.actionDisplay.set_text( _('Goto URL: ') + str(action.data['url'])) elif action.data['type'] == 'widgetSpaceConstellation': self.actionDisplay.set_text( _('Move Widget ') + str(action.data['widgetId']) + _(' into Space ') + str(action.data['space'])) elif action.data['type'] == 'site': self.actionDisplay.set_text( _('Goto Site ') + str(action.data['siteId']))
def __init__(self, *args, **kwargs): '''Constructor --''' assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.ListStore.__init__(self, *args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] self.objectStore.addCallback(self.render) self.filterString = None
def __init__(self,*args,**kwargs): '''Constructor --''' assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.ListStore.__init__(self,*args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] self.objectStore.addCallback(self.render) self.filterString = None
def __init__(self, *args, **kwargs): '''Constructor --''' assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.TreeStore.__init__(self, *args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] if kwargs['server'] is not None: self.server = kwargs['server'] self.server.getOperationManager().addCallback(self.render) else: self.server = None self.objectStore.addCallback(self.render) self.busy = False # Prevent threadcollisions self.root = self.append( None, (IconStock.ERROR, IconStock.OPERATION, _("Operationtree"), "", -2))
def uploadTemplate(self, widget=None, data=None): template = self.getMyObject() if not template: return if self.fileToUpload is not None and self.fileToUpload != "": template.upload(self.fileToUpload) else: raise Exception(_("No File specified"))
def __init__(self, par, widget): self.par = par gtk.Frame.__init__(self) self.widgetId = widget.getLocalId() self._change_for_render = False self.toggle = gtk.CheckButton(_("Automatically generate Views")) self.set_label_widget(self.toggle) self.table = gtk.Table(3, 3, False) self.label_view = gtk.Label(_("Baseview:")) self.label_space = gtk.Label(_("Targetspace:")) self.combo_view = ObjectCombo( self, "View", selectFirst=True, noneElement=True, virtualRootObject=widget.getModule().getModules().getSkarphed()) self.combo_space = gtk.ComboBox() self.savebutton = gtk.Button(stock=gtk.STOCK_SAVE) self.dummy = gtk.Label("") self.table.attach(self.label_view, 0, 1, 0, 1, gtk.FILL | gtk.SHRINK, gtk.FILL | gtk.SHRINK) self.table.attach(self.combo_view, 1, 2, 0, 1, gtk.FILL | gtk.SHRINK, gtk.FILL | gtk.SHRINK) self.table.attach(self.label_space, 0, 1, 1, 2, gtk.FILL | gtk.SHRINK, gtk.FILL | gtk.SHRINK) self.table.attach(self.combo_space, 1, 2, 1, 2, gtk.FILL | gtk.SHRINK, gtk.FILL | gtk.SHRINK) self.table.attach(self.savebutton, 1, 2, 2, 3, gtk.FILL | gtk.SHRINK, gtk.FILL | gtk.SHRINK) self.table.attach(self.dummy, 2, 3, 0, 3, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) self.combo_view.connect("changed", self.viewChangedCallback) self.savebutton.connect("clicked", self.saveCallback) self.toggle.connect("toggled", self.toggleCallback) self.add(self.table) widget.addCallback(self.render) self.render()
def __init__(self,par, obj): ObjectPageAbstract.__init__(self, par, obj) self.labeltop = gtk.Label() self.labelbottom = gtk.Label(_("No further details")) self.add(self.labeltop) self.add(self.labelbottom) self.show_all() self.render()
def __init__(self,parent, profile=None): gtk.Frame.__init__(self) self.par = parent self.serverId = None self.profile = profile # self.set_title(_("Skarphed Admin Pro :: Public Key Infrastructure")) self.label = gtk.Label(_('Skarphed uses public keys to sign modules. If you are a developer\ and want to submit modules to Skarphed repositories, you can create and\ view your public Keys here.')) self.generateButton = gtk.Button(_("Generate PKI")) self.closeButton = gtk.Button(stock=gtk.STOCK_CLOSE) self.generateButton.connect("clicked", self.cb_generateKeys) self.closeButton.connect("clicked", self.cb_close) self.publicview = gtk.TextView() self.privateview = gtk.TextView() self.publicframe = gtk.Frame(_("Public Key")) self.privateframe = gtk.Frame(_("Private Key")) self.publicframe.add(self.publicview) self.privateframe.add(self.privateview) self.vbox = gtk.VBox() self.hbox = gtk.HBox() self.dummy = gtk.Label("") self.vbox.pack_start(self.label,False) self.vbox.pack_start(self.publicframe,True) self.vbox.pack_start(self.privateframe,True) self.hbox.pack_start(self.dummy, True) self.hbox.pack_start(self.generateButton,False) self.hbox.pack_start(self.closeButton,False) self.vbox.pack_start(self.hbox,False) self.set_border_width(10) self.vbox.set_border_width(10) self.add(self.vbox) self.connect("delete-event", self.cb_close) self.getApplication().getMainWindow().openDialogPane(self) self.render()
def render(self): role = self.getMyObject() if not role: return self.headline.set_markup(_("<b>Edit Role: "+role.getName()+"</b>")) if role.permissiondata is not None: self.perm_permlist.clear() for permission in role.permissiondata: self.perm_permlist.append((int(permission['granted']),str(permission['right']),''))
def cb_DeleteTemplate(self,widget=None,data=None): def execute(): repo = self.getMyObject() repo.deleteTemplate(self.templateToDelete) self.templateToDelete = None selection = self.templateList.treeview.get_selection() rowiter = selection.get_selected()[1] nr = self.templateList.store.get_value(rowiter,4) self.templateToDelete = nr YesNoPage(self.getApplication().getMainWindow(), _("Do you really want to delete this Template from the Repository?"), execute)
def installRowCallback(self,treeview=None,iter=None,path=None,data=None): template = self.getMyObject() if not template: return selection = self.repotree.get_selection() rowiter = selection.get_selected()[1] if rowiter is None: raise TemplatePageException(_("You must select a Template to install it")) nr = self.repostore.get_value(rowiter,4) template.installFromRepo(nr)
def errorMessage(msgId): msgs = (_("This URL cannot be resolved"),) dia = gtk.MessageDialog( parent=self.getPar().getPar(), flags=0, type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_OK, message_format=msgs[msgId], ) dia.run() dia.destroy()
def __init__(self, parent, view, widget=None): gtk.VBox.__init__(self) self.par = parent self.viewId = view.getLocalId() self._firstRendered = False self.setWidget(widget) self.buttonHBox = gtk.HBox() self.addbutton = gtk.Button(stock=gtk.STOCK_ADD) self.rembutton = gtk.Button(stock=gtk.STOCK_REMOVE) self.savebutton = gtk.Button(stock=gtk.STOCK_SAVE) self.liststore = gtk.ListStore(str, str, str) self.treeview = gtk.TreeView() self.treeview.set_model(self.liststore) self.col_param = gtk.TreeViewColumn(_('Parameter')) self.col_value = gtk.TreeViewColumn(_('Value')) self.treeview.append_column(self.col_param) self.treeview.append_column(self.col_value) self.ren_param = gtk.CellRendererText() self.ren_value = gtk.CellRendererText() self.col_param.pack_start(self.ren_param, False) self.col_value.pack_start(self.ren_value, False) self.col_param.add_attribute(self.ren_param, 'text', 0) self.col_value.add_attribute(self.ren_value, 'text', 1) self.ren_value.set_property('editable', True) self.ren_value.connect("edited", self.editedValueCallback) self.addbutton.set_sensitive(False) self.rembutton.set_sensitive(False) self.addbutton.connect("clicked", self.addParamCallback) self.rembutton.connect("clicked", self.removeParamCallback) self.savebutton.connect("clicked", self.saveCallback) self.buttonHBox.pack_start(self.addbutton, False) self.buttonHBox.pack_start(self.rembutton, False) self.buttonHBox.pack_start(self.savebutton, False) self.add(self.buttonHBox) self.add(self.treeview) self.render()
def __init__(self, *args, **kwargs): assert kwargs['objectStore'] is not None, _("Need ObjectStore") gtk.TreeStore.__init__(self, *args) self.par = kwargs['parent'] self.objectStore = kwargs['objectStore'] self.menuId = kwargs['menu'].getLocalId() kwargs['menu'].addCallback(self.render) self.busy = False # Prevent threadcollisions self.root = self.append( None, (IconStock.MENU, kwargs['menu'].getName(), self.menuId, 0)) self.render()
def render(self): role = self.getMyObject() if not role: return self.headline.set_markup(_("<b>Edit Role: " + role.getName() + "</b>")) if role.permissiondata is not None: self.perm_permlist.clear() for permission in role.permissiondata: self.perm_permlist.append( (int(permission['granted']), str(permission['right']), ''))
def __init__(self): gtk.HBox.__init__(self) self.label = gtk.Label() self.killswitch = gtk.Button(_("Kill")) self.pack_start(self.label, True) self.pack_start(self.killswitch, False) self.set_border_width(2) self.threadId = None self.show_all() self.killswitch.set_visible(False)