#include "pirkeysetwidgetitem.h"
#include "dialogs/pireditkeysetdialog.h"
+// Debugging include:
+//#include <iostream>
+
extern PIRMakeMgr makeManager;
PIRSelectKeysetForm::PIRSelectKeysetForm(
ui(new Ui::PIRSelectKeysetForm),
mainWindow(mw),
editDialog(0),
+ showOnlyFavorites(false),
currentMake(Any_Make)
{
ui->setupUi(this);
// Does the keylist have the required make?
if ((currentMake == Any_Make) || (item->getMake() == currentMake))
{
- // Does this keylist match the search string?
- if ( searchString.isEmpty()
- || item->text().contains(searchString, Qt::CaseInsensitive))
+ // If required, is the keyset a favorite?
+ if (!showOnlyFavorites || (item->isFavorite()))
{
- // Yes, we can show this keylist:
- item->setHidden(false);
+ // Does this keylist match the search string?
+ if ( searchString.isEmpty()
+ || item->text().contains(searchString, Qt::CaseInsensitive))
+ {
+ // Yes, we can show this keylist:
+ item->setHidden(false);
+ }
+ else
+ {
+ item->setHidden(true);
+ }
}
else
{
editDialog->exec();
}
+
+
+void PIRSelectKeysetForm::on_showFavoritesCheckBox_toggled(bool checked)
+{
+ showOnlyFavorites = checked;
+ refilterList();
+}