Forráskód Böngészése

- modified the extensions all over such the names include also the extension name. For Linux who does not display the extensions in the native FileDialog.
- added descriptions for some of the methods in the app.
- added lightened icons for the dark theme from Leandro Heck

Marius Stanciu 5 éve
szülő
commit
c5926ae99f
100 módosított fájl, 204 hozzáadás és 111 törlés
  1. 124 94
      FlatCAMApp.py
  2. 77 17
      FlatCAMObj.py
  3. 3 0
      README.md
  4. BIN
      share/dark_resources/about32.png
  5. BIN
      share/dark_resources/active_static.png
  6. BIN
      share/dark_resources/addarray16.png
  7. BIN
      share/dark_resources/addarray20.png
  8. BIN
      share/dark_resources/addarray32.png
  9. BIN
      share/dark_resources/aero.png
  10. BIN
      share/dark_resources/aero_arc.png
  11. BIN
      share/dark_resources/aero_array.png
  12. BIN
      share/dark_resources/aero_buffer.png
  13. BIN
      share/dark_resources/aero_circle.png
  14. BIN
      share/dark_resources/aero_circle_geo.png
  15. BIN
      share/dark_resources/aero_disc.png
  16. BIN
      share/dark_resources/aero_drill.png
  17. BIN
      share/dark_resources/aero_drill_array.png
  18. BIN
      share/dark_resources/aero_path1.png
  19. BIN
      share/dark_resources/aero_path2.png
  20. BIN
      share/dark_resources/aero_path3.png
  21. BIN
      share/dark_resources/aero_path4.png
  22. BIN
      share/dark_resources/aero_path5.png
  23. BIN
      share/dark_resources/aero_semidisc.png
  24. BIN
      share/dark_resources/aero_slot.png
  25. BIN
      share/dark_resources/aero_text.png
  26. BIN
      share/dark_resources/align_center32.png
  27. BIN
      share/dark_resources/align_justify32.png
  28. BIN
      share/dark_resources/align_left32.png
  29. BIN
      share/dark_resources/align_right32.png
  30. BIN
      share/dark_resources/aperture16.png
  31. BIN
      share/dark_resources/aperture32.png
  32. BIN
      share/dark_resources/arc16.png
  33. BIN
      share/dark_resources/arc24.png
  34. BIN
      share/dark_resources/arc32.png
  35. BIN
      share/dark_resources/axis32.png
  36. BIN
      share/dark_resources/backup24.png
  37. BIN
      share/dark_resources/backup_export24.png
  38. BIN
      share/dark_resources/backup_import24.png
  39. BIN
      share/dark_resources/blocked16.png
  40. BIN
      share/dark_resources/bold32.png
  41. BIN
      share/dark_resources/bookmarks16.png
  42. BIN
      share/dark_resources/bookmarks32.png
  43. BIN
      share/dark_resources/buffer16-2.png
  44. BIN
      share/dark_resources/buffer16.png
  45. BIN
      share/dark_resources/buffer20.png
  46. BIN
      share/dark_resources/buffer24.png
  47. BIN
      share/dark_resources/bug16.png
  48. BIN
      share/dark_resources/bug32.png
  49. BIN
      share/dark_resources/calculator16.png
  50. BIN
      share/dark_resources/calculator24.png
  51. BIN
      share/dark_resources/calibrate_16.png
  52. BIN
      share/dark_resources/calibrate_32.png
  53. BIN
      share/dark_resources/cancel_edit16.png
  54. BIN
      share/dark_resources/cancel_edit32.png
  55. BIN
      share/dark_resources/circle32.png
  56. BIN
      share/dark_resources/clear_plot16.png
  57. BIN
      share/dark_resources/clear_plot32.png
  58. BIN
      share/dark_resources/close_edit_file16.png
  59. BIN
      share/dark_resources/close_edit_file32.png
  60. BIN
      share/dark_resources/cnc16.png
  61. BIN
      share/dark_resources/cnc32.png
  62. BIN
      share/dark_resources/code.png
  63. BIN
      share/dark_resources/code_editor32.png
  64. BIN
      share/dark_resources/convert24.png
  65. BIN
      share/dark_resources/copperfill16.png
  66. BIN
      share/dark_resources/copperfill32.png
  67. BIN
      share/dark_resources/copy.png
  68. BIN
      share/dark_resources/copy16.png
  69. BIN
      share/dark_resources/copy32.png
  70. BIN
      share/dark_resources/copy_16.png
  71. BIN
      share/dark_resources/copy_file16.png
  72. BIN
      share/dark_resources/copy_file32.png
  73. BIN
      share/dark_resources/copy_geo.png
  74. BIN
      share/dark_resources/corner32.png
  75. BIN
      share/dark_resources/cut16.png
  76. BIN
      share/dark_resources/cut16_bis.png
  77. BIN
      share/dark_resources/cut32.png
  78. BIN
      share/dark_resources/cut32_bis.png
  79. BIN
      share/dark_resources/cutpath16.png
  80. BIN
      share/dark_resources/cutpath24.png
  81. BIN
      share/dark_resources/cutpath32.png
  82. BIN
      share/dark_resources/database32.png
  83. BIN
      share/dark_resources/defaults.png
  84. BIN
      share/dark_resources/delete32.png
  85. BIN
      share/dark_resources/delete_file16.png
  86. BIN
      share/dark_resources/delete_file32.png
  87. BIN
      share/dark_resources/deleteshape16.png
  88. BIN
      share/dark_resources/deleteshape24.png
  89. BIN
      share/dark_resources/deleteshape32.png
  90. BIN
      share/dark_resources/deselect_all32.png
  91. BIN
      share/dark_resources/disable16.png
  92. BIN
      share/dark_resources/disable32.png
  93. BIN
      share/dark_resources/disc32.png
  94. BIN
      share/dark_resources/distance16.png
  95. BIN
      share/dark_resources/distance32.png
  96. BIN
      share/dark_resources/distance_min16.png
  97. BIN
      share/dark_resources/distance_min32.png
  98. BIN
      share/dark_resources/doubleside16.png
  99. BIN
      share/dark_resources/doubleside32.png
  100. BIN
      share/dark_resources/draw32.png

