Added texts on the buttons. Removed a number of debug messages. Hide and show the main menubar during edit. Removed unused and unneeded stackable window pages.

Sun, 20 Mar 2022 10:29:57 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 20 Mar 2022 10:29:57 +0100
changeset 66
72386c164f54
parent 65
2ef981980daa
child 67
55aa8c3146ee

Added texts on the buttons. Removed a number of debug messages. Hide and show the main menubar during edit. Removed unused and unneeded stackable window pages.

src/InventorySuppliers.cpp file | annotate | diff | comparison | revisions
src/MainWindow.cpp file | annotate | diff | comparison | revisions
ui/MainWindow.ui file | annotate | diff | comparison | revisions
--- 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<QPushButton *>(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);
 }
 
--- a/src/MainWindow.cpp	Sat Mar 19 22:59:11 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 10:29:57 2022 +0100
@@ -68,13 +68,11 @@
 void MainWindow::fromInventorySuppliers()
 {
     qDebug() << Q_FUNC_INFO;
-    qDebug() << "fromInventorySuppliers() start";
     ui->mainStack->setCurrentIndex(-1);
     ui->mainStack->removeWidget(InventorySuppliersWindow);
-    qDebug() << ui->mainStack->count();
     delete InventorySuppliersWindow;
     setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
-    qDebug() << "fromInventorySuppliers() done";
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -83,10 +81,11 @@
     qDebug() << Q_FUNC_INFO;
 
     InventorySuppliersWindow = new InventorySuppliers(this);
+    int index = ui->mainStack->count();
     ui->mainStack->addWidget(InventorySuppliersWindow);
-    qDebug() << ui->mainStack->count();
-    ui->mainStack->setCurrentIndex(2);
+    ui->mainStack->setCurrentIndex(index);
     setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 
--- a/ui/MainWindow.ui	Sat Mar 19 22:59:11 2022 +0100
+++ b/ui/MainWindow.ui	Sun Mar 20 10:29:57 2022 +0100
@@ -25,8 +25,6 @@
         <property name="focusPolicy">
          <enum>Qt::NoFocus</enum>
         </property>
-        <widget class="QWidget" name="page"/>
-        <widget class="QWidget" name="pageIS"/>
        </widget>
       </item>
      </layout>

mercurial