summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qt-recordmydesktop/src/rmdMonitor.py35
-rw-r--r--qt-recordmydesktop/src/rmdTrayIcon.py3
2 files changed, 22 insertions, 16 deletions
diff --git a/qt-recordmydesktop/src/rmdMonitor.py b/qt-recordmydesktop/src/rmdMonitor.py
index b35f5a0..08450c8 100644
--- a/qt-recordmydesktop/src/rmdMonitor.py
+++ b/qt-recordmydesktop/src/rmdMonitor.py
@@ -37,16 +37,17 @@ import popen2
import os,fcntl,signal
from rmdStrings import *
-class rmdMonitor(object):
+class rmdMonitor(QtGui.QDialog):
labeString=monStrings['PleaseWait']
counter_fraction=0.0
- def destroy_and_kill(self,Event=None):
+ def closeEvent(self,Event=None):
self.timed_id.stop()
self.stop_encoding()
def destroy(self,Event=None):
- self.window.close()
+ self.close()
+ exit_ret=os.waitpid(self.rmdPid,0)
self.parent.show()
def update_counter(self):
strstdout=""
@@ -77,14 +78,15 @@ class rmdMonitor(object):
flags = fcntl.fcntl(out_stream, fcntl.F_GETFL)
fcntl.fcntl(out_stream, fcntl.F_SETFL, flags | os.O_NONBLOCK)
self.rmdPid=childPid
+ self.stdout=out_stream
+ #self.window = QtGui.QDialog()
+ QtGui.QDialog.__init__(self)
+ #self.closeEvent=self.destroy_and_kill
- self.window = QtGui.QMainWindow()
- self.window.closeEvent=self.destroy_and_kill
-
- self.window.setWindowTitle("recordMyDesktop-encoder")
+ self.setWindowTitle("recordMyDesktop-encoder")
- self.frame=QtGui.QFrame()
+ #self.frame=QtGui.QFrame()
self.label=QtGui.QLabel(self.labeString)
self.label.setAlignment(QtCore.Qt.AlignHCenter)
@@ -92,7 +94,7 @@ class rmdMonitor(object):
self.progressbar=QtGui.QProgressBar()
self.counter_fraction=0
self.progressbar.setValue(self.counter_fraction)
- self.stopbutton=QtGui.QPushButton(monStrings['Cancel'],self.window)
+ self.stopbutton=QtGui.QPushButton(monStrings['Cancel'],self)
self.stopbutton.connect(self.stopbutton,QtCore.SIGNAL("clicked()"),
self.stop_encoding)
self.box=QtGui.QVBoxLayout()
@@ -101,13 +103,13 @@ class rmdMonitor(object):
self.box.addWidget(self.stopbutton,0)
- self.stopbutton.show()
- self.frame.setLayout(self.box)
- self.window.setCentralWidget(self.frame)
- self.label.show()
- self.progressbar.show()
- self.window.show()
- self.stdout=out_stream
+ #self.stopbutton.show()
+ self.setLayout(self.box)
+ #self.window.setCentralWidget(self.frame)
+ #self.label.show()
+ #self.progressbar.show()
+ #self.window.show()
+
self.timed_id=QtCore.QTimer(None)
self.timed_id.connect(self.timed_id,QtCore.SIGNAL("timeout()"),
self.update_counter)
@@ -117,3 +119,4 @@ class rmdMonitor(object):
+
diff --git a/qt-recordmydesktop/src/rmdTrayIcon.py b/qt-recordmydesktop/src/rmdTrayIcon.py
index 1d657b6..57a7ca7 100644
--- a/qt-recordmydesktop/src/rmdTrayIcon.py
+++ b/qt-recordmydesktop/src/rmdTrayIcon.py
@@ -72,6 +72,7 @@ class trayIcon(object):
def __buttonPress__(self,ActivationReason):
+
button=0
if ActivationReason==QtGui.QSystemTrayIcon.Trigger:
button=1
@@ -249,6 +250,8 @@ class trayIcon(object):
os.kill(self.rmdPid,signal.SIGTERM)
self.state=-1
monitor=imon.rmdMonitor(self.childP.fromchild,self.rmdPid,self.parent)
+ monitor.exec_()
+
self.state=0
else:
self.__exit_status_dialog(exit_ret[1])
© All Rights Reserved