_moduleLogger = logging.getLogger(__name__)
-class Bottombar(gtk.HBox):
+class Bottombar(gtk.VBox):
__gsignals__ = {
- 'changed' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING, gobject.TYPE_STRING)),
- #'changedCategory': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING, gobject.TYPE_STRING))
}
def __init__(self, db, view, isHildon):
- gtk.HBox.__init__(self, homogeneous = False, spacing = 3)
+ gtk.VBox.__init__(self, homogeneous = False, spacing = 3)
self.db = db
self.isHildon = isHildon
_moduleLogger.info("libBottomBar, init")
- button = gtk.Button(_("New item"))
- button.connect("clicked", self.new_item)
- self.pack_start(button, expand = False, fill = True, padding = 0)
+ buttonHBox = gtk.HBox()
+ self.pack_start(buttonHBox, expand = False, fill = True, padding = 3)
- label = gtk.Label(" ")
- self.pack_start(label, expand = True, fill = True, padding = 0)
+ button = gtk.Button(stock = gtk.STOCK_ADD)
+ button.connect("clicked", self.new_item, None)
+ buttonHBox.pack_start(button, expand = True, fill = True, padding = 3)
- button = gtk.Button(_("Checkout all items"))
- button.connect("clicked", self.checkout_items)
- self.pack_start(button, expand = False, fill = True, padding = 0)
-
- button = gtk.Button(_("Del item"))
- button.connect("clicked", self.del_item)
- self.pack_start(button, expand = False, fill = True, padding = 0)
+ button = gtk.Button(stock = gtk.STOCK_DELETE)
+ button.connect("clicked", self.del_item, None)
+ buttonHBox.pack_start(button, expand = True, fill = True, padding = 3)
@gtk_toolbox.log_exception(_moduleLogger)
def new_item(self, widget = None, data1 = None, data2 = None):
mbox.hide()
mbox.destroy()
- @gtk_toolbox.log_exception(_moduleLogger)
- def checkout_items(self, widget = None, data1 = None, data2 = None):
- #self.view.del_active_row()
- mbox = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, (_("Really checkout all items?")))
- response = mbox.run()
- mbox.hide()
- mbox.destroy()
- if response == gtk.RESPONSE_YES:
- self.view.liststorehandler.checkout_rows()
- #n = len(self.view.liststorehandler.get_liststore())
- #for i in range(n):
- # self.view.liststorehandler.checkout_rows()
- # #print i
-
- @gtk_toolbox.log_exception(_moduleLogger)
def rename_category(self, widget = None, data1 = None, data2 = None):
dialog = gtk.Dialog(_("New category name:"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
dialog.vbox.pack_start(entryKlasse, True, True, 0)
dialog.vbox.show_all()
- #dialog.set_size_request(400, 300)
if dialog.run() == gtk.RESPONSE_ACCEPT:
_moduleLogger.info("new category name "+entryKlasse.get_text())
self.view.liststorehandler.rename_category(entryKlasse.get_text())
else:
- #print "Cancel", res
pass
dialog.destroy()
- @gtk_toolbox.log_exception(_moduleLogger)
def rename_list(self, widget = None, data1 = None, data2 = None):
dialog = gtk.Dialog(_("New list name:"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
dialog.vbox.pack_start(entryKlasse, True, True, 0)
dialog.vbox.show_all()
- #dialog.set_size_request(400, 300)
if dialog.run() == gtk.RESPONSE_ACCEPT:
_moduleLogger.info("new list name "+entryKlasse.get_text())
self.view.liststorehandler.rename_list(entryKlasse.get_text())
else:
- #print "Cancel", res
pass
dialog.destroy()