Commit 81d0aa6c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to fill settings

parent ffb102ab
Pipeline #46320 passed with stage
in 45 minutes and 43 seconds
......@@ -6,6 +6,8 @@
#include "remotecontentconfigurewidget.h"
#include "remotecontentinfo.h"
#include "remotecontentmanager.h"
#include <KLocalizedString>
#include <QListWidget>
#include <QVBoxLayout>
......@@ -35,5 +37,12 @@ void RemoteContentConfigureWidget::saveSettings()
void RemoteContentConfigureWidget::readSettings()
{
const QVector<RemoteContentInfo> remoteContentInfos = RemoteContentManager::self()->removeContentInfo();
for (const RemoteContentInfo &info : remoteContentInfos) {
auto item = new QListWidgetItem(mListWidget);
item->setText(info.url());
if (info.status() == RemoteContentInfo::RemoteContentInfoStatus::Authorized) {
item->setCheckState(Qt::Checked);
}
}
}
......@@ -99,6 +99,11 @@ void RemoteContentManager::writeSettings()
group.writeEntry("Authorized", authorizedUrl);
}
QVector<RemoteContentInfo> RemoteContentManager::removeContentInfo() const
{
return mRemoveContentInfo;
}
void RemoteContentManager::addRemoteContent(const RemoteContentInfo &info)
{
mRemoveContentInfo.append(info);
......
......@@ -25,6 +25,8 @@ public:
Q_REQUIRED_RESULT bool isAutorized(const QUrl &url, bool &contains) const;
void addRemoteContent(const RemoteContentInfo &info);
Q_REQUIRED_RESULT QVector<RemoteContentInfo> removeContentInfo() const;
private:
void loadSettings();
void writeSettings();
......
......@@ -27,6 +27,11 @@ void RemoteContentMenu::initialize()
//TODO
}
void RemoteContentMenu::fillMenu()
{
//TODO
}
void RemoteContentMenu::slotConfigure()
{
QPointer<MessageViewer::RemoteContentConfigureDialog> remoteContentDialog = new MessageViewer::RemoteContentConfigureDialog(this);
......
......@@ -16,6 +16,7 @@ class MESSAGEVIEWER_TESTS_EXPORT RemoteContentMenu : public QMenu
public:
explicit RemoteContentMenu(QWidget *parent = nullptr);
~RemoteContentMenu() override;
void fillMenu();
private:
void initialize();
void slotConfigure();
......
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