Improve some layout and widget item

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4920 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun 2017-02-26 18:30:34 +00:00
parent 7f5f2b0081
commit 945d8562ca
14 changed files with 973 additions and 1467 deletions

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>650</width> <width>460</width>
<height>550</height> <height>508</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -25,122 +25,8 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout_2">
<property name="sizeConstraint"> <item row="2" column="0" colspan="2">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>50</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>253</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>630</width>
<height>495</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>430</width>
<height>250</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Project Status:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QComboBox" name="m_status_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="5" column="1" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" colspan="3">
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Range</string> <string>Range</string>
@ -232,7 +118,39 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="4"> <item row="4" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Help</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Project Status:</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Update Policy</string> <string>Update Policy</string>
@ -291,6 +209,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -377,6 +308,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -440,29 +384,51 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="m_status_cb">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="standardButtons"> <property name="sizeAdjustPolicy">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Help</set> <enum>QComboBox::AdjustToContents</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@ -1,113 +0,0 @@
/*
Copyright 2006-2017 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dialogautonum.h"
#include "ui_dialogautonum.h"
//#include "conductorautonumerotation.h"
#include "qetmessagebox.h"
#include "ui/selectautonumw.h"
/**
* @brief DialogAutoNum::DialogAutoNum
* @param dg
* @param parent
*/
DialogAutoNum::DialogAutoNum(Diagram *dg, QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogAutoNum),
dg_ (dg)
{
ui -> setupUi(this);
ui -> configuration_layout -> addWidget (new SelectAutonumW());
dgselect_ = new diagramselection( dg_ -> project(), ui -> annotation_tab);
ui -> verticalLayout_Selection -> addWidget(dgselect_);
}
/**
* @brief Destructor
*/
DialogAutoNum::~DialogAutoNum(){
delete ui;
}
/**
* @brief DialogAutoNum::on_pushButton_delete_clicked
*/
void DialogAutoNum::on_pushButton_delete_clicked() {
// get list of diagrams selected
QList<Diagram *>listDiag = dgselect_ -> list_of_DiagramSelected();
if(listDiag.count()<=0) return;
QString diagramsTitle;
for(int i=0; i<listDiag.count(); i++){
diagramsTitle += listDiag.at(i) -> title();
if(i+1 < listDiag.count()) diagramsTitle += ", ";
}
// Ask if user is sure to delete the conductor numerotation
QMessageBox::StandardButton answer = QET::QetMessageBox::critical(
this,
tr("Suppression des annotations conducteurs", "Attention"),
QString(
tr("Voulez-vous vraiment supprimer les annotations conducteurs de :\n\n%1 ?")
).arg(diagramsTitle),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No
);
// if yes remove all
if( answer == QMessageBox::Yes) {
for(int i=0; i<listDiag.count(); i++){
/*ConductorAutoNumerotation can(listDiag.at(i));
can.removeNumOfDiagram();*/
}
}
}
/**
* @brief set the autonum to all diagram selected
*/
void DialogAutoNum::on_pushButton_annotation_clicked(){
// Get list of diagrams selected
QList<Diagram *>listDiag = dgselect_ -> list_of_DiagramSelected();
if(listDiag.count()<=0) return;
QString diagramsTitle;
for(int i=0; i<listDiag.count(); i++){
diagramsTitle += listDiag.at(i) -> title();
if(i+1 < listDiag.count()) diagramsTitle += ", ";
}
// Ask if user is sure to numerate the conductor
QET::QetMessageBox::warning(
this,
tr("Annotation des conducteurs", "Attention"),
QString(
tr("Voulez-vous vraiment annoter les conducteurs de :\n\n%1 ?")
).arg(diagramsTitle),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No
);
}
/**
* @brief Close the dialog
*/
void DialogAutoNum::on_pushButton_close_clicked() {
close();
}

View File

@ -1,49 +0,0 @@
/*
Copyright 2006-2017 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIALOGAUTONUM_H
#define DIALOGAUTONUM_H
#include <QDialog>
#include "diagram.h"
#include "ui/diagramselection.h"
namespace Ui {
class DialogAutoNum;
}
class DialogAutoNum : public QDialog
{
Q_OBJECT
public:
explicit DialogAutoNum(Diagram *dg, QWidget *parent = 0);
~DialogAutoNum();
private slots:
void on_pushButton_annotation_clicked();
void on_pushButton_delete_clicked();
void on_pushButton_close_clicked();
private:
Ui::DialogAutoNum *ui;
Diagram *dg_;
diagramselection *dgselect_;
};
#endif // DialogAutoNum_H

View File

@ -1,162 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogAutoNum</class>
<widget class="QDialog" name="DialogAutoNum">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>416</height>
</rect>
</property>
<property name="windowTitle">
<string>Annotation des schémas</string>
</property>
<property name="windowIcon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/oxygen-icons/32x32/apps/qelectrotech.png</normaloff>:/ico/oxygen-icons/32x32/apps/qelectrotech.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="configuration_tab">
<attribute name="title">
<string>Configuration</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QVBoxLayout" name="configuration_layout">
<property name="spacing">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="annotation_tab">
<attribute name="title">
<string>Annotation</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_Selection">
<property name="title">
<string>Sélection</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_">
<item>
<widget class="QRadioButton" name="radioButton_conductor">
<property name="text">
<string>Conducteurs</string>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/conductor2.png</normaloff>:/ico/22x22/conductor2.png</iconset>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_component">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Composants</string>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/single_page.png</normaloff>:/ico/22x22/single_page.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_Selection"/>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButton_annotation">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Numérotée les folio sélectionné&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Annotation (alpha)</string>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/edit-select-all.png</normaloff>:/ico/16x16/edit-select-all.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_delete">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Supprimé la numérotation des folio sélectionné&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Supprimer l'annotation</string>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/edit-delete.png</normaloff>:/ico/16x16/edit-delete.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_close">
<property name="text">
<string>Fermer</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../../qelectrotech.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>524</width> <width>460</width>
<height>550</height> <height>309</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -26,76 +26,76 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>50</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>253</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>504</width>
<height>495</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="text">
<size> <string>Numérotation automatique de Folio :</string>
<width>430</width>
<height>250</height>
</size>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> </widget>
<property name="sizeConstraint"> </item>
<enum>QLayout::SetFixedSize</enum> <item row="0" column="1">
<widget class="QComboBox" name="m_autonums_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<item row="2" column="1" colspan="2"> <property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="Select">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Sélection:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="m_create_new_tabs_rb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Créer de nouveaux Folios</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_autonumber_tabs_rb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>NumAuto des folios séléctionnés</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="Options"> <widget class="QGroupBox" name="Options">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -191,74 +191,9 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="2">
<widget class="QGroupBox" name="Select">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Sélection:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="m_create_new_tabs_rb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Créer de nouveaux Folios</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_autonumber_tabs_rb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>NumAuto des folios séléctionnés</string>
</property>
</widget>
</item>
</layout> </layout>
</widget>
</item> </item>
<item row="0" column="1"> <item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Numérotation automatique de Folio :</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="m_autonums_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -271,10 +206,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
</layout>
</widget>
</widget>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy"> <property name="sizePolicy">
@ -289,6 +220,10 @@
</widget> </widget>
</item> </item>
</layout> </layout>
<zorder>buttonBox</zorder>
<zorder>verticalSpacer</zorder>
<zorder>gridLayoutWidget</zorder>
<zorder>verticalSpacer</zorder>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -40,8 +40,21 @@
<property name="title"> <property name="title">
<string>Auto Naming Pattern:</string> <string>Auto Naming Pattern:</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item row="0" column="1"> <item>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Formula:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_formula_le"> <widget class="QLineEdit" name="m_formula_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -60,18 +73,18 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item>
<widget class="QLabel" name="label_5"> <spacer name="horizontalSpacer">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <enum>Qt::Horizontal</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text"> <property name="sizeHint" stdset="0">
<string>Formula:</string> <size>
<width>40</width>
<height>20</height>
</size>
</property> </property>
</widget> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -22,10 +22,11 @@
/** /**
* Constructor * Constructor
*/ */
NumPartEditorW::NumPartEditorW(QWidget *parent) : NumPartEditorW::NumPartEditorW(int type, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::NumPartEditorW), ui(new Ui::NumPartEditorW),
intValidator (new QIntValidator(0,99999,this)) intValidator (new QIntValidator(0,99999,this)),
m_edited_type(type)
{ {
ui -> setupUi(this); ui -> setupUi(this);
setVisibleItems(); setVisibleItems();
@ -36,10 +37,11 @@ NumPartEditorW::NumPartEditorW(QWidget *parent) :
* Constructor * Constructor
* Build with value of @context at position i * Build with value of @context at position i
*/ */
NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, QWidget *parent): NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, QWidget *parent):
QWidget(parent), QWidget(parent),
ui(new Ui::NumPartEditorW), ui(new Ui::NumPartEditorW),
intValidator (new QIntValidator(0,99999,this)) intValidator (new QIntValidator(0,99999,this)),
m_edited_type(type)
{ {
ui -> setupUi(this); ui -> setupUi(this);
setVisibleItems(); setVisibleItems();
@ -75,15 +77,18 @@ NumPartEditorW::~NumPartEditorW()
delete ui; delete ui;
} }
void NumPartEditorW::setVisibleItems() { void NumPartEditorW::setVisibleItems()
{
ui->type_cb->setInsertPolicy(QComboBox::InsertAtBottom); ui->type_cb->setInsertPolicy(QComboBox::InsertAtBottom);
QStringList items; QStringList items;
if (parentWidget()->parentWidget()->objectName()=="FolioTab") { if (m_edited_type == 2)
{
items << tr("Chiffre 1") << tr("Chiffre 01") items << tr("Chiffre 1") << tr("Chiffre 01")
<< tr("Chiffre 001") << tr("Chiffre 001")
<< tr("Texte"); << tr("Texte");
} }
else if (parentWidget()->parentWidget()->objectName()=="ConductorTab") { else if (m_edited_type == 1)
{
items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01") items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01")
<< tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio") << tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio")
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Locmach"); << tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Locmach");

View File

@ -37,8 +37,8 @@ class NumPartEditorW : public QWidget
//METHODS //METHODS
public: public:
explicit NumPartEditorW(QWidget *parent = 0); explicit NumPartEditorW(int type, QWidget *parent = 0);
NumPartEditorW (NumerotationContext &, int, QWidget *parent=0); NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=0);
~NumPartEditorW(); ~NumPartEditorW();
enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio, enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio,
@ -66,6 +66,8 @@ class NumPartEditorW : public QWidget
private: private:
Ui::NumPartEditorW *ui; Ui::NumPartEditorW *ui;
QValidator *intValidator; QValidator *intValidator;
int m_edited_type = -1; //0 == element : 1 == conductor : 2 == folio
}; };

