Commit 7e3b8880 authored by Oleg Solovyov's avatar Oleg Solovyov 🐴 Committed by Albert Astals Cid
Browse files

Replace GHNS button with KNS3 class

parent 61017ebb
......@@ -114,15 +114,10 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="m_buttonGetNewThemes">
<widget class="KNS3::Button" name="m_buttonGetNewThemes">
<property name="text">
<string>Get New Themes...</string>
</property>
<property name="icon">
<iconset theme="edit-download">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
......@@ -155,4 +150,11 @@
</widget>
<resources/>
<connections/>
<customwidgets>
<customwidget>
<class>KNS3::Button</class>
<extends>QPushButton</extends>
<header>KNS3/Button</header>
</customwidget>
</customwidgets>
</ui>
......@@ -20,7 +20,6 @@
#include <KUrlRequester>
#include <KUrlRequesterDialog>
#include <KMessageBox>
#include <KNS3/DownloadDialog>
#include <QFile>
#include <QFileInfo>
......@@ -49,8 +48,12 @@ K3b::ThemeOptionTab::ThemeOptionTab( QWidget* parent )
this, SLOT(slotInstallTheme()) );
connect( m_buttonRemoveTheme, SIGNAL(clicked()),
this, SLOT(slotRemoveTheme()) );
connect( m_buttonGetNewThemes, SIGNAL(clicked()),
this, SLOT(slotGetNewThemes()) );
connect(m_buttonGetNewThemes, &KNS3::Button::dialogFinished, this, [this] (const QList<KNS3::Entry> &changedEntries) {
if (!changedEntries.isEmpty()) {
m_themeModel->reload();
}
});
m_buttonGetNewThemes->setConfigFile("k3btheme.knsrc");
}
......@@ -211,12 +214,3 @@ void K3b::ThemeOptionTab::slotRemoveTheme()
readSettings();
}
}
void K3b::ThemeOptionTab::slotGetNewThemes()
{
QPointer<KNS3::DownloadDialog> dialog = new KNS3::DownloadDialog( QStringLiteral("k3btheme.knsrc"), this );
dialog->exec();
if ( dialog && !dialog->changedEntries().isEmpty() )
m_themeModel->reload();
delete dialog;
}
......@@ -36,7 +36,6 @@ namespace K3b {
void selectionChanged();
void slotInstallTheme();
void slotRemoveTheme();
void slotGetNewThemes();
private:
ThemeModel* m_themeModel;
......
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