r14621 by cbradney - Get ShortWords plugin to show in new prefs pane

scribus-commit scribus-commit at lists.scribus.net
Mon Feb 1 23:21:07 CET 2010


Revision: 14621
Author: cbradney
Date: 2010-02-01T22:14:09.859206Z
Commit message: Get ShortWords plugin to show in new prefs pane

Changeset: 
M  /trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
M  /trunk/Scribus/scribus/scplugin.h
M  /trunk/Scribus/scribus/plugins/short-words/shortwords.cpp
M  /trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.h
M  /trunk/Scribus/scribus/plugins/short-words/shortwords.h
M  /trunk/Scribus/scribus/scplugin.cpp

Diffs:
Index: scribus/scplugin.h
===================================================================
--- scribus/scplugin.h	(revision 14620)
+++ scribus/scplugin.h	(revision 14621)
@@ -172,8 +172,8 @@
 		*/
 		virtual bool newPrefsPanelWidget(QWidget* parent, PrefsPanel*& panel,
 										 QString& caption, QPixmap& icon);
-		bool newPrefsPanelWidget(QWidget* parent, QWidget* panel,
-								 QString& caption, QPixmap& icon) {return false;};
+		virtual bool newPrefsPanelWidget(QWidget* parent, QWidget*& panel,
+								 QString& caption, QPixmap& icon);
 
 		/*! @brief Return descriptive information about the plug-in
 		 *
Index: scribus/scplugin.cpp
===================================================================
--- scribus/scplugin.cpp	(revision 14620)
+++ scribus/scplugin.cpp	(revision 14621)
@@ -33,6 +33,14 @@
 	return false;
 }
 
+bool ScPlugin::newPrefsPanelWidget( QWidget* /* parent */,
+									QWidget*& /* panel */,
+									QString& /* caption */,
+									QPixmap& /* icon */)
+{
+	return false;
+}
+
 const QString & ScPlugin::lastError() const
 {
 	return m_lastError;
Index: scribus/plugins/short-words/prefs_shortwords.cpp
===================================================================
--- scribus/plugins/short-words/prefs_shortwords.cpp	(revision 14620)
+++ scribus/plugins/short-words/prefs_shortwords.cpp	(revision 14621)
@@ -6,15 +6,27 @@
 */
 
 #include "prefs_shortwords.h"
+#include "prefsstructs.h"
 
 Prefs_ShortWords::Prefs_ShortWords(QWidget* parent)
-	: QWidget(parent)
+	: Prefs_Pane(parent)
 {
 	setupUi(this);
-
+	languageChange();
 }
 
 Prefs_ShortWords::~Prefs_ShortWords()
 {
 }
 
+void Prefs_ShortWords::languageChange()
+{
+}
+
+void Prefs_ShortWords::restoreDefaults(struct ApplicationPrefs *prefsData)
+{
+}
+
+void Prefs_ShortWords::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
+{
+}
Index: scribus/plugins/short-words/shortwords.cpp
===================================================================
--- scribus/plugins/short-words/shortwords.cpp	(revision 14620)
+++ scribus/plugins/short-words/shortwords.cpp	(revision 14621)
@@ -26,13 +26,13 @@
 #include <QPixmap>
 
 #include "shortwords.h"
-//#include "shortwords.moc"
 #include "version.h"
 #include "vlnadialog.h"
 #include "configuration.h"
 #include "parse.h"
 #include "page.h"
 #include "swprefsgui.h"
+#include "prefs_shortwords.h"
 #include "scpaths.h"
 #include "scribus.h"
 #include "scribusdoc.h"
@@ -155,10 +155,8 @@
 	return true;
 }
 
-bool ShortWordsPlugin::newPrefsPanelWidget(QWidget* parent,
-									       PrefsPanel*& panel,
-									       QString& caption,
-									       QPixmap& icon)
+bool ShortWordsPlugin::newPrefsPanelWidget(QWidget* parent, PrefsPanel*& panel,
+										   QString& caption, QPixmap& icon)
 {
 	panel = new SWPrefsGui(parent);
 	Q_CHECK_PTR(panel);
@@ -167,4 +165,12 @@
 	return true;
 }
 
-
+bool ShortWordsPlugin::newPrefsPanelWidget(QWidget* parent, QWidget*& panel,
+										   QString& caption, QPixmap& icon)
+{
+	panel = new Prefs_ShortWords(parent);
+	Q_CHECK_PTR(panel);
+	caption = tr("Short Words");
+	icon = loadIcon("shortwords.png");
+	return true;
+}
Index: scribus/plugins/short-words/prefs_shortwords.h
===================================================================
--- scribus/plugins/short-words/prefs_shortwords.h	(revision 14620)
+++ scribus/plugins/short-words/prefs_shortwords.h	(revision 14621)
@@ -9,15 +9,21 @@
 #define PREFS_SHORTWORDS_H
 
 #include "ui_prefs_shortwordsbase.h"
+#include "ui/prefs_pane.h"
 #include "scribusapi.h"
 
-class SCRIBUS_API Prefs_ShortWords : public QWidget, Ui::Prefs_ShortWords
+class SCRIBUS_API Prefs_ShortWords : public Prefs_Pane, Ui::Prefs_ShortWords
 {
 	Q_OBJECT
 
 	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();
 };
 
 #endif // PREFS_SHORTWORDS_H
Index: scribus/plugins/short-words/shortwords.h
===================================================================
--- scribus/plugins/short-words/shortwords.h	(revision 14620)
+++ scribus/plugins/short-words/shortwords.h	(revision 14621)
@@ -37,6 +37,8 @@
 		/*! \brief Preference widget */
 		virtual bool newPrefsPanelWidget(QWidget* parent, PrefsPanel*& panel,
 										 QString& caption, QPixmap& icon);
+		virtual bool newPrefsPanelWidget(QWidget* parent, QWidget*& panel,
+										 QString& caption, QPixmap& icon);
 		// Special features (none)
 };
 




More information about the scribus-commit mailing list