View File

@ -27,36 +27,44 @@
/** /**
* Constructor * Constructor
*/ */
SelectAutonumW::SelectAutonumW(QWidget *parent) : SelectAutonumW::SelectAutonumW(int type, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SelectAutonumW) ui(new Ui::SelectAutonumW),
m_edited_type(type)
{ {
ui->setupUi(this); ui->setupUi(this);
if (this->parentWidget() -> objectName()=="ElementTab"){ if (m_edited_type == 0)
{
m_feaw = new FormulaAutonumberingW(); m_feaw = new FormulaAutonumberingW();
ui->scrollAreaWidgetContents->layout()->addWidget(m_feaw); m_feaw->ui->label->setHidden(true);
ui->m_widget->layout()->addWidget(m_feaw);
} }
else if (this->parentWidget() -> objectName()=="ConductorTab"){ else if (m_edited_type == 1)
{
m_fcaw = new FormulaAutonumberingW(); m_fcaw = new FormulaAutonumberingW();
m_fcaw->ui->label->setHidden(true); m_fcaw->ui->label->setHidden(true);
ui->scrollAreaWidgetContents->layout()->addWidget(m_fcaw); ui->m_widget->layout()->addWidget(m_fcaw);
} }
setContext(NumerotationContext()); setContext(NumerotationContext());
} }
SelectAutonumW::SelectAutonumW(const NumerotationContext &context, QWidget *parent) : SelectAutonumW::SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SelectAutonumW) ui(new Ui::SelectAutonumW),
m_edited_type(type)
{
if (m_edited_type == 0)
{ {
if (this->parentWidget() -> objectName()=="ElementTab"){
m_feaw = new FormulaAutonumberingW(); m_feaw = new FormulaAutonumberingW();
ui->scrollAreaWidgetContents->layout()->addWidget(m_feaw); m_feaw->ui->label->setHidden(true);
ui->m_widget->layout()->addWidget(m_feaw);
} }
else if (this->parentWidget() -> objectName()=="ConductorTab"){ else if (m_edited_type == 1)
{
m_fcaw = new FormulaAutonumberingW(); m_fcaw = new FormulaAutonumberingW();
m_fcaw->ui->label->setHidden(true); m_fcaw->ui->label->setHidden(true);
ui->scrollAreaWidgetContents->layout()->addWidget(m_fcaw); ui->m_widget->layout()->addWidget(m_fcaw);
} }
ui->setupUi(this); ui->setupUi(this);
setContext(context); setContext(context);
@ -85,7 +93,7 @@ void SelectAutonumW::setContext(const NumerotationContext &context) {
} }
else { else {
for (int i=0; i<m_context.size(); ++i) { //build with the content of @context for (int i=0; i<m_context.size(); ++i) { //build with the content of @context
NumPartEditorW *part= new NumPartEditorW(m_context, i, this); NumPartEditorW *part= new NumPartEditorW(m_context, i, m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable())); connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
num_part_list_ << part; num_part_list_ << part;
ui -> editor_layout -> addWidget(part); ui -> editor_layout -> addWidget(part);
@ -113,9 +121,10 @@ NumerotationContext SelectAutonumW::toNumContext() const {
* @brief SelectAutonumW::on_add_button_clicked * @brief SelectAutonumW::on_add_button_clicked
* Action on add_button, add a @NumPartEditor * Action on add_button, add a @NumPartEditor
*/ */
void SelectAutonumW::on_add_button_clicked() { void SelectAutonumW::on_add_button_clicked()
{
applyEnable(false); applyEnable(false);
NumPartEditorW *part = new NumPartEditorW(this); NumPartEditorW *part = new NumPartEditorW(m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable())); connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
num_part_list_ << part; num_part_list_ << part;
ui -> editor_layout -> addWidget(part); ui -> editor_layout -> addWidget(part);
@ -143,12 +152,14 @@ void SelectAutonumW::on_remove_button_clicked() {
* @brief SelectAutonumW::formula * @brief SelectAutonumW::formula
* @return autonumbering widget formula * @return autonumbering widget formula
*/ */
QString SelectAutonumW::formula() { QString SelectAutonumW::formula()
if (this->parentWidget() -> objectName()=="ElementTab") {
if (m_edited_type == 0)
return m_feaw->formula(); return m_feaw->formula();
else if (this->parentWidget() ->objectName()=="ConductorTab") else if (m_edited_type == 1)
return m_fcaw->formula(); return m_fcaw->formula();
else return ""; else
return "";
} }
/** /**
@ -165,7 +176,8 @@ void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
break; break;
//help dialog //help dialog
case QDialogButtonBox::HelpRole: case QDialogButtonBox::HelpRole:
if (this->parentWidget() -> objectName()=="FolioTab"){ if (m_edited_type == 2)
{
QMessageBox::information (this, tr("Folio Autonumérotation", "title window"), QMessageBox::information (this, tr("Folio Autonumérotation", "title window"),
tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux folios.\n" tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux folios.\n"
"-Une numérotation est composée d'une variable minimum.\n" "-Une numérotation est composée d'une variable minimum.\n"
@ -183,7 +195,8 @@ void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
)); ));
break; break;
} }
else{ else
{
QMessageBox::information (this, tr("Conducteur Autonumérotation", "title window"), QMessageBox::information (this, tr("Conducteur Autonumérotation", "title window"),
tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux conducteurs.\n" tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux conducteurs.\n"
"-Une numérotation est composée d'une variable minimum.\n" "-Une numérotation est composée d'une variable minimum.\n"
@ -234,9 +247,9 @@ void SelectAutonumW::applyEnable(bool b) {
else { else {
ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b); ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b);
} }
if (this->parentWidget() -> objectName()=="ElementTab") if (m_edited_type == 0)
contextToFormula(); contextToFormula();
if (this->parentWidget()->objectName()=="ConductorTab") if (m_edited_type == 1)
contextToFormula(); contextToFormula();
} }
@ -247,9 +260,9 @@ void SelectAutonumW::applyEnable(bool b) {
void SelectAutonumW::contextToFormula() void SelectAutonumW::contextToFormula()
{ {
FormulaAutonumberingW* m_faw = nullptr; FormulaAutonumberingW* m_faw = nullptr;
if (this->parentWidget() -> objectName()=="ElementTab") if (m_edited_type == 0)
m_faw = m_feaw; m_faw = m_feaw;
else if (this->parentWidget()->objectName()=="ConductorTab") else if (m_edited_type == 1)
m_faw = m_fcaw; m_faw = m_fcaw;
if (m_faw) if (m_faw)

View File

@ -36,8 +36,8 @@ class SelectAutonumW : public QWidget
//METHODS //METHODS
public: public:
explicit SelectAutonumW(QWidget *parent = 0); explicit SelectAutonumW(int type, QWidget *parent = 0);
explicit SelectAutonumW(const NumerotationContext &context, QWidget *parent = 0); explicit SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent = 0);
~SelectAutonumW(); ~SelectAutonumW();
void setContext (const NumerotationContext &context); void setContext (const NumerotationContext &context);
@ -68,6 +68,7 @@ class SelectAutonumW : public QWidget
NumerotationContext m_context; NumerotationContext m_context;
FormulaAutonumberingW *m_feaw; FormulaAutonumberingW *m_feaw;
FormulaAutonumberingW *m_fcaw; FormulaAutonumberingW *m_fcaw;
int m_edited_type = -1; //0 == element : 1 == conductor : 2 == folio
}; };
#endif // SELECTAUTONUMW_H #endif // SELECTAUTONUMW_H

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>418</width> <width>616</width>
<height>508</height> <height>421</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -21,73 +21,25 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QWidget" name="m_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>455</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>453</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>450</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint"> <property name="spacing">
<enum>QLayout::SetFixedSize</enum> <number>0</number>
</property>
<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> </property>
<item> <item>
<widget class="QGroupBox" name="definition_groupe"> <widget class="QGroupBox" name="m_definition_groupe">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -102,7 +54,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
@ -113,7 +65,7 @@
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -134,7 +86,7 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../qelectrotech.qrc"> <iconset resource="../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/list-remove.png</normaloff>:/ico/22x22/list-remove.png</iconset> <normaloff>:/ico/22x22/list-remove.png</normaloff>:/ico/22x22/list-remove.png</iconset>
</property> </property>
<property name="flat"> <property name="flat">
@ -151,7 +103,7 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../qelectrotech.qrc"> <iconset resource="../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/list-add.png</normaloff>:/ico/22x22/list-add.png</iconset> <normaloff>:/ico/22x22/list-add.png</normaloff>:/ico/22x22/list-add.png</iconset>
</property> </property>
<property name="flat"> <property name="flat">
@ -168,7 +120,7 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../qelectrotech.qrc"> <iconset resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/arrow-left.png</normaloff>:/ico/16x16/arrow-left.png</iconset> <normaloff>:/ico/16x16/arrow-left.png</normaloff>:/ico/16x16/arrow-left.png</iconset>
</property> </property>
</widget> </widget>
@ -182,13 +134,13 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../qelectrotech.qrc"> <iconset resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/arrow-right.png</normaloff>:/ico/16x16/arrow-right.png</iconset> <normaloff>:/ico/16x16/arrow-right.png</normaloff>:/ico/16x16/arrow-right.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -234,7 +186,7 @@
<string>Valeur</string> <string>Valeur</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -258,29 +210,25 @@
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>0</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy"> <property name="sizePolicy">
@ -297,7 +245,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="../../qelectrotech.qrc"/> <include location="../../../qelectrotech.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -222,7 +222,6 @@ ProjectAutoNumConfigPage::ProjectAutoNumConfigPage (QETProject *project, QWidget
ProjectConfigPage(project, parent) ProjectConfigPage(project, parent)
{ {
initWidgets(); initWidgets();
initLayout();
buildConnections(); buildConnections();
readValuesFromProject(); readValuesFromProject();
} }
@ -254,127 +253,101 @@ void ProjectAutoNumConfigPage::applyProjectConf() {}
* @brief ProjectAutoNumConfigPage::initWidgets * @brief ProjectAutoNumConfigPage::initWidgets
* Init some widget of this page * Init some widget of this page
*/ */
void ProjectAutoNumConfigPage::initWidgets() { void ProjectAutoNumConfigPage::initWidgets()
{
QTabWidget *tab_widget = new QTabWidget(this);
tab_widget = new QTabWidget(this); //Management tab
m_amw = new AutoNumberingManagementW(project());
tab_widget->addTab(m_amw, tr("Management"));
management_tab_widget = new QWidget(this); //Conductor tab
m_amw = new AutoNumberingManagementW(project(), management_tab_widget); QWidget *conductor_widget = new QWidget();
QVBoxLayout *conductor_layout = new QVBoxLayout(conductor_widget);
QHBoxLayout *bp_conductor_layout = new QHBoxLayout();
//Conductor Tab QLabel *label_conductor = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
conductor_tab_widget = new QWidget(this); m_context_cb_conductor= new QComboBox();
conductor_tab_widget->setObjectName("ConductorTab");
m_label_conductor = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), conductor_tab_widget);
m_context_cb_conductor= new QComboBox(conductor_tab_widget);
m_context_cb_conductor->setEditable(true); m_context_cb_conductor->setEditable(true);
m_context_cb_conductor->lineEdit()->setClearButtonEnabled(true); m_context_cb_conductor->lineEdit()->setClearButtonEnabled(true);
m_context_cb_conductor->addItem(tr("Nom de la nouvelle numérotation")); m_context_cb_conductor->addItem(tr("Nom de la nouvelle numérotation"));
m_remove_pb_conductor= new QPushButton(QET::Icons::EditDelete, QString(), conductor_tab_widget); m_remove_pb_conductor= new QPushButton(QET::Icons::EditDelete, QString());
m_remove_pb_conductor-> setToolTip(tr("Supprimer la numérotation")); m_remove_pb_conductor-> setToolTip(tr("Supprimer la numérotation"));
m_saw_conductor = new SelectAutonumW(conductor_tab_widget); m_saw_conductor = new SelectAutonumW(1);
//Element Tab bp_conductor_layout->addWidget(label_conductor);
element_tab_widget = new QWidget(this); bp_conductor_layout->addStretch();
element_tab_widget->setObjectName("ElementTab"); bp_conductor_layout->addWidget(m_context_cb_conductor);
bp_conductor_layout->addWidget(m_remove_pb_conductor);
m_label_element = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), element_tab_widget); conductor_layout->addLayout(bp_conductor_layout);
conductor_layout->addWidget(m_saw_conductor);
m_context_cb_element = new QComboBox(element_tab_widget); tab_widget->addTab(conductor_widget, tr("Conducteur"));
//Element tab
QWidget *element_widget = new QWidget();
QVBoxLayout *element_layout = new QVBoxLayout(element_widget);
QHBoxLayout *bp_element_layout = new QHBoxLayout();
QLabel *label_element = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
m_context_cb_element = new QComboBox();
m_context_cb_element->setEditable(true); m_context_cb_element->setEditable(true);
m_context_cb_element->lineEdit()->setClearButtonEnabled(true); m_context_cb_element->lineEdit()->setClearButtonEnabled(true);
m_context_cb_element->addItem(tr("Nom de la nouvelle numérotation")); m_context_cb_element->addItem(tr("Nom de la nouvelle numérotation"));
m_remove_pb_element = new QPushButton(QET::Icons::EditDelete, QString(), element_tab_widget); m_remove_pb_element = new QPushButton(QET::Icons::EditDelete, QString());
m_remove_pb_element -> setToolTip(tr("Supprimer la numérotation")); m_remove_pb_element -> setToolTip(tr("Supprimer la numérotation"));
m_saw_element = new SelectAutonumW(element_tab_widget); m_saw_element = new SelectAutonumW(0);
bp_element_layout->addWidget(label_element);
bp_element_layout->addStretch();
bp_element_layout->addWidget(m_context_cb_element);
bp_element_layout->addWidget(m_remove_pb_element);
element_layout->addLayout(bp_element_layout);
element_layout->addWidget(m_saw_element);
tab_widget->addTab(element_widget, tr("Element"));
//Folio Tab //Folio Tab
folio_tab_widget = new QWidget(this); QWidget *folio_widget = new QWidget();
folio_tab_widget->setObjectName("FolioTab"); QVBoxLayout *folio_layout = new QVBoxLayout(folio_widget);
QHBoxLayout *bp_folio_layout = new QHBoxLayout();
m_label_folio = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), folio_tab_widget); QLabel *label_folio = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
m_context_cb_folio = new QComboBox(folio_tab_widget); m_context_cb_folio = new QComboBox();
m_context_cb_folio->setEditable(true); m_context_cb_folio->setEditable(true);
m_context_cb_folio->lineEdit()->setClearButtonEnabled(true); m_context_cb_folio->lineEdit()->setClearButtonEnabled(true);
m_context_cb_folio->addItem(tr("Nom de la nouvelle numérotation")); m_context_cb_folio->addItem(tr("Nom de la nouvelle numérotation"));
m_remove_pb_folio = new QPushButton(QET::Icons::EditDelete, QString(), folio_tab_widget); m_remove_pb_folio = new QPushButton(QET::Icons::EditDelete, QString());
m_remove_pb_folio -> setToolTip(tr("Supprimer la numérotation")); m_remove_pb_folio -> setToolTip(tr("Supprimer la numérotation"));
m_saw_folio = new SelectAutonumW(folio_tab_widget); m_saw_folio = new SelectAutonumW(2);
bp_folio_layout->addWidget(label_folio);
bp_folio_layout->addStretch();
bp_folio_layout->addWidget(m_context_cb_folio);
bp_folio_layout->addWidget(m_remove_pb_folio);
folio_layout->addLayout(bp_folio_layout);
folio_layout->addWidget(m_saw_folio);
tab_widget->addTab(folio_widget, tr("Folio"));
//AutoNumbering Tab //AutoNumbering Tab
autoNumbering_tab_widget = new QWidget(this); m_faw = new FolioAutonumberingW(project());
m_faw = new FolioAutonumberingW(project(),autoNumbering_tab_widget); tab_widget->addTab(m_faw, tr("Folio autonumérotation"));
}
/** m_main_layout = new QHBoxLayout();
* @brief ProjectAutoNumConfigPage::initLayout m_main_layout->addWidget(tab_widget);
* Init the layout of this page setLayout(m_main_layout);
*/
void ProjectAutoNumConfigPage::initLayout() {
//Management Tab
tab_widget->addTab(management_tab_widget, tr("Management"));
//Conductor Tab
tab_widget->addTab(conductor_tab_widget, tr("Conductor"));
QHBoxLayout *context_layout_conductor = new QHBoxLayout();
context_layout_conductor -> addWidget (m_label_conductor);
context_layout_conductor -> addWidget (m_context_cb_conductor);
context_layout_conductor -> addWidget (m_remove_pb_conductor);
QVBoxLayout *main_layout_conductor = new QVBoxLayout();
QVBoxLayout *aux_layout_conductor = new QVBoxLayout();
aux_layout_conductor->addLayout(context_layout_conductor);
aux_layout_conductor->addWidget(m_saw_conductor);
main_layout_conductor->addLayout(aux_layout_conductor);
conductor_tab_widget -> setLayout (main_layout_conductor);
//Element Tab
tab_widget->addTab(element_tab_widget,tr ("Element"));
QHBoxLayout *element_context_layout = new QHBoxLayout();
element_context_layout -> addWidget (m_label_element);
element_context_layout -> addWidget (m_context_cb_element);
element_context_layout -> addWidget (m_remove_pb_element);
QVBoxLayout *main_layout_element = new QVBoxLayout();
QVBoxLayout *aux_layout_element = new QVBoxLayout();
aux_layout_element->addLayout(element_context_layout);
aux_layout_element->addWidget(m_saw_element);
main_layout_element->addLayout(aux_layout_element);
element_tab_widget->setLayout(main_layout_element);
// Folio Tab
tab_widget->addTab(folio_tab_widget, tr("Folio"));
QHBoxLayout *context_layout_folio = new QHBoxLayout();
context_layout_folio -> addWidget (m_label_folio);
context_layout_folio -> addWidget (m_context_cb_folio);
context_layout_folio -> addWidget (m_remove_pb_folio);
QVBoxLayout *main_layout_folio = new QVBoxLayout();
QVBoxLayout *aux_layout_folio = new QVBoxLayout();
aux_layout_folio->addLayout(context_layout_folio);
aux_layout_folio->addWidget(m_saw_folio);
main_layout_folio->addLayout(aux_layout_folio);
folio_tab_widget->setLayout(main_layout_folio);
//Auto Numbering Tab
tab_widget->addTab(autoNumbering_tab_widget,tr ("Folio Auto Numbering"));
tab_widget->resize(850,590);
} }
/** /**
@ -417,7 +390,7 @@ void ProjectAutoNumConfigPage::adjustReadOnly() {
*/ */
void ProjectAutoNumConfigPage::buildConnections() { void ProjectAutoNumConfigPage::buildConnections() {
connect(tab_widget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int))); //connect(m_tab_widget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
//Management Tab //Management Tab
connect (m_amw, SIGNAL(applyPressed()), this, SLOT(applyManagement())); connect (m_amw, SIGNAL(applyPressed()), this, SLOT(applyManagement()));
@ -724,26 +697,7 @@ void ProjectAutoNumConfigPage::removeContext_folio() {
* @param tab index * @param tab index
* Change to Selected Tab * Change to Selected Tab
*/ */
void ProjectAutoNumConfigPage::changeToTab(int i){ void ProjectAutoNumConfigPage::changeToTab(int i)
tab_widget->setCurrentIndex(i); {
} Q_UNUSED(i);
/**
* @brief ProjectAutoNumConfigPage::tabChanged
* @param tab index
* Used to resize window to correct size
*/
void ProjectAutoNumConfigPage::tabChanged(int i){
if (i>=1){
if (tab_widget->currentIndex() == 4){
tab_widget->resize(520,tab_widget->height());
}
else if (tab_widget->currentIndex() == 1 || tab_widget->currentIndex() == 2 ){
tab_widget->resize(495,tab_widget->height());
}
else tab_widget->resize(475,tab_widget->height());
}
else {
tab_widget->resize(850,tab_widget->height());
}
} }

View File

@ -33,8 +33,8 @@ class QPushButton;
class FolioAutonumberingW; class FolioAutonumberingW;
class FormulaAutonumberingW; class FormulaAutonumberingW;
class AutoNumberingManagementW; class AutoNumberingManagementW;
class QTabWidget;
class QScrollArea; class QScrollArea;
class QHBoxLayout;
/** /**
This class, derived from ConfigPage, aims at providing the basic skeleton This class, derived from ConfigPage, aims at providing the basic skeleton
@ -134,7 +134,7 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
virtual void changeToTab(int); virtual void changeToTab(int);
protected: protected:
virtual void initWidgets(); virtual void initWidgets();
virtual void initLayout(); virtual void initLayout() {}
virtual void readValuesFromProject(); virtual void readValuesFromProject();
virtual void adjustReadOnly(); virtual void adjustReadOnly();
private: private:
@ -153,8 +153,6 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
void applyAutoNum(); void applyAutoNum();
void applyManagement(); void applyManagement();
void tabChanged(int);
signals: signals:
void setAutoNum(QString); void setAutoNum(QString);
void setAutoNum(int,int); void setAutoNum(int,int);
@ -163,16 +161,13 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
//Attributes //Attributes
private: private:
QTabWidget *tab_widget; QHBoxLayout *m_main_layout = nullptr;
QWidget *management_tab_widget; QWidget *m_management_tab_widget;
QWidget *conductor_tab_widget; QWidget *conductor_tab_widget;
QWidget *element_tab_widget; QWidget *element_tab_widget;
QWidget *folio_tab_widget; QWidget *folio_tab_widget;
QWidget *autoNumbering_tab_widget; QWidget *autoNumbering_tab_widget;
QScrollArea *scrollArea; QScrollArea *scrollArea;
QLabel *m_label_conductor;
QLabel *m_label_folio;
QLabel *m_label_element;
QComboBox *m_context_cb_conductor; QComboBox *m_context_cb_conductor;
QComboBox *m_context_cb_folio; QComboBox *m_context_cb_folio;
QComboBox *m_context_cb_element; QComboBox *m_context_cb_element;

View File

@ -43,8 +43,6 @@
#include "elementscollectionwidget.h" #include "elementscollectionwidget.h"
#include "autonumberingdockwidget.h" #include "autonumberingdockwidget.h"
#include "ui/dialogautonum.h"
#include <QMessageBox> #include <QMessageBox>
#include <QStandardPaths> #include <QStandardPaths>