+
+ RESPONSE_NEW, RESPONSE_EDIT, RESPONSE_DELETE = range(3)
+
+ dialog = gtk.Dialog()
+ dialog.set_transient_for(window)
+ dialog.set_title("Settings")
+
+ vbox = dialog.vbox
+
+ acctsLabel = gtk.Label("Accounts:")
+ acctsLabel.set_justify(gtk.JUSTIFY_LEFT)
+
+ vbox.pack_start(acctsLabel, False, False, 1)
+
+ accounts_model = models.AccountsModel(self.controller)
+
+ accounts_treeview = hildon.GtkTreeView(gtk.HILDON_UI_MODE_NORMAL)
+ accounts_treeview.set_model(accounts_model)
+ self.add_columns_to_accounts(accounts_treeview)
+ vbox.pack_start(accounts_treeview, False, False, 1)
+
+ # all stock responses are negative, so we can use any positive value
+ new_button = dialog.add_button("New", RESPONSE_NEW)
+ edit_button = dialog.add_button("Edit", RESPONSE_EDIT)
+ delete_button = dialog.add_button("Delete", RESPONSE_DELETE)
+ ok_button = dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
+
+ dialog.show_all()
+ result = dialog.run()
+ if result == RESPONSE_NEW:
+ self.new_account_clicked(window)
+ accounts_model.get_accounts()
+ elif result = RESPONSE_EDIT:
+ # get the selected treeview item and pop up the account_box
+ pass
+ elif result = RESPONSE_DELETE:
+ # get the selected treeview item, and delete the gconf keys
+ pass
+ elif result == gtk.RESPONSE_OK:
+ self.char_model.get_characters()
+ dialog.destroy()
+
+
+ def add_columns_to_accounts(self, treeview):
+ #Column 0 for the treeview
+ renderer = gtk.CellRendererText()
+ column = gtk.TreeViewColumn('Account ID', renderer, text=0)
+ column.set_property("expand", True)
+ treeview.append_column(column)
+
+
+ def new_account_clicked(self, window):