Parent Directory
|
Revision Log
Sticky Revision: |
made a copy
2007-01-06 Didrik Pinte <dpinte@itae.be> UTF-8 locales support reading non utf-8 files. This is a workaround and not a real bugfix. See http://wald.intevation.org/tracker/index.php?func=detail&aid=118 for more details * Thuban/UI/ tableview.py, controls.py, baserenderer.py, view.py: decode text from iso-8859-1 encoding.
2006-09-18 Didrik Pinte <dpinte@itae.be> * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6
More wxPython 2.5 changes. This time taken from a patch from Daniel Calvelo Aros. * Thuban/UI/tableview.py (QueryTableFrame.__init__) (QueryTableFrame.__init__): Pass the size of a spacer as a single item. * Thuban/UI/projdialog.py (ProjFrame.build_dialog) (ProjFrame.build_dialog): Pass the size of a spacer as a single item. * Thuban/UI/dbdialog.py (ChooseDBTableDialog.__init__): Pass the size of a spacer as a single item. * Thuban/UI/classifier.py (Classifier.dialog_layout): Pass the size of a spacer as a single item.
(TableGrid.OnDestroy) (TableGrid.__init__): Handle EVT_WINDOW_DESTROY in the grid to unsubscribe all subscribers. (LayerTableFrame.OnDestroy): Do not unsubscribe any messages from self.grid since it may already have been destroyed. Fixes RT #2256
(TableFrame.OnDestroy, LayerTableFrame.OnDestroy): New. Unsubscribe the messages here not in OnClose because that might get called multiple times. Fixes RT #2196 (TableFrame.OnClose, LayerTableFrame.OnClose): Removed. Not needed anymore.
Make the table interface distinguish between row ids (an integer that uniquely identifies a row) and row ordinals (a simple row count from 0 to NumRows() - 1) * Thuban/Model/postgisdb.py (PostGISTable.RowIdToOrdinal) (PostGISTable.RowOrdinalToId): New methods to conver between row ids and row ordinals (PostGISTable.ReadRowAsDict, PostGISTable.ReadValue): New keyword parameter row_is_ordinal to indicate whether the row parameter is the row id or the ordinal * Thuban/Model/transientdb.py (TransientTableBase.RowIdToOrdinal) (TransientTableBase.RowOrdinalToId) (AutoTransientTable.RowIdToOrdinal) (AutoTransientTable.RowOrdinalToId): Same new methods as in PostGISTable. (TransientTableBase.ReadRowAsDict, TransientTableBase.ReadValue) (AutoTransientTable.ReadRowAsDict, AutoTransientTable.ReadValue): Same new parameter as in PostGISTable. * Thuban/Model/table.py (DBFTable.RowIdToOrdinal) (DBFTable.RowOrdinalToId, MemoryTable.RowIdToOrdinal) (MemoryTable.RowOrdinalToId): Same new methods as in PostGISTable. (DBFTable.ReadValue, DBFTable.ReadRowAsDict) (MemoryTable.ReadValue, MemoryTable.ReadRowAsDict): Same new parameter as in PostGISTable. * Thuban/UI/tableview.py (DataTable.RowIdToOrdinal) (DataTable.RowOrdinalToId): New methods to convert between row ids and row ordinals. (TableGrid.SelectRowById): New method to select a row based on its ID as opposed to its ordinal (DataTable.GetValue, TableGrid.OnRangeSelect) (TableGrid.OnSelectCell, LayerTableGrid.select_shapes) (QueryTableFrame.OnQuery, QueryTableFrame.get_selected) (LayerTableFrame.__init__): Convert between row ids and row ordinals as appropriate * test/postgissupport.py (PostGISDatabase.__init__): Add doc-string. (PostGISDatabase.initdb): The optional third item in a tuple in tables is now a (key, value) list with additional arguments to pass to upload_shapefile (upload_shapefile): New parameter gid_offset to allow gids that are not the same as the shapeids in the shapefile (PostgreSQLServer.get_default_static_data_db): Use the new gid_offset to make the gids in landmarks 1000 higher than the shapeids in the shapefile * test/test_viewport.py (TestViewportWithPostGIS.test_find_shape_at_point): Adapt to the new shapeids in the landmarks table * test/test_transientdb.py (TestTransientTable.run_iceland_political_tests) (TestTransientTable.test_transient_joined_table): Add tests for the new table methods and new keywords arguments. * test/test_postgis_db.py (TestPostGISTable.test_read_row_as_dict_row_count_mode) (TestPostGISTable.test_read_value_row_count_mode) (TestPostGISTable.test_row_id_to_ordinal) (TestPostGISTable.test_row_oridnal_to_id): New test for the new table methods and the new arguments (TestPostGISShapestorePoint.test_shapes_in_region) (TestPostGISShapestorePoint.test_shape_raw_data) (TestPostGISShapestorePoint.test_shape_points) (TestPostGISShapestorePoint.test_shape_shapeid) (TestPostGISShapestorePoint.test_all_shapes) (TestPostGISTable.test_simple_query) (TestPostGISTable.test_simple_query) (TestPostGISTable.test_simple_query) (TestPostGISTable.test_read_value) (TestPostGISTable.test_read_row_as_dict): Adapt to the new shapeids in the landmarks table * test/test_memory_table.py (TestMemoryTable.test_read_row_as_dict_row_count_mode) (TestMemoryTable.test_read_value_row_count_mode) (TestMemoryTable.test_row_id_to_ordinal) (TestMemoryTable.test_row_oridnal_to_id): New test for the new table methods and the new arguments * test/test_dbf_table.py (TestDBFTable.test_read_row_as_dict_row_count_mode) (TestDBFTable.test_read_value_row_count_mode) (TestDBFTable.test_row_id_to_ordinal) (TestDBFTable.test_row_oridnal_to_id): New test for the new table methods and the new arguments
(QueryTableFrame.__init__): Add an Export Selection button and move the export buttons underneath the table. (QueryTableFrame.UpdateStatusText): Added event argument so that it can respond to grid selection events. The status text is now updated even when the table is not associated with a layer as was previously assumed. (QueryTableFrame.OnGridSelectRange, OnGridSelectCell): Removed. UpdateStatusText responds to these events. (QueryTableFrame.OnSaveAs): Renamed to doExport. (QueryTableFrame.doExport): Helper function that saves the entire table, or selected rows, to a file. (QueryTableFrame.OnExport, QueryTableFrame.OnExportSel): New. Respond to export button events and call doExport.
Use Thuban[Begin|End]BusyCursor() instead of a direct call to wx[Begin|End]CusyCursor().
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
(TableFrame.__init__): Add a panel object that can be used by derived classes to place any controls (including the grid) onto. (QueryTableFrame.__init__): Use the panel as the parent window for all the controls. Reparent the grid so that the panel is the parent. Call UpdateStatusText() to correctly initialize the status bar.
(TableGrid.__init__): Create an instance variable to keep track of how many rows are selected. Subscribe once to the the events we are interested in. (ThubanGrid.OnRangeSelect): Only handle event if event handling hasn't been turned off. (ThubanGrid.OnSelectCell): Only handle event if event handling hasn't been turned off. (ThubanGrid.ToggleEventListeners): Rather than subscribe None as an event listener (which changes the event handler stack) simply set an instance variable to False. This is checked in the event handlers. (ThubanGrid.GetNumberSelected): Return the number of currently selected rows. (TableFrame): Inherit from ThubanFrame so we can have a status bar and control buttons. (QueryTableFrame.__init__): Create a status bar. Fixes RTbug #1942. Explicitly set which items are selected in the operator choice and action choice so there is always a valid selection. Fixes RTbug #1941. Subscribe to grid cell selection events so we can update the status bar. (QueryTableFrame.UpdateStatusText): Update the status bar with how many rows are in the grid, how many columns, and how many rows are selected. (QueryTableFrame.OnGridSelectRange, QueryTableFrame.OnGridSelectCell): Call UpdateStatusText when cells are (de)selected. (QueryTableFrame.OnQuery): Use the string value in the value combo if either the selected item index is 0 or if the string cannot be found in the predefined list (this happens if the user changes the text). Fixes RTbug #1940. Only turn off the grid event listeners if there a query comes back with a none empty list of ids. in the case that the list is empty this causes a grid.ClearSelection() call to actually clear the grid selection which causes the selected items in the map to be deselected. Fixes RTbug #1939.
(LayerTableFrame.__init__): Subscribe to the messages MAP_LAYERS_REMOVED messages (LayerTableFrame.OnClose): Unsubscribe from it. (LayerTableFrame.map_layers_removed): New. Receiver for MAP_LAYERS_REMOVED. Close the dialog when the layer whose the dialog is showing is removed.
(QueryTableFrame.OnQuery): Wrap code with try/finally. Fixes RTBug #1904.
(LayerTableFrame.OnClose): Bug-fix: Now unsubscribes all that is subcribed in __init__.
(NullRenderer.Draw): New. Our own renderer so that NULL/None values get displayed differently (by a gray rectangle). (TableGrid.__init__): Override the default renderers
* 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.
(QueryTableFrame.__init__): The "_S_election" display has some unwanted side effects. Removed again.
Dialog derived from NonModalNonParentDialog
(QueryTableFrame.__init__): Underline the "S" of selection box label to hint on hot key (Alt-S). Works under Win32 but is ignored under GTK.
Replace the true/false of wxWindows by True/False of Python 2.2.1.
(LayerTableFrame.__init__): If there is already a selection present, update the grid accordingly.
(QueryTableFrame.OnSaveAs): Call table_to_dbf or table_to_csv depending on file selection.
(LayerTableFrame, QueryTableFrame): Split the class LayerTableFrame into two classes, LayerTableFrame and QueryTableFrame. The latter implements the selection GUI without dependency on a layer. LayerTableFrame now is derived from QueryTableFrame and connects to a layer.
(LayerTableFrame.__init__): Rename 'Save As' Button to 'Export'. Center Buttons in Selection Box, set Focus to Grid. (LayerTableFrame.OnKeyDown()): New, bound to the grid with EVT_KEY_DOWN, changes focus to the Selection when pressing "Alt-S".
(TableGrid.__init__): Call ToggleEventListeners to turn on listening. (TableGrid.ToggleEventListeners): New. Turns event listening on and off so as to prevent excessive messages. (LayerTableFrame.OnQuery): Use TableGrid.ToggleEventListeners to suppress excessive messages when selecting many rows. Fixes RTBug #1880.
(LayerTableFrame.__init__): Change the Choices symbols to match those used in the table query method. Replace deprecated method calls on table with new method names.
(TableGrid.OnRangeSelect): Fix some issues with correctly selecting the rows and issuing the right events. Be sure to call Skip() to allow the grid to do some of its own handling which allows the rows to actually be selected. (LayerTableGrid.select_shapes): Rename from select_shape. Supports selecting multiple shapes. (LayerTableFrame): Support for building Queries. (LayerTableFrame.select_shapes): Allow multiple shapes to be selected.
(DataTable.SetTable, DataTable.GetValue): Adapt to new table interface
(TableGrid.disallow_messages) (TableGrid.allow_messages): New methods to make it possible to inhibit message sending. (TableGrid.issue): Only send the message if not inhibited. (LayerTableGrid.select_shape): Use the new methods to make sure that no ROW_SELECTED message is sent while we're updating the selected rows to match the selected shapes.
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.
(LayerTableGrid.select_shape): Remove a debug print
* 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
* Thuban/UI/tableview.py (TableGrid.__init__): Do not call AutoSizeColumns because it will cause a traversal of the entire table which for large .dbf files will take a very long time.
* Thuban/UI/tableview.py (TableGrid.__init__): Fix typo
* Thuban/UI/tableview.py: Add some doc-strings (TableGrid): (TableGrid.OnRangeSelect): (TableGrid.OnSelectCell): (TableFrame.__init__): (TableFrame.row_selected): Selecting rows in the grid view now updates the selected shapes through the TableFrame. To achieve this we derive TableGrid from Publisher and introduce the message type ROW_SELECTED which the TableFrame subscribes to and which is issued by OnRangeSelect and OnSelectCell (DataTable.SelectRow): Removed because it's no longer needed in the row/shape selection scheme
(TableGrid.__init__): Don't subscribe to the SELECTED_SHAPE message anymore. This is now handled by the parent. (TableGrid.select_shape): Only update the selection if the shape is not None. (TableFrame): Inherit from the new NonModalDialog class. (TableFrame.__init__, TableFrame.select_shape): Handle the SELECT_SHAPE message. (TableFrame.OnClose): Extend the inherited method to unsubscribe SELECT_SHAPE
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 |