Added SimplePreview to NewLabelDialog.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "NewLabelDialog.h"
|
||||
|
||||
#include "libglabels/Db.h"
|
||||
#include "TemplatePickerItem.h"
|
||||
|
||||
|
||||
namespace gLabels
|
||||
@@ -48,6 +49,7 @@ namespace gLabels
|
||||
connect( pageSizeUsRadio, SIGNAL(toggled(bool)), this, SLOT(pageSizeRadioToggled(bool)) );
|
||||
connect( pageSizeOtherRadio, SIGNAL(toggled(bool)), this, SLOT(pageSizeRadioToggled(bool)) );
|
||||
|
||||
connect( templatePicker, SIGNAL(itemSelectionChanged()), this, SLOT(templatePickerSelectionChanged()) );
|
||||
}
|
||||
|
||||
|
||||
@@ -71,4 +73,22 @@ namespace gLabels
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void NewLabelDialog::templatePickerSelectionChanged()
|
||||
{
|
||||
QList<QListWidgetItem *> selectedItems = templatePicker->selectedItems();
|
||||
|
||||
if ( selectedItems.isEmpty() )
|
||||
{
|
||||
// Clear preview
|
||||
simplePreview->setTemplate( NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set template to preview
|
||||
TemplatePickerItem *tItem = dynamic_cast<TemplatePickerItem*>(selectedItems.first());
|
||||
simplePreview->setTemplate( tItem->tmplate() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user