def __init__(self, parent): PalabraDialog.__init__(self, parent, u"Manage clue databases") self.pwindow = parent self.store, self.tree, window = create_tree((str, str) , [(u"Name", 0), (u"Path", 1)] , f_sel=self.on_file_selected , window_size=(300, 300)) self.pack(window) buttonbox = gtk.HButtonBox() buttonbox.set_layout(gtk.BUTTONBOX_START) self.add_file_button = create_stock_button(gtk.STOCK_ADD , f_click=lambda b: self.on_add_clue_db()) buttonbox.pack_start(self.add_file_button, False, False) self.props_button = create_stock_button(gtk.STOCK_PROPERTIES, f_click=lambda b: self.on_properties()) buttonbox.pack_start(self.props_button, False, False) self.props_button.set_sensitive(False) self.remove_button = create_stock_button(gtk.STOCK_REMOVE , f_click=lambda b: self.on_remove_db()) buttonbox.pack_start(self.remove_button, False, False) self.remove_button.set_sensitive(False) self.pack(buttonbox) label = create_label(u"These clue databases are loaded when you start " + constants.TITLE + ".") self.pack(label, False) self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) self.load_clue_files(parent.clues)
def __init__(self, parent): super(WordListManager, self).__init__(parent, u"Manage word lists") self.palabra_window = parent self.modifications = set() # name path self.store, self.tree, s_window = create_tree((str, str) , [(u"Name", 0), (u"Path", 1)] , f_sel=self.on_selection_changed , window_size=(400, 400)) self.current_wlist = None self.add_wlist_button = create_stock_button(gtk.STOCK_ADD, lambda b: self.add_word_list()) self.rename_button = create_button(u"Rename", f_click=lambda b: self.rename_word_list()) def show_word_list_props(): w = WordListPropertiesDialog(self, self.current_wlist) w.show_all() w.run() w.destroy() self.props_button = create_stock_button(gtk.STOCK_PROPERTIES, lambda b: show_word_list_props()) self.remove_button = create_stock_button(gtk.STOCK_REMOVE, lambda b: self.remove_word_list()) buttonbox = gtk.HButtonBox() buttonbox.set_layout(gtk.BUTTONBOX_START) buttonbox.pack_start(self.add_wlist_button) buttonbox.pack_start(self.rename_button) buttonbox.pack_start(self.props_button) buttonbox.pack_start(self.remove_button) self.wlist_sensitives = [self.rename_button, self.props_button, self.remove_button] for b in self.wlist_sensitives: b.set_sensitive(False) wlist_vbox = gtk.VBox() wlist_vbox.set_spacing(12) wlist_vbox.pack_start(create_label("<b>Word lists</b>"), False, False, 0) wlist_vbox.pack_start(s_window) wlist_vbox.pack_start(buttonbox, False, False, 0) main = gtk.HBox() main.set_spacing(18) main.pack_start(wlist_vbox, False, False, 0) main.pack_start(self.create_contents_tab()) self.main.pack_start(main) label = create_label(u"These word lists are loaded when you start " + constants.TITLE + ".") self.main.pack_start(label, False, False, 0) self.display_wordlists() self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)