-
Forum
-
Search
Search Results
(Searched for: )
-
Aciera

15 Jan 2025 08:27
Category: Gmoccapy
code snippets:
gmoccapy.py:
if self.prefs.getpref("show_startup_messsage", True, bool):
title = "Important change for version 2.10"
message = "Gmoccapy does no longer automatically retain G43 after a toolchange!"
sub_message = "Automatic reactivation of G43 is possible using a REMAP.\nAn example can be found in any Gmoccapy SIM configuration."
cb_value = self.dialogs.show_startup_message(self, _(message), _(sub_message), _(title))
if cb_value:
self.prefs.putpref("show_startup_messsage", False, bool)
dialogs.py:
def show_startup_message(self, caller, message, sub_message, title = _("Operator Message")):
dialog = Gtk.MessageDialog(caller.widgets.window1,
Gtk.DialogFlags.DESTROY_WITH_PARENT,
Gtk.MessageType.WARNING,
Gtk.ButtonsType.NONE)
dialog.set_title(str(title))
dialog.set_markup("<span size='12000'><b>" + message + "</b></span>")
dialog.format_secondary_text(sub_message)
ok_button = Gtk.Button.new_with_mnemonic(_("_Ok"))
ok_button.set_size_request(-1, 56)
ok_button.connect("clicked",lambda w:dialog.response(Gtk.ResponseType.OK))
box = Gtk.HButtonBox()
box.add(ok_button)
cb = Gtk.CheckButton(label = "Don't show this again")
box.pack_start(cb, True, True, 0)
dialog.action_area.add(box)
dialog.set_border_width(5)
dialog.show_all()
self.emit("play_sound", "alert")
response = dialog.run()
dialog.destroy()
return cb.get_active()
-
Aciera

15 Jan 2025 08:17 - 15 Jan 2025 08:22
Category: Gmoccapy
Turned out to be not too difficult, adds an entry 'show_startup_message' in the .pref file:
15 Jan 2025 08:01
Category: Gmoccapy
Yes, this is a useful feature, thanks!
Displaying 20131 - 20133 out of 20133 results.
-
Forum
-
Search
Time to create page: 2.172 seconds