LayoutConfigDialog moved into LayoutManager class

pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago committed by Michail Vourlakos
parent 0b4dc7ce3e
commit 0e87cb8907

@ -1231,15 +1231,6 @@ bool DockView::tasksPresent()
return false;
}
void DockView::showLayoutConfigDialog()
{
if (!m_layoutConfigDialog)
m_layoutConfigDialog = new LayoutConfigDialog(nullptr);
m_layoutConfigDialog->show();
}
//!check if the plasmoid with _name_ exists in the midedata
bool DockView::mimeContainsPlasmoid(QMimeData *mimeData, QString name)
{
@ -1917,6 +1908,5 @@ void DockView::restoreConfig()
}
//!END configuration functions
QPointer<LayoutConfigDialog> DockView::m_layoutConfigDialog;
}
//!END namespace

@ -25,7 +25,6 @@
#include "plasmaquick/containmentview.h"
#include "visibilitymanager.h"
#include "../liblattedock/dock.h"
#include "layoutconfigdialog.h"
#include <QQuickView>
#include <QQmlListProperty>
@ -180,8 +179,6 @@ public slots:
Q_INVOKABLE bool setCurrentScreen(const QString id);
Q_INVOKABLE bool tasksPresent();
Q_INVOKABLE void showLayoutConfigDialog();
Q_INVOKABLE void closeApplication();
void updateAbsDockGeometry(bool bypassChecks = false);
@ -277,7 +274,6 @@ private:
QPointer<PlasmaQuick::ConfigView> m_configView;
QPointer<VisibilityManager> m_visibility;
QPointer<QScreen> m_screenToFollow;
static QPointer<LayoutConfigDialog> m_layoutConfigDialog;
QString m_screenToFollowId;

@ -26,7 +26,8 @@ Latte::LayoutConfigDialog::LayoutConfigDialog(QWidget* parent)
: QDialog(parent), ui(new Ui::LayoutConfigDialog)
{
ui->setupUi(this);
//QMetaObject::connectSlotsByName(this);
setAttribute(Qt::WA_DeleteOnClose, true);
}
Latte::LayoutConfigDialog::~LayoutConfigDialog()

@ -228,6 +228,14 @@ QString LayoutManager::newLayout(QString layoutName, QString preset)
return newLayoutPath;
}
void LayoutManager::showLayoutConfigDialog()
{
if (!m_layoutConfigDialog)
m_layoutConfigDialog = new LayoutConfigDialog(nullptr);
m_layoutConfigDialog->show();
}
void LayoutManager::showWidgetsExplorer()
{
QDBusInterface iface("org.kde.plasmashell", "/PlasmaShell", "", QDBusConnection::sessionBus());

@ -24,6 +24,7 @@
#include "dockcorona.h"
#include "importer.h"
#include "layoutsettings.h"
#include "layoutconfigdialog.h"
#include <QAction>
#include <QObject>
@ -66,12 +67,15 @@ public:
LayoutSettings *currentLayout();
public slots:
//! switch to specified layout
Q_INVOKABLE bool switchToLayout(QString layoutName);
//! creates a new layout with layoutName based on the preset
Q_INVOKABLE QString newLayout(QString layoutName, QString preset = QString(i18n("Default")));
Q_INVOKABLE QString newLayout(QString layoutName, QString preset = i18n("Default"));
Q_INVOKABLE void showLayoutConfigDialog();
signals:
void addWidgetsActionChanged();
@ -102,6 +106,8 @@ private:
QAction *m_addWidgetsAction{nullptr};
QAction *m_toggleLayoutAction{nullptr};
QPointer<LayoutConfigDialog> m_layoutConfigDialog;
};
}

@ -115,7 +115,7 @@ PlasmaComponents.Page {
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Layouts")
onClicked: dock.showLayoutConfigDialog()
onClicked: layoutManager.showLayoutConfigDialog()
}
}
}

Loading…
Cancel
Save