[rkward/work/new_completion_to_console] /: Copy completion settings to console config, except for the common options

Thomas Friedrichsmeier null at kde.org
Sun Apr 26 12:19:22 BST 2020


Git commit 96af26f515706d3546a63be91745cf52cd18f1be by Thomas Friedrichsmeier.
Committed on 26/04/2020 at 11:18.
Pushed by tfry into branch 'work/new_completion_to_console'.

Copy completion settings to console config, except for the common options

M  +1    -0    ChangeLog
M  +21   -0    rkward/settings/rksettings.cpp
M  +1    -0    rkward/settings/rksettings.h
M  +37   -31   rkward/settings/rksettingsmodulecommandeditor.cpp
M  +2    -1    rkward/settings/rksettingsmodulecommandeditor.h
M  +3    -1    rkward/settings/rksettingsmoduleconsole.cpp
M  +15   -15   rkward/windows/rkcodecompletion.cpp
M  +3    -1    rkward/windows/rkcodecompletion.h
M  +1    -1    rkward/windows/rkcommandeditorwindow.cpp
M  +1    -13   rkward/windows/rkhtmlwindow.cpp

https://commits.kde.org/rkward/96af26f515706d3546a63be91745cf52cd18f1be

diff --git a/ChangeLog b/ChangeLog
index 5b9e1ebb..68d96f0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
 - <text> elements in plugins may now also contain clickable links, including rkward://-scheme links
 * TODO: Bring new code hinting features to the console window!
 - On unix-systems, RKWard can now be run without installation
+  - TODO: common.js is not found in plugins!
 - Kate addons are now supported within RKWard. Intially, search-in-files, snippets, and projects are loaded by default
   * TODO: Some plugins still have UI issues. E.g.:
     - SQL plugin fails to add toplevel menu
diff --git a/rkward/settings/rksettings.cpp b/rkward/settings/rksettings.cpp
index 61d0c771..29720a9c 100644
--- a/rkward/settings/rksettings.cpp
+++ b/rkward/settings/rksettings.cpp
@@ -57,6 +57,27 @@ void RKSettings::configureSettings (SettingsPage page, QWidget *parent, RCommand
 	settings_dialog->raise ();
 }
 
+//static
+void RKSettings::configureSettings (const QString& page, QWidget *parent, RCommandChain *chain) {
+	RK_TRACE (SETTINGS);
+
+	if (page == QStringLiteral ("rbackend")) {
+		RKSettings::configureSettings (RKSettings::PageR, parent, chain);
+	} else if (page == QStringLiteral ("console")) {
+		RKSettings::configureSettings (RKSettings::PageConsole, parent, chain);
+	} else if (page == QStringLiteral ("editor")) {
+		RKSettings::configureSettings (RKSettings::PageCommandEditor, parent, chain);
+	} else if (page == QStringLiteral ("graphics")) {
+		RKSettings::configureSettings (RKSettings::PageX11, parent, chain);
+	} else if (page == QStringLiteral ("browser")) {
+		RKSettings::configureSettings (RKSettings::PageObjectBrowser, parent, chain);
+	} else if (page == QStringLiteral ("rpackages")) {
+		RKSettings::configureSettings (RKSettings::PageRPackages, parent, chain);
+	} else {
+		RKSettings::configureSettings (RKSettings::NoPage, parent, chain);
+	}
+}
+
 //static
 void RKSettings::dialogClosed () {
 	RK_TRACE (SETTINGS);
diff --git a/rkward/settings/rksettings.h b/rkward/settings/rksettings.h
index a15cba3f..6575fd37 100644
--- a/rkward/settings/rksettings.h
+++ b/rkward/settings/rksettings.h
@@ -54,6 +54,7 @@ public:
 	};
 
 	static void configureSettings (SettingsPage page=NoPage, QWidget *parent=0, RCommandChain *chain=0);
+	static void configureSettings (const QString& page, QWidget *parent=0, RCommandChain *chain=0);
 
 	static void loadSettings (KConfig *config);
 	static void saveSettings (KConfig *config);
diff --git a/rkward/settings/rksettingsmodulecommandeditor.cpp b/rkward/settings/rksettingsmodulecommandeditor.cpp
index 8f091c72..a04393c4 100644
--- a/rkward/settings/rksettingsmodulecommandeditor.cpp
+++ b/rkward/settings/rksettingsmodulecommandeditor.cpp
@@ -43,7 +43,7 @@ int RKSettingsModuleCommandEditor::autosave_interval;
 int RKSettingsModuleCommandEditor::num_recent_files;
 QString RKSettingsModuleCommandEditor::script_file_filter;
 
-RKCodeCompletionSettingsWidget::RKCodeCompletionSettingsWidget(QWidget *parent, RKSettingsModule *module, RKCodeCompletionSettings *settings) : RKSettingsModuleWidget(parent, module), settings(settings) {
+RKCodeCompletionSettingsWidget::RKCodeCompletionSettingsWidget(QWidget *parent, RKSettingsModule *module, RKCodeCompletionSettings *settings, bool show_common) : RKSettingsModuleWidget(parent, module), settings(settings), show_common(show_common) {
 	RK_TRACE (SETTINGS);
 	QVBoxLayout* main_vbox = new QVBoxLayout (this);
 	main_vbox->setContentsMargins(0,0,0,0);
@@ -86,30 +86,34 @@ RKCodeCompletionSettingsWidget::RKCodeCompletionSettingsWidget(QWidget *parent,
 	connect (cursor_navigates_completions_box, &QCheckBox::stateChanged, this, &RKCodeCompletionSettingsWidget::change);
 	form_layout->addRow (cursor_navigates_completions_box);
 
-	completion_list_member_operator_box = new QComboBox (group);
-	completion_list_member_operator_box->addItem (i18n ("'$'-operator (list$member)"));
-	completion_list_member_operator_box->addItem (i18n ("'[['-operator (list[[\"member\"]])"));
-	completion_list_member_operator_box->setCurrentIndex ((settings->completion_options & RObject::DollarExpansion) ? 0 : 1);
-	connect (completion_list_member_operator_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RKCodeCompletionSettingsWidget::change);
-	form_layout->addRow (i18nc ("Note: list() and data.frame() are programming terms in R, and should not be translated, here", "Operator for access to members of list() and data.frame() objects"), completion_list_member_operator_box);
-
-	completion_slot_operator_box = new QComboBox (group);
-	completion_slot_operator_box->addItem (i18n ("'@'-operator (object at smember)"));
-	completion_slot_operator_box->addItem (i18n ("'slot()'-function (slot(object, member))"));
-	completion_slot_operator_box->setCurrentIndex ((settings->completion_options & RObject::ExplicitSlotsExpansion) ? 1 : 0);
-	connect (completion_slot_operator_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RKCodeCompletionSettingsWidget::change);
-	form_layout->addRow (i18nc ("Note: S4-slot() is a programming term in R, and should not be translated, here", "Operator for access to S4-slot()s"), completion_slot_operator_box);
-
-	completion_object_qualification_box = new QComboBox (group);
-	completion_object_qualification_box->addItem (i18n ("For masked objects, only"));
-	completion_object_qualification_box->addItem (i18n ("For objects outside of <i>.GlobalEnv</i>, only"));
-	completion_object_qualification_box->addItem (i18n ("Always"));
-	if (settings->completion_options & (RObject::IncludeEnvirIfNotGlobalEnv)) {
-		if (settings->completion_options & (RObject::IncludeEnvirIfNotGlobalEnv)) completion_object_qualification_box->setCurrentIndex (2);
-		else completion_object_qualification_box->setCurrentIndex (1);
+	if (show_common) {
+		completion_list_member_operator_box = new QComboBox (group);
+		completion_list_member_operator_box->addItem (i18n ("'$'-operator (list$member)"));
+		completion_list_member_operator_box->addItem (i18n ("'[['-operator (list[[\"member\"]])"));
+		completion_list_member_operator_box->setCurrentIndex ((settings->completion_options & RObject::DollarExpansion) ? 0 : 1);
+		connect (completion_list_member_operator_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RKCodeCompletionSettingsWidget::change);
+		form_layout->addRow (i18nc ("Note: list() and data.frame() are programming terms in R, and should not be translated, here", "Operator for access to members of list() and data.frame() objects"), completion_list_member_operator_box);
+
+		completion_slot_operator_box = new QComboBox (group);
+		completion_slot_operator_box->addItem (i18n ("'@'-operator (object at smember)"));
+		completion_slot_operator_box->addItem (i18n ("'slot()'-function (slot(object, member))"));
+		completion_slot_operator_box->setCurrentIndex ((settings->completion_options & RObject::ExplicitSlotsExpansion) ? 1 : 0);
+		connect (completion_slot_operator_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RKCodeCompletionSettingsWidget::change);
+		form_layout->addRow (i18nc ("Note: S4-slot() is a programming term in R, and should not be translated, here", "Operator for access to S4-slot()s"), completion_slot_operator_box);
+
+		completion_object_qualification_box = new QComboBox (group);
+		completion_object_qualification_box->addItem (i18n ("For masked objects, only"));
+		completion_object_qualification_box->addItem (i18n ("For objects outside of <i>.GlobalEnv</i>, only"));
+		completion_object_qualification_box->addItem (i18n ("Always"));
+		if (settings->completion_options & (RObject::IncludeEnvirIfNotGlobalEnv)) {
+			if (settings->completion_options & (RObject::IncludeEnvirIfNotGlobalEnv)) completion_object_qualification_box->setCurrentIndex (2);
+			else completion_object_qualification_box->setCurrentIndex (1);
+		}
+		connect (completion_object_qualification_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RKCodeCompletionSettingsWidget::change);
+		form_layout->addRow (i18n ("Include environment for objects on the search path:"), completion_object_qualification_box);
+	} else {
+		box_layout->addWidget(RKCommonFunctions::linkedWrappedLabel(i18n("<b>Note: </b>Additional (common) completion options are available at the <a href=\"rkward://settings/editor\">script editor settings</a>")));
 	}
-	connect (completion_object_qualification_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &RKCodeCompletionSettingsWidget::change);
-	form_layout->addRow (i18n ("Include environment for objects on the search path:"), completion_object_qualification_box);
 
 	main_vbox->addWidget(group);
 }
@@ -124,12 +128,14 @@ void RKCodeCompletionSettingsWidget::applyChanges() {
 	}
 	settings->cursor_navigates_completions = cursor_navigates_completions_box->isChecked ();
 
-	settings->completion_options = 0;
-	if (completion_list_member_operator_box->currentIndex () == 0) settings->completion_options += RObject::DollarExpansion;
-	if (completion_slot_operator_box->currentIndex () == 1) settings->completion_options += RObject::ExplicitSlotsExpansion;
-	if (completion_object_qualification_box->currentIndex () == 2) settings->completion_options += RObject::IncludeEnvirForGlobalEnv | RObject::IncludeEnvirIfNotGlobalEnv;
-	else if (completion_object_qualification_box->currentIndex () == 1) settings->completion_options += RObject::IncludeEnvirIfNotGlobalEnv;
-	else settings->completion_options += RObject::IncludeEnvirIfMasked;
+	if (show_common) {
+		settings->completion_options = 0;
+		if (completion_list_member_operator_box->currentIndex () == 0) settings->completion_options += RObject::DollarExpansion;
+		if (completion_slot_operator_box->currentIndex () == 1) settings->completion_options += RObject::ExplicitSlotsExpansion;
+		if (completion_object_qualification_box->currentIndex () == 2) settings->completion_options += RObject::IncludeEnvirForGlobalEnv | RObject::IncludeEnvirIfNotGlobalEnv;
+		else if (completion_object_qualification_box->currentIndex () == 1) settings->completion_options += RObject::IncludeEnvirIfNotGlobalEnv;
+		else settings->completion_options += RObject::IncludeEnvirIfMasked;
+	}
 }
 
 void RKCodeCompletionSettingsWidget::makeCompletionTypeBoxes (const QStringList& labels, QGridLayout* layout) {
@@ -150,7 +156,7 @@ RKSettingsModuleCommandEditor::RKSettingsModuleCommandEditor (RKSettings *gui, Q
 	main_vbox->addWidget (RKCommonFunctions::wordWrappedLabel (i18n ("Settings marked with (*) do not take effect until you restart RKWard")));
 	main_vbox->addSpacing (2 * RKGlobals::spacingHint ());
 
-	main_vbox->addWidget (completion_settings_widget = new RKCodeCompletionSettingsWidget (this, this, &completion_settings));
+	main_vbox->addWidget (completion_settings_widget = new RKCodeCompletionSettingsWidget (this, this, &completion_settings, true));
 
 	main_vbox->addSpacing (2 * RKGlobals::spacingHint ());
 
diff --git a/rkward/settings/rksettingsmodulecommandeditor.h b/rkward/settings/rksettingsmodulecommandeditor.h
index e5be1c5e..3051ff38 100644
--- a/rkward/settings/rksettingsmodulecommandeditor.h
+++ b/rkward/settings/rksettingsmodulecommandeditor.h
@@ -66,7 +66,7 @@ friend class RKCodeCompletionSettingsWidget;
 
 class RKCodeCompletionSettingsWidget : public RKSettingsModuleWidget {
 public:
-	RKCodeCompletionSettingsWidget(QWidget *parent, RKSettingsModule *module, RKCodeCompletionSettings *settings);
+	RKCodeCompletionSettingsWidget(QWidget *parent, RKSettingsModule *module, RKCodeCompletionSettings *settings, bool show_common);
 	~RKCodeCompletionSettingsWidget() {};
 	void applyChanges() override;
 private:
@@ -83,6 +83,7 @@ private:
 	QComboBox* completion_object_qualification_box;
 
 	RKCodeCompletionSettings *settings;
+	bool show_common;
 };
 
 /**
diff --git a/rkward/settings/rksettingsmoduleconsole.cpp b/rkward/settings/rksettingsmoduleconsole.cpp
index 641d2e49..db6774d9 100644
--- a/rkward/settings/rksettingsmoduleconsole.cpp
+++ b/rkward/settings/rksettingsmoduleconsole.cpp
@@ -47,7 +47,7 @@ RKSettingsModuleConsole::RKSettingsModuleConsole (RKSettings *gui, QWidget *pare
 
 	QVBoxLayout *vbox = new QVBoxLayout (this);
 
-	vbox->addWidget (completion_settings_widget = new RKCodeCompletionSettingsWidget (this, this, &completion_settings));
+	vbox->addWidget (completion_settings_widget = new RKCodeCompletionSettingsWidget (this, this, &completion_settings, false));
 
 	save_history_box = new QCheckBox (i18n ("Load/Save command history"), this);
 	save_history_box->setChecked (save_history);
@@ -131,6 +131,7 @@ void RKSettingsModuleConsole::saveSettings (KConfig *config) {
 	cg.writeEntry ("pipe user commands through console", pipe_user_commands_through_console);
 	cg.writeEntry ("add piped commands to history", (int) add_piped_commands_to_history);
 	cg.writeEntry ("command history defaults to context sensitive", context_sensitive_history_by_default);
+	completion_settings.saveSettings(cg);
 }
 
 //static
@@ -144,6 +145,7 @@ void RKSettingsModuleConsole::loadSettings (KConfig *config) {
 	pipe_user_commands_through_console = cg.readEntry ("pipe user commands through console", true);
 	add_piped_commands_to_history = (PipedCommandsHistoryMode) cg.readEntry ("add piped commands to history", (int) AddSingleLine);
 	context_sensitive_history_by_default = cg.readEntry ("command history defaults to context sensitive", false);
+	completion_settings.loadSettings(cg);
 }
 
 //static
diff --git a/rkward/windows/rkcodecompletion.cpp b/rkward/windows/rkcodecompletion.cpp
index efc31fdd..3617d934 100644
--- a/rkward/windows/rkcodecompletion.cpp
+++ b/rkward/windows/rkcodecompletion.cpp
@@ -58,7 +58,7 @@ public:
 
 //////////////////////// RKCompletionManager //////////////////////
 
-RKCompletionManager::RKCompletionManager (KTextEditor::View* view) : QObject (view) {
+RKCompletionManager::RKCompletionManager(KTextEditor::View* view, const RKCodeCompletionSettings *settings) : QObject(view), settings(settings) {
 	RK_TRACE (COMMANDEDITOR);
 
 	_view = view;
@@ -108,8 +108,8 @@ void RKCompletionManager::tryCompletionProxy () {
 	if (cc_iface->isCompletionActive () || keep_active) {
 		// Handle this in the next event cycle, as more than one event may trigger
 		completion_timer->start (0);
-	} else if (RKSettingsModuleCommandEditor::completionSettings()->autoEnabled ()) {
-		completion_timer->start (RKSettingsModuleCommandEditor::completionSettings()->autoTimeout ());
+	} else if (settings->autoEnabled ()) {
+		completion_timer->start (settings->autoTimeout ());
 	}
 }
 
@@ -161,7 +161,7 @@ void RKCompletionManager::tryCompletion () {
 	}
 
 	QString word = currentCompletionWord ();
-	if (user_triggered || (word.length () >= RKSettingsModuleCommandEditor::completionSettings()->autoMinChars ())) {
+	if (user_triggered || (word.length () >= settings->autoMinChars ())) {
 		QString filename;
 		// as a very simple heuristic: If the current symbol starts with a quote, we should probably attempt file name completion, instead of symbol name completion
 		if (word.startsWith ('\"') || word.startsWith ('\'') || word.startsWith ('`')) {
@@ -286,17 +286,17 @@ void RKCompletionManager::updateVisibility () {
 		active_models.clear ();
 	}
 
-	bool min_len = (currentCompletionWord ().length () >= RKSettingsModuleCommandEditor::completionSettings()->autoMinChars ()) || user_triggered;
-	startModel (cc_iface, completion_model, min_len && RKSettingsModuleCommandEditor::completionSettings()->isEnabled (RKCodeCompletionSettings::Object), symbol_range, &active_models);
-	startModel (cc_iface, file_completion_model, min_len && RKSettingsModuleCommandEditor::completionSettings()->isEnabled (RKCodeCompletionSettings::Filename), symbol_range, &active_models);
-	if (kate_keyword_completion_model && RKSettingsModuleCommandEditor::completionSettings()->isEnabled (RKCodeCompletionSettings::AutoWord)) {
+	bool min_len = (currentCompletionWord ().length () >= settings->autoMinChars ()) || user_triggered;
+	startModel (cc_iface, completion_model, min_len && settings->isEnabled (RKCodeCompletionSettings::Object), symbol_range, &active_models);
+	startModel (cc_iface, file_completion_model, min_len && settings->isEnabled (RKCodeCompletionSettings::Filename), symbol_range, &active_models);
+	if (kate_keyword_completion_model && settings->isEnabled (RKCodeCompletionSettings::AutoWord)) {
 		// Model needs to update, first, as we have not handled it in tryCompletion:
 		if (min_len) kate_keyword_completion_model->completionInvoked (view (), symbol_range, KTextEditor::CodeCompletionModel::ManualInvocation);
 		startModel (cc_iface, kate_keyword_completion_model, min_len, symbol_range, &active_models);
 	}
 // NOTE: Freaky bug in KF 5.44.0: Call hint will not show for the first time, if logically above the primary screen. TODO: provide patch for kateargumenthinttree.cpp:166pp
-	startModel (cc_iface, callhint_model, true && RKSettingsModuleCommandEditor::completionSettings()->isEnabled (RKCodeCompletionSettings::Calltip), currentCallRange (), &active_models);
-	startModel (cc_iface, arghint_model, min_len && RKSettingsModuleCommandEditor::completionSettings()->isEnabled (RKCodeCompletionSettings::Arghint), argname_range, &active_models);
+	startModel (cc_iface, callhint_model, true && settings->isEnabled (RKCodeCompletionSettings::Calltip), currentCallRange (), &active_models);
+	startModel (cc_iface, arghint_model, min_len && settings->isEnabled (RKCodeCompletionSettings::Arghint), argname_range, &active_models);
 
 	if (active_models.isEmpty ()) {
 		cc_iface->abortCompletion ();
@@ -337,7 +337,7 @@ void RKCompletionManager::cursorPositionChanged (KTextEditor::View* view, const
 			if (text.contains (QChar ('(')) || text.contains (QChar (')'))) update_call = true;
 		}
 		tryCompletionProxy ();
-	} else if (RKSettingsModuleCommandEditor::completionSettings()->autoCursorActivated ()) {
+	} else if (settings->autoCursorActivated ()) {
 		tryCompletionProxy ();
 	}
 }
@@ -391,7 +391,7 @@ bool RKCompletionManager::eventFilter (QObject*, QEvent* event) {
 					// Ouch, how messy. We want to make sure completion stops, and is not re-triggered by the insertion, itself
 					active_models.clear ();
 					cc_iface->abortCompletion ();
-					if (RKSettingsModuleCommandEditor::completionSettings()->autoEnabled ()) ignore_next_trigger = true;
+					if (settings->autoEnabled ()) ignore_next_trigger = true;
 				}
 				else if (comp.isEmpty ()) {
 					QApplication::beep (); // TODO: unfortunately, we catch *two* tab events, so this is not good, yet
@@ -399,10 +399,10 @@ bool RKCompletionManager::eventFilter (QObject*, QEvent* event) {
 				return true;
 			}
 		} else if ((k->key () == Qt::Key_Up || k->key () == Qt::Key_Down) && cc_iface->isCompletionActive ()) {
-			if (RKSettingsModuleCommandEditor::completionSettings()->cursorNavigatesCompletions ()) return false;
+			if (settings->cursorNavigatesCompletions ()) return false;
 
 			// Make up / down-keys (without alt) navigate in the document (aborting the completion)
-			// Meke alt+up / alt+down naviate in the completion list
+			// Make alt+up / alt+down navigate in the completion list
 			if (k->modifiers () & Qt::AltModifier) {
 				if (k->type() != QKeyEvent::KeyPress) return true;  // eat the release event
 
@@ -489,7 +489,7 @@ void RKCodeCompletionModel::updateCompletionList (const QString& symbol) {
 	n_completions = matches.size ();
 	icons.clear ();
 	icons.reserve (n_completions);
-	names = RObject::getFullNames (matches, RKSettingsModuleCommandEditor::completionSettings()->options());
+	names = RObject::getFullNames (matches, RKSettingsModuleCommandEditor::completionSettings()->options());  // NOTE: Intentionally using the script editor completion settings object, here. the completion options are shared with the console!
 	for (int i = 0; i < n_completions; ++i) {
 		icons.append (RKStandardIcons::iconForObject (matches[i]));
 	}
diff --git a/rkward/windows/rkcodecompletion.h b/rkward/windows/rkcodecompletion.h
index c9857c6a..1d17398a 100644
--- a/rkward/windows/rkcodecompletion.h
+++ b/rkward/windows/rkcodecompletion.h
@@ -28,6 +28,7 @@
 #include <ktexteditor/codecompletionmodelcontrollerinterface.h>
 
 class QEvent;
+class RKCodeCompletionSettings;
 class RKCodeCompletionModel;
 class RKFileCompletionModel;
 class RKCallHintModel;
@@ -37,7 +38,7 @@ class RKArgumentHintModel;
 class RKCompletionManager : public QObject {
 	Q_OBJECT
 public:
-	RKCompletionManager (KTextEditor::View *view);
+	RKCompletionManager (KTextEditor::View *view, const RKCodeCompletionSettings *settings);
 	~RKCompletionManager ();
 
 	QString currentCompletionWord () const;
@@ -69,6 +70,7 @@ private:
 	KTextEditor::CodeCompletionModel* kate_keyword_completion_model;
 	QTimer *completion_timer;
 
+	const RKCodeCompletionSettings *settings;
 	KTextEditor::View *_view;
 	KTextEditor::Cursor cached_position;
 
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 9ccba1b1..123d98fd 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -246,7 +246,7 @@ RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, const QUrl _url,
 	if (use_r_highlighting) {
 		RKCommandHighlighter::setHighlighting (m_doc, RKCommandHighlighter::RScript);
 		if (flags & RKCommandEditorFlags::UseCodeHinting) {
-			new RKCompletionManager (m_view);
+			new RKCompletionManager (m_view, RKSettingsModuleCommandEditor::completionSettings());
 			//hinter = new RKFunctionArgHinter (this, m_view);
 		}
 	} else {
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index 0e244240..2024b5d5 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -521,19 +521,7 @@ bool RKHTMLWindow::handleRKWardURL (const QUrl &url, RKHTMLWindow *window) {
 		} else if (url.host () == "settings") {
 			QString path = url.path ();
 			if (path.startsWith ('/')) path = path.mid (1);
-			if (path == QStringLiteral ("rbackend")) {
-				RKSettings::configureSettings (RKSettings::PageR);
-			} else if (path == QStringLiteral ("console")) {
-				RKSettings::configureSettings (RKSettings::PageConsole);
-			} else if (path == QStringLiteral ("graphics")) {
-				RKSettings::configureSettings (RKSettings::PageX11);
-			} else if (path == QStringLiteral ("browser")) {
-				RKSettings::configureSettings (RKSettings::PageObjectBrowser);
-			} else if (path == QStringLiteral ("rpackages")) {
-				RKSettings::configureSettings (RKSettings::PageRPackages);
-			} else {
-				RKSettings::configureSettings (RKSettings::NoPage);
-			}
+			RKSettings::configureSettings(path);
 		} else {
 			if (window) window->openRKHPage (url);
 			else RKWorkplace::mainWorkplace ()->openHelpWindow (url);	// will recurse with window set, via openURL()



More information about the rkward-tracker mailing list