diff --git a/app/elementstablemodel.cpp b/app/elementstablemodel.cpp index 438c2e877ef171c78804a95d6940541bc216b25e..c116ca7943e1a7fa328de27323b4937e5ecadf09 100644 --- a/app/elementstablemodel.cpp +++ b/app/elementstablemodel.cpp @@ -235,8 +235,9 @@ void ElementsTableModel::writeCSV(QFile * file) { QTextStream stream( file ); stream << "PID , name , status , PPID , user , CPU , memory , uptime" << endl; - foreach (Task* t, taskVector) { - stream << t->print(" , ") << endl; + for (int i = 0 ; i < taskVector.size() ; ++i) + { + stream << taskVector.value(i)->print(" , ") << endl; } //for (QMap<int, Task>::const_iterator it = taskMap.cbegin() ; taskMap.cend() ; ++it) diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index e26ec77ec508d691905a658eae8ce80491894cf1..4addf8af3695996aa96068ffc52aa93aa724e99a 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -51,6 +51,7 @@ void MainWindow::update_status(GeneralStatus &genStatus) void MainWindow::set_task(ElementsTableModel * eltCollection) { ui->tableView->setModel(eltCollection); + model = eltCollection; } void MainWindow::update_tasks() diff --git a/app/mainwindow.ui b/app/mainwindow.ui index d1e0cde62e39b2d87a96af9692876b5e345b1f3f..fb3b52854517e7f4a361d804c7bc90128978050a 100644 --- a/app/mainwindow.ui +++ b/app/mainwindow.ui @@ -345,6 +345,7 @@ <string>File</string> </property> <addaction name="actionAbout"/> + <addaction name="actionExport_actual_state"/> <addaction name="actionQuit"/> </widget> <widget class="QMenu" name="menuLanguage"> @@ -405,6 +406,11 @@ <string>Create task</string> </property> </action> + <action name="actionExport_actual_state"> + <property name="text"> + <string>Export actual state</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <resources/>