Commit 8f7bbaa9 authored by Mikhail Zolotukhin's avatar Mikhail Zolotukhin
Browse files

[App Style KCM] Use QtQuick NewStuff dialogs

Make the dialogs consistent with others KCMs by using QtQuick versions.

Test Plan: Test dialogs for GTK themes installation.

Reviewers: broulik, ngraham

Reviewed By: ngraham

Subscribers: jferrer, #localization, yurchor, ngraham, plasma-devel

Tags: #plasma

Differential Revision:
parent 0175fee9
......@@ -41,7 +41,7 @@ target_link_libraries(kcm_style
kcoreaddons_desktop_to_json(kcm_style "kcm_style.desktop")
install(FILES stylesettings.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(FILES cgctheme.knsrc cgcgtk3.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
install(FILES gtk2_themes.knsrc gtk3_themes.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
Name=GTK 2.x Themes
Name[ar]=سمات جتك الثّانية
Name[ast]=Estilos pa GTK 2.x
Name[ca]=Temes GTK 2.x
Name[ca@valencia]=Temes GTK 2.x
Name[cs]=Motivy GTK 2.x
Name[da]=GTK 2.x-temaer
Name[de]=GTK 2.x-Designs
Name[el]=Θέματα GTK 2.x
Name[en_GB]=GTK 2.x Themes
Name[es]=Temas de GTK 2.x
Name[et]=GTK 2.x teemad
Name[eu]=GTK 2.x gaiak
Name[ia]=Themas de GTK 2.x
Name[fi]=GTK 2.x -teemat
Name[fr]=Thèmes GTK 2.x
Name[gl]=Temas de GTK 2.x
Name[he]=ערכות נושא של GTK 2.x
Name[hu]=GTK 2.x témák
Name[id]=Tema GTK 2.x
Name[it]=Temi GTK 2.x
Name[ko]=GTK 2.x 테마
Name[lt]=GTK 2.x apipavidalinimai
Name[nl]=GTK 2.x thema's
Name[nn]=GTK 2.x-tema
Name[pl]=Wygląd GTK 2.x
Name[pt]=Temas do GTK 2.x
Name[pt_BR]=Temas GTK 2.x
Name[ru]=Темы GTK 2.x
Name[sk]=GTK 2.x Témy
Name[sk]=Témy GTK 2.x
Name[sl]=Teme GTK 2.x
Name[sr]=ГТК 2.x теме
Name[sr@ijekavian]=ГТК 2.x теме
Name[sr@ijekavianlatin]=GTK 2.x teme
Name[sr@latin]=GTK 2.x teme
Name[sv]=GTK 2.x-teman
Name[tg]=Мавзӯъҳои GTK 2.x
Name[tr]=GTK 2.x Temaları
Name[uk]=Теми GTK 2.x
Name[x-test]=xxGTK 2.x Themesxx
Name[zh_CN]=GTK 2.x 主题
Name[zh_TW]=GTK 2.x 主題
Categories=GTK 2.x Theme/Style
Name=GTK 3.x Themes
Name[ar]=سمات جتك الثّالثة
Name[ast]=Estilos pa GTK 3.x
Name[ca]=Temes GTK 3.x
Name[ca@valencia]=Temes GTK 3.x
Name[cs]=Motivy GTK 3.x
Name[da]=GTK 3.x-temaer
Name[de]=GTK 3.x-Designs
Name[el]=Θέματα GTK 3.x
Name[en_GB]=GTK 3.x Themes
Name[es]=Temas de GTK 3.x
Name[et]=GTK 3.x teemad
Name[eu]=GTK 3.x gaiak
Name[ia]=Themas de GTK 3.x
Name[fi]=GTK 3.x -teemat
Name[fr]=Thèmes GTK 3.x
Name[gl]=Temas de GTK 3.x
Name[he]=ערכות נושא של GTK 3.x
Name[hu]=GTK 3.x témák
Name[id]=Tema GTK 3.x
Name[it]=Temi GTK 3.x
Name[ko]=GTK 3.x 테마
Name[lt]=GTK 3.x apipavidalinimai
Name[nl]=GTK 3.x thema's
Name[nn]=GTK 3.x-tema
Name[pl]=Wygląd GTK 3.x
Name[pt]=Temas do GTK 3.x
Name[pt_BR]=Temas GTK 3.x
Name[ru]=Темы GTK 3.x
Name[sk]=GTK 3.x Témy
Name[sk]=Témy GTK 3.x
Name[sl]=Teme GTK 3.x
Name[sr]=ГТК 3.x теме
Name[sr@ijekavian]=ГТК 3.x теме
Name[sr@ijekavianlatin]=GTK 3.x teme
Name[sr@latin]=GTK 3.x teme
Name[sv]=GTK 3.x-teman
Name[tg]=Мавзӯъҳои GTK 3.x
Name[tr]=GTK 3.x Temaları
Name[uk]=Теми GTK 3.x
Name[x-test]=xxGTK 3.x Themesxx
Name[zh_CN]=GTK 3.x 主题
Name[zh_TW]=GTK 3.x 主題
Categories=GTK 3.x Theme/Style
......@@ -79,32 +79,20 @@ void GtkPage::showGtk3Preview()"showGtk3ThemePreview"), m_gtk3ThemesModel->selectedTheme());
void GtkPage::installGtk2ThemeFromGHNS()
void GtkPage::onThemeRemoved()
KNS3::DownloadDialog downloadDialog(QStringLiteral("cgctheme.knsrc"));
downloadDialog.setWindowTitle(i18n("Download New GNOME/GTK2 Application Styles"));
if (downloadDialog.exec()) {
void GtkPage::installGtk3ThemeFromGHNS()
void GtkPage::onGhnsEntriesChanged(const QQmlListReference &changedEnties)
KNS3::DownloadDialog downloadDialog(QStringLiteral("cgcgtk3.knsrc"));
downloadDialog.setWindowTitle(i18n("Download New GNOME/GTK3 Application Styles"));
if (downloadDialog.exec()) {
if (changedEnties.count() == 0) {
void GtkPage::onThemeRemoved()
void GtkPage::installGtkThemeFromFile(const QUrl &fileUrl)
......@@ -22,6 +22,7 @@
#include <QObject>
#include <QDBusInterface>
#include <QQmlListReference>
#include "gtkthemesmodel.h"
......@@ -48,10 +49,9 @@ public Q_SLOTS:
void showGtk3Preview();
void installGtkThemeFromFile(const QUrl &fileUrl);
void installGtk2ThemeFromGHNS();
void installGtk3ThemeFromGHNS();
void onThemeRemoved();
void onGhnsEntriesChanged(const QQmlListReference &changedEnties);
void gtk2ThemesModelChanged(GtkThemesModel *model);
......@@ -33,7 +33,6 @@ class GtkThemesModel : public QAbstractListModel {
GtkThemesModel(QObject *parent = nullptr);
~GtkThemesModel() override = default;
enum Roles {
ThemeNameRole = Qt::UserRole + 1,
......@@ -24,6 +24,7 @@ import QtQuick.Dialogs 1.0 as QtDialogs
import QtQuick.Controls 2.10 as QtControls
import org.kde.kirigami 2.10 as Kirigami
import 1.0 as Private
import org.kde.newstuff 1.62 as NewStuff
import org.kde.kcm 1.2 as KCM
Kirigami.Page {
......@@ -151,7 +152,7 @@ Kirigami.Page {
QtControls.Button { "get-hot-new-stuff"
text: i18n("Get New GNOME/GTK Application Styles...")
text: i18n("Download New GNOME/GTK Application Styles...")
QtControls.Menu {
......@@ -159,21 +160,40 @@ Kirigami.Page {
QtControls.MenuItem { "get-hot-new-stuff"
text: i18n("Get New GNOME/GTK2 Application Styles...")
text: i18n("Download New GNOME/GTK2 Application Styles...")
onClicked: function() {
NewStuff.Button {
id: gtk2NewStuffButton
downloadNewWhat: i18n("GNOME/GTK2 Application Styles")
configFile: "gtk2_themes.knsrc"
viewMode: NewStuff.Page.ViewMode.Preview
onChangedEntriesChanged: kcm.gtkPage.onGhnsEntriesChanged(gtk2NewStuffButton.changedEntries);
visible: false
QtControls.MenuItem { "get-hot-new-stuff"
text: i18n("Get New GNOME/GTK3 Application Styles...")
text: i18n("Download New GNOME/GTK3 Application Styles...")
onClicked: function() {
NewStuff.Button {
id: gtk3NewStuffButton
downloadNewWhat: i18n("GNOME/GTK3 Application Styles")
configFile: "gtk3_themes.knsrc"
viewMode: NewStuff.Page.ViewMode.Preview
onChangedEntriesChanged: kcm.gtkPage.onGhnsEntriesChanged(gtk3NewStuffButton.changedEntries);
visible: false
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