Commit 726d0530 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to unlock tab

parent 6e9c378f
Pipeline #48840 passed with stage
in 41 minutes and 42 seconds
...@@ -131,6 +131,10 @@ Widget::Widget(QWidget *pParent) ...@@ -131,6 +131,10 @@ Widget::Widget(QWidget *pParent)
d->tabLockedWarning = new TabLockedWarning(this); d->tabLockedWarning = new TabLockedWarning(this);
g->addWidget(d->tabLockedWarning, 0); g->addWidget(d->tabLockedWarning, 0);
connect(d->tabLockedWarning, &TabLockedWarning::unlockTabRequested, this, [this]() {
setLockTab(false);
//Fix icon!
});
d->mView = new View(this); d->mView = new View(this);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "tablockedwarning.h" #include "tablockedwarning.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <QAction>
using namespace MessageList::Core; using namespace MessageList::Core;
TabLockedWarning::TabLockedWarning(QWidget *parent) TabLockedWarning::TabLockedWarning(QWidget *parent)
: KMessageWidget(parent) : KMessageWidget(parent)
...@@ -16,6 +17,10 @@ TabLockedWarning::TabLockedWarning(QWidget *parent) ...@@ -16,6 +17,10 @@ TabLockedWarning::TabLockedWarning(QWidget *parent)
setWordWrap(true); setWordWrap(true);
setText(i18n("Current Tab is locked.")); setText(i18n("Current Tab is locked."));
setVisible(false); setVisible(false);
auto unlockAction = new QAction(i18n("Unlock"), this);
connect(unlockAction, &QAction::triggered, this,
&TabLockedWarning::unlockTabRequested);
addAction(unlockAction);
} }
TabLockedWarning::~TabLockedWarning() TabLockedWarning::~TabLockedWarning()
......
...@@ -19,6 +19,8 @@ class MESSAGELIST_TESTS_EXPORT TabLockedWarning : public KMessageWidget ...@@ -19,6 +19,8 @@ class MESSAGELIST_TESTS_EXPORT TabLockedWarning : public KMessageWidget
public: public:
explicit TabLockedWarning(QWidget *parent = nullptr); explicit TabLockedWarning(QWidget *parent = nullptr);
~TabLockedWarning() override; ~TabLockedWarning() override;
Q_SIGNALS:
void unlockTabRequested();
}; };
} }
} }
......
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