Added simple page size filtering.

This commit is contained in:
Jim Evins
2013-11-13 00:04:00 -05:00
parent 5ce9121801
commit 1c02315db9
7 changed files with 77 additions and 17 deletions
+29 -1
View File
@@ -30,17 +30,45 @@ namespace gLabels
{
setupUi( this );
// TODO: Set default based on locale
pageSizeIsoRadio->setChecked( true );
QList<libglabels::Template*> tmplates = libglabels::Db::templates();
templatePicker->setTemplates( tmplates );
templatePicker->applyFilter( searchEntry->text(),
pageSizeIsoRadio->isChecked(),
pageSizeUsRadio->isChecked(),
pageSizeOtherRadio->isChecked() );
connect( searchEntry, SIGNAL(textChanged(const QString &)),
this, SLOT(searchEntryTextChanged(const QString &)) );
connect( pageSizeIsoRadio, SIGNAL(toggled(bool)), this, SLOT(pageSizeRadioToggled(bool)) );
connect( pageSizeUsRadio, SIGNAL(toggled(bool)), this, SLOT(pageSizeRadioToggled(bool)) );
connect( pageSizeOtherRadio, SIGNAL(toggled(bool)), this, SLOT(pageSizeRadioToggled(bool)) );
}
void NewLabelDialog::searchEntryTextChanged( const QString &text )
{
templatePicker->applyFilter( text );
templatePicker->applyFilter( text,
pageSizeIsoRadio->isChecked(),
pageSizeUsRadio->isChecked(),
pageSizeOtherRadio->isChecked() );
}
void NewLabelDialog::pageSizeRadioToggled( bool checked )
{
if ( checked )
{
templatePicker->applyFilter( searchEntry->text(),
pageSizeIsoRadio->isChecked(),
pageSizeUsRadio->isChecked(),
pageSizeOtherRadio->isChecked() );
}
}
}