def __init__(self, title, display_name, save_button_text, validate_name, check_name=None): WindowBuilder.__init__(self, 'save-file') if check_name is not None: self.check_name = check_name self.validate_name = validate_name self.dialog.set_title(title) self.dialog.set_default_response(gtk.RESPONSE_OK) self.message_label.set_text("Please enter a new name for '%s'" % display_name) self.name_entry.connect('changed', self.__update_save_sensitivity) self.__update_save_sensitivity() self.save_button.set_label(save_button_text) self.save_button.set_image( gtk.image_new_from_stock('gtk-save', gtk.ICON_SIZE_BUTTON))
def __init__(self): WindowBuilder.__init__(self, 'preferences') self.dialog.connect('response', self.__on_response) self.dialog.connect('delete-event', self.__on_delete_event) global_settings.connect('notify::editor-font-is-custom', self.__on_notify_editor_font_is_custom) self.__on_notify_editor_font_is_custom() self.editor_font_custom_check_button.connect('toggled', self.__on_editor_font_custom_check_button_toggled) self.__on_editor_font_custom_check_button_toggled() global_settings.connect('notify::editor-font-name', self.__on_notify_editor_font_name) self.__on_notify_editor_font_name() self.editor_font_button.connect('font-set', self.__on_editor_font_set) global_settings.connect('notify::doc-tooltip-font-is-custom', self.__on_notify_doc_tooltip_font_is_custom) self.__on_notify_doc_tooltip_font_is_custom() self.doc_tooltip_font_custom_check_button.connect('toggled', self.__on_doc_tooltip_font_custom_check_button_toggled) self.__on_doc_tooltip_font_custom_check_button_toggled() global_settings.connect('notify::doc-tooltip-font-name', self.__on_notify_doc_tooltip_font_name) self.__on_notify_doc_tooltip_font_name() self.doc_tooltip_font_button.connect('font-set', self.__on_doc_tooltip_font_set) global_settings.connect('notify::autocomplete', self.__on_notify_autocomplete) self.__on_notify_autocomplete() self.autocomplete_check_button.connect('toggled', self.__on_autocomplete_check_button_toggled)
def __init__(self): WindowBuilder.__init__(self, "preferences") self.dialog.connect("response", self.__on_response) self.dialog.connect("delete-event", self.__on_delete_event) global_settings.watch("editor-font-is-custom", self.__on_notify_editor_font_is_custom) self.__on_notify_editor_font_is_custom() self.editor_font_custom_check_button.connect("toggled", self.__on_editor_font_custom_check_button_toggled) self.__on_editor_font_custom_check_button_toggled() global_settings.watch("editor-font-name", self.__on_notify_editor_font_name) self.__on_notify_editor_font_name() self.editor_font_button.connect("font-set", self.__on_editor_font_set) global_settings.watch("doc-tooltip-font-is-custom", self.__on_notify_doc_tooltip_font_is_custom) self.__on_notify_doc_tooltip_font_is_custom() self.doc_tooltip_font_custom_check_button.connect( "toggled", self.__on_doc_tooltip_font_custom_check_button_toggled ) self.__on_doc_tooltip_font_custom_check_button_toggled() global_settings.watch("doc-tooltip-font-name", self.__on_notify_doc_tooltip_font_name) self.__on_notify_doc_tooltip_font_name() self.doc_tooltip_font_button.connect("font-set", self.__on_doc_tooltip_font_set) global_settings.watch("autocomplete", self.__on_notify_autocomplete) self.__on_notify_autocomplete() self.autocomplete_check_button.connect("toggled", self.__on_autocomplete_check_button_toggled)
def __init__(self): WindowBuilder.__init__(self, 'new-notebook') self.name_entry.connect('changed', self.__update_create_sensitivity) self.__update_create_sensitivity() self.description_text_view.set_accepts_tab(False) self.other_folder_radio_button.set_group(self.default_folder_radio_button) self.other_folder_radio_button.connect('toggled', self.__update_other_folder_sensitivity) self.__update_other_folder_sensitivity(self.other_folder_radio_button) self.other_folder_chooser.set_filename(global_settings.notebooks_dir) self.create_button.set_image(gtk.image_new_from_stock('gtk-new', gtk.ICON_SIZE_BUTTON))
def __init__(self, title, display_name, save_button_text, check_name=None): WindowBuilder.__init__(self, 'save-file') if check_name != None: self.check_name = check_name self.dialog.set_title(title) self.dialog.set_default_response(gtk.RESPONSE_OK) self.message_label.set_text("Please enter a new name for '%s'" % display_name) self.name_entry.connect('changed', self.__update_save_sensitivity) self.__update_save_sensitivity() self.save_button.set_label(save_button_text) self.save_button.set_image(gtk.image_new_from_stock('gtk-save', gtk.ICON_SIZE_BUTTON))
def __init__(self): WindowBuilder.__init__(self, 'new-notebook') self.name_entry.connect('changed', self.__update_create_sensitivity) self.__update_create_sensitivity() self.description_text_view.set_accepts_tab(False) self.other_folder_radio_button.set_group( self.default_folder_radio_button) self.other_folder_radio_button.connect( 'toggled', self.__update_other_folder_sensitivity) self.__update_other_folder_sensitivity(self.other_folder_radio_button) self.other_folder_chooser.set_filename(global_settings.notebooks_dir) self.create_button.set_image( gtk.image_new_from_stock('gtk-new', gtk.ICON_SIZE_BUTTON))
def __init__(self): WindowBuilder.__init__(self, 'preferences') self.dialog.connect('response', self.__on_response) self.dialog.connect('delete-event', self.__on_delete_event) global_settings.watch('editor-font-is-custom', self.__on_notify_editor_font_is_custom) self.__on_notify_editor_font_is_custom() self.editor_font_custom_check_button.connect( 'toggled', self.__on_editor_font_custom_check_button_toggled) self.__on_editor_font_custom_check_button_toggled() global_settings.watch('editor-font-name', self.__on_notify_editor_font_name) self.__on_notify_editor_font_name() self.editor_font_button.connect('font-set', self.__on_editor_font_set) global_settings.watch('doc-tooltip-font-is-custom', self.__on_notify_doc_tooltip_font_is_custom) self.__on_notify_doc_tooltip_font_is_custom() self.doc_tooltip_font_custom_check_button.connect( 'toggled', self.__on_doc_tooltip_font_custom_check_button_toggled) self.__on_doc_tooltip_font_custom_check_button_toggled() global_settings.watch('doc-tooltip-font-name', self.__on_notify_doc_tooltip_font_name) self.__on_notify_doc_tooltip_font_name() self.doc_tooltip_font_button.connect('font-set', self.__on_doc_tooltip_font_set) global_settings.watch('autocomplete', self.__on_notify_autocomplete) self.__on_notify_autocomplete() self.autocomplete_check_button.connect( 'toggled', self.__on_autocomplete_check_button_toggled)
def __init__(self): WindowBuilder.__init__(self, 'open-notebook') tree = self.notebooks_tree self.model = gtk.ListStore(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT) for info in application.get_notebook_infos(): iter = self.model.append() state = application.state.get_notebook_state(info.folder) self.model.set_value(iter, 0, info) self.model.set_value(iter, 1, state) tree.set_model(self.model) ############################## name_column = gtk.TreeViewColumn("Name") tree.append_column(name_column) cell_renderer = gtk.CellRendererText() name_column.pack_start(cell_renderer, True) name_column.set_cell_data_func(cell_renderer, self.__name_data_func) self.model.set_sort_func(0, self.__name_column_sort) name_column.set_sort_column_id(0) ############################## description_column = gtk.TreeViewColumn("Description") description_column.set_expand(True) tree.append_column(description_column) cell_renderer = gtk.CellRendererText() cell_renderer.props.ellipsize = pango.ELLIPSIZE_END description_column.pack_start(cell_renderer, True) description_column.set_cell_data_func(cell_renderer, self.__description_data_func) ############################## modified_column = gtk.TreeViewColumn("Last Modified") tree.append_column(modified_column) cell_renderer = gtk.CellRendererText() modified_column.pack_start(cell_renderer, True) modified_column.set_cell_data_func(cell_renderer, self.__modified_data_func) self.model.set_sort_func(2, self.__modified_column_sort) modified_column.set_sort_column_id(2) ############################## opened_column = gtk.TreeViewColumn("Last Opened") tree.append_column(opened_column) cell_renderer = gtk.CellRendererText() opened_column.pack_start(cell_renderer, True) opened_column.set_cell_data_func(cell_renderer, self.__opened_data_func) self.model.set_sort_func(3, self.__opened_column_sort) opened_column.set_sort_column_id(3) self.model.set_sort_column_id(3, gtk.SORT_ASCENDING) ############################## tree.get_selection().connect('changed', self.__update_open_button_sensitivity) self.__update_open_button_sensitivity() tree.connect('row-activated', self.on_row_activated)