1
# PiTiVi , Non-linear video editor
3
# pitivi/ui/screencast_managerdialog.py
5
# Copyright (c) 2008, Sarath Lakshman <sarathlakshman@slynux.org>
7
# This program is free software; you can redistribute it and/or
8
# modify it under the terms of the GNU Lesser General Public
9
# License as published by the Free Software Foundation; either
10
# version 2.1 of the License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
# Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public
18
# License along with this program; if not, write to the
19
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
# Boston, MA 02111-1307, USA.
32
from pitivi.configure import LIBDIR
34
class ScreencastManagerDialog(object):
36
def __init__(self, instance):
37
gst.log("Creating new ScreencastManager Dialog")
40
# Create gtk widget using glade model
41
if 'pitivi.exe' in __file__.lower():
42
glade_dir = LIBDIR + '\\pitivi.exe'
44
glade_dir = os.path.dirname(os.path.abspath(__file__))
45
pool_ui = gtk.glade.XML(os.path.join(glade_dir, "screencast_manager.glade"))
47
self.window = pool_ui.get_widget("screencast_window")
48
self.close_btn = pool_ui.get_widget("btn_close")
49
self.ok_btn = pool_ui.get_widget("btn_ok")
50
self.screencast_btn = pool_ui.get_widget("btn_screencast")
51
self.istanbul_btn = pool_ui.get_widget("btn_istanbul")
53
self.close_btn.connect("clicked",self.close)
54
self.ok_btn.connect("clicked",self.ok)
55
self.istanbul_btn.connect("clicked",self.start_istanbul)
56
self.screencast_btn.set_active(self.app.screencast)
63
def dbus_connect(self):
64
# Connect to istanbul dbus service
66
bus = dbus.SessionBus()
67
remote_object = bus.get_object("org.gnome.istanbul", "/state")
68
self.iface = dbus.Interface(remote_object, "org.gnome.istanbul")
69
self.istanbul_btn.hide()
70
self.screencast_btn.set_sensitive(True)
71
self.ok_btn.set_sensitive(True)
74
self.screencast_btn.set_sensitive(False)
75
self.ok_btn.set_sensitive(False)
85
def start_thread_istanbul(self):
89
# Start istanbul using thread module
90
def start_istanbul(self,w):
91
thread.start_new_thread(self.start_thread_istanbul,())
95
def screencast(self,w):
96
if self.screencast_btn.get_active():
97
self.iface.savemode(True)
98
self.app.screencast = True
100
self.iface.savemode(False)
101
self.app.screencast = False