.
This commit is contained in:
@@ -19,20 +19,19 @@ public:
|
||||
explicit cDistributorEditDialog(QWidget *parent = 0);
|
||||
~cDistributorEditDialog();
|
||||
|
||||
qint32 id();
|
||||
|
||||
void setValues(cDistributor* lpDistributor);
|
||||
qint32 id();
|
||||
void setValues(cDistributor* lpDistributor);
|
||||
private slots:
|
||||
void on_m_lpName_textChanged(const QString &arg1);
|
||||
void on_m_lpName_textChanged(const QString &arg1);
|
||||
|
||||
private:
|
||||
Ui::cDistributorEditDialog *ui;
|
||||
qint32 m_id;
|
||||
Ui::cDistributorEditDialog* ui;
|
||||
qint32 m_id;
|
||||
|
||||
bool save();
|
||||
bool add();
|
||||
bool save();
|
||||
bool add();
|
||||
protected:
|
||||
void accept();
|
||||
void accept();
|
||||
};
|
||||
|
||||
#endif // CDISTRIBUTOREDITDIALOG_H
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>515</width>
|
||||
<height>347</height>
|
||||
<width>500</width>
|
||||
<height>350</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "cdistributoreditdialog.h"
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
@@ -67,6 +66,9 @@ void cDistributorWindow::showDistributorList()
|
||||
|
||||
m_lpDistributorListModel->appendRow(lpItems);
|
||||
}
|
||||
|
||||
for(int z = 0;z < header.count();z++)
|
||||
ui->m_lpDistributorList->resizeColumnToContents(z);
|
||||
}
|
||||
|
||||
bool cDistributorWindow::somethingSelected()
|
||||
|
||||
+327
-13
@@ -1,14 +1,20 @@
|
||||
#include "cmainwindow.h"
|
||||
#include "ui_cmainwindow.h"
|
||||
|
||||
#include "cpartlistwindow.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QDir>
|
||||
|
||||
#include <QInputDialog>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
@@ -34,6 +40,8 @@ cMainWindow::cMainWindow(QWidget *parent) :
|
||||
initDB();
|
||||
|
||||
loadDistributorList();
|
||||
loadPartGroupList();
|
||||
loadPartList();
|
||||
|
||||
updateMenu();
|
||||
}
|
||||
@@ -76,12 +84,22 @@ void cMainWindow::initDB()
|
||||
|
||||
QSqlQuery query;
|
||||
|
||||
if(!m_db.tables().contains("partgroup"))
|
||||
{
|
||||
query.exec("CREATE TABLE partgroup ("
|
||||
" id INTEGER PRIMARY KEY,"
|
||||
" name STRING NOT NULL,"
|
||||
" description TEXT);");
|
||||
}
|
||||
|
||||
if(!m_db.tables().contains("part"))
|
||||
{
|
||||
query.exec("CREATE TABLE part ("
|
||||
" id INTEGER PRIMARY KEY,"
|
||||
" name STRING NOT NULL,"
|
||||
" description TEXT);");
|
||||
" partgroupID INTEGER REFERENCES partgroup(id),"
|
||||
" description TEXT,"
|
||||
" link STRING);");
|
||||
}
|
||||
|
||||
if(!m_db.tables().contains("distributor"))
|
||||
@@ -99,6 +117,18 @@ void cMainWindow::initDB()
|
||||
" description TEXT);");
|
||||
}
|
||||
|
||||
if(!m_db.tables().contains("part_distributor"))
|
||||
{
|
||||
query.exec("CREATE TABLE part_distributor ("
|
||||
" id INTEGER PRIMARY KEY,"
|
||||
" name STRING,"
|
||||
" description TEXT,"
|
||||
" partID INTEGER REFERENCES part (id),"
|
||||
" distributorID INTEGER REFERENCES distributor (id),"
|
||||
" price DOUBLE,"
|
||||
" link STRING);");
|
||||
}
|
||||
|
||||
if(!m_db.tables().contains("partlist"))
|
||||
{
|
||||
query.exec("CREATE TABLE partlist ("
|
||||
@@ -110,21 +140,23 @@ void cMainWindow::initDB()
|
||||
if(!m_db.tables().contains("partlistitem"))
|
||||
{
|
||||
query.exec("CREATE TABLE partlistitem ("
|
||||
" id INTEGER PRIMARY KEY,"
|
||||
" partlistID INTEGER REFERENCES partlist (id),"
|
||||
" partID INTEGER REFERENCES part (id),"
|
||||
" reference STRING,"
|
||||
" description TEXT,"
|
||||
" distributorID INTEGER REFERENCES distributor (id),"
|
||||
" ordered BOOLEAN,"
|
||||
" link STRING);");
|
||||
" id INTEGER PRIMARY KEY,"
|
||||
" partlistID INTEGER REFERENCES partlist (id),"
|
||||
" part_disttributorID INTEGER REFERENCES part_distributor (id),"
|
||||
" replaceID INTEGER REFERENCES partlistitem (id),"
|
||||
" reference STRING,"
|
||||
" description TEXT,"
|
||||
" state INTEGER,"
|
||||
" price DOUBLE);");
|
||||
}
|
||||
|
||||
if(!m_db.tables().contains("project"))
|
||||
{
|
||||
query.exec("CREATE TABLE project ("
|
||||
" id INTEGER PRIMARY KEY,"
|
||||
" name STRING);");
|
||||
" name STRING,"
|
||||
" initialDate DATE,"
|
||||
" description);");
|
||||
}
|
||||
|
||||
if(!m_db.tables().contains("project_partlist"))
|
||||
@@ -170,6 +202,64 @@ void cMainWindow::loadDistributorList()
|
||||
}
|
||||
}
|
||||
|
||||
void cMainWindow::loadPartGroupList()
|
||||
{
|
||||
m_partGroupList.clear();
|
||||
|
||||
QSqlQuery query;
|
||||
QString szQuery;
|
||||
|
||||
szQuery = "SELECT id, name, description FROM partgroup ORDER BY name;";
|
||||
|
||||
if(!query.exec(szQuery))
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return;
|
||||
}
|
||||
|
||||
while(query.next())
|
||||
{
|
||||
cPartGroup* lpPartGroup = m_partGroupList.add(query.value("id").toInt());
|
||||
if(!lpPartGroup)
|
||||
return;
|
||||
|
||||
lpPartGroup->setName(query.value("name").toString());
|
||||
lpPartGroup->setDescription(query.value("description").toString());
|
||||
}
|
||||
}
|
||||
|
||||
void cMainWindow::loadPartList()
|
||||
{
|
||||
m_partList.clear();
|
||||
|
||||
QSqlQuery query;
|
||||
QString szQuery;
|
||||
|
||||
szQuery = "SELECT part.id id, part.name name, part.description description, part.partgroupID partgroupID, part.link FROM part JOIN partgroup ON (part.partgroupID = partgroup.id) ORDER BY partgroup.name, part.name;";
|
||||
|
||||
if(!query.exec(szQuery))
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return;
|
||||
}
|
||||
|
||||
while(query.next())
|
||||
{
|
||||
cPartGroup* lpPartGroup = m_partGroupList.find(query.value("part.partgroupID").toInt());
|
||||
if(!lpPartGroup)
|
||||
return;
|
||||
|
||||
cPart* lpPart = m_partList.add(query.value("part.id").toInt());
|
||||
if(!lpPart)
|
||||
return;
|
||||
|
||||
lpPart->setName(query.value("part.name").toString());
|
||||
lpPart->setDescription(query.value("part.description").toString());
|
||||
lpPart->setPartGroup(lpPartGroup);
|
||||
lpPart->setLink(query.value("part.link").toString());
|
||||
}
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuFileNewProject_triggered()
|
||||
{
|
||||
|
||||
@@ -239,23 +329,36 @@ void cMainWindow::on_m_lpMenuPartsShow_triggered()
|
||||
{
|
||||
m_lpPartWindow = new cPartWindow(this);
|
||||
ui->m_lpMainTab->addTab(m_lpPartWindow, tr("Parts"));
|
||||
m_lpPartWindow->setList(&m_partGroupList, &m_partList);
|
||||
|
||||
connect(m_lpPartWindow, SIGNAL(selectionChanged(QModelIndex)), this, SLOT(partSelectionChanged(QModelIndex)));
|
||||
connect(m_lpPartWindow, SIGNAL(partChanged(cPart*)), this, SLOT(partChanged(cPart*)));
|
||||
}
|
||||
ui->m_lpMainTab->setCurrentWidget(m_lpPartWindow);
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartsAdd_triggered()
|
||||
{
|
||||
if(!m_lpPartWindow)
|
||||
return;
|
||||
|
||||
m_lpPartWindow->addPart();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartsEdit_triggered()
|
||||
{
|
||||
if(!m_lpPartWindow)
|
||||
return;
|
||||
|
||||
m_lpPartWindow->editPart();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartsDelete_triggered()
|
||||
{
|
||||
if(!m_lpPartWindow)
|
||||
return;
|
||||
|
||||
m_lpPartWindow->deletePart();
|
||||
}
|
||||
|
||||
void cMainWindow::updateMenu()
|
||||
@@ -268,6 +371,17 @@ void cMainWindow::updateMenu()
|
||||
ui->m_lpMenuDistributorEdit->setEnabled(false);
|
||||
ui->m_lpMenuDistributorDelete->setEnabled(false);
|
||||
|
||||
ui->m_lpMenuPartsShow->setEnabled(true);
|
||||
ui->m_lpMenuPartsAdd->setEnabled(false);
|
||||
ui->m_lpMenuPartsEdit->setEnabled(false);
|
||||
ui->m_lpMenuPartsDelete->setEnabled(false);
|
||||
|
||||
ui->m_lpMenuPartlistNew->setEnabled(true);
|
||||
ui->m_lpMenuPartlistOpen->setEnabled(true);
|
||||
ui->m_lpMenuPartlistClose->setEnabled(false);
|
||||
ui->m_lpMenuPartlistSave->setEnabled(false);
|
||||
ui->m_lpMenuPartlistSaveAs->setEnabled(false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -289,13 +403,61 @@ void cMainWindow::updateMenu()
|
||||
ui->m_lpMenuDistributorEdit->setEnabled(false);
|
||||
ui->m_lpMenuDistributorDelete->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->m_lpMenuPartsShow->setEnabled(true);
|
||||
ui->m_lpMenuPartsAdd->setEnabled(false);
|
||||
ui->m_lpMenuPartsEdit->setEnabled(false);
|
||||
ui->m_lpMenuPartsDelete->setEnabled(false);
|
||||
|
||||
ui->m_lpMenuPartlistNew->setEnabled(true);
|
||||
ui->m_lpMenuPartlistOpen->setEnabled(true);
|
||||
ui->m_lpMenuPartlistClose->setEnabled(false);
|
||||
ui->m_lpMenuPartlistSave->setEnabled(false);
|
||||
ui->m_lpMenuPartlistSaveAs->setEnabled(false);
|
||||
}
|
||||
else
|
||||
else if(lpPartWindow)
|
||||
{
|
||||
ui->m_lpMenuPartsShow->setEnabled(false);
|
||||
ui->m_lpMenuPartsAdd->setEnabled(true);
|
||||
if(!lpPartWindow->groupSelected())
|
||||
{
|
||||
ui->m_lpMenuPartsEdit->setEnabled(true);
|
||||
ui->m_lpMenuPartsDelete->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_lpMenuPartsEdit->setEnabled(false);
|
||||
ui->m_lpMenuPartsDelete->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->m_lpMenuDistributorShow->setEnabled(true);
|
||||
ui->m_lpMenuDistributorAdd->setEnabled(false);
|
||||
ui->m_lpMenuDistributorEdit->setEnabled(false);
|
||||
ui->m_lpMenuDistributorDelete->setEnabled(false);
|
||||
|
||||
ui->m_lpMenuPartlistNew->setEnabled(true);
|
||||
ui->m_lpMenuPartlistOpen->setEnabled(true);
|
||||
ui->m_lpMenuPartlistClose->setEnabled(false);
|
||||
ui->m_lpMenuPartlistSave->setEnabled(false);
|
||||
ui->m_lpMenuPartlistSaveAs->setEnabled(false);
|
||||
}
|
||||
else if(lpPartlistWindow)
|
||||
{
|
||||
ui->m_lpMenuPartlistNew->setEnabled(true);
|
||||
ui->m_lpMenuPartlistOpen->setEnabled(true);
|
||||
ui->m_lpMenuPartlistClose->setEnabled(true);
|
||||
ui->m_lpMenuPartlistSave->setEnabled(lpPartlistWindow->somethingChanged());
|
||||
ui->m_lpMenuPartlistSaveAs->setEnabled(true);
|
||||
|
||||
ui->m_lpMenuDistributorShow->setEnabled(true);
|
||||
ui->m_lpMenuDistributorAdd->setEnabled(false);
|
||||
ui->m_lpMenuDistributorEdit->setEnabled(false);
|
||||
ui->m_lpMenuDistributorDelete->setEnabled(false);
|
||||
|
||||
ui->m_lpMenuPartsShow->setEnabled(true);
|
||||
ui->m_lpMenuPartsAdd->setEnabled(false);
|
||||
ui->m_lpMenuPartsEdit->setEnabled(false);
|
||||
ui->m_lpMenuPartsDelete->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,12 +466,164 @@ void cMainWindow::on_m_lpMainTab_currentChanged(int /*index*/)
|
||||
updateMenu();
|
||||
}
|
||||
|
||||
void cMainWindow::distributorSelectionChanged(const QModelIndex& index)
|
||||
void cMainWindow::distributorSelectionChanged(const QModelIndex& /*index*/)
|
||||
{
|
||||
updateMenu();
|
||||
}
|
||||
|
||||
void cMainWindow::distributorChanged(cDistributor* lpDistributor)
|
||||
void cMainWindow::distributorChanged(cDistributor* /*lpDistributor*/)
|
||||
{
|
||||
loadDistributorList();
|
||||
}
|
||||
|
||||
void cMainWindow::partSelectionChanged(const QModelIndex& /*index*/)
|
||||
{
|
||||
updateMenu();
|
||||
}
|
||||
|
||||
void cMainWindow::partGroupChanged(cPartGroup* /*lpPartGroup*/)
|
||||
{
|
||||
loadPartGroupList();
|
||||
loadPartList();
|
||||
}
|
||||
|
||||
void cMainWindow::partChanged(cPart* /*lpPart*/)
|
||||
{
|
||||
loadPartList();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartlistNew_triggered()
|
||||
{
|
||||
QList<qint16> newList;
|
||||
|
||||
for(int x = 0;x < ui->m_lpMainTab->count();x++)
|
||||
{
|
||||
cPartlistWindow* lpPartlistWindow = qobject_cast<cPartlistWindow*>(ui->m_lpMainTab->widget(x));
|
||||
|
||||
if(!lpPartlistWindow)
|
||||
continue;
|
||||
|
||||
QString szTitle = lpPartlistWindow->windowTitle();
|
||||
if(!szTitle.startsWith("new"))
|
||||
continue;
|
||||
|
||||
if(szTitle.length() == 3)
|
||||
{
|
||||
newList.append(0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!szTitle.contains("("))
|
||||
continue;
|
||||
|
||||
szTitle = szTitle.mid(szTitle.indexOf("(")+1);
|
||||
if(!szTitle.contains(")"))
|
||||
continue;
|
||||
|
||||
szTitle = szTitle.left(szTitle.indexOf(")"));
|
||||
newList.append(szTitle.toInt());
|
||||
}
|
||||
|
||||
std::sort(newList.begin(), newList.end());
|
||||
QString szNew;
|
||||
|
||||
if(newList.isEmpty())
|
||||
szNew = "new";
|
||||
else
|
||||
szNew = QString("new (%1)").arg(newList.last()+1);
|
||||
|
||||
cPartlistWindow* lpNew = new cPartlistWindow(ui->m_lpMainTab);
|
||||
lpNew->setPartlistName(szNew);
|
||||
lpNew->setMainTab(ui->m_lpMainTab);
|
||||
ui->m_lpMainTab->addTab(lpNew, szNew);
|
||||
ui->m_lpMainTab->setCurrentWidget(lpNew);
|
||||
|
||||
connect(lpNew, SIGNAL(partlistChanged(QWidget*)), this, SLOT(partlistChanged(QWidget*)));
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartlistOpen_triggered()
|
||||
{
|
||||
QStringList szList;
|
||||
QSqlQuery query;
|
||||
QList<qint32> idList;
|
||||
|
||||
if(!query.exec("SELECT id, name, description FROM partlist ORDER BY name;"))
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
QMessageBox::critical(this, "Error", "No projects found.");
|
||||
return;
|
||||
}
|
||||
|
||||
while(query.next())
|
||||
{
|
||||
QString sz = query.value("name").toString();
|
||||
if(!query.value("description").toString().isEmpty())
|
||||
sz.append(QString(" (%1)").arg(query.value("description").toString()));
|
||||
|
||||
szList.append(sz);
|
||||
idList.append(query.value("id").toInt());
|
||||
}
|
||||
|
||||
if(!szList.count())
|
||||
{
|
||||
QMessageBox::critical(this, "Error", "No projects found.");
|
||||
return;
|
||||
}
|
||||
|
||||
QInputDialog inputDialog(this);
|
||||
inputDialog.setOptions(QInputDialog::UseListViewForComboBoxItems);
|
||||
inputDialog.setComboBoxItems(szList);
|
||||
inputDialog.setLabelText("Project:");
|
||||
inputDialog.setWindowTitle("Open");
|
||||
|
||||
if(inputDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
QString szResult = inputDialog.textValue();
|
||||
qint16 index = szList.indexOf(szResult);
|
||||
qint32 id = idList.at(index);
|
||||
|
||||
cPartlistWindow* lpNew = new cPartlistWindow(ui->m_lpMainTab);
|
||||
lpNew->setMainTab(ui->m_lpMainTab);
|
||||
ui->m_lpMainTab->addTab(lpNew, "INITIALIZING");
|
||||
ui->m_lpMainTab->setCurrentWidget(lpNew);
|
||||
lpNew->setPartlistID(id);
|
||||
|
||||
connect(lpNew, SIGNAL(partlistChanged(QWidget*)), this, SLOT(partlistChanged(QWidget*)));
|
||||
}
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartlistClose_triggered()
|
||||
{
|
||||
cPartlistWindow* lpPartlistWindow = qobject_cast<cPartlistWindow*>(ui->m_lpMainTab->widget(ui->m_lpMainTab->currentIndex()));
|
||||
|
||||
if(!lpPartlistWindow)
|
||||
return;
|
||||
|
||||
if(lpPartlistWindow->close())
|
||||
ui->m_lpMainTab->removeTab(ui->m_lpMainTab->currentIndex());
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartlistSave_triggered()
|
||||
{
|
||||
cPartlistWindow* lpPartlistWindow = qobject_cast<cPartlistWindow*>(ui->m_lpMainTab->widget(ui->m_lpMainTab->currentIndex()));
|
||||
|
||||
if(!lpPartlistWindow)
|
||||
return;
|
||||
|
||||
lpPartlistWindow->save();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMenuPartlistSaveAs_triggered()
|
||||
{
|
||||
cPartlistWindow* lpPartlistWindow = qobject_cast<cPartlistWindow*>(ui->m_lpMainTab->widget(ui->m_lpMainTab->currentIndex()));
|
||||
|
||||
if(!lpPartlistWindow)
|
||||
return;
|
||||
|
||||
lpPartlistWindow->saveAs();
|
||||
}
|
||||
|
||||
void cMainWindow::partlistChanged(QWidget* /*lpWidget*/)
|
||||
{
|
||||
updateMenu();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "cpartwindow.h"
|
||||
|
||||
#include "cdistributor.h"
|
||||
#include "cpartgroup.h"
|
||||
#include "cpart.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QCloseEvent>
|
||||
@@ -30,12 +32,16 @@ private:
|
||||
Ui::cMainWindow* ui;
|
||||
QSqlDatabase m_db;
|
||||
cDistributorList m_distributorList;
|
||||
cPartGroupList m_partGroupList;
|
||||
cPartList m_partList;
|
||||
|
||||
cDistributorWindow* m_lpDistributorWindow;
|
||||
cPartWindow* m_lpPartWindow;
|
||||
|
||||
void initDB();
|
||||
void loadDistributorList();
|
||||
void loadPartGroupList();
|
||||
void loadPartList();
|
||||
|
||||
void updateMenu();
|
||||
protected:
|
||||
@@ -46,10 +52,12 @@ private slots:
|
||||
void on_m_lpMenuFileCloseProject_triggered();
|
||||
void on_m_lpMenuFileExport_triggered();
|
||||
void on_m_lpMenuFileClose_triggered();
|
||||
|
||||
void on_m_lpMenuDistributorShow_triggered();
|
||||
void on_m_lpMenuDistributorAdd_triggered();
|
||||
void on_m_lpMenuDistributorEdit_triggered();
|
||||
void on_m_lpMenuDistributorDelete_triggered();
|
||||
|
||||
void on_m_lpMenuPartsShow_triggered();
|
||||
void on_m_lpMenuPartsAdd_triggered();
|
||||
void on_m_lpMenuPartsEdit_triggered();
|
||||
@@ -58,6 +66,18 @@ private slots:
|
||||
|
||||
void distributorSelectionChanged(const QModelIndex& index);
|
||||
void distributorChanged(cDistributor* lpDistributor);
|
||||
|
||||
void partSelectionChanged(const QModelIndex& index);
|
||||
void partGroupChanged(cPartGroup* lpPartGroup);
|
||||
void partChanged(cPart* lpPart);
|
||||
|
||||
void partlistChanged(QWidget* lpWidget);
|
||||
|
||||
void on_m_lpMenuPartlistNew_triggered();
|
||||
void on_m_lpMenuPartlistOpen_triggered();
|
||||
void on_m_lpMenuPartlistClose_triggered();
|
||||
void on_m_lpMenuPartlistSave_triggered();
|
||||
void on_m_lpMenuPartlistSaveAs_triggered();
|
||||
};
|
||||
|
||||
#endif // CMAINWINDOW_H
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -64,9 +67,22 @@
|
||||
<addaction name="m_lpMenuPartsEdit"/>
|
||||
<addaction name="m_lpMenuPartsDelete"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="m_lpMenuPartlist">
|
||||
<property name="title">
|
||||
<string>Part&list</string>
|
||||
</property>
|
||||
<addaction name="m_lpMenuPartlistNew"/>
|
||||
<addaction name="m_lpMenuPartlistOpen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="m_lpMenuPartlistClose"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="m_lpMenuPartlistSave"/>
|
||||
<addaction name="m_lpMenuPartlistSaveAs"/>
|
||||
</widget>
|
||||
<addaction name="m_lpMenuFile"/>
|
||||
<addaction name="m_lpMenuDistributor"/>
|
||||
<addaction name="m_lpMenuParts"/>
|
||||
<addaction name="m_lpMenuPartlist"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
@@ -150,6 +166,31 @@
|
||||
<string>delete</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="m_lpMenuPartlistNew">
|
||||
<property name="text">
|
||||
<string>&new...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="m_lpMenuPartlistOpen">
|
||||
<property name="text">
|
||||
<string>&open...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="m_lpMenuPartlistClose">
|
||||
<property name="text">
|
||||
<string>&close</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="m_lpMenuPartlistSave">
|
||||
<property name="text">
|
||||
<string>&save</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="m_lpMenuPartlistSaveAs">
|
||||
<property name="text">
|
||||
<string>save &as...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#include "cpart.h"
|
||||
|
||||
|
||||
cPart::cPart() :
|
||||
m_id(-1),
|
||||
m_szName(""),
|
||||
m_szDescription(""),
|
||||
m_szLink(""),
|
||||
m_lpPartGroup(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void cPart::setID(const qint32& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
qint32 cPart::id()
|
||||
{
|
||||
return(m_id);
|
||||
}
|
||||
|
||||
void cPart::setName(const QString& szName)
|
||||
{
|
||||
m_szName = szName;
|
||||
}
|
||||
|
||||
QString cPart::name()
|
||||
{
|
||||
return(m_szName);
|
||||
}
|
||||
|
||||
void cPart::setDescription(const QString& szDescription)
|
||||
{
|
||||
m_szDescription = szDescription;
|
||||
}
|
||||
|
||||
QString cPart::description()
|
||||
{
|
||||
return(m_szDescription);
|
||||
}
|
||||
|
||||
void cPart::setLink(const QString& szLink)
|
||||
{
|
||||
m_szLink = szLink;
|
||||
}
|
||||
|
||||
QString cPart::link()
|
||||
{
|
||||
return(m_szLink);
|
||||
}
|
||||
|
||||
void cPart::setPartGroup(cPartGroup* lpPartGroup)
|
||||
{
|
||||
m_lpPartGroup = lpPartGroup;
|
||||
}
|
||||
|
||||
cPartGroup* cPart::partGroup()
|
||||
{
|
||||
return(m_lpPartGroup);
|
||||
}
|
||||
|
||||
cPart* cPartList::add(qint32 id)
|
||||
{
|
||||
for(int x = 0;x < count();x++)
|
||||
{
|
||||
if(at(x)->id() == id)
|
||||
return(at(x));
|
||||
}
|
||||
|
||||
cPart* lpPart = new cPart;
|
||||
lpPart->setID(id);
|
||||
append(lpPart);
|
||||
return(lpPart);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef CPART_H
|
||||
#define CPART_H
|
||||
|
||||
|
||||
#include "cpartgroup.h"
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QList>
|
||||
|
||||
|
||||
class cPart
|
||||
{
|
||||
public:
|
||||
cPart();
|
||||
|
||||
void setID(const qint32& id);
|
||||
qint32 id();
|
||||
|
||||
void setName(const QString& szName);
|
||||
QString name();
|
||||
|
||||
void setDescription(const QString& szDescription);
|
||||
QString description();
|
||||
|
||||
void setLink(const QString& szLink);
|
||||
QString link();
|
||||
|
||||
void setPartGroup(cPartGroup* lpPartGroup);
|
||||
cPartGroup* partGroup();
|
||||
private:
|
||||
qint32 m_id;
|
||||
QString m_szName;
|
||||
QString m_szDescription;
|
||||
QString m_szLink;
|
||||
cPartGroup* m_lpPartGroup;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(cPart*)
|
||||
|
||||
class cPartList : public QList<cPart*>
|
||||
{
|
||||
public:
|
||||
cPart* add(qint32 id);
|
||||
};
|
||||
|
||||
#endif // CPART_H
|
||||
@@ -0,0 +1,215 @@
|
||||
#include "cparteditdialog.h"
|
||||
#include "ui_cparteditdialog.h"
|
||||
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
cPartEditDialog::cPartEditDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::cPartEditDialog),
|
||||
m_id(-1),
|
||||
m_lpPart(0),
|
||||
m_lpPartGroupList(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->m_lpButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
}
|
||||
|
||||
cPartEditDialog::~cPartEditDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cPartEditDialog::setValues(cPart* lpPart, cPartGroupList* lpPartGroupList)
|
||||
{
|
||||
m_lpPart = lpPart;
|
||||
m_lpPartGroupList = lpPartGroupList;
|
||||
|
||||
for(int x = 0;x < m_lpPartGroupList->count();x++)
|
||||
ui->m_lpGroup->addItem(m_lpPartGroupList->at(x)->name(), QVariant::fromValue(m_lpPartGroupList->at(x)));
|
||||
|
||||
if(lpPart)
|
||||
{
|
||||
ui->m_lpName->setText(lpPart->name());
|
||||
ui->m_lpLink->setText(lpPart->link());
|
||||
ui->m_lpDescription->setText(lpPart->description());
|
||||
|
||||
ui->m_lpGroup->setCurrentText(lpPart->partGroup()->name());
|
||||
|
||||
m_id = lpPart->id();
|
||||
}
|
||||
}
|
||||
|
||||
void cPartEditDialog::on_m_lpName_textChanged(const QString &arg1)
|
||||
{
|
||||
if(arg1.isEmpty())
|
||||
ui->m_lpButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
else
|
||||
ui->m_lpButtonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
}
|
||||
|
||||
void cPartEditDialog::accept()
|
||||
{
|
||||
if(m_id != -1)
|
||||
{
|
||||
if(save())
|
||||
QDialog::accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(add())
|
||||
QDialog::accept();
|
||||
}
|
||||
}
|
||||
|
||||
bool cPartEditDialog::save()
|
||||
{
|
||||
QSqlQuery query;
|
||||
QString szQuery;
|
||||
|
||||
szQuery = QString("SELECT name FROM part WHERE name=:name AND id <> :id AND partgroupID = :partgroupID;");
|
||||
|
||||
query.prepare(szQuery);
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":id", m_id);
|
||||
query.bindValue(":partgroupID", qvariant_cast<cPartGroup*>(ui->m_lpGroup->currentData(Qt::UserRole))->id());
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(query.next())
|
||||
{
|
||||
QMessageBox::critical(this, "ERROR", "Part name already exists.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
szQuery = QString("UPDATE part SET name=:name, link=:link, description=:description, partgroupID = :partgroupID WHERE id=:id;");
|
||||
query.prepare(szQuery);
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":link", ui->m_lpLink->text());
|
||||
query.bindValue(":description", ui->m_lpDescription->document()->toPlainText());
|
||||
query.bindValue(":id", m_id);
|
||||
query.bindValue(":partgroupID", qvariant_cast<cPartGroup*>(ui->m_lpGroup->currentData(Qt::UserRole))->id());
|
||||
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool cPartEditDialog::add()
|
||||
{
|
||||
QSqlQuery query;
|
||||
QString szQuery;
|
||||
|
||||
szQuery = QString("SELECT name FROM part WHERE name=:name AND partgroupID = :partgroupID;");
|
||||
query.prepare(szQuery);
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":partgroupID", qvariant_cast<cPartGroup*>(ui->m_lpGroup->currentData(Qt::UserRole))->id());
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(query.next())
|
||||
{
|
||||
QMessageBox::critical(this, "ERROR", "Part already exists.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
szQuery = QString("INSERT INTO part (name, link, description, partgroupID) VALUES (:name, :link, :description, :partgroupID);");
|
||||
query.prepare(szQuery);
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":link", ui->m_lpLink->text());
|
||||
query.bindValue(":description", ui->m_lpDescription->document()->toPlainText());
|
||||
query.bindValue(":partgroupID", qvariant_cast<cPartGroup*>(ui->m_lpGroup->currentData(Qt::UserRole))->id());
|
||||
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
szQuery = QString("SELECT name FROM part WHERE name=:name AND partgroupID = :partgroupID;");
|
||||
query.prepare(szQuery);
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":partgroupID", qvariant_cast<cPartGroup*>(ui->m_lpGroup->currentData(Qt::UserRole))->id());
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(!query.next())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
m_id = query.value("id").toInt();
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
qint32 cPartEditDialog::id()
|
||||
{
|
||||
return(m_id);
|
||||
}
|
||||
|
||||
void cPartEditDialog::on_m_lpGroupAdd_clicked()
|
||||
{
|
||||
bool bOK;
|
||||
QString szGroup = QInputDialog::getText(this, tr("Part Group"), tr("Part Group:"), QLineEdit::Normal, "", &bOK);
|
||||
|
||||
if(bOK && !szGroup.isEmpty())
|
||||
{
|
||||
QSqlQuery query;
|
||||
|
||||
query.prepare("SELECT id FROM partgroup WHERE name=:name;");
|
||||
query.bindValue(":name", szGroup);
|
||||
if(!query.exec())
|
||||
qDebug() << query.lastError().text();
|
||||
else
|
||||
{
|
||||
if(query.next())
|
||||
QMessageBox::information(this, "Group", "Group already exists.");
|
||||
else
|
||||
{
|
||||
query.prepare("INSERT INTO partgroup (name) VALUES(:name);");
|
||||
query.bindValue(":name", szGroup);
|
||||
if(!query.exec())
|
||||
qDebug() << query.lastError().text();
|
||||
else
|
||||
{
|
||||
query.prepare("SELECT id FROM partgroup WHERE name=:name;");
|
||||
query.bindValue(":name", szGroup);
|
||||
if(!query.exec())
|
||||
qDebug() << query.lastError().text();
|
||||
else
|
||||
{
|
||||
cPartGroup* lpGroup = m_lpPartGroupList->add(query.value("id").toInt());
|
||||
lpGroup->setName(szGroup);
|
||||
|
||||
setValues(m_lpPart, m_lpPartGroupList);
|
||||
|
||||
ui->m_lpGroup->setCurrentText(szGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef CPARTEDITDIALOG_H
|
||||
#define CPARTEDITDIALOG_H
|
||||
|
||||
|
||||
#include "cpart.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cPartEditDialog;
|
||||
}
|
||||
|
||||
class cPartEditDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit cPartEditDialog(QWidget *parent = 0);
|
||||
~cPartEditDialog();
|
||||
|
||||
qint32 id();
|
||||
void setValues(cPart* lpPart, cPartGroupList* lpPartGroupList);
|
||||
private slots:
|
||||
void on_m_lpName_textChanged(const QString &arg1);
|
||||
void on_m_lpGroupAdd_clicked();
|
||||
|
||||
private:
|
||||
Ui::cPartEditDialog* ui;
|
||||
qint32 m_id;
|
||||
cPart* m_lpPart;
|
||||
cPartGroupList* m_lpPartGroupList;
|
||||
|
||||
bool save();
|
||||
bool add();
|
||||
protected:
|
||||
void accept();
|
||||
};
|
||||
|
||||
#endif // CPARTEDITDIALOG_H
|
||||
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>cPartEditDialog</class>
|
||||
<widget class="QDialog" name="cPartEditDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Part</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Group:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_lpGroup"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_lpGroupAdd">
|
||||
<property name="text">
|
||||
<string>add...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Web:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpLink"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="m_lpDescription"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="m_lpButtonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>m_lpButtonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>cPartEditDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_lpButtonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>cPartEditDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,62 @@
|
||||
#include "cpartgroup.h"
|
||||
|
||||
|
||||
cPartGroup::cPartGroup() :
|
||||
m_id(-1),
|
||||
m_szName(""),
|
||||
m_szDescription("")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void cPartGroup::setID(const qint32& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
qint32 cPartGroup::id()
|
||||
{
|
||||
return(m_id);
|
||||
}
|
||||
|
||||
void cPartGroup::setName(const QString& szName)
|
||||
{
|
||||
m_szName = szName;
|
||||
}
|
||||
|
||||
QString cPartGroup::name()
|
||||
{
|
||||
return(m_szName);
|
||||
}
|
||||
|
||||
void cPartGroup::setDescription(const QString& szDescription)
|
||||
{
|
||||
m_szDescription = szDescription;
|
||||
}
|
||||
|
||||
QString cPartGroup::description()
|
||||
{
|
||||
return(m_szDescription);
|
||||
}
|
||||
|
||||
cPartGroup* cPartGroupList::add(qint32 id)
|
||||
{
|
||||
cPartGroup* lpPartGroup = find(id);
|
||||
if(lpPartGroup)
|
||||
return(lpPartGroup);
|
||||
|
||||
lpPartGroup = new cPartGroup;
|
||||
lpPartGroup->setID(id);
|
||||
append(lpPartGroup);
|
||||
return(lpPartGroup);
|
||||
}
|
||||
|
||||
cPartGroup* cPartGroupList::find(qint32 id)
|
||||
{
|
||||
for(int x = 0;x < count();x++)
|
||||
{
|
||||
if(at(x)->id() == id)
|
||||
return(at(x));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef CPARTGROUP_H
|
||||
#define CPARTGROUP_H
|
||||
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QList>
|
||||
|
||||
|
||||
class cPartGroup
|
||||
{
|
||||
public:
|
||||
cPartGroup();
|
||||
|
||||
void setID(const qint32& id);
|
||||
qint32 id();
|
||||
|
||||
void setName(const QString& szName);
|
||||
QString name();
|
||||
|
||||
void setDescription(const QString& szDescription);
|
||||
QString description();
|
||||
private:
|
||||
qint32 m_id;
|
||||
QString m_szName;
|
||||
QString m_szDescription;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(cPartGroup*)
|
||||
|
||||
class cPartGroupList : public QList<cPartGroup*>
|
||||
{
|
||||
public:
|
||||
cPartGroup* add(qint32 id);
|
||||
cPartGroup* find(qint32 id);
|
||||
};
|
||||
|
||||
#endif // CPARTGROUP_H
|
||||
+180
-2
@@ -2,15 +2,193 @@
|
||||
#include "ui_cpartlistwindow.h"
|
||||
|
||||
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
cPartlistWindow::cPartlistWindow(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::cPartlistWindow)
|
||||
ui(new Ui::cPartlistWindow),
|
||||
m_lpMainTab(0),
|
||||
m_id(-1),
|
||||
m_bSomethingChanged(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
cPartlistWindow::~cPartlistWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cPartlistWindow::setMainTab(QTabWidget *lpMainTab)
|
||||
{
|
||||
m_lpMainTab = lpMainTab;
|
||||
}
|
||||
|
||||
void cPartlistWindow::setPartlistName(const QString& szPartlistName)
|
||||
{
|
||||
setWindowTitle(szPartlistName);
|
||||
ui->m_lpName->setText(szPartlistName);
|
||||
m_bSomethingChanged = true;
|
||||
}
|
||||
|
||||
QString cPartlistWindow::partlistName()
|
||||
{
|
||||
return(ui->m_lpName->text());
|
||||
}
|
||||
|
||||
void cPartlistWindow::setPartlistID(const qint32& id)
|
||||
{
|
||||
m_id = id;
|
||||
|
||||
QSqlQuery query;
|
||||
|
||||
query.prepare("SELECT name, description FROM partlist WHERE id=:id;");
|
||||
query.bindValue(":id", m_id);
|
||||
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!query.next())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return;
|
||||
}
|
||||
|
||||
ui->m_lpName->setText(query.value("name").toString());
|
||||
ui->m_lpDescription->setText(query.value("description").toString());
|
||||
|
||||
if(m_lpMainTab)
|
||||
{
|
||||
m_lpMainTab->setTabText(m_lpMainTab->currentIndex(), query.value("name").toString());
|
||||
partlistChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
void cPartlistWindow::on_m_lpName_textChanged(const QString &arg1)
|
||||
{
|
||||
if(m_lpMainTab)
|
||||
{
|
||||
m_bSomethingChanged = true;
|
||||
m_lpMainTab->setTabText(m_lpMainTab->currentIndex(), arg1);
|
||||
partlistChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool cPartlistWindow::close()
|
||||
{
|
||||
qint32 ret = QMessageBox::question(this, tr("Close"), tr("Do you want to save changes?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Abort);
|
||||
|
||||
switch(ret)
|
||||
{
|
||||
case QMessageBox::Yes:
|
||||
return(save());
|
||||
break;
|
||||
case QMessageBox::No:
|
||||
return(false);
|
||||
break;
|
||||
case QMessageBox::Abort:
|
||||
return(false);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cPartlistWindow::save()
|
||||
{
|
||||
if(ui->m_lpName->text().isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, "Save", "No name given for Partlist.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(m_id == -1)
|
||||
saveAs();
|
||||
|
||||
return(save(m_id));
|
||||
}
|
||||
|
||||
bool cPartlistWindow::saveAs()
|
||||
{
|
||||
if(ui->m_lpName->text().isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, "Save", "No name given for Partlist.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
QSqlQuery query;
|
||||
|
||||
query.prepare("SELECT id FROM partlist WHERE name = :name;");
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(query.next())
|
||||
{
|
||||
QMessageBox::critical(this, "Save", "Partlist already exists.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
query.prepare("INSERT INTO partlist (name, description) VALUES (:name, :description);");
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":description", ui->m_lpDescription->document()->toPlainText());
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
query.prepare("SELECT id FROM partlist WHERE name = :name;");
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(!query.next())
|
||||
return(false);
|
||||
|
||||
m_id = query.value("id").toInt();
|
||||
|
||||
return(save(m_id));
|
||||
}
|
||||
|
||||
bool cPartlistWindow::save(qint32 id)
|
||||
{
|
||||
QSqlQuery query;
|
||||
|
||||
query.prepare("DELETE FROM partlistitem WHERE partlistID = :partlistID;");
|
||||
query.bindValue(":partlistID", id);
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
query.prepare("UPDATE partlist SET name=:name, description=:description WHERE id=:id;");
|
||||
query.bindValue(":name", ui->m_lpName->text());
|
||||
query.bindValue(":description", ui->m_lpDescription->document()->toPlainText());
|
||||
query.bindValue(":id", id);
|
||||
if(!query.exec())
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool cPartlistWindow::somethingChanged()
|
||||
{
|
||||
return(m_bSomethingChanged);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CPARTLISTWINDOW_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTabWidget>
|
||||
|
||||
namespace Ui {
|
||||
class cPartlistWindow;
|
||||
@@ -15,8 +16,31 @@ public:
|
||||
explicit cPartlistWindow(QWidget *parent = 0);
|
||||
~cPartlistWindow();
|
||||
|
||||
void setMainTab(QTabWidget* lpMainTab);
|
||||
|
||||
void setPartlistName(const QString& szPartlistName);
|
||||
QString partlistName();
|
||||
|
||||
void setPartlistID(const qint32& id);
|
||||
|
||||
bool close();
|
||||
bool save();
|
||||
bool saveAs();
|
||||
|
||||
bool somethingChanged();
|
||||
private slots:
|
||||
void on_m_lpName_textChanged(const QString &arg1);
|
||||
|
||||
signals:
|
||||
void partlistChanged(QWidget* lpWidget) const;
|
||||
|
||||
private:
|
||||
Ui::cPartlistWindow *ui;
|
||||
QTabWidget* m_lpMainTab;
|
||||
qint32 m_id;
|
||||
bool m_bSomethingChanged;
|
||||
|
||||
bool save(qint32 id);
|
||||
};
|
||||
|
||||
#endif // CPARTLISTWINDOW_H
|
||||
|
||||
+90
-15
@@ -6,26 +6,101 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>593</width>
|
||||
<height>560</height>
|
||||
<width>793</width>
|
||||
<height>700</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>190</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,100">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="2,5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Costs:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpCosts">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="m_lpDescription"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_lpGroupBox">
|
||||
<property name="title">
|
||||
<string>Parts</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="m_lpPartList"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
+256
@@ -1,15 +1,271 @@
|
||||
#include "cpartwindow.h"
|
||||
#include "ui_cpartwindow.h"
|
||||
|
||||
#include "cparteditdialog.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
cPartWindow::cPartWindow(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::cPartWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_lpPartListModel = new QStandardItemModel(0, 2);
|
||||
ui->m_lpPartList->setModel(m_lpPartListModel);
|
||||
}
|
||||
|
||||
cPartWindow::~cPartWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cPartWindow::setList(cPartGroupList* lpPartGroupList, cPartList* lpPartList)
|
||||
{
|
||||
m_lpPartGroupList = lpPartGroupList;
|
||||
m_lpPartList = lpPartList;
|
||||
|
||||
showPartList();
|
||||
}
|
||||
|
||||
void cPartWindow::showPartList()
|
||||
{
|
||||
m_lpPartListModel->clear();
|
||||
|
||||
QStringList header;
|
||||
header << tr("Name") << tr("description") << tr("link");
|
||||
|
||||
m_lpPartListModel->setHorizontalHeaderLabels(header);
|
||||
|
||||
qint32 iOldPartGroupID = -1;
|
||||
QStandardItem* lpGroupItem = 0;
|
||||
|
||||
for(int x = 0;x < m_lpPartList->count();x++)
|
||||
{
|
||||
QList<QStandardItem*> lpItems;
|
||||
cPart* lpPart = m_lpPartList->at(x);
|
||||
cPartGroup* lpPartGroup = lpPart->partGroup();
|
||||
|
||||
if(lpPartGroup->id() != iOldPartGroupID)
|
||||
{
|
||||
iOldPartGroupID = lpPartGroup->id();
|
||||
lpGroupItem = new QStandardItem(lpPartGroup->name());
|
||||
m_lpPartListModel->appendRow(lpGroupItem);
|
||||
}
|
||||
|
||||
for(int z = 0;z < header.count();z++)
|
||||
lpItems.append(new QStandardItem);
|
||||
|
||||
lpItems.at(0)->setText(lpPart->name());
|
||||
lpItems.at(1)->setText(lpPart->description());
|
||||
lpItems.at(2)->setText(lpPart->link());
|
||||
|
||||
for(int z = 0;z < header.count();z++)
|
||||
lpItems.at(z)->setData(QVariant::fromValue(lpPart), Qt::UserRole);
|
||||
|
||||
lpGroupItem->appendRow(lpItems);
|
||||
}
|
||||
|
||||
for(int z = 0;z < header.count();z++)
|
||||
ui->m_lpPartList->resizeColumnToContents(z);
|
||||
|
||||
ui->m_lpPartList->expandAll();
|
||||
|
||||
for(int z = 0;z < header.count();z++)
|
||||
ui->m_lpPartList->resizeColumnToContents(z);
|
||||
}
|
||||
|
||||
bool cPartWindow::somethingSelected()
|
||||
{
|
||||
if(ui->m_lpPartList->selectionModel()->selectedRows().count())
|
||||
return(true);
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cPartWindow::groupSelected()
|
||||
{
|
||||
QStandardItem* lpItem = m_lpPartListModel->itemFromIndex(ui->m_lpPartList->selectionModel()->currentIndex());
|
||||
if(!lpItem)
|
||||
return(false);
|
||||
|
||||
if(lpItem->parent())
|
||||
return(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
void cPartWindow::on_m_lpPartList_clicked(const QModelIndex &index)
|
||||
{
|
||||
selectionChanged(index);
|
||||
}
|
||||
|
||||
void cPartWindow::on_m_lpPartList_customContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
QMenu* lpMenu = new QMenu(this);
|
||||
|
||||
lpMenu->addAction("add", this, SLOT(onAdd()));
|
||||
|
||||
if(somethingSelected())
|
||||
{
|
||||
if(!groupSelected())
|
||||
{
|
||||
lpMenu->addAction("edit", this, SLOT(onEdit()));
|
||||
lpMenu->addAction("delete", this, SLOT(onDelete()));
|
||||
}
|
||||
}
|
||||
|
||||
lpMenu->popup(ui->m_lpPartList->viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void cPartWindow::addPart()
|
||||
{
|
||||
onAdd();
|
||||
}
|
||||
|
||||
void cPartWindow::editPart()
|
||||
{
|
||||
onEdit();
|
||||
}
|
||||
|
||||
void cPartWindow::deletePart()
|
||||
{
|
||||
onDelete();
|
||||
}
|
||||
|
||||
void cPartWindow::onAdd()
|
||||
{
|
||||
cPartEditDialog* lpDialog = new cPartEditDialog(this);
|
||||
lpDialog->setValues(0, m_lpPartGroupList);
|
||||
|
||||
if(lpDialog->exec() == QDialog::Rejected)
|
||||
{
|
||||
delete lpDialog;
|
||||
return;
|
||||
}
|
||||
|
||||
qint32 id = lpDialog->id();
|
||||
|
||||
delete lpDialog;
|
||||
|
||||
partChanged(0);
|
||||
showPartList();
|
||||
|
||||
for(int x = 0;x < m_lpPartListModel->rowCount();x++)
|
||||
{
|
||||
QStandardItem* lpItem = m_lpPartListModel->item(x, 0);
|
||||
if(!lpItem)
|
||||
continue;
|
||||
|
||||
cPart* lpPart = qvariant_cast<cPart*>(lpItem->data(Qt::UserRole));
|
||||
if(!lpPart)
|
||||
continue;
|
||||
|
||||
if(lpPart->id() == id)
|
||||
{
|
||||
ui->m_lpPartList->setCurrentIndex(lpItem->index());
|
||||
ui->m_lpPartList->scrollTo(lpItem->index());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cPartWindow::onEdit()
|
||||
{
|
||||
if(!ui->m_lpPartList->selectionModel()->selectedRows().count())
|
||||
return;
|
||||
|
||||
QStandardItem* lpItem = m_lpPartListModel->itemFromIndex(ui->m_lpPartList->selectionModel()->selectedIndexes().at(0));
|
||||
if(!lpItem)
|
||||
return;
|
||||
|
||||
cPart* lpPart = qvariant_cast<cPart*>(lpItem->data(Qt::UserRole));
|
||||
if(!lpPart)
|
||||
return;
|
||||
|
||||
cPartEditDialog* lpDialog = new cPartEditDialog(this);
|
||||
lpDialog->setValues(lpPart, m_lpPartGroupList);
|
||||
|
||||
if(lpDialog->exec() == QDialog::Rejected)
|
||||
{
|
||||
delete lpDialog;
|
||||
return;
|
||||
}
|
||||
|
||||
qint32 id = lpDialog->id();
|
||||
|
||||
delete lpDialog;
|
||||
|
||||
partChanged(0);
|
||||
showPartList();
|
||||
|
||||
for(int x = 0;x < m_lpPartListModel->rowCount();x++)
|
||||
{
|
||||
QStandardItem* lpItem = m_lpPartListModel->item(x, 0);
|
||||
if(!lpItem)
|
||||
continue;
|
||||
|
||||
cPart* lpPart = qvariant_cast<cPart*>(lpItem->data(Qt::UserRole));
|
||||
if(!lpPart)
|
||||
continue;
|
||||
|
||||
if(lpPart->id() == id)
|
||||
{
|
||||
ui->m_lpPartList->setCurrentIndex(lpItem->index());
|
||||
ui->m_lpPartList->scrollTo(lpItem->index());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cPartWindow::onDelete()
|
||||
{
|
||||
for(int x = 0;x < ui->m_lpPartList->selectionModel()->selectedIndexes().count();x++)
|
||||
{
|
||||
if(ui->m_lpPartList->selectionModel()->selectedIndexes().at(x).column())
|
||||
continue;
|
||||
|
||||
QStandardItem* lpItem = m_lpPartListModel->itemFromIndex(ui->m_lpPartList->selectionModel()->selectedIndexes().at(x));
|
||||
if(!lpItem)
|
||||
continue;
|
||||
|
||||
cPart* lpPart = qvariant_cast<cPart*>(lpItem->data(Qt::UserRole));
|
||||
if(!lpPart)
|
||||
continue;
|
||||
|
||||
QSqlQuery query;
|
||||
QString szQuery;
|
||||
|
||||
szQuery = QString("SELECT * FROM partlistitem WHERE partID = %1;").arg(lpPart->id());
|
||||
if(!query.exec(szQuery))
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(query.next())
|
||||
{
|
||||
QMessageBox::critical(this, "ERROR", QString("Part '%1' still in use.\nUnable to delete.").arg(lpPart->name()));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(QMessageBox::question(this, "DELETE", QString("Are you sure to delete part '%1'?").arg(lpPart->name())) == QMessageBox::No)
|
||||
continue;
|
||||
|
||||
szQuery = QString("DELETE FROM part WHERE id=%1;").arg(lpPart->id());
|
||||
if(!query.exec(szQuery))
|
||||
{
|
||||
qDebug() << query.lastError().text();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
partChanged(0);
|
||||
showPartList();
|
||||
}
|
||||
|
||||
+32
-1
@@ -1,7 +1,13 @@
|
||||
#ifndef CPARTWINDOW_H
|
||||
#define CPARTWINDOW_H
|
||||
|
||||
|
||||
#include "cpart.h"
|
||||
#include "cpartgroup.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cPartWindow;
|
||||
@@ -15,8 +21,33 @@ public:
|
||||
explicit cPartWindow(QWidget *parent = 0);
|
||||
~cPartWindow();
|
||||
|
||||
void setList(cPartGroupList* lpPartGroupList, cPartList* lpPartList);
|
||||
bool somethingSelected();
|
||||
bool groupSelected();
|
||||
|
||||
void addPart();
|
||||
void editPart();
|
||||
void deletePart();
|
||||
private slots:
|
||||
void on_m_lpPartList_clicked(const QModelIndex &index);
|
||||
void on_m_lpPartList_customContextMenuRequested(const QPoint &pos);
|
||||
|
||||
void onAdd();
|
||||
void onEdit();
|
||||
void onDelete();
|
||||
|
||||
signals:
|
||||
void selectionChanged(const QModelIndex& index) const;
|
||||
void partGroupChanged(cPartGroup* lpPartGroup) const;
|
||||
void partChanged(cPart* lpPart) const;
|
||||
|
||||
private:
|
||||
Ui::cPartWindow *ui;
|
||||
Ui::cPartWindow* ui;
|
||||
QStandardItemModel* m_lpPartListModel;
|
||||
cPartGroupList* m_lpPartGroupList;
|
||||
cPartList* m_lpPartList;
|
||||
|
||||
void showPartList();
|
||||
};
|
||||
|
||||
#endif // CPARTWINDOW_H
|
||||
|
||||
+14
-1
@@ -15,7 +15,20 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="m_lpPartList"/>
|
||||
<widget class="QTreeView" name="m_lpPartList">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
+10
-3
@@ -31,7 +31,10 @@ SOURCES += \
|
||||
cdistributorwindow.cpp \
|
||||
cpartwindow.cpp \
|
||||
cdistributor.cpp \
|
||||
cdistributoreditdialog.cpp
|
||||
cdistributoreditdialog.cpp \
|
||||
cpartgroup.cpp \
|
||||
cpart.cpp \
|
||||
cparteditdialog.cpp
|
||||
|
||||
HEADERS += \
|
||||
cmainwindow.h \
|
||||
@@ -40,11 +43,15 @@ HEADERS += \
|
||||
cdistributorwindow.h \
|
||||
cpartwindow.h \
|
||||
cdistributor.h \
|
||||
cdistributoreditdialog.h
|
||||
cdistributoreditdialog.h \
|
||||
cpartgroup.h \
|
||||
cpart.h \
|
||||
cparteditdialog.h
|
||||
|
||||
FORMS += \
|
||||
cmainwindow.ui \
|
||||
cpartlistwindow.ui \
|
||||
cdistributorwindow.ui \
|
||||
cpartwindow.ui \
|
||||
cdistributoreditdialog.ui
|
||||
cdistributoreditdialog.ui \
|
||||
cparteditdialog.ui
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.5.0, 2017-12-28T17:53:22. -->
|
||||
<!-- Written by QtCreator 4.5.0, 2018-01-05T10:47:46. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
Reference in New Issue
Block a user