Control orientation of labels in NewLabelDialog.

This commit is contained in:
Jim Evins
2013-11-17 12:12:36 -05:00
parent 64a9076b18
commit d4541d396e
4 changed files with 69 additions and 43 deletions
+18
View File
@@ -55,6 +55,9 @@ namespace gLabels
connect( pageSizeOtherRadio, SIGNAL(toggled(bool)), this, SLOT(pageSizeRadioToggled(bool)) );
connect( templatePicker, SIGNAL(itemSelectionChanged()), this, SLOT(templatePickerSelectionChanged()) );
connect( orientationNormalRadio, SIGNAL(toggled(bool)), this, SLOT(orientationRadioToggled(bool)) );
connect( orientationRotatedRadio, SIGNAL(toggled(bool)), this, SLOT(orientationRadioToggled(bool)) );
}
@@ -81,6 +84,8 @@ namespace gLabels
void NewLabelDialog::templatePickerSelectionChanged()
{
orientationNormalRadio->setChecked( true );
QList<QListWidgetItem *> selectedItems = templatePicker->selectedItems();
if ( selectedItems.isEmpty() )
@@ -97,6 +102,7 @@ namespace gLabels
const libglabels::Frame *frame = tmplate->frames().first();
simplePreview->setTemplate( tmplate );
simplePreview->setRotate( false );
const libglabels::Vendor *vendor = libglabels::Db::lookupVendorFromName( tmplate->brand() );
if ( (vendor != NULL) && (vendor->url() != NULL) )
@@ -148,7 +154,19 @@ namespace gLabels
}
similarBrowser->setText( similarListString );
}
orientationGroupBox->setEnabled( frame->w() != frame->h() );
}
}
void NewLabelDialog::orientationRadioToggled( bool checked )
{
if ( checked )
{
simplePreview->setRotate( orientationRotatedRadio->isChecked() );
}
}
}