diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-08-09 23:11:43 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-08-09 23:11:43 +0000 |
commit | c364387c6657769e29ade8fe16038a1c9b6fa1e0 (patch) | |
tree | 57e4a0e606ec4c32c70d41b185fe5e399801063d | |
parent | b5244639d1b3e38b1c56e03e7f65b8da44970233 (diff) |
rmdConfig.py.in, rmdFrame.py, rmdPrefsWidget.py,
rmdSelectThumb.py, rmdSimple.py, rmdStrings.py,
rmdTrayIcon.py : Added follow mouse option in the
Preferences Widget and all relevant functionality
( save/load , defaults, string/tooltip). Also added
moveFrame method so that the frame can follow
the mouse.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@406 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r-- | gtk-recordmydesktop/src/rmdConfig.py.in | 2 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdFrame.py | 26 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdPrefsWidget.py | 26 | ||||
-rwxr-xr-x | gtk-recordmydesktop/src/rmdSelectThumb.py | 16 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdSimple.py | 11 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdStrings.py | 5 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdTrayIcon.py | 15 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdConfig.py.in | 2 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdFrame.py | 30 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdPrefsWidget.py | 24 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdSelectThumb.py | 34 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdSimple.py | 11 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdStrings.py | 5 | ||||
-rw-r--r-- | qt-recordmydesktop/src/rmdTrayIcon.py | 16 |
14 files changed, 158 insertions, 65 deletions
diff --git a/gtk-recordmydesktop/src/rmdConfig.py.in b/gtk-recordmydesktop/src/rmdConfig.py.in index ff17ebc..60bdf42 100644 --- a/gtk-recordmydesktop/src/rmdConfig.py.in +++ b/gtk-recordmydesktop/src/rmdConfig.py.in @@ -22,7 +22,7 @@ default_values=[15, #framerate #but when the value is set to this the argument is omitted 0, #shared memory,0 on 1 off 0, #reset recording area ,0 on 1 off - 75, #shared threshold.Removed at 0.3.4, preserved for compatibility of prefs file. + 1, #follow mouse,0 on 1 off 1, #quick subsampling,0 on 1 off "/tmp", #working directory 1, #on the fly encoding,0 on 1 off diff --git a/gtk-recordmydesktop/src/rmdFrame.py b/gtk-recordmydesktop/src/rmdFrame.py index f5187e4..2dc556f 100644 --- a/gtk-recordmydesktop/src/rmdFrame.py +++ b/gtk-recordmydesktop/src/rmdFrame.py @@ -26,19 +26,20 @@ import pygtk pygtk.require('2.0') import gtk +import gobject class rmdFrame: borderwidth=6 outlinewidth=1 - def __init__(self,x,y,w,h): + def __init__(self,x,y,w,h,parent): self.window=gtk.Window(gtk.WINDOW_TOPLEVEL) self.area=gtk.DrawingArea() self.x=x self.y=y self.w=w self.h=h - + self.parent=parent mask = gtk.gdk.Pixmap(None, self.w+self.borderwidth*2, self.h+self.borderwidth*2, @@ -71,6 +72,27 @@ class rmdFrame: self.window.move(self.x-self.borderwidth, self.y-self.borderwidth) self.window.set_resizable(False) + self.disp=gtk.gdk.display_get_default() + self.wroot = gtk.gdk.get_default_root_window() + (self.wwidth, self.wheight) = self.wroot.get_size() + self.timed_id=gobject.timeout_add(10,self.moveFrame) + + def moveFrame(self): + if self.parent.values[15]==0: + npos=gtk.gdk.Display.get_pointer(self.disp) + x=npos[1]-self.w/2 + y=npos[2]-self.h/2 + x=(x>>1)<<1 + y=(y>>1)<<1 + if x<0:x=0 + if y<0:y=0 + if x+self.w>self.wwidth:x=self.wwidth-self.w + if y+self.h>self.wheight:y=self.wheight-self.h + if(x!=self.x or y!= self.y): + self.x=x + self.y=y + self.window.move(self.x-(self.borderwidth),self.y-(self.borderwidth)) + return True def __expose_cb(self, widget, event): diff --git a/gtk-recordmydesktop/src/rmdPrefsWidget.py b/gtk-recordmydesktop/src/rmdPrefsWidget.py index 050be4f..480fc4d 100644 --- a/gtk-recordmydesktop/src/rmdPrefsWidget.py +++ b/gtk-recordmydesktop/src/rmdPrefsWidget.py @@ -42,7 +42,7 @@ from rmdStrings import * class prefsWidget(object): def __tooltips__(self): self.tooltips=gtk.Tooltips() - for i in range(18): + for i in range(19): self.tooltips.set_tip(self.eboxes[i],prefTooltipLabels[i]) self.tooltips.set_tip(self.jack_ebox,prefJacktip) @@ -56,7 +56,7 @@ class prefsWidget(object): self.values[12]=self.displayEntry.get_text().replace(' ','') self.values[13]=self.sharedComboBox.get_active() self.values[14]=self.areaResetComboBox.get_active() -# self.values[15]=self.thresSpinButton.get_value_as_int() + self.values[15]=self.followMouseComboBox.get_active() self.values[16]=self.quickComboBox.get_active() self.values[17]=self.workdirEntry.get_text() self.values[18]=self.onTheFlyComboBox.get_active() @@ -236,7 +236,7 @@ class prefsWidget(object): self.boxes[9].pack_end(self.deviceEntry,expand=False,fill=False) #misc page - for i in xrange(10,18): + for i in xrange(10,19): self.labels[i]=gtk.Label(prefLabelStrings[i]) self.labels[i].set_justify(gtk.JUSTIFY_LEFT) self.boxes[i]=gtk.HBox(homogeneous=False, spacing=0) @@ -259,27 +259,33 @@ class prefsWidget(object): self.mouseComboBox.show() self.boxes[11].pack_end(self.mouseComboBox,expand=False,fill=False) + self.followMouseComboBox = gtk.combo_box_new_text() + for i in range(2): + self.followMouseComboBox.append_text(prefStateStrings[i]) + self.followMouseComboBox.set_active(self.values[15]) + self.followMouseComboBox.show() + self.boxes[12].pack_end(self.followMouseComboBox,expand=False,fill=False) self.sharedComboBox = gtk.combo_box_new_text() for i in range(2): self.sharedComboBox.append_text(prefStateStrings[i]) self.sharedComboBox.set_active(self.values[13]) self.sharedComboBox.show() - self.boxes[12].pack_end(self.sharedComboBox,expand=False,fill=False) + self.boxes[13].pack_end(self.sharedComboBox,expand=False,fill=False) self.winDecoComboBox = gtk.combo_box_new_text() for i in range(2): self.winDecoComboBox.append_text(prefStateStrings[i]) self.winDecoComboBox.set_active(self.values[21]) self.winDecoComboBox.show() - self.boxes[13].pack_end(self.winDecoComboBox,expand=False,fill=False) + self.boxes[14].pack_end(self.winDecoComboBox,expand=False,fill=False) self.tooltipsComboBox = gtk.combo_box_new_text() for i in range(2): self.tooltipsComboBox.append_text(prefStateStrings[i]) self.tooltipsComboBox.set_active(self.values[24]) self.tooltipsComboBox.show() - self.boxes[14].pack_end(self.tooltipsComboBox,expand=False,fill=False) + self.boxes[15].pack_end(self.tooltipsComboBox,expand=False,fill=False) self.rFrameComboBox = gtk.combo_box_new_text() @@ -287,21 +293,21 @@ class prefsWidget(object): self.rFrameComboBox.append_text(prefStateStrings[i]) self.rFrameComboBox.set_active(self.values[25]) self.rFrameComboBox.show() - self.boxes[15].pack_end(self.rFrameComboBox,expand=False,fill=False) + self.boxes[16].pack_end(self.rFrameComboBox,expand=False,fill=False) self.areaResetComboBox = gtk.combo_box_new_text() for i in range(2): self.areaResetComboBox.append_text(prefStateStrings[i]) self.areaResetComboBox.set_active(self.values[14]) self.areaResetComboBox.show() - self.boxes[16].pack_end(self.areaResetComboBox,expand=False,fill=False) + self.boxes[17].pack_end(self.areaResetComboBox,expand=False,fill=False) self.extraOptsEntry= gtk.Entry(max=0) self.extraOptsEntry.set_text(self.values[26]) self.extraOptsEntry.show() - self.boxes[17].pack_end(self.extraOptsEntry,expand=False,fill=False) + self.boxes[18].pack_end(self.extraOptsEntry,expand=False,fill=False) - for i in range(18): + for i in range(19): self.boxes[i].show() self.eboxes[i].show() diff --git a/gtk-recordmydesktop/src/rmdSelectThumb.py b/gtk-recordmydesktop/src/rmdSelectThumb.py index 5e305a5..b9533aa 100755 --- a/gtk-recordmydesktop/src/rmdSelectThumb.py +++ b/gtk-recordmydesktop/src/rmdSelectThumb.py @@ -192,8 +192,11 @@ class GtkThumbSelector(gtk.DrawingArea): if self.area_return[3]>=0: vals[3]=self.area_return[3]-self.area_return[1] if vals[0] >0 or vals[1] >0 or vals[2] <self.wwidth or vals[3] <self.wheight: - if self.selecting==0: + if self.selecting==0 and self.caller.values[15]==1: self.__draw_lines__(self.root,vals,self.factor) + elif self.selecting==0 and self.caller.values[15]==0: + self.__check_frame__() + elif self.realFrame!=None: self.realFrame.destroy() self.realFrame=None @@ -210,9 +213,13 @@ class GtkThumbSelector(gtk.DrawingArea): img.put_pixel(vals[0]/factor+k,i,0xff0000) img.put_pixel((vals[0]+vals[2]/2-k)/factor,i,0xff0000) img.put_pixel((vals[0]+vals[2]-1-k)/factor,i,0xff0000) + self.__check_frame__() + + def __check_frame__(self): if self.realFrame!=None: - if (self.area_return[0]!=self.realFrame.x or - self.area_return[1]!=self.realFrame.y or + if (((self.area_return[0]!=self.realFrame.x or + self.area_return[1]!=self.realFrame.y) and + self.caller.values[15]==1) or self.area_return[2]-self.area_return[0]!=self.realFrame.w or self.area_return[3]-self.area_return[1]!=self.realFrame.h or self.caller.values[25]): @@ -228,7 +235,8 @@ class GtkThumbSelector(gtk.DrawingArea): self.realFrame=rmdFrame(self.area_return[0], self.area_return[1], self.area_return[2]-self.area_return[0], - self.area_return[3]-self.area_return[1]) + self.area_return[3]-self.area_return[1], + self.caller) #area_return=[-1,-1,-1,-1] diff --git a/gtk-recordmydesktop/src/rmdSimple.py b/gtk-recordmydesktop/src/rmdSimple.py index 671d619..1bf2c2a 100644 --- a/gtk-recordmydesktop/src/rmdSimple.py +++ b/gtk-recordmydesktop/src/rmdSimple.py @@ -303,7 +303,7 @@ class simpleWidget(object): self.values[5]=[] for i in rmdConfig.default_values[5]: self.values[5].append(i) - #open for some future option + #loaded further bellow self.values.append(0) savefile.readline() self.values.append(int(savefile.readline())) @@ -349,6 +349,13 @@ class simpleWidget(object): self.values.append(rmdConfig.default_values[26]) else: self.values.append(savefile.readline().replace("\n","")) + p=savefile.readline() + if p=='': + self.values[15]=rmdConfig.default_values[15] + else: + t_followmouse=int(savefile.readline()) + if t_followmouse>1: t_followmouse=1 + self.values[15]=t_followmouse return True except: return False @@ -415,6 +422,8 @@ class simpleWidget(object): savefile.write("%d\n"%self.values[25]) savefile.write("#Extra options\n") savefile.write("%s\n"%self.values[26]) + savefile.write("#Follow mouse,1 disabled 0 enabled\n") + savefile.write("%d\n"%self.values[15]) savefile.flush() savefile.close() return True diff --git a/gtk-recordmydesktop/src/rmdStrings.py b/gtk-recordmydesktop/src/rmdStrings.py index b0d82d0..108d4f6 100644 --- a/gtk-recordmydesktop/src/rmdStrings.py +++ b/gtk-recordmydesktop/src/rmdStrings.py @@ -69,8 +69,8 @@ prefLabelStrings=[_('Overwite Existing Files'),_('Working Directory'), _('Frames Per Second'),_('Encode On the Fly'),_('Zero Compression'), _('Quick Subsampling'),_('Full shots at every frame'), _('Channels'),_('Frequency'),_('Device'),_('Display'),_('Mouse Cursor'), - _('MIT-Shm extension'),_('Include Window Decorations'),_('Tooltips'), - _('Outline Capture Area On Screen'), + _('Follow Mouse'),_('MIT-Shm extension'),_('Include Window Decorations'), + _('Tooltips'),_('Outline Capture Area On Screen'), _('Reset Capture Area'), _('Extra Options'), _('Video Quality'),_('Sound Quality'), @@ -90,6 +90,7 @@ prefTooltipLabels=[_('By default, if you try to save under a filename that alrea _('ALSA sound device, that is used for sound recording.'), _('Connection to the Xserver.'), _('The mouse cursor that will be drawn.\nNormal is for the real cursor that you see while recording,\nwhile black and white are fake cursors, drawn by the program.\nYou can also disable cursor drawing.'), + _('When This option is enabled, the capture\narea will follow your mouse cursor.\nEnabling this option will also enable full shots at\nevery frame, so it\'s not recommended\nfor large capture areas.'), _('Use the MIT-Shared memory extension, whenever appropriate,\n depending on the rest of the program settings.\nDisabling this option is not recommended,\nas it may severely slow down the program.'), _('When selecting a window via the "Select Window" button,\ninclude that window\'s decorations in the recording area.'), _('Enable or disable tooltips, like this one.\n(Requires restart)'), diff --git a/gtk-recordmydesktop/src/rmdTrayIcon.py b/gtk-recordmydesktop/src/rmdTrayIcon.py index 560d2bf..f6907f0 100644 --- a/gtk-recordmydesktop/src/rmdTrayIcon.py +++ b/gtk-recordmydesktop/src/rmdTrayIcon.py @@ -150,12 +150,13 @@ class trayIcon(object): self.execargs.append("--full-shots") if self.parent.values[13] == 1: self.execargs.append("--no-shared") - if self.parent.values[5][0]>0 : - self.execargs.append('-x') - self.execargs.append('%d'%self.parent.values[5][0]) - if self.parent.values[5][1]>0: - self.execargs.append('-y') - self.execargs.append('%d'%self.parent.values[5][1]) + if self.parent.values[15]==1: + if self.parent.values[5][0]>0 : + self.execargs.append('-x') + self.execargs.append('%d'%self.parent.values[5][0]) + if self.parent.values[5][1]>0: + self.execargs.append('-y') + self.execargs.append('%d'%self.parent.values[5][1]) if self.parent.values[5][2]>0 and self.parent.values[5][3]>0: self.execargs.append('-width') self.execargs.append('%d'%(self.parent.values[5][2]-self.parent.values[5][0])) @@ -191,6 +192,8 @@ class trayIcon(object): self.execargs.append('--compress-cache') if self.parent.values[20] == True: self.execargs.append('--overwrite') + if self.parent.values[15] == 0: + self.execargs.append('--follow-mouse') if self.parent.values[22] == True: self.execargs.append('-use-jack') for i in self.parent.values[23]: diff --git a/qt-recordmydesktop/src/rmdConfig.py.in b/qt-recordmydesktop/src/rmdConfig.py.in index 5d4184f..fa2fcd5 100644 --- a/qt-recordmydesktop/src/rmdConfig.py.in +++ b/qt-recordmydesktop/src/rmdConfig.py.in @@ -23,7 +23,7 @@ default_values=[15, #framerate #but when the value is set to this the argument is omitted 0, #shared memory,0 on 1 off 0, #reset recording area ,0 on 1 off - 75, #shared threshold.Removed at 0.3.4, preserved for compatibility of prefs file. + 1, #follow mouse,0 on 1 off 1, #quick subsampling,0 on 1 off "/tmp", #working directory 1, #on the fly encoding,0 on 1 off diff --git a/qt-recordmydesktop/src/rmdFrame.py b/qt-recordmydesktop/src/rmdFrame.py index ef05fc6..bb11778 100644 --- a/qt-recordmydesktop/src/rmdFrame.py +++ b/qt-recordmydesktop/src/rmdFrame.py @@ -29,13 +29,13 @@ class rmdFrame: borderwidth=6 outlinewidth=1 - def __init__(self,x,y,w,h): + def __init__(self,x,y,w,h,parent): self.window=QtGui.QWidget(None,QtCore.Qt.X11BypassWindowManagerHint|QtCore.Qt.WindowStaysOnTopHint) self.x=x self.y=y self.w=w self.h=h - + self.parent=parent self.mask = QtGui.QBitmap(self.w+self.borderwidth*2, self.h+self.borderwidth*2) self.mask.fill(QtCore.Qt.color1) @@ -49,9 +49,31 @@ class rmdFrame: self.window.move(self.x-self.borderwidth, self.y-self.borderwidth) self.window.show() + self.timer=QtCore.QTimer(None) + self.timer.connect(self.timer,QtCore.SIGNAL("timeout()"), + self.moveFrame) + self.timer.start(10) + self.screen_width=QtGui.qApp.desktop().width() + self.screen_height=QtGui.qApp.desktop().height() - def paintEvent(self,Event): + def moveFrame(self): + if self.parent.values[15]==0: + npos=QtGui.QCursor.pos() + x=npos.x()-self.w/2 + y=npos.y()-self.h/2 + x=(x>>1)<<1 + y=(y>>1)<<1 + if x<0:x=0 + if y<0:y=0 + if x+self.w>self.screen_width:x=self.screen_width-self.w + if y+self.h>self.screen_height:y=self.screen_height-self.h + if(x!=self.x or y!= self.y): + self.x=x + self.y=y + self.window.move(self.x-(self.borderwidth),self.y-(self.borderwidth)) + + def paintEvent(self,Event): painterw= QtGui.QPainter(self.window) painterw.fillRect(0,0,self.w+self.borderwidth*2, self.h+self.borderwidth*2, @@ -83,7 +105,7 @@ class rmdFrame: pass def destroy(self): - #self.area.destroy() + self.timer.stop() try: self.window.close() except: diff --git a/qt-recordmydesktop/src/rmdPrefsWidget.py b/qt-recordmydesktop/src/rmdPrefsWidget.py index 407a9f4..5aa8ede 100644 --- a/qt-recordmydesktop/src/rmdPrefsWidget.py +++ b/qt-recordmydesktop/src/rmdPrefsWidget.py @@ -42,7 +42,7 @@ from rmdStrings import * class prefsWidget(object): def __tooltips__(self): - for i in range(18): + for i in range(19): self.labels[i].setToolTip(htmlize(prefTooltipLabels[i])) self.jack_button.setToolTip(htmlize(prefJacktip)) self.jack_lsp_label.setToolTip(htmlize(prefJacktip)) @@ -60,6 +60,7 @@ class prefsWidget(object): self.values[12]=self.displayEntry.text().replace(' ','') self.values[13]=self.sharedComboBox.currentIndex() self.values[14]=self.areaResetComboBox.currentIndex() + self.values[15]=self.followMouseComboBox.currentIndex() self.values[16]=self.quickComboBox.currentIndex() self.values[17]=self.workdirEntry.text() self.values[18]=self.onTheFlyComboBox.currentIndex() @@ -211,7 +212,7 @@ class prefsWidget(object): self.boxes[9].insertWidget(-1,self.deviceEntry) #misc page - for i in xrange(10,18): + for i in xrange(10,19): self.labels[i]=QtGui.QLabel(prefLabelStrings[i],self.tabWidgets[3]) self.labels[i].setAlignment(QtCore.Qt.AlignLeft) self.boxes[i]=QtGui.QHBoxLayout() @@ -227,43 +228,48 @@ class prefsWidget(object): self.mouseComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(4): self.mouseComboBox.addItem(prefMouseStrings[i]) - self.mouseComboBox.setCurrentIndex(self.values[1]) + self.mouseComboBox.setCurrentIndex(self.values[15]) self.boxes[11].insertWidget(-1,self.mouseComboBox) + self.followMouseComboBox = QtGui.QComboBox(self.tabWidgets[3]) + for i in range(2): + self.followMouseComboBox.addItem(prefStateStrings[i]) + self.followMouseComboBox.setCurrentIndex(self.values[15]) + self.boxes[12].insertWidget(-1,self.followMouseComboBox) self.sharedComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(2): self.sharedComboBox.addItem(prefStateStrings[i]) self.sharedComboBox.setCurrentIndex(self.values[13]) - self.boxes[12].insertWidget(-1,self.sharedComboBox) + self.boxes[13].insertWidget(-1,self.sharedComboBox) self.winDecoComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(2): self.winDecoComboBox.addItem(prefStateStrings[i]) self.winDecoComboBox.setCurrentIndex(self.values[21]) - self.boxes[13].insertWidget(-1,self.winDecoComboBox) + self.boxes[14].insertWidget(-1,self.winDecoComboBox) self.tooltipsComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(2): self.tooltipsComboBox.addItem(prefStateStrings[i]) self.tooltipsComboBox.setCurrentIndex(self.values[24]) - self.boxes[14].insertWidget(-1,self.tooltipsComboBox) + self.boxes[15].insertWidget(-1,self.tooltipsComboBox) self.rFrameComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(2): self.rFrameComboBox.addItem(prefStateStrings[i]) self.rFrameComboBox.setCurrentIndex(self.values[25]) - self.boxes[15].insertWidget(-1,self.rFrameComboBox) + self.boxes[16].insertWidget(-1,self.rFrameComboBox) self.areaResetComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(2): self.areaResetComboBox.addItem(prefStateStrings[i]) self.areaResetComboBox.setCurrentIndex(self.values[14]) - self.boxes[16].insertWidget(-1,self.areaResetComboBox) + self.boxes[17].insertWidget(-1,self.areaResetComboBox) self.extraOptsEntry= QtGui.QLineEdit(self.values[26]) - self.boxes[17].insertWidget(-1,self.extraOptsEntry) + self.boxes[18].insertWidget(-1,self.extraOptsEntry) for i in range(4): self.tabWidgets[i].setLayout(self.labelbox[i]) diff --git a/qt-recordmydesktop/src/rmdSelectThumb.py b/qt-recordmydesktop/src/rmdSelectThumb.py index 3da48ec..045a1c8 100644 --- a/qt-recordmydesktop/src/rmdSelectThumb.py +++ b/qt-recordmydesktop/src/rmdSelectThumb.py @@ -68,8 +68,9 @@ class QtThumbSelector(QtGui.QLabel): def update(self): QtGui.QLabel.update(self) if self.realFrame!=None: - if (self.area_return[0]!=self.realFrame.x or - self.area_return[1]!=self.realFrame.y or + if (((self.area_return[0]!=self.realFrame.x or + self.area_return[1]!=self.realFrame.y) and + self.caller.values[15]==1) or self.area_return[2]-self.area_return[0]!=self.realFrame.w or self.area_return[3]-self.area_return[1]!=self.realFrame.h or self.caller.values[25]): @@ -93,19 +94,19 @@ class QtThumbSelector(QtGui.QLabel): painter = QtGui.QPainter(self) painter.drawPixmap(0,0,self.wwidth/self.factor,self.wheight/self.factor,self.pix) - - if self.x1 >= 0: - x = min(self.x1, self.x2) - y = min(self.y1, self.y2) - w = max(self.x1, self.x2) - x - h = max(self.y1, self.y2) - y - painter.fillRect(x,y,w,h,QtGui.QBrush(QtCore.Qt.red,QtCore.Qt.CrossPattern)) - elif self.area_return[0]>=0 or self.area_return[1]>=0 or self.area_return[2]>=0 or self.area_return[3]>=0: - x = max(0, self.area_return[0])/self.factor - y = max(0, self.area_return[1])/self.factor - w = min(self.wwidth, self.area_return[2])/self.factor - x - h = min(self.wheight, self.area_return[3])/self.factor - y - painter.fillRect(x,y,w,h,QtGui.QBrush(QtCore.Qt.red,QtCore.Qt.CrossPattern)) + if self.selecting==1 or self.caller.values[15]==1: + if self.x1 >= 0: + x = min(self.x1, self.x2) + y = min(self.y1, self.y2) + w = max(self.x1, self.x2) - x + h = max(self.y1, self.y2) - y + painter.fillRect(x,y,w,h,QtGui.QBrush(QtCore.Qt.red,QtCore.Qt.CrossPattern)) + elif self.area_return[0]>=0 or self.area_return[1]>=0 or self.area_return[2]>=0 or self.area_return[3]>=0: + x = max(0, self.area_return[0])/self.factor + y = max(0, self.area_return[1])/self.factor + w = min(self.wwidth, self.area_return[2])/self.factor - x + h = min(self.wheight, self.area_return[3])/self.factor - y + painter.fillRect(x,y,w,h,QtGui.QBrush(QtCore.Qt.red,QtCore.Qt.CrossPattern)) def mouseMoveEvent(self, event): if self.x1 >= 0: rect = QtCore.QRect() @@ -145,7 +146,8 @@ class QtThumbSelector(QtGui.QLabel): self.realFrame=rmdFrame(self.area_return[0], self.area_return[1], self.area_return[2]-self.area_return[0], - self.area_return[3]-self.area_return[1]) + self.area_return[3]-self.area_return[1], + self.caller) def closeEvent(self,event): self.realFrame.destroy() QtGui.QLabel.close(self) diff --git a/qt-recordmydesktop/src/rmdSimple.py b/qt-recordmydesktop/src/rmdSimple.py index 5c2be25..e4b3585 100644 --- a/qt-recordmydesktop/src/rmdSimple.py +++ b/qt-recordmydesktop/src/rmdSimple.py @@ -292,7 +292,7 @@ class simpleWidget(object): self.values[5]=[] for i in rmdConfig.default_values[5]: self.values[5].append(i) - #open for some future option + #loaded further bellow self.values.append(0) savefile.readline() self.values.append(int(savefile.readline())) @@ -338,6 +338,13 @@ class simpleWidget(object): self.values.append(rmdConfig.default_values[26]) else: self.values.append(savefile.readline().replace("\n","")) + p=savefile.readline() + if p=='': + self.values[15]=rmdConfig.default_values[15] + else: + t_followmouse=int(savefile.readline()) + if t_followmouse>1: t_followmouse=1 + self.values[15]=t_followmouse return True except: return False @@ -404,6 +411,8 @@ class simpleWidget(object): savefile.write("%d\n"%self.values[25]) savefile.write("#Extra options\n") savefile.write("%s\n"%self.values[26]) + savefile.write("#Follow mouse,1 disabled 0 enabled\n") + savefile.write("%d\n"%self.values[15]) savefile.flush() savefile.close() return True diff --git a/qt-recordmydesktop/src/rmdStrings.py b/qt-recordmydesktop/src/rmdStrings.py index b588d2c..4de1f4e 100644 --- a/qt-recordmydesktop/src/rmdStrings.py +++ b/qt-recordmydesktop/src/rmdStrings.py @@ -69,8 +69,8 @@ prefLabelStrings=[_('Overwite Existing Files'),_('Working Directory'), _('Frames Per Second'),_('Encode On the Fly'),_('Zero Compression'), _('Quick Subsampling'),_('Full shots at every frame'), _('Channels'),_('Frequency'),_('Device'),_('Display'),_('Mouse Cursor'), - _('MIT-Shm extension'),_('Include Window Decorations'),_('Tooltips'), - _('Outline Capture Area On Screen'), + _('Follow Mouse'),_('MIT-Shm extension'),_('Include Window Decorations'), + _('Tooltips'),_('Outline Capture Area On Screen'), _('Reset Capture Area'), _('Extra Options'), _('Video Quality'),_('Sound Quality'), @@ -90,6 +90,7 @@ prefTooltipLabels=[_('By default, if you try to save under a filename that alrea _('ALSA sound device, that is used for sound recording.'), _('Connection to the Xserver.'), _('The mouse cursor that will be drawn.\nNormal is for the real cursor that you see while recording,\nwhile black and white are fake cursors, drawn by the program.\nYou can also disable cursor drawing.'), + _('When This option is enabled, the capture\narea will follow your mouse cursor.\nEnabling this option will also enable full shots at\nevery frame, so it\'s not recommended\nfor large capture areas.'), _('Use the MIT-Shared memory extension, whenever appropriate,\n depending on the rest of the program settings.\nDisabling this option is not recommended,\nas it may severely slow down the program.'), _('When selecting a window via the "Select Window" button,\ninclude that window\'s decorations in the recording area.'), _('Enable or disable tooltips, like this one.\n(Requires restart)'), diff --git a/qt-recordmydesktop/src/rmdTrayIcon.py b/qt-recordmydesktop/src/rmdTrayIcon.py index bd70af4..ae9b3cf 100644 --- a/qt-recordmydesktop/src/rmdTrayIcon.py +++ b/qt-recordmydesktop/src/rmdTrayIcon.py @@ -140,12 +140,14 @@ class trayIcon(object): self.execargs.append("--full-shots") if self.parent.values[13] == 1: self.execargs.append("--no-shared") - if self.parent.values[5][0]>0 : - self.execargs.append('-x') - self.execargs.append('%d'%self.parent.values[5][0]) - if self.parent.values[5][1]>0: - self.execargs.append('-y') - self.execargs.append('%d'%self.parent.values[5][1]) + + if self.parent.values[15]==1: + if self.parent.values[5][0]>0 : + self.execargs.append('-x') + self.execargs.append('%d'%self.parent.values[5][0]) + if self.parent.values[5][1]>0: + self.execargs.append('-y') + self.execargs.append('%d'%self.parent.values[5][1]) if self.parent.values[5][2]>0 and self.parent.values[5][3]>0: self.execargs.append('-width') self.execargs.append('%d'%(self.parent.values[5][2]-self.parent.values[5][0])) @@ -181,6 +183,8 @@ class trayIcon(object): self.execargs.append('--compress-cache') if self.parent.values[20] == True: self.execargs.append('--overwrite') + if self.parent.values[15] == 0: + self.execargs.append('--follow-mouse') if self.parent.values[22] == True: self.execargs.append('-use-jack') for i in self.parent.values[23]: |