/[ascend]/trunk/pygtk/gtkbrowser.py
ViewVC logotype

Diff of /trunk/pygtk/gtkbrowser.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 857 by johnpye, Thu Sep 21 12:54:43 2006 UTC revision 858 by johnpye, Mon Sep 25 15:04:48 2006 UTC
# Line 140  class Browser: Line 140  class Browser:
140  #   ---------------------------------  #   ---------------------------------
141  #   SETUP  #   SETUP
142    
143      def __init__(self):      def __init__(self,librarypath=None,assetspath=None):
144    
145            if assetspath==None:
146                assetspath=config.PYGTK_ASSETS
147            if librarypath==None:
148                librarypath=config.LIBRARY_PATH
149    
150          #--------          #--------
151          # load the file referenced in the command line, if any          # load the file referenced in the command line, if any
152    
153          print_loading_status("Parsing options")          print_loading_status("Parsing options","CONFIG = %s"%config.VERSION)
154                    
155          parser = optparse.OptionParser(usage="%prog [[-m typename] file]", version="gtkbrowser $rev$" )          parser = optparse.OptionParser(usage="%prog [[-m typename] file]", version="gtkbrowser $rev$" )
156          # add options here if we want          # add options here if we want
# Line 157  class Browser: Line 163  class Browser:
163              ,action="store", type="string", dest="assets_dir"              ,action="store", type="string", dest="assets_dir"
164              ,help="override the configuration value for the location of assets"\              ,help="override the configuration value for the location of assets"\
165                  +" required by PyGTK for the ASCEND GUI, optional"                  +" required by PyGTK for the ASCEND GUI, optional"
166              ,default=config.PYGTK_ASSETS              ,default=assetspath
167          )          )
168    
169          parser.add_option("--library"          parser.add_option("--library"
170              ,action="store", type="string", dest="library_path"              ,action="store", type="string", dest="library_path"
171              ,help="override the configuration value for the library path"              ,help="override the configuration value for the library path"
172              ,default=None              ,default=librarypath
173          )          )
174    
175          parser.add_option("--no-auto-sim"          parser.add_option("--no-auto-sim"
# Line 196  class Browser: Line 202  class Browser:
202                    
203          if self.options.library_path != None:          if self.options.library_path != None:
204              _path = os.path.abspath(self.options.library_path)              _path = os.path.abspath(self.options.library_path)
205              _pathsrc = "commandline"              _pathsrc = "command line"
206              # when a special path is specified, use that as the file-open location              # when a special path is specified, use that as the file-open location
207              self.fileopenpath = _path              self.fileopenpath = _path
208          else:          else:
# Line 223  class Browser: Line 229  class Browser:
229          #-------------------          #-------------------
230          # Set up the window and main widget actions          # Set up the window and main widget actions
231    
232          self.glade_file = self.assets_dir+config.GLADE_FILE          self.glade_file = os.path.join(self.assets_dir,config.GLADE_FILE)
233    
234          print_loading_status("Setting up windows","GLADE_FILE = %s" % self.glade_file)          print_loading_status("Setting up windows","GLADE_FILE = %s" % self.glade_file)
235    
# Line 295  class Browser: Line 301  class Browser:
301          # Status icons          # Status icons
302    
303          self.fixedimg = gtk.Image()          self.fixedimg = gtk.Image()
304          self.fixedimg.set_from_file(self.options.assets_dir+'locked.png')          self.fixedimg.set_from_file(os.path.join(self.options.assets_dir,'locked.png'))
305    
306          self.iconstatusunknown = None          self.iconstatusunknown = None
307          self.iconfixed = self.fixedimg.get_pixbuf()          self.iconfixed = self.fixedimg.get_pixbuf()
# Line 411  class Browser: Line 417  class Browser:
417              _iconpath = ""              _iconpath = ""
418              try:              try:
419                  _icon = gtk.Image()                  _icon = gtk.Image()
420                  _iconpath = self.assets_dir+'ascend'+config.ICON_EXTENSION                  _iconpath = os.path.join(self.assets_dir,'ascend'+config.ICON_EXTENSION)
421                  _icon.set_from_file(_iconpath)                  _icon.set_from_file(_iconpath)
422                  _iconpbuf = _icon.get_pixbuf()                  _iconpbuf = _icon.get_pixbuf()
423                  self.window.set_icon(_iconpbuf)                  self.window.set_icon(_iconpbuf)

Legend:
Removed from v.857  
changed lines
  Added in v.858

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22