Commit 65cda3b7 authored by Oleg Solovyov's avatar Oleg Solovyov 🐴 Committed by Albert Astals Cid
Browse files

Replace GHNS button with KNS3 instance

parent cff231d1
......@@ -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);
......
......@@ -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);
......
......@@ -53,7 +53,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="btnDownloadNew">
<widget class="KNS3::Button" name="btnDownloadNew">
<property name="toolTip">
<string>Download new vocabulary from &quot;Get hot new Stuff&quot;</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>
Markdown is supported
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