Fixed translations after language change

--HG--
branch : feature
This commit is contained in:
BojanKverh 2016-08-17 21:38:39 +02:00
parent 10f2d83edd
commit 1cfa97497c
6 changed files with 19 additions and 3 deletions

View File

@ -1140,7 +1140,7 @@
<item row="6" column="1"> <item row="6" column="1">
<widget class="QLineEdit" name="lineEditSize"> <widget class="QLineEdit" name="lineEditSize">
<property name="toolTip"> <property name="toolTip">
<string>Use %width% and %height% to insert pattern width and height</string> <string>Use %size% and %height% to insert pattern size and height</string>
</property> </property>
<property name="maxLength"> <property name="maxLength">
<number>40</number> <number>40</number>

View File

@ -1222,6 +1222,7 @@ void MainWindow::changeEvent(QEvent *event)
helpLabel->setText(QObject::tr("Changes applied.")); helpLabel->setText(QObject::tr("Changes applied."));
patternPieceLabel->setText(tr("Pattern Piece:")); patternPieceLabel->setText(tr("Pattern Piece:"));
UpdateWindowTitle(); UpdateWindowTitle();
emit sceneDetails->LanguageChanged();
} }
// remember to call base class implementation // remember to call base class implementation
QMainWindow::changeEvent(event); QMainWindow::changeEvent(event);

View File

@ -305,7 +305,8 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-down"> <iconset theme="go-down">
<normaloff>.</normaloff>.</iconset> <normaloff/>
</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -319,7 +320,8 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="go-up"> <iconset theme="go-up">
<normaloff>.</normaloff>.</iconset> <normaloff/>
</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -419,6 +421,9 @@
</item> </item>
<item row="0" column="2" colspan="2"> <item row="0" column="2" colspan="2">
<widget class="QComboBox" name="comboBoxMaterial"> <widget class="QComboBox" name="comboBoxMaterial">
<property name="toolTip">
<string>You can choose one of the predefined materials or enter a new one</string>
</property>
<property name="editable"> <property name="editable">
<bool>true</bool> <bool>true</bool>
</property> </property>

View File

@ -208,6 +208,7 @@ VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32
connect(sceneDetails, &VMainGraphicsScene::DimensionsChanged, this, &VToolDetail::UpdateLabel); connect(sceneDetails, &VMainGraphicsScene::DimensionsChanged, this, &VToolDetail::UpdateLabel);
connect(sceneDetails, &VMainGraphicsScene::DimensionsChanged, this, &VToolDetail::UpdatePatternInfo); connect(sceneDetails, &VMainGraphicsScene::DimensionsChanged, this, &VToolDetail::UpdatePatternInfo);
connect(sceneDetails, &VMainGraphicsScene::LanguageChanged, this, &VToolDetail::retranslateUi);
UpdateLabel(); UpdateLabel();
UpdatePatternInfo(); UpdatePatternInfo();
@ -1132,3 +1133,10 @@ void VToolDetail::UpdateAll()
sceneDetails->update(); sceneDetails->update();
update(); update();
} }
//---------------------------------------------------------------------------------------------------------------------
void VToolDetail::retranslateUi()
{
UpdateLabel();
UpdatePatternInfo();
}

View File

@ -99,6 +99,7 @@ public slots:
virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE; virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE;
virtual void ResetChildren(QGraphicsItem* pItem); virtual void ResetChildren(QGraphicsItem* pItem);
virtual void UpdateAll(); virtual void UpdateAll();
virtual void retranslateUi();
protected: protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) Q_DECL_OVERRIDE; QWidget *widget) Q_DECL_OVERRIDE;

View File

@ -147,6 +147,7 @@ signals:
void EnableDetailItemHover(bool enabled); void EnableDetailItemHover(bool enabled);
void EnableLineItemHover(bool enabled); void EnableLineItemHover(bool enabled);
void DimensionsChanged(); void DimensionsChanged();
void LanguageChanged();
private: private:
/** @brief horScrollBar value horizontal scroll bar. */ /** @brief horScrollBar value horizontal scroll bar. */