diff options
author | Fabian Schillinger | 2010-11-05 11:14:22 +0100 |
---|---|---|
committer | Fabian Schillinger | 2010-11-05 11:14:22 +0100 |
commit | ded15ea687403e165914b746e948bce2cc78bc57 (patch) | |
tree | 351c2d2afddcfc47ae442b14e75ae98fc523db61 | |
parent | Merge branch 'master' of openslx.org:pvs (diff) | |
download | pvs-ded15ea687403e165914b746e948bce2cc78bc57.tar.gz pvs-ded15ea687403e165914b746e948bce2cc78bc57.tar.xz pvs-ded15ea687403e165914b746e948bce2cc78bc57.zip |
Process start/stop/view functionality
Cleanup
-rw-r--r-- | misc/pvs.conf | 2 | ||||
-rw-r--r-- | src/gui/processWidget.cpp | 16 | ||||
-rw-r--r-- | src/gui/processWidget.h | 2 | ||||
-rw-r--r-- | src/gui/processesDialog.cpp | 13 | ||||
-rw-r--r-- | src/gui/processesDialog.h | 2 | ||||
-rw-r--r-- | src/gui/ui/mainwindow.ui | 5 | ||||
-rw-r--r-- | src/gui/ui/mainwindowtouch.ui | 9 | ||||
-rw-r--r-- | src/gui/ui/processWidget.ui | 10 | ||||
-rwxr-xr-x | src/pvs.cpp | 8 |
9 files changed, 51 insertions, 16 deletions
diff --git a/misc/pvs.conf b/misc/pvs.conf index 93c4ac5..8e1f67c 100644 --- a/misc/pvs.conf +++ b/misc/pvs.conf @@ -7,3 +7,5 @@ vnc_other=no allow_chat=T allow_filetransfer=T +[RemoteProcess] +filter=pvs pvsgui pvsmgr x11vnc dbus diff --git a/src/gui/processWidget.cpp b/src/gui/processWidget.cpp index d61b42c..ac0b419 100644 --- a/src/gui/processWidget.cpp +++ b/src/gui/processWidget.cpp @@ -56,9 +56,19 @@ void ProcessWidget::resendProcessList() sendCommand("SHOWPROCESSES", ""); } - -void ProcessWidget::refrProcessList() +void ProcessWidget::refrProcessList(bool timerEvent) { + if (timerEvent) + { + if (prowui->processTable->selectedItems().length() > 0) + return; + else + { + resendProcessList(); + return; + } + } + //remove every item of our list for(int i=prowui->processTable->rowCount(); i == 0; i--) { @@ -77,8 +87,6 @@ void ProcessWidget::refrProcessList() prowui->processTable->setItem(i,j,new QTableWidgetItem(processesList.at(j),0)); } } - //select row 0 - prowui->processTable->selectRow(0); } void ProcessWidget::stopProcess() diff --git a/src/gui/processWidget.h b/src/gui/processWidget.h index 788c9e6..4d696eb 100644 --- a/src/gui/processWidget.h +++ b/src/gui/processWidget.h @@ -19,7 +19,7 @@ public: ~ ProcessWidget(); public slots: - void refrProcessList(); + void refrProcessList(bool timerEvent = false); private: Ui::ProcessWidget *prowui; diff --git a/src/gui/processesDialog.cpp b/src/gui/processesDialog.cpp index 49535d5..7c0405c 100644 --- a/src/gui/processesDialog.cpp +++ b/src/gui/processesDialog.cpp @@ -49,13 +49,24 @@ ProcessDialog::ProcessDialog(QDialog *parent, int displayedClientNameEnum) : break; } } + + QTimer *refreshTimer = new QTimer(this); + connect(refreshTimer, SIGNAL(timeout()), this, SLOT(currRefr())); + refreshTimer->start(5000); + } // if other Tab is activated we say our tab to refresh the processList void ProcessDialog::currChanged() { ProcessWidget *temp = static_cast<ProcessWidget*>(tWidget->currentWidget()); - temp->refrProcessList(); + temp->refrProcessList(false); +} + +void ProcessDialog::currRefr() +{ + ProcessWidget *temp = static_cast<ProcessWidget*>(tWidget->currentWidget()); + temp->refrProcessList(true); } ProcessDialog::~ProcessDialog() diff --git a/src/gui/processesDialog.h b/src/gui/processesDialog.h index d2bcae1..2c821fb 100644 --- a/src/gui/processesDialog.h +++ b/src/gui/processesDialog.h @@ -6,6 +6,7 @@ #include <src/gui/processWidget.h> #include <src/gui/mainWindow.h> #include <list> +#include <QTimer> namespace Ui { @@ -32,6 +33,7 @@ private: private slots: void currChanged(); + void currRefr(); }; #endif // PROCESSESDIALOG_H diff --git a/src/gui/ui/mainwindow.ui b/src/gui/ui/mainwindow.ui index d444092..a9d5cad 100644 --- a/src/gui/ui/mainwindow.ui +++ b/src/gui/ui/mainwindow.ui @@ -557,7 +557,7 @@ <string>showProcesses</string> </property> <property name="toolTip"> - <string>Show Processes of the selected Client</string> + <string>Show processes of all clients</string> </property> </action> <action name="actionStartProcess"> @@ -568,6 +568,9 @@ <property name="text"> <string>Start Process</string> </property> + <property name="toolTip"> + <string>Start process on the selected client(s)</string> + </property> </action> </widget> <layoutdefault spacing="6" margin="11"/> diff --git a/src/gui/ui/mainwindowtouch.ui b/src/gui/ui/mainwindowtouch.ui index 3480f09..12a2f2b 100644 --- a/src/gui/ui/mainwindowtouch.ui +++ b/src/gui/ui/mainwindowtouch.ui @@ -28,8 +28,8 @@ <rect> <x>0</x> <y>0</y> - <width>1335</width> - <height>673</height> + <width>1329</width> + <height>660</height> </rect> </property> <layout class="QGridLayout" name="gridLayout_3"> @@ -648,7 +648,7 @@ <string>showProcesses</string> </property> <property name="toolTip"> - <string>Show Processes of the selected Client</string> + <string>Show processes of all clients</string> </property> </action> <action name="actionStartProcess"> @@ -659,6 +659,9 @@ <property name="text"> <string>Start Process</string> </property> + <property name="toolTip"> + <string>Start process on the selected client(s)</string> + </property> </action> </widget> <layoutdefault spacing="6" margin="11"/> diff --git a/src/gui/ui/processWidget.ui b/src/gui/ui/processWidget.ui index 5ada967..a759dc1 100644 --- a/src/gui/ui/processWidget.ui +++ b/src/gui/ui/processWidget.ui @@ -26,7 +26,7 @@ <item> <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>Prozessliste</string> + <string>List of processes</string> </property> <widget class="QWidget" name="verticalLayoutWidget"> <property name="geometry"> @@ -147,14 +147,14 @@ <item> <widget class="QPushButton" name="refreshButton"> <property name="text"> - <string>Aktualisieren</string> + <string>Refresh</string> </property> </widget> </item> <item> <widget class="QPushButton" name="stopButton"> <property name="text"> - <string>Prozess beenden</string> + <string>Stop process</string> </property> </widget> </item> @@ -180,7 +180,7 @@ </size> </property> <property name="title"> - <string>Prozess starten</string> + <string>Start Process</string> </property> <widget class="QWidget" name="horizontalLayoutWidget"> <property name="geometry"> @@ -198,7 +198,7 @@ <item> <widget class="QPushButton" name="startButton"> <property name="text"> - <string>Prozess starten</string> + <string>Start Process</string> </property> </widget> </item> diff --git a/src/pvs.cpp b/src/pvs.cpp index 18b3570..8017d8b 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -940,6 +940,9 @@ QString PVS::getConfigValue(QString key) void PVS::showProc() { + QString settings = getConfigValue("RemoteProcess/filter"); + QStringList filter = settings.split(" "); + //look at procfs QDir procfs("/proc"); QStringList procList = procfs.entryList(); @@ -985,8 +988,11 @@ void PVS::showProc() } if (write) { - if ((name.startsWith("pvs")) || (name.startsWith("dbus"))) + for (int i=0;i<filter.size();i++) + { + if (name == (filter.at(i))) write = false; + } } if (write) //if process belongs to user (and not to PVS) we go on { |