Commit a9a05655 authored by sumpfralle's avatar sumpfralle

fixed various small things

removed many icons for menus and buttons: focussing on important actions


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1029 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 879ff049
This diff is collapsed.
...@@ -281,6 +281,7 @@ class ProjectGui: ...@@ -281,6 +281,7 @@ class ProjectGui:
gtk.main_quit() gtk.main_quit()
self.gui.add_from_file(gtk_build_file) self.gui.add_from_file(gtk_build_file)
self.window = self.gui.get_object("ProjectWindow") self.window = self.gui.get_object("ProjectWindow")
# show stock items on buttons
# increase the initial width of the window (due to hidden elements) # increase the initial width of the window (due to hidden elements)
self.window.set_default_size(400, -1) self.window.set_default_size(400, -1)
# initialize the RecentManager (TODO: check for Windows) # initialize the RecentManager (TODO: check for Windows)
...@@ -1593,7 +1594,8 @@ class ProjectGui: ...@@ -1593,7 +1594,8 @@ class ProjectGui:
def _browse_external_program_location(self, widget=None, key=None): def _browse_external_program_location(self, widget=None, key=None):
location = self.get_filename_via_dialog(title="Select the executable " \ location = self.get_filename_via_dialog(title="Select the executable " \
+ "for '%s'" % key, mode_load=True) + "for '%s'" % key, mode_load=True,
parent=self.preferences_window)
if not location is None: if not location is None:
self.settings.set("external_program_%s" % key, location) self.settings.set("external_program_%s" % key, location)
...@@ -4048,11 +4050,13 @@ class ProjectGui: ...@@ -4048,11 +4050,13 @@ class ProjectGui:
return toolpath_settings return toolpath_settings
def get_filename_via_dialog(self, title, mode_load=False, type_filter=None, def get_filename_via_dialog(self, title, mode_load=False, type_filter=None,
filename_templates=None, filename_extension=None): filename_templates=None, filename_extension=None, parent=None):
if parent is None:
parent = self.window
# we open a dialog # we open a dialog
if mode_load: if mode_load:
dialog = gtk.FileChooserDialog(title=title, dialog = gtk.FileChooserDialog(title=title,
parent=self.window, action=gtk.FILE_CHOOSER_ACTION_OPEN, parent=parent, action=gtk.FILE_CHOOSER_ACTION_OPEN,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK)) gtk.STOCK_OPEN, gtk.RESPONSE_OK))
else: else:
...@@ -4267,6 +4271,10 @@ class ProjectGui: ...@@ -4267,6 +4271,10 @@ class ProjectGui:
def mainloop(self): def mainloop(self):
# run the mainloop only if a GUI was requested # run the mainloop only if a GUI was requested
if not self.no_dialog: if not self.no_dialog:
gtk_settings = gtk.settings_get_default()
# force the icons to be displayed
gtk_settings.props.gtk_menu_images = True
gtk_settings.props.gtk_button_images = True
try: try:
gtk.main() gtk.main()
except KeyboardInterrupt: except KeyboardInterrupt:
......
...@@ -209,7 +209,7 @@ def get_external_program_location(key): ...@@ -209,7 +209,7 @@ def get_external_program_location(key):
for one_dir in path_env.split(os.pathsep): for one_dir in path_env.split(os.pathsep):
for basename in potential_names: for basename in potential_names:
location = os.path.join(one_dir, basename) location = os.path.join(one_dir, basename)
if check_uri_exists(location): if os.path.isfile(location):
return location return location
# do a manual scan in the programs directory (only for windows) # do a manual scan in the programs directory (only for windows)
try: try:
...@@ -223,7 +223,7 @@ def get_external_program_location(key): ...@@ -223,7 +223,7 @@ def get_external_program_location(key):
for sub_dir in windows_program_directories[key]: for sub_dir in windows_program_directories[key]:
for basename in potential_names: for basename in potential_names:
location = os.path.join(program_dir, sub_dir, basename) location = os.path.join(program_dir, sub_dir, basename)
if check_uri_exists(location): if os.path.isfile(location):
return location return location
# nothing found # nothing found
return None return None
......
...@@ -100,7 +100,7 @@ class RepetitionsFilter(logging.Filter): ...@@ -100,7 +100,7 @@ class RepetitionsFilter(logging.Filter):
# a clean style. # a clean style.
self._handler = handler self._handler = handler
self._suppressed_messages_counter = 0 self._suppressed_messages_counter = 0
self._cmp_len = 20 self._cmp_len = 30
self._delay = 3 self._delay = 3
def filter(self, record): def filter(self, record):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment