diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 91a835a11f7809f69e0060c7ee27d696b02cd3e5..1cda3342a391e43a79cd44bb1a982f9149671bcd 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 86da2d44ffa48b4e8b6061081ff97ace78a89657..7ca85f4d1cc96d6d40e831fc087b128e3b88eaac 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 5fd407a57c6db4c65db1e0a2e1e1be9729583991..a42a885a7f2218aca591857be6d99ca9262170df 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">