Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
5e1c0285
Commit
5e1c0285
authored
Nov 09, 2021
by
Oleg Solovyov
🐴
Committed by
Alexander Semke
Jul 23, 2022
Browse files
Use KNSWidgets::{Action,Button} classes
parent
03a0e82d
Pipeline
#208220
passed with stage
in 4 minutes and 59 seconds
Changes
7
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
5e1c0285
...
...
@@ -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
}
)
...
...
src/CMakeLists.txt
View file @
5e1c0285
...
...
@@ -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::NewStuff
Widgets
KF5::ConfigCore KF5::CoreAddons KF5::ConfigGui
KF5::Crash KF5::XmlGui Qt5::WebEngine cantorlibs cantor_config
)
########### install files ###############
...
...
src/backends/CMakeLists.txt
View file @
5e1c0285
...
...
@@ -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::NewStuff
Widgets
KF5::KIOWidgets Qt5::Help
)
if
(
NOT WIN32
)
add_subdirectory
(
sage
)
...
...
src/backends/qthelpconfig.cpp
View file @
5e1c0285
...
...
@@ -13,7 +13,7 @@
#include
<KConfigGroup>
#include
<KLocalizedString>
#include
<KMessageBox>
#include
<KNS
3
/Button>
#include
<KNS
Widgets
/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
KNS
3
::
Button
(
i18nc
(
"@action:button Allow user to get some API documentation with GHNS"
,
"Get New Documentation"
),
auto
*
knsButton
=
new
KNS
Widgets
::
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
,
&
KNS
3
::
Button
::
dialogFinished
,
this
,
&
QtHelpConfig
::
knsUpdate
);
connect
(
knsButton
,
&
KNS
Widgets
::
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
;
...
...
src/backends/qthelpconfig.h
View file @
5e1c0285
...
...
@@ -8,7 +8,7 @@
#define QTHELPCONFIG_H
#include
<QWidget>
#include
<KNS
3/Entry
>
#include
<KNS
Widgets/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
::
L
ist
&
);
void
knsUpdate
(
const
QList
<
KNSCore
::
Entry
>
&
l
ist
);
void
saveSettings
();
private:
...
...
src/cantor.cpp
View file @
5e1c0285
...
...
@@ -15,7 +15,7 @@
#include
<KMessageBox>
#include
<KShortcutsDialog>
#include
<KStandardAction>
#include
<KNS
3/DownloadDialog
>
#include
<KNS
Widgets/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"
);
...
...
src/cantor.h
View file @
5e1c0285
...
...
@@ -91,7 +91,6 @@ private Q_SLOTS:
void
showSettings
();
void
downloadExamples
();
void
openExample
();
void
initPanels
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment