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
Kanagram
Commits
65cda3b7
Commit
65cda3b7
authored
Nov 10, 2021
by
Oleg Solovyov
🐴
Committed by
Albert Astals Cid
Nov 17, 2021
Browse files
Replace GHNS button with KNS3 instance
parent
cff231d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/vocabsettings.cpp
View file @
65cda3b7
...
...
@@ -21,7 +21,6 @@
#include
"vocabsettings.h"
#include
<KConfigDialog>
#include
<KNS3/DownloadDialog>
#include
<sharedkvtmlfiles.h>
...
...
@@ -39,7 +38,12 @@ VocabSettings::VocabSettings(QWidget *parent)
connect
(
lviewVocab
,
&
QTreeWidget
::
currentItemChanged
,
this
,
&
VocabSettings
::
slotSelectionChanged
);
btnDownloadNew
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"get-hot-new-stuff"
)));
connect
(
btnDownloadNew
,
&
KNS3
::
Button
::
dialogFinished
,
this
,
[
this
]
(
const
QList
<
KNS3
::
Entry
>
&
changedEntries
)
{
if
(
!
changedEntries
.
isEmpty
())
{
refreshView
();
}
});
btnDownloadNew
->
setConfigFile
(
"kanagram.knsrc"
);
refreshView
();
}
...
...
@@ -91,17 +95,6 @@ void VocabSettings::on_btnCreateNew_clicked()
vocabEdit
->
show
();
}
void
VocabSettings
::
on_btnDownloadNew_clicked
()
{
QPointer
<
KNS3
::
DownloadDialog
>
dialog
=
new
KNS3
::
DownloadDialog
(
QStringLiteral
(
"kanagram.knsrc"
)
);
dialog
->
exec
();
if
(
dialog
->
changedEntries
().
size
()
>
0
){
refreshView
();
}
delete
dialog
;
}
void
VocabSettings
::
slotSelectionChanged
(
QTreeWidgetItem
*
item
)
{
int
index
=
m_itemMap
.
value
(
item
);
...
...
src/vocabsettings.h
View file @
65cda3b7
...
...
@@ -50,7 +50,6 @@ Q_OBJECT
* called when the btnCreateNew is clicked
*/
void
on_btnCreateNew_clicked
();
void
on_btnDownloadNew_clicked
();
void
on_btnEdit_clicked
();
void
slotSelectionChanged
(
QTreeWidgetItem
*
item
);
...
...
src/vocabsettingswidget.ui
View file @
65cda3b7
...
...
@@ -53,7 +53,7 @@
</widget>
</item>
<item>
<widget
class=
"
QPush
Button"
name=
"btnDownloadNew"
>
<widget
class=
"
KNS3::
Button"
name=
"btnDownloadNew"
>
<property
name=
"toolTip"
>
<string>
Download new vocabulary from
"
Get hot new Stuff
"
</string>
</property>
...
...
@@ -103,4 +103,11 @@
</widget>
<resources/>
<connections/>
<customwidgets>
<customwidget>
<class>
KNS3::Button
</class>
<extends>
QPushButton
</extends>
<header>
KNS3/Button
</header>
</customwidget>
</customwidgets>
</ui>
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