Merge pull request #162 from zambonin/master
Force quit and subscription page fixes. #156 #161 #163
This commit is contained in:
@@ -67,7 +67,7 @@ Basic Commands
|
||||
:``r`` or ``F5``: Refresh page content
|
||||
:``u``: Log in or switch accounts
|
||||
:``?``: Show the help screen
|
||||
:``q``: Quit
|
||||
:``q``/``Q``: Quit/Force quit
|
||||
|
||||
----------------------
|
||||
Authenticated Commands
|
||||
|
||||
@@ -29,7 +29,7 @@ Basic Commands
|
||||
`r` or `F5` : Refresh page content
|
||||
`u` : Log in or switch accounts
|
||||
`?` : Show the help screen
|
||||
`q` : Quit
|
||||
`q/Q` : Quit/Force quit
|
||||
|
||||
Authenticated Commands
|
||||
`a/z` : Upvote/downvote
|
||||
|
||||
@@ -275,6 +275,10 @@ class BasePage(object):
|
||||
elif ch != 'n':
|
||||
curses.flash()
|
||||
|
||||
@BaseController.register('Q')
|
||||
def force_exit(self):
|
||||
sys.exit()
|
||||
|
||||
@BaseController.register('?')
|
||||
def help(self):
|
||||
show_help(self._content_window)
|
||||
@@ -439,6 +443,10 @@ class BasePage(object):
|
||||
Checks the inbox for unread messages and displays a notification.
|
||||
"""
|
||||
|
||||
if not self.reddit.is_oauth_session():
|
||||
show_notification(self.stdscr, ['Not logged in'])
|
||||
return
|
||||
|
||||
inbox = len(list(self.reddit.get_unread(limit=1)))
|
||||
try:
|
||||
if inbox > 0:
|
||||
|
||||
@@ -34,11 +34,16 @@ class SubscriptionPage(BasePage):
|
||||
self.controller.trigger(cmd)
|
||||
|
||||
@SubscriptionController.register(curses.KEY_F5, 'r')
|
||||
def refresh_content(self):
|
||||
def refresh_content(self, order=None):
|
||||
"Re-download all subscriptions and reset the page index"
|
||||
|
||||
self.content = SubscriptionContent.from_user(self.reddit, self.loader)
|
||||
self.nav = Navigator(self.content.get)
|
||||
if order:
|
||||
# reddit.get_my_subreddits() does not support sorting by order
|
||||
curses.flash()
|
||||
else:
|
||||
self.content = SubscriptionContent.from_user(self.reddit,
|
||||
self.loader)
|
||||
self.nav = Navigator(self.content.get)
|
||||
|
||||
@SubscriptionController.register(curses.KEY_ENTER, 10, curses.KEY_RIGHT)
|
||||
def store_selected_subreddit(self):
|
||||
|
||||
Reference in New Issue
Block a user