From a9197b19f52cfd104676c1546789be71b44b66c6 Mon Sep 17 00:00:00 2001 From: Jordan Aurey <aurejordan@gmail.com> Date: Fri, 29 Mar 2019 11:53:28 +0100 Subject: [PATCH] Ajout signaux + statusBar en cours --- app/mainwindow.cpp | 35 ++++++++++++++++++++++++++++++----- app/mainwindow.h | 4 ++++ app/mainwindow.ui | 24 ++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 91a835a..1cda334 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -9,11 +9,7 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); - // on affiche d'abord la TreeView - //ui->treeWidget->show(); - //ui->listWidget->hide(); - - + ui->comboBox->hide(); //Task t(1); //ElementsTableModel * model = new ElementsTableModel(); @@ -92,6 +88,35 @@ 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(); + ui->statusBar->showMessage("PID currently selected : " + PIDselected); } + +void MainWindow::on_commandLinkButton_6_clicked() +{ + ui->comboBox->show(); +} + +void MainWindow::on_comboBox_currentTextChanged(const QString &arg1) +{ + + if (arg1 == "Interrupt"){ + kill(PIDselected, SIGINT); + } + + if (arg1 == "Continue"){ + kill(PIDselected, SIGCONT); + } + + if (arg1 == "Quit"){ + kill(PIDselected, SIGQUIT); + } + + if (arg1 == "Kill"){ + kill(PIDselected, SIGKILL); + } + + ui->comboBox->hide(); + +} diff --git a/app/mainwindow.h b/app/mainwindow.h index 86da2d4..7ca85f4 100644 --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -34,6 +34,10 @@ private slots: void on_tableView_clicked(const QModelIndex &index); + void on_commandLinkButton_6_clicked(); + + void on_comboBox_currentTextChanged(const QString &arg1); + private: Ui::MainWindow *ui; int PIDselected; diff --git a/app/mainwindow.ui b/app/mainwindow.ui index 5fd407a..a42a885 100644 --- a/app/mainwindow.ui +++ b/app/mainwindow.ui @@ -224,6 +224,30 @@ </property> </widget> </item> + <item> + <widget class="QComboBox" name="comboBox"> + <item> + <property name="text"> + <string>Interrupt</string> + </property> + </item> + <item> + <property name="text"> + <string>Continue</string> + </property> + </item> + <item> + <property name="text"> + <string>Quit</string> + </property> + </item> + <item> + <property name="text"> + <string>Kill</string> + </property> + </item> + </widget> + </item> <item> <spacer name="horizontalSpacer_2"> <property name="orientation"> -- GitLab