From 2c297ab4792210f85663264d2735949cc356e1dc Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 6 May 2010 01:49:03 -0700 Subject: [PATCH] Track selection changes for updating in icon preview. --- src/ui/dialog/icon-preview.cpp | 8 +++++++- src/ui/dialog/icon-preview.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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 ); -- 2.30.2