Commit 287c3a7e authored by Nathan Lee's avatar Nathan Lee Committed by Marc Jeanmougin

Hide spellcheck if Aspell missing

Remove extra flags missed in last commit.
(roughly backported 68eb62ca)
parent 880a88d9
Pipeline #77615502 passed with stages
in 34 minutes and 21 seconds
......@@ -630,6 +630,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
#endif
#if !HAVE_ASPELL
&& strcmp(verb_name, "DialogSpellcheck") != 0
#endif
) {
g_warning("Unknown verb name: %s", verb_name);
......
......@@ -98,7 +98,6 @@ set(ui_SRC
dialog/polar-arrange-tab.cpp
dialog/print-colors-preview-dialog.cpp
dialog/print.cpp
dialog/spellcheck.cpp
dialog/svg-fonts-dialog.cpp
dialog/swatches.cpp
dialog/symbols.cpp
......@@ -239,7 +238,6 @@ set(ui_SRC
dialog/polar-arrange-tab.h
dialog/print-colors-preview-dialog.h
dialog/print.h
dialog/spellcheck.h
dialog/svg-fonts-dialog.h
dialog/swatches.h
dialog/symbols.h
......@@ -373,3 +371,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()
......@@ -90,8 +90,6 @@ ink_common_sources += \
ui/dialog/print.h \
ui/dialog/print-colors-preview-dialog.cpp \
ui/dialog/print-colors-preview-dialog.h \
ui/dialog/spellcheck.cpp \
ui/dialog/spellcheck.h \
ui/dialog/svg-fonts-dialog.cpp \
ui/dialog/svg-fonts-dialog.h \
ui/dialog/swatches.cpp \
......@@ -131,3 +129,11 @@ ink_common_sources += \
ui/dialog/tracedialog.h
endif
if HAVE_ASPELL
ink_common_sources += \
ui/dialog/spellcheck.cpp \
ui/dialog/spellcheck.h
endif
\ No newline at end of file
......@@ -53,7 +53,11 @@
#include "ui/dialog/object-attributes.h"
#include "ui/dialog/object-properties.h"
#include "ui/dialog/text-edit.h"
#include "ui/dialog/spellcheck.h"
#if HAVE_ASPELL
# include "ui/dialog/spellcheck.h"
#endif
#include "ui/dialog/export.h"
#include "ui/dialog/xml-tree.h"
#include "ui/dialog/clonetiler.h"
......@@ -138,7 +142,9 @@ 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 +183,9 @@ 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>);
......
......@@ -92,8 +92,9 @@ enum {
PREFS_PAGE_SYSTEM,
PREFS_PAGE_BITMAPS,
PREFS_PAGE_RENDERING,
#if HAVE_ASPELL
PREFS_PAGE_SPELLCHECK
#endif
};
namespace Gtk {
......
......@@ -2215,11 +2215,13 @@ void ContextMenu::MakeTextMenu (void)
mi->show();
insert(*mi,positionOfLastDialog++);
#if HAVE_ASPELL
/* Spellcheck dialog */
mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g..."), 1));
mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SpellcheckSettings));
mi->show();
insert(*mi,positionOfLastDialog++);
#endif
}
void ContextMenu::TextSettings (void)
......@@ -2233,11 +2235,13 @@ void ContextMenu::TextSettings (void)
void ContextMenu::SpellcheckSettings (void)
{
#if HAVE_ASPELL
if (_desktop->selection->isEmpty()) {
_desktop->selection->set(_item);
}
_desktop->_dlg_mgr->showDialog("SpellCheck");
#endif
}
/*
......
......@@ -84,7 +84,11 @@
#include "ui/dialog/object-properties.h"
#include "ui/dialog/swatches.h"
#include "ui/dialog/symbols.h"
#include "ui/dialog/spellcheck.h"
#if HAVE_ASPELL
# include "ui/dialog/spellcheck.h"
#endif
#include "ui/icon-names.h"
#include "ui/tools/node-tool.h"
#include "selection.h"
......@@ -838,6 +842,9 @@ Verb *Verb::getbyid(gchar const *id)
&& strcmp(id, "ToolPaintBucket") != 0
&& strcmp(id, "SelectionTrace") != 0
&& strcmp(id, "PaintBucketPrefs") != 0
#endif
#if !HAVE_ASPELL
&& strcmp(id, "DialogSpellcheck") != 0
#endif
)
printf("Unable to find: %s\n", id);
......@@ -2071,9 +2078,11 @@ void DialogVerb::perform(SPAction *action, void *data)
case SP_VERB_DIALOG_FINDREPLACE:
// not implemented yet
break;
#if HAVE_ASPELL
case SP_VERB_DIALOG_SPELLCHECK:
dt->_dlg_mgr->showDialog("SpellCheck");
break;
#endif
case SP_VERB_DIALOG_DEBUG:
dt->_dlg_mgr->showDialog("Messages");
break;
......@@ -2188,14 +2197,10 @@ void TutorialVerb::perform(SPAction *action, void *data)
// TRANSLATORS: See "tutorial-basic.svg" comment.
sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg"));
break;
#if HAVE_POTRACE
case SP_VERB_TUTORIAL_TRACING:
// TRANSLATORS: See "tutorial-basic.svg" comment.
sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg"));
break;
#endif
case SP_VERB_TUTORIAL_TRACING_PIXELART:
sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing-pixelart.svg"));
break;
......@@ -2941,8 +2946,12 @@ Verb *Verb::_base_verbs[] = {
N_("Find objects in document"), INKSCAPE_ICON("edit-find")),
new DialogVerb(SP_VERB_DIALOG_FINDREPLACE, "DialogFindReplace", N_("Find and _Replace Text..."),
N_("Find and replace text in document"), INKSCAPE_ICON("edit-find-replace")),
#if HAVE_ASPELL
new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g..."),
N_("Check spelling of text in document"), INKSCAPE_ICON("tools-check-spelling")),
#endif
new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
N_("View debug messages"), INKSCAPE_ICON("dialog-messages")),
new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
......
......@@ -299,7 +299,9 @@ enum {
SP_VERB_DIALOG_XML_EDITOR,
SP_VERB_DIALOG_FIND,
SP_VERB_DIALOG_FINDREPLACE,
#if HAVE_ASPELL
SP_VERB_DIALOG_SPELLCHECK,
#endif
SP_VERB_DIALOG_DEBUG,
SP_VERB_DIALOG_TOGGLE,
SP_VERB_DIALOG_CLONETILER,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment