Skip to content

Commit

Permalink
Fix return codes for buttons in Nadeshiko-do-post dialogues.
Browse files Browse the repository at this point in the history
  • Loading branch information
deterenkelt committed Nov 28, 2018
1 parent f82b5da commit d3b0418
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions modules/nadeshiko-do-postponed_dialogues_gtk.glade
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Run them?</property>
<property name="is_focus">True</property>
<property name="receives_default">True</property>
<property name="image">img_quit</property>
<signal name="clicked" handler="on_window_destroy" swapped="no"/>
<signal name="clicked" handler="on_launch_jobs_cancel_but_click" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
Expand Down Expand Up @@ -178,7 +178,7 @@ Run them?</property>
<property name="margin_top">14</property>
<property name="margin_bottom">16</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_window_destroy" swapped="no"/>
<signal name="clicked" handler="on_launch_jobs_ok2_but_click" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand Down Expand Up @@ -270,7 +270,7 @@ Run them?</property>
</child>
</object>
</child>
<child>
<child type="titlebar">
<placeholder/>
</child>
</object>
Expand Down
16 changes: 15 additions & 1 deletion modules/nadeshiko-do-postponed_dialogues_gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,21 @@ def on_window_destroy(self, object, data=None):
def on_launch_jobs_ok1_but_click(self, widget, *args):
print ('run_jobs')
Gtk.main_quit()
sys.exit(4)
sys.exit(0)

def on_launch_jobs_ok2_but_click(self, widget, *args):
print ('no_jobs')
Gtk.main_quit()
sys.exit(0)

# Cancel with a cancel button.
# Not using on_window_destroy, for it will cancel with exit code 4
# and then trigger notify-send message with “Cancelled” whic would
# look superfluous.
def on_launch_jobs_cancel_but_click(self, widget, *args):
print ('do_not_run_jobs')
Gtk.main_quit()
sys.exit(0)


def main():
Expand Down

0 comments on commit d3b0418

Please sign in to comment.