diff --git a/glabels/LabelModel.cpp b/glabels/LabelModel.cpp
index 251133c..b3d7b4c 100644
--- a/glabels/LabelModel.cpp
+++ b/glabels/LabelModel.cpp
@@ -86,8 +86,12 @@ void LabelModel::restore( const LabelModel *savedModel )
mObjectList.append( object->clone() );
}
+ // Emit signals based on potential changes
emit changed();
emit selectionChanged();
+ emit modifiedChanged();
+ emit nameChanged();
+ emit sizeChanged();
}
diff --git a/glabels/PropertiesView.cpp b/glabels/PropertiesView.cpp
index 4f85cf6..9fa0a9d 100644
--- a/glabels/PropertiesView.cpp
+++ b/glabels/PropertiesView.cpp
@@ -156,32 +156,38 @@ void PropertiesView::onLabelSizeChanged()
{
orientationCombo->setCurrentIndex( isRotated ? 0 : 1 );
}
+ mOldOrientationIndex = orientationCombo->currentIndex();
}
///
-/// Form changed handler
+/// Orientation combo box changed handler
///
-void PropertiesView::onFormChanged()
+void PropertiesView::onOrientationActivated()
{
const glabels::Template *tmplate = mModel->tmplate();
const glabels::Frame *frame = tmplate->frames().first();
- if ( frame->w() == frame->h() )
+ // Make sure index actually changed.
+ int index = orientationCombo->currentIndex();
+ if ( index != mOldOrientationIndex )
{
- mModel->setRotate( false );
- }
- else if ( frame->w() > frame->h() )
- {
- mUndoRedoModel->checkpoint( tr("Product Orientation") );
- int index = orientationCombo->currentIndex();
- mModel->setRotate( index == 1 );
- }
- else
- {
- mUndoRedoModel->checkpoint( tr("Product Orientation") );
- int index = orientationCombo->currentIndex();
- mModel->setRotate( index == 0 );
+ mOldOrientationIndex = index;
+
+ mUndoRedoModel->checkpoint( tr("Product Rotate") );
+
+ if ( frame->w() == frame->h() )
+ {
+ mModel->setRotate( false );
+ }
+ else if ( frame->w() > frame->h() )
+ {
+ mModel->setRotate( index == 1 );
+ }
+ else
+ {
+ mModel->setRotate( index == 0 );
+ }
}
}
diff --git a/glabels/PropertiesView.h b/glabels/PropertiesView.h
index dceb775..91909c3 100644
--- a/glabels/PropertiesView.h
+++ b/glabels/PropertiesView.h
@@ -58,7 +58,7 @@ public:
private slots:
void onSettingsChanged();
void onLabelSizeChanged();
- void onFormChanged();
+ void onOrientationActivated();
void onChangeProductButtonClicked();
@@ -69,7 +69,7 @@ private:
LabelModel* mModel;
UndoRedoModel* mUndoRedoModel;
glabels::Units mUnits;
-
+ int mOldOrientationIndex;
};
diff --git a/glabels/ui/PropertiesView.ui b/glabels/ui/PropertiesView.ui
index ebf3009..496e5db 100644
--- a/glabels/ui/PropertiesView.ui
+++ b/glabels/ui/PropertiesView.ui
@@ -372,22 +372,6 @@
-
- orientationCombo
- currentIndexChanged(int)
- PropertiesView
- onFormChanged()
-
-
- 671
- 283
-
-
- 723
- 285
-
-
-
changeProductButton
clicked()
@@ -395,8 +379,8 @@
onChangeProductButtonClicked()
- 684
- 192
+ 311
+ 221
728
@@ -404,9 +388,25 @@
+
+ orientationCombo
+ activated(int)
+ PropertiesView
+ onOrientationActivated()
+
+
+ 285
+ 280
+
+
+ 802
+ 300
+
+
+
onChangeProductButtonClicked()
- onFormChanged()
+ onOrientationActivated()