def __init__(self, event): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo from scal3.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.VBox.__init__(self) self.event = event ########### hbox = gtk.HBox() ### pack(hbox, gtk.Label(_('Calendar Type'))) combo = CalTypeCombo() combo.set_active(calTypes.primary) ## overwritten in updateWidget() pack(hbox, combo) pack(hbox, gtk.Label(''), 1, 1) self.modeCombo = combo ### pack(self, hbox) ########### if event.isAllDay: self.tzCheck = None else: hbox = gtk.HBox() self.tzCheck = gtk.CheckButton(_('Time Zone')) set_tooltip(self.tzCheck, _('For input times of event')) pack(hbox, self.tzCheck) combo = TimeZoneComboBoxEntry() pack(hbox, combo) pack(hbox, gtk.Label(''), 1, 1) self.tzCombo = combo pack(self, hbox) self.tzCheck.connect( 'clicked', lambda check: self.tzCombo.set_sensitive(check.get_active())) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_('Summary'))) self.summaryEntry = gtk.Entry() pack(hbox, self.summaryEntry, 1, 1) pack(self, hbox) ########### self.descriptionInput = TextFrame() swin = gtk.ScrolledWindow() swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) swin.add_with_viewport(self.descriptionInput) ### exp = gtk.Expander() exp.set_expanded(True) exp.set_label(_('Description')) exp.add(swin) pack(self, exp, 1, 1) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_('Icon') + ':')) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ########## self.modeCombo.connect( 'changed', self.modeComboChanged) ## right place? before updateWidget? FIXME
def __init__(self, name, stockName, method, desc='', shortDesc='', enableTooltip=True): #print('ToolbarItem', name, stockName, method, desc, text) self.method = method ###### if not desc: desc = name.capitalize() ## if not shortDesc: shortDesc = desc ## desc = _(desc) shortDesc = _(shortDesc) ###### gtk.ToolButton.__init__(self) self.set_icon_widget( gtk.Image.new_from_stock( getattr(gtk, 'STOCK_%s'%(stockName.upper())), gtk.IconSize.DIALOG, ) if stockName else None, #shortDesc, ) self.set_label(shortDesc) self._name = name self.desc = desc #self.shortDesc = shortDesc## FIXME self.initVars() if enableTooltip: set_tooltip(self, desc)## FIXME self.set_is_important(True)## FIXME
def changeMode(self, mode): if mode == self.rule.getMode(): return for i in range(12): set_tooltip( self.buttons[i], locale_man.getMonthName(mode, i + 1), )
def __init__(self): w = gtk.CheckButton(_("Run on session startup")) set_tooltip( w, "Run on startup of Gnome, KDE, Xfce, LXDE, ...\nFile: %s" % startup.comDesk ) self._widget = w
def newSmallNoFocusButton(stock, func, tooltip=""): arrow = ConButton() arrow.set_relief(2) arrow.set_can_focus(False) arrow.set_image(gtk.Image.new_from_stock(stock, gtk.IconSize.SMALL_TOOLBAR)) arrow.connect("con-clicked", func) if tooltip: set_tooltip(arrow, tooltip) return arrow
def newSmallNoFocusButton(stock, func, tooltip=''): arrow = ConButton() arrow.set_relief(2) arrow.set_can_focus(False) arrow.set_image(gtk.Image.new_from_stock(stock, gtk.IconSize.SMALL_TOOLBAR)) arrow.connect('con-clicked', func) if tooltip: set_tooltip(arrow, tooltip) return arrow
def __init__(self, event): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo from scal3.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.VBox.__init__(self) self.event = event ########### hbox = gtk.HBox() ### pack(hbox, gtk.Label(_('Calendar Type'))) combo = CalTypeCombo() combo.set_active(calTypes.primary)## overwritten in updateWidget() pack(hbox, combo) pack(hbox, gtk.Label(''), 1, 1) self.modeCombo = combo ### pack(self, hbox) ########### if event.isAllDay: self.tzCheck = None else: hbox = gtk.HBox() self.tzCheck = gtk.CheckButton(_('Time Zone')) set_tooltip(self.tzCheck, _('For input times of event')) pack(hbox, self.tzCheck) combo = TimeZoneComboBoxEntry() pack(hbox, combo) pack(hbox, gtk.Label(''), 1, 1) self.tzCombo = combo pack(self, hbox) self.tzCheck.connect('clicked', lambda check: self.tzCombo.set_sensitive(check.get_active())) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_('Summary'))) self.summaryEntry = gtk.Entry() pack(hbox, self.summaryEntry, 1, 1) pack(self, hbox) ########### self.descriptionInput = TextFrame() swin = gtk.ScrolledWindow() swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) swin.add_with_viewport(self.descriptionInput) ### exp = gtk.Expander() exp.set_expanded(True) exp.set_label(_('Description')) exp.add(swin) pack(self, exp, 1, 1) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_('Icon')+':')) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ########## self.modeCombo.connect('changed', self.modeComboChanged)## right place? before updateWidget? FIXME
def build(self): self.im = gtk.Image() self.setFocus(False) self.im.set_size_request(self.size, self.size) self.add(self.im) self.connect('enter-notify-event', self.enterNotify) self.connect('leave-notify-event', self.leaveNotify) self.connect('button-press-event', self.buttonPress) self.connect('button-release-event', self.buttonRelease) set_tooltip(self, self.desc)## FIXME
def build(self): self.im = gtk.Image() self.setFocus(False) self.im.set_size_request(self.size, self.size) self.add(self.im) self.connect("enter-notify-event", self.enterNotify) self.connect("leave-notify-event", self.leaveNotify) self.connect("button-press-event", self.buttonPress) self.connect("button-release-event", self.buttonRelease) set_tooltip(self, self.desc)## FIXME
def __init__(self, rule): self.rule = rule ### gtk.HBox.__init__(self) ### self.buttons = [] mode = self.rule.getMode() for i in range(12): b = gtk.ToggleButton(_(i + 1)) set_tooltip(b, locale_man.getMonthName(mode, i + 1)) pack(self, b) self.buttons.append(b)
def __init__(self, rule): self.rule = rule ### gtk.HBox.__init__(self) ### self.buttons = [] mode = self.rule.getMode() for i in range(12): b = gtk.ToggleButton(_(i+1)) set_tooltip(b, locale_man.getMonthName(mode, i+1)) pack(self, b) self.buttons.append(b)
def createDialog(self): if self.dialog: return print('----- toplevel', self.get_toplevel()) self.dialog = gtk.Dialog( title=self.rule.desc, parent=self.get_toplevel(), ) ### self.treev = gtk.TreeView() self.treev.set_headers_visible(True) self.treev.set_model(self.trees) ## cell = gtk.CellRendererText() cell.set_property('editable', True) cell.connect('edited', self.dateCellEdited) col = gtk.TreeViewColumn(_('Date'), cell, text=0) self.treev.append_column(col) ## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ## tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _('Add')) tb.connect('clicked', self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb ## tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _('Delete')) tb.connect('clicked', self.deleteClicked) toolbar.insert(tb, -1) #self.buttonDel = tb ## tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _('Move up')) tb.connect('clicked', self.moveUpClicked) toolbar.insert(tb, -1) ## tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _('Move down')) tb.connect('clicked', self.moveDownClicked) toolbar.insert(tb, -1) ## dialogHbox = gtk.HBox() pack(dialogHbox, self.treev, 1, 1) pack(dialogHbox, toolbar) pack(self.dialog.vbox, dialogHbox, 1, 1) self.dialog.vbox.show_all() self.dialog.resize(200, 300) self.dialog.connect('response', lambda w, e: self.dialog.hide()) ## okButton = self.dialog.add_button(gtk.STOCK_OK, gtk.ResponseType.CANCEL) if ui.autoLocale: okButton.set_label(_('_OK')) okButton.set_image( gtk.Image.new_from_stock(gtk.STOCK_OK, gtk.IconSize.BUTTON))
def createDialog(self): if self.dialog: return print('----- toplevel', self.get_toplevel()) self.dialog = gtk.Dialog( title=self.rule.desc, parent=self.get_toplevel(), ) ### self.treev = gtk.TreeView() self.treev.set_headers_visible(True) self.treev.set_model(self.trees) ## cell = gtk.CellRendererText() cell.set_property('editable', True) cell.connect('edited', self.dateCellEdited) col = gtk.TreeViewColumn(_('Date'), cell, text=0) self.treev.append_column(col) ## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ## tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _('Add')) tb.connect('clicked', self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb ## tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _('Delete')) tb.connect('clicked', self.deleteClicked) toolbar.insert(tb, -1) #self.buttonDel = tb ## tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _('Move up')) tb.connect('clicked', self.moveUpClicked) toolbar.insert(tb, -1) ## tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _('Move down')) tb.connect('clicked', self.moveDownClicked) toolbar.insert(tb, -1) ## dialogHbox = gtk.HBox() pack(dialogHbox, self.treev, 1, 1) pack(dialogHbox, toolbar) pack(self.dialog.vbox, dialogHbox, 1, 1) self.dialog.vbox.show_all() self.dialog.resize(200, 300) self.dialog.connect('response', lambda w, e: self.dialog.hide()) ## okButton = self.dialog.add_button(gtk.STOCK_OK, gtk.ResponseType.CANCEL) if ui.autoLocale: okButton.set_label(_('_OK')) okButton.set_image(gtk.Image.new_from_stock(gtk.STOCK_OK, gtk.IconSize.BUTTON))
def __init__(self, term): self.term = term ##### gtk.HBox.__init__(self) self.treev = gtk.TreeView() self.treev.set_headers_visible(False) self.trees = gtk.ListStore(str) self.treev.set_model(self.trees) ########## cell = gtk.CellRendererText() cell.set_property("editable", True) cell.connect("edited", self.timeEdited) col = gtk.TreeViewColumn(_("Time"), cell, text=0) self.treev.append_column(col) #### pack(self, self.treev, 1, 1) ########## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #try:## DeprecationWarning #????????????? # #toolbar.set_icon_size(gtk.IconSize.SMALL_TOOLBAR) # # no different (argument to set_icon_size has no effect) ????????? #except: # pass size = gtk.IconSize.SMALL_TOOLBAR ##no different(argument2 to image_new_from_stock has no effect) ????????? #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.MENU tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _("Add")) tb.connect("clicked", self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb #### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _("Delete")) tb.connect("clicked", self.deleteClicked) toolbar.insert(tb, -1) #self.buttonDel = tb ####### pack(self, toolbar)
def __init__(self, term): self.term = term ##### gtk.HBox.__init__(self) self.treev = gtk.TreeView() self.treev.set_headers_visible(False) self.trees = gtk.ListStore(str) self.treev.set_model(self.trees) ########## cell = gtk.CellRendererText() cell.set_property('editable', True) cell.connect('edited', self.timeEdited) col = gtk.TreeViewColumn(_('Time'), cell, text=0) self.treev.append_column(col) #### pack(self, self.treev, 1, 1) ########## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #try:## DeprecationWarning #????????????? #toolbar.set_icon_size(gtk.IconSize.SMALL_TOOLBAR) ### no different (argument to set_icon_size does not affect) ????????? #except: # pass size = gtk.IconSize.SMALL_TOOLBAR ##no different(argument2 to image_new_from_stock does not affect) ????????? #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.MENU tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _('Add')) tb.connect('clicked', self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb #### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _('Delete')) tb.connect('clicked', self.deleteClicked) toolbar.insert(tb, -1) #self.buttonDel = tb ####### pack(self, toolbar)
def __init__(self): self._widget = gtk.HBox() size = gtk.IconSize.SMALL_TOOLBAR ###### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) ######## treev = ActiveCalsTreeView() treev.connect("row-activated", self.activeTreevRActivate) treev.connect("focus-in-event", self.activeTreevFocus) treev.get_selection().connect( "changed", self.activeTreevSelectionChanged, ) ### pack(self._widget, treev.makeSwin()) #### self.activeTreev = treev self.activeTrees = treev.get_model() ######## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #### tb = gtk.ToolButton() tb.set_direction(gtk.TextDirection.LTR) tb.action = "" self.leftRightButton = tb set_tooltip(tb, _("Activate/Inactivate")) tb.connect("clicked", self.leftRightClicked) toolbar.insert(tb, -1) #### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _("Move up")) tb.connect("clicked", self.upClicked) toolbar.insert(tb, -1) ## tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _("Move down")) tb.connect("clicked", self.downClicked) toolbar.insert(tb, -1) ## pack(self._widget, toolbar) ######## treev = InactiveCalsTreeView() treev.connect("row-activated", self.inactiveTreevRActivate) treev.connect("focus-in-event", self.inactiveTreevFocus) treev.get_selection().connect( "changed", self.inactiveTreevSelectionChanged, ) ### pack(self._widget, treev.makeSwin()) #### self.inactiveTreev = treev self.inactiveTrees = treev.get_model()
def __init__(self, defaultValue=""): self.defaultValue = defaultValue ##### gtk.HBox.__init__(self) self.treev = gtk.TreeView() self.treev.set_headers_visible(False) self.trees = gtk.ListStore(str) self.treev.set_model(self.trees) ########## cell = gtk.CellRendererText() cell.set_property("editable", True) col = gtk.TreeViewColumn("", cell, text=0) self.treev.append_column(col) #### pack(self, self.treev, 1, 1) ########## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #try:## DeprecationWarning #????????????? # toolbar.set_icon_size(gtk.IconSize.SMALL_TOOLBAR) # # no different (argument to set_icon_size does not affect) ????????? #except: # pass size = gtk.IconSize.SMALL_TOOLBAR ##no different(argument2 to image_new_from_stock does not affect) ????????? #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.MENU tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _("Add")) tb.connect("clicked", self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb #### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _("Move up")) tb.connect("clicked", self.moveUpClicked) toolbar.insert(tb, -1) #### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _("Move down")) tb.connect("clicked", self.moveDownClicked) toolbar.insert(tb, -1) ####### pack(self, toolbar)
def __init__(self, defaultValue=''): self.defaultValue = defaultValue ##### gtk.HBox.__init__(self) self.treev = gtk.TreeView() self.treev.set_headers_visible(False) self.trees = gtk.ListStore(str) self.treev.set_model(self.trees) ########## cell = gtk.CellRendererText() cell.set_property('editable', True) col = gtk.TreeViewColumn('', cell, text=0) self.treev.append_column(col) #### pack(self, self.treev, 1, 1) ########## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #try:## DeprecationWarning #????????????? #toolbar.set_icon_size(gtk.IconSize.SMALL_TOOLBAR) ### no different (argument to set_icon_size does not affect) ????????? #except: # pass size = gtk.IconSize.SMALL_TOOLBAR ##no different(argument2 to image_new_from_stock does not affect) ????????? #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.MENU tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _('Add')) tb.connect('clicked', self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb #### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _('Move up')) tb.connect('clicked', self.moveUpClicked) toolbar.insert(tb, -1) #### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _('Move down')) tb.connect('clicked', self.moveDownClicked) toolbar.insert(tb, -1) ####### pack(self, toolbar)
def __init__(self, **kwargs): checkEventsReadOnly() # FIXME gtk.Dialog.__init__(self, **kwargs) self.initVars() ud.windowList.appendItem(self) #### self.syncing = None ## or a tuple of (groupId, statusText) self.groupIterById = {} self.trashIter = None self.isLoaded = False self.loadedGroupIds = set() self.eventsIter = {} #### self.set_title(_("Event Manager")) self.resize(600, 300) self.connect("delete-event", self.onDeleteEvent) self.set_transient_for(None) self.set_type_hint(gdk.WindowTypeHint.NORMAL) ## dialog_add_button(self, gtk.STOCK_OK, _("_OK"), gtk.ResponseType.OK) #self.connect("response", lambda w, e: self.hide()) self.connect("response", self.onResponse) self.connect("show", self.onShow) ####### self.searchWin = EventSearchWindow() ####### menubar = gtk.MenuBar() #### fileItem = MenuItem(_("_File")) fileMenu = gtk.Menu() fileItem.set_submenu(fileMenu) menubar.append(fileItem) ## addGroupItem = MenuItem(_("Add New Group")) addGroupItem.set_sensitive(not event_lib.allReadOnly) addGroupItem.connect("activate", self.addGroupBeforeSelection) ## or before selected group? FIXME fileMenu.append(addGroupItem) ## searchItem = MenuItem(_("_Search Events"))## FIXME right place? searchItem.connect("activate", self.mbarSearchClicked) fileMenu.append(searchItem) ## exportItem = MenuItem(_("_Export")) exportItem.connect("activate", self.mbarExportClicked) fileMenu.append(exportItem) ## importItem = MenuItem(_("_Import")) importItem.set_sensitive(not event_lib.allReadOnly) importItem.connect("activate", self.mbarImportClicked) fileMenu.append(importItem) ## orphanItem = MenuItem(_("Check for Orphan Events")) orphanItem.set_sensitive(not event_lib.allReadOnly) orphanItem.connect("activate", self.mbarOrphanClicked) fileMenu.append(orphanItem) #### editItem = MenuItem(_("_Edit")) if event_lib.allReadOnly: editItem.set_sensitive(False) else: editMenu = gtk.Menu() editItem.set_submenu(editMenu) menubar.append(editItem) ## editEditItem = MenuItem(_("Edit")) editEditItem.connect("activate", self.mbarEditClicked) editMenu.append(editEditItem) editMenu.connect("show", self.mbarEditMenuPopup) self.mbarEditItem = editEditItem ## editMenu.append(gtk.SeparatorMenuItem()) ## cutItem = MenuItem(_("Cu_t")) cutItem.connect("activate", self.mbarCutClicked) editMenu.append(cutItem) self.mbarCutItem = cutItem ## copyItem = MenuItem(_("_Copy")) copyItem.connect("activate", self.mbarCopyClicked) editMenu.append(copyItem) self.mbarCopyItem = copyItem ## pasteItem = MenuItem(_("_Paste")) pasteItem.connect("activate", self.mbarPasteClicked) editMenu.append(pasteItem) self.mbarPasteItem = pasteItem ## editMenu.append(gtk.SeparatorMenuItem()) ## dupItem = MenuItem(_("_Duplicate")) dupItem.connect("activate", self.duplicateSelectedObj) editMenu.append(dupItem) self.mbarDupItem = dupItem ## editMenu.append(gtk.SeparatorMenuItem()) ## enableAllItem = MenuItem(_("Enable All Groups")) enableAllItem.connect("activate", self.enableAllClicked) editMenu.append(enableAllItem) self.mbarEnableAllItem = enableAllItem ## disableAllItem = MenuItem(_("Disable All Groups")) disableAllItem.connect("activate", self.disableAllClicked) editMenu.append(disableAllItem) self.mbarDisableAllItem = disableAllItem #### viewItem = MenuItem(_("_View")) viewMenu = gtk.Menu() viewItem.set_submenu(viewMenu) menubar.append(viewItem) ## collapseItem = MenuItem(_("Collapse All")) collapseItem.connect("activate", self.collapseAllClicked) viewMenu.append(collapseItem) ## expandItem = MenuItem(_("Expand All")) expandItem.connect("activate", self.expandAllClicked) viewMenu.append(expandItem) ## viewMenu.append(gtk.SeparatorMenuItem()) ## self.showDescItem = gtk.CheckMenuItem(_("Show _Description")) self.showDescItem.set_use_underline(True) self.showDescItem.set_active(ui.eventManShowDescription) self.showDescItem.connect("toggled", self.showDescItemToggled) viewMenu.append(self.showDescItem) #### #testItem = MenuItem(_("Test")) #testMenu = gtk.Menu() #testItem.set_submenu(testMenu) #menubar.append(testItem) ### #item = MenuItem("") #item.connect("activate", ) #testMenu.append(item) #### menubar.show_all() pack(self.vbox, menubar) ####### treeBox = gtk.HBox() ##### self.treev = gtk.TreeView() self.treev.set_search_column(2) #self.treev.set_headers_visible(False)## FIXME #self.treev.get_selection().set_mode(gtk.SelectionMode.MULTIPLE)## FIXME #self.treev.set_rubber_banding(gtk.SelectionMode.MULTIPLE)## FIXME #self.treev.connect("realize", self.onTreeviewRealize) self.treev.get_selection().connect( "changed", self.treeviewCursorChanged, ) # FIXME self.treev.connect("button-press-event", self.treeviewButtonPress) self.treev.connect("row-activated", self.rowActivated) self.treev.connect("key-press-event", self.keyPress) ##### swin = gtk.ScrolledWindow() swin.add(self.treev) swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) pack(treeBox, swin, 1, 1) ### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _("Move up")) tb.connect("clicked", self.moveUpByButton) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _("Move down")) tb.connect("clicked", self.moveDownByButton) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_COPY, size) set_tooltip(tb, _("Duplicate")) tb.connect("clicked", self.duplicateSelectedObj) toolbar.insert(tb, -1) ### pack(treeBox, toolbar) ##### pack(self.vbox, treeBox, 1, 1) ####### self.trees = gtk.TreeStore(int, GdkPixbuf.Pixbuf, str, str) ## event: eid, event_icon, event_summary, event_description ## group: gid, group_pixbuf, group_title, ?description ## trash: -1, trash_icon, _("Trash"), "" self.treev.set_model(self.trees) ### col = gtk.TreeViewColumn() cell = gtk.CellRendererPixbuf() pack(col, cell) col.add_attribute(cell, "pixbuf", 1) col.set_property("expand", False) self.treev.append_column(col) self.pixbufCol = col ### col = gtk.TreeViewColumn( _("Summary"), gtk.CellRendererText(), text=2, ) col.set_resizable(True) col.set_property("expand", True) self.treev.append_column(col) ### self.colDesc = gtk.TreeViewColumn( _("Description"), gtk.CellRendererText(), text=3, ) self.colDesc.set_property("expand", True) if ui.eventManShowDescription: self.treev.append_column(self.colDesc) ### #self.treev.set_search_column(2)## or 3 ### self.toPasteEvent = None ## (treeIter, bool move) ##### self.sbar = gtk.Statusbar() self.sbar.set_direction(gtk.TextDirection.LTR) #self.sbar.set_has_resize_grip(False) pack(self.vbox, self.sbar) ##### self.vbox.show_all()
def __init__(self, **kwargs): gtk.Dialog.__init__(self, **kwargs) self.set_title(_("Tune Hijri Monthes")) self.connect("delete-event", self.onDeleteEvent) ############ self.altMode = 0 self.altModeDesc = "Gregorian" ############ hbox = gtk.HBox() self.topLabel = gtk.Label() pack(hbox, self.topLabel) self.startDateInput = DateButton() self.startDateInput.set_editable(False) ## FIXME self.startDateInput.connect("changed", lambda widget: self.updateEndDates()) pack(hbox, self.startDateInput) pack(self.vbox, hbox) ############################ treev = gtk.TreeView() trees = gtk.ListStore( int, # ym (hidden) str, # localized year str, # localized month int, # monthLenCombo str, # localized endDate ) treev.set_model(trees) #treev.get_selection().connect("changed", self.plugTreevCursorChanged) #treev.connect("row-activated", self.plugTreevRActivate) #treev.connect("button-press-event", self.plugTreevButtonPress) ### swin = gtk.ScrolledWindow() swin.add(treev) swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("Year"), cell, text=1) treev.append_column(col) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("Month"), cell, text=2) treev.append_column(col) ###### cell = gtk.CellRendererCombo() mLenModel = gtk.ListStore(int) mLenModel.append([29]) mLenModel.append([30]) cell.set_property("model", mLenModel) #cell.set_property("has-entry", False) cell.set_property("editable", True) cell.set_property("text-column", 0) cell.connect("edited", self.monthLenCellEdited) col = gtk.TreeViewColumn(_("Month Length"), cell, text=3) treev.append_column(col) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("End Date"), cell, text=4) treev.append_column(col) ###### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ### tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _("Add")) tb.connect("clicked", self.addClicked) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _("Delete")) tb.connect("clicked", self.delClicked) toolbar.insert(tb, -1) ###### self.treev = treev self.trees = trees ##### mainHbox = gtk.HBox() pack(mainHbox, swin, 1, 1) pack(mainHbox, toolbar) pack(self.vbox, mainHbox, 1, 1) ###### dialog_add_button( self, gtk.STOCK_OK, _("_OK"), gtk.ResponseType.OK, ) dialog_add_button( self, gtk.STOCK_CANCEL, _("_Cancel"), gtk.ResponseType.CANCEL, ) ## resetB = self.add_button( gtk.STOCK_UNDO, gtk.ResponseType.NONE, ) resetB.set_label(_("_Reset to Defaults")) resetB.set_image( gtk.Image.new_from_stock( gtk.STOCK_UNDO, gtk.IconSize.BUTTON, )) resetB.connect("clicked", self.resetToDefaults) ## self.connect("response", self.onResponse) #print(dir(self.get_action_area())) #self.get_action_area().set_homogeneous(False) ###### self.vbox.show_all()
def __init__(self, group): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo from scal3.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.VBox.__init__(self) self.group = group ######## self.sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL) ##### hbox = gtk.HBox() label = gtk.Label(_("Title")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.titleEntry = gtk.Entry() pack(hbox, self.titleEntry, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Color")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.colorButton = MyColorButton() self.colorButton.set_use_alpha(True) ## FIXME pack(hbox, self.colorButton) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Default Icon")) ## FIXME label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Default Calendar Type")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) combo = CalTypeCombo() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.modeCombo = combo pack(self, hbox) ##### hbox = gtk.HBox() self.tzCheck = gtk.CheckButton(_("Default Time Zone")) pack(hbox, self.tzCheck) self.sizeGroup.add_widget(self.tzCheck) combo = TimeZoneComboBoxEntry() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.tzCombo = combo pack(self, hbox) self.tzCheck.connect( "clicked", lambda check: self.tzCombo.set_sensitive(check.get_active()), ) ##### hbox = gtk.HBox() label = gtk.Label(_("Show in Calendar")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInDCalCheck = gtk.CheckButton(_("Day")) self.showInWCalCheck = gtk.CheckButton(_("Week")) self.showInMCalCheck = gtk.CheckButton(_("Month")) pack(hbox, self.showInDCalCheck) pack(hbox, gtk.Label(""), 1, 1) pack(hbox, self.showInWCalCheck) pack(hbox, gtk.Label(""), 1, 1) pack(hbox, self.showInMCalCheck) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Show in")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInTimeLineCheck = gtk.CheckButton(_("Time Line")) self.showInStatusIconCheck = gtk.CheckButton(_("Status Icon")) pack(hbox, self.showInTimeLineCheck) pack(hbox, gtk.Label(""), 1, 1) pack(hbox, self.showInStatusIconCheck) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Event Cache Size")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.cacheSizeSpin = IntSpinButton(0, 9999) pack(hbox, self.cacheSizeSpin) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(label=_("Event Text Separator")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.sepInput = TextFrame() pack(hbox, self.sepInput, 1, 1) pack(self, hbox) set_tooltip( hbox, _("Using to seperate Summary and Description when displaying event" )) ##### #hbox = gtk.HBox() #label = gtk.Label(_("Show Full Event Description")) #label.set_alignment(0, 0.5) #pack(hbox, label) #self.sizeGroup.add_widget(label) #self.showFullEventDescCheck = gtk.CheckButton("") #pack(hbox, self.showFullEventDescCheck, 1, 1) #pack(self, hbox) ### self.modeCombo.connect( "changed", self.modeComboChanged, ) # right place? before updateWidget? FIXME
def __init__(self, event): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo from scal3.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.VBox.__init__(self) self.event = event ########### hbox = gtk.HBox() ### pack(hbox, gtk.Label(_("Calendar Type"))) combo = CalTypeCombo() combo.set_active(calTypes.primary) ## overwritten in updateWidget() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.modeCombo = combo ### pack(self, hbox) ########### if event.isAllDay: self.tzCheck = None else: hbox = gtk.HBox() self.tzCheck = gtk.CheckButton(_("Time Zone")) set_tooltip(self.tzCheck, _("For input times of event")) pack(hbox, self.tzCheck) combo = TimeZoneComboBoxEntry() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.tzCombo = combo pack(self, hbox) self.tzCheck.connect( "clicked", lambda check: self.tzCombo.set_sensitive(check.get_active(), ), ) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_("Summary"))) self.summaryEntry = gtk.Entry() pack(hbox, self.summaryEntry, 1, 1) pack(self, hbox) ########### self.descriptionInput = TextFrame() swin = gtk.ScrolledWindow() swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) swin.add_with_viewport(self.descriptionInput) ### frame = gtk.Frame() frame.set_label(_("Description")) frame.add(swin) pack(self, frame, self.expandDescription, self.expandDescription) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_("Icon") + ":")) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ########## self.modeCombo.connect( "changed", self.modeComboChanged, ) # right place? before updateWidget? FIXME
def __init__(self, **kwargs): gtk.Dialog.__init__(self, **kwargs) self.set_title(_("Tune Hijri Monthes")) self.connect("delete-event", self.onDeleteEvent) ############ self.altMode = 0 self.altModeDesc = "Gregorian" ############ hbox = gtk.HBox() self.topLabel = gtk.Label() pack(hbox, self.topLabel) self.startDateInput = DateButton() self.startDateInput.set_editable(False)## FIXME self.startDateInput.connect("changed", lambda widget: self.updateEndDates()) pack(hbox, self.startDateInput) pack(self.vbox, hbox) ############################ treev = gtk.TreeView() trees = gtk.ListStore( int, # ym (hidden) str, # localized year str, # localized month int, # monthLenCombo str, # localized endDate ) treev.set_model(trees) #treev.get_selection().connect("changed", self.plugTreevCursorChanged) #treev.connect("row-activated", self.plugTreevRActivate) #treev.connect("button-press-event", self.plugTreevButtonPress) ### swin = gtk.ScrolledWindow() swin.add(treev) swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("Year"), cell, text=1) treev.append_column(col) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("Month"), cell, text=2) treev.append_column(col) ###### cell = gtk.CellRendererCombo() mLenModel = gtk.ListStore(int) mLenModel.append([29]) mLenModel.append([30]) cell.set_property("model", mLenModel) #cell.set_property("has-entry", False) cell.set_property("editable", True) cell.set_property("text-column", 0) cell.connect("edited", self.monthLenCellEdited) col = gtk.TreeViewColumn(_("Month Length"), cell, text=3) treev.append_column(col) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_("End Date"), cell, text=4) treev.append_column(col) ###### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ### tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _("Add")) tb.connect("clicked", self.addClicked) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _("Delete")) tb.connect("clicked", self.delClicked) toolbar.insert(tb, -1) ###### self.treev = treev self.trees = trees ##### mainHbox = gtk.HBox() pack(mainHbox, swin, 1, 1) pack(mainHbox, toolbar) pack(self.vbox, mainHbox, 1, 1) ###### dialog_add_button( self, gtk.STOCK_OK, _("_OK"), gtk.ResponseType.OK, ) dialog_add_button( self, gtk.STOCK_CANCEL, _("_Cancel"), gtk.ResponseType.CANCEL, ) ## resetB = self.add_button( gtk.STOCK_UNDO, gtk.ResponseType.NONE, ) resetB.set_label(_("_Reset to Defaults")) resetB.set_image(gtk.Image.new_from_stock( gtk.STOCK_UNDO, gtk.IconSize.BUTTON, )) resetB.connect("clicked", self.resetToDefaults) ## self.connect("response", self.onResponse) #print(dir(self.get_action_area())) #self.get_action_area().set_homogeneous(False) ###### self.vbox.show_all()
def __init__(self, **kwargs): checkEventsReadOnly() ## FIXME gtk.Dialog.__init__(self, **kwargs) self.initVars() ud.windowList.appendItem(self) #### self.syncing = None ## or a tuple of (groupId, statusText) self.groupIterById = {} self.trashIter = None self.isLoaded = False self.loadedGroupIds = set() self.eventsIter = {} #### self.set_title(_('Event Manager')) self.resize(600, 300) self.connect('delete-event', self.onDeleteEvent) self.set_transient_for(None) self.set_type_hint(gdk.WindowTypeHint.NORMAL) ## dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.ResponseType.OK) #self.connect('response', lambda w, e: self.hide()) self.connect('response', self.onResponse) self.connect('show', self.onShow) ####### self.searchWin = EventSearchWindow() ####### menubar = gtk.MenuBar() #### fileItem = MenuItem(_('_File')) fileMenu = gtk.Menu() fileItem.set_submenu(fileMenu) menubar.append(fileItem) ## addGroupItem = MenuItem(_('Add New Group')) addGroupItem.set_sensitive(not event_lib.readOnly) addGroupItem.connect('activate', self.addGroupBeforeSelection) ## or before selected group? FIXME fileMenu.append(addGroupItem) ## searchItem = MenuItem(_('_Search Events'))## FIXME right place? searchItem.connect('activate', self.mbarSearchClicked) fileMenu.append(searchItem) ## exportItem = MenuItem(_('_Export')) exportItem.connect('activate', self.mbarExportClicked) fileMenu.append(exportItem) ## importItem = MenuItem(_('_Import')) importItem.set_sensitive(not event_lib.readOnly) importItem.connect('activate', self.mbarImportClicked) fileMenu.append(importItem) ## orphanItem = MenuItem(_('Check for Orphan Events')) orphanItem.set_sensitive(not event_lib.readOnly) orphanItem.connect('activate', self.mbarOrphanClicked) fileMenu.append(orphanItem) #### editItem = MenuItem(_('_Edit')) if event_lib.readOnly: editItem.set_sensitive(False) else: editMenu = gtk.Menu() editItem.set_submenu(editMenu) menubar.append(editItem) ## editEditItem = MenuItem(_('Edit')) editEditItem.connect('activate', self.mbarEditClicked) editMenu.append(editEditItem) editMenu.connect('show', self.mbarEditMenuPopup) self.mbarEditItem = editEditItem ## editMenu.append(gtk.SeparatorMenuItem()) ## cutItem = MenuItem(_('Cu_t')) cutItem.connect('activate', self.mbarCutClicked) editMenu.append(cutItem) self.mbarCutItem = cutItem ## copyItem = MenuItem(_('_Copy')) copyItem.connect('activate', self.mbarCopyClicked) editMenu.append(copyItem) self.mbarCopyItem = copyItem ## pasteItem = MenuItem(_('_Paste')) pasteItem.connect('activate', self.mbarPasteClicked) editMenu.append(pasteItem) self.mbarPasteItem = pasteItem ## editMenu.append(gtk.SeparatorMenuItem()) ## dupItem = MenuItem(_('_Duplicate')) dupItem.connect('activate', self.duplicateSelectedObj) editMenu.append(dupItem) self.mbarDupItem = dupItem #### viewItem = MenuItem(_('_View')) viewMenu = gtk.Menu() viewItem.set_submenu(viewMenu) menubar.append(viewItem) ## collapseItem = MenuItem(_('Collapse All')) collapseItem.connect('activate', self.collapseAllClicked) viewMenu.append(collapseItem) ## expandItem = MenuItem(_('Expand All')) expandItem.connect('activate', self.expandAllClicked) viewMenu.append(expandItem) ## viewMenu.append(gtk.SeparatorMenuItem()) ## self.showDescItem = gtk.CheckMenuItem(_('Show _Description')) self.showDescItem.set_active(ui.eventManShowDescription) self.showDescItem.connect('toggled', self.showDescItemToggled) viewMenu.append(self.showDescItem) #### #testItem = MenuItem(_('Test')) #testMenu = gtk.Menu() #testItem.set_submenu(testMenu) #menubar.append(testItem) ### #item = MenuItem('') #item.connect('activate', ) #testMenu.append(item) #### menubar.show_all() pack(self.vbox, menubar) ####### treeBox = gtk.HBox() ##### self.treev = gtk.TreeView() self.treev.set_search_column(2) #self.treev.set_headers_visible(False)## FIXME #self.treev.get_selection().set_mode(gtk.SelectionMode.MULTIPLE)## FIXME #self.treev.set_rubber_banding(gtk.SelectionMode.MULTIPLE)## FIXME #self.treev.connect('realize', self.onTreeviewRealize) self.treev.get_selection().connect('changed', self.treeviewCursorChanged)## FIXME self.treev.connect('button-press-event', self.treeviewButtonPress) self.treev.connect('row-activated', self.rowActivated) self.treev.connect('key-press-event', self.keyPress) ##### swin = gtk.ScrolledWindow() swin.add(self.treev) swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) pack(treeBox, swin, 1, 1) ### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _('Move up')) tb.connect('clicked', self.moveUpByButton) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _('Move down')) tb.connect('clicked', self.moveDownByButton) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_COPY, size) set_tooltip(tb, _('Duplicate')) tb.connect('clicked', self.duplicateSelectedObj) toolbar.insert(tb, -1) ### pack(treeBox, toolbar) ##### pack(self.vbox, treeBox, 1, 1) ####### self.trees = gtk.TreeStore(int, GdkPixbuf.Pixbuf, str, str) ## event: eid, event_icon, event_summary, event_description ## group: gid, group_pixbuf, group_title, ?description ## trash: -1, trash_icon, _('Trash'), '' self.treev.set_model(self.trees) ### col = gtk.TreeViewColumn() cell = gtk.CellRendererPixbuf() pack(col, cell) col.add_attribute(cell, 'pixbuf', 1) col.set_property('expand', False) self.treev.append_column(col) ### col = gtk.TreeViewColumn( _('Summary'), gtk.CellRendererText(), text=2, ) col.set_resizable(True) col.set_property('expand', True) self.treev.append_column(col) ### self.colDesc = gtk.TreeViewColumn( _('Description'), gtk.CellRendererText(), text=3, ) self.colDesc.set_property('expand', True) if ui.eventManShowDescription: self.treev.append_column(self.colDesc) ### #self.treev.set_search_column(2)## or 3 ### self.toPasteEvent = None ## (path, bool move) ##### self.sbar = gtk.Statusbar() self.sbar.set_direction(gtk.TextDirection.LTR) #self.sbar.set_has_resize_grip(False) pack(self.vbox, self.sbar) ##### self.vbox.show_all()
def __init__(self, event): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo from scal3.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.VBox.__init__(self) self.event = event ########### hbox = gtk.HBox() ### pack(hbox, gtk.Label(_("Calendar Type"))) combo = CalTypeCombo() combo.set_active(calTypes.primary)## overwritten in updateWidget() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.modeCombo = combo ### pack(self, hbox) ########### if event.isAllDay: self.tzCheck = None else: hbox = gtk.HBox() self.tzCheck = gtk.CheckButton(_("Time Zone")) set_tooltip(self.tzCheck, _("For input times of event")) pack(hbox, self.tzCheck) combo = TimeZoneComboBoxEntry() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.tzCombo = combo pack(self, hbox) self.tzCheck.connect( "clicked", lambda check: self.tzCombo.set_sensitive( check.get_active(), ), ) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_("Summary"))) self.summaryEntry = gtk.Entry() pack(hbox, self.summaryEntry, 1, 1) pack(self, hbox) ########### self.descriptionInput = TextFrame() swin = gtk.ScrolledWindow() swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) swin.add_with_viewport(self.descriptionInput) ### frame = gtk.Frame() frame.set_label(_("Description")) frame.add(swin) pack(self, frame, self.expandDescription, self.expandDescription) ########### hbox = gtk.HBox() pack(hbox, gtk.Label(_("Icon") + ":")) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ########## self.modeCombo.connect( "changed", self.modeComboChanged, ) # right place? before updateWidget? FIXME
def __init__(self, group): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo gtk.VBox.__init__(self) self.group = group ######## self.sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL) ##### hbox = gtk.HBox() label = gtk.Label(_('Title')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.titleEntry = gtk.Entry() pack(hbox, self.titleEntry, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Color')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.colorButton = MyColorButton() self.colorButton.set_use_alpha(True) ## FIXME pack(hbox, self.colorButton) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Default Icon'))## FIXME label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Default Calendar Type')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) combo = CalTypeCombo() pack(hbox, combo) pack(hbox, gtk.Label(''), 1, 1) self.modeCombo = combo pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Show in Calendar')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInDCalCheck = gtk.CheckButton(_('Day')) self.showInWCalCheck = gtk.CheckButton(_('Week')) self.showInMCalCheck = gtk.CheckButton(_('Month')) pack(hbox, self.showInDCalCheck) pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.showInWCalCheck) pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.showInMCalCheck) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Show in')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInTimeLineCheck = gtk.CheckButton(_('Time Line')) self.showInStatusIconCheck = gtk.CheckButton(_('Status Icon')) pack(hbox, self.showInTimeLineCheck) pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.showInStatusIconCheck) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Event Cache Size')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.cacheSizeSpin = IntSpinButton(0, 9999) pack(hbox, self.cacheSizeSpin) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Event Text Seperator')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.sepInput = TextFrame() pack(hbox, self.sepInput, 1, 1) pack(self, hbox) set_tooltip(hbox, _('Using to seperate Summary and Description when displaying event')) ##### #hbox = gtk.HBox() #label = gtk.Label(_('Show Full Event Description')) #label.set_alignment(0, 0.5) #pack(hbox, label) #self.sizeGroup.add_widget(label) #self.showFullEventDescCheck = gtk.CheckButton('') #pack(hbox, self.showFullEventDescCheck, 1, 1) #pack(self, hbox) ### self.modeCombo.connect('changed', self.modeComboChanged)## right place? before updateWidget? FIXME
def __init__(self, group): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo from scal3.ui_gtk.mywidgets.tz_combo import TimeZoneComboBoxEntry gtk.VBox.__init__(self) self.group = group ######## self.sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL) ##### hbox = gtk.HBox() label = gtk.Label(_("Title")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.titleEntry = gtk.Entry() pack(hbox, self.titleEntry, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Color")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.colorButton = MyColorButton() self.colorButton.set_use_alpha(True) ## FIXME pack(hbox, self.colorButton) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Default Icon"))## FIXME label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Default Calendar Type")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) combo = CalTypeCombo() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.modeCombo = combo pack(self, hbox) ##### hbox = gtk.HBox() self.tzCheck = gtk.CheckButton(_("Default Time Zone")) pack(hbox, self.tzCheck) self.sizeGroup.add_widget(self.tzCheck) combo = TimeZoneComboBoxEntry() pack(hbox, combo) pack(hbox, gtk.Label(""), 1, 1) self.tzCombo = combo pack(self, hbox) self.tzCheck.connect( "clicked", lambda check: self.tzCombo.set_sensitive(check.get_active()), ) ##### hbox = gtk.HBox() label = gtk.Label(_("Show in Calendar")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInDCalCheck = gtk.CheckButton(_("Day")) self.showInWCalCheck = gtk.CheckButton(_("Week")) self.showInMCalCheck = gtk.CheckButton(_("Month")) pack(hbox, self.showInDCalCheck) pack(hbox, gtk.Label(""), 1, 1) pack(hbox, self.showInWCalCheck) pack(hbox, gtk.Label(""), 1, 1) pack(hbox, self.showInMCalCheck) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Show in")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInTimeLineCheck = gtk.CheckButton(_("Time Line")) self.showInStatusIconCheck = gtk.CheckButton(_("Status Icon")) pack(hbox, self.showInTimeLineCheck) pack(hbox, gtk.Label(""), 1, 1) pack(hbox, self.showInStatusIconCheck) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Event Cache Size")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.cacheSizeSpin = IntSpinButton(0, 9999) pack(hbox, self.cacheSizeSpin) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Event Text Seperator")) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.sepInput = TextFrame() pack(hbox, self.sepInput, 1, 1) pack(self, hbox) set_tooltip(hbox, _( "Using to seperate Summary and Description when displaying event" )) ##### #hbox = gtk.HBox() #label = gtk.Label(_("Show Full Event Description")) #label.set_alignment(0, 0.5) #pack(hbox, label) #self.sizeGroup.add_widget(label) #self.showFullEventDescCheck = gtk.CheckButton("") #pack(hbox, self.showFullEventDescCheck, 1, 1) #pack(self, hbox) ### self.modeCombo.connect( "changed", self.modeComboChanged, ) # right place? before updateWidget? FIXME
def __init__( self, term, defaultCourseName=_("New Course"), defaultCourseUnits=3, enableScrollbars=False, ): self.term = term ## UniversityTerm obj self.defaultCourseName = defaultCourseName self.defaultCourseUnits = defaultCourseUnits ##### gtk.HBox.__init__(self) self.treev = gtk.TreeView() self.treev.set_headers_visible(True) self.trees = gtk.ListStore(int, str, int) self.treev.set_model(self.trees) ########## cell = gtk.CellRendererText() cell.set_property("editable", True) cell.connect("edited", self.courseNameEdited) # cell.connect("editing-started", ....) # cell.connect("editing-canceled", ...) col = gtk.TreeViewColumn(_("Course Name"), cell, text=1) self.treev.append_column(col) ### cell = gtk.CellRendererText() cell.set_property("editable", True) cell.connect("edited", self.courseUnitsEdited) col = gtk.TreeViewColumn(_("Units"), cell, text=2) self.treev.append_column(col) #### if enableScrollbars:## FIXME swin = gtk.ScrolledWindow() swin.add(self.treev) swin.set_policy(gtk.PolicyType.NEVER, gtk.PolicyType.AUTOMATIC) pack(self, swin, 1, 1) else: pack(self, self.treev, 1, 1) ########## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #try:## DeprecationWarning #????????????? # #toolbar.set_icon_size(gtk.IconSize.SMALL_TOOLBAR) # # argument to set_icon_size has no effect #except: # pass size = gtk.IconSize.SMALL_TOOLBAR # no different(argument2 to image_new_from_stock has no effect) # gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.MENU tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _("Add")) tb.connect("clicked", self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb #### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _("Delete")) tb.connect("clicked", self.deleteClicked) toolbar.insert(tb, -1) #self.buttonDel = tb #### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _("Move up")) tb.connect("clicked", self.moveUpClicked) toolbar.insert(tb, -1) #### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _("Move down")) tb.connect("clicked", self.moveDownClicked) toolbar.insert(tb, -1) ####### pack(self, toolbar)
def __init__(self): w = gtk.CheckButton(_("Run on session startup")) set_tooltip( w, "Run on startup of Gnome, KDE, Xfce, LXDE, ...\nFile: %s" % startup.comDesk) self._widget = w
def __init__(self, widget, **kwargs): gtk.Dialog.__init__(self, **kwargs) self.set_title(_('Customize')) #self.set_has_separator(False)## not in gtk3 self.connect('delete-event', self.close) dialog_add_button(self, gtk.STOCK_CLOSE, _('_Close'), 0, self.close) ### self._widget = widget self.activeOptionsWidget = None ### self.model = gtk.TreeStore(bool, str) ## (GdkPixbuf.Pixbuf, str) treev = self.treev = gtk.TreeView(self.model) ## treev.set_enable_tree_lines(True) treev.set_headers_visible(False) treev.connect('row-activated', self.rowActivated) ## col = gtk.TreeViewColumn('Widget') ## cell = gtk.CellRendererToggle() cell.connect('toggled', self.enableCellToggled) pack(col, cell) col.add_attribute(cell, 'active', 0) col.set_property('expand', False) ## treev.append_column(col) col = gtk.TreeViewColumn('Widget') col.set_property('expand', False) ## cell = gtk.CellRendererText() pack(col, cell) col.add_attribute(cell, 'text', 1) col.set_property('expand', True) ## treev.append_column(col) ### for item in widget.items: if item.customizable: self.appendItemTree(item, None) ### hbox = gtk.HBox() vbox_l = gtk.VBox() pack(vbox_l, treev, 1, 1) pack(hbox, vbox_l, 1, 1) ### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR toolbar.set_icon_size(size) ## argument2 to image_new_from_stock does not affect ### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _('Move up')) tb.connect('clicked', self.upClicked) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _('Move down')) tb.connect('clicked', self.downClicked) toolbar.insert(tb, -1) ### pack(hbox, toolbar) pack(self.vbox, hbox, 1, 1) self.vbox_l = vbox_l ### self.vbox.connect('size-allocate', self.vboxSizeRequest) self.vbox.show_all() treev.get_selection().connect('changed', self.treevCursorChanged)
def __init__(self, **kwargs): gtk.Dialog.__init__(self, **kwargs) self.set_title(_('Tune Hijri Monthes')) self.connect('delete-event', self.onDeleteEvent) ############ self.altMode = 0 self.altModeDesc = 'Gregorian' ############ hbox = gtk.HBox() self.topLabel = gtk.Label() pack(hbox, self.topLabel) self.startDateInput = DateButton() self.startDateInput.set_editable(False)## FIXME self.startDateInput.connect('changed', lambda widget: self.updateEndDates()) pack(hbox, self.startDateInput) pack(self.vbox, hbox) ############################ treev = gtk.TreeView() trees = gtk.ListStore(int, str, str, int, str)## ym, yearShown, monthShown, monthLenCombo, endDateShown treev.set_model(trees) #treev.get_selection().connect('changed', self.plugTreevCursorChanged) #treev.connect('row-activated', self.plugTreevRActivate) #treev.connect('button-press-event', self.plugTreevButtonPress) ### swin = gtk.ScrolledWindow() swin.add(treev) swin.set_policy(gtk.PolicyType.AUTOMATIC, gtk.PolicyType.AUTOMATIC) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_('Year'), cell, text=1) treev.append_column(col) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_('Month'), cell, text=2) treev.append_column(col) ###### cell = gtk.CellRendererCombo() mLenModel = gtk.ListStore(int) mLenModel.append([29]) mLenModel.append([30]) cell.set_property('model', mLenModel) #cell.set_property('has-entry', False) cell.set_property('editable', True) cell.set_property('text-column', 0) cell.connect('edited', self.monthLenCellEdited) col = gtk.TreeViewColumn(_('Month Length'), cell, text=3) treev.append_column(col) ###### cell = gtk.CellRendererText() col = gtk.TreeViewColumn(_('End Date'), cell, text=4) treev.append_column(col) ###### toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) size = gtk.IconSize.SMALL_TOOLBAR ### tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _('Add')) tb.connect('clicked', self.addClicked) toolbar.insert(tb, -1) ### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _('Delete')) tb.connect('clicked', self.delClicked) toolbar.insert(tb, -1) ###### self.treev = treev self.trees = trees ##### mainHbox = gtk.HBox() pack(mainHbox, swin, 1, 1) pack(mainHbox, toolbar) pack(self.vbox, mainHbox, 1, 1) ###### dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.ResponseType.OK) dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.ResponseType.CANCEL) ## resetB = self.add_button(gtk.STOCK_UNDO, gtk.ResponseType.NONE) resetB.set_label(_('_Reset to Defaults')) resetB.set_image(gtk.Image.new_from_stock(gtk.STOCK_UNDO, gtk.IconSize.BUTTON)) resetB.connect('clicked', self.resetToDefaults) ## self.connect('response', self.onResponse) #print(dir(self.get_action_area())) #self.get_action_area().set_homogeneous(False) ###### self.vbox.show_all()
def __init__( self, term, defaultCourseName=_('New Course'), defaultCourseUnits=3, enableScrollbars=False, ): self.term = term ## UniversityTerm obj self.defaultCourseName = defaultCourseName self.defaultCourseUnits = defaultCourseUnits ##### gtk.HBox.__init__(self) self.treev = gtk.TreeView() self.treev.set_headers_visible(True) self.trees = gtk.ListStore(int, str, int) self.treev.set_model(self.trees) ########## cell = gtk.CellRendererText() cell.set_property('editable', True) cell.connect('edited', self.courseNameEdited) #cell.connect('editing-started', lambda cell0, editable, path: # sys.stdout.write('editing-started %s\n'%path)) #cell.connect('editing-canceled', lambda cell0:sys.stdout.write('editing-canceled\n')) col = gtk.TreeViewColumn(_('Course Name'), cell, text=1) self.treev.append_column(col) ### cell = gtk.CellRendererText() cell.set_property('editable', True) cell.connect('edited', self.courseUnitsEdited) col = gtk.TreeViewColumn(_('Units'), cell, text=2) self.treev.append_column(col) #### if enableScrollbars:## FIXME swin = gtk.ScrolledWindow() swin.add(self.treev) swin.set_policy(gtk.PolicyType.NEVER, gtk.PolicyType.AUTOMATIC) pack(self, swin, 1, 1) else: pack(self, self.treev, 1, 1) ########## toolbar = gtk.Toolbar() toolbar.set_orientation(gtk.Orientation.VERTICAL) #try:## DeprecationWarning #????????????? #toolbar.set_icon_size(gtk.IconSize.SMALL_TOOLBAR) ### no different (argument to set_icon_size does not affect) ????????? #except: # pass size = gtk.IconSize.SMALL_TOOLBAR ##no different(argument2 to image_new_from_stock does not affect) ????????? #### gtk.IconSize.SMALL_TOOLBAR or gtk.IconSize.MENU tb = toolButtonFromStock(gtk.STOCK_ADD, size) set_tooltip(tb, _('Add')) tb.connect('clicked', self.addClicked) toolbar.insert(tb, -1) #self.buttonAdd = tb #### tb = toolButtonFromStock(gtk.STOCK_DELETE, size) set_tooltip(tb, _('Delete')) tb.connect('clicked', self.deleteClicked) toolbar.insert(tb, -1) #self.buttonDel = tb #### tb = toolButtonFromStock(gtk.STOCK_GO_UP, size) set_tooltip(tb, _('Move up')) tb.connect('clicked', self.moveUpClicked) toolbar.insert(tb, -1) #### tb = toolButtonFromStock(gtk.STOCK_GO_DOWN, size) set_tooltip(tb, _('Move down')) tb.connect('clicked', self.moveDownClicked) toolbar.insert(tb, -1) ####### pack(self, toolbar)
def __init__(self, group): from scal3.ui_gtk.mywidgets.cal_type_combo import CalTypeCombo gtk.VBox.__init__(self) self.group = group ######## self.sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL) ##### hbox = gtk.HBox() label = gtk.Label(_('Title')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.titleEntry = gtk.Entry() pack(hbox, self.titleEntry, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Color')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.colorButton = MyColorButton() self.colorButton.set_use_alpha(True) ## FIXME pack(hbox, self.colorButton) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Default Icon')) ## FIXME label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.iconSelect = IconSelectButton() pack(hbox, self.iconSelect) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Default Calendar Type')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) combo = CalTypeCombo() pack(hbox, combo) pack(hbox, gtk.Label(''), 1, 1) self.modeCombo = combo pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Show in Calendar')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInDCalCheck = gtk.CheckButton(_('Day')) self.showInWCalCheck = gtk.CheckButton(_('Week')) self.showInMCalCheck = gtk.CheckButton(_('Month')) pack(hbox, self.showInDCalCheck) pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.showInWCalCheck) pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.showInMCalCheck) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Show in')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.showInTimeLineCheck = gtk.CheckButton(_('Time Line')) self.showInStatusIconCheck = gtk.CheckButton(_('Status Icon')) pack(hbox, self.showInTimeLineCheck) pack(hbox, gtk.Label(''), 1, 1) pack(hbox, self.showInStatusIconCheck) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Event Cache Size')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.cacheSizeSpin = IntSpinButton(0, 9999) pack(hbox, self.cacheSizeSpin) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Event Text Seperator')) label.set_alignment(0, 0.5) pack(hbox, label) self.sizeGroup.add_widget(label) self.sepInput = TextFrame() pack(hbox, self.sepInput, 1, 1) pack(self, hbox) set_tooltip( hbox, _('Using to seperate Summary and Description when displaying event' )) ##### #hbox = gtk.HBox() #label = gtk.Label(_('Show Full Event Description')) #label.set_alignment(0, 0.5) #pack(hbox, label) #self.sizeGroup.add_widget(label) #self.showFullEventDescCheck = gtk.CheckButton('') #pack(hbox, self.showFullEventDescCheck, 1, 1) #pack(self, hbox) ### self.modeCombo.connect( 'changed', self.modeComboChanged) ## right place? before updateWidget? FIXME