summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/shortcuts.cpp4
-rw-r--r--src/ui/CMakeLists.txt11
-rw-r--r--src/ui/contextmenu.cpp4
-rw-r--r--src/ui/desktop/menubar.cpp9
-rw-r--r--src/ui/dialog/dialog-manager.cpp14
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp6
-rw-r--r--src/ui/dialog/inkscape-preferences.h3
-rw-r--r--src/ui/dialog/spellcheck.cpp14
-rw-r--r--src/ui/dialog/spellcheck.h4
-rw-r--r--src/verbs.cpp10
-rw-r--r--src/verbs.h8
-rw-r--r--src/widgets/toolbox.cpp2
12 files changed, 65 insertions, 24 deletions
diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp
index 0ec19d291..04e655ea0 100644
--- a/src/shortcuts.cpp
+++ b/src/shortcuts.cpp
@@ -670,6 +670,10 @@ static void read_shortcuts_file(char const *filename, bool const is_user_set) {
&& strcmp(verb_name, "ToolPaintBucket") != 0
&& strcmp(verb_name, "SelectionTrace") != 0
&& strcmp(verb_name, "PaintBucketPrefs") != 0
+ && strcmp(verb_name, "TutorialsTracing") != 0
+#endif
+#if !HAVE_ASPELL
+ && strcmp(verb_name, "DialogSpellcheck") != 0
#endif
) {
g_warning("Unknown verb name: %s", verb_name);
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index 8bd586c4b..d84ac8be4 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -135,7 +135,6 @@ set(ui_SRC
dialog/print.cpp
dialog/prototype.cpp
dialog/selectorsdialog.cpp
- dialog/spellcheck.cpp
dialog/styledialog.cpp
dialog/svg-fonts-dialog.cpp
dialog/svg-preview.cpp
@@ -303,7 +302,6 @@ set(ui_SRC
dialog/print.h
dialog/prototype.h
dialog/selectorsdialog.h
- dialog/spellcheck.h
dialog/styledialog.h
dialog/svg-fonts-dialog.h
dialog/svg-preview.h
@@ -479,3 +477,12 @@ set ( ui_flood_and_trace_SRC
if ("${HAVE_POTRACE}")
add_inkscape_source("${ui_flood_and_trace_SRC}")
endif()
+
+set ( ui_spellcheck_SRC
+ dialog/spellcheck.cpp
+ dialog/spellcheck.h
+)
+
+if ("${HAVE_ASPELL}")
+ add_inkscape_source("${ui_spellcheck_SRC}")
+endif() \ No newline at end of file
diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp
index fb3cb7b29..b33653bfd 100644
--- a/src/ui/contextmenu.cpp
+++ b/src/ui/contextmenu.cpp
@@ -929,11 +929,13 @@ void ContextMenu::MakeTextMenu ()
mi->show();
insert(*mi,positionOfLastDialog++);
+#if HAVE_ASPELL
/* Spellcheck dialog */
mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g..."), true));
mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SpellcheckSettings));
mi->show();
insert(*mi,positionOfLastDialog++);
+#endif
}
void ContextMenu::TextSettings ()
@@ -947,11 +949,13 @@ void ContextMenu::TextSettings ()
void ContextMenu::SpellcheckSettings ()
{
+#if HAVE_ASPELL
if (_desktop->selection->isEmpty()) {
_desktop->selection->set(_item);
}
_desktop->_dlg_mgr->showDialog("SpellCheck");
+#endif
}
void ContextMenu::ShiftIcons()
diff --git a/src/ui/desktop/menubar.cpp b/src/ui/desktop/menubar.cpp
index 9340c682a..39496afad 100644
--- a/src/ui/desktop/menubar.cpp
+++ b/src/ui/desktop/menubar.cpp
@@ -473,7 +473,14 @@ build_menu(Gtk::MenuShell* menu, Inkscape::XML::Node* xml, Inkscape::UI::View::V
menu->append(*menuitem);
}
}
- } else {
+ } else if (true
+#if !HAVE_POTRACE
+ && !strcmp(verb_name.c_str(), "SelectionTrace")
+#endif
+#if !HAVE_ASPELL
+ && !strcmp(verb_name.c_str(), "DialogSpellcheck")
+#endif
+ ) {
std::cerr << "build_menu: no verb with id: " << verb_name << std::endl;
}
}
diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp
index 66a682de6..0bcf7727c 100644
--- a/src/ui/dialog/dialog-manager.cpp
+++ b/src/ui/dialog/dialog-manager.cpp
@@ -52,7 +52,11 @@
#include "ui/dialog/object-properties.h"
#include "ui/dialog/objects.h"
#include "ui/dialog/selectorsdialog.h"
-#include "ui/dialog/spellcheck.h"
+
+#if HAVE_ASPELL
+# include "ui/dialog/spellcheck.h"
+#endif
+
#include "ui/dialog/styledialog.h"
#include "ui/dialog/svg-fonts-dialog.h"
#include "ui/dialog/text-edit.h"
@@ -136,7 +140,11 @@ DialogManager::DialogManager() {
registerFactory("UndoHistory", &create<UndoHistory, FloatingBehavior>);
registerFactory("InputDevices", &create<InputDialog, FloatingBehavior>);
registerFactory("TextFont", &create<TextEdit, FloatingBehavior>);
+
+#if HAVE_ASPELL
registerFactory("SpellCheck", &create<SpellCheck, FloatingBehavior>);
+#endif
+
registerFactory("Export", &create<Export, FloatingBehavior>);
registerFactory("CloneTiler", &create<CloneTiler, FloatingBehavior>);
registerFactory("XmlTree", &create<XmlTree, FloatingBehavior>);
@@ -177,7 +185,11 @@ DialogManager::DialogManager() {
registerFactory("UndoHistory", &create<UndoHistory, DockBehavior>);
registerFactory("InputDevices", &create<InputDialog, DockBehavior>);
registerFactory("TextFont", &create<TextEdit, DockBehavior>);
+
+#if HAVE_ASPELL
registerFactory("SpellCheck", &create<SpellCheck, DockBehavior>);
+#endif
+
registerFactory("Export", &create<Export, DockBehavior>);
registerFactory("CloneTiler", &create<CloneTiler, DockBehavior>);
registerFactory("XmlTree", &create<XmlTree, DockBehavior>);
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 3119b1b3b..1584a7662 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -64,7 +64,7 @@
#include "widgets/desktop-widget.h"
#include <fstream>
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
# include <aspell.h>
# ifdef _WIN32
# include <windows.h>
@@ -474,7 +474,7 @@ void InkscapePreferences::initPageTools()
cb->init ( _("Show font samples in the drop-down list"), "/tools/text/show_sample_in_list", true);
_page_text.add_line( false, "", *cb, "", _("Show font samples alongside font names in the drop-down list in Text bar"));
- _font_dialog.init(_("Show font substitution inng dialog"), "/options/font/substitutedlg", false);
+ _font_dialog.init(_("Show font substitution warning dialog"), "/options/font/substitutedlg", false);
_page_text.add_line( false, "", _font_dialog, "", _("Show font substitution warning dialog when requested fonts are not available on the system"));
cb = Gtk::manage(new PrefCheckButton);
@@ -2493,7 +2493,7 @@ void InkscapePreferences::onKBListKeyboardShortcuts()
void InkscapePreferences::initPageSpellcheck()
{
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
std::vector<Glib::ustring> languages;
std::vector<Glib::ustring> langValues;
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index e1dbd51c2..1c9fe1f7b 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -91,8 +91,9 @@ enum {
PREFS_PAGE_SYSTEM,
PREFS_PAGE_BITMAPS,
PREFS_PAGE_RENDERING,
+#if HAVE_ASPELL
PREFS_PAGE_SPELLCHECK
-
+#endif
};
namespace Gtk {
diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp
index 77b96c696..ab0282298 100644
--- a/src/ui/dialog/spellcheck.cpp
+++ b/src/ui/dialog/spellcheck.cpp
@@ -75,7 +75,7 @@ SpellCheck::SpellCheck () :
deskTrack()
{
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
_speller = nullptr;
_speller2 = nullptr;
_speller3 = nullptr;
@@ -315,7 +315,7 @@ SpellCheck::init(SPDesktop *d)
_adds = 0;
clearRects();
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
{
AspellConfig *config = new_aspell_config();
aspell_config_replace(config, "lang", _lang.c_str());
@@ -375,7 +375,7 @@ SpellCheck::init(SPDesktop *d)
void
SpellCheck::finished ()
{
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
aspell_speller_save_all_word_lists(_speller);
delete_aspell_speller(_speller);
_speller = nullptr;
@@ -504,7 +504,7 @@ SpellCheck::nextWord()
int have = 0;
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
// run it by all active spellers
have = aspell_speller_check(_speller, _word.c_str(), -1);
if (_speller2)
@@ -602,7 +602,7 @@ SpellCheck::nextWord()
sp_text_context_place_cursor (SP_TEXT_CONTEXT(desktop->event_context), _text, _begin_w);
}
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
// get suggestions
{
@@ -754,7 +754,7 @@ void SpellCheck::onAccept ()
void
SpellCheck::onIgnore ()
{
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
aspell_speller_add_to_session(_speller, _word.c_str(), -1);
if (_speller2)
aspell_speller_add_to_session(_speller2, _word.c_str(), -1);
@@ -778,7 +778,7 @@ SpellCheck::onAdd ()
{
_adds++;
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
gint num = gtk_combo_box_get_active((GtkComboBox *)dictionary_combo);
switch (num) {
case 0:
diff --git a/src/ui/dialog/spellcheck.h b/src/ui/dialog/spellcheck.h
index 6726cf417..22dca3640 100644
--- a/src/ui/dialog/spellcheck.h
+++ b/src/ui/dialog/spellcheck.h
@@ -33,7 +33,7 @@
#include "text-editing.h"
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
#include <aspell.h>
#endif /* HAVE_ASPELL */
@@ -164,7 +164,7 @@ private:
SPObject *_root;
-#ifdef HAVE_ASPELL
+#if HAVE_ASPELL
AspellSpeller *_speller;
AspellSpeller *_speller2;
AspellSpeller *_speller3;
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 065b7e10c..dae0fea3b 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -23,10 +23,6 @@
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h" // only include where actually required!
-#endif
-
#include <cstring>
#include <string>
@@ -83,7 +79,6 @@
#include "ui/dialog/new-from-template.h"
#include "ui/dialog/object-properties.h"
#include "ui/dialog/save-template-dialog.h"
-#include "ui/dialog/spellcheck.h"
#include "ui/dialog/swatches.h"
#include "ui/dialog/symbols.h"
#include "ui/icon-names.h"
@@ -613,7 +608,6 @@ SPAction *Verb::get_action(Inkscape::ActionContext const & context)
} else {
action = this->make_action(context);
- // if (action == NULL) printf("Hmm, NULL in %s\n", _name);
if (action == nullptr) printf("Hmm, NULL in %s\n", _name);
if (!_default_sensitive) {
sp_action_set_sensitive(action, 0);
@@ -808,6 +802,10 @@ Verb *Verb::getbyid(gchar const *id, bool verbose)
&& strcmp(id, "ToolPaintBucket") != 0
&& strcmp(id, "SelectionTrace") != 0
&& strcmp(id, "PaintBucketPrefs") != 0
+ && strcmp(id, "TutorialsTracing") != 0
+#endif
+#if !HAVE_ASPELL
+ && strcmp(id, "DialogSpellcheck") != 0
#endif
) {
if (verbose)
diff --git a/src/verbs.h b/src/verbs.h
index d3a63320c..d70a3dbfd 100644
--- a/src/verbs.h
+++ b/src/verbs.h
@@ -13,6 +13,10 @@
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h" // only include where actually required!
+#endif
+
#include <cstring>
#include <string>
#include <glibmm/ustring.h>
@@ -324,7 +328,11 @@ enum {
SP_VERB_DIALOG_XML_EDITOR,
SP_VERB_DIALOG_SELECTORS,
SP_VERB_DIALOG_FIND,
+
+#if HAVE_ASPELL
SP_VERB_DIALOG_SPELLCHECK,
+#endif
+
SP_VERB_DIALOG_DEBUG,
SP_VERB_DIALOG_TOGGLE,
SP_VERB_DIALOG_CLONETILER,
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 5a33616c5..cb9a32e95 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -726,7 +726,7 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
gtk_widget_set_name( holder, aux_toolboxes[i].ui_name );
gtk_widget_show(sub_toolbox);
gtk_widget_show(holder);
- } else {
+ } else if (aux_toolboxes[i].swatch_verb_id != SP_VERB_NONE) {
g_warning("Could not create toolbox %s", aux_toolboxes[i].ui_name);
}
}