From 7f399d7c3c68c67e34241f91a1c9776049ae3ca7 Mon Sep 17 00:00:00 2001 From: iovar Date: Sun, 8 Jul 2007 15:49:23 +0000 Subject: rmdConfig.py.in, rmdPrefsWidget.py, rmdSimple.py, rmdStrings.py, rmdTrayIcon.py: made area resting after every capture optional. The area is also saved in the options file, if reseting is disabled. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@376 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- gtk-recordmydesktop/src/rmdConfig.py.in | 2 +- gtk-recordmydesktop/src/rmdPrefsWidget.py | 16 ++++++++++++---- gtk-recordmydesktop/src/rmdSimple.py | 28 ++++++++++++++++++++++------ gtk-recordmydesktop/src/rmdStrings.py | 2 ++ gtk-recordmydesktop/src/rmdTrayIcon.py | 5 +++-- 5 files changed, 40 insertions(+), 13 deletions(-) (limited to 'gtk-recordmydesktop/src') diff --git a/gtk-recordmydesktop/src/rmdConfig.py.in b/gtk-recordmydesktop/src/rmdConfig.py.in index d0ac1ee..ff17ebc 100644 --- a/gtk-recordmydesktop/src/rmdConfig.py.in +++ b/gtk-recordmydesktop/src/rmdConfig.py.in @@ -21,7 +21,7 @@ default_values=[15, #framerate "$DISPLAY", #display, this is not interpreted as an env variable #but when the value is set to this the argument is omitted 0, #shared memory,0 on 1 off - 1, #drop frames,unused in 0.3,0, removed at 0.3.4, preserved for compatibility of prefs file. + 0, #reset recording area ,0 on 1 off 75, #shared threshold.Removed at 0.3.4, preserved for compatibility of prefs file. 1, #quick subsampling,0 on 1 off "/tmp", #working directory diff --git a/gtk-recordmydesktop/src/rmdPrefsWidget.py b/gtk-recordmydesktop/src/rmdPrefsWidget.py index 1a587ae..050be4f 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(17): + for i in range(18): self.tooltips.set_tip(self.eboxes[i],prefTooltipLabels[i]) self.tooltips.set_tip(self.jack_ebox,prefJacktip) @@ -55,6 +55,7 @@ class prefsWidget(object): self.values[9]=self.deviceEntry.get_text().replace(' ','') 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[16]=self.quickComboBox.get_active() self.values[17]=self.workdirEntry.get_text() @@ -235,7 +236,7 @@ class prefsWidget(object): self.boxes[9].pack_end(self.deviceEntry,expand=False,fill=False) #misc page - for i in xrange(10,17): + for i in xrange(10,18): self.labels[i]=gtk.Label(prefLabelStrings[i]) self.labels[i].set_justify(gtk.JUSTIFY_LEFT) self.boxes[i]=gtk.HBox(homogeneous=False, spacing=0) @@ -288,12 +289,19 @@ class prefsWidget(object): self.rFrameComboBox.show() self.boxes[15].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.extraOptsEntry= gtk.Entry(max=0) self.extraOptsEntry.set_text(self.values[26]) self.extraOptsEntry.show() - self.boxes[16].pack_end(self.extraOptsEntry,expand=False,fill=False) + self.boxes[17].pack_end(self.extraOptsEntry,expand=False,fill=False) - for i in range(17): + for i in range(18): self.boxes[i].show() self.eboxes[i].show() diff --git a/gtk-recordmydesktop/src/rmdSimple.py b/gtk-recordmydesktop/src/rmdSimple.py index 381dc8b..671d619 100644 --- a/gtk-recordmydesktop/src/rmdSimple.py +++ b/gtk-recordmydesktop/src/rmdSimple.py @@ -279,7 +279,7 @@ class simpleWidget(object): savefile.readline() self.values.append(savefile.readline().replace("\n","")) #recording area is not saved - self.values.append(rmdConfig.default_values[5]) + self.values.append([]) for i in range(3): savefile.readline() self.values.append(int(savefile.readline())) @@ -290,10 +290,24 @@ class simpleWidget(object): self.values.append(int(savefile.readline())) savefile.readline() self.values.append(savefile.readline().replace("\n","")) - for i in range(4): + for i in range(2): savefile.readline() self.values.append(int(savefile.readline())) savefile.readline() + areastring=savefile.readline() + try: + as1=areastring.replace('\n','').split(',') + for i in range(4): + self.values[5].append(int(as1[i])) + except: + self.values[5]=[] + for i in rmdConfig.default_values[5]: + self.values[5].append(i) + #open for some future option + self.values.append(0) + savefile.readline() + self.values.append(int(savefile.readline())) + savefile.readline() self.values.append(savefile.readline().replace("\n","")) for i in range(2): savefile.readline() @@ -370,11 +384,13 @@ class simpleWidget(object): savefile.write("%s\n"%self.values[12]) savefile.write("#Shared memory,1 disabled 0 enabled\n") savefile.write("%d\n"%self.values[13]) - savefile.write("#Drop frames(encoder option),1 disabled 0 enabled.Unused at 0.3.0, removed at 0.3.4, preserved for compatibility of prefs file.\n") + savefile.write("#Reset capture area,1 disabled 0 enabled\n") savefile.write("%d\n"%self.values[14]) - savefile.write("#Shared memory threshold,0-100. Removed at 0.3.4," - " preserved for compatibility of prefs file\n") - savefile.write("%d\n"%self.values[15]) + savefile.write("#Recording area\n") + if(self.values[14]): + savefile.write("%d,%d,%d,%d\n"%(self.values[5][0],self.values[5][1],self.values[5][2],self.values[5][3])) + else: + savefile.write("%d,%d,%d,%d\n"%(rmdConfig.default_values[5][0],rmdConfig.default_values[5][1],rmdConfig.default_values[5][2],rmdConfig.default_values[5][3])) savefile.write("#Quick subsampling,1 disabled 0 enabled\n") savefile.write("%d\n"%self.values[16]) savefile.write("#Working directory(temporary files)\n") diff --git a/gtk-recordmydesktop/src/rmdStrings.py b/gtk-recordmydesktop/src/rmdStrings.py index dcd2fa4..b0d82d0 100644 --- a/gtk-recordmydesktop/src/rmdStrings.py +++ b/gtk-recordmydesktop/src/rmdStrings.py @@ -71,6 +71,7 @@ prefLabelStrings=[_('Overwite Existing Files'),_('Working Directory'), _('Channels'),_('Frequency'),_('Device'),_('Display'),_('Mouse Cursor'), _('MIT-Shm extension'),_('Include Window Decorations'),_('Tooltips'), _('Outline Capture Area On Screen'), + _('Reset Capture Area'), _('Extra Options'), _('Video Quality'),_('Sound Quality'), _('Drop Frames(encoder)'),_('Startup Delay(secs)'),] @@ -93,6 +94,7 @@ prefTooltipLabels=[_('By default, if you try to save under a filename that alrea _('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)'), _('Draw a frame on the screen, around the area\nthat will get captured.\n(This frame will remain throughout the recording.)'), + _('Reset capture area after every recording\nand at program shutdown.'), _('Extra commandline options that will get\npassed to recordMyDesktop during initialization.\nThese options must be entered the same way\nthey would in the commandline (i.e. separated with spaces).\nConsult the manpage for more information on using them.')] prefJacktip=_("Enable this option to record audio through\nJACK. The Jack server must be running in order to\nobtain the ports that will be recorded.\nThe audio recorded from each one\nwill be written on a channel of its own.\nrecordMyDesktop must be compiled with JACK\nsupport for this option to work.") diff --git a/gtk-recordmydesktop/src/rmdTrayIcon.py b/gtk-recordmydesktop/src/rmdTrayIcon.py index bbb88d5..560d2bf 100644 --- a/gtk-recordmydesktop/src/rmdTrayIcon.py +++ b/gtk-recordmydesktop/src/rmdTrayIcon.py @@ -161,8 +161,9 @@ class trayIcon(object): self.execargs.append('%d'%(self.parent.values[5][2]-self.parent.values[5][0])) self.execargs.append('-height') self.execargs.append('%d'%(self.parent.values[5][3]-self.parent.values[5][1])) - for i in range(4): - self.parent.values[5][i]=-1 + if(not self.parent.values[14]): + for i in range(4): + self.parent.values[5][i]=-1 if self.parent.values[6]>0: self.execargs.append('-delay') self.execargs.append('%d'%self.parent.values[6]) -- cgit v1.2.3