SVN commit 502481 by cgilles:
digikam from trunk : Showfoto/IE common GUI implementation : - new setupStandardConnections() to set common stots/signals connections. - new virtual common setupConnections() method. CCMAIL: [hidden email] M +15 -40 showfoto/showfoto.cpp M +1 -0 showfoto/showfoto.h M +33 -0 utilities/imageeditor/editor/editorwindow.cpp M +2 -0 utilities/imageeditor/editor/editorwindow.h M +18 -41 utilities/imageeditor/editor/imagewindow.cpp M +1 -0 utilities/imageeditor/editor/imagewindow.h --- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #502480:502481 @@ -182,47 +182,8 @@ applySettings(); - // -- setup connections --------------------------- + setupConnections(); - connect(m_bar, SIGNAL(signalURLSelected(const KURL&)), - this, SLOT(slotOpenURL(const KURL&))); - - connect(m_bar, SIGNAL(signalItemAdded()), - this, SLOT(slotUpdateItemInfo())); - - connect(m_canvas, SIGNAL(signalRightButtonClicked()), - this, SLOT(slotContextMenu())); - - connect(m_canvas, SIGNAL(signalZoomChanged(float)), - this, SLOT(slotZoomChanged(float))); - - connect(m_canvas, SIGNAL(signalChanged(bool, bool)), - this, SLOT(slotChanged(bool, bool))); - - connect(m_canvas, SIGNAL(signalSelected(bool)), - this, SLOT(slotSelected(bool))); - - connect(m_canvas, SIGNAL(signalLoadingStarted(const QString &)), - this, SLOT(slotLoadingStarted(const QString &))); - - connect(m_canvas, SIGNAL(signalLoadingFinished(const QString &, bool, bool)), - this, SLOT(slotLoadingFinished(const QString &, bool, bool))); - - connect(m_canvas, SIGNAL(signalLoadingProgress(const QString &, float)), - this, SLOT(slotLoadingProgress(const QString &, float))); - - connect(m_canvas, SIGNAL(signalSavingStarted(const QString &)), - this, SLOT(slotSavingStarted(const QString &))); - - connect(m_canvas, SIGNAL(signalSavingFinished(const QString &, bool)), - this, SLOT(slotSavingFinished(const QString &, bool))); - - connect(m_canvas, SIGNAL(signalSavingProgress(const QString&, float)), - this, SLOT(slotSavingProgress(const QString&, float))); - - connect(m_slideShow, SIGNAL(finished()), - m_slideShowAction, SLOT(activate()) ); - //------------------------------------------------------------- for (KURL::List::const_iterator it = urlList.begin(); @@ -257,6 +218,20 @@ delete m_rightSidebar; } +void ShowFoto::setupConnections() +{ + setupStandardConnections(); + + connect(m_bar, SIGNAL(signalURLSelected(const KURL&)), + this, SLOT(slotOpenURL(const KURL&))); + + connect(m_bar, SIGNAL(signalItemAdded()), + this, SLOT(slotUpdateItemInfo())); + + connect(m_slideShow, SIGNAL(finished()), + m_slideShowAction, SLOT(activate()) ); +} + void ShowFoto::setupUserArea() { KConfig* config = kapp->config(); --- trunk/extragear/graphics/digikam/showfoto/showfoto.h #502480:502481 @@ -108,6 +108,7 @@ void saveSettings(); bool promptUserSave(); void setupActions(); + void setupConnections(); void applySettings(); bool save(); --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #502480:502481 @@ -146,6 +146,39 @@ e->accept(); } +void EditorWindow::setupStandardConnections() +{ + connect(m_canvas, SIGNAL(signalRightButtonClicked()), + this, SLOT(slotContextMenu())); + + connect(m_canvas, SIGNAL(signalZoomChanged(float)), + this, SLOT(slotZoomChanged(float))); + + connect(m_canvas, SIGNAL(signalChanged(bool, bool)), + this, SLOT(slotChanged(bool, bool))); + + connect(m_canvas, SIGNAL(signalSelected(bool)), + this, SLOT(slotSelected(bool))); + + connect(m_canvas, SIGNAL(signalLoadingStarted(const QString &)), + this, SLOT(slotLoadingStarted(const QString &))); + + connect(m_canvas, SIGNAL(signalLoadingFinished(const QString &, bool, bool)), + this, SLOT(slotLoadingFinished(const QString &, bool, bool))); + + connect(m_canvas, SIGNAL(signalLoadingProgress(const QString &, float)), + this, SLOT(slotLoadingProgress(const QString &, float))); + + connect(m_canvas, SIGNAL(signalSavingStarted(const QString &)), + this, SLOT(slotSavingStarted(const QString &))); + + connect(m_canvas, SIGNAL(signalSavingFinished(const QString &, bool)), + this, SLOT(slotSavingFinished(const QString &, bool))); + + connect(m_canvas, SIGNAL(signalSavingProgress(const QString&, float)), + this, SLOT(slotSavingProgress(const QString&, float))); +} + void EditorWindow::setupStandardActions() { // Standard 'File' menu actions --------------------------------------------- --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #502480:502481 @@ -147,6 +147,7 @@ void closeEvent(QCloseEvent* e); + void setupStandardConnections(); void setupStandardActions(); void setupStandardAccelerators(); void setupStatusBar(); @@ -156,6 +157,7 @@ void plugActionAccel(KAction* action); void unplugActionAccel(KAction* action); + virtual void setupConnections()=0; virtual void setupActions()=0; virtual bool promptUserSave()=0; virtual void saveSettings()=0; --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #502480:502481 @@ -124,47 +124,7 @@ // -- setup connections --------------------------- - connect(m_canvas, SIGNAL(signalRightButtonClicked()), - this, SLOT(slotContextMenu())); - - connect(m_canvas, SIGNAL(signalZoomChanged(float)), - this, SLOT(slotZoomChanged(float))); - - connect(m_canvas, SIGNAL(signalSelected(bool)), - this, SLOT(slotSelected(bool))); - - connect(m_canvas, SIGNAL(signalChanged(bool, bool)), - this, SLOT(slotChanged(bool, bool))); - - connect(m_canvas, SIGNAL(signalShowNextImage()), - this, SLOT(slotForward())); - - connect(m_canvas, SIGNAL(signalShowPrevImage()), - this, SLOT(slotBackward())); - - connect(m_canvas, SIGNAL(signalLoadingStarted(const QString &)), - this, SLOT(slotLoadingStarted(const QString &))); - - connect(m_canvas, SIGNAL(signalLoadingFinished(const QString &, bool, bool)), - this, SLOT(slotLoadingFinished(const QString &, bool, bool))); - - connect(m_canvas, SIGNAL(signalLoadingProgress(const QString &, float)), - this, SLOT(slotLoadingProgress(const QString &, float))); - - connect(m_canvas, SIGNAL(signalSavingStarted(const QString &)), - this, SLOT(slotSavingStarted(const QString &))); - - connect(m_canvas, SIGNAL(signalSavingFinished(const QString &, bool)), - this, SLOT(slotSavingFinished(const QString &, bool))); - - connect(m_canvas, SIGNAL(signalSavingProgress(const QString&, float)), - this, SLOT(slotSavingProgress(const QString&, float))); - - connect(m_rightSidebar, SIGNAL(signalNextItem()), - this, SLOT(slotForward())); - - connect(m_rightSidebar, SIGNAL(signalPrevItem()), - this, SLOT(slotBackward())); + setupConnections(); // -- read settings -------------------------------- @@ -199,6 +159,23 @@ delete m_rightSidebar; } +void ImageWindow::setupConnections() +{ + setupStandardConnections(); + + connect(m_rightSidebar, SIGNAL(signalNextItem()), + this, SLOT(slotForward())); + + connect(m_rightSidebar, SIGNAL(signalPrevItem()), + this, SLOT(slotBackward())); + + connect(m_canvas, SIGNAL(signalShowNextImage()), + this, SLOT(slotForward())); + + connect(m_canvas, SIGNAL(signalShowPrevImage()), + this, SLOT(slotBackward())); +} + void ImageWindow::setupUserArea() { QWidget* widget = new QWidget(this); --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.h #502480:502481 @@ -105,6 +105,7 @@ void saveSettings(); bool promptUserSave(); void setupActions(); + void setupConnections(); void readSettings(); bool save(); _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |