PropertiesView and View now follow Settings::units.

This commit is contained in:
Jim Evins
2016-04-14 23:10:38 -04:00
parent 2f7f4b2041
commit 783ede0a03
28 changed files with 559 additions and 258 deletions
+18 -1
View File
@@ -21,6 +21,7 @@
#include "PropertiesView.h"
#include "LabelModel.h"
#include "Settings.h"
#include "libglabels/Db.h"
#include "SelectProductDialog.h"
@@ -37,6 +38,9 @@ PropertiesView::PropertiesView( QWidget *parent )
similarBrowser->setAttribute(Qt::WA_TranslucentBackground);
similarBrowser->viewport()->setAutoFillBackground(false);
connect( Settings::instance(), SIGNAL(changed()), this, SLOT(onSettingsChanged()) );
onSettingsChanged();
}
@@ -61,6 +65,19 @@ void PropertiesView::setModel( LabelModel* model )
}
///
/// Settings changed handler
///
void PropertiesView::onSettingsChanged()
{
mUnits = Settings::units();
if (mModel)
{
onLabelSizeChanged();
}
}
///
/// Label size changed handler
///
@@ -99,7 +116,7 @@ void PropertiesView::onLabelSizeChanged()
QString pgSizeString = glabels::Db::lookupPaperNameFromId( tmplate->paperId() );
pageSizeLabel->setText( pgSizeString );
QString labelSizeString = frame->sizeDescription( glabels::Distance::Units::IN );
QString labelSizeString = frame->sizeDescription( mUnits );
labelSizeLabel->setText( labelSizeString );
QString layoutString = frame->layoutDescription();