Example #1
0
    def __init__(self):
        gtk.Toolbar.__init__(self)

        self._add_separator()

        tool_item = gtk.ToolItem()
        self.insert(tool_item, -1)
        tool_item.show()
        self._search_entry = iconentry.IconEntry()
        self._search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                              'system-search')
        self._search_entry.add_clear_button()
        self._search_entry.set_width_chars(25)
        self._search_entry.connect('changed', self.__search_entry_changed_cb)
        tool_item.add(self._search_entry)
        self._search_entry.show()

        self._add_separator(True)

        self.stop = ToolButton(icon_name='dialog-cancel')
        self.stop.set_tooltip(_('Done'))
        self.stop.connect('clicked', self.__stop_clicked_cb)
        self.stop.show()
        self.insert(self.stop, -1)
        self.stop.show()
Example #2
0
    def __init__(self):
        gtk.Toolbar.__init__(self)

        self._mount_point = None

        self._search_entry = iconentry.IconEntry()
        self._search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                              'system-search')
        self._search_entry.connect('activate', self._search_entry_activated_cb)
        self._search_entry.connect('changed', self._search_entry_changed_cb)
        self._search_entry.add_clear_button()
        self._autosearch_timer = None
        self._add_widget(self._search_entry, expand=True)

        self._favorite_button = ToggleToolButton('emblem-favorite')
        self._favorite_button.connect('toggled',
                                      self.__favorite_button_toggled_cb)
        self.insert(self._favorite_button, -1)
        self._favorite_button.show()

        self._what_search_combo = ComboBox()
        self._what_combo_changed_sid = self._what_search_combo.connect(
            'changed', self._combo_changed_cb)
        tool_item = ToolComboBox(self._what_search_combo)
        self.insert(tool_item, -1)
        tool_item.show()

        self._when_search_combo = self._get_when_search_combo()
        tool_item = ToolComboBox(self._when_search_combo)
        self.insert(tool_item, -1)
        tool_item.show()

        self._sorting_button = SortingButton()
        self._sorting_button.connect('clicked',
                                     self.__sorting_button_clicked_cb)
        self.insert(self._sorting_button, -1)
        self._sorting_button.connect('sort-property-changed',
                                     self.__sort_changed_cb)
        self._sorting_button.show()

        # TODO: enable it when the DS supports saving the buddies.
        #self._with_search_combo = self._get_with_search_combo()
        #tool_item = ToolComboBox(self._with_search_combo)
        #self.insert(tool_item, -1)
        #tool_item.show()

        self._query = self._build_query()

        self.refresh_filters()
Example #3
0
    def __init__(self):
        gtk.Toolbar.__init__(self)

        self._query = None
        self._autosearch_timer = None

        self._add_separator()

        tool_item = gtk.ToolItem()
        self.insert(tool_item, -1)
        tool_item.show()

        self.search_entry = iconentry.IconEntry()
        self.search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                             'system-search')
        self.search_entry.add_clear_button()
        self.search_entry.set_width_chars(25)
        self.search_entry.connect('activate', self.__entry_activated_cb)
        self.search_entry.connect('changed', self.__entry_changed_cb)
        tool_item.add(self.search_entry)
        self.search_entry.show()

        self._add_separator(expand=True)

        favorites_button = FavoritesButton()
        favorites_button.connect('toggled', self.__view_button_toggled_cb,
                                 _FAVORITES_VIEW)
        self.insert(favorites_button, -1)
        favorites_button.show()

        self._list_button = RadioToolButton(named_icon='view-list')
        self._list_button.props.group = favorites_button
        self._list_button.props.tooltip = _('List view')
        self._list_button.props.accelerator = _('<Ctrl>2')
        self._list_button.connect('toggled', self.__view_button_toggled_cb,
                                  _LIST_VIEW)
        self.insert(self._list_button, -1)
        self._list_button.show()

        self._add_separator()
