summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2017-06-01 22:24:48 -0400
committerKurt Hindenburg <[email protected]>2017-06-01 22:24:48 -0400
commit9a3e18816e66aecbb5f79cc243a6e1d5c5723d6f (patch)
tree86e82a06cf8840162ddd8210b8d29389291aacbe
parente67661d28dfa4e922472cba501eb7890a785e0c1 (diff)
Fix 'Manage Profiles' option from KonsolePart
Allow the menu option to work again. Code copied from MainWindow. Keeping the bug report open for now as I think this still need some work. CCBUG: 360072
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/Part.cpp23
-rw-r--r--src/Part.h3
3 files changed, 27 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b64545a..468174a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -201,8 +201,9 @@ install(TARGETS kdeinit_konsole konsole
### Embedded Konsole KPart
-set(konsolepart_PART_SRCS Part.cpp)
-
+set(konsolepart_PART_SRCS Part.cpp
+ settings/ProfileSettings.cpp)
+kconfig_add_kcfg_files(konsolepart_PART_SRCS settings/KonsoleSettings.kcfgc)
add_library(konsolepart MODULE ${konsolepart_PART_SRCS})
generate_export_header(konsolepart BASE_NAME konsole)
set_target_properties(konsolepart PROPERTIES DEFINE_SYMBOL KONSOLE_PART)
diff --git a/src/Part.cpp b/src/Part.cpp
index 8d822ac..c5dcb8a 100644
--- a/src/Part.cpp
+++ b/src/Part.cpp
@@ -30,6 +30,8 @@
#include <QAction>
#include <KActionCollection>
#include <KPluginFactory>
+#include <KLocalizedString>
+#include <KConfigDialog>
// Konsole
#include "EditProfileDialog.h"
@@ -40,6 +42,8 @@
#include "ProfileManager.h"
#include "TerminalDisplay.h"
#include "ViewManager.h"
+#include "KonsoleSettings.h"
+#include "settings/ProfileSettings.h"
using namespace Konsole;
@@ -50,7 +54,6 @@ Part::Part(QWidget* parentWidget , QObject* parent, const QVariantList&)
: KParts::ReadOnlyPart(parent)
, _viewManager(0)
, _pluggedController(0)
- , _manageProfilesAction(0)
{
// create view widget
_viewManager = new ViewManager(this, actionCollection());
@@ -263,6 +266,24 @@ void Part::activeViewTitleChanged(ViewProperties* properties)
emit setWindowCaption(properties->title());
}
+void Part::showManageProfilesDialog(QWidget* parent)
+{
+ if (KConfigDialog::showDialog(QStringLiteral("settings"))) {
+ return;
+ }
+
+ KConfigDialog *settingsDialog = new KConfigDialog(parent, QStringLiteral("settings"), KonsoleSettings::self());
+ settingsDialog->setFaceType(KPageDialog::Tabbed);
+
+ auto profileSettings = new ProfileSettings(settingsDialog);
+ settingsDialog->addPage(profileSettings,
+ i18nc("@title Preferences page name",
+ "Profiles"),
+ QStringLiteral("configure"));
+
+ settingsDialog->show();
+}
+
void Part::showEditCurrentProfileDialog(QWidget* parent)
{
Q_ASSERT(activeSession());
diff --git a/src/Part.h b/src/Part.h
index f64776b..f91967a 100644
--- a/src/Part.h
+++ b/src/Part.h
@@ -92,6 +92,8 @@ public Q_SLOTS:
*/
QStringList profileNameList() const;
+ void showManageProfilesDialog(QWidget* parent);
+
/**
* Shows the dialog used to edit the profile used by the active session. The
* dialog will be non-modal and will delete itself when it is closed.
@@ -193,7 +195,6 @@ private:
private:
ViewManager *_viewManager;
SessionController *_pluggedController;
- QAction *_manageProfilesAction;
};
}