diff -r 2ef981980daa -r 72386c164f54 src/InventorySuppliers.cpp --- a/src/InventorySuppliers.cpp Sat Mar 19 22:59:11 2022 +0100 +++ b/src/InventorySuppliers.cpp Sun Mar 20 10:29:57 2022 +0100 @@ -22,7 +22,11 @@ -InventorySuppliers::InventorySuppliers(QWidget *parent) : QDialog(parent) /*, ui(new Ui::InventorySuppliers)*/ +/* + * Build the table and buttons on the mainscreen. + * Don't use a ui file, do it dynamicly. + */ +InventorySuppliers::InventorySuppliers(QWidget *parent) : QDialog(parent) { qDebug() << "InventorySuppliers start"; @@ -50,6 +54,7 @@ quitButton = new QPushButton(groupBox); quitButton->setObjectName(QString::fromUtf8("quitButton")); quitButton->setMinimumSize(QSize(80, 24)); + quitButton->setText(tr("Quit")); QIcon icon; icon.addFile(QString::fromUtf8(":icons/silk/door_out.png"), QSize(), QIcon::Normal, QIcon::Off); quitButton->setIcon(icon); @@ -58,15 +63,13 @@ insertButton = new QPushButton(groupBox); insertButton->setObjectName(QString::fromUtf8("insertButton")); insertButton->setMinimumSize(QSize(80, 24)); + insertButton->setText(tr("New")); QIcon icon1; icon1.addFile(QString::fromUtf8(":icons/silk/table_row_insert.png"), QSize(), QIcon::Normal, QIcon::Off); insertButton->setIcon(icon1); horizontalLayout->addWidget(insertButton, 0, Qt::AlignRight); - gridLayout->addWidget(groupBox, 1, 0, 1, 1); - //retranslateUi(this); - connect(quitButton, SIGNAL(clicked()), parent, SLOT(fromInventorySuppliers())); connect(insertButton, SIGNAL(clicked()), this, SLOT(on_insertButton_clicked())); emit refreshTable(); @@ -116,16 +119,11 @@ } -InventorySuppliers::~InventorySuppliers() -{ - qDebug() << "InventorySuppliers done"; -} +InventorySuppliers::~InventorySuppliers() {} void InventorySuppliers::edit(int recno) { - qDebug() << "InventorySuppliers edit:" << recno; - EditSupplier dialog(recno, this); /* Signal from editor if a refresh is needed */ connect(&dialog, SIGNAL(entry_changed()), this, SLOT(refreshTable())); @@ -138,14 +136,12 @@ { QPushButton *pb = qobject_cast(QObject::sender()); int recno = pb->objectName().toInt(); - qDebug() << Q_FUNC_INFO << recno; edit(recno); } void InventorySuppliers::on_insertButton_clicked() { - qDebug() << Q_FUNC_INFO; edit(-1); }