Added recently-used products tab to SelectProductDialog.
This commit is contained in:
@@ -52,9 +52,9 @@ void TemplatePicker::setTemplates( const QList <glabels::Template*> &tmplates )
|
||||
|
||||
|
||||
///
|
||||
/// Apply Filter to Narrow Template Choices
|
||||
/// Apply Filter to Narrow Template Choices by search criteria
|
||||
///
|
||||
void TemplatePicker::applyFilter( const QString &searchString,
|
||||
void TemplatePicker::applyFilter( const QString& searchString,
|
||||
bool isoMask, bool usMask, bool otherMask,
|
||||
bool anyCategory, const QStringList& categoryIds )
|
||||
{
|
||||
@@ -97,6 +97,38 @@ void TemplatePicker::applyFilter( const QString &searchString,
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Apply Filter to Narrow Template Choices by a list of names
|
||||
///
|
||||
void TemplatePicker::applyFilter( const QStringList& names )
|
||||
{
|
||||
foreach ( QListWidgetItem *item, findItems( "*", Qt::MatchWildcard ) )
|
||||
{
|
||||
TemplatePickerItem *tItem = dynamic_cast<TemplatePickerItem *>(item);
|
||||
|
||||
bool match = false;
|
||||
foreach ( QString name, names )
|
||||
{
|
||||
if ( tItem->tmplate()->name() == name )
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( match )
|
||||
{
|
||||
item->setHidden( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setHidden( true );
|
||||
item->setSelected( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Get Currently Selected Template
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user