Nomenclature

Add dialog for informing the user


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3344 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2014-10-04 15:49:27 +00:00
parent c883f612e6
commit f6426411ab
2 changed files with 8 additions and 3 deletions

View File

@@ -46,8 +46,12 @@ nomenclature::~nomenclature() {
@param true if success @param true if success
*/ */
bool nomenclature::saveToCSVFile() { bool nomenclature::saveToCSVFile() {
if(m_list_diagram.isEmpty()) return false; if(m_list_diagram.isEmpty())
QMessageBox msgBox;
msgBox.setText("Le titre du projet est vide, veuillez le remplir.");
msgBox.exec();
return false;
//Process... //Process...
QString data = tr("NOMENCLATURE : ") + m_project -> title() + "\n\n"; QString data = tr("NOMENCLATURE : ") + m_project -> title() + "\n\n";
data += tr("Folio") +";"+ tr("Sch\351ma") +";"+ tr("D\351signation")+";"+ tr("Label") +";"+ tr("Commententaire") +";"+ tr("Fabriquant") +";"+ tr("Reference") +";"+ tr("Machine-reference\n"); data += tr("Folio") +";"+ tr("Sch\351ma") +";"+ tr("D\351signation")+";"+ tr("Label") +";"+ tr("Commententaire") +";"+ tr("Fabriquant") +";"+ tr("Reference") +";"+ tr("Machine-reference\n");
@@ -58,7 +62,7 @@ bool nomenclature::saveToCSVFile() {
data += rows.at(j); data += rows.at(j);
} }
} }
// SAVE IN FILE // SAVE IN FILE
QString name = tr("nomenclature_") + QString(m_project -> title()); QString name = tr("nomenclature_") + QString(m_project -> title());
QString filename = QFileDialog::getSaveFileName(this->m_parent, tr("Enregister sous... "), name, tr("Fichiers csv (*.csv)")); QString filename = QFileDialog::getSaveFileName(this->m_parent, tr("Enregister sous... "), name, tr("Fichiers csv (*.csv)"));

View File

@@ -42,6 +42,7 @@ class nomenclature : public QObject {
QETProject *m_project; QETProject *m_project;
QList<Diagram *> m_list_diagram; QList<Diagram *> m_list_diagram;
QWidget *m_parent; QWidget *m_parent;
QMessageBox msgBox;
// constructors, destructor // constructors, destructor
public: public: