Commit 0a0996ca authored by Frerich Raabe's avatar Frerich Raabe

- Made the More and Fewer buttons do something

svn path=/trunk/kdemultimedia/juk/; revision=242492
parent f544ffd7
......@@ -70,8 +70,13 @@ AdvancedSearchDialog::AdvancedSearchDialog(const QString &defaultName,
l->addStretch(1);
l->addWidget(new KPushButton(i18n("More"), buttons));
l->addWidget(new KPushButton(i18n("Fewer"), buttons));
m_moreButton = new KPushButton(i18n("More"), buttons);
connect(m_moreButton, SIGNAL(clicked()), SLOT(more()));
l->addWidget(m_moreButton);
m_fewerButton = new KPushButton(i18n("Fewer"), buttons);
connect(m_fewerButton, SIGNAL(clicked()), SLOT(fewer()));
l->addWidget(m_fewerButton);
}
AdvancedSearchDialog::~AdvancedSearchDialog()
......@@ -122,4 +127,30 @@ void AdvancedSearchDialog::clear()
(*it)->clear();
}
void AdvancedSearchDialog::more()
{
SearchLine *searchLine = new SearchLine(m_criteria);
m_searchLines.append(searchLine);
searchLine->show();
updateButtons();
}
void AdvancedSearchDialog::fewer()
{
SearchLine *searchLine = m_searchLines.last();
m_searchLines.remove(searchLine);
delete searchLine;
updateButtons();
}
////////////////////////////////////////////////////////////////////////////////
// private methods
////////////////////////////////////////////////////////////////////////////////
void AdvancedSearchDialog::updateButtons()
{
m_moreButton->setEnabled(m_searchLines.count() < 16);
m_fewerButton->setEnabled(m_searchLines.count() > 1);
}
#include "advancedsearchdialog.moc"
......@@ -23,6 +23,7 @@
#include "playlistsearch.h"
class KLineEdit;
class KPushButton;
class QGroupBox;
class QRadioButton;
class SearchLine;
......@@ -51,8 +52,12 @@ public slots:
protected slots:
virtual void accept();
virtual void clear();
virtual void more();
virtual void fewer();
private:
void updateButtons();
QWidget *m_criteria;
PlaylistSearch m_search;
QString m_playlistName;
......@@ -60,6 +65,8 @@ private:
KLineEdit *m_playlistNameLineEdit;
QRadioButton *m_matchAnyButton;
QRadioButton *m_matchAllButton;
KPushButton *m_moreButton;
KPushButton *m_fewerButton;
};
#endif
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