Commit 0ad10ec7 authored by Harald Sitter's avatar Harald Sitter 🕵

revise the tab upload dialog to direct people at the kde store

Summary:
previously the dialog would ask users to mail John Tapsell who I think
doesn't maintain ksysguard anymore, plus that was weirdly not scaling.
instead we can simply publish it through the kde store (D8734).
provide all pertinent information to do this.

also
- switch to xi18n and use markup tags instead of manual rich text
- use KNS to retrieve the category name for the store so as to not
  hardcode it
- assert that the KNS config has only one category to ensure this doesn't
  go randomly messed up in the future should multiple categories get used

Test Plan:
- create a new tab
- file -> upload
- dialog pops up
- dialog has relevant information to actually publish the file

Reviewers: #plasma, jriddell, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8735
parent 386cda36
......@@ -30,6 +30,7 @@
#include <kacceleratormanager.h>
#include <kactioncollection.h>
#include <KNewStuff3/KNS3/DownloadDialog>
#include <KNewStuff3/KNSCore/Engine>
#include <KConfigGroup>
#include "WorkSheet.h"
......@@ -290,8 +291,19 @@ void Workspace::uploadHotNewWorksheet()
WorkSheet *currentWorksheet = currentWorkSheet();
if(!currentWorksheet)
return;
KMessageBox::information(this, i18n("<qt>To propose the current custom tab as a new System Monitor tab, email <br><a href=\"file:%1\">%2</a><br> to <a href=\"mailto:john.tapsell@kde.org?subject='System Monitor Tab'&attach='file://%2'\">john.tapsell@kde.org</a></qt>", currentWorksheet->fullFileName().section('/',0,-2), currentWorksheet->fullFileName()), i18n("Upload custom System Monitor tab"), QString(), KMessageBox::AllowLink);
KNSCore::Engine engine;
engine.init(QStringLiteral("ksysguard.knsrc"));
Q_ASSERT(engine.categories().size() == 1);
KMessageBox::information(this,
xi18nc("@info",
"<para>You can publish your custom tab on the <link url='%1'>KDE Store</link> in the <icode>%2</icode> category.</para>"
"<para><filename>%3</filename></para>",
QStringLiteral("https://store.kde.org"),
engine.categories().at(0),
currentWorksheet->fullFileName()),
i18n("Upload custom System Monitor tab"),
QString(),
KMessageBox::AllowLink);
}
void Workspace::getHotNewWorksheet()
{
......
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