diff --git a/kcms/colors/package/contents/ui/main.qml b/kcms/colors/package/contents/ui/main.qml index ef999fd395e4ba56c27cff0388360dbb1e66178b..7e064eaca524291202df3b86ac4479f17d930cfd 100644 --- a/kcms/colors/package/contents/ui/main.qml +++ b/kcms/colors/package/contents/ui/main.qml @@ -13,7 +13,7 @@ import QtQuick.Templates 2.3 as T import QtQml 2.15 import org.kde.kirigami 2.8 as Kirigami -import org.kde.newstuff 1.62 as NewStuff +import org.kde.newstuff 1.81 as NewStuff import org.kde.kcm 1.5 as KCM import org.kde.kquickcontrols 2.0 as KQuickControls import org.kde.private.kcms.colors 1.0 as Private @@ -487,51 +487,18 @@ KCM.GridViewKCM { icon.name: "document-import" onTriggered: fileDialogLoader.active = true }, - Kirigami.Action { + NewStuff.Action { text: i18n("Get New Color Schemes…") - icon.name: "get-hot-new-stuff" - onTriggered: { newStuffPage.open(); } - } - ] - } - } - - Loader { - id: newStuffPage - - // Use this function to open the dialog. It seems roundabout, but this ensures - // that the dialog is not constructed until we want it to be shown the first time, - // since it will initialise itself on the first load (which causes it to phone - // home) and we don't want that until the user explicitly asks for it. - function open() { - if (item) { - item.open(); - } else { - active = true; - } - } - onLoaded: { - item.open(); - } - - active: false - asynchronous: true - - sourceComponent: NewStuff.Dialog { - id: newStuffDialog - configFile: "colorschemes.knsrc" - viewMode: NewStuff.Page.ViewMode.Tiles - Connections { - target: newStuffDialog.engine - function onEntryEvent(entry, event) { - if (event == 1) { // StatusChangedEvent - kcm.knsEntryChanged(entry) - } else if (event == 2) { // AdoptedEvent - kcm.loadSelectedColorScheme() + configFile: "colorschemes.knsrc" + function onEntryEvent(entry, event) { + if (event == 1) { // StatusChangedEvent + kcm.knsEntryChanged(entry) + } else if (event == 2) { // AdoptedEvent + kcm.loadSelectedColorScheme() + } } } - } - + ] } } diff --git a/kcms/cursortheme/package/contents/ui/main.qml b/kcms/cursortheme/package/contents/ui/main.qml index cb77688596b0a133273379be08806b51e671bce1..6d7d845c765b360cd247e1891cc4ac64a068fa0c 100644 --- a/kcms/cursortheme/package/contents/ui/main.qml +++ b/kcms/cursortheme/package/contents/ui/main.qml @@ -10,7 +10,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.2 as QtControls import QtQuick.Dialogs 1.1 as QtDialogs import org.kde.kirigami 2.5 as Kirigami -import org.kde.newstuff 1.62 as NewStuff +import org.kde.newstuff 1.81 as NewStuff import org.kde.kcm 1.3 as KCM import org.kde.private.kcm_cursortheme 1.0 @@ -136,53 +136,20 @@ KCM.GridViewKCM { onTriggered: fileDialogLoader.active = true enabled: kcm.canInstall }, - Kirigami.Action { + NewStuff.Action { text: i18n("&Get New Cursors…") - icon.name: "get-hot-new-stuff" - onTriggered: { newStuffPage.open(); } - enabled: kcm.canInstall + configFile: "xcursor.knsrc" + function onEntryEvent(entry, event) { + if (event == 1) { // StatusChangedEvent + kcm.ghnsEntryChanged(entry); + } + } } ] } } } - Loader { - id: newStuffPage - - // Use this function to open the dialog. It seems roundabout, but this ensures - // that the dialog is not constructed until we want it to be shown the first time, - // since it will initialise itself on the first load (which causes it to phone - // home) and we don't want that until the user explicitly asks for it. - function open() { - if (item) { - item.open(); - } else { - active = true; - } - } - onLoaded: { - item.open(); - } - - active: false - asynchronous: true - - sourceComponent: NewStuff.Dialog { - id: newStuffDialog - configFile: "xcursor.knsrc" - viewMode: NewStuff.Page.ViewMode.Tiles - Connections { - target: newStuffDialog.engine - function onEntryEvent(entry, event) { - if (event == 1) { // StatusChangedEvent - kcm.ghnsEntryChanged(entry); - } - } - } - } - } - Loader { id: fileDialogLoader active: false diff --git a/kcms/desktoptheme/package/contents/ui/main.qml b/kcms/desktoptheme/package/contents/ui/main.qml index 2268a3c30d4d2b67271909e483b2a18196a2965d..2e33f2c72e00bcdc6b3fc66f45851a986e26072c 100644 --- a/kcms/desktoptheme/package/contents/ui/main.qml +++ b/kcms/desktoptheme/package/contents/ui/main.qml @@ -14,7 +14,7 @@ import QtQuick.Controls 2.3 as QtControls import QtQml 2.15 import org.kde.kirigami 2.8 as Kirigami -import org.kde.newstuff 1.62 as NewStuff +import org.kde.newstuff 1.81 as NewStuff import org.kde.kcm 1.3 as KCM import org.kde.private.kcms.desktoptheme 1.0 as Private @@ -175,48 +175,17 @@ KCM.GridViewKCM { icon.name: "document-import" onTriggered: fileDialogLoader.active = true }, - Kirigami.Action { + NewStuff.Action { text: i18n("Get New Plasma Styles…") - icon.name: "get-hot-new-stuff" - onTriggered: { newStuffPage.open(); } + configFile: "plasma-themes.knsrc" + function onEntryEvent(entry, event) { + kcm.load(); + } } ] } } - Loader { - id: newStuffPage - - // Use this function to open the dialog. It seems roundabout, but this ensures - // that the dialog is not constructed until we want it to be shown the first time, - // since it will initialise itself on the first load (which causes it to phone - // home) and we don't want that until the user explicitly asks for it. - function open() { - if (item) { - item.open(); - } else { - active = true; - } - } - onLoaded: { - item.open(); - } - - active: false - asynchronous: true - - sourceComponent: NewStuff.Dialog { - configFile: "plasma-themes.knsrc" - viewMode: NewStuff.Page.ViewMode.Preview - Connections { - target: newStuffPage.item.engine.engine - function onSignalEntryEvent(entry, event) { - kcm.load(); - } - } - } - } - Loader { id: fileDialogLoader active: false diff --git a/kcms/icons/package/contents/ui/main.qml b/kcms/icons/package/contents/ui/main.qml index 34ed8e2f95fe072198fd73884cb1392a40729874..0ff67434f42e685d6b7c7791971b1453c6e6fe30 100644 --- a/kcms/icons/package/contents/ui/main.qml +++ b/kcms/icons/package/contents/ui/main.qml @@ -11,7 +11,7 @@ import QtQuick.Dialogs 1.0 as QtDialogs import QtQuick.Controls 2.3 as QtControls import org.kde.kirigami 2.14 as Kirigami import org.kde.kquickcontrolsaddons 2.0 as KQCAddons -import org.kde.newstuff 1.62 as NewStuff +import org.kde.newstuff 1.81 as NewStuff import org.kde.kcm 1.3 as KCM import org.kde.private.kcms.icons 1.0 as Private @@ -247,54 +247,22 @@ KCM.GridViewKCM { icon.name: "document-import" onTriggered: fileDialogLoader.active = true }, - Kirigami.Action { - enabled: root.view.enabled + NewStuff.Action { text: i18n("Get New Icons…") - icon.name: "get-hot-new-stuff" - onTriggered: { newStuffPage.open(); } + configFile: "icons.knsrc" + function onEntryEvent(entry, event) { + if (event == 1) { // StatusChangedEvent + kcm.ghnsEntriesChanged(); + } else if (event == 2) { // AdoptedEvent + kcm.reloadConfig(); + } + } } ] } } } - Loader { - id: newStuffPage - - // Use this function to open the dialog. It seems roundabout, but this ensures - // that the dialog is not constructed until we want it to be shown the first time, - // since it will initialise itself on the first load (which causes it to phone - // home) and we don't want that until the user explicitly asks for it. - function open() { - if (item) { - item.open(); - } else { - active = true; - } - } - onLoaded: { - item.open(); - } - - active: false - asynchronous: true - - sourceComponent: NewStuff.Dialog { - configFile: "icons.knsrc" - viewMode: NewStuff.Page.ViewMode.Preview - Connections { - target: newStuffPage.item.engine - function onEntryEvent(entry, event) { - if (event == 2) { // AdoptedEvent - kcm.reloadConfig(); - } else if (event == 1) { // StatusChangedEvent - kcm.ghnsEntriesChanged(); - } - } - } - } - } - Loader { id: iconSizePopupLoader active: false diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp index c10018dbda935ff11d89fa7aacf7e39d0a4eb487..ab3f139f9e64223bc91eefe2f68d413bcce78702 100644 --- a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp +++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp @@ -249,7 +249,8 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList &) m_scanDuplicateFontsControl = new CPushButton(KGuiItem(i18n("Find Duplicates…"), "edit-duplicate", i18n("Scan for Duplicate Fonts…")), fontControlWidget); m_addFontControl = new CPushButton(KGuiItem(i18n("Install from File…"), "document-import", i18n("Install fonts from a local file")), fontControlWidget); - m_getNewFontsControl = new CPushButton(KGuiItem(i18n("Get New Fonts…"), "get-hot-new-stuff", i18n("Download new fonts")), fontControlWidget); + m_getNewFontsControl = new KNS3::Button(i18n("Get New Fonts…"), QStringLiteral("kfontinst.knsrc"), this); + m_getNewFontsControl->setToolTip(i18n("Download new fonts")); m_deleteFontControl = new CPushButton(KGuiItem(QString(), "edit-delete", i18n("Delete Selected Fonts…")), fontControlWidget); @@ -346,7 +347,7 @@ CKCmFontInst::CKCmFontInst(QWidget *parent, const QVariantList &) connect(m_enableGroupControl, &QAbstractButton::clicked, this, &CKCmFontInst::enableGroup); connect(m_disableGroupControl, &QAbstractButton::clicked, this, &CKCmFontInst::disableGroup); connect(m_addFontControl, SIGNAL(clicked()), SLOT(addFonts())); - connect(m_getNewFontsControl, &QAbstractButton::clicked, this, &CKCmFontInst::downloadFonts); + connect(m_getNewFontsControl, &KNS3::Button::dialogFinished, this, &CKCmFontInst::downloadFonts); connect(m_deleteFontControl, &QAbstractButton::clicked, this, &CKCmFontInst::deleteFonts); connect(m_scanDuplicateFontsControl, &QAbstractButton::clicked, this, &CKCmFontInst::duplicateFonts); // connect(validateFontsAct, SIGNAL(triggered(bool)), SLOT(validateFonts())); @@ -792,24 +793,24 @@ void CKCmFontInst::duplicateFonts() //{ //} -void CKCmFontInst::downloadFonts() +void CKCmFontInst::downloadFonts(const QList &changedEntries) { - KNS3::QtQuickDialogWrapper newStuff(QStringLiteral("kfontinst.knsrc")); - if (!newStuff.exec().isEmpty()) // We have new fonts, so need to reconfigure fontconfig... - { - // Ask dbus helper for the current fonts folder name... - // We then sym-link our knewstuff3 download folder into the fonts folder... - QString destFolder = CJobRunner::folderName(false); - if (!destFolder.isEmpty()) { - destFolder += "kfontinst"; - if (!QFile::exists(destFolder)) { - QFile _file(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "kfontinst"); - _file.link(destFolder); - } - } + if (changedEntries.isEmpty()) { + return; + } - doCmd(CJobRunner::CMD_UPDATE, CJobRunner::ItemList()); + // Ask dbus helper for the current fonts folder name... + // We then sym-link our knewstuff3 download folder into the fonts folder... + QString destFolder = CJobRunner::folderName(false); + if (!destFolder.isEmpty()) { + destFolder += "kfontinst"; + if (!QFile::exists(destFolder)) { + QFile _file(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "kfontinst"); + _file.link(destFolder); + } } + + doCmd(CJobRunner::CMD_UPDATE, CJobRunner::ItemList()); } void CKCmFontInst::print() diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.h b/kcms/kfontinst/kcmfontinst/KCmFontInst.h index eb0eb43e2254ff1c2eaaff525e5a4a31607f7129..ee7a3810d8a98076f0408c13e64de0bd9739a39b 100644 --- a/kcms/kfontinst/kcmfontinst/KCmFontInst.h +++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,7 @@ public Q_SLOTS: void disableGroup(); void changeText(); void duplicateFonts(); - void downloadFonts(); + void downloadFonts(const QList &changedEntries); void print(); void printGroup(); void listingPercent(int p); @@ -90,8 +91,9 @@ private: CFontListView *m_fontListView; CGroupList *m_groupList; CGroupListView *m_groupListView; - QPushButton *m_deleteGroupControl, *m_enableGroupControl, *m_disableGroupControl, *m_addFontControl, *m_getNewFontsControl, *m_deleteFontControl, + QPushButton *m_deleteGroupControl, *m_enableGroupControl, *m_disableGroupControl, *m_addFontControl, *m_deleteFontControl, *m_scanDuplicateFontsControl; + KNS3::Button *m_getNewFontsControl; CFontFilter *m_filter; QString m_lastStatusBarMsg; KIO::Job *m_job; diff --git a/kcms/lookandfeel/package/contents/ui/main.qml b/kcms/lookandfeel/package/contents/ui/main.qml index ec6de99601493c7d69dfe11526a0aaad76348c27..3ab3d1075069a89d3be420bb4c3de408768e73ea 100644 --- a/kcms/lookandfeel/package/contents/ui/main.qml +++ b/kcms/lookandfeel/package/contents/ui/main.qml @@ -9,7 +9,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 import QtQuick.Controls 2.3 as QtControls import org.kde.kirigami 2.5 as Kirigami -import org.kde.newstuff 1.62 as NewStuff +import org.kde.newstuff 1.81 as NewStuff import org.kde.kconfig 1.0 // for KAuthorized import org.kde.kcm 1.3 as KCM @@ -81,53 +81,22 @@ KCM.GridViewKCM { flat: false alignment: Qt.AlignRight actions: [ - Kirigami.Action { + NewStuff.Action { + configFile: "lookandfeel.knsrc" text: i18n("Get New Global Themes…") - icon.name: "get-hot-new-stuff" - onTriggered: { newStuffPage.open(); } + function onEntryEvent(entry, event) { + if (event == 1) { // StatusChangedEvent + kcm.knsEntryChanged(entry); + } else if (event == 2) { // AdoptedEvent + kcm.reloadConfig(); + } + } } ] } } } - Loader { - id: newStuffPage - - // Use this function to open the dialog. It seems roundabout, but this ensures - // that the dialog is not constructed until we want it to be shown the first time, - // since it will initialise itself on the first load (which causes it to phone - // home) and we don't want that until the user explicitly asks for it. - function open() { - if (item) { - item.open(); - } else { - active = true; - } - } - onLoaded: { - item.open(); - } - - active: false - asynchronous: true - - sourceComponent: NewStuff.Dialog { - configFile: "lookandfeel.knsrc" - viewMode: NewStuff.Page.ViewMode.Preview - Connections { - target: newStuffPage.item.engine - function onEntryEvent(entry, event) { - if (event == 2) { // AdoptedEvent - kcm.reloadConfig(); - } else if (event == 1) { // StatusChangedEvent - kcm.knsEntryChanged(entry); - } - } - } - } - } - Window { id: previewWindow property alias url: previewImage.source diff --git a/kcms/style/package/contents/ui/GtkStylePage.qml b/kcms/style/package/contents/ui/GtkStylePage.qml index 9b804dc2c0b65ff0539a635bd1c0e1823701f076..efdfe6064c385ae9b5912c0abb66db37299b14fe 100644 --- a/kcms/style/package/contents/ui/GtkStylePage.qml +++ b/kcms/style/package/contents/ui/GtkStylePage.qml @@ -10,7 +10,7 @@ import QtQuick.Dialogs 1.0 as QtDialogs import QtQuick.Controls 2.10 as QtControls import org.kde.kirigami 2.10 as Kirigami import org.kde.private.kcms.style 1.0 as Private -import org.kde.newstuff 1.62 as NewStuff +import org.kde.newstuff 1.81 as NewStuff import org.kde.kcm 1.2 as KCM Kirigami.Page { @@ -96,49 +96,16 @@ Kirigami.Page { icon.name: "document-import" onTriggered: fileDialogLoader.active = true }, - Kirigami.Action { + NewStuff.Action { text: i18n("Get New GNOME/GTK Application Styles…") - icon.name: "get-hot-new-stuff" - onTriggered: { newStuffPage.open(); } - } - ] - } - } - - Loader { - id: newStuffPage - - // Use this function to open the dialog. It seems roundabout, but this ensures - // that the dialog is not constructed until we want it to be shown the first time, - // since it will initialise itself on the first load (which causes it to phone - // home) and we don't want that until the user explicitly asks for it. - function open() { - if (item) { - item.open(); - } else { - active = true; - } - } - onLoaded: { - item.open(); - } - - active: false - asynchronous: true - - sourceComponent: NewStuff.Dialog { - id: newStuffDialog - configFile: "gtk_themes.knsrc" - viewMode: NewStuff.Page.ViewMode.Preview - Connections { - target: newStuffDialog.engine - function onEntryEvent(entry, event) { - if (event == 1) { // StatusChangedEvent - kcm.load(); + configFile: "gtk_themes.knsrc" + function onEntryEvent(entry, event) { + if (event == 1) { // StatusChangedEvent + kcm.load(); + } } } - - } + ] } }