Parent Directory
|
Revision Log
Sticky Revision: |
made a copy
2006-09-18 Didrik Pinte <dpinte@itae.be> * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6
* Thuban/UI/application.py: Fixed warning dialog when gdal is missing. * Fixed Changelog a bit.
(ThubanApplication.OnInit): Add the initialization of the extensions. (ThubanApplication.init_extensions): Init all extensions.
Alternative Path feature: * test/test_load.py (TestAltPath): New, tests for alternative path feature in load_session() (Shapefile_CallBack): Helper, implements controllable callback. * Thuban/UI/application.py (ThubanApplication.OnInit): Added "alt_path" to self.path (ThubanApplication.OpenSession): Added shapefile_callback as second callback similar to db_connection_callback. (ThubanApplication.run_alt_path_dialog): New, implementaion of shapefile_callback. In addition to raising the dialog the control of self.path('alt_path') is implemented here. * Thuban/Model/load.py (SessionLoader.__init__): Added shapefile_callback. (SessionLoader.open_shapefile): Open shapefile, eventually with alternative path. This wrapps the "theSession.OpenShapefile(filename)" formerly used in start_fileshapesource()/start_layer(). (SessionLoader.start_fileshapesource): Call open_shapefile(). (SessionLoader.start_layer): Call open_shapefile(). (load_session): Added shapefile_callback. * Thuban/UI/altpathdialog.py: New, implements dialogs for alternative path feature (search / check).
(ThubanApplication.OnInit): Make sure the mainwindow has a reference to the map of the initial session. This fixes a bug introduced with the fix for RT#2245
Fix for RT#2245 * Thuban/UI/application.py (ThubanApplication.OnInit): Initialize instance variables before trying to create any windows. Creating windows can start an event loop if e.g. message boxes are popped up for some reason, and event handlers, especially EVT_UPDATE_UI may want to access things from the application. (ThubanApplication.maps_changed): The mainwindow may not have been created yet, so check whether it has been created before calling its methods * Thuban/UI/view.py (MapCanvas.OnIdle): Only try to redraw if we have a map
Make Thuban remember path selections (at least for one application run). * Thuban/UI/application.py (Application.OnInit): Initialize path as a attribute of application object. Path is a dictionary of strings, currently with the items "data" and "projection". (Application.SetPath): New, stores path for the specified item. (Application.Path): New, return path for the specified item. * Thuban/UI/mainwindow.py (MainWindow.OpenSession, MainWindow.SaveSessionAs, MainWindow.AddLayer, MainWindow.AddRasterLayer, MainWindow.TableOpen): Access "data" path information of the application. * Thuban/UI/projdialog.py (ProjFrame._OnImport, ProjFrame._OnExport): Access "projection" path information of the application.
(ThubanApplication.ShowExceptionDialog): Handle translation of the dialog message properly
(ThubanApplication.maps_changed): Add doc-string
(ThubanApplication.ShowExceptionDialog): Made strings available to translations. Exchanged the simple ScrolledMessageDialog by the new ExceptionDialog.
(ThubanApplication.run_db_param_dialog): New. Suitable as a db_connection_callback. Main difference is that the dialog run from this method doesn't have a parent so it can be used even when there is no main window (ThubanApplication.OpenSession): Use self.run_db_param_dialog if no db_connection_callback was given. This way the dialog pops up even when the .thuban file was given as a command line parameter.
(ThubanApplication.OpenSession): Catch LoadCancelled exceptions and handle them by returning immediately.
* Thuban/UI/dbdialog.py (DBDialog): Reimplement to make it look a bit nucer and be more generic. (DBFrame.OnAdd): Adapt to new DBDialog interface * Thuban/UI/application.py (ThubanApplication.OpenSession): New optional parameter db_connection_callback which is passed to load_session. * Thuban/UI/mainwindow.py (MainWindow.run_db_param_dialog): New. Suitable as a db_connection_callback (MainWindow.OpenSession): Use self.run_db_param_dialog as the db_connection_callback of the application's OpenSession method
Make sure translated strings are recognized as one string literal.
(ThubanApplication.ShowExceptionDialog): Put back this method and remove the equivalent function since we are setting the exception hook from within this class (OnInit).
(ThubanApplication.OnInit): set the python exception hook here so that we are sure to catch any Thuban exception that happen during initialization.
(ThubanApplication.ShowExceptionDialog): Removed and called it show_exception_dialog() so that the exception handler can be set before the class is created.
(ThubanApplication.ShowExceptionDialog): Port exception dialog from GREAT-ER. Fixes RTbug #1993.
(ThubanApplication.OpenSession): Display a message box if the gdal library is not available, but only if there are any layers that would use it. Addresses RTbug #1877.
(ThubanApplication.read_startup_files): Use get_application_dir.
(ThubanApplication.read_startup_files): Guess location of .thuban directory from tempdir parent directory.
(ThubanApplication.CreateMainWindow): Make initial window size 600x400. Fixes RTBug #1872.
Next step of table implementation. Introduce a transient database using SQLite that some of the data is copied to on demand. This allows us to do joins and other operations that require an index for good performance with reasonable efficiency. Thuban now needs SQLite 2.8.0 and pysqlite 0.4.1. Older versions may work but I haven't tested that. * Thuban/Model/transientdb.py: New. Transient database implementation. * test/test_transientdb.py: New. Tests for the transient DB classes. * Thuban/Model/session.py (AutoRemoveFile, AutoRemoveDir): New classes to help automatically remove temporary files and directories. (Session.__init__): New instance variables temp_dir for the temporary directory and transient_db for the SQLite database (Session.temp_directory): New. Create a temporary directory if not yet done and return its name. Use AutoRemoveDir to have it automatically deleted (Session.TransientDB): Instantiate the transient database if not done yet and return it. * Thuban/Model/data.py (ShapefileStore.__init__): Use an AutoTransientTable so that data is copied to the transient DB on demand. (SimpleStore): New class that simply combines a table and a shapefile * Thuban/Model/table.py (Table, DBFTable): Rename Table into DBFTable and update its doc-string to reflect the fact that this is only the table interface to a DBF file. Table is now an alias for DBFTable for temporary backwards compatibility. * Thuban/UI/application.py (ThubanApplication.OnExit): Make sure the last reference to the session goes away so that the temporary files are removed properly. * test/test_load.py (LoadSessionTest.tearDown): Remove the reference to the session to make sure the temporary files are removed.
(ThubanApplication.MainLoop): Removed. In wxPython 2.4 there's no need to extend MainLoop anymore since wxPython itself makes sure OnExit is called.
* Thuban/__init__.py (_): Implement the translation function for real using the python gettext module. * Thuban/UI/classifier.py (ClassTable.GetRowLabelValue): Don't translate empty strings. * Thuban/UI/application.py (ThubanApplication.read_startup_files): Add a missing space to a warning message * po/README: New. Notes about the management of the translation files. * po/Makefile: New. Makefile to help manage the translation files. * po/es.po: New. Spanish translation by Daniel Calvelo Aros * MANIFEST.in: Include the *.mo files in Resources/Locale and the translations and support files in po/ * setup.py (data_files): Add the *.mo files to the data_files too * README: Add note about the translations when building from CVS
(ThubanApplication.OpenSession): Make sure the filename is absolute to avoid problems when saving the session again
Implement multiple selected shapes * Thuban/UI/selection.py: New module with a class to represent the selection. * Thuban/UI/messages.py (SELECTED_TABLE, SELECTED_MAP): Remove these unused messages * Thuban/UI/application.py (ThubanApplication.OnInit) (ThubanApplication.OnExit, ThubanApplication.SetSession): The interactor is gone now. (ThubanApplication.CreateMainWindow): There is no interactor anymore so we pass None as the interactor argument for now for compatibility. * Thuban/UI/view.py (MapCanvas.delegated_messages) (MapCanvas.Subscribe, MapCanvas.Unsubscribe): In Subscribe and Unsubscribe, delegate messages according to the delegated_messages class variable. (MapCanvas.__getattr__, MapCanvas.delegated_methods): Get some attributes from instance variables as described with the delegated_methods class variable. (MapCanvas.__init__): New instance variable selection holding the current selection (MapCanvas.do_redraw): Deal with multiple selected shapes. Simply pass them on to the renderer (MapCanvas.SetMap): Clear the selection when a different map is selected. (MapCanvas.shape_selected): Simple force a complete redraw. The selection class now takes care of only issueing SHAPES_SELECTED messages when the set of selected shapes actually does change. (MapCanvas.SelectShapeAt): The selection is now managed in self.selection * Thuban/UI/mainwindow.py (MainWindow.delegated_messages) (MainWindow.Subscribe, MainWindow.Unsubscribe): In Subscribe and Unsubscribe, delegate messages according to the delegated_messages class variable. (MainWindow.delegated_methods, MainWindow.__getattr__): Get some attributes from instance variables as described with the delegated_methods class variable. (MainWindow.__init__): The interactor as ivar is gone. The parameter is still there for compatibility. The selection messages now come from the canvas. (MainWindow.current_layer, MainWindow.has_selected_layer): Delegate to the the canvas. (MainWindow.LayerShowTable, MainWindow.Classify) (MainWindow.identify_view_on_demand): The dialogs don't need the interactor parameter anymore. * Thuban/UI/tableview.py (TableFrame.__init__) (LayerTableFrame.__init__, LayerTableFrame.OnClose) (LayerTableFrame.row_selected): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. Subscribe to SHAPES_SELECTED instead of SELECTED_SHAPE * Thuban/UI/dialogs.py (NonModalDialog.__init__): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. * Thuban/UI/classifier.py (Classifier.__init__): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. * Thuban/UI/tree.py (SessionTreeView.__init__): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. (SessionTreeCtrl.__init__): New parameter mainwindow which is stored as self.mainwindow. The mainwindow is need so that the tree can still subscribe to the selection messages. (SessionTreeCtrl.__init__, SessionTreeCtrl.unsubscribe_all) (SessionTreeCtrl.update_tree, SessionTreeCtrl.OnSelChanged): The selection is now accessible through the mainwindow. Subscribe to SHAPES_SELECTED instead of SELECTED_SHAPE * Thuban/UI/identifyview.py (IdentifyView.__init__): Use the SHAPES_SELECTED message now. (IdentifyView.selected_shape): Now subscribed to SHAPES_SELECTED, so deal with multiple shapes (IdentifyView.__init__, IdentifyView.OnClose): The interactor is gone. It's job from the dialog's point of view is now done by the mainwindow, i.e. the parent. * Thuban/UI/renderer.py (ScreenRenderer.RenderMap): Rename the selected_shape parameter and ivar to selected_shapes. It's now a list of shape ids. (MapRenderer.draw_label_layer): Deal with multiple selected shapes. Rearrange the code a bit so that the setup and shape type distinctions are only executed once.
Use True instead of true.
Changed SESSION_CHANGED to SESSION_REPLACED.
(ThubanApplication.OnInit): Call the new splash_screen method to determine whether the application should display a splash screen. If it displays a splash screen do not immediately show the main window. (ThubanApplication.splash_screen): New method to create a splash screen. (ThubanApplication.ShowMainWindow): New. Show the main window. Needed so the splash screen can display the mainwindow
Replace user string by _() for i18n.
(ThubanApplication.OnExit): Do some cleanup. (ThubanApplication.MainLoop): Extend to automatically call OnExit.
(ThubanApplication.create_session): Extend the doc string. (ThubanApplication.subscribe_session) (ThubanApplication.unsubscribe_session): New methods to subscribe/unsubscribe to/from session channels. (ThubanApplication.SetSession): Call the new methods here. (ThubanApplication.maps_changed, ThubanApplication.set_map): Renamed set_map to maps_changed. Its now a subscriber for MAPS_CHANGED.
* Thuban/UI/mainwindow.py (MainWindow.__init__): Change the parameter list a bit to allow setting the window title and the initial message in the status bar. Update the callers. * Thuban/UI/application.py (ThubanApplication.OnInit) (ThubanApplication.CreateMainWindow): Put the mainwindow instantiation into a separate method so that it can be overridden by a subclass.
* Thuban/UI/application.py (ThubanApplication.OnInit): Instantiate the main window with self.
* Thuban/UI/application.py (ThubanApplication.SetSession): Add doc-string (ThubanApplication.Session): New method to return the session object
* Thuban/UI/application.py: Don't use "import from" for the MainWindow. It can't always be resolved. (ThubanApplication.OnInit): change reference to MainWindow accordingly.
* Thuban/UI/application.py (ThubanApplication.OnInit): Read the startup file (ThubanApplication.read_startup_files): New method to run ~/.thuban/thubanstart.py
Create the session tree view in main with the new mainwindow method ShowSessionTree and not directly the application's OnInit method
Use the new argument to the MainWindow constructor to get rid of the ugly hack that made main.app available early just so that the mapcanvas could access the interactor object.
import all the source files
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |