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