Author: jghali
Date: Sun Mar 17 18:50:29 2019
New Revision: 22901

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22901
Log:
Refactor ShapePlugin::addToMainWindowMenu()

Modified:
    trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp

Modified: trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22901&path=/trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp        (original)
+++ trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp        Sun Mar 17 
18:50:29 2019
@@ -66,18 +66,18 @@
 
 void ShapePlugin::addToMainWindowMenu(ScribusMainWindow* mw)
 {
-       if (sc_palette)
-       {
-               sc_palette->setMainWindow(mw);
-               languageChange();
-               m_actions.insert("shapeShowPalette", new 
ScrAction(QObject::tr("Custom Shapes"), QKeySequence(), this));
-               m_actions["shapeShowPalette"]->setToggleAction(true);
-               m_actions["shapeShowPalette"]->setChecked(false);
-               connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), 
sc_palette, SLOT(setPaletteShown(bool)));
-               connect(sc_palette, SIGNAL(paletteShown(bool)), 
m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
-               mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", 
"toolsInline", "Windows");
-               mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", 
m_actions);
-       }
+       if (!sc_palette)
+               return;
+
+       sc_palette->setMainWindow(mw);
+       languageChange();
+       m_actions.insert("shapeShowPalette", new ScrAction(QObject::tr("Custom 
Shapes"), QKeySequence(), this));
+       m_actions["shapeShowPalette"]->setToggleAction(true);
+       m_actions["shapeShowPalette"]->setChecked(false);
+       connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), 
sc_palette, SLOT(setPaletteShown(bool)));
+       connect(sc_palette, SIGNAL(paletteShown(bool)), 
m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
+       mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", 
"toolsInline", "Windows");
+       mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
 }
 
 const QString ShapePlugin::fullTrName() const


_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit

Reply via email to