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
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.
* 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
(DBFrame.conns_changed): Fix doc-string (DBFrame.OnAdd): Use the new MatchesParameters method when looking for existing connections with the same parameters and break out of the loop correctly.
* 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.
* 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
(DBPwdDlg): Removed because it's not used. (DBFrame.OnEdit): Removed because it's not used and wouldn't work at the moment. The functionality should probably be implemented some time, though.
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.
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
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 |