Changeset View
Changeset View
Standalone View
Standalone View
kcms/desktoptheme/kcm.cpp
Show All 34 Lines | |||||
35 | #include <QDebug> | 35 | #include <QDebug> | ||
36 | #include <QProcess> | 36 | #include <QProcess> | ||
37 | #include <QQuickItem> | 37 | #include <QQuickItem> | ||
38 | #include <QQuickWindow> | 38 | #include <QQuickWindow> | ||
39 | #include <QStandardPaths> | 39 | #include <QStandardPaths> | ||
40 | #include <QStandardItemModel> | 40 | #include <QStandardItemModel> | ||
41 | #include <QTemporaryFile> | 41 | #include <QTemporaryFile> | ||
42 | 42 | | |||
43 | #include <KNewStuff3/KNS3/DownloadDialog> | | |||
44 | | ||||
45 | #include "desktopthemesettings.h" | 43 | #include "desktopthemesettings.h" | ||
46 | #include "filterproxymodel.h" | 44 | #include "filterproxymodel.h" | ||
47 | #include "themesmodel.h" | 45 | #include "themesmodel.h" | ||
48 | 46 | | |||
49 | Q_LOGGING_CATEGORY(KCM_DESKTOP_THEME, "kcm_desktoptheme") | 47 | Q_LOGGING_CATEGORY(KCM_DESKTOP_THEME, "kcm_desktoptheme") | ||
50 | 48 | | |||
51 | K_PLUGIN_FACTORY_WITH_JSON(KCMDesktopThemeFactory, "kcm_desktoptheme.json", registerPlugin<KCMDesktopTheme>();) | 49 | K_PLUGIN_FACTORY_WITH_JSON(KCMDesktopThemeFactory, "kcm_desktoptheme.json", registerPlugin<KCMDesktopTheme>();) | ||
52 | 50 | | |||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 100 | { | |||
103 | return m_filteredModel; | 101 | return m_filteredModel; | ||
104 | } | 102 | } | ||
105 | 103 | | |||
106 | bool KCMDesktopTheme::downloadingFile() const | 104 | bool KCMDesktopTheme::downloadingFile() const | ||
107 | { | 105 | { | ||
108 | return m_tempCopyJob; | 106 | return m_tempCopyJob; | ||
109 | } | 107 | } | ||
110 | 108 | | |||
111 | void KCMDesktopTheme::getNewStuff(QQuickItem *ctx) | | |||
112 | { | | |||
113 | if (!m_newStuffDialog) { | | |||
114 | m_newStuffDialog = new KNS3::DownloadDialog(QStringLiteral("plasma-themes.knsrc")); | | |||
115 | m_newStuffDialog.data()->setWindowTitle(i18n("Download New Plasma Styles")); | | |||
116 | m_newStuffDialog->setWindowModality(Qt::WindowModal); | | |||
117 | m_newStuffDialog->winId(); // so it creates the windowHandle(); | | |||
118 | connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, &KCMDesktopTheme::load); | | |||
119 | } | | |||
120 | | ||||
121 | if (ctx && ctx->window()) { | | |||
122 | m_newStuffDialog->windowHandle()->setTransientParent(ctx->window()); | | |||
123 | } | | |||
124 | | ||||
125 | m_newStuffDialog.data()->show(); | | |||
126 | } | | |||
127 | | ||||
128 | void KCMDesktopTheme::installThemeFromFile(const QUrl &url) | 109 | void KCMDesktopTheme::installThemeFromFile(const QUrl &url) | ||
129 | { | 110 | { | ||
130 | if (url.isLocalFile()) { | 111 | if (url.isLocalFile()) { | ||
131 | installTheme(url.toLocalFile()); | 112 | installTheme(url.toLocalFile()); | ||
132 | return; | 113 | return; | ||
133 | } | 114 | } | ||
134 | 115 | | |||
135 | if (m_tempCopyJob) { | 116 | if (m_tempCopyJob) { | ||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |