Skip to content

Commit 5629a87

Browse files
authored
Force restart when changing interface mode
1 parent 37d836f commit 5629a87

File tree

1 file changed

+2
-47
lines changed

1 file changed

+2
-47
lines changed

faugus-launcher.py

+2-47
Original file line numberDiff line numberDiff line change
@@ -1335,53 +1335,8 @@ def on_settings_dialog_response(self, dialog, response_id, settings_dialog):
13351335

13361336
if validation_result:
13371337
if self.interface_mode != combo_box_interface:
1338-
dialog = Gtk.Dialog(title="Faugus Launcher", transient_for=settings_dialog, modal=True)
1339-
dialog.set_resizable(False)
1340-
dialog.set_icon_from_file(faugus_png)
1341-
subprocess.Popen(["canberra-gtk-play", "-i", "dialog-information"])
1342-
if faugus_session:
1343-
dialog.fullscreen()
1344-
1345-
label = Gtk.Label()
1346-
label.set_label("Please restart Faugus Launcher")
1347-
label.set_halign(Gtk.Align.CENTER)
1348-
1349-
label2 = Gtk.Label()
1350-
label2.set_label("to switch the interface mode.")
1351-
label2.set_halign(Gtk.Align.CENTER)
1352-
1353-
button_yes = Gtk.Button(label="Ok")
1354-
button_yes.set_size_request(150, -1)
1355-
button_yes.connect("clicked", lambda x: dialog.response(Gtk.ResponseType.YES))
1356-
1357-
content_area = dialog.get_content_area()
1358-
content_area.set_border_width(0)
1359-
content_area.set_halign(Gtk.Align.CENTER)
1360-
content_area.set_valign(Gtk.Align.CENTER)
1361-
content_area.set_vexpand(True)
1362-
content_area.set_hexpand(True)
1363-
1364-
box_top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
1365-
box_top.set_margin_start(20)
1366-
box_top.set_margin_end(20)
1367-
box_top.set_margin_top(20)
1368-
box_top.set_margin_bottom(20)
1369-
1370-
box_bottom = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10)
1371-
box_bottom.set_margin_start(10)
1372-
box_bottom.set_margin_end(10)
1373-
box_bottom.set_margin_bottom(10)
1374-
1375-
box_top.pack_start(label, True, True, 0)
1376-
box_top.pack_start(label2, True, True, 0)
1377-
box_bottom.pack_start(button_yes, True, True, 0)
1378-
1379-
content_area.add(box_top)
1380-
content_area.add(box_bottom)
1381-
1382-
dialog.show_all()
1383-
dialog.run()
1384-
dialog.destroy()
1338+
subprocess.Popen([sys.executable, __file__])
1339+
self.destroy()
13851340

13861341
self.load_config()
13871342
settings_dialog.destroy()

0 commit comments

Comments
 (0)