summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Schillinger2010-11-05 11:14:22 +0100
committerFabian Schillinger2010-11-05 11:14:22 +0100
commitded15ea687403e165914b746e948bce2cc78bc57 (patch)
tree351c2d2afddcfc47ae442b14e75ae98fc523db61
parentMerge branch 'master' of openslx.org:pvs (diff)
downloadpvs-ded15ea687403e165914b746e948bce2cc78bc57.tar.gz
pvs-ded15ea687403e165914b746e948bce2cc78bc57.tar.xz
pvs-ded15ea687403e165914b746e948bce2cc78bc57.zip
Process start/stop/view functionality
Cleanup
-rw-r--r--misc/pvs.conf2
-rw-r--r--src/gui/processWidget.cpp16
-rw-r--r--src/gui/processWidget.h2
-rw-r--r--src/gui/processesDialog.cpp13
-rw-r--r--src/gui/processesDialog.h2
-rw-r--r--src/gui/ui/mainwindow.ui5
-rw-r--r--src/gui/ui/mainwindowtouch.ui9
-rw-r--r--src/gui/ui/processWidget.ui10
-rwxr-xr-xsrc/pvs.cpp8
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
{