Esempio n. 1
0
    def __init__(self, scrolled_window, api, group_name):
        super(FeedWebView, self).__init__()
        self.api = api
        self.group_name = group_name

        self.scroll = FeedWebViewScroll()
        self.link_on_webview = FeedWebViewLink()
        self.scrolled_window = scrolled_window
        self.theme = scrolled_window.theme
        self.dnd = DnDFile()

        self.load_uri("file://%s" % SHARED_DATA_FILE('html/base.html'))
        self.connect("navigation-policy-decision-requested",
                     self.on_click_link, api)
        self.connect("populate-popup", self.on_popup, api)
        self.connect("hovering-over-link", self.on_hovering_over_link)
        self.connect('scroll-event', self.on_scroll_event)
        self.connect("document-load-finished", self.on_load_finished)

        self.connect("drag-data-received", self.on_drag_data_received)
        self.connect("drag-drop", self.on_drag_drop)

        SETTINGS_VIEW.connect("changed::theme", self.on_load_finished)
        SETTINGS_DESKTOP.connect("changed::document-font-name",
                                 self.on_changed_system_font)

        scrolled_window.add(self)
        self.show_all()
Esempio n. 2
0
    def __init__(self, scrolled_window, api, group_name):
        super(FeedWebView, self).__init__()
        self.api = api
        self.group_name = group_name

        self.scroll = FeedWebViewScroll()
        self.link_on_webview = FeedWebViewLink()
        self.scrolled_window = scrolled_window
        self.theme = scrolled_window.theme
        self.dnd = DnDFile()

        self.load_uri("file://%s" % SHARED_DATA_FILE('html/base.html'))
        self.connect("navigation-policy-decision-requested", self.on_click_link, api)
        self.connect("populate-popup", self.on_popup, api)
        self.connect("hovering-over-link", self.on_hovering_over_link)
        self.connect('scroll-event', self.on_scroll_event)
        self.connect("document-load-finished", self.on_load_finished)

        self.connect("drag-data-received", self.on_drag_data_received)
        self.connect("drag-drop", self.on_drag_drop)

        SETTINGS_VIEW.connect("changed::theme", self.on_load_finished)
        SETTINGS_DESKTOP.connect("changed::document-font-name", 
                                 self.on_changed_system_font)

        scrolled_window.add(self)
        self.show_all()
Esempio n. 3
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. 4
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. 5
0
    def __init__(self, liststore, notebook, api, name='', page=-1):
        super(FeedView, self).__init__()

        self.name = name
        self.api = api
        self.liststore = liststore
        self.window = liststore.window  # access from RetweetMenuItem
        self.theme = self.window.theme
        self.feed_counter = 1  # numbers of feeds

        self.webview = FeedWebView(self, api, notebook.group_name)
        self.notification = self.window.notification

        self.id_history = CacheList()
        SETTINGS_VIEW.connect("changed::theme", self.id_history.clear)

        self.box = Gtk.VBox()
        self.profile = ProfilePane()
        self.append(notebook, page)
Esempio n. 6
0
    def __init__(self, liststore, notebook, api, name='', page=-1):
        super(FeedView, self).__init__()

        self.name = name
        self.api = api
        self.liststore = liststore
        self.window = liststore.window # access from RetweetMenuItem
        self.theme = self.window.theme
        self.feed_counter = 1 # numbers of feeds

        self.webview = FeedWebView(self, api, notebook.group_name)
        self.notification = self.window.notification

        self.id_history = CacheList()
        SETTINGS_VIEW.connect("changed::theme", self.id_history.clear)

        self.box = Gtk.VBox()
        self.profile = ProfilePane()
        self.append(notebook, page)
Esempio n. 7
0
    def __init__(self):
        self.template = {}

        self.all_themes = {}
        theme_system = SHARED_DATA_FILE('html/theme/')

        alllist = [(theme_system, p) for p in os.listdir(theme_system)] +\
            [(THEME_HOME, p) for p in os.listdir(THEME_HOME)]

        for path, filename in alllist:
            full_path = os.path.join(path, filename)
            if not os.path.isdir(full_path):
                continue

            name = filename.split('.')[0]
            self.all_themes.setdefault(name, {})
            self.all_themes[name]['dir'] = full_path

            if filename.count('Ascending'):
                self.all_themes[name]['is_ascending'] = True

        SETTINGS_VIEW.connect("changed::theme", self.on_setting_theme_changed)
        self.on_setting_theme_changed(SETTINGS_VIEW, 'theme')
Esempio n. 8
0
    def __init__(self):
        self.template = {}

        self.all_themes = {}
        theme_system = SHARED_DATA_FILE("html/theme/")

        alllist = [(theme_system, p) for p in os.listdir(theme_system)] + [
            (THEME_HOME, p) for p in os.listdir(THEME_HOME)
        ]

        for path, filename in alllist:
            full_path = os.path.join(path, filename)
            if not os.path.isdir(full_path):
                continue

            name = filename.split(".")[0]
            self.all_themes.setdefault(name, {})
            self.all_themes[name]["dir"] = full_path

            if filename.count("Ascending"):
                self.all_themes[name]["is_ascending"] = True

        SETTINGS_VIEW.connect("changed::theme", self.on_setting_theme_changed)
        self.on_setting_theme_changed(SETTINGS_VIEW, "theme")
Esempio n. 9
0
    def __init__(self):
        self.is_paused = SETTINGS_VIEW.get_int('auto-scroll-delay') < 0
        self._timer = None

        SETTINGS_VIEW.connect("changed::auto-scroll-delay",
                              self._on_changed_delay)
Esempio n. 10
0
    def __init__(self):
        self.is_paused = SETTINGS_VIEW.get_int('auto-scroll-delay') < 0
        self._timer = None

        SETTINGS_VIEW.connect("changed::auto-scroll-delay", self._on_changed_delay)