+ 124 - 94
FlatCAMApp.py

@@ -545,23 +545,24 @@ class App(QtCore.QObject):
 
             "gerber_def_units": 'IN',
             "gerber_def_zeros": 'L',
-            "gerber_save_filters": "Gerber File (*.gbr);;Gerber File (*.bot);;Gerber File (*.bsm);;"
-                                   "Gerber File (*.cmp);;Gerber File (*.crc);;Gerber File (*.crs);;"
-                                   "Gerber File (*.gb0);;Gerber File (*.gb1);;Gerber File (*.gb2);;"
-                                   "Gerber File (*.gb3);;Gerber File (*.gb4);;Gerber File (*.gb5);;"
-                                   "Gerber File (*.gb6);;Gerber File (*.gb7);;Gerber File (*.gb8);;"
-                                   "Gerber File (*.gb9);;Gerber File (*.gbd);;Gerber File (*.gbl);;"
-                                   "Gerber File (*.gbo);;Gerber File (*.gbp);;Gerber File (*.gbs);;"
-                                   "Gerber File (*.gdo);;Gerber File (*.ger);;Gerber File (*.gko);;"
-                                   "Gerber File (*.gm1);;Gerber File (*.gm2);;Gerber File (*.gm3);;"
-                                   "Gerber File (*.grb);;Gerber File (*.gtl);;Gerber File (*.gto);;"
-                                   "Gerber File (*.gtp);;Gerber File (*.gts);;Gerber File (*.ly15);;"
-                                   "Gerber File (*.ly2);;Gerber File (*.mil);;Gerber File (*.pho);;"
-                                   "Gerber File (*.plc);;Gerber File (*.pls);;Gerber File (*.smb);;"
-                                   "Gerber File (*.smt);;Gerber File (*.sol);;Gerber File (*.spb);;"
-                                   "Gerber File (*.spt);;Gerber File (*.ssb);;Gerber File (*.sst);;"
-                                   "Gerber File (*.stc);;Gerber File (*.sts);;Gerber File (*.top);;"
-                                   "Gerber File (*.tsm);;Gerber File (*.art)"
+            "gerber_save_filters": "Gerber File .gbr (*.gbr);;Gerber File .bot (*.bot);;Gerber File .bsm (*.bsm);;"
+                                   "Gerber File .cmp (*.cmp);;Gerber File .crc (*.crc);;Gerber File .crs (*.crs);;"
+                                   "Gerber File .gb0 (*.gb0);;Gerber File .gb1 (*.gb1);;Gerber File .gb2 (*.gb2);;"
+                                   "Gerber File .gb3 (*.gb3);;Gerber File .gb4 (*.gb4);;Gerber File .gb5 (*.gb5);;"
+                                   "Gerber File .gb6 (*.gb6);;Gerber File .gb7 (*.gb7);;Gerber File .gb8 (*.gb8);;"
+                                   "Gerber File .gb9 (*.gb9);;Gerber File .gbd (*.gbd);;Gerber File .gbl (*.gbl);;"
+                                   "Gerber File .gbo (*.gbo);;Gerber File .gbp (*.gbp);;Gerber File .gbs (*.gbs);;"
+                                   "Gerber File .gdo (*.gdo);;Gerber File .ger (*.ger);;Gerber File .gko (*.gko);;"
+                                   "Gerber File .gm1 (*.gm1);;Gerber File .gm2 (*.gm2);;Gerber File .gm3 (*.gm3);;"
+                                   "Gerber File .grb (*.grb);;Gerber File .gtl (*.gtl);;Gerber File .gto (*.gto);;"
+                                   "Gerber File .gtp (*.gtp);;Gerber File .gts (*.gts);;Gerber File .ly15 (*.ly15);;"
+                                   "Gerber File .ly2 (*.ly2);;Gerber File .mil (*.mil);;"
+                                   "Gerber File .outline (*.outline);;Gerber File .pho (*.pho);;"
+                                   "Gerber File .plc (*.plc);;Gerber File .pls (*.pls);;Gerber File .smb (*.smb);;"
+                                   "Gerber File .smt (*.smt);;Gerber File .sol (*.sol);;Gerber File .spb (*.spb);;"
+                                   "Gerber File .spt (*.spt);;Gerber File .ssb (*.ssb);;Gerber File .sst (*.sst);;"
+                                   "Gerber File .stc (*.stc);;Gerber File .sts (*.sts);;Gerber File .top (*.top);;"
+                                   "Gerber File .tsm (*.tsm);;Gerber File .art (*.art)"
                                    "All Files (*.*)",
 
             # Gerber Options
@@ -627,9 +628,11 @@ class App(QtCore.QObject):
             "excellon_optimization_type": 'B',
 
             "excellon_search_time": 3,
-            "excellon_save_filters": "Excellon File (*.txt);;Excellon File (*.drd);;Excellon File (*.drl);;"
-                                     "Excellon File (*.exc);;Excellon File (*.ncd);;Excellon File (*.tap);;"
-                                     "Excellon File (*.xln);;All Files (*.*)",
+            "excellon_save_filters": "Excellon File .txt (*.txt);;Excellon File .drd (*.drd);;"
+                                     "Excellon File .drill (*.drill);;"
+                                     "Excellon File .drl (*.drl);;Excellon File .exc (*.exc);;"
+                                     "Excellon File .ncd (*.ncd);;Excellon File .tap (*.tap);;"
+                                     "Excellon File .xln (*.xln);;All Files (*.*)",
             "excellon_plot_fill": '#C40000BF',
             "excellon_plot_line": '#750000BF',
 
@@ -749,15 +752,15 @@ class App(QtCore.QObject):
             "cncjob_steps_per_circle": 64,
             "cncjob_footer": False,
             "cncjob_line_ending": False,
-            "cncjob_save_filters": "G-Code Files (*.nc);;G-Code Files (*.din);;G-Code Files (*.dnc);;"
-                                   "G-Code Files (*.ecs);;G-Code Files (*.eia);;G-Code Files (*.fan);;"
-                                   "G-Code Files (*.fgc);;G-Code Files (*.fnc);;G-Code Files (*.gc);;"
-                                   "G-Code Files (*.gcd);;G-Code Files (*.gcode);;G-Code Files (*.h);;"
-                                   "G-Code Files (*.hnc);;G-Code Files (*.i);;G-Code Files (*.min);;"
-                                   "G-Code Files (*.mpf);;G-Code Files (*.mpr);;G-Code Files (*.cnc);;"
-                                   "G-Code Files (*.ncc);;G-Code Files (*.ncg);;G-Code Files (*.ncp);;"
-                                   "G-Code Files (*.ngc);;G-Code Files (*.out);;G-Code Files (*.ply);;"
-                                   "G-Code Files (*.sbp);;G-Code Files (*.tap);;G-Code Files (*.xpi);;"
+            "cncjob_save_filters": "G-Code Files .nc (*.nc);;G-Code Files .din (*.din);;G-Code Files .dnc (*.dnc);;"
+                                   "G-Code Files .ecs (*.ecs);;G-Code Files .eia (*.eia);;G-Code Files .fan (*.fan);;"
+                                   "G-Code Files .fgc (*.fgc);;G-Code Files .fnc (*.fnc);;G-Code Files . gc (*.gc);;"
+                                   "G-Code Files .gcd (*.gcd);;G-Code Files .gcode (*.gcode);;G-Code Files .h (*.h);;"
+                                   "G-Code Files .hnc (*.hnc);;G-Code Files .i (*.i);;G-Code Files .min (*.min);;"
+                                   "G-Code Files .mpf (*.mpf);;G-Code Files .mpr (*.mpr);;G-Code Files .cnc (*.cnc);;"
+                                   "G-Code Files .ncc (*.ncc);;G-Code Files .ncg (*.ncg);;G-Code Files .ncp (*.ncp);;"
+                                   "G-Code Files .ngc (*.ngc);;G-Code Files .out (*.out);;G-Code Files .ply (*.ply);;"
+                                   "G-Code Files .sbp (*.sbp);;G-Code Files .tap (*.tap);;G-Code Files .xpi (*.xpi);;"
                                    "All Files (*.*)",
             "cncjob_plot_line": '#4650BDFF',
             "cncjob_plot_fill": '#5E6CFFFF',
@@ -1022,12 +1025,12 @@ class App(QtCore.QObject):
 
             # Utilities
             # file associations
-            "fa_excellon": 'drd, drl, exc, ncd, tap, xln',
+            "fa_excellon": 'drd, drill, drl, exc, ncd, tap, xln',
             "fa_gcode": 'cnc, din, dnc, ecs, eia, fan, fgc, fnc, gc, gcd, gcode, h, hnc, i, min, mpf, mpr, nc, ncc, '
                         'ncg, ncp, ngc, out, ply, rol, sbp, tap, xpi',
             "fa_gerber": 'art, bot, bsm, cmp, crc, crs, dim, gb0, gb1, gb2, gb3, gb4, gb5, gb6, gb7, gb8, gb9, gbd, '
                          'gbl, gbo, gbp, gbr, gbs, gdo, ger, gko, gm1, gm2, gm3, grb, gtl, gto, gtp, gts, ly15, ly2, '
-                         'mil, pho, plc, pls, smb, smt, sol, spb, spt, ssb, sst, stc, sts, top, tsm',
+                         'mil, outline, pho, plc, pls, smb, smt, sol, spb, spt, ssb, sst, stc, sts, top, tsm',
             # Keyword list
             "util_autocomplete_keywords": 'Desktop, Documents, FlatConfig, FlatPrj, False, '
                                           'Marius, My Documents, Paste_1, '
@@ -2726,10 +2729,11 @@ class App(QtCore.QObject):
 
         self.grb_list = ['art', 'bot', 'bsm', 'cmp', 'crc', 'crs', 'dim', 'g4', 'gb0', 'gb1', 'gb2', 'gb3', 'gb5',
                          'gb6', 'gb7', 'gb8', 'gb9', 'gbd', 'gbl', 'gbo', 'gbp', 'gbr', 'gbs', 'gdo', 'ger', 'gko',
-                         'gml', 'gm1', 'gm2', 'gm3', 'grb', 'gtl', 'gto', 'gtp', 'gts', 'ly15', 'ly2', 'mil', 'pho',
-                         'plc', 'pls', 'smb', 'smt', 'sol', 'spb', 'spt', 'ssb', 'sst', 'stc', 'sts', 'top', 'tsm']
+                         'gml', 'gm1', 'gm2', 'gm3', 'grb', 'gtl', 'gto', 'gtp', 'gts', 'ly15', 'ly2', 'mil', 'outline',
+                         'pho', 'plc', 'pls', 'smb', 'smt', 'sol', 'spb', 'spt', 'ssb', 'sst', 'stc', 'sts', 'top',
+                         'tsm']
 
-        self.exc_list = ['drd', 'drl', 'exc', 'ncd', 'tap', 'txt', 'xln']
+        self.exc_list = ['drd', 'drl', 'drill', 'exc', 'ncd', 'tap', 'txt', 'xln']
 
         self.gcode_list = ['cnc', 'din', 'dnc', 'ecs', 'eia', 'fan', 'fgc', 'fnc', 'gc', 'gcd', 'gcode', 'h', 'hnc',
                            'i', 'min', 'mpf', 'mpr', 'nc', 'ncc', 'ncg', 'ngc', 'ncp', 'out', 'ply', 'rol',
@@ -10082,8 +10086,7 @@ class App(QtCore.QObject):
 
         # Check for more compatible types and add as required
         if not isinstance(obj, FlatCAMExcellon):
-            self.inform.emit('[ERROR_NOTCL] %s' %
-                             _("Failed. Only Excellon objects can be saved as Excellon files..."))
+            self.inform.emit('[ERROR_NOTCL] %s' % _("Failed. Only Excellon objects can be saved as Excellon files..."))
             return
 
         name = self.collection.get_active().options["name"]
@@ -10100,8 +10103,7 @@ class App(QtCore.QObject):
         filename = str(filename)
 
         if filename == "":
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("Export Excellon cancelled."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Export Excellon cancelled."))
             return
         else:
             used_extension = filename.rpartition('.')[2]
@@ -10147,8 +10149,7 @@ class App(QtCore.QObject):
         filename = str(filename)
 
         if filename == "":
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("Export Gerber cancelled."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Export Gerber cancelled."))
             return
         else:
             used_extension = filename.rpartition('.')[2]
@@ -10170,8 +10171,7 @@ class App(QtCore.QObject):
 
         obj = self.collection.get_active()
         if obj is None:
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("No object selected."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("No object selected."))
             msg = _("Please Select a Geometry object to export")
             msgbox = QtWidgets.QMessageBox()
             msgbox.setInformativeText(msg)
@@ -10182,8 +10182,7 @@ class App(QtCore.QObject):
 
         # Check for more compatible types and add as required
         if not isinstance(obj, FlatCAMGeometry):
-            msg = '[ERROR_NOTCL] %s' % \
-                  _("Only Geometry objects can be used.")
+            msg = '[ERROR_NOTCL] %s' % _("Only Geometry objects can be used.")
             msgbox = QtWidgets.QMessageBox()
             msgbox.setInformativeText(msg)
             bt_ok = msgbox.addButton(_('Ok'), QtWidgets.QMessageBox.AcceptRole)
@@ -10194,21 +10193,19 @@ class App(QtCore.QObject):
 
         name = self.collection.get_active().options["name"]
 
-        _filter_ = "DXF File (*.DXF);;All Files (*.*)"
+        _filter_ = "DXF File .dxf (*.DXF);;All Files (*.*)"
         try:
             filename, _f = FCFileSaveDialog.get_saved_filename(
                 caption=_("Export DXF"),
                 directory=self.get_last_save_folder() + '/' + name,
                 filter=_filter_)
         except TypeError:
-            filename, _f = FCFileSaveDialog.get_saved_filename(caption=_("Export DXF"),
-                                                                 filter=_filter_)
+            filename, _f = FCFileSaveDialog.get_saved_filename(caption=_("Export DXF"), filter=_filter_)
 
         filename = str(filename)
 
         if filename == "":
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("Export DXF cancelled."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Export DXF cancelled."))
             return
         else:
             self.export_dxf(name, filename)
@@ -10226,7 +10223,7 @@ class App(QtCore.QObject):
         self.report_usage("on_file_importsvg")
         App.log.debug("on_file_importsvg()")
 
-        _filter_ = "SVG File (*.svg);;All Files (*.*)"
+        _filter_ = "SVG File .svg (*.svg);;All Files (*.*)"
         try:
             filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Import SVG"),
                                                                    directory=self.get_last_folder(), filter=_filter_)
@@ -10240,8 +10237,7 @@ class App(QtCore.QObject):
         filenames = [str(filename) for filename in filenames]
 
         if len(filenames) == 0:
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("Open SVG cancelled."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Open SVG cancelled."))
         else:
             for filename in filenames:
                 if filename != '':
@@ -10258,7 +10254,7 @@ class App(QtCore.QObject):
         self.report_usage("on_file_importdxf")
         App.log.debug("on_file_importdxf()")
 
-        _filter_ = "DXF File (*.DXF);;All Files (*.*)"
+        _filter_ = "DXF File .dxf (*.DXF);;All Files (*.*)"
         try:
             filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Import DXF"),
                                                                    directory=self.get_last_folder(),
@@ -10273,8 +10269,7 @@ class App(QtCore.QObject):
         filenames = [str(filename) for filename in filenames]
 
         if len(filenames) == 0:
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("Open DXF cancelled."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Open DXF cancelled."))
         else:
             for filename in filenames:
                 if filename != '':
@@ -10332,11 +10327,11 @@ class App(QtCore.QObject):
 
         flt = "All Files (*.*)"
         if obj.kind == 'gerber':
-            flt = "Gerber Files (*.GBR);;PDF Files (*.PDF);;All Files (*.*)"
+            flt = "Gerber Files .gbr (*.GBR);;PDF Files .pdf (*.PDF);;All Files (*.*)"
         elif obj.kind == 'excellon':
-            flt = "Excellon Files (*.DRL);;PDF Files (*.PDF);;All Files (*.*)"
+            flt = "Excellon Files .drl (*.DRL);;PDF Files .pdf (*.PDF);;All Files (*.*)"
         elif obj.kind == 'cncjob':
-            flt = "GCode Files (*.NC);;PDF Files (*.PDF);;All Files (*.*)"
+            flt = "GCode Files .nc (*.NC);;PDF Files .pdf (*.PDF);;All Files (*.*)"
 
         self.source_editor_tab = TextEditor(app=self, plain_text=True)
 
@@ -10497,7 +10492,8 @@ class App(QtCore.QObject):
         self.report_usage("on_fileopenscript")
         App.log.debug("on_fileopenscript()")
 
-        _filter_ = "TCL script (*.FlatScript);;TCL script (*.TCL);;TCL script (*.TXT);;All Files (*.*)"
+        _filter_ = "TCL script .FlatScript (*.FlatScript);;TCL script .tcl (*.TCL);;TCL script .txt (*.TXT);;" \
+                   "All Files (*.*)"
 
         if name:
             filenames = [name]
@@ -10539,7 +10535,8 @@ class App(QtCore.QObject):
                                         alignment=Qt.AlignBottom | Qt.AlignLeft,
                                         color=QtGui.QColor("gray"))
         else:
-            _filter_ = "TCL script (*.FlatScript);;TCL script (*.TCL);;TCL script (*.TXT);;All Files (*.*)"
+            _filter_ = "TCL script .FlatScript (*.FlatScript);;TCL script .tcl (*.TCL);;TCL script .txt (*.TXT);;" \
+                       "All Files (*.*)"
             try:
                 filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Run TCL script"),
                                                                      directory=self.get_last_folder(), filter=_filter_)
@@ -10616,7 +10613,7 @@ class App(QtCore.QObject):
         self.date = ''.join(c for c in self.date if c not in ':-')
         self.date = self.date.replace(' ', '_')
 
-        filter_ = "FlatCAM Project (*.FlatPrj);; All Files (*.*)"
+        filter_ = "FlatCAM Project .FlatPrj (*.FlatPrj);; All Files (*.*)"
         try:
             filename, _f = FCFileSaveDialog.get_saved_filename(
                 caption=_("Save Project As ..."),
@@ -10670,7 +10667,7 @@ class App(QtCore.QObject):
             self.inform.emit('[ERROR_NOTCL] %s' % _("No object selected."))
             return
 
-        filter_ = "PDF File (*.PDF);; All Files (*.*)"
+        filter_ = "PDF File .pdf (*.PDF);; All Files (*.*)"
         try:
             filename, _f = FCFileSaveDialog.get_saved_filename(
                 caption=_("Save Object as PDF ..."),
@@ -11542,10 +11539,11 @@ class App(QtCore.QObject):
         Opens a G-gcode file, parses it and creates a new object for
         it in the program. Thread-safe.
 
-        :param outname: Name of the resulting object. None causes the name to be that of the file.
-        :param filename: G-code file filename
-        :type filename: str
-        :return: None
+        :param filename:        G-code file filename
+        :param outname:         Name of the resulting object. None causes the name to be that of the file.
+        :param force_parsing:
+        :param plot:
+        :return:                None
         """
         App.log.debug("open_gcode()")
 
@@ -11605,11 +11603,9 @@ class App(QtCore.QObject):
         Opens a HPGL2 file, parses it and creates a new object for
         it in the program. Thread-safe.
 
-        :param outname: Name of the resulting object. None causes the
-            name to be that of the file.
-        :param filename: HPGL2 file filename
-        :type filename: str
-        :return: None
+        :param outname:     Name of the resulting object. None causes the name to be that of the file.
+        :param filename:    HPGL2 file filename
+        :return:            None
         """
         filename = filename
 
@@ -11672,10 +11668,9 @@ class App(QtCore.QObject):
         Opens a Script file, parses it and creates a new object for
         it in the program. Thread-safe.
 
-        :param outname: Name of the resulting object. None causes the name to be that of the file.
-        :param filename: Script file filename
-        :type filename: str
-        :return: None
+        :param outname:     Name of the resulting object. None causes the name to be that of the file.
+        :param filename:    Script file filename
+        :return:            None
         """
         App.log.debug("open_script()")
 
@@ -11709,9 +11704,9 @@ class App(QtCore.QObject):
         """
         Loads a config file from the specified file.
 
-        :param filename:  Name of the file from which to load.
-        :type filename: str
-        :return: None
+        :param filename:        Name of the file from which to load.
+        :param run_from_arg:    if True the FlatConfig file will be open as an command line argument
+        :return:                None
         """
         App.log.debug("Opening config file: " + filename)
 
@@ -11760,12 +11755,11 @@ class App(QtCore.QObject):
         5) Calls new_object() with the object's from_dict() as init method.
         6) Calls plot_all() if plot=True
 
-        :param filename:  Name of the file from which to load.
-        :type filename: str
-        :param run_from_arg: True if run for arguments
-        :param plot: If True plot all objects in the project
-        :param cli: run from command line
-        :return: None
+        :param filename:        Name of the file from which to load.
+        :param run_from_arg:    True if run for arguments
+        :param plot:            If True plot all objects in the project
+        :param cli:             Run from command line
+        :return:                None
         """
         App.log.debug("Opening project: " + filename)
 
@@ -11870,7 +11864,8 @@ class App(QtCore.QObject):
         an alternative to project options but allows the use
         of values invisible to the user.
 
-        :return: None
+        :param silent:  No messages
+        :return:        None
         """
 
         if silent is False:
@@ -11914,7 +11909,7 @@ class App(QtCore.QObject):
 
         :param fit_view:    if True will plot the objects and will adjust the zoom to fit all plotted objects into view
         :param use_thread:  if True will use threading for plotting the objects
-        :return:
+        :return:            None
         """
         self.log.debug("Plot_all()")
         self.inform.emit('[success] %s...' % _("Redrawing all objects"))
@@ -11933,12 +11928,31 @@ class App(QtCore.QObject):
                 worker_task(obj)
 
     def register_folder(self, filename):
+        """
+        Register the last folder used by the app to open something
+
+        :param filename:    the last folder is extracted from the filename
+        :return:            None
+        """
         self.defaults["global_last_folder"] = os.path.split(str(filename))[0]
 
     def register_save_folder(self, filename):
+        """
+        Register the last folder used by the app to save something
+
+        :param filename:    the last folder is extracted from the filename
+        :return:            None
+        """
         self.defaults["global_last_save_folder"] = os.path.split(str(filename))[0]
 
     def set_progress_bar(self, percentage, text=""):
+        """
+        Set a progress bar to a value (percentage)
+
+        :param percentage:  Value set to the progressbar
+        :param text:        Not used
+        :return:            None
+        """
         self.ui.progress_bar.setValue(int(percentage))
 
     def setup_shell(self):
@@ -12143,7 +12157,11 @@ class App(QtCore.QObject):
             ''')
 
     def setup_recent_items(self):
+        """
+        Setup a dictionary with the recent files accessed, organized by type
 
+        :return:
+        """
         # TODO: Move this to constructor
         icons = {
             "gerber": self.resource_location + "/flatcam_icon16.png",
@@ -12309,6 +12327,11 @@ class App(QtCore.QObject):
         self.log.debug("Recent items list has been populated.")
 
     def setup_component_editor(self):
+        """
+        Default text for the Selected tab when is not taken by the Object UI.
+
+        :return:
+        """
         # label = QtWidgets.QLabel("Choose an item from Project")
         # label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
 
@@ -12423,7 +12446,8 @@ class App(QtCore.QObject):
 
     def setup_obj_classes(self):
         """
-        Sets up application specifics on the FlatCAMObj class.
+        Sets up application specifics on the FlatCAMObj class. This way the object.app attribute will point to the App
+        class.
 
         :return: None
         """
@@ -12504,10 +12528,10 @@ class App(QtCore.QObject):
 
     def on_plotcanvas_setup(self, container=None):
         """
-        This is doing the setup for the plot area (canvas)
+        This is doing the setup for the plot area (canvas).
 
-        :param container: widget where to install the canvas
-        :return: None
+        :param container:   QT Widget where to install the canvas
+        :return:            None
         """
         if container:
             plot_container = container
@@ -12571,8 +12595,8 @@ class App(QtCore.QObject):
         toolbar button or the '1' key when the canvas is focused. Calls ``self.adjust_axes()``
         with axes limits from the geometry bounds of all objects.
 
-        :param event: Ignored.
-        :return: None
+        :param event:   Ignored.
+        :return:        None
         """
         if self.is_legacy is False:
             self.plotcanvas.fit_view()
@@ -12723,8 +12747,9 @@ class App(QtCore.QObject):
     def toggle_plots(self, objects):
         """
         Toggle plots visibility
-        :param objects: list of Objects for which to be toggled the visibility
-        :return:
+
+        :param objects:     list of Objects for which to be toggled the visibility
+        :return:            None
         """
 
         # if no objects selected then do nothing
@@ -12741,6 +12766,11 @@ class App(QtCore.QObject):
         self.plots_updated.emit()
 
     def clear_plots(self):
+        """
+        Clear the plots
+
+        :return:            None
+        """
 
         objects = self.collection.get_list()
 

+ 77 - 17
FlatCAMObj.py

@@ -447,10 +447,10 @@ class FlatCAMObj(QtCore.QObject):
         Will modify the filter string that is used when saving a file (a list of file extensions) to have the last
         used file extension as the first one in the special string
 
-        :param last_ext: the file extension that was last used to save a file
-        :param filter_string: a key in self.app.defaults that holds a string with the filter from QFileDialog
+        :param last_ext:        The file extension that was last used to save a file
+        :param filter_string:   A key in self.app.defaults that holds a string with the filter from QFileDialog
         used when saving a file
-        :return: None
+        :return:                None
         """
 
         filters = copy(self.app.defaults[filter_string])
@@ -7007,6 +7007,12 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         self.app.worker_task.emit({'fcn': worker_task, 'params': []})
 
     def on_exportgcode_button_click(self, *args):
+        """
+        Handler activated by a button clicked when exporting GCode.
+
+        :param args:
+        :return:
+        """
         self.app.report_usage("cncjob_on_exportgcode_button")
 
         self.read_form()
@@ -7014,9 +7020,9 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         save_gcode = False
 
         if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
-            _filter_ = "RML1 Files (*.rol);;All Files (*.*)"
+            _filter_ = "RML1 Files .rol (*.rol);;All Files (*.*)"
         elif 'hpgl' in self.pp_geometry_name:
-            _filter_ = "HPGL Files (*.plt);;All Files (*.*)"
+            _filter_ = "HPGL Files .plt (*.plt);;All Files (*.*)"
         else:
             save_gcode = True
             _filter_ = self.app.defaults['cncjob_save_filters']
@@ -7055,10 +7061,16 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         if self.app.defaults["global_open_style"] is False:
             self.app.file_opened.emit("gcode", filename)
         self.app.file_saved.emit("gcode", filename)
-        self.app.inform.emit('[success] %s: %s' %
-                             (_("Machine Code file saved to"), filename))
+        self.app.inform.emit('[success] %s: %s' % (_("Machine Code file saved to"), filename))
 
     def on_edit_code_click(self, *args):
+        """
+        Handler activated by a button clicked when editing GCode.
+
+        :param args:
+        :return:
+        """
+
         self.app.proc_container.view.set_busy(_("Loading..."))
 
         preamble = str(self.ui.prepend_text.get_value())
@@ -7116,9 +7128,9 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         """
         Will create a header to be added to all GCode files generated by FlatCAM
 
-        :param comment_start_symbol: a symbol to be used as the first symbol in a comment
-        :param comment_stop_symbol:  a symbol to be used as the last symbol in a comment
-        :return: a string with a GCode header
+        :param comment_start_symbol:    A symbol to be used as the first symbol in a comment
+        :param comment_stop_symbol:     A symbol to be used as the last symbol in a comment
+        :return:                        A string with a GCode header
         """
 
         log.debug("FlatCAMCNCJob.gcode_header()")
@@ -7219,6 +7231,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
 
     def gcode_footer(self, end_command=None):
         """
+        Will add the M02 to the end of GCode, if requested.
 
         :param end_command: 'M02' or 'M30' - String
         :return:
@@ -7232,11 +7245,11 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         """
         This will save the GCode from the Gcode object to a file on the OS filesystem
 
-        :param filename: filename for the GCode file
-        :param preamble: a custom Gcode block to be added at the beginning of the Gcode file
-        :param postamble: a custom Gcode block to be added at the end of the Gcode file
-        :param to_file: if False then no actual file is saved but the app will know that a file was created
-        :return: None
+        :param filename:    filename for the GCode file
+        :param preamble:    a custom Gcode block to be added at the beginning of the Gcode file
+        :param postamble:   a custom Gcode block to be added at the end of the Gcode file
+        :param to_file:     if False then no actual file is saved but the app will know that a file was created
+        :return:            None
         """
         # gcode = ''
         # roland = False
@@ -7482,6 +7495,13 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
             return lines
 
     def on_toolchange_custom_clicked(self, signal):
+        """
+        Handler for clicking toolchange custom.
+
+        :param signal:
+        :return:
+        """
+
         try:
             if 'toolchange_custom' not in str(self.options['ppname_e']).lower():
                 if self.ui.toolchange_cb.get_value():
@@ -7503,7 +7523,13 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
                 self.app.inform.emit('[ERROR] %s' % _("There is no preprocessor file."))
 
     def get_gcode(self, preamble='', postamble=''):
-        # we need this to be able get_gcode separately for shell command export_gcode
+        """
+        We need this to be able to get_gcode separately for shell command export_gcode
+
+        :param preamble:    Extra GCode added to the beginning of the GCode
+        :param postamble:   Extra GCode added at the end of the GCode
+        :return:            The modified GCode
+        """
         return preamble + '\n' + self.gcode + "\n" + postamble
 
     def get_svg(self):
@@ -7511,6 +7537,12 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         pass
 
     def on_plot_cb_click(self, *args):
+        """
+        Handler for clicking on the Plot checkbox.
+
+        :param args:
+        :return:
+        """
         if self.muted_ui:
             return
         kind = self.ui.cncplot_method_combo.get_value()
@@ -7528,6 +7560,12 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         self.ui_connect()
 
     def on_plot_cb_click_table(self):
+        """
+        Handler for clicking the plot checkboxes added into a Table on each row. Purpose: toggle visibility for the
+        tool/aperture found on that row.
+        :return:
+        """
+
         # self.ui.cnc_tools_table.cellWidget(row, 2).widget().setCheckState(QtCore.Qt.Unchecked)
         self.ui_disconnect()
         # cw = self.sender()
@@ -7566,9 +7604,14 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         self.ui_connect()
 
     def plot(self, visible=None, kind='all'):
-
+        """
         # Does all the required setup and returns False
         # if the 'ptint' option is set to False.
+
+        :param visible: Boolean to decide if the object will be plotted as visible or disabled on canvas
+        :param kind:    String. Can be "all" or "travel" or "cut". For CNCJob plotting
+        :return:        None
+        """
         if not FlatCAMObj.plot(self):
             return
 
@@ -7612,6 +7655,11 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
                 self.annotation.clear(update=True)
 
     def on_annotation_change(self):
+        """
+        Handler for toggling the annotation display by clicking a checkbox.
+        :return:
+        """
+
         if self.app.is_legacy is False:
             if self.ui.annotation_cb.get_value():
                 self.text_col.enabled = True
@@ -7625,6 +7673,13 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
             self.plot(kind=kind)
 
     def convert_units(self, units):
+        """
+        Units conversion used by the CNCJob objects.
+
+        :param units:   Can be "MM" or "IN"
+        :return:
+        """
+
         log.debug("FlatCAMObj.FlatCAMECNCjob.convert_units()")
 
         factor = CNCjob.convert_units(self, units)
@@ -7723,6 +7778,11 @@ class FlatCAMScript(FlatCAMObj):
         self.script_editor_tab = TextEditor(app=self.app, plain_text=True)
 
     def set_ui(self, ui):
+        """
+        Sets the Object UI in Selected Tab for the FlatCAM Script type of object.
+        :param ui:
+        :return:
+        """
         FlatCAMObj.set_ui(self, ui)
         FlatCAMApp.App.log.debug("FlatCAMScript.set_ui()")
 

+ 3 - 0
README.md

@@ -12,6 +12,9 @@ CAD program, and create G-Code for Isolation routing.
 14.04.2020 
 
 - lightened the hue of the color for 'success' messages printed in the Tcl Shell browser
+- modified the extensions all over such the names include also the extension name. For Linux who does not display the extensions in the native FileDialog.
+- added descriptions for some of the methods in the app.
+- added lightened icons for the dark theme from Leandro Heck 
 
 13.04.2020 
 

BIN
share/dark_resources/about32.png


BIN
share/dark_resources/active_static.png


BIN
share/dark_resources/addarray16.png


BIN
share/dark_resources/addarray20.png


BIN
share/dark_resources/addarray32.png


BIN
share/dark_resources/aero.png


BIN
share/dark_resources/aero_arc.png


BIN
share/dark_resources/aero_array.png


BIN
share/dark_resources/aero_buffer.png


BIN
share/dark_resources/aero_circle.png


BIN
share/dark_resources/aero_circle_geo.png


BIN
share/dark_resources/aero_disc.png


BIN
share/dark_resources/aero_drill.png


BIN
share/dark_resources/aero_drill_array.png


BIN
share/dark_resources/aero_path1.png


BIN
share/dark_resources/aero_path2.png


BIN
share/dark_resources/aero_path3.png


BIN
share/dark_resources/aero_path4.png


BIN
share/dark_resources/aero_path5.png


BIN
share/dark_resources/aero_semidisc.png


BIN
share/dark_resources/aero_slot.png


BIN
share/dark_resources/aero_text.png


BIN
share/dark_resources/align_center32.png


BIN
share/dark_resources/align_justify32.png


BIN
share/dark_resources/align_left32.png


BIN
share/dark_resources/align_right32.png


BIN
share/dark_resources/aperture16.png


BIN
share/dark_resources/aperture32.png


BIN
share/dark_resources/arc16.png


BIN
share/dark_resources/arc24.png


BIN
share/dark_resources/arc32.png


BIN
share/dark_resources/axis32.png


BIN
share/dark_resources/backup24.png


BIN
share/dark_resources/backup_export24.png


BIN
share/dark_resources/backup_import24.png


BIN
share/dark_resources/blocked16.png


BIN
share/dark_resources/bold32.png


BIN
share/dark_resources/bookmarks16.png


BIN
share/dark_resources/bookmarks32.png


BIN
share/dark_resources/buffer16-2.png


BIN
share/dark_resources/buffer16.png


BIN
share/dark_resources/buffer20.png


BIN
share/dark_resources/buffer24.png


BIN
share/dark_resources/bug16.png


BIN
share/dark_resources/bug32.png


BIN
share/dark_resources/calculator16.png


BIN
share/dark_resources/calculator24.png


BIN
share/dark_resources/calibrate_16.png


BIN
share/dark_resources/calibrate_32.png


BIN
share/dark_resources/cancel_edit16.png


BIN
share/dark_resources/cancel_edit32.png


BIN
share/dark_resources/circle32.png


BIN
share/dark_resources/clear_plot16.png


BIN
share/dark_resources/clear_plot32.png


BIN
share/dark_resources/close_edit_file16.png


BIN
share/dark_resources/close_edit_file32.png


BIN
share/dark_resources/cnc16.png


BIN
share/dark_resources/cnc32.png


BIN
share/dark_resources/code.png


BIN
share/dark_resources/code_editor32.png


BIN
share/dark_resources/convert24.png


BIN
share/dark_resources/copperfill16.png


BIN
share/dark_resources/copperfill32.png


BIN
share/dark_resources/copy.png


BIN
share/dark_resources/copy16.png


BIN
share/dark_resources/copy32.png


BIN
share/dark_resources/copy_16.png


BIN
share/dark_resources/copy_file16.png


BIN
share/dark_resources/copy_file32.png


BIN
share/dark_resources/copy_geo.png


BIN
share/dark_resources/corner32.png


BIN
share/dark_resources/cut16.png


BIN
share/dark_resources/cut16_bis.png


BIN
share/dark_resources/cut32.png


BIN
share/dark_resources/cut32_bis.png


BIN
share/dark_resources/cutpath16.png


BIN
share/dark_resources/cutpath24.png


BIN
share/dark_resources/cutpath32.png


BIN
share/dark_resources/database32.png


BIN
share/dark_resources/defaults.png


BIN
share/dark_resources/delete32.png


BIN
share/dark_resources/delete_file16.png


BIN
share/dark_resources/delete_file32.png


BIN
share/dark_resources/deleteshape16.png


BIN
share/dark_resources/deleteshape24.png


BIN
share/dark_resources/deleteshape32.png


BIN
share/dark_resources/deselect_all32.png


BIN
share/dark_resources/disable16.png


BIN
share/dark_resources/disable32.png


BIN
share/dark_resources/disc32.png


BIN
share/dark_resources/distance16.png


BIN
share/dark_resources/distance32.png


BIN
share/dark_resources/distance_min16.png


BIN
share/dark_resources/distance_min32.png


BIN
share/dark_resources/doubleside16.png


BIN
share/dark_resources/doubleside32.png


BIN
share/dark_resources/draw32.png


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott