Use NewStuff Elements

This commit is contained in:
Oleg Solovyov 2021-11-09 14:08:26 +03:00 committed by Vlad Zahorodnii
parent 83a036e9d4
commit cd4bdaa8fe
2 changed files with 7 additions and 11 deletions

View file

@ -27,7 +27,7 @@
#include <KLocalizedString>
#include <KPluginFactory>
#include <KTitleWidget>
#include <KNewStuff3/KNS3/QtQuickDialogWrapper>
#include <KNS3/Button>
// Plasma
#include <KPackage/Package>
#include <KPackage/PackageLoader>
@ -58,8 +58,12 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
tabWidget->addTab(m_primaryTabBoxUi, i18n("Main"));
tabWidget->addTab(m_alternativeTabBoxUi, i18n("Alternative"));
QPushButton* ghnsButton = new QPushButton(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")), i18n("Get New Task Switchers..."));
connect(ghnsButton, &QAbstractButton::clicked, this, &KWinTabBoxConfig::slotGHNS);
KNS3::Button *ghnsButton = new KNS3::Button(i18n("Get New Task Switchers..."), QStringLiteral("kwinswitcher.knsrc"), this);
connect(ghnsButton, &KNS3::Button::dialogFinished, this, [this] (auto changedEntries) {
if (!changedEntries.isEmpty()) {
initLayoutLists();
}
});
QHBoxLayout* buttonBar = new QHBoxLayout();
QSpacerItem* buttonBarSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
@ -423,13 +427,6 @@ void KWinTabBoxConfig::configureEffectClicked()
}
}
void KWinTabBoxConfig::slotGHNS()
{
if (!KNS3::QtQuickDialogWrapper("kwinswitcher.knsrc").exec().isEmpty()) {
initLayoutLists();
}
}
} // namespace
#include "main.moc"

View file

@ -42,7 +42,6 @@ private Q_SLOTS:
void updateUnmanagedState();
void updateDefaultIndicator();
void configureEffectClicked();
void slotGHNS();
private:
void updateUiFromConfig(KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);