Example #4
0
    def __init__(self):
        activity.EditToolbar.__init__(self)

        self._view = None

        self._find_job = None

        search_item = gtk.ToolItem()

        self._search_entry = iconentry.IconEntry()
        self._search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                                'system-search')
        self._search_entry.add_clear_button()
        self._search_entry.connect('activate', self._search_entry_activate_cb)
        self._search_entry.connect('changed', self._search_entry_changed_cb)
        self._search_entry_changed = True

        width = int(gtk.gdk.screen_width() / 3)
        self._search_entry.set_size_request(width, -1)

        search_item.add(self._search_entry)
        self._search_entry.show()

        self.insert(search_item, -1)
        search_item.show()

        self._prev = ToolButton('go-previous-paired')
        self._prev.set_tooltip(_('Previous'))
        self._prev.props.sensitive = False
        self._prev.connect('clicked', self._find_prev_cb)
        self.insert(self._prev, -1)
        self._prev.show()

        self._next = ToolButton('go-next-paired')
        self._next.set_tooltip(_('Next'))
        self._next.props.sensitive = False
        self._next.connect('clicked', self._find_next_cb)
        self.insert(self._next, -1)
        self._next.show()
Example #5
0
    def __init__(self):
        gtk.Toolbar.__init__(self)

        self._query = None
        self._autosearch_timer = None

        self._add_separator()

        tool_item = gtk.ToolItem()
        self.insert(tool_item, -1)
        tool_item.show()

        self.search_entry = iconentry.IconEntry()
        self.search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                             'system-search')
        self.search_entry.add_clear_button()
        self.search_entry.set_width_chars(25)
        self.search_entry.connect('activate', self._entry_activated_cb)
        self.search_entry.connect('changed', self._entry_changed_cb)
        tool_item.add(self.search_entry)
        self.search_entry.show()

        self._add_separator(expand=True)
    def __init__(self, handle):
        activity.Activity.__init__(self, handle)

        self.max_participants = 1

        # Canvas
        canvas = Canvas(self)
        self.set_canvas(canvas)

        self._download_list = canvas.gtk_list.download_list

        # Toolbars
        toolbarbox = ToolbarBox()

        activity_button = ActivityToolbarButton(self)
        toolbarbox.toolbar.insert(activity_button, 0)

        separator = gtk.SeparatorToolItem()
        separator.set_draw(False)
        separator.set_expand(False)
        toolbarbox.toolbar.insert(separator, -1)

        # Switch
        store_list = RadioToolButton()
        store_list.set_active(True)
        store_list.props.icon_name = 'view-list'
        store_list.connect("clicked", canvas.switch_to_list)
        store_list.set_tooltip(_("Show the search list"))
        toolbarbox.toolbar.insert(store_list, -1)

        downloads_list = RadioToolButton()
        downloads_list.connect("clicked", canvas.switch_to_downloads_list)
        downloads_list.set_tooltip(_("Show the downloads list"))
        downloads_list.props.group = store_list

        self.downloads_icon = DownloadsIcon()
        downloads_list.set_icon_widget(self.downloads_icon)

        toolbarbox.toolbar.insert(downloads_list, -1)

        self.store_list = store_list
        self.downloads_list = downloads_list

        separator = gtk.SeparatorToolItem()
        separator.set_draw(True)
        separator.set_expand(False)
        toolbarbox.toolbar.insert(separator, -1)

        # Search
        search_entry = iconentry.IconEntry()
        search_entry.set_size_request(gtk.gdk.screen_width() / 4, -1)
        search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                        'system-search')
        search_entry.connect('activate', canvas.gtk_list.search)
        search_entry.connect('activate', lambda w: canvas.switch_to_list(None))
        search_entry.add_clear_button()
        search_item = gtk.ToolItem()
        search_item.add(search_entry)
        toolbarbox.toolbar.insert(search_item, -1)

        separator = gtk.SeparatorToolItem()
        separator.set_draw(False)
        separator.set_expand(True)
        toolbarbox.toolbar.insert(separator, -1)

        stopbtn = StopButton(self)
        toolbarbox.toolbar.insert(stopbtn, -1)

        self.set_toolbar_box(toolbarbox)
        self.show_all()

        canvas.set_page(0)
    def __init__(self, handle):
        activity.Activity.__init__(self, handle, True)

        self.max_participants = 1

        # ****** Editor ******

        self.editor = Editor(self)
        self.editor.set_size_request(800, 790)
        scroll = gtk.ScrolledWindow()
        scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scroll.add(self.editor)
        scroll.show_all()

        vbox = gtk.VBox()
        vbox.pack_start(scroll, True, True, 0)
        vbox.show_all()

        self.set_canvas(vbox)

        # ****** Toolbars ******

        self.toolbar_box = ToolbarBox()

        activity_button = ActivityToolbarButton(self)
        activity_toolbar = activity_button.page

        # Abrir objeto / Open object
        open_obj_btn = ToolButton("open-from-journal")
        open_obj_btn.connect("clicked", file_choosers.open_from_journal, None,
                             self)
        open_obj_btn.set_tooltip(_("Open object from journal"))
        activity_toolbar.insert(open_obj_btn, -1)

        # Separador / Separator
        separator = gtk.SeparatorToolItem()
        separator.set_draw(True)
        separator.set_expand(False)
        activity_toolbar.insert(separator, -1)

        # ****** Open File button ******
        open_btn = ToolButton("fileopen")
        open_btn.set_tooltip(_("Open File"))
        open_btn.set_accelerator('<ctrl>o')
        open_btn.connect("clicked", self.open_file)
        activity_toolbar.insert(open_btn, -1)

        # ****** Save File button ******
        save_btn = ToolButton("stock_save")
        save_btn.set_tooltip(_("Save this file"))
        save_btn.set_accelerator('<ctrl>s')
        save_btn.connect("clicked", self.save_file)
        activity_toolbar.insert(save_btn, -1)

        activity_toolbar.show_all()
        activity_toolbar.stop.hide()

        # Guardar como / Save As
        save_as = gtk.MenuItem(_("Save on the file system."))
        activity_toolbar.keep.props.palette.menu.append(save_as)
        save_as.connect("activate", self.save_file_as)
        save_as.show()

        # Nuevo / New
        new = ToolButton("new")
        new.set_tooltip(_("New file"))
        new.set_accelerator('<ctrl>n')
        new.connect("clicked", self.new)
        activity_toolbar.insert(new, 6)
        new.show()

        activity_toolbar.keep.show()

        self.toolbar_box.toolbar.insert(activity_button, 0)

        # Edicion / Edit Toolbar

        edit_toolbar = EditToolbar()
        edit_toolbar_button = ToolbarButton(label=_("Edit"),
                                            page=edit_toolbar,
                                            icon_name='toolbar-edit')

        edit_toolbar.cut = ToolButton("cut")
        edit_toolbar.cut.set_tooltip(_("Cut"))
        edit_toolbar.cut.set_accelerator('<ctrl>x')
        edit_toolbar.insert(edit_toolbar.cut, 4)

        separator = gtk.SeparatorToolItem()
        separator.set_draw(False)
        separator.set_expand(True)
        edit_toolbar.insert(separator, -1)

        edit_toolbar.pep8_btn = ToolButton('pep8')
        edit_toolbar.pep8_btn.set_tooltip(_("PEP 8 Check"))
        edit_toolbar.pep8_btn.connect("clicked", self.pep8_check)
        edit_toolbar.insert(edit_toolbar.pep8_btn, -1)

        edit_toolbar.pep8_datetime_separator = gtk.SeparatorToolItem()
        edit_toolbar.pep8_datetime_separator.set_draw(True)
        edit_toolbar.insert(edit_toolbar.pep8_datetime_separator, -1)

        insert_datetime = ToolButton("insert-datetime")
        insert_datetime.connect("clicked", self.editor._insert_date_time)
        insert_datetime.set_tooltip(_("Insert date and time"))
        edit_toolbar.insert(insert_datetime, -1)
        insert_datetime.show_all()

        edit_toolbar.copy.connect("clicked", self.editor._copy_cb)
        edit_toolbar.paste.connect("clicked", self.editor._paste_cb)
        edit_toolbar.undo.connect("clicked", self.editor._undo_cb)
        edit_toolbar.redo.connect("clicked", self.editor._redo_cb)
        edit_toolbar.cut.connect("clicked", self.editor._cut_cb)

        edit_toolbar.show_all()
        edit_toolbar.pep8_btn.hide()
        edit_toolbar.pep8_datetime_separator.set_draw(False)

        self.toolbar_box.toolbar.insert(edit_toolbar_button, -1)

        self.edit_toolbar = edit_toolbar

        # Separador / Separator
        separator = gtk.SeparatorToolItem()
        separator.set_draw(False)
        self.toolbar_box.toolbar.insert(separator, -1)

        # Buscar / Search
        search_entry = iconentry.IconEntry()
        search_entry.set_size_request(gtk.gdk.screen_width() / 3, -1)
        search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                        'system-search')
        search_entry.add_clear_button()
        search_entry.connect('activate', self.editor._search_entry_activate_cb)
        search_entry.connect('changed', self.editor._search_entry_changed_cb)
        search_item = gtk.ToolItem()
        search_item.add(search_entry)
        self.toolbox.toolbar.insert(search_item, -1)

        self._search_prev = ToolButton('go-previous-paired')
        self._search_prev.set_tooltip(_('Previous'))
        self._search_prev.connect('clicked', self.editor._search_prev_cb)
        self.toolbox.toolbar.insert(self._search_prev, -1)

        self._search_next = ToolButton('go-next-paired')
        self._search_next.set_tooltip(_('Next'))
        self._search_next.connect('clicked', self.editor._search_next_cb)
        self.toolbox.toolbar.insert(self._search_next, -1)

        # Preferencias / preferences

        preferences_toolbar = gtk.Toolbar()

        show_line_numbers = ToggleToolButton('show-numbers')
        show_line_numbers.set_tooltip(_("Show line numbers"))

        show_line_numbers.set_active(True)
        show_line_numbers.connect("clicked", \
                             self.editor._set_show_line_numbers)
        show_line_numbers.show()
        preferences_toolbar.insert(show_line_numbers, -1)

        self.editor._make_languages_combo(preferences_toolbar)
        self.editor.make_style_combo(preferences_toolbar)

        preferences = ToolbarButton()
        preferences.props.page = preferences_toolbar
        preferences.props.icon_name = 'preferences-system'
        preferences.show_all()

        self.toolbar_box.toolbar.insert(preferences, -1)

        font_options = FontToolbarButton()
        font_options.connect("load-pango-context", self.load_pango_context)
        font_options.load_toolbar()
        font_options.connect("font-changed", self.change_font)
        self.toolbar_box.toolbar.insert(font_options, -1)
        font_options.show()

        # Separador / Separator

        separator = gtk.SeparatorToolItem()
        separator.set_draw(False)
        separator.set_expand(True)
        self.toolbar_box.toolbar.insert(separator, -1)

        # Boton salir / Stop Button

        exit = StopButton(self)
        self.toolbar_box.toolbar.insert(exit, -1)

        self.toolbar_box.show_all()

        self.set_toolbar_box(self.toolbar_box)

        # Barra de estado de PEP8 / PEP8 status bar
        self.pep8_bar = gtk.Statusbar()
        self.pep8_bar.label = gtk.Label()
        self.pep8_bar.add(self.pep8_bar.label)
        vbox.pack_end(self.pep8_bar, False, True, 0)
    def __init__(self, toolbox, abiword_canvas, text_toolbar, parent):

        EditToolbar.__init__(self)

        self._toolbox = toolbox
        self._abiword_canvas = abiword_canvas
        self._text_toolbar = text_toolbar
        self._parent = parent

        # connect existing buttons
        self.undo.set_sensitive(False)
        self.redo.set_sensitive(False)
        self.undo.connect('clicked', self._undo_cb)
        self.redo.connect('clicked', self._redo_cb)
        self.copy.connect('clicked', self._copy_cb)
        self.paste.connect('clicked', self._paste_cb)

        self._abiword_canvas.connect("can-undo", self._can_undo_cb)
        self._abiword_canvas.connect("can-redo", self._can_redo_cb)

        # make expanded non-drawn visible separator to make the search stuff right-align
        separator = gtk.SeparatorToolItem()
        separator.props.draw = False
        separator.set_expand(True)
        self.insert(separator, -1)
        separator.show()

        # setup the search options
        self._search_entry = iconentry.IconEntry()
        self._search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                              'system-search')
        self._search_entry.connect('activate', self._search_entry_activated_cb)
        self._search_entry.connect('changed', self._search_entry_changed_cb)
        self._search_entry.add_clear_button()
        self._add_widget(self._search_entry, expand=True)

        self._findprev = ToolButton('go-previous')
        self._findprev.set_tooltip(_('Find previous'))
        self.insert(self._findprev, -1)
        self._findprev.show()
        self._findprev.connect('clicked', self._findprev_cb)

        self._findnext = ToolButton('go-next')
        self._findnext.set_tooltip(_('Find next'))
        self.insert(self._findnext, -1)
        self._findnext.show()
        self._findnext.connect('clicked', self._findnext_cb)

        # set the initial state of the search controls
        # note: we won't simple call self._search_entry_changed_cb
        # here, as that will call into the abiword_canvas, which
        # is not mapped on screen here, causing the set_find_string
        # call to fail
        self._findprev.set_sensitive(False)
        self._findnext.set_sensitive(False)

        ####btn salir del barrido del menu item
        self._btn_barrido_menu = ToolButton()
        self._btn_barrido_menu.set_tooltip(_('Salir \nMenĂș'))
        self._btn_barrido_menu_id = self._btn_barrido_menu.connect(
            'clicked', self._btn_barrido_menu_cb)
        self.insert(self._btn_barrido_menu, -1)
        self._btn_barrido_menu.set_no_show_all(True)
