diff --git a/app/controller.cpp b/app/controller.cpp index 261624894564e0d521db3fb49c2e43c2b8dbd57a..3234ce4dfd50ef443c09f4f3d3dd72247edd187a 100644 --- a/app/controller.cpp +++ b/app/controller.cpp @@ -9,7 +9,7 @@ Controller::Controller(MainWindow *window) : eltCollection(), genStatus(), main( //thread->start(); main->set_task(&eltCollection); - + update(); QTimer *timer = new QTimer(); timer->connect(timer, SIGNAL(timeout()), this , SLOT(update())); timer->start(1000); @@ -42,3 +42,4 @@ void Controller::quit() eltCollection.clear(); system("rm .listT .nbT .userT"); } + diff --git a/app/elementstablemodel.cpp b/app/elementstablemodel.cpp index 8f81ddf8cb341c2feb53bf6d388a2b71014cb4aa..244a7317872283d8846d4ef9b3cec20dfbf975a1 100644 --- a/app/elementstablemodel.cpp +++ b/app/elementstablemodel.cpp @@ -114,7 +114,6 @@ void ElementsTableModel::removeTask(Task* task){ beginRemoveRows(QModelIndex(), rowCount(), rowCount()); taskVector.removeOne(task); free(task); - qDebug() << "free"; //pidVector.remove(row); //qDebug() << "remove " << task->print(); endRemoveRows(); @@ -125,7 +124,6 @@ void ElementsTableModel::clear() beginRemoveRows(QModelIndex(), 0, rowCount()); for (int i = 0; i < taskVector.size(); ++i) { free(taskVector.value(i)); - qDebug() << "free"; } taskVector.clear(); endRemoveRows(); diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index e0a6e93443f980167446f0c175344c400ff0fcb5..55f4ea30ba4494ba69bf382074dfdbfe914096d9 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -54,9 +54,9 @@ void MainWindow::set_task(ElementsTableModel * eltCollection) model = eltCollection; } -void MainWindow::update_tasks() +void MainWindow::update_selection() { - ui->tableView->update(); + ui->tableView->selectRow(rowSelectedIndex); } @@ -91,9 +91,9 @@ void MainWindow::on_tableView_clicked(const QModelIndex &index) ui->tableView->selectRow(index.row()); rowSelectedIndex = index.row(); PIDselected = ui->tableView->model()->index(index.row(), 0).data().toInt(); + QVariant name = ui->tableView->model()->index(index.row(), 1).data(); ui->statusBar->clearMessage(); - ui->statusBar->showMessage("PID currently selected : " + QString::number(PIDselected)); - + ui->statusBar->showMessage("Task currently selected: " + QString::number(PIDselected) + " | " + name.toString()); } @@ -130,3 +130,11 @@ void MainWindow::on_actionQuit_triggered() { QApplication::quit(); } + +void MainWindow::on_actionAbout_triggered() +{ + QMessageBox msgBox; + msgBox.setTextFormat(Qt::RichText); + msgBox.setText("<h2>Task Manager 1.0</h2><br>Built on Mar 29 2017<br><br>Copyright 2019 Jordan Aurey & Romain Derré All right reserved.<br><br><i>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</i>"); + msgBox.exec(); +} diff --git a/app/mainwindow.h b/app/mainwindow.h index cf788c445724ebf767cbb78858294c74b1d0cee3..c13bff338d35208d762db9bfbfcfdfc99ef3d969 100644 --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -23,7 +23,7 @@ public: ~MainWindow(); void update_status(GeneralStatus &genStatus); void set_task(ElementsTableModel * eltCollection); - void update_tasks(); + void update_selection(); ElementsTableModel * model; @@ -40,6 +40,8 @@ private slots: void on_actionQuit_triggered(); + void on_actionAbout_triggered(); + private: Ui::MainWindow *ui; int PIDselected; diff --git a/app/mainwindow.ui b/app/mainwindow.ui index 45fa5777cdcf2a39120c0664f7b96da7052e9b8e..18e2448f1fb3aacf042b4c53fa8a53e3a2b07943 100644 --- a/app/mainwindow.ui +++ b/app/mainwindow.ui @@ -174,13 +174,13 @@ <widget class="QCommandLinkButton" name="commandLinkButton_7"> <property name="minimumSize"> <size> - <width>150</width> + <width>125</width> <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>150</width> + <width>125</width> <height>30</height> </size> </property> @@ -199,7 +199,7 @@ </property> <property name="sizeHint" stdset="0"> <size> - <width>10</width> + <width>20</width> <height>10</height> </size> </property> @@ -209,13 +209,13 @@ <widget class="QCommandLinkButton" name="commandLinkButton_6"> <property name="minimumSize"> <size> - <width>150</width> + <width>125</width> <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>150</width> + <width>125</width> <height>30</height> </size> </property> @@ -344,27 +344,17 @@ <property name="title"> <string>File</string> </property> - <addaction name="actionAbout"/> <addaction name="actionExport_actual_state"/> <addaction name="actionQuit"/> </widget> - <widget class="QMenu" name="menuLanguage"> - <property name="title"> - <string>Language</string> - </property> - <addaction name="actionFR"/> - <addaction name="actionEn"/> - </widget> - <widget class="QMenu" name="menuDisplay_2"> + <widget class="QMenu" name="menuHelp"> <property name="title"> - <string>Display</string> + <string>Help</string> </property> - <addaction name="actionIcons"/> - <addaction name="actionMode_Night"/> + <addaction name="actionAbout"/> </widget> <addaction name="menuDisplay"/> - <addaction name="menuLanguage"/> - <addaction name="menuDisplay_2"/> + <addaction name="menuHelp"/> </widget> <action name="actionFR"> <property name="text">