From: Jon A. Cruz Date: Thu, 6 May 2010 08:49:03 +0000 (-0700) Subject: Track selection changes for updating in icon preview. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2c297ab4792210f85663264d2735949cc356e1dc;p=inkscape.git Track selection changes for updating in icon preview. --- diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 946eed4ca..9a46254ab 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -90,7 +90,8 @@ IconPreviewPanel::IconPreviewPanel() : selectionButton(0), desktopChangeConn(), docReplacedConn(), - docModConn() + docModConn(), + selChangedConn() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); numEntries = 0; @@ -242,6 +243,7 @@ IconPreviewPanel::~IconPreviewPanel() timer = 0; } + selChangedConn.disconnect(); docModConn.disconnect(); docReplacedConn.disconnect(); desktopChangeConn.disconnect(); @@ -261,10 +263,14 @@ void IconPreviewPanel::setDesktop( SPDesktop* desktop ) if ( desktop != this->desktop ) { docReplacedConn.disconnect(); + selChangedConn.disconnect(); this->desktop = Panel::getDesktop(); if ( this->desktop ) { docReplacedConn = this->desktop->connectDocumentReplaced(sigc::hide<0>(sigc::mem_fun(this, &IconPreviewPanel::setDocument))); + if (this->desktop->selection) { + selChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(this, &IconPreviewPanel::queueRefresh))); + } } } setDocument(newDoc); diff --git a/src/ui/dialog/icon-preview.h b/src/ui/dialog/icon-preview.h index a0f813b94..9de882569 100644 --- a/src/ui/dialog/icon-preview.h +++ b/src/ui/dialog/icon-preview.h @@ -84,6 +84,7 @@ private: sigc::connection desktopChangeConn; sigc::connection docReplacedConn; sigc::connection docModConn; + sigc::connection selChangedConn; void setDocument( SPDocument *document );