diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-07-11 16:47:00 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-07-11 16:47:00 -0700 |
commit | 3625160acc1715fc380f58ec3c4248485bed2370 (patch) | |
tree | dc95a32d81daac298cef69879a639029797fb762 /gtk-recordmydesktop/src | |
parent | cfcca8681b88a171fb2cdbb83daa5f22bbedb6b8 (diff) |
*: drop {gtk,qt}-recordmydesktop subdirs
This restores the recordmydesktop/ subdir as root from the mirror I
cloned by fork from.
I have no particular interest in the gtk/qt frontends and it doesn't
appear they were part of a single tree in the past. But I will
probably preserve backwards compatibility of the cli so they can
continue to work with this fork installed.
Diffstat (limited to 'gtk-recordmydesktop/src')
-rw-r--r-- | gtk-recordmydesktop/src/Makefile.am | 28 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/__init__.py | 4 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/gtk-recordMyDesktop.in | 50 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/gtk-recordmydesktop.desktop | 12 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/gtk-recordmydesktop.png | bin | 3651 -> 0 bytes | |||
-rw-r--r-- | gtk-recordmydesktop/src/gtk-recordmydesktop.svg | 99 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdConfig.py.in | 37 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdFrame.py | 124 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdMonitor.py | 74 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdPrefsWidget.py | 425 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdSelect.py | 139 | ||||
-rwxr-xr-x | gtk-recordmydesktop/src/rmdSelectThumb.py | 250 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdSimple.py | 535 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdStrings.py | 112 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdTrayIcon.py | 358 | ||||
-rw-r--r-- | gtk-recordmydesktop/src/rmdTrayPopup.py | 108 |
16 files changed, 0 insertions, 2355 deletions
diff --git a/gtk-recordmydesktop/src/Makefile.am b/gtk-recordmydesktop/src/Makefile.am deleted file mode 100644 index 1527d23..0000000 --- a/gtk-recordmydesktop/src/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -bin_SCRIPTS=gtk-recordMyDesktop - -gtk_recordMyDesktopdir=$(pythondir)/recordMyDesktop - -gtk_recordMyDesktop_PYTHON = \ - rmdSelect.py\ - rmdTrayIcon.py\ - rmdSelectThumb.py\ - rmdTrayPopup.py\ - rmdPrefsWidget.py\ - rmdSimple.py\ - rmdConfig.py\ - rmdMonitor.py\ - rmdFrame.py\ - rmdStrings.py\ - __init__.py - -desktopdir = $(datadir)/applications - -desktop_DATA =gtk-recordmydesktop.desktop - -pixmapdir = $(datadir)/pixmaps -pixmap_DATA = gtk-recordmydesktop.png - -EXTRA_DIST=gtk-recordMyDesktop.in gtk-recordmydesktop.desktop gtk-recordmydesktop.png gtk-recordmydesktop.svg - -clean-local: - rm -rf *.pyc *.pyo diff --git a/gtk-recordmydesktop/src/__init__.py b/gtk-recordmydesktop/src/__init__.py deleted file mode 100644 index 7262f15..0000000 --- a/gtk-recordmydesktop/src/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -# -# - diff --git a/gtk-recordmydesktop/src/gtk-recordMyDesktop.in b/gtk-recordmydesktop/src/gtk-recordMyDesktop.in deleted file mode 100644 index 6d5b6ab..0000000 --- a/gtk-recordmydesktop/src/gtk-recordMyDesktop.in +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python - - -#/********************************************************************************* -#* gtk-recordMyDesktop * -#********************************************************************************** -#* * -#* Copyright (C) 2006 John Varouhakis * -#* * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU General Public License as published by * -#* the Free Software Foundation; either version 2 of the License, or * -#* (at your option) any later version. * -#* * -#* This program is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU General Public License for more details. * -#* * -#* You should have received a copy of the GNU General Public License * -#* along with this program; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -#* * -#* * -#* * -#* For further information contact me at johnvarouhakis@gmail.com * -#**********************************************************************************/ - -import sys - -#this is the installation direcotry, -#which is determined during configuration -#default /usr/local/lib/python<version>/site-packages -PYTHONDIR='@PYTHONDIR@' -sys.path.append(PYTHONDIR) -from recordMyDesktop import rmdSimple - -def main(): - tr=rmdSimple.simpleWidget() - - -main() - - - - - - - diff --git a/gtk-recordmydesktop/src/gtk-recordmydesktop.desktop b/gtk-recordmydesktop/src/gtk-recordmydesktop.desktop deleted file mode 100644 index 5c79b89..0000000 --- a/gtk-recordmydesktop/src/gtk-recordmydesktop.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Version=1.0 -Encoding=UTF-8 -Name=gtk-recordMyDesktop -Comment=Frontend for recordMyDesktop -Comment[fr]=Interface pour recordmydesktop -Exec=gtk-recordMyDesktop -Terminal=false -Type=Application -Icon=gtk-recordmydesktop.png -Categories=AudioVideo;Recorder; -StartupNotify=false diff --git a/gtk-recordmydesktop/src/gtk-recordmydesktop.png b/gtk-recordmydesktop/src/gtk-recordmydesktop.png Binary files differdeleted file mode 100644 index 8ac6b3e..0000000 --- a/gtk-recordmydesktop/src/gtk-recordmydesktop.png +++ /dev/null diff --git a/gtk-recordmydesktop/src/gtk-recordmydesktop.svg b/gtk-recordmydesktop/src/gtk-recordmydesktop.svg deleted file mode 100644 index 2d76d5b..0000000 --- a/gtk-recordmydesktop/src/gtk-recordmydesktop.svg +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://web.resource.org/cc/" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="468pt" - height="468pt" - viewBox="0 0 468 468" - preserveAspectRatio="xMidYMid meet" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.44.1" - sodipodi:docname="rmddb1.png.svg" - sodipodi:docbase="/home/iovar/workspace/recordMyDesktop/NO_CVS"> - <defs - id="defs13"> - <linearGradient - id="linearGradient2764"> - <stop - style="stop-color:#32000c;stop-opacity:1;" - offset="0" - id="stop2776" /> - <stop - id="stop2769" - offset="0.53846157" - style="stop-color:#7d001f;stop-opacity:1;" /> - <stop - style="stop-color:#210019;stop-opacity:1;" - offset="1" - id="stop2768" /> - </linearGradient> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2764" - id="radialGradient2770" - cx="330.83143" - cy="238.79865" - fx="330.83143" - fy="238.79865" - r="61.69674" - gradientTransform="matrix(1,0,0,0.988932,0,2.643133)" - gradientUnits="userSpaceOnUse" /> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2764" - id="radialGradient2772" - cx="233.28449" - cy="256.5222" - fx="233.28449" - fy="256.5222" - r="222.42589" - gradientTransform="matrix(1,0,0,0.950779,0,12.62635)" - gradientUnits="userSpaceOnUse" /> - </defs> - <sodipodi:namedview - inkscape:window-height="579" - inkscape:window-width="931" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - guidetolerance="10.0" - gridtolerance="10.0" - objecttolerance="10.0" - borderopacity="1.0" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" - inkscape:zoom="0.64786325" - inkscape:cx="292.5" - inkscape:cy="290.95646" - inkscape:window-x="0" - inkscape:window-y="25" - inkscape:current-layer="svg2" /> - <metadata - id="metadata4"> -Created by potrace 1.7, written by Peter Selinger 2001-2005 -<rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> -</rdf:RDF> -</metadata> - <path - style="fill:url(#radialGradient2772);stroke:none;fill-opacity:1.0" - id="path8" - d="M 124.3125,64.35 C -4.3875,121.3875 -29.25,270.5625 78.975,340.7625 C 127.2375,372.9375 127.2375,389.025 80.4375,400.725 C -11.7,424.125 86.2875,468 231.075,468 C 333.45,468 418.275,444.6 429.975,413.8875 C 434.3625,403.65 429.975,394.875 419.7375,394.875 C 368.55,393.4125 364.1625,368.55 408.0375,324.675 C 495.7875,238.3875 457.7625,106.7625 331.9875,59.9625 C 276.4125,38.025 178.425,40.95 124.3125,64.35 z M 381.7125,111.15 C 466.5375,153.5625 457.7625,289.575 370.0125,323.2125 C 282.2625,356.85 225.225,310.05 232.5375,212.0625 L 235.4625,168.1875 L 191.5875,219.375 C 152.1,267.6375 147.7125,269.1 111.15,250.0875 C 59.9625,222.3 62.8875,195.975 124.3125,137.475 C 194.5125,71.6625 286.65,61.425 381.7125,111.15 z M 383.175,429.975 C 345.15,451.9125 137.475,460.6875 125.775,440.2125 C 118.4625,428.5125 143.325,424.125 207.675,424.125 C 263.25,422.6625 310.05,415.35 327.6,402.1875 C 348.075,386.1 359.775,386.1 381.7125,399.2625 C 406.575,415.35 406.575,416.8125 383.175,429.975 z " /> - <path - style="fill:url(#radialGradient2770);stroke:none;fill-opacity:1.0" - id="path10" - d="M 277.875,195.975 C 261.7875,216.45 266.175,219.375 305.6625,219.375 C 348.075,219.375 351,222.3 342.225,258.8625 L 331.9875,299.8125 L 364.1625,272.025 C 409.5,231.075 399.2625,184.275 342.225,178.425 C 314.4375,175.5 289.575,182.8125 277.875,195.975 z " /> -</svg> diff --git a/gtk-recordmydesktop/src/rmdConfig.py.in b/gtk-recordmydesktop/src/rmdConfig.py.in deleted file mode 100644 index 8f875d1..0000000 --- a/gtk-recordmydesktop/src/rmdConfig.py.in +++ /dev/null @@ -1,37 +0,0 @@ -import os -VERSION='@VERSION@' -PREFIX='@PREFIX@' -locale_install_dir=os.path.join('@DATADIR@'.replace("${prefix}",PREFIX), 'locale') - -#binary values expressed with 1 and zero instead of True and False -#are upside down. That means 0 is enabled and 1 disabled - -default_values=[15, #framerate - 0, #cursor - True, #sound - 1, #full shots,0 on 1 off - os.path.join(os.getenv('HOME'),'out.ogv'), #filename - [-1,-1,-1,-1], #recording area(<0 means auto) - 0, #delay ,unused on 0.3 - 1, #no of channels - 22050, #frequency - 'DEFAULT', #device - 63, #video quality - 10, #audio quality - "$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 - 0, #reset recording area ,0 on 1 off - 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 - 0, #zero compression,0 on 1 off - False, #overwrite existing files - 0, #include window decorations, 0 on 1 off - False, #Use jack - [], #jack ports - 0, #tooltips,0 on 1 off - 0, #draw an on-screen frame, surrounding the capture area,0 on 1 off - "", #extra options - ] diff --git a/gtk-recordmydesktop/src/rmdFrame.py b/gtk-recordmydesktop/src/rmdFrame.py deleted file mode 100644 index 4441afb..0000000 --- a/gtk-recordmydesktop/src/rmdFrame.py +++ /dev/null @@ -1,124 +0,0 @@ -#/********************************************************************************* -#* gtk-recordMyDesktop * -#********************************************************************************** -#* * -#* Copyright (C) 2006 John Varouhakis * -#* * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU General Public License as published by * -#* the Free Software Foundation; either version 2 of the License, or * -#* (at your option) any later version. * -#* * -#* This program is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU General Public License for more details. * -#* * -#* You should have received a copy of the GNU General Public License * -#* along with this program; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -#* * -#* * -#* * -#* For further information contact me at johnvarouhakis@gmail.com * -#**********************************************************************************/ -import pygtk -pygtk.require('2.0') -import gtk -import gobject - -class rmdFrame: - borderwidth=6 - outlinewidth=1 - - 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, - 1) - gc = mask.new_gc() - gc.foreground = gtk.gdk.Color(0,0,0,1) - mask.draw_rectangle(gc,True,0,0, - self.w+self.borderwidth*2, - self.h+self.borderwidth*2) - gc.foreground = gtk.gdk.Color(0, 0, 0, 0) - mask.draw_rectangle(gc,True, - self.borderwidth, - self.borderwidth, - self.w,self.h) - - self.area.show() - self.window.stick() - self.window.set_keep_above(True) - self.area.connect("expose-event", self.__expose_cb) - self.window.shape_combine_mask(mask,0,0) - self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK) - self.window.set_title("gtk-recordMyDesktop frame") - self.window.stick() - self.window.set_keep_above(True) - self.window.add(self.area) - self.window.show() - - self.window.set_size_request(self.w+self.borderwidth*2, - self.h+self.borderwidth*2) - 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(100,self.moveFrame) - - def moveFrame(self): - if self.parent.values[15]==0 and self.parent.hidden[0]==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): - if widget==self.area: - self.area.window.draw_rectangle(self.window.style.white_gc, - True,0,0,self.w+self.borderwidth*2, - self.h+self.borderwidth*2) - self.area.window.draw_rectangle(self.window.style.black_gc, - True,self.outlinewidth, - self.outlinewidth, - self.w+(self.borderwidth- - self.outlinewidth)*2, - self.h+(self.borderwidth- - self.outlinewidth)*2) - self.area.window.draw_rectangle(self.window.style.white_gc, - True, - self.borderwidth-self.outlinewidth, - self.borderwidth-self.outlinewidth, - self.w+self.outlinewidth*2, - self.h+self.outlinewidth*2) - else: - pass - - def destroy(self): - self.area.destroy() - try: - self.window.destroy() - except: - pass diff --git a/gtk-recordmydesktop/src/rmdMonitor.py b/gtk-recordmydesktop/src/rmdMonitor.py deleted file mode 100644 index f6c20dd..0000000 --- a/gtk-recordmydesktop/src/rmdMonitor.py +++ /dev/null @@ -1,74 +0,0 @@ -import pygtk -pygtk.require('2.0') -import gtk -import gobject -import locale, gettext -import rmdConfig -_ = gettext.gettext -gettext.textdomain('gtk-recordMyDesktop') -gettext.bindtextdomain('gtk-recordMyDesktop',rmdConfig.locale_install_dir) -import popen2 -import os,fcntl,signal -from rmdStrings import * - -class rmdMonitor(object): - labeString=monStrings['PleaseWait'] - counter_fraction=0.0 - - def destroy_and_kill(self,Event=None): - self.destroy() - self.stop_encoding() - def destroy(self,Event=None): - gobject.source_remove(self.timed_id) - self.window.destroy() - gtk.main_quit() - def update_counter(self): - strstdout="" - try: - strstdout=self.stdout.read() - if strstdout =='': - self.destroy() - except: - return True - try: - self.counter_fraction=float(strstdout.replace("[","").replace("%] ","")) - percentage=self.counter_fraction/100.0 - if percentage>1.0: - percentage=1.0 - self.progressbar.set_fraction(percentage) - self.progressbar.set_text("%.2f%% "%(self.counter_fraction)+monStrings['complete']) - except: - self.counter_fraction=0.0 - - return True - def stop_encoding(self,Event=None): - os.kill(self.rmdPid,signal.SIGINT) - - def __init__(self,out_stream,childPid): - flags = fcntl.fcntl(out_stream, fcntl.F_GETFL) - fcntl.fcntl(out_stream, fcntl.F_SETFL, flags | os.O_NONBLOCK) - self.rmdPid=childPid - self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) - self.window.connect("destroy", self.destroy_and_kill) - self.window.set_border_width(10) - self.window.set_title("recordMyDesktop-encoder") - self.label=gtk.Label(self.labeString) - self.label.set_justify(gtk.JUSTIFY_CENTER) - self.label.show() - self.progressbar=gtk.ProgressBar(adjustment=None) - self.progressbar.set_fraction(self.counter_fraction) - self.progressbar.set_text("0% "+monStrings['complete']) - self.progressbar.show() - self.stopbutton=gtk.Button(None,gtk.STOCK_CANCEL) - self.stopbutton.connect("clicked",self.stop_encoding) - self.box=gtk.VBox(homogeneous=False, spacing=20) - self.box.pack_start(self.label,True,True) - self.box.pack_start(self.progressbar,True,True) - self.box.pack_start(self.stopbutton,expand=False,fill=False) - self.box.show() - self.stopbutton.show() - self.window.add(self.box) - self.window.show() - self.stdout=out_stream - self.timed_id=gobject.timeout_add(100,self.update_counter) - gtk.main() diff --git a/gtk-recordmydesktop/src/rmdPrefsWidget.py b/gtk-recordmydesktop/src/rmdPrefsWidget.py deleted file mode 100644 index 0257ba9..0000000 --- a/gtk-recordmydesktop/src/rmdPrefsWidget.py +++ /dev/null @@ -1,425 +0,0 @@ -#/********************************************************************************* -#* gtk-recordMyDesktop * -#********************************************************************************** -#* * -#* Copyright (C) 2006 John Varouhakis * -#* * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU General Public License as published by * -#* the Free Software Foundation; either version 2 of the License, or * -#* (at your option) any later version. * -#* * -#* This program is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU General Public License for more details. * -#* * -#* You should have received a copy of the GNU General Public License * -#* along with this program; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -#* * -#* * -#* * -#* For further information contact me at johnvarouhakis@gmail.com * -#**********************************************************************************/ - - -import pygtk -pygtk.require('2.0') -import gtk -import locale, gettext -import rmdConfig -_ = gettext.gettext -gettext.textdomain('gtk-recordMyDesktop') -gettext.bindtextdomain('gtk-recordMyDesktop',rmdConfig.locale_install_dir) -import os -from rmdStrings import * - - - - -class prefsWidget(object): - def __tooltips__(self): - self.tooltips=gtk.Tooltips() - for i in range(19): - self.tooltips.set_tip(self.eboxes[i],prefTooltipLabels[i]) - self.tooltips.set_tip(self.jack_ebox,prefJacktip) - - - def destroy(self,Event=None): - self.values[0]=self.fpsSpinButton.get_value_as_int() - self.values[1]=self.mouseComboBox.get_active() - self.values[3]=int(not self.fullComboBox.get_active()) - self.values[7]=self.channelsSpinButton.get_value_as_int() - self.values[8]=self.freqSpinButton.get_value_as_int() - self.values[9]=self.deviceEntry.get_text().replace(' ','') - self.values[12]=self.displayEntry.get_text().replace(' ','') - self.values[13]=int(not self.sharedComboBox.get_active()) - self.values[14]=int(not self.areaResetComboBox.get_active()) - self.values[15]=int(not self.followMouseComboBox.get_active()) - self.values[16]=int(not self.quickComboBox.get_active()) - self.values[17]=self.workdirEntry.get_text() - self.values[18]=int(not self.onTheFlyComboBox.get_active()) - self.values[19]=int(not self.zeroCmpComboBox.get_active()) - self.values[20]=self.overwriteFilesButton.get_active() - self.values[21]=int(not self.winDecoComboBox.get_active()) - self.values[22]=self.jack_button.get_active() - self.__getSelectedPorts__() - self.values[24]=int(not self.tooltipsComboBox.get_active()) - self.values[25]=int(not self.rFrameComboBox.get_active()) - self.values[26]=self.extraOptsEntry.get_text().strip() - self.window.destroy() - self.optionsOpen[0]=0 - - def __exit__(self,Event=None): - gtk.main_quit() - self.values[0]=-1 - self.optionsOpen[0]=0 - self.window.destroy() - - def __getSelectedPorts__(self): - iters_t=[] - self.values[23]=[] - sel_rows=self.jack_lsp_listview.get_selection().get_selected_rows() - for i in sel_rows[1]: - iters_t.append(self.jack_lsp_listview.get_model().get_iter(i)) - for i in iters_t: - self.values[23].append(self.jack_lsp_listview.get_model().get_value(i,0)) - - def __fileSelQuit__(self,Event=None): - self.fileSel.destroy() - - def __fileSelOk__(self,Event=None): - new_val=self.fileSel.get_filename() - self.workdirEntry.set_text(new_val) - self.fileSel.destroy() - - - def __subWidgets__(self): - self.labels={} - self.boxes={} - self.labelbox={} - self.eboxes={} - for i in range(4): - self.labelbox[i]=gtk.VBox(homogeneous=False, spacing=20) - self.notebook = gtk.Notebook() - -#Files page - for i in range(2): - self.labels[i]=gtk.Label(prefLabelStrings[i]) - self.labels[i].set_justify(gtk.JUSTIFY_LEFT) - self.boxes[i]=gtk.HBox(homogeneous=False, spacing=40) - self.boxes[i].pack_start(self.labels[i],expand=False,fill=False) - self.labels[i].show() - self.eboxes[i]=gtk.EventBox() - self.eboxes[i].add(self.boxes[i]) - self.labelbox[0].pack_start(self.eboxes[i],expand=False,fill=False) - - self.workdir_layout=gtk.HBox(homogeneous=False, spacing=0) - - - self.overwriteFilesButton=gtk.CheckButton(label=None) - self.overwriteFilesButton.set_active(self.values[20]) - self.overwriteFilesButton.show() - self.boxes[0].pack_end(self.overwriteFilesButton,expand=False,fill=False) - - self.workdirEntry= gtk.Entry(max=0) - self.workdirEntry.set_text(self.values[17]) - self.workdirEntry.show() - #self.boxes[1].pack_end(self.workdirEntry,expand=False,fill=False) - #self.file_button=gtk.Button(None,gtk.STOCK_SAVE_AS) - #self.file_button.show() - self.workdir_button=gtk.Button(None,gtk.STOCK_SAVE_AS) - self.workdir_button.show() - - - self.workdir_layout.pack_start(self.workdirEntry,expand=True,fill=True) - self.workdir_layout.pack_start(self.workdir_button,expand=False,fill=False) - self.workdir_layout.show() - - self.labelbox[0].pack_start(self.workdir_layout,expand=False,fill=False) - - -#Performance page - for i in xrange(2,7): - self.labels[i]=gtk.Label(prefLabelStrings[i]) - self.labels[i].set_justify(gtk.JUSTIFY_LEFT) - self.boxes[i]=gtk.HBox(homogeneous=False, spacing=40) - self.boxes[i].pack_start(self.labels[i],expand=False,fill=False) - self.labels[i].show() - self.eboxes[i]=gtk.EventBox() - self.eboxes[i].add(self.boxes[i]) - self.labelbox[1].pack_start(self.eboxes[i],expand=False,fill=False) - - self.fpsAdjustment=gtk.Adjustment(value=self.values[0], lower=1, upper=50, step_incr=1, page_incr=5, page_size=0) - self.fpsSpinButton= gtk.SpinButton(self.fpsAdjustment, climb_rate=0.5, digits=0) - self.fpsSpinButton.show() - self.boxes[2].pack_end(self.fpsSpinButton,expand=False,fill=False) - - self.onTheFlyComboBox = gtk.CheckButton(" ") - self.onTheFlyComboBox.set_active(int(not self.values[18])) - self.onTheFlyComboBox.show() - self.boxes[3].pack_end(self.onTheFlyComboBox,expand=False,fill=False) - - self.zeroCmpComboBox = gtk.CheckButton(" ") - self.zeroCmpComboBox.set_active(int(not self.values[19])) - self.zeroCmpComboBox.show() - self.boxes[4].pack_end(self.zeroCmpComboBox,expand=False,fill=False) - - self.quickComboBox = gtk.CheckButton(" ") - self.quickComboBox.set_active(int(not self.values[16])) - self.quickComboBox.show() - self.boxes[5].pack_end(self.quickComboBox,expand=False,fill=False) - - self.fullComboBox = gtk.CheckButton(" ") - self.fullComboBox.set_active(int(not self.values[3])) - self.fullComboBox.show() - self.boxes[6].pack_end(self.fullComboBox,expand=False,fill=False) - - -#sound page - for i in xrange(7,10): - self.labels[i]=gtk.Label(prefLabelStrings[i]) - self.labels[i].set_justify(gtk.JUSTIFY_LEFT) - self.boxes[i]=gtk.HBox(homogeneous=False, spacing=0) - self.boxes[i].pack_start(self.labels[i],expand=False,fill=False) - self.labels[i].show() - self.eboxes[i]=gtk.EventBox() - self.eboxes[i].add(self.boxes[i]) - self.labelbox[2].pack_start(self.eboxes[i],expand=False,fill=False) - - self.jack_button= gtk.CheckButton(prefStrings['UseJack']) - self.jack_lsp_label=gtk.Label(prefStrings['SelectPorts']) - - self.jack_lsp_liststore=gtk.ListStore(str) - - self.jack_lsp_listview=gtk.TreeView(self.jack_lsp_liststore) - self.jack_lsp_tvc = gtk.TreeViewColumn(prefStrings['AvailablePorts']) - self.jack_lsp_listview.append_column(self.jack_lsp_tvc) - self.cell = gtk.CellRendererText() - self.jack_lsp_tvc.pack_start(self.cell, True) - self.jack_lsp_tvc.add_attribute(self.cell, 'text', 0) - self.jack_lsp_listview.set_search_column(0) - self.jack_lsp_listview.set_reorderable(True) - self.jack_lsp_listview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) - self.jack_scroll=gtk.ScrolledWindow(hadjustment=None, vadjustment=None) - self.jack_scroll.add_with_viewport(self.jack_lsp_listview) - - self.jack_lsp_refresh=gtk.Button(None,gtk.STOCK_REFRESH) - self.jack_box=gtk.VBox(homogeneous=False, spacing=10) - self.jack_box.pack_start(self.jack_button,expand=False,fill=False) - self.jack_box.pack_start(self.jack_lsp_label,expand=False,fill=False) - self.jack_box.pack_start(self.jack_scroll,expand=True,fill=True) - self.jack_box.pack_start(self.jack_lsp_refresh,expand=False,fill=False) - - - - self.jack_button.set_active(self.values[22]) - self.jack_button.show() - self.jack_lsp_label.show() - self.jack_lsp_listview.show() - self.jack_scroll.set_size_request(-1,200) - self.jack_scroll.show() - self.jack_lsp_refresh.show() - - self.jack_ebox=gtk.EventBox() - self.jack_ebox.add(self.jack_box) - self.jack_box.show() - - sep1=gtk.HSeparator() - - self.labelbox[2].pack_start(sep1,expand=False,fill=False) - self.labelbox[2].pack_start(self.jack_ebox,expand=True,fill=True) - sep1.show() - self.jack_ebox.show() - - - self.channelsAdjustment=gtk.Adjustment(value=self.values[7], lower=1,upper=2, step_incr=1, page_incr=1, page_size=1) - self.channelsSpinButton= gtk.SpinButton(self.channelsAdjustment, climb_rate=0.5, digits=0) - self.channelsSpinButton.show() - self.boxes[7].pack_end(self.channelsSpinButton,expand=False,fill=False) - - - self.freqAdjustment=gtk.Adjustment(value=self.values[8], lower=0,upper=48000, step_incr=1, page_incr=100, page_size=0) - self.freqSpinButton= gtk.SpinButton(self.freqAdjustment, climb_rate=0.5, digits=0) - self.freqSpinButton.show() - self.boxes[8].pack_end(self.freqSpinButton,expand=False,fill=False) - - - self.deviceEntry= gtk.Entry(max=0) - self.deviceEntry.set_text(self.values[9]) - self.deviceEntry.show() - self.boxes[9].pack_end(self.deviceEntry,expand=False,fill=False) - -#misc page - 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) - self.boxes[i].pack_start(self.labels[i],expand=False,fill=False) - self.labels[i].show() - self.eboxes[i]=gtk.EventBox() - self.eboxes[i].add(self.boxes[i]) - self.labelbox[3].pack_start(self.eboxes[i],expand=False,fill=False) - - self.displayEntry= gtk.Entry(max=0) - self.displayEntry.set_text(self.values[12]) - self.displayEntry.show() - self.boxes[10].pack_end(self.displayEntry,expand=False,fill=False) - - - self.mouseComboBox = gtk.combo_box_new_text() - for i in range(4): - self.mouseComboBox.append_text(prefMouseStrings[i]) - self.mouseComboBox.set_active(self.values[1]) - self.mouseComboBox.show() - self.boxes[11].pack_end(self.mouseComboBox,expand=False,fill=False) - - self.followMouseComboBox = gtk.CheckButton(" ") - self.followMouseComboBox.set_active(int(not self.values[15])) - self.followMouseComboBox.show() - self.boxes[12].pack_end(self.followMouseComboBox,expand=False,fill=False) - - self.sharedComboBox = gtk.CheckButton(" ") - self.sharedComboBox.set_active(int(not self.values[13])) - self.sharedComboBox.show() - self.boxes[13].pack_end(self.sharedComboBox,expand=False,fill=False) - - self.winDecoComboBox = gtk.CheckButton(" ") - self.winDecoComboBox.set_active(int(not self.values[21])) - self.winDecoComboBox.show() - self.boxes[14].pack_end(self.winDecoComboBox,expand=False,fill=False) - - self.tooltipsComboBox = gtk.CheckButton(" ") - self.tooltipsComboBox.set_active(int(not self.values[24])) - self.tooltipsComboBox.show() - self.boxes[15].pack_end(self.tooltipsComboBox,expand=False,fill=False) - - - self.rFrameComboBox = gtk.CheckButton(" ") - self.rFrameComboBox.set_active(int(not self.values[25])) - self.rFrameComboBox.show() - self.boxes[16].pack_end(self.rFrameComboBox,expand=False,fill=False) - - self.areaResetComboBox = gtk.CheckButton(" ") - self.areaResetComboBox.set_active(int(not self.values[14])) - self.areaResetComboBox.show() - 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[18].pack_end(self.extraOptsEntry,expand=False,fill=False) - - for i in range(19): - self.boxes[i].show() - self.eboxes[i].show() - -#append and show - for i in range(4): - self.notebook.append_page(self.labelbox[i],gtk.Label(prefTabStrings[i])) - self.window.add(self.notebook) - for i in range(4): - self.labelbox[i].show() - self.notebook.show() - def __runJackLSP__(self,button=None): - if button!=None: - self.__getSelectedPorts__() - self.ports=[] - failed=0 - (stdin,stdout,stderr)=os.popen3(['jack_lsp'],'t') - ports=stdout.readlines() - stdin.close() - stdout.close() - stderr.close() - self.jack_lsp_liststore.clear() - self.jack_lsp_listview.get_selection().unselect_all() - if ports!=[]: - for i in ports: - self.ports.append(i.replace('\n',"")) - self.jack_lsp_listview.get_selection().set_mode(gtk.SELECTION_MULTIPLE) - else: - failed=1 - self.ports.append(prefStrings['JackLspS1']) - self.ports.append(prefStrings['JackLspS2']) - self.jack_lsp_listview.get_selection().set_mode(gtk.SELECTION_NONE) - self.values[23]=[] - k=0 - for i in self.values[23]: - self.jack_lsp_liststore.append([i]) - self.jack_lsp_listview.get_selection().select_path((k,)) - k+=1 - for i in self.ports: - if i not in self.values[23]: - self.jack_lsp_liststore.append([i]) - #we are selecting the first one to prevent messing the args - if (not failed) and self.values[23]==[]: - self.jack_lsp_listview.get_selection().select_path((0,)) - #print self.jack_lsp_listview.get_selection().get_selected_rows() - - def __workdirSelect__(self,Event=None): - p=gtk.FileChooserDialog(title=None, - action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, - gtk.STOCK_OPEN,gtk.RESPONSE_OK) - ) - p.set_filename(self.workdirEntry.get_text()) - if p.run()==gtk.RESPONSE_OK: - tpath=p.get_filename() - if tpath!= '': - self.workdirEntry.set_text(tpath) - p.hide() - p.destroy() - - def __makeCons__(self): - self.jack_button.connect("clicked",self.__jack_enabled_check__) - self.jack_lsp_refresh.connect("clicked",self.__runJackLSP__) - self.workdir_button.connect("clicked",self.__workdirSelect__) - - def __register_shortcuts__(self): - self.parent.advanced_button.add_accelerator("clicked",self.accel_group, - ord('P'), gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE) - self.parent.advanced_button.add_accelerator("clicked",self.accel_group, - gtk.gdk.keyval_from_name("Escape"),0, - gtk.ACCEL_VISIBLE) - - def __jack_enabled_check__(self,widget): - self.channelsSpinButton.set_sensitive(not widget.get_active()) - self.freqSpinButton.set_sensitive(not widget.get_active()) - self.deviceEntry.set_sensitive(not widget.get_active()) - self.jack_lsp_listview.set_sensitive(widget.get_active()) - self.jack_lsp_refresh.set_sensitive(widget.get_active()) - - def __init__(self,parent,values,optionsOpen): - self.values=values - self.ports=[] - self.parent=parent - self.optionsOpen=optionsOpen - self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) - self.window.connect("destroy", self.destroy) - self.window.set_border_width(10) - self.window.set_title("recordMyDesktop: "+smplButtonStrings[0]) - self.accel_group = gtk.AccelGroup() - self.window.add_accel_group(self.accel_group) - - self.__subWidgets__() - self.__makeCons__() - self.__register_shortcuts__() - self.__runJackLSP__() - self.__jack_enabled_check__(self.jack_button) - if self.values[24]==0: - self.__tooltips__() - self.window.show() - - def main(self): - gtk.main() - - - - - - - - diff --git a/gtk-recordmydesktop/src/rmdSelect.py b/gtk-recordmydesktop/src/rmdSelect.py deleted file mode 100644 index cf03403..0000000 --- a/gtk-recordmydesktop/src/rmdSelect.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 -# -# Istanbul - a desktop session recorder -# Copyright (C) 2005 Zaheer Abbas Merali (zaheerabbas at merali dot org) -# All rights reserved. - -# This file may be distributed and/or modified under the terms of -# the GNU General Public License version 2 as published by -# the Free Software Foundation. -# This file is distributed without any warranty; without even the implied -# warranty of merchantability or fitness for a particular purpose. -# See "LICENSE.GPL" in the source distribution for more information. - -# Headers in this file shall remain intact. - -#This file has been modified to be used in gtk-recordMyDesktop -#by John Varouhakis -#area_return list has been added to retrieve the values -#original file name is select.py in Istanbul-0.2.1 -import gtk -import gtk.gdk - -class GtkAreaSelector(gtk.Window): - def __init__(self,area_return): - self.area_return=area_return - gtk.Window.__init__(self) - self.set_app_paintable(True) - self.fullscreen() - self.connect("expose-event", self.expose_cb) - self.connect("button-press-event", self.button_press_cb) - self.connect("button-release-event", self.button_release_cb) - self.connect("motion-notify-event", self.motion_notify_cb) - self.connect("delete-event", self.delete_cb) - self.connect("realize", self.realize_cb) - root = gtk.gdk.get_default_root_window() - (width, height) = root.get_size() - self.root = root.get_image(0, 0, width, height) - self.x1 = self.y1 = -1 - self.x2 = self.y2 = 0 - self.show_all() - - def realize_cb(self, widget): - gdkwindow = self.window - gdkwindow.set_events(gdkwindow.get_events() | - gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.BUTTON_RELEASE_MASK | - gtk.gdk.POINTER_MOTION_MASK); - cursor = gtk.gdk.Cursor(gtk.gdk.CROSSHAIR) - gdkwindow.set_cursor(cursor) - gdkwindow.set_back_pixmap(None, False) - - def expose_cb(self, widget, event): - dashes = [ 1.0, 2.0 ] - cr = self.window.cairo_create() - cr.rectangle(event.area.x, event.area.y, event.area.width, - event.area.height) - cr.clip() - self.window.draw_image(self.style.black_gc, self.root, event.area.x, - event.area.y, event.area.x, event.area.y, event.area.width, - event.area.height) - cr.set_line_width(1.0) - cr.set_source_rgba (1.0, 0.0, 0.0, 1.0) - cr.set_dash (dashes, 0.0) - cr.move_to (self.x1 - 0.5, 0.0) - cr.line_to (self.x1 - 0.5, event.area.y + event.area.height) - cr.move_to (0.0, self.y1 - 0.5) - cr.line_to (event.area.x + event.area.width, self.y1 - 0.5) - cr.stroke () - - 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 - cr.set_dash ([], 0.0) - cr.rectangle ( x, y, w, h) - cr.fill() - cr.set_source_rgba (0.0, 0.0, 0.5, 0.5) - cr.rectangle (x + 0.5, y + 0.5, w - 1, h - 1) - cr.stroke() - - return False - - def motion_notify_cb(self, widget, event): - self.queue_draw() - - if self.x1 >= 0: - rect = gtk.gdk.Rectangle() - rect.x = min(self.x1, min(self.x2, event.x + 1)) - rect.width = max(self.x1, max(self.x2, event.x + 1)) - rect.x - rect.y = min(self.y1, min(self.y2, event.y + 1)) - rect.height = max(self.y1, max(self.y2, event.y + 1)) - rect.y - self.queue_draw_area(rect.x, rect.y, rect.width, rect.height) - - self.x2 = event.x + 1 - self.y2 = event.y + 1 - - return True - - def button_release_cb(self, widget, event): - if event.button == 1 and self.x1 >= 0: - self.x2 = event.x + 1 - self.y2 = event.y + 1 - # stop - self.area_return[0]=min(int(self.x1),int(self.x2)) - self.area_return[1]=min(int(self.y1),int(self.y2)) - self.area_return[2]=max(int(self.x1),int(self.x2)) - self.area_return[3]=max(int(self.y1),int(self.y2)) - self.hide() - self.destroy() - - return True - - def button_press_cb(self, widget, event): - if event.button != 1: - self.x1 = self.y1 = -1 - # stop - #print "(%d, %d) - (%d, %d)" % (self.x1, self.y1, self.x2, self.y2) - #self.area_return[0]=self.x1 - #self.area_return[1]=self.y1 - #self.area_return[2]=self.x2 - #self.area_return[3]=self.y2 - #print self.area_return - self.destroy() - return True - self.x1 = event.x - self.y1 = event.y - self.queue_draw() - return True - - def delete_cb(self, widget,Event=None): - pass - -if __name__ == "__main__": - w = GtkAreaSelector() - w.show() - gtk.main() - - diff --git a/gtk-recordmydesktop/src/rmdSelectThumb.py b/gtk-recordmydesktop/src/rmdSelectThumb.py deleted file mode 100755 index b9533aa..0000000 --- a/gtk-recordmydesktop/src/rmdSelectThumb.py +++ /dev/null @@ -1,250 +0,0 @@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 -# -# Istanbul - a desktop session recorder -# Copyright (C) 2005 Zaheer Abbas Merali (zaheerabbas at merali dot org) -# All rights reserved. - -# This file may be distributed and/or modified under the terms of -# the GNU General Public License version 2 as published by -# the Free Software Foundation. -# This file is distributed without any warranty; without even the implied -# warranty of merchantability or fitness for a particular purpose. -# See "LICENSE.GPL" in the source distribution for more information. - -# Headers in this file shall remain intact. - -#This file has been modified to be used in gtk-recordMyDesktop -#by John Varouhakis - -#Base class is DrawingArea instead of Window to allow insertion. -#new methods: -# update_image to keep the screenshot current. -# __subsample__ to scale the screenshot -# __draw_lines__ to highlight the selected area. -#Calls to destroy have been removed, since this widget is meant to -#live for an indefinite amount of time. -#Click behavior has been changed. Selection now happens by left-click and dragging, -#while right click resets the selection. - - -#original file name is select.py in Istanbul-0.2.1 - - -import gtk -import gtk.gdk -from rmdFrame import * -import gobject -import gc - -class GtkThumbSelector(gtk.DrawingArea): - def __init__(self,caller,area_return,hidden,update_interval=2000): - self.hidden=hidden - self.area_return=area_return - self.selecting=0 - self.realFrame=None - self.caller=caller - gtk.DrawingArea.__init__(self) - self.set_app_paintable(True) - #self.fullscreen() - self.connect("expose-event", self.expose_cb) - self.connect("button-press-event", self.button_press_cb) - self.connect("button-release-event", self.button_release_cb) - self.connect("motion-notify-event", self.motion_notify_cb) - #self.connect("delete-event", self.delete_cb) - self.connect("realize", self.realize_cb) - #root = gtk.gdk.get_default_root_window() - self.wroot = gtk.gdk.get_default_root_window() - (self.wwidth, self.wheight) = self.wroot.get_size() - ############################################################### - - self.factor=1; - twidth=self.wwidth - while twidth>320 or self.factor<4: - twidth/=2 - self.factor*=2 - self.root=gtk.gdk.Image(gtk.gdk.IMAGE_NORMAL,self.wroot.get_visual(),self.wwidth/self.factor,self.wheight/self.factor) - #(width, height) = root.get_size() - sroot = self.wroot.get_image(0, 0, self.wwidth, self.wheight) - self.__subsample__(sroot,self.wwidth,self.wheight,self.root,self.factor) - #self.root = root.get_image(0, 0, width, height) - self.x1 = self.y1 = -1 - self.x2 = self.y2 = -1 - self.set_size_request(self.wwidth/self.factor,self.wheight/self.factor) - self.timed_id=gobject.timeout_add(update_interval,self.update_image) - - def __subsample__(self,im1,w,h,im2,stride,x=0,y=0): - for i in xrange(y,h,stride): - for k in xrange(x,w,stride): - im2.put_pixel(k/stride,i/stride,im1.get_pixel(k,i)) - def button_release_cb(self, widget, event): - if event.button == 1 and self.x1 >= 0 and widget==self: - self.selecting=0 - self.x2 = event.x + 1 - self.y2 = event.y + 1 - # stop - if self.x1 <0: self.x1=0 - if self.x2 <0: self.x2=0 - if self.y1 <0: self.y1=0 - if self.y2 <0: self.y2=0 - if self.x1 >self.wwidth/self.factor: self.x1=self.wwidth/self.factor - if self.x2 >self.wwidth/self.factor: self.x2=self.wwidth/self.factor - if self.y1 >self.wheight/self.factor: self.y1=self.wheight/self.factor - if self.y2 >self.wheight/self.factor: self.y2=self.wheight/self.factor - - - self.area_return[0]=min(int(self.x1),int(self.x2))*self.factor - self.area_return[1]=min(int(self.y1),int(self.y2))*self.factor - self.area_return[2]=max(int(self.x1),int(self.x2))*self.factor - self.area_return[3]=max(int(self.y1),int(self.y2))*self.factor - self.x1=self.y1=self.x2=self.y2=-1 - #print self.area_return - self.update_image() - - def button_press_cb(self, widget, event): - if widget==self: - if event.button == 1: - self.selecting=1 - self.update_image() - self.x1 = event.x - self.y1 = event.y - else: - self.x1 = self.y1=self.x2=self.y2=-1 - self.area_return[0]=self.area_return[1]=0 - self.area_return[2]=self.wwidth - self.area_return[3]=self.wheight - self.update_image() - - def realize_cb(self, widget): - if widget == self: - gdkwindow = self.window - gdkwindow.set_events(gdkwindow.get_events() | - gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.BUTTON_RELEASE_MASK | - gtk.gdk.POINTER_MOTION_MASK); - cursor = gtk.gdk.Cursor(gtk.gdk.CROSSHAIR) - gdkwindow.set_cursor(cursor) - gdkwindow.set_back_pixmap(None, False) - - def expose_cb(self, widget, event): - if widget==self: - dashes = [ 1.0, 2.0 ] - cr = self.window.cairo_create() - cr.rectangle(event.area.x, event.area.y, event.area.width, - event.area.height) - cr.clip() - self.window.draw_image(self.style.black_gc, self.root, event.area.x, - event.area.y, event.area.x, event.area.y, event.area.width, - event.area.height) - cr.set_line_width(1.0) - cr.set_source_rgba (1.0, 0.0, 0.0, 1.0) - cr.set_dash (dashes, 0.0) - cr.move_to (self.x1 - 0.5, 0.0) - cr.line_to (self.x1 - 0.5, event.area.y + event.area.height) - cr.move_to (0.0, self.y1 - 0.5) - cr.line_to (event.area.x + event.area.width, self.y1 - 0.5) - cr.stroke () - - 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 - cr.set_dash ([], 0.0) - cr.rectangle ( x, y, w, h) - cr.fill() - cr.set_source_rgba (0.0, 0.0, 0.5, 0.5) - cr.rectangle (x + 0.5, y + 0.5, w - 1, h - 1) - cr.stroke() - - return False - - def motion_notify_cb(self, widget, event): - if widget ==self: - self.queue_draw() - - if self.x1 >= 0 : - rect = gtk.gdk.Rectangle() - rect.x = min(self.x1, min(self.x2, event.x + 1)) - rect.width = max(self.x1, max(self.x2, event.x + 1)) - rect.x - rect.y = min(self.y1, min(self.y2, event.y + 1)) - rect.height = max(self.y1, max(self.y2, event.y + 1)) - rect.y - self.queue_draw_area(rect.x, rect.y, rect.width, rect.height) - - self.x2 = event.x + 1 - self.y2 = event.y + 1 - - return True - - def update_image(self): - #self.root.destroy() - self.queue_draw() - if self.hidden[0]==0 : - gc.collect() - sroot = self.wroot.get_image(0,0,self.wwidth,self.wheight) - self.__subsample__(sroot,self.wwidth,self.wheight,self.root,self.factor) - vals=[0,0, self.wwidth, self.wheight] - if self.area_return[0]>=0: - vals[0]=self.area_return[0] - if self.area_return[1]>=0: - vals[1]=self.area_return[1] - if self.area_return[2]>=0: - vals[2]=self.area_return[2]-self.area_return[0] - 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 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 - - return True - def __draw_lines__(self,img,vals,factor): - for i in xrange(vals[0]/factor,vals[0]/factor+vals[2]/factor): - for k in range(2): - img.put_pixel(i,vals[1]/factor+k,0xff0000) - img.put_pixel(i,(vals[1]+vals[3]/2-k)/factor,0xff0000) - img.put_pixel(i,(vals[1]+vals[3]-1-k)/factor,0xff0000) - for i in xrange(vals[1]/factor,vals[1]/factor+vals[3]/factor): - for k in range(2): - 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) 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]): - - self.realFrame.destroy() - self.realFrame=None - if self.realFrame==None and self.caller.values[25]==0: - self.__draw_frame__() - - - - def __draw_frame__(self): - 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.caller) - -#area_return=[-1,-1,-1,-1] - -#w=GtkThumbSelector(area_return,0) -#w.show() -#gtk.main() -#print area_return - - - - diff --git a/gtk-recordmydesktop/src/rmdSimple.py b/gtk-recordmydesktop/src/rmdSimple.py deleted file mode 100644 index eb85b84..0000000 --- a/gtk-recordmydesktop/src/rmdSimple.py +++ /dev/null @@ -1,535 +0,0 @@ -#/********************************************************************************* -#* gtk-recordMyDesktop * -#********************************************************************************** -#* * -#* Copyright (C) 2006 John Varouhakis * -#* * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU General Public License as published by * -#* the Free Software Foundation; either version 2 of the License, or * -#* (at your option) any later version. * -#* * -#* This program is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU General Public License for more details. * -#* * -#* You should have received a copy of the GNU General Public License * -#* along with this program; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -#* * -#* * -#* * -#* For further information contact me at johnvarouhakis@gmail.com * -#**********************************************************************************/ - - -import pygtk -pygtk.require('2.0') -import gtk -import locale, gettext -import rmdConfig -_ = gettext.gettext -gettext.textdomain('gtk-recordMyDesktop') -gettext.bindtextdomain('gtk-recordMyDesktop',rmdConfig.locale_install_dir) -import os -from rmdPrefsWidget import * -from rmdTrayIcon import * -import gtk.gdk -import gobject -import gc -import sys -import re -from subprocess import Popen,PIPE -import rmdPrefsWidget as pW -import rmdSelectThumb as sT -from rmdStrings import * - -class simpleWidget(object): - hidden=[0] - options=None - optionsOpen=[0] - def __subWidgets__(self): - self.labelbox=gtk.VBox(homogeneous=False, spacing=20) - #self.labelbox.set_size_request(400,272) - self.NBox=gtk.HBox(homogeneous=False, spacing=20) - self.NEBox=gtk.VBox(homogeneous=False, spacing=0) - self.NEVQBox=gtk.HBox(homogeneous=False, spacing=10) - self.NESQBox=gtk.HBox(homogeneous=False, spacing=10) - self.NETABox=gtk.VBox(homogeneous=False, spacing=10) - self.NWBox=gtk.VBox(homogeneous=False, spacing=0) - - - - self.NBox.pack_start(self.NWBox,expand=False,fill=False) - self.NBox.pack_start(self.NEBox,expand=True,fill=True) - self.NEBox.pack_start(self.NEVQBox,expand=False,fill=False) - self.NEBox.pack_start(self.NESQBox,expand=False,fill=False) - self.NEBox.pack_start(self.NETABox,expand=False,fill=False) - - self.SBox=gtk.HBox(homogeneous=True, spacing=0) - self.SEBox=gtk.HBox(homogeneous=False, spacing=10) - self.SWBox=gtk.HBox(homogeneous=False, spacing=10) - self.SBox.pack_start(self.SWBox,expand=True,fill=True) - self.SBox.pack_start(self.SEBox,expand=True,fill=True) - - self.labelbox.pack_start(self.NBox,expand=False,fill=False) - self.labelbox.pack_end(self.SBox,expand=False,fill=False) - - self.wroot = gtk.gdk.get_default_root_window() - (self.wwidth, self.wheight) = self.wroot.get_size() - - self.factor=1; - twidth=self.wwidth - while twidth>320 or self.factor<4: - twidth/=2 - self.factor*=2 - self.image=sT.GtkThumbSelector(self,self.values[5],self.hidden,2000) - self.image.show() - - self.NWBox.pack_start(self.image,False,False) - #quality - self.v_adj=gtk.Adjustment(value=int(round((float(self.values[10])*100.0)/63.0)), lower=0, upper=100, step_incr=1, page_incr=10, page_size=0) - self.v_quality=gtk.HScale(self.v_adj) - self.v_quality.set_value_pos(gtk.POS_LEFT) - self.v_quality.set_digits(0) - self.s_button= gtk.CheckButton(label=None) - self.s_adj=gtk.Adjustment(value=int(round(float(self.values[11])*10.0)), lower=0, upper=100, step_incr=1, page_incr=10, page_size=0) - #print (self.values[11]*10) - self.s_quality=gtk.HScale(self.s_adj) - self.s_quality.set_value_pos(gtk.POS_LEFT) - self.s_quality.set_digits(0) - self.v_label=gtk.Label(" "+smplLabelStrings[0]) - self.s_label=gtk.Label(smplLabelStrings[1]) - - self.advanced_button=gtk.Button(smplButtonStrings[0]) - self.tipLabel=gtk.Label(smplTipLabelStrings[0]) - self.NEVQBox.pack_start(self.v_label,expand=False,fill=False) - self.NEVQBox.pack_start(self.v_quality,expand=True,fill=True) - self.NESQBox.pack_start(self.s_button,expand=False,fill=False) - self.NESQBox.pack_start(self.s_label,expand=False,fill=False) - self.NESQBox.pack_start(self.s_quality,expand=True,fill=True) - self.NETABox.pack_start(self.advanced_button,expand=False,fill=False) - self.NETABox.pack_start(self.tipLabel,expand=False,fill=False) - - self.win_button=gtk.Button(smplButtonStrings[1]) - self.start_button=gtk.Button(None,gtk.STOCK_MEDIA_RECORD) - self.file_button=gtk.Button(None,gtk.STOCK_SAVE_AS) - self.quit_button=gtk.Button(None,gtk.STOCK_QUIT) - self.SWBox.pack_start(self.win_button,False,False) - self.SWBox.pack_start(self.start_button,False,False) - self.SEBox.pack_end(self.quit_button,False,False) - self.SEBox.pack_end(self.file_button,False,False) - - self.win_button.show() - self.start_button.show() - self.file_button.show() - self.quit_button.show() - - self.v_quality.show() - self.s_button.show() - self.s_quality.show() - self.v_label.show() - self.s_label.show() - self.tipLabel.show() - self.advanced_button.show() - self.NEVQBox.show() - self.NESQBox.show() - self.NETABox.show() - self.NEBox.show() - self.NWBox.show() - self.NBox.show() - self.SEBox.show() - self.SWBox.show() - self.SBox.show() - - self.labelbox.show() - self.window.add(self.labelbox) - def __tooltips__(self): - self.tooltips=gtk.Tooltips() - self.tooltips.set_tip(self.win_button,smplTooltipLabels[0]) - self.tooltips.set_tip(self.start_button,smplTooltipLabels[1]) - self.tooltips.set_tip(self.file_button,smplTooltipLabels[2]) - self.tooltips.set_tip(self.quit_button,smplTooltipLabels[3]) - self.tooltips.set_tip(self.v_quality,smplTooltipLabels[4]) - self.tooltips.set_tip(self.v_label,smplTooltipLabels[4]) - self.tooltips.set_tip(self.s_button,smplTooltipLabels[5]) - self.tooltips.set_tip(self.s_quality,smplTooltipLabels[6]) - self.tooltips.set_tip(self.s_label,smplTooltipLabels[6]) - self.tooltips.set_tip(self.advanced_button,smplTooltipLabels[7]) - - def __exit__(self,Event=None): - if self.exited==0: - self.update() - self.exited=1 - gtk.main_quit() - #self.values[0]=-1 - self.optionsOpen[0]=0 - self.window.destroy() - if self.save_prefs()==False: - print "Warning!!!Couldn't save preferences" - def hide(self,Event=None): - if self.image.realFrame != None and self.values[25]==0: - self.image.realFrame.window.hide() - self.window.hide() - self.hidden[0]=1 - def show(self,Event=None): - if self.image.realFrame != None and self.values[25]==0: - self.image.realFrame.window.show() - self.window.show() - self.hidden[0]=0 - def __swap_visibility__(self,widget=None,event=None): - if event.changed_mask==gtk.gdk.WINDOW_STATE_ICONIFIED: - if self.minimized==0: - self.hidden[0]=self.minimized=1 - else: - self.hidden[0]=self.minimized=0 - - def advanced(self,button=None): - if self.optionsOpen[0] ==0: - self.optionsOpen[0]=1 - self.options=pW.prefsWidget(self,self.values,self.optionsOpen) - #self.parent.show() - else: - if self.options != None: - self.options.window.destroy() - self.optionsOpen[0]=0 - def close_advanced(self): - if self.options != None: - if self.optionsOpen[0] ==1: - self.options.window.destroy() - self.optionsOpen[0]=0 - def __fileSelQuit__(self,Event=None): - self.fileSel.destroy() - - def __fileSelOk__(self,Event=None): - self.values[4]=self.fileSel.get_filename() - #self.pathEntry.set_text(self.fileSel.get_filename()) - - def __fileSelect__(self,Event=None): - self.fileSel = gtk.FileChooserDialog(title=None, - action=gtk.FILE_CHOOSER_ACTION_SAVE, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, - gtk.STOCK_SAVE,gtk.RESPONSE_OK)) - self.fileSel.set_filename(self.values[4]) - self.fileSel.show() - if self.fileSel.run() == gtk.RESPONSE_OK: - self.__fileSelOk__() - self.__fileSelQuit__() - - def __select_window__(self,button): - # check user has not disabled capture of window decoration - if self.values[21]!=1: - # else work out the size including decoration (also taking into account compiz) - p = Popen(['xwininfo','-frame'],stdout=PIPE) - pattern = re.compile('^xwininfo: Window id: (0x[0-9a-fA-F]+)') - - while True: - o = p.stdout.readline() - if o == '' and p.poll() != None: break - match = pattern.search(o) - if match: - fid = match.group(1) - break - - p = Popen(['xprop','-id',fid,'_NET_FRAME_WINDOW'],stdout=PIPE) - pattern = re.compile('^_NET_FRAME_WINDOW\(WINDOW\): window id # (0x[0-9a-fA-F]+)') - - while True: - o = p.stdout.readline() - if o == '' and p.poll() != None: break - match = pattern.search(o) - if match: - wid = match.group(1) - break - else: - print pattern - print o - - if wid: xwininfo_com = ['xwininfo','-id',wid] - else: xwininfo_com = ['xwininfo'] - p = Popen(xwininfo_com,stdout=PIPE) - wid=p.stdout.readlines() - - x=y=width=height=None - for i in wid: - if i.lstrip().startswith('Absolute upper-left X:'): - x=int(i.split(' ')[len(i.split(' '))-1]) - elif i.lstrip().startswith('Absolute upper-left Y'): - y=int(i.split(' ')[len(i.split(' '))-1]) - elif i.lstrip().startswith('Width:'): - width=int(i.split(' ')[len(i.split(' '))-1]) - elif i.lstrip().startswith('Height:'): - height=int(i.split(' ')[len(i.split(' '))-1]) - if x<0: - width+=x - x=0 - if y<0: - height+=y - y=0 - if width+x>self.wwidth: width=self.wwidth-x - if height+y>self.wheight: height=self.wheight-y - self.values[5][0]=x - self.values[5][1]=y - self.values[5][2]=width+x - self.values[5][3]=height+y - self.image.update_image() - - def __makeCons__(self): - self.advanced_button.connect("clicked",self.advanced) - self.file_button.connect("clicked",self.__fileSelect__) - self.quit_button.connect("clicked",self.__exit__) - self.start_button.connect("clicked",self.trayIcon.record_ext) - self.s_button.connect("clicked",self.__sound_check__) - self.win_button.connect("clicked",self.__select_window__) - self.window.connect("window-state-event",self.__swap_visibility__) - - def __register_shortcuts__(self): - self.advanced_button.add_accelerator("clicked",self.accel_group, - ord('P'), gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE) - self.file_button.add_accelerator("clicked",self.accel_group, - ord('S'), gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE) - self.quit_button.add_accelerator("clicked",self.accel_group, - ord('Q'), gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE) - self.start_button.add_accelerator("clicked",self.accel_group, - ord('R'), gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE) - - self.trayIcon.tray_popup.popupmenu_prefs_widget.add_accelerator( - "activate",self.accel_group, - ord('H'), gtk.gdk.CONTROL_MASK, - gtk.ACCEL_VISIBLE - ) - self.trayIcon.tray_popup.popupmenu_prefs_widget.add_accelerator( - "activate",self.accel_group, - gtk.gdk.keyval_from_name("Escape"),0, - gtk.ACCEL_VISIBLE - ) - - def __sound_check__(self,widget): - self.s_quality.set_sensitive(widget.get_active()) - self.values[2]=widget.get_active() - - def update(self) : - self.values[10]=int(round((float(self.v_quality.get_value())*63.0)/100.0)) - self.values[11]=int(round(float(self.s_quality.get_value())/10.0)) - if self.values[10]>63: - self.values[10]=63 - if self.values[11]>10: - self.values[11]=10 - def load_prefs(self): - path=os.path.join(os.getenv("HOME"),".gtk-recordmydesktop") - try: - self.values=[] - savefile=open(path,"r") - #the header - savefile.readline() - savefile.readline() - #the options,each has a coment above - for i in range(2): - savefile.readline() - self.values.append(int(savefile.readline())) - savefile.readline() - self.values.append(int(savefile.readline())==1) - savefile.readline() - self.values.append(int(savefile.readline())) - savefile.readline() - self.values.append(savefile.readline().replace("\n","")) - #recording area is not saved - self.values.append([]) - for i in range(3): - savefile.readline() - self.values.append(int(savefile.readline())) - savefile.readline() - self.values.append(savefile.readline().replace("\n","")) - for i in range(2): - savefile.readline() - self.values.append(int(savefile.readline())) - savefile.readline() - self.values.append(savefile.readline().replace("\n","")) - 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) - #loaded further bellow - 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() - self.values.append(int(savefile.readline())) - savefile.readline() - self.values.append(int(savefile.readline())==1) - #new options for 0.3.3 - p=savefile.readline() - if p=='': - self.values.append(rmdConfig.default_values[21]) - else: - self.values.append(int(savefile.readline())) - p=savefile.readline() - if p=='': - self.values.append(rmdConfig.default_values[22]) - self.values.append(rmdConfig.default_values[23]) - else: - self.values.append(int(savefile.readline())==1) - p=savefile.readline() - if p=='': - self.values.append(rmdConfig.default_values[23]) - else: - ports_t=savefile.readline().split(' ') - #get rid of the trailing \n - ports_t.pop() - self.values.append(ports_t) - p=savefile.readline() - if p=='': - self.values.append(rmdConfig.default_values[24]) - else: - self.values.append(int(savefile.readline())) - p=savefile.readline() - if p=='': - self.values.append(rmdConfig.default_values[25]) - else: - self.values.append(int(savefile.readline())) - p=savefile.readline() - if p=='': - 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 - def save_prefs(self): - try: - path=os.path.join(os.getenv("HOME"),".gtk-recordmydesktop") - savefile=open(path,"w") - savefile.write("#Order and overall number of lines must be preserved\n") - savefile.write("#For this file to be read correctly\n") - savefile.write("#Framerate\n") - savefile.write("%d\n"%self.values[0]) - savefile.write("#Cursor(0 xfixes,1 white,2 black,3 none)\n") - savefile.write("%d\n"%self.values[1]) - savefile.write("#Sound,0 disabled 1 enabled\n") - savefile.write("%d\n"%self.values[2]) - savefile.write("#Full shots,1 disabled 0 enabled\n") - savefile.write("%d\n"%self.values[3]) - savefile.write("#Filename\n") - savefile.write("%s\n"%self.values[4]) - savefile.write("#Delay,seconds\n") - savefile.write("%d\n"%self.values[6]) - savefile.write("#Number of channels\n") - savefile.write("%d\n"%self.values[7]) - savefile.write("#Frequency\n") - savefile.write("%d\n"%self.values[8]) - savefile.write("#Sound-device\n") - savefile.write("%s\n"%self.values[9]) - savefile.write("#Video quality(0-63)\n") - savefile.write("%d\n"%self.values[10]) - savefile.write("#Audio quality(0-10)\n") - savefile.write("%d\n"%self.values[11]) - savefile.write("#Display\n") - 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("#Reset capture area,1 disabled 0 enabled\n") - savefile.write("%d\n"%self.values[14]) - 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") - savefile.write("%s\n"%self.values[17]) - savefile.write("#On the fly encoding,1 disabled 0 enabled\n") - savefile.write("%d\n"%self.values[18]) - savefile.write("#Zero compression,1 disabled 0 enabled\n") - savefile.write("%d\n"%self.values[19]) - savefile.write("#overwrite existing files,0 disabled 1 enabled\n") - savefile.write("%d\n"%self.values[20]) - savefile.write("#Include window decorations,1 disabled 0 enabled\n") - savefile.write("%d\n"%self.values[21]) - savefile.write("#Use jack\n") - savefile.write("%d\n"%self.values[22]) - savefile.write("#last used jack ports\n") - for i in self.values[23]: - savefile.write("%s "%i) - savefile.write("\n") - savefile.write("#Tooltips,1 disabled 0 enabled\n") - savefile.write("%d\n"%self.values[24]) - savefile.write("#draw an on-screen frame, surrounding the capture area\n") - 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 - except: - return False - - def __init__(self): - if self.load_prefs()==False: - self.values= rmdConfig.default_values - self.optionsOpen=[0] - self.minimized=0 - self.exited=0 - self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) - self.window.connect("destroy", self.__exit__) - self.window.set_border_width(10) - self.window.set_title("recordMyDesktop") - self.__subWidgets__() - self.accel_group = gtk.AccelGroup() - self.window.add_accel_group(self.accel_group) - #self.timed_id=gobject.timeout_add(2000,self.__update_image__) - #if resolution is low let it decide size on it's own - - #if self.wwidth>640: - #self.window.set_size_request(int(self.wwidth/self.factor*2.3),-1) - #self.window.set_resizable(False) - - self.trayIcon=trayIcon(self) - self.__makeCons__() - self.__register_shortcuts__() - if self.values[24]==0: - self.__tooltips__() - self.s_quality.set_sensitive(self.values[2]) - self.s_button.set_active(self.values[2]) - self.window.show() -# wh=self.window.size_request() -# self.window.set_size_request(wh[0],wh[1]) - gtk.main() - - - - - - - - - - - diff --git a/gtk-recordmydesktop/src/rmdStrings.py b/gtk-recordmydesktop/src/rmdStrings.py deleted file mode 100644 index 9980970..0000000 --- a/gtk-recordmydesktop/src/rmdStrings.py +++ /dev/null @@ -1,112 +0,0 @@ -import locale, gettext -import rmdConfig -_ = gettext.gettext - - -gettext.textdomain('gtk-recordMyDesktop') -gettext.bindtextdomain('gtk-recordMyDesktop',rmdConfig.locale_install_dir) - - -TpmStr={'ShowHide':_("Show/hide Main Window"), - 'SelectOnScreen':_("_Select Area On Screen"), - 'Quit':_("Quit"), - 'ProgDesc':_('a graphical frontend for recordMyDesktop'), - 'Copyright': _('Copyright (C) John Varouhakis\nPortions Copyright (C) 2005-6 Zaheer Abbas Merali, John N. Laliberte\nPortions Copyright (C) Fluendo S.L.'), - 'TranslatorCredits': _('Translator Credits And Information(Replace with your info)') - } - -rmdErrStr={ - 0:_('Success'), - 1*256:_('Error while parsing the arguments.'), - 2*256:_('Initializing the encoder failed(either vorbis or theora)'), - 3*256:_('Could not open/configure sound card.'), - 4*256:_('Xdamage extension not present.'), - 5*256:_('Shared memory extension not present.'), - 6*256:_('Xfixes extension not present.'), - 7*256:_('XInitThreads failed.'), - 8*256:_('No $DISPLAY environment variable and none specified as argument.'), - 9*256:_('Cannot connect to Xserver.'), - 10*256:_('Color depth is not 24bpp.'), - 11*256:_('Improper window specification.'), - 12*256:_('Cannot attach shared memory to proccess.'), - 13*256:_('Cannot open file for writting.'), - 14*256:_('Cannot load the Jack library (dlopen/dlsym error on libjack.so).'), - 15*256:_('Cannot create new client.'), - 16*256:_('Cannot activate client.'), - 17*256:_('Port registration/connection failure.'), - 11:_('Segmentation Fault') - } -TrayIconStr={ - 'RecFinishedKnown':_("Recording is finished.\nrecordMyDesktop has exited with status"), - 'ErrDesc':_("Description"), - 'RecFinishedUnknown':_("Recording is finished.\nrecordMyDesktop has exited with uknown\nerror code") - } - - -smplLabelStrings=[_('Video Quality'),_('Sound Quality')] -smplButtonStrings=[_('Advanced'),_('Select Window')] -smplTooltipLabels=[_('Click here to select a window to record'), - _('Click to start the recording.\nThis window will hide itself.'), - _('Click to choose a filename and location.\nDefault is out.ogv in your home folder.\nIf the file already exists, the new one\nwill have a number attached on its name\n(this behavior can be changed )'), - _('Click to exit the program.'), - _('Select the video quality of your recording.\n(Lower quality will require more proccessing power,\nso it\'s recommended, when encoding on the fly,\nto leave at 100)'), - _('Enable/Disable sound recording.'), - _('Select the audio quality of your recording.'), - _('Click here to access more options.')] -smplTipLabelStrings=[_('\nLeft click and drag, on the preview image,\nto select an area for recording.\nRight click on it, to reset the area.')] - -smplStrings={ 'Record':_("Record"), - 'SaveAs':_("Save As"), - 'Quit':_("Quit") - } - -monStrings={'Cancel':_("Cancel"), - 'PleaseWait':_("Please wait while your recording is being encoded\nWARNING!!!\nIf you press Cancel or close this window,\nthis proccess cannot be resumed!"), - 'complete':_("complete") - } - -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'), - _('Follow Mouse'),_('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)'),] -prefMouseStrings=[_('Normal'),_('White'),_('Black'),_('None')] -prefStateStrings=[_('Enabled'),_('Disabled')]#0,1 -prefTabStrings=[_('Files'),_('Performance'),_('Sound'),_('Misc')] -prefTooltipLabels=[_('By default, if you try to save under a filename that already\nexists, the new file will be renamed\n(for example if you try to save as out.ogv and that file exists, your file will be named out.ogv.1).\nBy checking this box, this behavior is disabled and the old file is overwritten.\n'), - _('Directory where temporary files will be saved.'), - _('Frames Per Second'), - _('Encode simultaneously with the recording.\nThis will require a lot more processing power.\n'), - _('Do not apply compression on the temporary files.\nIf enabled, the program will need less processing power,\nin the expense of hard disk space.\nThis option is valid only when encoding on the fly is disabled.'), - _('This option, if enabled, will cause the program to require less\nprocessing power, but it might make the colors look a bit more blurry.'), - _('This option should be enabled when recording 3d windows.\nIt is also auto-enabled when recording a\nknown 3d compositing window manager.\n '), - _('Number of audio channels.'), - _('Sound frequency.'), - _('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)'), - _('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.") - -prefStrings={ 'UseJack':_("Use Jack for audio capture."), - 'SelectPorts':_("Select the ports you want to record from\n" - "(hold Ctrl to select multiple entries):"), - 'AvailablePorts':_("Available Ports"), - 'JackLspS1':_("jack_lsp returned no ports."), - 'JackLspS2':_("Make sure that jackd is running."), - 'AvailablePortsAdd':_("Available ports (double click to add):"), - 'SelectedPortsRemove':_("Selected ports (double click to remove):"), - 'Refresh':_("Refresh") -} - diff --git a/gtk-recordmydesktop/src/rmdTrayIcon.py b/gtk-recordmydesktop/src/rmdTrayIcon.py deleted file mode 100644 index 0ab0e10..0000000 --- a/gtk-recordmydesktop/src/rmdTrayIcon.py +++ /dev/null @@ -1,358 +0,0 @@ -#/********************************************************************************* -#* gtk-recordMyDesktop * -#********************************************************************************** -#* * -#* Copyright (C) 2006 John Varouhakis * -#* * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU General Public License as published by * -#* the Free Software Foundation; either version 2 of the License, or * -#* (at your option) any later version. * -#* * -#* This program is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU General Public License for more details. * -#* * -#* You should have received a copy of the GNU General Public License * -#* along with this program; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -#* * -#* * -#* * -#* For further information contact me at johnvarouhakis@gmail.com * -#**********************************************************************************/ - - -import pygtk -pygtk.require('2.0') -import gtk,gobject -import locale, gettext -import rmdConfig -import re - -_ = gettext.gettext -gettext.textdomain('gtk-recordMyDesktop') -gettext.bindtextdomain('gtk-recordMyDesktop',rmdConfig.locale_install_dir) -USE_EGG=1 -if gtk.pygtk_version[0]==2 and gtk.pygtk_version[1]>=10: - USE_EGG=0 -if USE_EGG==1: - import egg.trayicon -import rmdSelect as isel -import rmdTrayPopup as iTP -import rmdMonitor as imon -import os,signal,popen2,fcntl -from rmdStrings import * -#values struct: - -#0 fps -#1 mouse -#2 sound on/off -#3 full -#4 path -#5 area -#6 delay -#7 channels -#8 frequency -#9 device -#10 v_quality -#11 s_quality -#12 display -#13 shared memory -#14 drop-frames -#15 shared threshold -#16 quick subsampling - - -class trayIcon(object): - state=0#0 stopped,1 recording,2 paused - rmdPid=None - optionsOpen=[1] - reopen=0 - timed_id=None - def __buttonPressNoEGG_Activate__(self,widget): - self.__buttonPress__(1) - def __buttonPressNoEGG_Popup__(self,widget,button,activate_time): - self.__buttonPress__(3) - def __buttonPressEGG__(self,widget,event=None): - self.__buttonPress__(event.button) - def __set_icon__(self,widget,icon): - if USE_EGG==1: - widget.set_from_stock(icon,gtk.ICON_SIZE_SMALL_TOOLBAR) - else: - widget.set_from_stock(icon) - - - def __buttonPress__(self,button): - if button==1 and self.state>=0: - if self.state == 0: - if self.optionsOpen[0]==1: - self.parent.hide() - self.optionsOpen[0]=0 - self.reopen=1 - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_STOP,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_STOP) - self.state=1 - self.__execRMD__() - elif self.state== 1: - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_RECORD,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_RECORD) - self.state=0 - self.__stopRMD__() - elif self.state == 2 : - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_STOP,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_STOP) - self.state=1 - self.__pauseRMD__() - - - elif button == 3 and self.state>=0: - if self.state == 0: - self.tray_popup.show() - elif self.state == 1: - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_PAUSE,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_PAUSE) - self.state=2 - self.__pauseRMD__() - elif self.state ==2: - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_STOP,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_STOP) - self.state=1 - self.__pauseRMD__() - def record_ext(self,button=None): - if self.state == 0: - if self.optionsOpen[0]==1: - self.parent.hide() - self.optionsOpen[0]=0 - self.reopen=1 - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_STOP,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_STOP) - self.state=1 - self.__execRMD__() - - def __execRMD__(self): - self.parent.close_advanced() - self.parent.update() - self.ch_err="" - self.execargs=["recordmydesktop","-o",'%s'%self.parent.values[4], - "--fps","%d"%self.parent.values[0]] - if self.parent.values[2]==False : - self.execargs.append("--no-sound") - if self.parent.values[1] == 1: - self.execargs.append("--dummy-cursor") - self.execargs.append("white") - elif self.parent.values[1] == 2: - self.execargs.append("--dummy-cursor") - self.execargs.append("black") - elif self.parent.values[1] == 3: - self.execargs.append("--no-cursor") - - if self.parent.values[3] == 0: - self.execargs.append("--full-shots") - if self.parent.values[13] == 1: - self.execargs.append("--no-shared") - 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])) - self.execargs.append('--height') - self.execargs.append('%d'%(self.parent.values[5][3]-self.parent.values[5][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]) - self.execargs.append('--channels') - self.execargs.append('%d'%self.parent.values[7]) - self.execargs.append('--freq') - self.execargs.append('%d'%self.parent.values[8]) - if self.parent.values[9]!='DEFAULT': - self.execargs.append('--device') - self.execargs.append('%s'%self.parent.values[9]) - self.execargs.append('--v_quality') - self.execargs.append('%d'%self.parent.values[10]) - self.execargs.append('--s_quality') - self.execargs.append('%d'%self.parent.values[11]) - if self.parent.values[12] != "$DISPLAY": - self.execargs.append('--display') - self.execargs.append('%s'%self.parent.values[12]) - if self.parent.values[16] == 0: - self.execargs.append('--quick-subsampling') - self.execargs.append('--workdir') - self.execargs.append('%s'%self.parent.values[17]) - if self.parent.values[18] == 0: - self.execargs.append('--on-the-fly-encoding') - if self.parent.values[19] == 1: - 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]: - self.execargs.append(i) - if self.parent.values[25] == 1: - self.execargs.append('--no-frame') - if self.parent.values[26] != "": - for i in self.parent.values[26].split(" "): - if i!="": - self.execargs.append(i) - #print execargs - - self.childP=popen2.Popen3(self.execargs,"t",0) - flags = fcntl.fcntl(self.childP.childerr, fcntl.F_GETFL) - fcntl.fcntl(self.childP.childerr, fcntl.F_SETFL, flags | os.O_NONBLOCK) - self.rmdPid=self.childP.pid - self.timed_id=gobject.timeout_add(1000,self.__check_status__) - - - def __exit_status_dialog(self,status): - #first try to write down a log for examination - try: - error_log=open(os.path.join(os.getenv("HOME"),"gtk-recordMyDesktop-crash.log"),"w") - error_log.write("#This is the command given at initialization:\n") - for i in self.execargs: - error_log.write("%s "%i) - error_log.write("\n\n\n#recordMyDesktop stderror output:\n") - error_log.write(self.ch_err) - try: - for err_line in self.childP.childerr.readlines(): - error_log.write(err_line) - except: - error_log.write("Couldn't write stderror of recordMyDesktop!\n") - self.childP.childerr.close() - except: - print "Couldn't write error log.\n" - dialog = gtk.Dialog(title=None, parent=None, flags=0, buttons=None) - label1=None - try: - label1 = gtk.Label("\t\t"+TrayIconStr['RecFinishedKnown']+ - ": %d\n"%(status)+TrayIconStr['ErrDesc']+":%s\n"%(rmdErrStr[int(status)])) - except: - label1 = gtk.Label("\t\t"+TrayIconStr['RecFinishedUnknown']+": %d \n"%(status)) - dialog.vbox.pack_start(label1, True, True, 0) - label1.show() - button = gtk.Button(label=None, stock=gtk.STOCK_OK) - dialog.vbox.pack_start(button, True, True, 0) - def __destroy(button): - dialog.destroy() - button.connect("clicked", __destroy) - button.show() - dialog.set_size_request(300,128) - dialog.show() - - def __pauseRMD__(self): - os.kill(self.rmdPid,signal.SIGUSR1) - - def __stopRMD__(self,need_kill=True): - if self.timed_id!=None: - gobject.source_remove(self.timed_id) - self.timed_id=None - exit_ret=os.waitpid(self.rmdPid,os.WNOHANG) - if exit_ret[0] == 0: - if need_kill: - os.kill(self.rmdPid,signal.SIGTERM) - self.state=-1 - monitor=imon.rmdMonitor(self.childP.fromchild,self.rmdPid) - - exit_ret=os.waitpid(self.rmdPid,0) - self.state=0 - - #if exit_ret[0]==self.rmdPid: - #self.__exit_status_dialog(exit_ret[1]) - else: - self.__exit_status_dialog(exit_ret[1]) - self.rmdPid=None - if self.reopen==1: - self.parent.show() - self.optionsOpen[0]=1 - self.reopen=0 - - #print exit_ret - def __check_status__(self): - if self.rmdPid!=None: - exit_ret=os.waitpid(self.rmdPid,os.WNOHANG) - if exit_ret[0] != 0: - self.state=0 - #self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_RECORD,gtk.ICON_SIZE_SMALL_TOOLBAR) - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_RECORD) - self.__exit_status_dialog(exit_ret[1]) - self.rmdPid=None - if self.reopen==1: - self.parent.show() - self.optionsOpen[0]=1 - self.reopen=0 - return False - else: - new_stderr="" - #try: - while True: - try: - err_line=self.childP.childerr.readline() - new_stderr+=err_line - except: - break - - self.ch_err+=new_stderr - if(self.ch_err.find("STATE:RECORDING")>=0): - rp=re.compile("STATE:RECORDING") - self.ch_err=rp.sub("",self.ch_err) - print "EXTERNAL STATE CHANGE:RECORDING" - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_STOP) - self.state=1 - elif(self.ch_err.find("STATE:PAUSED")>=0): - rp=re.compile("STATE:PAUSED") - self.ch_err=rp.sub("",self.ch_err) - print "EXTERNAL STATE CHANGE:PAUSED" - self.__set_icon__(self.trayIcon,gtk.STOCK_MEDIA_PAUSE) - self.state=2 - elif(self.ch_err.find("STATE:ENCODING")>=0): - rp=re.compile("STATE:ENCODING") - self.ch_err=rp.sub("",self.ch_err) - print "EXTERNAL STATE CHANGE:ENCODING" - self.__stopRMD__(False) - return True - else: - return False - - - def __init__(self,parent): - self.parent=parent - #self.parent.values=values - if USE_EGG==1: - self.event_box = gtk.EventBox() - self.trayIcon=gtk.Image() - self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_RECORD, gtk.ICON_SIZE_SMALL_TOOLBAR) - self.event_box.add(self.trayIcon) - self.tray_container = egg.trayicon.TrayIcon("recordMyDesktop") - self.tray_container.add(self.event_box) - self.tray_popup=iTP.TrayPopupMenu(self.parent,self.parent.values,self.optionsOpen) - self.event_box.connect("button-press-event", self.__buttonPressEGG__) - self.tray_container.show_all() - else: - self.trayIcon=gtk.StatusIcon() - self.trayIcon.set_from_stock(gtk.STOCK_MEDIA_RECORD) - self.tray_popup=iTP.TrayPopupMenu(self.parent,self.parent.values,self.optionsOpen) - self.trayIcon.connect("activate",self.__buttonPressNoEGG_Activate__) - self.trayIcon.connect("popup-menu",self.__buttonPressNoEGG_Popup__) - #gtk.main() - - - - - - - - - - diff --git a/gtk-recordmydesktop/src/rmdTrayPopup.py b/gtk-recordmydesktop/src/rmdTrayPopup.py deleted file mode 100644 index a65ee8f..0000000 --- a/gtk-recordmydesktop/src/rmdTrayPopup.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 -# -# Istanbul - A desktop recorder -# Copyright (C) 2005 Zaheer Abbas Merali (zaheerabbas at merali dot org) -# Copyright (C) 2006 John N. Laliberte (allanonjl@gentoo.org) (jlaliberte@gmail.com) -# Portions Copyright (C) 2004,2005 Fluendo, S.L. (www.fluendo.com). -# All rights reserved. - - -# This file may be distributed and/or modified under the terms of -# the GNU General Public License version 2 as published by -# the Free Software Foundation. -# This file is distributed without any warranty; without even the implied -# warranty of merchantability or fitness for a particular purpose. -# See "COPYING" in the source distribution for more information. - -#gtk-recordMyDesktop - a graphical frontend for recordMyDesktop -#Copyright (C) 2006 John Varouhakis -#This file has been modified to be used in gtk-recordMyDesktop -#original file name is tray_popup.py in istanbul-0.2.1 - - -#25/11/2006: picked aboutdialog close-button fix from upstream Istanbul - -import gtk -import locale, gettext -import rmdConfig -_ = gettext.gettext -gettext.textdomain('gtk-recordMyDesktop') -gettext.bindtextdomain('gtk-recordMyDesktop',rmdConfig.locale_install_dir) -import rmdSelect as iSel -import rmdPrefsWidget as pW -from rmdStrings import * - -class TrayPopupMenu: - options=None - def __init__(self,parent,values,optionsOpen): - self.parent=parent - self.optionsOpen=optionsOpen - self.values=values - self._setup_popup_menu() - self.selector = None - self.popupmenu.show_all() - - def _setup_popup_menu(self): - self.popupmenu = gtk.Menu() - self._setup_about() - self._setup_prefs_widget() - self._setup_select_area() - self._setup_quit() - - def _prefs_widget(self,button): - if self.optionsOpen[0] ==0: - self.optionsOpen[0]=1 - #self.options=pW.prefsWidget(self.values,self.optionsOpen) - self.parent.show() - else: - #if self.options != None: - self.parent.hide() - self.optionsOpen[0]=0 - def _setup_prefs_widget(self): - self.popupmenu_prefs_widget = gtk.ImageMenuItem( - TpmStr['ShowHide']) - self.popupmenu_prefs_widget.connect('activate', self._prefs_widget) - self.popupmenu.add(self.popupmenu_prefs_widget) - - def _setup_about(self): - self.popupmenu_aboutitem = gtk.ImageMenuItem(gtk.STOCK_ABOUT) - self.popupmenu_aboutitem.connect('activate', self._about) - self.popupmenu.add(self.popupmenu_aboutitem) - - def _about(self, button): - aboutdialog = gtk.AboutDialog() - aboutdialog.set_name('gtk-recordMyDesktop') - aboutdialog.set_version(rmdConfig.VERSION) - aboutdialog.set_comments(TpmStr['ProgDesc']) - aboutdialog.set_copyright(TpmStr['Copyright']) - aboutdialog.set_authors(['recordMyDesktop and gtk-recordMyDesktop\nis written by John Varouhakis','Portions of gtk-recordMyDesktop\nare taken from Istanbul\n(http://live.gnome.org/Istanbul)\nwritten by\nZaheer Abbas Merali and John N. Laliberte']) - aboutdialog.set_website('http://recordmydesktop.sourceforge.net') - aboutdialog.set_license('GPL-2') - aboutdialog.set_translator_credits(TpmStr['TranslatorCredits']) - aboutdialog.connect('response', lambda widget, response: widget.destroy()) - aboutdialog.show_all() - - def _setup_select_area(self): - self.popupmenu_selectarea = gtk.ImageMenuItem( - TpmStr['SelectOnScreen']) - self.popupmenu.add(self.popupmenu_selectarea) - self.popupmenu_selectarea.connect("activate", self._select_area_cb) - - def _select_area_cb(self, menuitem): - self.popupmenu.hide() - self.selector = iSel.GtkAreaSelector(self.values[5]) - self.selector.show() - - def _setup_quit(self): - self.popupmenu_quititem = gtk.ImageMenuItem(gtk.STOCK_QUIT) - self.popupmenu_quititem.connect('activate', self._quit) - self.popupmenu.add(self.popupmenu_quititem) - - def _quit(self, button): - gtk.main_quit() - - def show(self): - self.popupmenu.show_all() - self.popupmenu.popup(None, None, None, 3, gtk.get_current_event_time()) - |