summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-04-30 21:42:55 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-04-30 21:42:55 +0000
commit03f92217ee2336adcbf9b1343ea03edac490ade5 (patch)
tree54300e6b248f5b341d8de29649d4175edfae5742 /scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
parent8f5f4c57942487fafbeced90e981810b20c809b5 (diff)
downloadscribus-03f92217ee2336adcbf9b1343ea03edac490ade5.tar.gz
scribus-03f92217ee2336adcbf9b1343ea03edac490ade5.tar.xz
scribus-03f92217ee2336adcbf9b1343ea03edac490ade5.zip
Update hunspell plugin, plugin manager to allow SE to see plugins, scplugin to have SE plugin attributes
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17485 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp')
-rw-r--r--scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp b/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
index 5b089a7..b4fbaab 100644
--- a/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
+++ b/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
@@ -7,6 +7,7 @@ for which a new license (GPL+exception) is in place.
#include "hunspellplugin.h"
#include "hunspellpluginimpl.h"
#include "scribuscore.h"
+#include "storyeditor.h"
// See scplugin.h and pluginmanager.{cpp,h} for detail on what these methods
// do. That documentatation is not duplicated here.
@@ -29,9 +30,11 @@ void HunspellPlugin::languageChange()
// Action name
m_actionInfo.name = "HunspellPlugin";
// Action text for menu, including &accel
- m_actionInfo.text = tr("Hunspell &Plugin");
+ m_actionInfo.text = tr("Check Spelling...");
// Menu
m_actionInfo.menu = "Item";
+ // Story Editor Menu
+ m_actionInfo.seMenu = "Edit";
// If needed, what item to add the menu item after
//m_actionInfo.menuAfterName = "ColorWheel"
// If needed, the keyboard shortcut for the plugin
@@ -39,6 +42,7 @@ void HunspellPlugin::languageChange()
// Should the menu item be enabled when the app starts
// (even without a document open) ?
m_actionInfo.enabledOnStartup = false;
+ m_actionInfo.enabledForStoryEditor = true;
m_actionInfo.notSuitableFor.append(PageItem::Line);
m_actionInfo.notSuitableFor.append(PageItem::Polygon);
m_actionInfo.notSuitableFor.append(PageItem::ImageFrame);
@@ -74,6 +78,17 @@ bool HunspellPlugin::run(ScribusDoc* doc, QString target)
return result;
}
+bool HunspellPlugin::run(QWidget *parent, ScribusDoc *doc, QString target)
+{
+ HunspellPluginImpl *hunspellPluginImpl = new HunspellPluginImpl();
+ Q_CHECK_PTR(hunspellPluginImpl);
+ if (parent)
+ hunspellPluginImpl->setRunningForSE(true, dynamic_cast<StoryEditor*>(parent));
+ bool result = hunspellPluginImpl->run(target, doc);
+ delete hunspellPluginImpl;
+ return result;
+}
+
// Low level plugin API
int hunspellplugin_getPluginAPIVersion()
{