Esempio n. 1
0
    def _get_default(self):
        if SETTINGS_VIEW.get_boolean('use-system-font'):
            font_name = SETTINGS_DESKTOP.get_string('document-font-name')
        else:
            font_name = SETTINGS_VIEW.get_string('font')

        font_template, size = self.get_pango_font_format(font_name)
        return font_template, size
Esempio n. 2
0
    def _get_default(self):
        if SETTINGS_VIEW.get_boolean("use-system-font"):
            font_name = SETTINGS_DESKTOP.get_string("document-font-name")
        else:
            font_name = SETTINGS_VIEW.get_string("font")

        font_template, size = self.get_pango_font_format(font_name)
        return font_template, size
Esempio n. 3
0
    def get_notebook(self, group_name):
        if not SETTINGS_VIEW.get_boolean("multi-column"):
            group_name = "dummy for single column"

        if group_name in self.column:
            notebook = self.column.get(group_name)
        else:
            notebook = FeedNotebook(self.column, group_name, self.liststore)
            self.column.add(group_name, notebook)

        return notebook
Esempio n. 4
0
    def get_notebook(self, group_name):
        if not SETTINGS_VIEW.get_boolean('multi-column'):
            group_name = 'dummy for single column'

        if group_name in self.column:
            notebook = self.column.get(group_name)
        else:
            notebook = FeedNotebook(self.column, group_name, self.liststore)
            self.column.add(group_name, notebook)

        return notebook
Esempio n. 5
0
    def __init__(self, liststore):
        self.liststore = liststore

        self.gui = gui = Gtk.Builder()
        gui.add_from_file(SHARED_DATA_FILE('gfeedline.glade'))

        self.window = window = gui.get_object('main_window')
        self.column = MultiColumnDict(gui)  # multi-columns for Notebooks
        self.theme = Theme()
        self.font = FontSet()
        self.notification = StatusNotification(liststore)

        dnd_list = [
            Gtk.TargetEntry.new("text/uri-list", 0, 1),
            Gtk.TargetEntry.new("text/x-moz-url", 0, 4),
        ]
        window.drag_dest_set(Gtk.DestDefaults.ALL, dnd_list,
                             Gdk.DragAction.COPY)

        target = Gtk.TargetList.new([])
        target.add(Gdk.Atom.intern("text/x-moz-url", False), 0, 4)
        target.add(Gdk.Atom.intern("text/uri-list", False), 0, 1)

        window.drag_dest_set_target_list(target)
        window.connect("drag-data-received", self.on_drag_data_received)

        SETTINGS.connect("changed::window-sticky",
                         self.on_settings_sticky_change)
        self.on_settings_sticky_change(SETTINGS, 'window-sticky')

        SETTINGS_VIEW.connect("changed::theme", self.on_settings_theme_change)
        self.on_settings_theme_change(SETTINGS_VIEW, 'theme')

        is_multi_column = SETTINGS_VIEW.get_boolean('multi-column')
        menuitem_multicolumn = gui.get_object('menuitem_multicolumn')
        menuitem_multicolumn.set_active(is_multi_column)

        menuitem_update = MenuItemUpdate(gui, liststore)

        x, y, w, h = self._get_geometry_from_settings()
        #        window.show() # for wrong position when auto-start

        if x >= 0 and y >= 0:
            window.move(x, y)

        window.resize(w, h)
        window.show()

        gui.connect_signals(self)
Esempio n. 6
0
    def __init__(self, liststore):
        self.liststore = liststore

        self.gui = gui = Gtk.Builder()
        gui.add_from_file(SHARED_DATA_FILE("gfeedline.glade"))

        self.window = window = gui.get_object("main_window")
        self.column = MultiColumnDict(gui)  # multi-columns for Notebooks
        self.theme = Theme()
        self.font = FontSet()
        self.notification = StatusNotification(liststore)

        dnd_list = [Gtk.TargetEntry.new("text/uri-list", 0, 1), Gtk.TargetEntry.new("text/x-moz-url", 0, 4)]
        window.drag_dest_set(Gtk.DestDefaults.ALL, dnd_list, Gdk.DragAction.COPY)

        target = Gtk.TargetList.new([])
        target.add(Gdk.Atom.intern("text/x-moz-url", False), 0, 4)
        target.add(Gdk.Atom.intern("text/uri-list", False), 0, 1)

        window.drag_dest_set_target_list(target)
        window.connect("drag-data-received", self.on_drag_data_received)

        SETTINGS.connect("changed::window-sticky", self.on_settings_sticky_change)
        self.on_settings_sticky_change(SETTINGS, "window-sticky")

        SETTINGS_VIEW.connect("changed::theme", self.on_settings_theme_change)
        self.on_settings_theme_change(SETTINGS_VIEW, "theme")

        is_multi_column = SETTINGS_VIEW.get_boolean("multi-column")
        menuitem_multicolumn = gui.get_object("menuitem_multicolumn")
        menuitem_multicolumn.set_active(is_multi_column)

        menuitem_update = MenuItemUpdate(gui, liststore)

        x, y, w, h = self._get_geometry_from_settings()
        #        window.show() # for wrong position when auto-start

        if x >= 0 and y >= 0:
            window.move(x, y)

        window.resize(w, h)
        window.show()

        gui.connect_signals(self)
Esempio n. 7
0
    def __init__(self, name, notebook, child):
        super(NotebookTabLabel, self).__init__()

        self.label = Gtk.Label.new_with_mnemonic(name)
        self.connect("button-press-event", self._on_button_press_cb, notebook, child)

        box = Gtk.Box()

        if SETTINGS_VIEW.get_boolean("favicon"):
            feedview = child.get_children()[1]
            icon_pixbuf = feedview.webview.api.account.icon.get_pixbuf()
            icon = Gtk.Image.new_from_pixbuf(icon_pixbuf)
            box.pack_start(icon, True, True, 2)

        box.pack_start(self.label, True, True, 0)

        self.set_visible_window(False)
        self.add(box)
        self.show_all()
Esempio n. 8
0
    def __init__(self, name, notebook, child):
        super(NotebookTabLabel, self).__init__()

        self.label = Gtk.Label.new_with_mnemonic(name)
        self.connect('button-press-event', self._on_button_press_cb, notebook,
                     child)

        box = Gtk.Box()

        if SETTINGS_VIEW.get_boolean('favicon'):
            feedview = child.get_children()[1]
            icon_pixbuf = feedview.webview.api.account.icon.get_pixbuf()
            icon = Gtk.Image.new_from_pixbuf(icon_pixbuf)
            box.pack_start(icon, True, True, 2)

        box.pack_start(self.label, True, True, 0)

        self.set_visible_window(False)
        self.add(box)
        self.show_all()
Esempio n. 9
0
 def on_changed_system_font(self, settings, key):
     if SETTINGS_VIEW.get_boolean('use-system-font'):
         self.change_font()
Esempio n. 10
0
 def on_changed_system_font(self, settings, key):
     if SETTINGS_VIEW.get_boolean('use-system-font'):
         self.change_font()