[Qgis-developer] Question about changing some code from QgisAppto QGgsDbSourceSelect

Hugentobler Marco marco.hugentobler at karto.baug.ethz.ch
Fri Oct 19 15:57:52 EDT 2007


Hi Godofredo

>I was thinking to create the selected layers of one database when pressing the
>add button in QGgsDbSourceSelect. Because the gui elements of dialog will be
>the same to postgres databases and ogr databases, I was also thinking in add
>a disconnect button to  close the actual connection being able to choose another
>connection, maybe of different type and populate again the list of tables, being
>possible to add another set of tables without closing the dialog.

Hm, but if a user just adds layers from one database, he needs to press the close button for the dialog to disappear? In my opinion, it gets less usable for the case where only one database is added. And the one database case happens probably more often than the several database case. Also, it would not be consistent with the behaviour of the dialogs to add ogr file layers and raster layers any more. I'm therefore in favour to keep the current behaviour of the database dialog that disappears after adding layers from one database. 

>This is the how postgres vector is added actually.

Currently, postgres provider is hardcoded in QGisApp::addDatabaseLayer instead taken from the dialog. But yes, it is similar to current situation.

Regards,
Marco

-----Ursprüngliche Nachricht-----
Von: godofredo contreras [mailto:frdcn at hotmail.com]
Gesendet: Fr 19.10.2007 17:37
An: Hugentobler  Marco
Cc: qgis-developer at lists.qgis.org
Betreff: RE: [Qgis-developer] Question about changing some code from QgisAppto QGgsDbSourceSelect
 

Hi Marco:

> >thinking in usability  it will be better if we
> >could add multiple  database  layers  without needing to close and reopen  
> QGgsDbSourceSelect
> 
> It is possible to add multiple tables from one database by selecting and 
> holding the ctrl key pressed. Or do you mean to add layers from multiple 
> databases with one dialog? If yes, how do you intend to change the gui 
> elements in the dialog?

I was thinking to create the selected layers of one database when pressing the
add button in QGgsDbSourceSelect. Because the gui elements of dialog will be
the same to postgres databases and ogr databases, I was also thinking in add
a disconnect button to  close the actual connection being able to choose another
connection, maybe of different type and populate again the list of tables, being
possible to add another set of tables without closing the dialog.
 
> >What do you think about this change, or it could be better to add the code to 
> manage ogr database layers
> >in  QgisApp::addDatabaseLayer()?
> 
> Maybe QgsDbSourceSelect should just give back a list of urls and provider 
> strings and QgisApp::addDatabaseLayer() just create the vector layers with 
> this information. That way, the assembly of the database urls for postgres- 
> or ogr-database layers could happen inside QGgsDbSourceSelect class. Does 
> that make sense?
> 
This is the how postgres vector is added actually.


_________________________________________________________________
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us




More information about the Qgis-developer mailing list