Button to call Label editor.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-09 19:32:14 +03:00
parent 80f6a5a7d1
commit 7b13020e4e
5 changed files with 37 additions and 11 deletions

View File

@ -36,6 +36,7 @@
#include "../xml/vpattern.h" #include "../xml/vpattern.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../core/vapplication.h" #include "../core/vapplication.h"
#include "../vtools/dialogs/support/dialogeditlabel.h"
// calc how many combinations we have // calc how many combinations we have
static const int heightsCount = (static_cast<int>(GHeights::H200) - static const int heightsCount = (static_cast<int>(GHeights::H200) -
@ -201,6 +202,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
connect(ui->lineEditSize, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged); connect(ui->lineEditSize, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->checkBoxShowDate, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged); connect(ui->checkBoxShowDate, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->checkBoxShowMeasurements, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged); connect(ui->checkBoxShowMeasurements, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->pushButtonEditPatternLabel, &QPushButton::clicked, this, &DialogPatternProperties::EditLabel);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -849,3 +851,10 @@ void DialogPatternProperties::SaveImage()
} }
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogPatternProperties::EditLabel()
{
DialogEditLabel editor;
editor.exec();
}

View File

@ -62,6 +62,7 @@ private slots:
void DescEdited(); void DescEdited();
void ChangeImage(); void ChangeImage();
void SaveImage(); void SaveImage();
void EditLabel();
private: private:
Q_DISABLE_COPY(DialogPatternProperties) Q_DISABLE_COPY(DialogPatternProperties)
Ui::DialogPatternProperties *ui; Ui::DialogPatternProperties *ui;

View File

@ -14,14 +14,14 @@
<string>Pattern properties</string> <string>Pattern properties</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset> <iconset resource="../../../libs/vmisc/share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -1213,7 +1213,7 @@
<item> <item>
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
<string>Label:</string> <string>Label template:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1223,7 +1223,7 @@
<string>Edit pattern label</string> <string>Edit pattern label</string>
</property> </property>
<property name="text"> <property name="text">
<string>Edit label</string> <string>Edit template</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1360,7 +1360,9 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
</resources>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>

View File

@ -3,8 +3,9 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui
class DialogEditLabel; {
class DialogEditLabel;
} }
class DialogEditLabel : public QDialog class DialogEditLabel : public QDialog
@ -12,10 +13,11 @@ class DialogEditLabel : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DialogEditLabel(QWidget *parent = 0); explicit DialogEditLabel(QWidget *parent = nullptr);
~DialogEditLabel(); virtual ~DialogEditLabel();
private: private:
Q_DISABLE_COPY(DialogEditLabel)
Ui::DialogEditLabel *ui; Ui::DialogEditLabel *ui;
}; };

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogEditLabel</class> <class>DialogEditLabel</class>
<widget class="QDialog" name="DialogEditLabel"> <widget class="QDialog" name="DialogEditLabel">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -11,7 +14,14 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Edit label template</string>
</property>
<property name="windowIcon">
<iconset resource="../../../vmisc/share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<property name="modal">
<bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
@ -314,7 +324,9 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="../../../vmisc/share/resources/icon.qrc"/>
</resources>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>