/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/application.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/application.py

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

revision 2446 by frank, Mon Dec 13 11:52:34 2004 UTC revision 2700 by dpinte, Mon Sep 18 14:27:02 2006 UTC
# Line 1  Line 1 
1  # Copyright (C) 2001, 2002, 2003, 2004 by Intevation GmbH  # Copyright (C) 2001-2005 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jan-Oliver Wagner <[email protected]>  # Jan-Oliver Wagner <[email protected]>
4  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
# Line 17  import os.path Line 17  import os.path
17    
18  import traceback  import traceback
19    
20  from wxPython.wx import *  import wx
21    
22  from Thuban.Lib.connector import Publisher  from Thuban.Lib.connector import Publisher
23  from Thuban.Lib.fileutil import get_application_dir  from Thuban.Lib.fileutil import get_application_dir
# Line 30  from Thuban.Model.messages import MAPS_C Line 30  from Thuban.Model.messages import MAPS_C
30  from Thuban.Model.layer import RasterLayer  from Thuban.Model.layer import RasterLayer
31  import Thuban.Model.resource  import Thuban.Model.resource
32    
33    from extensionregistry import ext_registry
34    
35  import view  import view
36  import tree  import tree
37  import mainwindow  import mainwindow
# Line 40  import exceptiondialog Line 42  import exceptiondialog
42  from messages import SESSION_REPLACED  from messages import SESSION_REPLACED
43    
44    
45  class ThubanApplication(wxApp, Publisher):  class ThubanApplication(wx.App, Publisher):
46    
47      """      """
48      Thuban's application class.      Thuban's application class.
# Line 71  class ThubanApplication(wxApp, Publisher Line 73  class ThubanApplication(wxApp, Publisher
73          if self.splash is not None:          if self.splash is not None:
74              self.splash.Show()              self.splash.Show()
75          self.read_startup_files()          self.read_startup_files()
76            self.init_extensions()
77          self.top = self.CreateMainWindow()          self.top = self.CreateMainWindow()
78          # The session was alredy created above and we need to get the          # The session was alredy created above and we need to get the
79          # map into the mainwindow.  maps_changed does that.          # map into the mainwindow.  maps_changed does that.
# Line 122  class ThubanApplication(wxApp, Publisher Line 125  class ThubanApplication(wxApp, Publisher
125              # There's no .thuban directory              # There's no .thuban directory
126              sys.stderr.write(_("No ~/.thuban directory\n"))              sys.stderr.write(_("No ~/.thuban directory\n"))
127    
128        def init_extensions(self):
129            """Call initialization callbacks for all registered extensions."""
130            for ext in ext_registry:
131                ext.init_ext()
132    
133      def splash_screen(self):      def splash_screen(self):
134          """Create and return a splash screen.          """Create and return a splash screen.
135    
# Line 157  class ThubanApplication(wxApp, Publisher Line 165  class ThubanApplication(wxApp, Publisher
165          """          """
166          msg = (_("This is the wxPython-based Graphical User Interface"          msg = (_("This is the wxPython-based Graphical User Interface"
167                 " for exploring geographic data"))                 " for exploring geographic data"))
168          return mainwindow.MainWindow(NULL, -1, "Thuban", self, None,          return mainwindow.MainWindow(None, -1, "Thuban", self, None,
169                                       initial_message = msg,                                       initial_message = msg,
170                                       size = (600, 400))                                       size = (600, 400))
171    
# Line 246  class ThubanApplication(wxApp, Publisher Line 254  class ThubanApplication(wxApp, Publisher
254                      msg = _("The current session contains Image layers,\n"                      msg = _("The current session contains Image layers,\n"
255                              "but the GDAL library is not available to "                              "but the GDAL library is not available to "
256                              "draw them.")                              "draw them.")
257                      dlg = wx.wxMessageDialog(None,                      dlg = wx.MessageDialog(None,
258                                               msg,                                               msg,
259                                               _("Library not available"),                                               _("Library not available"),
260                                               wx.wxOK | wx.wxICON_INFORMATION)                                               wx.OK | wx.ICON_INFORMATION)
261                      print msg                      print msg
262                      dlg.ShowModal()                      dlg.ShowModal()
263                      dlg.Destroy()                      dlg.Destroy()
# Line 292  class ThubanApplication(wxApp, Publisher Line 300  class ThubanApplication(wxApp, Publisher
300                  dlg = altpathdialog.AltPathFileDialog(filename)                  dlg = altpathdialog.AltPathFileDialog(filename)
301                  fname = dlg.RunDialog()                  fname = dlg.RunDialog()
302                  if fname is not None:                  if fname is not None:
303                      self.SetPath('alt_path', fname)                          self.SetPath('alt_path', fname)
304                  from_list = 0                  from_list = 0
305              else:              else:
306                  fname = os.path.join(self.Path('alt_path'),                  fname = os.path.join(self.Path('alt_path'),
# Line 347  class ThubanApplication(wxApp, Publisher Line 355  class ThubanApplication(wxApp, Publisher
355          if self.in_exception_dialog:          if self.in_exception_dialog:
356              return              return
357          self.in_exception_dialog = 1          self.in_exception_dialog = 1
358          while wxIsBusy():          while wx.IsBusy():
359              wxEndBusyCursor() # reset the mouse cursor              wx.EndBusyCursor() # reset the mouse cursor
360    
361          try:          try:
362              lines = traceback.format_exception(exc_type, exc_value,              lines = traceback.format_exception(exc_type, exc_value,

Legend:
Removed from v.2446  
changed lines
  Added in v.2700

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26