- fixed the Properties Project menu entry to work on the new way

- in Properties tool now the Gerber apertures show the number of polygons in 'solid_geometry' instead of listing the objects
This commit is contained in:
Marius Stanciu 2019-03-11 19:30:38 +02:00
parent 5a4d61ee8f
commit e54ee9b569
4 changed files with 29 additions and 27 deletions

View File

@ -22,6 +22,8 @@ import urllib.request, urllib.parse, urllib.error
from contextlib import contextmanager
import gc
from xml.dom.minidom import parseString as parse_xml_string
########################################
## Imports part of FlatCAM ##
########################################
@ -44,8 +46,6 @@ from flatcamTools import *
from multiprocessing import Pool
import tclCommands
# from ParseFont import *
import gettext
import FlatCAMTranslation as fcTranslate
@ -2909,7 +2909,6 @@ class App(QtCore.QObject):
def final_save(self):
if self.should_we_save and self.collection.get_list():
msgbox = QtWidgets.QMessageBox()
# msgbox.setText("<B>Save changes ...</B>")
msgbox.setText(_("There are files/objects modified in FlatCAM. "
"\n"
"Do you want to Save the project?"))
@ -2926,20 +2925,19 @@ class App(QtCore.QObject):
elif response == QtWidgets.QMessageBox.Cancel:
self.should_we_quit = False
return
self.save_defaults()
log.debug("App.final_save() --> App Defaults saved.")
if self.should_we_quit is True:
# save toolbar state to file
settings = QSettings("Open Source", "FlatCAM")
settings.setValue('saved_gui_state', self.ui.saveState())
settings.setValue('maximized_gui', self.ui.isMaximized())
# save toolbar state to file
settings = QSettings("Open Source", "FlatCAM")
settings.setValue('saved_gui_state', self.ui.saveState())
settings.setValue('maximized_gui', self.ui.isMaximized())
# This will write the setting to the platform specific storage.
del settings
log.debug("App.final_save() --> App UI state saved.")
QtWidgets.qApp.quit()
# This will write the setting to the platform specific storage.
del settings
log.debug("App.final_save() --> App UI state saved.")
QtWidgets.qApp.quit()
def on_toggle_shell(self):
"""
@ -5862,16 +5860,6 @@ class App(QtCore.QObject):
except IOError:
exists = False
# msg = "Project file exists. Overwrite?"
# if exists:
# msgbox = QtWidgets.QMessageBox()
# msgbox.setInformativeText(msg)
# msgbox.setStandardButtons(QtWidgets.QMessageBox.Cancel |QtWidgets.QMessageBox.Ok)
# msgbox.setDefaultButton(QtWidgets.QMessageBox.Cancel)
# result = msgbox.exec_()
# if result ==QtWidgets.QMessageBox.Cancel:
# return
if thread is True:
self.worker_task.emit({'fcn': self.save_project,
'params': [filename]})

View File

@ -17,6 +17,7 @@ CAD program, and create G-Code for Isolation routing.
- added a visual cue in Menu -> Edit about the entries to enter the Editor and to Save & Exit Editor. When one is enabled the other is disabled.
- grouped all the UI files in flatcamGUI folder
- grouped all parsers files in flatcamParsers folder
- changes to the final_save() function
10.03.2019

View File

@ -9,16 +9,25 @@
#import traceback
from io import StringIO
import numpy as np
from numpy import arctan2, Inf, array, sqrt, pi, ceil, sin, cos, dot, float32, \
transpose
from numpy.linalg import solve, norm
import re, sys, os, platform
import math
from copy import deepcopy
import traceback
from decimal import Decimal
from rtree import index as rtindex
from lxml import etree as ET
# See: http://toblerity.org/shapely/manual.html
from shapely.geometry import Polygon
from shapely.geometry import Polygon, LineString, Point, LinearRing, MultiLineString
from shapely.geometry import MultiPoint, MultiPolygon
from shapely.geometry import box as shply_box
from shapely.ops import cascaded_union, unary_union
import shapely.affinity as affinity
@ -27,21 +36,21 @@ from shapely.wkt import dumps as sdumps
from shapely.geometry.base import BaseGeometry
from shapely.geometry import shape
import collections
from collections import Iterable
import rasterio
from rasterio.features import shapes
import ezdxf
# TODO: Commented for FlatCAM packaging with cx_freeze
# from scipy.spatial import KDTree, Delaunay
from flatcamParsers.ParseSVG import *
from flatcamParsers.ParseDXF import *
import logging
# import pprint
import platform
import FlatCAMApp
if platform.architecture()[0] == '64bit':
from ortools.constraint_solver import pywrapcp
@ -63,6 +72,7 @@ import builtins
if '_' not in builtins.__dict__:
_ = gettext.gettext
class ParseError(Exception):
pass

View File

@ -2569,6 +2569,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.final_save.emit()
if self.app.should_we_quit is False:
event.ignore()
class GeneralPreferencesUI(QtWidgets.QWidget):
def __init__(self, parent=None):