Commit 9a3e1881 authored by Kurt Hindenburg's avatar Kurt Hindenburg

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
parent e67661d2
......@@ -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)
......
......@@ -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());
......
......@@ -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;
};
}
......
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