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
Add a new dialog box for raster layers. The dialog box allows the user to toggle a mask that is generated by ProjectRasterFile and is used to only draw the real parts of the projected image.
Rework the status bar updates a bit to make sure the message about the projections is produced at the right times. * Thuban/UI/mainwindow.py (MainWindow.update_status_bar_messages): New class variable with messages that may require a status bar update. (MainWindow.view_position_changed) (MainWindow.update_status_bar): Rename from view_position_changed to update_status_bar. It's meaning has changed now that it may also generate messages about problems with projection settings. (MainWindow.__init__): Use the new update_status_bar_messages class variable to subscribe update_status_bar (MainWindow.set_position_text): Update doc-string. This method has to be renamed at some point. See doc-string and comments. (MainWindow.OnClose): Unsubscribe update_status_bar from all messages in update_status_bar_messages * Thuban/UI/viewport.py (ViewPort.forwarded_map_messages): New class attribute. map messages to be forwarded by the viewport. (ViewPort._subscribe_map, ViewPort._unsubscribe_map): (un)subscribe the messages in forwarded_map_messages
(view_position_changed): Made string available for i18n.
* Thuban/UI/mainwindow.py(view_position_changed): Added docstring and comment that the warning code here is a hack.
Warn user about misprojected layers when their lat/lon bounding box exceeds rational lat/lon values.
* Thuban/UI/mainwindow.py (MainWindow.DuplicateLayer): Fix indention bug.
BugFix 2901: Explicitly copy layers ClassificationColumn since it is not part of the layers Classification.
Utilise the new ClassMapper for global registration of properties dialog classes (which are indeed layer-specific).
Move the logic for checking whether a dialog is already opened (and raising it to the users attention) and creating a new dialog into a function of its own
The map can be retrieved through the parent which is passed to the constructor anyway and doesn't require an argument of its own, required for the unification of arguments for general use through properties-dialog selector.
New method commands: layer_to_top, layer_to_bottom, layer_visibility (MainWindow.LayerToTop): New. Put current layer to the top. (MainWindow.LayerToBottom): New. Put current layer to bottom. (MainWindow.HideLayer, MainWindow.ShowLayer, _has_visible_map): Replace 1,0 by True, False. (MainWindow.ToggleLayerVisibility): New. Toggle visibility of current layer. (MainWindow.LayerShowTable): Removed raising of dialog. (_has_selected_layer_visible): New. Support function.
(MainWindow.LayerShowTable): Added docstring. Now for layers without a ShapeStore a corresponding message is given to the user, that this layer has no table to show.
Raise the ShowTable() dialog/frame when the user attempts to display it while it has been opened before already and not closed again.
* Thuban/UI/dbdialog.py (ChooseDBTableDialog.__init__): Rework how the dialog is constructed. Add combo boxes to select id and geometry column. Rename some instance variables. (ChooseDBTableDialog.GetTable): Return id and geometry column names (ChooseDBTableDialog.OnTableSelect): New. Event handler for selections in the table list * Thuban/UI/mainwindow.py (MainWindow.AddDBLayer): Use id_column and geometry_column * Thuban/Model/session.py (Session.OpenDBShapeStore): Add the new parameters for id_column and geometry column of PostGISShapeStore here as well. * Thuban/Model/postgisdb.py (type_map): Add ROWID psycog type. (_raw_type_map): New. Map raw PostgreSQL type ints to thuban types (PostGISConnection.GeometryTables): Use a better query to determine which relations in the database might be usable for shapestores. Now supports views as well but is more PostgreSQL specific (PostGISConnection.table_columns): New. Somewhat experimental method to let the db dialogs provide lists of columns to users so that they can select id and geometry columns. (PostGISTable.__init__): The default value of the id_column parameter is now None it still means "gid" effectively, though. (PostGISTable.IDColumn): New introspection method to return a column object for the id column (PostGISShapeStore.GeometryColumn): New introspection method to return a column object for the geometry column * test/test_postgis_db.py (TestPostGISConnection.test_gis_tables_non_empty): Removed. Subsumed by the new: (TestPostGISConnection.test_gis_tables_with_views_and_tables): New. Tes the GeometryTables and table_columns methods with actual tables and views. (PointTests.test_id_column, PointTests.test_geometry_column): New. tests for the new methods. (TestPostGISShapestorePoint.setUp) (TestPostGISShapestorePointSRID.setUp) (TestPostGISShapestorePointExplicitGIDColumn.setUp): Fill the instance variables needed by the new tests
(MainWindow.AddDBLayer): When the layer can't be created, return immediately after displaying the error message.
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.
* Thuban/UI/join.py (JoinDialog.__init__): Mark one more string for translation * Thuban/UI/mainwindow.py (MainWindow.TableRename) (MainWindow.RenameMap, MainWindow.RenameLayer): Mark some more strings for translation * po/de.po: Update with the newly marked strings.
(MainWindow.has_selected_shape_layer): New. Like has_selected_layer but for shape layers only (_has_selected_shape_layer): New. Like _has_selected_layer but for shape layers only (layer_show_table command, layer_jointable command): Use these commands should only be available for shape layers
(MainWindow.Unsubscribe): Deal with publishers that are wx objects and may have been destroyed by wx already. Fixes RT #2242.
(MainWindow.AddLayer): Change the wild cards for the dialog so that shapefiles ending in all uppercase SHP are listed too
(MainWindow.__init__): Subscribe to the canvas' TITLE_CHANGED messages (MainWindow.update_title): New. Update the main window's title (MainWindow.__SetTitle): Removed. Use update_title instead. (MainWindow.SetMap): Use update_title instead of __SetTitle (MainWindow.RenameMap): Do change the window title explicitly here. That's handled in a proper MVC way now. (MainWindow.title_changed): New. Subscriber for the TITLE_CHANGED messages
* Thuban/UI/dbdialog.py (ChooseDBTableDialog.__init__): Change the parameter list to just parent and session (ChooseDBTableDialog.__set_properties): Removed. Setting the selection of empty list boxes is not allowed (and produces C++ assertion errors) and the rest of the setup is better done in __init__ anyway. (ChooseDBTableDialog.OnCancel, ChooseDBTableDialog.OnOK) (ChooseDBTableDialog.OnLBDClick, DBDialog.OnOK): Use the Python builtins True/False for booleans to avoid warnings from wxPython * Thuban/UI/mainwindow.py (MainWindow.AddDBLayer): Adapt to new ChooseDBTableDialog constructor parameters.
Remove some unused imports
* 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
(__ThubanVersion__): Remove this and replace it and the comment with __BuildDate__ by the Source: and Id: cvs keywords as used in the other files.
Make postgis support really optional including insensitive menu items. * Thuban/Model/postgisdb.py (has_postgis_support): New. Return whether the postgis is supported. * Thuban/UI/dbdialog.py: Put the psycopg import into try..except to make postgis support optional * Thuban/UI/mainwindow.py (_has_postgis_support): New. Context version of Thuban.Model.postgisdb.has_postgis_support (database_management command): Make it only sensitive if postgis is supported.
(MainWindow.AddLayer): Changed dialog settings to allow multiple files to load into the map. Also reduced selection to *.shp as a default.
Add dialogs and commands to open database connections and add database layers. * Thuban/UI/mainwindow.py (MainWindow.DatabaseManagement): New method to open the database connection management dialog (MainWindow.AddDBLayer): New method to add a layer from a database (_has_dbconnections): New helper function to use for sensitivity (database_management command, layer_add_db command): New commands that call the above new methods. (main_menu): Add the new commands to the menu. * Thuban/Model/postgisdb.py (PostGISConnection.__init__) (PostGISConnection.connect): Establish the actual connection in a separate method and call it in __init__. This makes it easier to override the behavior in test cases (PostGISConnection.BriefDescription): New method to return a brief description for use in dialogs. * test/test_postgis_db.py (NonConnection): DB connection that doesn't actually connect (TestBriefDescription): New class with tests for the new BriefDescription method
* Thuban/UI/messages.py (MAP_REPLACED): New message. * Thuban/UI/viewport.py (ViewPort.SetMap): Issue MAP_REPLACED after the new map has been assigned * Thuban/UI/mainwindow.py (MainWindow.delegated_messages): Delegate MAP_REPLACED to the canvas too (MainWindow.prepare_new_session): Removed. Thanks to the new MAP_REPLACED message it's no longer needed (MainWindow.OpenSession, MainWindow.NewSession): prepare_new_session has been removed. * Thuban/UI/classifier.py (Classifier.__init__): Subscribe to MAP_REPLACED so that we can close the dialog if a new map is set. (Classifier.unsubscribe_messages): Unsubscribe from MAP_REPLACED (Classifier.map_replaced): Handle MAP_REPLACED by closing the dialog * test/test_viewport.py (SimpleViewPortTest) (SimpleViewPortTest.test_default_size): Add doc-strings (ViewPortTest.setUp): Bind map to self.map so we can use it in tests. Subscribe to MAP_REPLACED messages too. (ViewPortTest.tearDown): No need to explicitly unsubscribe (ViewPortTest.test_set_map): New test for the SetMap method.
(MainWindow.ToggleLegend): Don't fit the map to the window as this changes any zoom level that the user may have set.
(MainWindow.ShowTableView): Raise the table window when it is selectd to be shown.
(MainWindow.About): Call new About box in Thuban.UI.about.
Add blank line at the end because file was not being read correctly building the Windows distribution.
(MainWindow.About): Fix text.
(MainWindow.__init__): Call ShowLegend().
Update to the layer interface: Direct access to the table, shapetable, shapefile and filename attributes is now actively deprecated by issuing deprecation warnings for all places where this happens. * Thuban/Model/layer.py (Layer.__getattr__): New. Implement access to the instance variables table, shapetable, shapefile and filename via __getattr__ so that we can issue a deprecation warning. (Layer.SetShapeStore): Don't set the deprecated instance variables any more (Layer.SetShapeStore): Don't use deprecated layer instance variables (Layer.Destroy): No need to explicitly remove the instance variables any more (Layer.GetFieldType, Layer.Shape): Don't use deprecated layer instance variables * Thuban/UI/classgen.py (ClassGenDialog.__init__) (GenUniformPanel._OnRetrieve, GenUniquePanel._OnRetrieve) (GenQuantilesPanel.GetList, GenQuantilesPanel.OnRetrieve): Don't use deprecated layer instance variables * Thuban/UI/classifier.py (Classifier.__init__): Don't use deprecated layer instance variables * Thuban/UI/identifyview.py (IdentifyListCtrl.selected_shape) (IdentifyGridCtrl.selected_shape): Don't set the deprecated layer instance variables * Thuban/UI/tableview.py (LayerTableGrid.select_shapes): Don't use deprecated layer instance variables * Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Don't use deprecated layer instance variables * Thuban/Model/save.py (SessionSaver.write_layer): Don't use deprecated layer instance variables * Thuban/UI/renderer.py (MapRenderer.draw_shape_layer) (MapRenderer.polygon_render_param): Don't use deprecated layer instance variables * test/runtests.py (main): Turn Thuban's deprecation warnings into errors so that they're cought by the tests * test/test_load.py (TestSingleLayer.test): Don't use deprecated layer instance variables
(_has_gdal_support): New. Used to determine if the "Add Image Layer" menu option should be greyed out or not. Addresses RTbug #1877.
import wxMultipleChoiceDialog from multiplechoicedialog.py rather than from the wxPython library.
* Thuban/Model/messages.py (LAYER_SHAPESTORE_REPLACED): New message. * Thuban/Model/layer.py (Layer.SetShapeStore): Send LAYER_SHAPESTORE_REPLACED when the shapestore changes. A LAYER_CHANGED will still be sent if the classification changes. * Thuban/UI/classifier.py (Classifier.__init__): Add the map as parameter so we can subscribe to some of its messages (Classifier.__init__): Subscribe to the map's MAP_LAYERS_REMOVED and the layer's LAYER_SHAPESTORE_REPLACED (Classifier.unsubscribe_messages): New. Unsubscribe from message subscribed to in __init__ (Classifier.map_layers_removed) (Classifier.layer_shapestore_replaced): receivers for the messages subscribed to in __init__. Unsubscribe and close the dialog * Thuban/UI/mainwindow.py (MainWindow.OpenLayerProperties): Pass the map to the Classifier dialog * test/test_layer.py (SetShapeStoreTests): Derive from SubscriberMixin as well so we can test messages (SetShapeStoreTests.setUp): Subscribe to some of the layer's messages (SetShapeStoreTests.tearDown): Clear the messages again (SetShapeStoreTests.test_sanity): Expand the doc-string and check for the modified flag too (SetShapeStoreTests.test_set_shape_store_modified_flag): New test to check whether SetShapeStore sets the modified flag (SetShapeStoreTests.test_set_shape_store_different_field_name) (SetShapeStoreTests.test_set_shape_store_same_field) (SetShapeStoreTests.test_set_shape_store_same_field_different_type): Add tests for the messages. This checks both the new LAYER_SHAPESTORE_REPLACED and the older LAYER_CHANGED
Improved and partly added help texts for the menu items.
(layer_rename command, table_rename command): New commands. (main_menu): Add the new commands. (MainWindow.TableRename): New. Implementation of the table_rename command. (MainWindow.RenameLayer): New. Implementation of the layer_rename command.
(MainWindow.ToggleLegend): Apply a full extent to the map when the legend is toggled. Fixes RTBug #1881.
(MainWindow.DuplicateLayer) (MainWindow.CanDuplicateLayer): New methods to implement the Layer/Duplicate command. (layer_duplicate command): New. (main_menu): Add layer_duplicate to the Layer menu.
(MainWindow.TableClose, MainWindow.TableShow): sort the selection list for the dialog.
(_can_unjoin): Add doc-string and cope with layers that don't have shapestores, i.e. raster layers.
(MainWindow.TableShow) Added wxDEFAULT_DIALOG_STYLE to show table dialog styles.
* Thuban/UI/mainwindow.py (MainWindow.delegated_messages): Also delegate SelectedLayer. (MainWindow.LayerUnjoinTable): Implement. (_can_unjoin): New. Helper function for the sensitivity of the layer/unjoin command. * Thuban/Model/data.py (ShapefileStore.OrigShapeStore) (DerivedShapeStore.OrigShapeStore): New. Return the original shapestore. Used to figure out how to unjoin. (DerivedShapeStore.Shapefile): Fix a typo.
* Thuban/UI/join.py (JoinDialog): Extend to handle layer joins as well (JoinDialog.__init__): Use the layer parameter and only build the left choice when a layer is given (JoinDialog.OnJoin): Handle layer joins as well (JoinDialog.OnLeftTable, JoinDialog.OnRightTable): Handle the case that the user selects the "Select..." item. The sensitivitly updating is now in update_sensitivity (JoinDialog.y): New method to refactor the sensitivity update of the join button into its own method. * Thuban/UI/mainwindow.py (MainWindow.LayerJoinTable): Implement.
* Thuban/UI/mainwindow.py (table_close command): Make it sensitive iff there are unreferenced tables in the session
* Thuban/Model/messages.py (TABLE_REMOVED): New message. * Thuban/Model/session.py (Session.UnreferencedTables): New method to return tables that are not referenced by other tables or shape stores and can be removed. (Session.RemoveTable): Issue a TABLE_REMOVED message after removing the table * Thuban/UI/mainwindow.py: Remove unused imports (MainWindow.TableClose): Implement. * Thuban/UI/tableview.py (TableFrame.__init__): Subscribe to some messages so that the frame will be automatically closed when a new session is opened or the table is removed. (TableFrame.OnClose): Unsubscribe the Subscriptions made in __init__ (TableFrame.close_on_session_replaced) (TableFrame.close_on_table_removed): New. Subscribers that close the window * test/test_session.py (TestSessionMessages.test_remove_table) (TestSessionSimple.test_remove_table): Move the test to TestSessionSimple and add test for the TABLE_REMOVED message (TestSessionBase.setUp): Also subscribe to TABLE_REMOVED (TestSessionSimple.test_unreferenced_tables) New. Test for the UnreferencedTables method. (UnreferencedTablesTests): New. Class with some more sophisticated tests for UnreferencedTables.
(MainWindow.OnClose): Explicitly destroy all dialogs in the dialogs dictionary and the canvas.
(MainWindow.ShowTableView): New. Open a tableview dialog (MainWindow.TableShow): Use ShowTableView to open the dialogs. Also, don't use the table's titles as the dialog names. The titles aren't guaranteed to be unique. (MainWindow.TableOpen): Open a table view dialog after opening the table
Remove the Table/Hide menu item. Its effect can be achieved by simply closing the window showing the table. (MainWindow.TableHide): Removed. (main_menu): Removed "table_hide"
(MainWindow.TableOpen): Real implementation. Mark parts of the file format strings for localization.
Replace the true/false of wxWindows by True/False of Python 2.2.1.
(MainWindow.TableShow): Make the dialog resizeable and increase its initial size.
(MainWindow.LayerShowTable): Prefix the table window with 'Layer Table:' instead of 'Table:'.
(MainWindow.TableShow): A very coarse implementation that still needs work.
(MainWindow.TableJoin): Removed print.
(MainWindow.OnClose): Call DockFrame.OnClose, not DockFrame._OnClose.
(MainWindow.AddLayer): Move OpenShapefile into try block. AddLayer doesn't throw any exceptions anymore. (MainWindow.AddRasterLayer): Move constructor of RasterLayer into try block.
(MainWindow): Renamed _OnClose() back to OnClose() to keep in sync with extensions. Internally Thuban still uses "underscored" names.
(MainWindow.NewSession, MainWindow.OpenSession): Don't proceed with an action if the user chooses Cancel when they are asked to save changes. (MainWindow.AddRasterLayer): New. Open a dialog to allow the user to select an image file. Create a new RasterLayer and add it to the map.
Extended version information: Display Thuban, wxPython and Python version.
(MainWindow.ExportMap()): New. Added also new method_command to call ExportMap, with platform dependency (only __WXMSW__)
Add support for the Join Dialog. Added a Table menu and associated method calls. (MainWindow.choose_color): Removed. No longer needed.
Added new "Full selection extent" menu option. (MainWindow.has_selected_shapes): New. Returns true if there are any selected shapes. (MainWindow.FullSelectionExtent): New. Calls MapCanvas.FitSelectedToWindow() when the user selects the menu option. (_has_selected_shapes): New. Returns true if there are any selected shapes.
Added new "Full layer extent" menu option. (MainWindow.FullLayerExtent): New. Calls MapCanvas.FitLayerToWindow() when the user selects the menu option.
Add "..." to menu items that will open new dialogs.
Move menu item map_rename up.
(MainWindow.identify_view_on_demand): Do not pop up the dialog if the selection becomes empty (this could happen if e.g. a new selection is opened while the identify tool is active and dialog had been closed)
(MainWindow.SetMap): Look up the legend dialog box and tell it to change its map to the one supplied to SetMap(). Fixes RTbug #1770.
(MainWindow.SaveSessionAs): Dialog should be of type wxSAVE and should verify overwriting a file.
(MainWindow.MapProjection): Set the dialog title to include the map's title. (MainWindow.LayerProjection): Set the dialog title to include the layer's title.
Add a Projection option under the layer menu. (MainWindow.LayerProjection): New. Open up a projection window for a layer.
First step towards table management. Introduce a simple data abstraction so that we replace the data a layer uses more easily in the next step. * Thuban/Model/data.py: New file with a simple data abstraction that bundles shapefile and dbffile into one object. * Thuban/Model/session.py (Session.OpenShapefile): New method to open shapefiles and return a shape store object * Thuban/Model/layer.py (Layer.__init__): Pass the data as a store object instead of a shapefile filename. This introduces a new instance variable store holding the datastore. For intermediate backwards compatibility keep the old instance variables. (open_shapefile): Removed. No longer needed with the shape store. (Layer.SetShapeStore, Layer.ShapeStore): New methods to set and get the shape store used by a layer. (Layer.Destroy): No need to explicitly destroy the shapefile or table anymore. * Thuban/UI/mainwindow.py (MainWindow.AddLayer) (MainWindow.AddLayer): Use the session's OpenShapefile method to open shapefiles * Thuban/Model/load.py (ProcessSession.start_layer): Use the session's OpenShapefile method to open shapefiles * test/test_classification.py (TestClassification.test_classification): Use the session's OpenShapefile method to open shapefiles and build the filename in a more platform independed way * test/test_layer.py (TestLayer.setUp, TestLayer.tearDown): Implement to have a session to use in the tests (TestLayer.test_arc_layer, TestLayer.test_polygon_layer) (TestLayer.test_point_layer, TestLayer.test_empty_layer): Use the session's OpenShapefile method to open shapefiles (TestLayerLegend.setUp): Instantiate a session so that we can use it to open shapefiles. (TestLayerLegend.tearDown): Make sure that all references to layers and session are removed otherwise we may get a resource leak * test/test_map.py (TestMapAddLayer.test_add_layer) (TestMapWithContents.setUp): Instantiate a session so that we can use it to open shapefiles. (TestMapWithContents.tearDown): Make sure that all references to layers, maps and sessions are removed otherwise we may get a resource leak ("__main__"): use support.run_tests() so that more info about uncollected garbage is printed * test/test_save.py (SaveSessionTest.testSingleLayer): Use the session's OpenShapefile method to open shapefiles ("__main__"): use support.run_tests() so that more info about uncollected garbage is printed * test/test_selection.py (TestSelection.tearDown): Make sure that all references to the session and the selection are removed otherwise we may get a resource leak (TestSelection.get_layer): Instantiate a session so that we can use it to open shapefiles. ("__main__"): use support.run_tests() so that more info about uncollected garbage is printed * test/test_session.py (TestSessionBase.tearDown) (TestSessionWithContent.tearDown): Make sure that all references to the session and layers are removed otherwise we may get a resource leak (TestSessionWithContent.setUp): Use the session's OpenShapefile method to open shapefiles
(MainWindow.Projection): Use new projection dialog.
Remove some unused imports and global constants
Added new menu item and associated code to open a dialog to rename the map. (MainWindow): Use new resource class to import bitmaps.
MainWindow.OpenClassifier renamed to MainWindow.OpenLayerProperties. MainWindow.LayerEditProperties renamed to MainWindow.LayerEditProperties. (MainWindow.ToggleLegend): Don't include map name in legend title. (MainWindow.SetMap): Added the map name to the window title. (MainWindow.LayerFillColor, MainWindow.LayerTransparentFill, MainWindow.LayerOutlineColor, MainWindow.LayerNoOutline): Removed. Functionality is found in the layer properties dialog.
Import just the Classifier class.
(main_menu): Move the toggle_legend item to the map module
(MainWindow.ShowSessionTree): Removed in favor of ToggleSessionTree (MainWindow.ToggleSessionTree): New method to toggle visibility of the session tree. (MainWindow.SessionTreeShown): New method to return whether the session tree is currently shown. (MainWindow.ToggleLegend): New method to toggle visibility of the legend (MainWindow.ShowLegend): Implement in terms of ToggleLegend and LegendShown (MainWindow.LegendShown): New method to return whether the legend is currently shown. (_method_command): Add checked parameter so we can define check menu items (_has_tree_window_shown, _has_legend_shown): Use the appropriate mainwindow methods. (show_session_tree, show_legend commands): Removed. (toggle_session_tree, toggle_legend commands): New commands to toggle the visibility of the dialogs
Use False instead of false. (MainWindow.ShowLegend): Remove unnecessary switch parameter.
Put "Show Legend" and "Show Session Tree" into the same group.
Rename Color.None to Color.Transparent.
Renamed OnClose to _OnClose for symmetry with other such methods. (MainWindow.ShowLegend): Show the legend docked by default.
Removed legend specific code and replaced it with calls to the new dock code.
Added sash windows to the main window and supporting functions for manipulating the sashes. (MainWindow.ShowLegend): Create a DockableWindow with the LegendPanel as the contents.
New code to open the legend.
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.
About window shows version number.
Use True instead of true.
(MainWindow.prepare_new_session): Call Close() instead of Shutdown().
(MainWindow.prepare_new_session): Shuts down open dialogs. Used when a new session is created or a session is opened. (MainWindow.SaveSession): Should only call application.SaveSession() if we don't call SaveSessionAs first. (MainWindow.Classify): Allow different classifier dialogs for different layers.
Function name changes.
Use Layer.GetClassification() since the class attribute __classification is now private.
(MainWindow.OpenSession, MainWindow.SaveSessionAs): Text string changes so the dialogs have more meaningful titles.
* Thuban/UI/mainwindow.py (MainWindow): Use the SetDefault*() methods of the Classification class.
Replace user string by _() for i18n.
added 'Classify' option in 'Layer' menu
(MainWindow.update_command_ui): If an active tool's command turns insensitive, disable the tool. (_tool_command): Use the new ToolCommand class
Altered the order of tools in the toolbar: First now are all navigation tools (Zoom In/Out, Pan, Full Extent).
(MainWindow.About): Add 2002 to copyright notice.
(MainWindow.view_position_changed) (MainWindow.set_position_text): Put the code that puts the text with the mouse position into the status bar into the new method set_position_text so that it can overwritten in derived classes.
(MainWindow.RunMessageBox): Center the message box on the main window.
(MainWindow.build_menu): remove an incorrect comment.
Underline the 'x' in "Exit" instead of the 'E' because it's less likely to interfere with other menu entries.
(MainWindow.Map): New. (_tool_command): Add sensitive parameter (_has_visible_map): Sensitivity callback to tools and other commands that require a visible map. Use it in map_zoom_in_tool, map_zoom_out_tool, map_pan_tool, map_identify_tool, map_label_tool and map_full_extent
(MainWindow.OnClose): Unsubscribe VIEW_POSITION
(MainWindow.CanRemoveLayer): New method for the sensitivity of remove layer. (_can_remove_layer): New. Sensitivity callback for remove layer (Command layer_remove): Use _can_remove_layer
* Thuban/UI/mainwindow.py: Refactor the context creation: (MainWindow.Context): New method to return a context (MainWindow.invoke_command, MainWindow.update_command_ui): Use the new method
* Thuban/UI/tableview.py (TableGrid, LayerTableGrid): Split the layer table specific code from TableGrid into LayerTableGrid (TableFrame, LayerTableFrame): Split the layer table specific code from TableFrame into LayerTableFrame * Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Use the LayerTableFrame
(make_check_current_tool) (_tool_command): Put the code that generates the "checked" callback into a separate function so that we can reuse it elsewhere
menu item 'show session tree' now disable if tree window already open
(MainWindow.__init__): Turn the initial window size into a parameter.
* 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/mainwindow.py (MainWindow.__init__): Add application as parameter and store it in an instance variable (MainWindow.invoke_command, MainWindow.update_command_ui) (MainWindow.save_modified_session, MainWindow.NewSession) (MainWindow.OpenSession, MainWindow.SaveSession) (MainWindow.SaveSessionAs, MainWindow.ShowSessionTree): Use self's application object.
* Thuban/UI/mainwindow.py (MainWindow.invoke_command, MainWindow.update_command_ui): Pass an instance of the context class to the command's methods (check_current_tool, call_method): Handle the new context implementation
* Thuban/UI/mainwindow.py (MainWindow.bind_command_events): Bind the events for a comnmand. (MainWindow.add_toolbar_command, MainWindow.add_menu_command): Call bind_command_events to bind the events. add_toolbar_command can now bind events too so that it's possible to have commands that are only available through the toolbar. (MainWindow.init_ids): New instance variable events_bound to keep track of for which commands events have been bound.
* Thuban/UI/mainwindow.py (MainWindow.__init__, main_toolbar): Move the toolbar definition to the Menu instance main_toolbar. (MainWindow.build_toolbar): New method to build the toolbar similar to the build_menu methods
* Thuban/UI/mainwindow.py: Remove some unused imports. (MainWindow.__init__, main_menu): move the definition of the main menu from __init__ to the Menu instance main_menu. (MainWindow.build_menu_bar, MainWindow.build_menu): New methods to build the menu bar and sub-menus from a menu description.
* Thuban/UI/mainwindow.py (MainWindow.__init__): Fix spelling of layer_outline_color. Fix it in the definition of the command too.
* Thuban/UI/mainwindow.py (MainWindow.RunMessageBox): Fix a typo in the docstring
* Thuban/UI/mainwindow.py (MainWindow.__init__): Add the "Show Session Tree" command to the file menu.
* Thuban/UI/mainwindow.py (MainWindow.SaveSessionAs, MainWindow.OpenSession): Change the file extension of the session files to .thuban
* Thuban/UI/mainwindow.py (MainWindow.__init__): Subscribe to the canvas' VIEW_POSITION event (MainWindow.view_position_changed): Handler for VIEW_POSITION. Update the text in the status-bar accordingly.
AddLayer: Dialog title changed: s/session/data
removed old comments
added full-extent to toolbar; adapted proj4 call
launch save as dialog for saving new sessions
* Thuban/UI/mainwindow.py (MainWindow.__init__): Move the "Add Layer" and "Remove Layer" commands from the layer menu to the map menu
* Thuban/UI/mainwindow.py (MainWindow.NewSession): Use create_empty_session session to create the new, empty session. * Thuban/UI/mainwindow.py (MainWindow.__init__): Set the size of the tool bitmaps. (MainWindow.OnClose, MainWindow.save_modified_session): Separate the code that asks whether the session should be saved into the new method save_modified_session. (MainWindow.OpenSession, MainWindow.NewSession): Use the new method to save modified session here too.
(MainWindow.IdentifyTool): Popup the identify view immediately
* Thuban/UI/mainwindow.py (MainWindow.current_layer): (MainWindow.has_selected_layer): Simply call the appropriate interactor method * Thuban/UI/mainwindow.py (MainWindow.__init__): (MainWindow.LayerShowTable): (MainWindow.identify_view_on_demand): Store the interactor in an instvar and use that reference instead of going through main.app * Thuban/UI/mainwindow.py (MainWindow.ShowSessionTree): * Thuban/UI/application.py (ThubanApplication.OnInit): * Thuban/UI/main.py (main): Create the session tree view in main with the new mainwindow method ShowSessionTree and not directly the application's OnInit method
* Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Pass the layer to the tableview dialog.
* Thuban/UI/mainwindow.py (MainWindow.init_dialogs): (MainWindow.add_dialog): (MainWindow.dialog_open): (MainWindow.remove_dialog): (MainWindow.get_open_dialog): New methods to maintain a dictionary of opened non-modal dialogs. (MainWindow.__init__): Initialize the new non-modal dictionary management code (MainWindow.LayerShowTable): maintain separate dialogs for each table using the non-modal dialog management code to only open a view once for each table. (MainWindow.IdentifyTool): (MainWindow.__init__): (MainWindow.identify_view_on_demand): Don't open the identify view in IdentifyTool anymore. This will be done automatically by the new method identify_view_on_demand which handles the SELECTED_SHAPE message so that the identify view will be opened on demand
New argument interactor to pass through to the MapCanvas
* Thuban/UI/mainwindow.py (MainWindow.RunMessageBox): New method that runs a modal message box (MainWindow.OnClose): Use the new method (MainWindow.RemoveLayer): Just do nothing in case no layer is selected. The command should be grayed out anyway, so there's no need to pop up a message box. (MainWindow.AddLayer): Pop up a message box with an error message if the shape file can't be opened
* Thuban/UI/mainwindow.py (MainWindow.AddLayer): Fit the map to the window when the first layer is added to the map. * setup.py (ThubanInstall.run): Honor the build root (self.root) when linking thuban.py to <prefix>/bin
* Thuban/UI/mainwindow.py (MainWindow.update_command_ui): Call event.Check only if the command is actuall checkable. (MainWindow.__init__): Call the toolbar's Realize method to make sure that the items are actually shown
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 |