[rkward] rkward/windows: Try to set non-confusing strings for Search in Files-plugin

Thomas Friedrichsmeier null at kde.org
Tue Jan 28 17:03:09 GMT 2020


Git commit b1ea9587d0b2c5478302f04ac3628d85401ae34b by Thomas Friedrichsmeier.
Committed on 28/01/2020 at 17:02.
Pushed by tfry into branch 'master'.

Try to set non-confusing strings for Search in Files-plugin

M  +13   -2    rkward/windows/katepluginintegration.cpp

https://commits.kde.org/rkward/b1ea9587d0b2c5478302f04ac3628d85401ae34b

diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index 6214edb8..4465738a 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -21,6 +21,7 @@
 #include <QFileInfo>
 #include <QVBoxLayout>
 #include <QChildEvent>
+#include <QComboBox>
 
 #include <KPluginFactory>
 #include <KPluginLoader>
@@ -488,9 +489,19 @@ void KatePluginIntegrationWindow::fixUpPluginUI(const QString &id, const PluginR
 		factory()->removeClient(client);
 
 		if (i == 0 && id == QStringLiteral("katesearchplugin")) {
-			window->setCaption(i18nc("Tab title", "Search in Scripts"));
+			// Try to avoid confusion regarding where the plugin will search:
+			// https://mail.kde.org/pipermail/rkward-devel/2020-January/005393.html
+			// window->setCaption(i18nc("Tab title", "Search in Scripts"));
+			if (!resources.windows.isEmpty()) {
+				// I wonder how long this HACK will work...
+				QComboBox *box = resources.windows.first()->findChild<QComboBox*>("searchPlaceCombo");
+				if (box && (box->count() > 1)) {
+					box->setItemText(0, i18nc("where to search", "in Current Script"));
+					box->setItemText(1, i18nc("where to search", "in Open Scripts"));
+				}
+			}
 			RKCommonFunctions::removeContainers(client, QStringList() << "search_in_files", true);
-			// TODO: Rename "Search more" to "Search in Scripts". These should still be accessible, globally.
+			// TODO: Rename "Search more" to something sensible. These actions should still be accessible, globally.
 		} else if (i == 0 && id == QStringLiteral("kateprojectplugin")) {
 			RKCommonFunctions::moveContainer(client, "Menu", "projects", "view", true, false);
 		}



More information about the rkward-tracker mailing list