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). <div>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...</div>
<div><br></div><div>giovanni<br><br><div class="gmail_quote">2012/5/10 Nathan Woodrow <span dir="ltr"><<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<span class="HOEnZb"><font color="#888888"><div>
<br></div></font></span><div><span class="HOEnZb"><font color="#888888">- Nathan </font></span><div><div class="h5"><br><br><div class="gmail_quote">On Thu, May 10, 2012 at 10:49 AM, Etienne Tourigny <span dir="ltr"><<a href="mailto:etourigny.dev@gmail.com" target="_blank">etourigny.dev@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agree that this should not happen, should the default be always open<br>
the first tab, or only when the histogram tab was previously selected?<br>
<br>
Unfortunately there is no function in the provider API to know if<br>
there is a cached histogram, so it would be better to never allow the<br>
properties window to start on the histogram tab.<br>
<br>
I have implemented this in a branch of mine to improve the histogram<br>
tab, here is a snippet:<br>
<br>
- tabBar->setCurrentIndex( settings.value(<br>
"/Windows/RasterLayerProperties/row" ).toInt() );<br>
+ int currentTabIndex = settings.value(<br>
"/Windows/RasterLayerProperties/row" ).toInt();<br>
+ // if current tab is disabled, use first tab<br>
+ if ( ! tabBar->widget( currentTabIndex )->isEnabled() )<br>
+ currentTabIndex = 0;<br>
+ // if current tab is histogram, use first tab (to avoid long<br>
histogram queries)<br>
+ // there is currently no way to know if there ia a cached histogram<br>
int myHistogramTab = 6;<br>
- if ( tabBar->currentIndex() == myHistogramTab )<br>
- {<br>
- refreshHistogram();<br>
- }<br>
+ if ( currentTabIndex == myHistogramTab )<br>
+ currentTabIndex = 0;<br>
+ tabBar->setCurrentIndex( currentTabIndex );<br>
<br>
<br>
Etienne<br>
<div><div><br>
On Mon, May 7, 2012 at 10:15 AM, G. Allegri <<a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a>> wrote:<br>
> A complex object to say something simple :(<br>
> When a user opens a layer settings window and hits a tab, the same tab index<br>
> is kept when opening another layer settings, or in a new qgis sessions.<br>
> I had a small raster layer, and I opened the histogram tab.<br>
> The today I've opened a big raster layer, and opening the layer settings<br>
> caused my pc running and running, till a complete qgis crash.<br>
> I supposed it was something with the settings, so I opened the smalle<br>
> raster, changed the tab to Style, then I was able to open the large raster<br>
> settings<br>
> It's corner case probably, and qgis shouldn't crash with huge raster<br>
> histograms. Anyway, opening the layer settings to the frist tab would avoid<br>
> heartbreaks :)<br>
><br>
> giovanni<br>
><br>
</div></div>> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>