diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-15 05:28:05 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-15 05:28:05 -0500 |
commit | dd90247d8c14ff837db878e99c1896a04d90013e (patch) | |
tree | 987f7c4e18c8ff524747cb1010a661110579223f /clients/urwid/main.py | |
parent | 2a2a9e8762616b85b3f4d2d031c87db7a57a20eb (diff) | |
download | bbj-dd90247d8c14ff837db878e99c1896a04d90013e.tar.gz |
restrict on_post actions when the composer is open
Diffstat (limited to 'clients/urwid/main.py')
-rw-r--r-- | clients/urwid/main.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/clients/urwid/main.py b/clients/urwid/main.py index 20695e3..be559c5 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -482,16 +482,19 @@ class App(object): def on_post(self, button, message): quotes = self.get_quotes(message) author = self.usermap[message["author"]] - buttons = [ - urwid.Button("Reply", self.reply, message), - ] + buttons = [] + + if not self.window_split: + buttons.append(urwid.Button("Reply", self.reply, message)) if quotes and message["post_id"] != 0: - buttons.insert(1, urwid.Button( + buttons.append(urwid.Button( "View %sQuote" % ("a " if len(quotes) != 1 else ""), self.quote_view_menu, quotes)) - if network.can_edit(message["thread_id"], message["post_id"]): + if network.can_edit(message["thread_id"], message["post_id"]) \ + and not self.window_split: + if message["post_id"] == 0: msg = "Thread" else: msg = "Post" @@ -499,6 +502,9 @@ class App(object): buttons.insert(0, urwid.Button("Delete %s" % msg, self.deletion_dialog, message)) buttons.insert(0, urwid.Button("Edit Post", self.edit_post, message)) + if not buttons: + return + widget = OptionsMenu( urwid.ListBox(urwid.SimpleFocusListWalker(buttons)), title=str(">>%d (%s)" % (message["post_id"], author["user_name"])), |