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 &quot;Load histogram&quot; 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 &quot;Load histogram&quot; to show it.<div>

<br></div><div>- Nathan <br><br><div class="gmail_quote">On Thu, May 10, 2012 at 10:49 AM, Etienne Tourigny <span dir="ltr">&lt;<a href="mailto:etourigny.dev@gmail.com" target="_blank">etourigny.dev@gmail.com</a>&gt;</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-&gt;setCurrentIndex( settings.value(<br>
&quot;/Windows/RasterLayerProperties/row&quot; ).toInt() );<br>
+  int currentTabIndex = settings.value(<br>
&quot;/Windows/RasterLayerProperties/row&quot; ).toInt();<br>
+  // if current tab is disabled, use first tab<br>
+  if ( ! tabBar-&gt;widget( currentTabIndex )-&gt;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-&gt;currentIndex() == myHistogramTab )<br>
-  {<br>
-    refreshHistogram();<br>
-  }<br>
+  if ( currentTabIndex == myHistogramTab )<br>
+    currentTabIndex = 0;<br>
+  tabBar-&gt;setCurrentIndex( currentTabIndex );<br>
<br>
<br>
Etienne<br>
<div><div class="h5"><br>
On Mon, May 7, 2012 at 10:15 AM, G. Allegri &lt;<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>&gt; wrote:<br>
&gt; A complex object to say something simple :(<br>
&gt; When a user opens a layer settings window and hits a tab, the same tab index<br>
&gt; is kept when opening another layer settings, or in a new qgis sessions.<br>
&gt; I had a small raster layer, and I opened the histogram tab.<br>
&gt; The today I&#39;ve opened a big raster layer, and opening the layer settings<br>
&gt; caused my pc running and running, till a complete qgis crash.<br>
&gt; I supposed it was something with the settings, so I opened the smalle<br>
&gt; raster, changed the tab to Style, then I was able to open the large raster<br>
&gt; settings<br>
&gt; It&#39;s corner case probably, and qgis shouldn&#39;t crash with huge raster<br>
&gt; histograms. Anyway, opening the layer settings to the frist tab would avoid<br>
&gt; heartbreaks :)<br>
&gt;<br>
&gt; giovanni<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Qgis-developer mailing list<br>
&gt; <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
&gt;<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">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>