Example #9
0
    def __init__(self, pc, toolbar_box):

        gtk.Toolbar.__init__(self)

        self._abiword_canvas = pc.abiword_canvas

        copy = CopyButton()
        copy.props.accelerator = '<Ctrl>C'
        copy.connect('clicked', lambda button: pc.abiword_canvas.copy())
        self.insert(copy, -1)
        copy.show()

        paste = PasteButton()
        paste.props.accelerator = '<Ctrl>V'
        paste.connect('clicked', lambda button: pc.abiword_canvas.paste())
        self.insert(paste, -1)
        paste.show()

        separator = gtk.SeparatorToolItem()
        self.insert(separator, -1)
        separator.show()

        undo = UndoButton(sensitive=False)
        undo.connect('clicked', lambda button: pc.abiword_canvas.undo())
        pc.abiword_canvas.connect(
            "can-undo", lambda abi, can_undo: undo.set_sensitive(can_undo))
        self.insert(undo, -1)
        undo.show()

        redo = RedoButton(sensitive=False)
        redo.connect('clicked', lambda button: pc.abiword_canvas.redo())
        pc.abiword_canvas.connect(
            "can-redo", lambda abi, can_redo: redo.set_sensitive(can_redo))
        self.insert(redo, -1)
        redo.show()

        pc.abiword_canvas.connect('text-selected',
                                  lambda abi, b: copy.set_sensitive(True))
        pc.abiword_canvas.connect('image-selected',
                                  lambda abi, b: copy.set_sensitive(True))
        pc.abiword_canvas.connect('selection-cleared',
                                  lambda abi, b: copy.set_sensitive(False))

        separator = gtk.SeparatorToolItem()
        self.insert(separator, -1)
        separator.show()

        search_label = gtk.Label(_("Search") + ": ")
        search_label.show()
        search_item_page_label = gtk.ToolItem()
        search_item_page_label.add(search_label)
        self.insert(search_item_page_label, -1)
        search_item_page_label.show()

        # setup the search options
        self._search_entry = iconentry.IconEntry()
        self._search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
                                              'system-search')
        self._search_entry.connect('activate', self._search_entry_activated_cb)
        self._search_entry.connect('changed', self._search_entry_changed_cb)
        self._search_entry.add_clear_button()
        self._add_widget(self._search_entry, expand=True)

        self._findprev = ToolButton('go-previous-paired')
        self._findprev.set_tooltip(_('Find previous'))
        self.insert(self._findprev, -1)
        self._findprev.show()
        self._findprev.connect('clicked', self._findprev_cb)

        self._findnext = ToolButton('go-next-paired')
        self._findnext.set_tooltip(_('Find next'))
        self.insert(self._findnext, -1)
        self._findnext.show()
        self._findnext.connect('clicked', self._findnext_cb)

        # set the initial state of the search controls
        # note: we won't simple call self._search_entry_changed_cb
        # here, as that will call into the abiword_canvas, which
        # is not mapped on screen here, causing the set_find_string
        # call to fail
        self._findprev.set_sensitive(False)
        self._findnext.set_sensitive(False)