[Qgis-developer] keeping layer settings tab between layers and qgis sessions can cause problems when histogram tab is the last viewed

G. Allegri giohappy at gmail.com
Thu May 10 00:09:48 PDT 2012


Etienne, I don't think it's a good design to introduce such rules inside
the code (switching ti the first tab in case the remembered tab is the
histogram's).
Having the user to explicitely force the reload of the histogram is what I
would expect to find inside the tab... Maybe with the option, through
settings, to ask for the histogram to be loaded automatically...

giovanni

2012/5/10 Nathan Woodrow <madmanwoo at gmail.com>

> Generally it is good practice that the UI remembers where the user left it
> last time.  In this case this has a bad user experience because of the slow
> loading.  My suggestion would be to just add a "Load histogram" button in
> the histogram tab that loads the histogram rather then when the tab is
> switched to.  This way even if the histogram tab is remembered as the
> current tab it will load like normal and user has to click "Load histogram"
> to show it.
>
> - Nathan
>
>
> On Thu, May 10, 2012 at 10:49 AM, Etienne Tourigny <
> etourigny.dev at gmail.com> wrote:
>
>> I agree that this should not happen, should the default be always open
>> the first tab, or only when the histogram tab was previously selected?
>>
>> Unfortunately there is no function in the provider API to know if
>> there is a cached histogram, so it would be better to never allow the
>> properties window to start on the histogram tab.
>>
>> I have implemented this in a branch of mine to improve the histogram
>> tab, here is a snippet:
>>
>> -  tabBar->setCurrentIndex( settings.value(
>> "/Windows/RasterLayerProperties/row" ).toInt() );
>> +  int currentTabIndex = settings.value(
>> "/Windows/RasterLayerProperties/row" ).toInt();
>> +  // if current tab is disabled, use first tab
>> +  if ( ! tabBar->widget( currentTabIndex )->isEnabled() )
>> +    currentTabIndex = 0;
>> +  // if current tab is histogram, use first tab (to avoid long
>> histogram queries)
>> +  // there is currently no way to know if there ia a cached histogram
>>   int myHistogramTab = 6;
>> -  if ( tabBar->currentIndex() == myHistogramTab )
>> -  {
>> -    refreshHistogram();
>> -  }
>> +  if ( currentTabIndex == myHistogramTab )
>> +    currentTabIndex = 0;
>> +  tabBar->setCurrentIndex( currentTabIndex );
>>
>>
>> Etienne
>>
>> On Mon, May 7, 2012 at 10:15 AM, G. Allegri <giohappy at gmail.com> wrote:
>> > A complex object to say something simple :(
>> > When a user opens a layer settings window and hits a tab, the same tab
>> index
>> > is kept when opening another layer settings, or in a new qgis sessions.
>> > I had a small raster layer, and I opened the histogram tab.
>> > The today I've opened a big raster layer, and opening the layer settings
>> > caused my pc running and running, till a complete qgis crash.
>> > I supposed it was something with the settings, so I opened the smalle
>> > raster, changed the tab to Style, then I was able to open the large
>> raster
>> > settings
>> > It's corner case probably, and qgis shouldn't crash with huge raster
>> > histograms. Anyway, opening the layer settings to the frist tab would
>> avoid
>> > heartbreaks :)
>> >
>> > giovanni
>> >
>> > _______________________________________________
>> > Qgis-developer mailing list
>> > Qgis-developer at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> >
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120510/6b82c43a/attachment-0001.html


More information about the Qgis-developer mailing list