Code

Added preference to suppress auto-refresh of icon previews.
authorJon A. Cruz <jon@joncruz.org>
Mon, 26 Jul 2010 00:34:06 +0000 (17:34 -0700)
committerJon A. Cruz <jon@joncruz.org>
Mon, 26 Jul 2010 00:34:06 +0000 (17:34 -0700)
src/preferences-skeleton.h
src/ui/dialog/icon-preview.cpp

index cabb13d4713f747a03feb6f7c744af4af62d409e..32f4b7c350bddfe7bdf4d25650bb80d2c6bc8fd1 100644 (file)
@@ -392,6 +392,7 @@ static char const preferences_skeleton[] =
 "\n"
 "  <group\n"
 "     id=\"iconpreview\"\n"
+"     autoRefresh=\"1\"\n"
 "     pack=\"1\"\n"
 "     selectionHold=\"1\"\n"
 "     showFrames=\"1\"\n"
index c8f5d2c2e43fcbb96dd596bdd66aca3ecd8662b3..cbd2769947226c5866171774c6beb987613ed943 100644 (file)
@@ -300,7 +300,7 @@ void IconPreviewPanel::setDesktop( SPDesktop* desktop )
         this->desktop = Panel::getDesktop();
         if ( this->desktop ) {
             docReplacedConn = this->desktop->connectDocumentReplaced(sigc::hide<0>(sigc::mem_fun(this, &IconPreviewPanel::setDocument)));
-            if (this->desktop->selection) {
+            if ( this->desktop->selection && Inkscape::Preferences::get()->getBool("/iconpreview/autoRefresh", true) ) {
                 selChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(this, &IconPreviewPanel::queueRefresh)));
             }
         }
@@ -316,7 +316,9 @@ void IconPreviewPanel::setDocument( SPDocument *document )
 
         this->document = document;
         if (this->document) {
-            docModConn = this->document->connectModified(sigc::hide(sigc::mem_fun(this, &IconPreviewPanel::queueRefresh)));
+            if ( Inkscape::Preferences::get()->getBool("/iconpreview/autoRefresh", true) ) {
+                docModConn = this->document->connectModified(sigc::hide(sigc::mem_fun(this, &IconPreviewPanel::queueRefresh)));
+            }
             queueRefresh();
         }
     }