Changeset View
Changeset View
Standalone View
Standalone View
kcms/desktoptheme/kcm.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 50 | KCMDesktopTheme::KCMDesktopTheme(QObject *parent, const QVariantList &args) | |||
---|---|---|---|---|---|
53 | , m_haveThemeExplorerInstalled(false) | 53 | , m_haveThemeExplorerInstalled(false) | ||
54 | { | 54 | { | ||
55 | //This flag seems to be needed in order for QQuickWidget to work | 55 | //This flag seems to be needed in order for QQuickWidget to work | ||
56 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | 56 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | ||
57 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | 57 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | ||
58 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | 58 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | ||
59 | qmlRegisterType<QStandardItemModel>(); | 59 | qmlRegisterType<QStandardItemModel>(); | ||
60 | 60 | | |||
61 | KAboutData* about = new KAboutData(QStringLiteral("kcm_desktoptheme"), i18n("Plasma Theme"), | 61 | KAboutData* about = new KAboutData(QStringLiteral("kcm_desktoptheme"), i18n("Plasma Style"), | ||
62 | QStringLiteral("0.1"), QString(), KAboutLicense::LGPL); | 62 | QStringLiteral("0.1"), QString(), KAboutLicense::LGPL); | ||
63 | about->addAuthor(i18n("David Rosca"), QString(), QStringLiteral("nowrep@gmail.com")); | 63 | about->addAuthor(i18n("David Rosca"), QString(), QStringLiteral("nowrep@gmail.com")); | ||
64 | setAboutData(about); | 64 | setAboutData(about); | ||
65 | setButtons(Apply | Default | Help); | 65 | setButtons(Apply | Default | Help); | ||
66 | 66 | | |||
67 | m_model = new QStandardItemModel(this); | 67 | m_model = new QStandardItemModel(this); | ||
68 | QHash<int, QByteArray> roles = m_model->roleNames(); | 68 | QHash<int, QByteArray> roles = m_model->roleNames(); | ||
69 | roles[PluginNameRole] = QByteArrayLiteral("pluginName"); | 69 | roles[PluginNameRole] = QByteArrayLiteral("pluginName"); | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 121 | { | |||
131 | 131 | | |||
132 | updateNeedsSave(); | 132 | updateNeedsSave(); | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | void KCMDesktopTheme::getNewStuff(QQuickItem *ctx) | 135 | void KCMDesktopTheme::getNewStuff(QQuickItem *ctx) | ||
136 | { | 136 | { | ||
137 | if (!m_newStuffDialog) { | 137 | if (!m_newStuffDialog) { | ||
138 | m_newStuffDialog = new KNS3::DownloadDialog(QStringLiteral("plasma-themes.knsrc")); | 138 | m_newStuffDialog = new KNS3::DownloadDialog(QStringLiteral("plasma-themes.knsrc")); | ||
139 | m_newStuffDialog.data()->setWindowTitle(i18n("Download New Plasma Themes")); | 139 | m_newStuffDialog.data()->setWindowTitle(i18n("Download New Plasma Styles")); | ||
140 | m_newStuffDialog->setWindowModality(Qt::WindowModal); | 140 | m_newStuffDialog->setWindowModality(Qt::WindowModal); | ||
141 | m_newStuffDialog->winId(); // so it creates the windowHandle(); | 141 | m_newStuffDialog->winId(); // so it creates the windowHandle(); | ||
142 | connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, &KCMDesktopTheme::load); | 142 | connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, &KCMDesktopTheme::load); | ||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | if (ctx && ctx->window()) { | 145 | if (ctx && ctx->window()) { | ||
146 | m_newStuffDialog->windowHandle()->setTransientParent(ctx->window()); | 146 | m_newStuffDialog->windowHandle()->setTransientParent(ctx->window()); | ||
147 | } | 147 | } | ||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |