mirror of
https://github.com/aclist/dztui.git
synced 2026-08-29 19:27:13 +02:00
feat: add quit dialog
This commit is contained in:
parent
63beb61878
commit
ff0c5caf30
@ -101,6 +101,7 @@ class Popup(Enum):
|
|||||||
RETURN = 5
|
RETURN = 5
|
||||||
MODLIST = 6
|
MODLIST = 6
|
||||||
DETAILS = 7
|
DETAILS = 7
|
||||||
|
QUIT = 8
|
||||||
|
|
||||||
|
|
||||||
class NotebookPage(Enum):
|
class NotebookPage(Enum):
|
||||||
@ -860,8 +861,7 @@ def process_shell_return_code(
|
|||||||
process_tree_option(RowType.HANDSHAKE)
|
process_tree_option(RowType.HANDSHAKE)
|
||||||
case 255: # dzgui version update
|
case 255: # dzgui version update
|
||||||
msg = "Update complete. Please close DZGUI and restart."
|
msg = "Update complete. Please close DZGUI and restart."
|
||||||
spawn_dialog(msg, Popup.NOTIFY)
|
spawn_dialog(msg, Popup.QUIT)
|
||||||
save_res_and_quit()
|
|
||||||
|
|
||||||
|
|
||||||
def call_on_thread(
|
def call_on_thread(
|
||||||
@ -2697,11 +2697,7 @@ class GenericDialog(Gtk.MessageDialog):
|
|||||||
dialog_type = Gtk.MessageType.INFO
|
dialog_type = Gtk.MessageType.INFO
|
||||||
button_type = Gtk.ButtonsType.NONE
|
button_type = Gtk.ButtonsType.NONE
|
||||||
header_text = "Please wait"
|
header_text = "Please wait"
|
||||||
case Popup.NOTIFY:
|
case Popup.NOTIFY | Popup.RETURN | Popup.QUIT:
|
||||||
dialog_type = Gtk.MessageType.INFO
|
|
||||||
button_type = Gtk.ButtonsType.OK
|
|
||||||
header_text = "Notice"
|
|
||||||
case Popup.RETURN:
|
|
||||||
dialog_type = Gtk.MessageType.INFO
|
dialog_type = Gtk.MessageType.INFO
|
||||||
button_type = Gtk.ButtonsType.OK
|
button_type = Gtk.ButtonsType.OK
|
||||||
header_text = "Notice"
|
header_text = "Notice"
|
||||||
@ -2748,6 +2744,13 @@ class GenericDialog(Gtk.MessageDialog):
|
|||||||
ok.connect("clicked", self._return_to_main_menu)
|
ok.connect("clicked", self._return_to_main_menu)
|
||||||
self.connect("delete-event", self._return_to_main_menu)
|
self.connect("delete-event", self._return_to_main_menu)
|
||||||
|
|
||||||
|
if mode == Popup.QUIT:
|
||||||
|
button_label = "Exit"
|
||||||
|
ok = self.action_area.get_children()[0]
|
||||||
|
ok.set_label(button_label)
|
||||||
|
ok.connect("clicked", save_res_and_quit)
|
||||||
|
self.connect("delete-event", save_res_and_quit)
|
||||||
|
|
||||||
self.set_default_response(Gtk.ResponseType.OK)
|
self.set_default_response(Gtk.ResponseType.OK)
|
||||||
self.set_size_request(500, 0)
|
self.set_size_request(500, 0)
|
||||||
self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
|
self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user