Advanced Search

Search Results (Searched for: )

  • Aciera
  • Aciera's Avatar
15 Jan 2025 08:27
Replied by Aciera on topic LCNC 2.10 - Ask for AUTOMATIC_G43

LCNC 2.10 - Ask for AUTOMATIC_G43

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
  • Aciera's Avatar
15 Jan 2025 08:17 - 15 Jan 2025 08:22
Replied by Aciera on topic LCNC 2.10 - Ask for AUTOMATIC_G43

LCNC 2.10 - Ask for AUTOMATIC_G43

Category: Gmoccapy

Turned out to be not too difficult, adds an entry 'show_startup_message' in the .pref file:  
 
Displaying 20131 - 20132 out of 20132 results.
Time to create page: 0.903 seconds
Powered by Kunena Forum