Commit 5e1c0285 authored by Oleg Solovyov's avatar Oleg Solovyov 🐴 Committed by Alexander Semke
Browse files

Use KNSWidgets::{Action,Button} classes

parent 03a0e82d
Pipeline #208220 passed with stage
in 4 minutes and 59 seconds
......@@ -10,7 +10,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(cantor VERSION ${RELEASE_SERVICE_VERSION})
set(KF5_MIN_VERSION "5.70.0")
set(KF5_MIN_VERSION "5.91.0")
find_package(ECM 5.15.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${cantor_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
......
......@@ -38,7 +38,7 @@ file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../icons/*-apps-cantor.png")
ecm_add_app_icon(cantor_SRCS ICONS ${ICONS_SRCS})
add_executable(cantor ${cantor_SRCS})
target_link_libraries(cantor KF5::Parts KF5::NewStuff KF5::ConfigCore KF5::CoreAddons KF5::ConfigGui
target_link_libraries(cantor KF5::Parts KF5::NewStuffWidgets KF5::ConfigCore KF5::CoreAddons KF5::ConfigGui
KF5::Crash KF5::XmlGui Qt5::WebEngine cantorlibs cantor_config)
########### install files ###############
......
......@@ -21,7 +21,7 @@ ki18n_wrap_ui(cantor_HELP qthelpconfig.ui)
ki18n_wrap_ui(cantor_HELP qthelpconfigeditdialog.ui)
add_library(cantor_help STATIC ${cantor_HELP})
target_link_libraries(cantor_help KF5::SyntaxHighlighting KF5::I18n KF5::IconThemes KF5::NewStuff KF5::KIOWidgets Qt5::Help)
target_link_libraries(cantor_help KF5::SyntaxHighlighting KF5::I18n KF5::IconThemes KF5::NewStuffWidgets KF5::KIOWidgets Qt5::Help)
if(NOT WIN32)
add_subdirectory(sage)
......
......@@ -13,7 +13,7 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KMessageBox>
#include <KNS3/Button>
#include <KNSWidgets/Button>
#include <KSharedConfig>
#include "qthelpconfig.h"
......@@ -97,12 +97,12 @@ QtHelpConfig::QtHelpConfig(const QString& backend) : QWidget(), m_backend(backen
m_treeWidget->header()->setSectionResizeMode(ConfigColumn, QHeaderView::Fixed);
// Add GHNS button
auto* knsButton = new KNS3::Button(i18nc("@action:button Allow user to get some API documentation with GHNS", "Get New Documentation"),
auto* knsButton = new KNSWidgets::Button(i18nc("@action:button Allow user to get some API documentation with GHNS", "Get New Documentation"),
QStringLiteral("cantor-documentation.knsrc"),
this);
knsButton->setToolTip(i18n("Download additional documentations"));
ui->tableCtrlLayout->insertWidget(1, knsButton);
connect(knsButton, &KNS3::Button::dialogFinished, this, &QtHelpConfig::knsUpdate);
connect(knsButton, &KNSWidgets::Button::dialogFinished, this, &QtHelpConfig::knsUpdate);
connect(this, &QtHelpConfig::settingsChanged, this, &QtHelpConfig::saveSettings);
......@@ -194,7 +194,7 @@ void QtHelpConfig::remove(QTreeWidgetItem* item)
emit settingsChanged();
}
void QtHelpConfig::knsUpdate(const KNS3::Entry::List& list)
void QtHelpConfig::knsUpdate(const QList<KNSCore::Entry>& list)
{
if (list.isEmpty())
return;
......
......@@ -8,7 +8,7 @@
#define QTHELPCONFIG_H
#include <QWidget>
#include <KNS3/Entry>
#include <KNSWidgets/Button>
class QTreeWidget;
class QTreeWidgetItem;
......@@ -30,7 +30,7 @@ class QtHelpConfig : public QWidget
void add();
void remove(QTreeWidgetItem*);
void modify(QTreeWidgetItem*);
void knsUpdate(const KNS3::Entry::List&);
void knsUpdate(const QList<KNSCore::Entry> &list);
void saveSettings();
private:
......
......@@ -15,7 +15,7 @@
#include <KMessageBox>
#include <KShortcutsDialog>
#include <KStandardAction>
#include <KNS3/DownloadDialog>
#include <KNSWidgets/Action>
#include <KParts/ReadWritePart>
#include <KRecentFilesAction>
#include <KPluginFactory>
......@@ -143,10 +143,8 @@ void CantorShell::setupActions()
KStandardAction::preferences(this, SLOT(showSettings()), actionCollection());
QAction* downloadExamples = new QAction(i18n("Download Examples"), actionCollection());
downloadExamples->setIcon(QIcon::fromTheme(QLatin1String("get-hot-new-stuff")));
actionCollection()->addAction(QLatin1String("file_example_download"), downloadExamples);
connect(downloadExamples, &QAction::triggered, this, &CantorShell::downloadExamples);
KNSWidgets::Action* downloadExamples = new KNSWidgets::Action(i18n("Download Examples"), QStringLiteral("cantor.knsrc"), actionCollection());
actionCollection()->addAction(QLatin1String("file_example_download"), downloadExamples);
QAction* openExample = new QAction(i18n("&Open Example"), actionCollection());
openExample->setIcon(QIcon::fromTheme(QLatin1String("document-open")));
......@@ -643,16 +641,6 @@ void CantorShell::showSettings()
connect(dialog, &KConfigDialog::settingsChanged, this, &CantorShell::settingsChanges);
}
void CantorShell::downloadExamples()
{
KNS3::DownloadDialog dialog;
dialog.exec();
for (const auto& e : dialog.changedEntries())
{
qDebug() << "Changed Entry: " << e.name();
}
}
void CantorShell::openExample()
{
QString dir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/examples");
......
......@@ -91,7 +91,6 @@ private Q_SLOTS:
void showSettings();
void downloadExamples();
void openExample();
void initPanels();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment