-/***************************************************************************
- * Copyright (C) 2009-2010 by Peter Penz <peter.penz19@gmail.com> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2009-2010 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#include "servicessettingspage.h"
#include <QGridLayout>
#include <QLabel>
#include <QListWidget>
+#include <QScroller>
#include <QShowEvent>
#include <QSortFilterProxyModel>
#include <QLineEdit>
});
m_listView = new QListView(this);
+ QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
+
auto *delegate = new ServiceItemDelegate(m_listView, m_listView);
m_serviceModel = new ServiceModel(this);
m_sortModel = new QSortFilterProxyModel(this);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
connect(m_listView, &QListView::clicked, this, &ServicesSettingsPage::changed);
+#ifndef Q_OS_WIN
auto *downloadButton = new KNS3::Button(i18nc("@action:button", "Download New Services..."),
QStringLiteral("servicemenu.knsrc"),
this);
- connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices);
+ connect(downloadButton, &KNS3::Button::dialogFinished, this, [this](const KNS3::Entry::List &changedEntries) {
+ if (!changedEntries.isEmpty()) {
+ m_serviceModel->clear();
+ loadServices();
+ }
+ });
+
+#endif
topLayout->addWidget(label);
topLayout->addWidget(m_searchLineEdit);
topLayout->addWidget(m_listView);
+#ifndef Q_OS_WIN
topLayout->addWidget(downloadButton);
+#endif
m_enabledVcsPlugins = VersionControlSettings::enabledPlugins();
std::sort(m_enabledVcsPlugins.begin(), m_enabledVcsPlugins.end());