r23155 by jghali - #15770: Add a virtual Prefs_Pane::apply() function

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 24 04:10:39 UTC 2019


Author: jghali
Date: Sat Aug 24 04:10:38 2019
New Revision: 23155

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23155
Log:
#15770: Add a virtual Prefs_Pane::apply() function

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/prefs_scripter.h
    trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.h
    trunk/Scribus/scribus/ui/prefs_pane.h
    trunk/Scribus/scribus/ui/prefs_plugins.cpp
    trunk/Scribus/scribus/ui/prefs_plugins.h

Modified: trunk/Scribus/scribus/plugins/scriptplugin/prefs_scripter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23155&path=/trunk/Scribus/scribus/plugins/scriptplugin/prefs_scripter.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/prefs_scripter.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/prefs_scripter.h	Sat Aug 24 04:10:38 2019
@@ -19,14 +19,14 @@
 	public:
 		Prefs_Scripter(QWidget* parent=0);
 		~Prefs_Scripter();
+
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 
 	public slots:
 		void languageChange();
 		//! \brief Apply changes to prefs. Auto connected.
-		void apply();
-
+		void apply() override;
 
 	protected:
 		void setupSyntaxColors();

Modified: trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23155&path=/trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.h
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.h	(original)
+++ trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.h	Sat Aug 24 04:10:38 2019
@@ -18,13 +18,14 @@
 	public:
 		Prefs_ShortWords(QWidget* parent=0);
 		~Prefs_ShortWords();
+
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 
 	public slots:
 		void languageChange();
 		//! \brief Apply changes to prefs. Auto connected.
-		void apply();
+		void apply() override;
 
 	protected slots:
 		/*! \brief Save the content into user file. */

Modified: trunk/Scribus/scribus/ui/prefs_pane.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23155&path=/trunk/Scribus/scribus/ui/prefs_pane.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pane.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_pane.h	Sat Aug 24 04:10:38 2019
@@ -18,6 +18,7 @@
 	public:
 		Prefs_Pane(QWidget* parent) : QWidget(parent) {}
 		~Prefs_Pane() {}
+
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData) = 0;
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const = 0;
 
@@ -31,6 +32,9 @@
 			return m_icon;
 		}
 
+	public slots:
+		virtual void apply() {}; // For plugin prefs panels
+
 	protected:
 		QString m_caption;
 		QString m_icon;

Modified: trunk/Scribus/scribus/ui/prefs_plugins.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23155&path=/trunk/Scribus/scribus/ui/prefs_plugins.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_plugins.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_plugins.cpp	Sat Aug 24 04:10:38 2019
@@ -95,26 +95,6 @@
 	pluginTable->resizeColumnsToContents();
 }
 
-
-void Prefs_Plugins::apply()
-{
-	QString plugName;
-	//	PluginManager& pluginManager(PluginManager::instance());
-	//	bool enable;
-	for (int i = 0; i < pluginTable->rowCount(); ++i)
-	{
-		plugName = pluginTable->item(i, 4)->text();
-		/* Don't need this  at all now we are not allowing users to turn plugins on or off
-		QCheckBox* onStartCheck=qobject_cast<QCheckBox*>(pluginTable->cellWidget(i, 3));
-		if (onStartCheck)
-		{
-			enable = onStartCheck->isChecked();
-			pluginManager.enableOnStartup(plugName) = enable;
-		}
-	*/
-	}
-}
-
 Prefs_Plugins::~Prefs_Plugins() = default;
 
 void Prefs_Plugins::languageChange()

Modified: trunk/Scribus/scribus/ui/prefs_plugins.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23155&path=/trunk/Scribus/scribus/ui/prefs_plugins.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_plugins.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_plugins.h	Sat Aug 24 04:10:38 2019
@@ -21,13 +21,12 @@
 	public:
 		Prefs_Plugins(QWidget* parent, ScribusDoc* doc=nullptr);
 		~Prefs_Plugins();
+
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 
 	public slots:
 		void languageChange();
-		//! \brief Apply changes to each plugin's PluginSettings
-		void apply();
 };
 
 //! \brief Non editable QTableWidgetItem




More information about the scribus-commit mailing list