Changeset View
Changeset View
Standalone View
Standalone View
kcms/lookandfeel/kcm.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 56 | KCMLookandFeel::KCMLookandFeel(QObject* parent, const QVariantList& args) | |||
---|---|---|---|---|---|
68 | , m_applyWindowDecoration(true) | 68 | , m_applyWindowDecoration(true) | ||
69 | { | 69 | { | ||
70 | //This flag seems to be needed in order for QQuickWidget to work | 70 | //This flag seems to be needed in order for QQuickWidget to work | ||
71 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | 71 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | ||
72 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | 72 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | ||
73 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | 73 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | ||
74 | qmlRegisterType<QStandardItemModel>(); | 74 | qmlRegisterType<QStandardItemModel>(); | ||
75 | qmlRegisterType<KCMLookandFeel>(); | 75 | qmlRegisterType<KCMLookandFeel>(); | ||
76 | KAboutData* about = new KAboutData(QStringLiteral("kcm_lookandfeel"), i18n("Look and Feel"), | 76 | KAboutData* about = new KAboutData(QStringLiteral("kcm_lookandfeel"), i18n("Global Theme"), | ||
77 | QStringLiteral("0.1"), QString(), KAboutLicense::LGPL); | 77 | QStringLiteral("0.1"), QString(), KAboutLicense::LGPL); | ||
78 | about->addAuthor(i18n("Marco Martin"), QString(), QStringLiteral("mart@kde.org")); | 78 | about->addAuthor(i18n("Marco Martin"), QString(), QStringLiteral("mart@kde.org")); | ||
79 | setAboutData(about); | 79 | setAboutData(about); | ||
80 | setButtons(Apply | Default); | 80 | setButtons(Apply | Default); | ||
81 | 81 | | |||
82 | m_model = new QStandardItemModel(this); | 82 | m_model = new QStandardItemModel(this); | ||
83 | QHash<int, QByteArray> roles = m_model->roleNames(); | 83 | QHash<int, QByteArray> roles = m_model->roleNames(); | ||
84 | roles[PluginNameRole] = "pluginName"; | 84 | roles[PluginNameRole] = "pluginName"; | ||
Show All 19 Lines | |||||
104 | KCMLookandFeel::~KCMLookandFeel() | 104 | KCMLookandFeel::~KCMLookandFeel() | ||
105 | { | 105 | { | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | void KCMLookandFeel::getNewStuff(QQuickItem *ctx) | 108 | void KCMLookandFeel::getNewStuff(QQuickItem *ctx) | ||
109 | { | 109 | { | ||
110 | if (!m_newStuffDialog) { | 110 | if (!m_newStuffDialog) { | ||
111 | m_newStuffDialog = new KNS3::DownloadDialog( QLatin1String("lookandfeel.knsrc") ); | 111 | m_newStuffDialog = new KNS3::DownloadDialog( QLatin1String("lookandfeel.knsrc") ); | ||
112 | m_newStuffDialog.data()->setWindowTitle(i18n("Download New Look and Feel Themes")); | 112 | m_newStuffDialog.data()->setWindowTitle(i18n("Download New Global Themes")); | ||
113 | m_newStuffDialog->setWindowModality(Qt::WindowModal); | 113 | m_newStuffDialog->setWindowModality(Qt::WindowModal); | ||
114 | m_newStuffDialog->winId(); // so it creates the windowHandle(); | 114 | m_newStuffDialog->winId(); // so it creates the windowHandle(); | ||
115 | connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, &KCMLookandFeel::loadModel); | 115 | connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, &KCMLookandFeel::loadModel); | ||
116 | } | 116 | } | ||
117 | 117 | | |||
118 | if (ctx && ctx->window()) { | 118 | if (ctx && ctx->window()) { | ||
119 | m_newStuffDialog->windowHandle()->setTransientParent(ctx->window()); | 119 | m_newStuffDialog->windowHandle()->setTransientParent(ctx->window()); | ||
120 | } | 120 | } | ||
▲ Show 20 Lines • Show All 714 Lines • Show Last 20 Lines |