Closing the main window now closes the whole program.
This commit is contained in:
parent
47dd9e3715
commit
6cd256ad49
|
@ -142,7 +142,7 @@ class App(QtCore.QObject):
|
||||||
}
|
}
|
||||||
|
|
||||||
self.defaults = LoudDict()
|
self.defaults = LoudDict()
|
||||||
self.defaults.set_change_callback(lambda field: self.defaults_write_form_field(field)) # When the dictionary changes.
|
self.defaults.set_change_callback(self.on_defaults_dict_change) # When the dictionary changes.
|
||||||
self.defaults.update({
|
self.defaults.update({
|
||||||
"serial": 0,
|
"serial": 0,
|
||||||
"stats": {},
|
"stats": {},
|
||||||
|
@ -246,7 +246,7 @@ class App(QtCore.QObject):
|
||||||
}
|
}
|
||||||
|
|
||||||
self.options = LoudDict()
|
self.options = LoudDict()
|
||||||
self.options.set_change_callback(lambda field: self.options_write_form_field(field))
|
self.options.set_change_callback(self.on_options_dict_change)
|
||||||
self.options.update({
|
self.options.update({
|
||||||
"units": "IN",
|
"units": "IN",
|
||||||
"gerber_plot": True,
|
"gerber_plot": True,
|
||||||
|
@ -947,6 +947,18 @@ class App(QtCore.QObject):
|
||||||
obj.options[oname] = self.defaults[option]
|
obj.options[oname] = self.defaults[option]
|
||||||
obj.to_form() # Update UI
|
obj.to_form() # Update UI
|
||||||
|
|
||||||
|
def on_options_dict_change(self, field):
|
||||||
|
self.options_write_form_field(field)
|
||||||
|
|
||||||
|
if field == "units":
|
||||||
|
self.set_screen_units(self.options['units'])
|
||||||
|
|
||||||
|
def on_defaults_dict_change(self, field):
|
||||||
|
self.defaults_write_form_field(field)
|
||||||
|
|
||||||
|
def set_screen_units(self, units):
|
||||||
|
self.ui.units_label.setText("[" + self.options["units"].lower() + "]")
|
||||||
|
|
||||||
def on_toggle_units(self):
|
def on_toggle_units(self):
|
||||||
"""
|
"""
|
||||||
Callback for the Units radio-button change in the Options tab.
|
Callback for the Units radio-button change in the Options tab.
|
||||||
|
@ -1016,7 +1028,8 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
self.options_read_form()
|
self.options_read_form()
|
||||||
self.inform.emit("Converted units to %s" % self.options["units"])
|
self.inform.emit("Converted units to %s" % self.options["units"])
|
||||||
self.ui.units_label.setText("[" + self.options["units"] + "]")
|
#self.ui.units_label.setText("[" + self.options["units"] + "]")
|
||||||
|
self.set_screen_units(self.options["units"])
|
||||||
|
|
||||||
def on_options_combo_change(self, sel):
|
def on_options_combo_change(self, sel):
|
||||||
"""
|
"""
|
||||||
|
@ -1641,7 +1654,8 @@ class App(QtCore.QObject):
|
||||||
##Project options
|
##Project options
|
||||||
self.options.update(d['options'])
|
self.options.update(d['options'])
|
||||||
self.project_filename = filename
|
self.project_filename = filename
|
||||||
self.ui.units_label.setText("[" + self.options["units"] + "]")
|
#self.ui.units_label.setText("[" + self.options["units"] + "]")
|
||||||
|
self.set_screen_units(self.options["units"])
|
||||||
|
|
||||||
## Re create objects
|
## Re create objects
|
||||||
App.log.debug("Re-creating objects...")
|
App.log.debug("Re-creating objects...")
|
||||||
|
@ -1657,6 +1671,7 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
def propagate_defaults(self):
|
def propagate_defaults(self):
|
||||||
|
|
||||||
|
# Which objects to update the given parameters.
|
||||||
routes = {
|
routes = {
|
||||||
"zdownrate": CNCjob
|
"zdownrate": CNCjob
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,6 +234,9 @@ class FlatCAMGUI(QtGui.QMainWindow):
|
||||||
self.setWindowTitle('FlatCAM %s' % version)
|
self.setWindowTitle('FlatCAM %s' % version)
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
def closeEvent(self, event):
|
||||||
|
QtGui.qApp.quit()
|
||||||
|
|
||||||
|
|
||||||
class FlatCAMInfoBar(QtGui.QWidget):
|
class FlatCAMInfoBar(QtGui.QWidget):
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"geometry_plot": true, "zoom_ratio": 1.5, "shell_at_startup": "1", "gerber_plot": true, "defaults_save_period_ms": 20000, "geometry_feedrate": 3.0, "excellon_travelz": 0.1, "gerber_multicolored": false, "gerber_solid": true, "gerber_isopasses": 1, "excellon_plot": true, "excellon_feedrate": 3.0, "geometry_travelz": 0.1, "excellon_solid": false, "geometry_paintmargin": 0.0, "zdownrate": "1", "gerber_gaps": "4", "gerber_bboxmargin": 0.0, "point_clipboard_format": "(%.4f, %.4f)", "excellon_drillz": -0.1, "geometry_cnctooldia": 0.016, "geometry_painttooldia": 0.07, "gerber_noncopperrounded": false, "geometry_paintoverlap": 0.15, "cncjob_append": "", "serial": "nuaxe92x4v5f2jeft4kr", "shell_shape": [500, 300], "zoom_in_key": "3", "zoom_out_key": "2", "stats": {"on_toggle_units": 6, "on_options_app2project": 48, "save_defaults": 13480, "on_delete": 33, "cncjob_on_exportgcode_button": 2, "on_fileopengerber": 13, "obj_on_scale_button": 7, "on_file_openproject": 1, "on_file_saveproject": 2, "geometry_on_generatecnc_button": 17, "on_file_new": 48, "on_about": 1, "exec_command": 6, "obj_on_offset_button": 1, "gerber_on_iso_button": 6, "on_fileopenexcellon": 13}, "recent_limit": 10, "gerber_cutoutgapsize": 0.15, "units": "IN", "fit_key": "1", "gerber_isotooldia": 0.016, "cncjob_tooldia": 0.016, "gerber_cutoutmargin": 0.1, "geometry_cutz": -0.002, "gerber_cutouttooldia": 0.07, "cncjob_plot": true, "gerber_isooverlap": 0.15, "gerber_bboxrounded": false, "gerber_noncoppermargin": 0.0}
|
{}
|
Loading…
Reference in New Issue