Exemplo n.º 1
0
 def settings_updated(self):
     """
     Called when settings are updated
     """
     super(FeedListView, self).settings_updated()
     self.unread_only = not not settings.get('feeds', 'unread_only')
     self.action_sync.setDisabled(not settings.auth_ready())
     if settings.auth_ready():
         self.update_feed_list()
Exemplo n.º 2
0
 def settings_updated(self):
     """
     Called when settings are updated
     """
     super(FeedListView, self).settings_updated()
     self.unread_only = not not settings.get('feeds', 'unread_only')
     self.manage_actions()
     if not self.sync_running and settings.auth_ready():
         self.update_feed_list()
Exemplo n.º 3
0
 def trigger_unread_only(self, checked):
     """
     Action when the "show unread" button is checked or unchecked
     """
     if not settings.auth_ready():
         return
     if self.unread_only != checked:
         self.get_selected()
         self.unread_only = checked
         self.verify_current_category()
         self.update_feed_list()
Exemplo n.º 4
0
 def manage_actions(self):
     """
     Update the menus (main menu and context menu)
     """
     auth_ready = settings.auth_ready()
     self.action_sync.setDisabled(self.sync_running or not auth_ready)
     self.action_show_all.setDisabled(not auth_ready)
     self.action_show_unread_only.setDisabled(not auth_ready)
     self.action_show_unread_only.setChecked(self.unread_only)
     self.action_settings.setDisabled(self.sync_running or not auth_ready)          
     self.action_mark_selected_as_read.setDisabled(not self.can_mark_selected_as_read())
Exemplo n.º 5
0
    def init_menu(self):
        super(FeedListView, self).init_menu()
        
        menu_container = self.get_menu_container()
        
        # simple menu boutons
        self.action_settings = QAction("Settings", self.win)
        self.action_settings.setObjectName('actionSettings')
        self.action_sync = QAction("Synchronize all", self.win)
        self.action_sync.setDisabled(not settings.auth_ready())
        self.action_sync.setObjectName('actionSync')
        menu_container.addAction(self.action_settings)
        menu_container.addAction(self.action_sync)
        self.action_settings.triggered.connect(self.controller.trigger_settings)
        self.action_sync.triggered.connect(self.trigger_sync)
        
        menu_container.addSeparator()

        # menu boutons : group for show all/unread
        self.group_show = QActionGroup(self.win)
        self.action_show_all = QAction("Show all", self.group_show)
        self.action_show_all.setCheckable(True)
        self.action_show_all.setDisabled(True)
        self.action_show_unread_only = QAction("Unread only", self.group_show)
        self.action_show_unread_only.setCheckable(True)
        self.action_show_unread_only.setDisabled(True)
        if settings.get('feeds', 'unread_only'):
            self.action_show_unread_only.setChecked(True)
        else:
            self.action_show_all.setChecked(True)
        menu_container.addActions(self.group_show.actions())
        self.action_show_unread_only.toggled.connect(self.trigger_unread_only)
        
        # context menu
        self.make_context_menu(self.ui.listFeedList)
        
        self.action_mark_selected_as_read = QAction("Mark as read", self.win)
        self.action_mark_selected_as_read.triggered.connect(self.trigger_mark_selected_as_read)
        self.context_menu.addAction(self.action_mark_selected_as_read)

        self.context_menu.addSeparator()
        self.context_menu.addActions(self.group_show.actions())
        self.context_menu.addSeparator()
        self.context_menu.addAction(self.action_sync)
        self.context_menu.addAction(self.action_settings)
        
        self.manage_actions()
Exemplo n.º 6
0
    def __init__(self, controller):
        super(FeedListView, self).__init__(controller, Ui_winFeedList)
        
        self.current_category = None
        self.unread_only     = settings.get('feeds', 'unread_only')

        self.selected_category = None
        self.selected_feed     = None

        # menu bar

        self.add_orientation_menu()
        
        # simple menu boutons
        self.action_settings = QAction("Settings", self.win)
        self.action_settings.setObjectName('actionSettings')
        self.action_sync = QAction("Synchronize all", self.win)
        self.action_sync.setDisabled(not settings.auth_ready())
        self.action_sync.setObjectName('actionSync')
        self.ui.menuBar.addAction(self.action_settings)
        self.ui.menuBar.addAction(self.action_sync)
        self.action_settings.triggered.connect(self.controller.trigger_settings)
        self.action_sync.triggered.connect(self.trigger_sync)

        # menu boutons : group for show all/unread
        self.group_show = QActionGroup(self.win)
        self.action_show_all = QAction("Show all", self.group_show)
        self.action_show_all.setCheckable(True)
        self.action_show_all.setDisabled(True)
        self.action_show_unread_only = QAction("Show unread", self.group_show)
        self.action_show_unread_only.setCheckable(True)
        self.action_show_unread_only.setDisabled(True)
        if settings.get('feeds', 'unread_only'):
            self.action_show_unread_only.setChecked(True)
        else:
            self.action_show_all.setChecked(True)
        self.ui.menuBar.addActions(self.group_show.actions())
        self.action_show_unread_only.toggled.connect(self.toggle_unread_only)
        
        # feed list
        flm = FeedListModel(data=[], view=self)
        fld = FeedListDelegate(self.win)
        self.ui.listFeedList.setModel(flm)
        self.ui.listFeedList.setItemDelegate(fld)
        self.ui.listFeedList.activated.connect(self.activate_entry)