Minor gui change

This commit is contained in:
joshua
2021-07-12 19:16:01 +02:00
parent f410fbf7e2
commit efed7ab5c0
3 changed files with 132 additions and 141 deletions

View File

@@ -385,20 +385,24 @@ void TerminalStripEditor::on_m_terminal_strip_tw_currentItemChanged(QTreeWidgetI
setCurrentStrip(strip_);
}
void TerminalStripEditor::on_m_apply_data_pb_clicked(QAbstractButton *button)
void TerminalStripEditor::on_m_dialog_button_box_clicked(QAbstractButton *button)
{
Q_UNUSED(button)
if (m_current_strip)
{
TerminalStripData data;
data.m_installation = ui->m_installation_le->text();
data.m_location = ui->m_location_le->text();
data.m_name = ui->m_name_le->text();
data.m_comment = ui->m_comment_le->text();
data.m_description = ui->m_description_te->toPlainText();
auto role = ui->m_dialog_button_box->buttonRole(button);
m_project->undoStack()->push(new ChangeTerminalStripData(m_current_strip, data, nullptr));
if (role == QDialogButtonBox::AcceptRole) {
if (m_current_strip)
{
TerminalStripData data;
data.m_installation = ui->m_installation_le->text();
data.m_location = ui->m_location_le->text();
data.m_name = ui->m_name_le->text();
data.m_comment = ui->m_comment_le->text();
data.m_description = ui->m_description_te->toPlainText();
m_project->undoStack()->push(new ChangeTerminalStripData(m_current_strip, data, nullptr));
}
}
on_m_reload_pb_clicked();

View File

@@ -56,7 +56,7 @@ class TerminalStripEditor : public QDialog
void on_m_remove_terminal_strip_pb_clicked();
void on_m_reload_pb_clicked();
void on_m_terminal_strip_tw_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_m_apply_data_pb_clicked(QAbstractButton *button);
void on_m_dialog_button_box_clicked(QAbstractButton *button);
private:
Ui::TerminalStripEditor *ui;

View File

@@ -6,15 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>951</width>
<height>491</height>
<width>901</width>
<height>465</height>
</rect>
</property>
<property name="windowTitle">
<string>Gestionnaire de borniers</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,1" columnstretch="0">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,1">
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
@@ -78,17 +78,11 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="handleWidth">
<number>4</number>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="TerminalStripTreeWidget" name="m_terminal_strip_tw">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
@@ -114,141 +108,134 @@
</property>
</column>
</widget>
<widget class="QTabWidget" name="m_tab_widget">
<widget class="QWidget" name="widget_3" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="m_layout_tab">
<attribute name="title">
<string>Disposition</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableView" name="m_table_widget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="m_tab_widget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="m_layout_tab">
<attribute name="title">
<string>Disposition</string>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>true</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_data_tab">
<attribute name="title">
<string>Propriétés</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Installation :</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Commentaire</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="m_name_le"/>
</item>
<item row="4" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QPlainTextEdit" name="m_description_te"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Nom :</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_location_le"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_installation_le"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Localisation :</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="m_comment_le"/>
</item>
<item row="6" column="0" colspan="2">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="horizontalSpacer_2">
<widget class="QTableView" name="m_table_widget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>true</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_data_tab">
<attribute name="title">
<string>Propriétés</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Nom :</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="m_name_le"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QPlainTextEdit" name="m_description_te"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_installation_le"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Commentaire</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="m_comment_le"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Installation :</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="m_apply_data_pb">
<property name="standardButtons">
<set>QDialogButtonBox::Apply</set>
<item row="1" column="1">
<widget class="QLineEdit" name="m_location_le"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Localisation :</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="m_dialog_button_box">
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Reset</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>