[pitivi: 1/4] User Interface: remove remaining references to ins
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 1/4] User Interface: remove remaining references to ins
- Date: Mon, 9 Mar 2009 09:52:04 -0400 (EDT)
commit a1ec10ae060ec604ddeae3bc982f779ae18789cb
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Sun Mar 8 22:28:17 2009 -0700
User Interface: remove remaining references to instance.pitivi
---
pitivi/ui/audiofxlist.py | 6 +++---
pitivi/ui/mainwindow.py | 4 ++--
pitivi/ui/projecttabs.py | 5 +++--
pitivi/ui/propertyeditor.py | 7 +++----
pitivi/ui/screencast_managerdialog.py | 10 +++++-----
pitivi/ui/sourcelist.py | 29 +++++++++++++++--------------
pitivi/ui/videofxlist.py | 6 +++---
7 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/pitivi/ui/audiofxlist.py b/pitivi/ui/audiofxlist.py
index 0bd4631..1982b47 100644
--- a/pitivi/ui/audiofxlist.py
+++ b/pitivi/ui/audiofxlist.py
@@ -21,7 +21,6 @@
import gtk
import pango
-import pitivi.instance as instance
from gettext import gettext as _
"""
@@ -31,9 +30,10 @@ Audio FX list widgets
class AudioFxList(gtk.VBox):
""" Widget for listing video effects """
- def __init__(self):
+ def __init__(self, instance):
gtk.VBox.__init__(self)
self.set_border_width(5)
+ self.app = instance
# model
self.storemodel = gtk.ListStore(str, str, object)
@@ -64,7 +64,7 @@ class AudioFxList(gtk.VBox):
self._fillUpModel()
def _fillUpModel(self):
- for factory in instance.PiTiVi.effects.simple_audio:
+ for factory in self.app.effects.simple_audio:
self.storemodel.append([factory.get_longname(),
factory.get_description(),
factory])
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index 87437fb..882538b 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -297,7 +297,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
vpaned.pack2(self.timeline, resize=True, shrink=False)
hpaned = gtk.HPaned()
vpaned.pack1(hpaned, resize=False, shrink=True)
- self.projecttabs = ProjectTabs()
+ self.projecttabs = ProjectTabs(self.app)
self._connectToSourceList()
hpaned.pack1(self.projecttabs, resize=True, shrink=False)
@@ -542,7 +542,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
# screencast callback
def _Screencast(self,unused_action):
from screencast_managerdialog import ScreencastManagerDialog
- ScreencastManagerDialog()
+ ScreencastManagerDialog(self.app)
## Devices changed
def __deviceChangeCb(self, probe, unused_device):
diff --git a/pitivi/ui/projecttabs.py b/pitivi/ui/projecttabs.py
index b4a49ff..5c66a41 100644
--- a/pitivi/ui/projecttabs.py
+++ b/pitivi/ui/projecttabs.py
@@ -69,9 +69,10 @@ class ProjectTabs(gtk.Notebook):
# (PropertyEditor, _("Properties")),
)
- def __init__(self):
+ def __init__(self, instance):
""" initialize """
gtk.Notebook.__init__(self)
+ self.app = instance
self._full_list = []
self.connect("switch-page", self.__switchPage)
self._createUi()
@@ -80,7 +81,7 @@ class ProjectTabs(gtk.Notebook):
""" set up the gui """
self.set_tab_pos(gtk.POS_TOP)
for component, label in self.__DEFAULT_COMPONENTS__:
- self.addComponent(component(), label)
+ self.addComponent(component(self.app), label)
def addComponent(self, component, label):
self.append_page(component, DetachLabel(self, component, label))
diff --git a/pitivi/ui/propertyeditor.py b/pitivi/ui/propertyeditor.py
index a1d5e92..9adeca1 100644
--- a/pitivi/ui/propertyeditor.py
+++ b/pitivi/ui/propertyeditor.py
@@ -24,7 +24,6 @@ Editor for aribtrary properties of timeline objects
"""
import gtk
-import pitivi.instance as instance
from gettext import gettext as _
from pitivi.receiver import receiver, handler
from pitivi.utils import same
@@ -36,10 +35,10 @@ class PropertyEditor(gtk.ScrolledWindow):
}
- def __init__(self, *args, **kwargs):
+ def __init__(self, instance, *args, **kwargs):
gtk.ScrolledWindow.__init__(self, *args, **kwargs)
- self.instance = instance.PiTiVi
- self.timeline = instance.PiTiVi.current.timeline
+ self.instance = instance
+ self.timeline = instance.current.timeline
self.__createUi()
self.__selectionChangedCb(self.timeline)
self.__module_instances = {}
diff --git a/pitivi/ui/screencast_managerdialog.py b/pitivi/ui/screencast_managerdialog.py
index 4752971..c3f6aa0 100644
--- a/pitivi/ui/screencast_managerdialog.py
+++ b/pitivi/ui/screencast_managerdialog.py
@@ -22,7 +22,6 @@
import gtk
import os
import gtk.glade
-from pitivi import instance
import gst
import dbus
import dbus.service
@@ -33,8 +32,9 @@ import time
class ScreencastManagerDialog(object):
- def __init__(self):
+ def __init__(self, instance):
gst.log("Creating new ScreencastManager Dialog")
+ self.app = instance
# Create gtk widget using glade model
glade_dir = os.path.dirname(os.path.abspath(__file__))
@@ -49,7 +49,7 @@ class ScreencastManagerDialog(object):
self.close_btn.connect("clicked",self.close)
self.ok_btn.connect("clicked",self.ok)
self.istanbul_btn.connect("clicked",self.start_istanbul)
- self.screencast_btn.set_active(instance.PiTiVi.screencast)
+ self.screencast_btn.set_active(self.app.screencast)
self.dbus_connect()
@@ -91,7 +91,7 @@ class ScreencastManagerDialog(object):
def screencast(self,w):
if self.screencast_btn.get_active():
self.iface.savemode(True)
- instance.PiTiVi.screencast = True
+ self.app.screencast = True
else:
self.iface.savemode(False)
- instance.PiTiVi.screencast = False
+ self.app.screencast = False
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index d52c38a..3092663 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -30,7 +30,6 @@ from urllib import unquote
from gettext import gettext as _
from gettext import ngettext
-import pitivi.instance as instance
import pitivi.ui.dnd as dnd
from pitivi.ui.pathwalker import PathWalker
from pitivi.ui.filelisterrordialog import FileListErrorDialog
@@ -117,10 +116,12 @@ class SourceList(gtk.VBox, Loggable):
(gobject.TYPE_PYOBJECT,))
}
- def __init__(self):
+ def __init__(self, instance):
gtk.VBox.__init__(self)
Loggable.__init__(self)
+ self.app = instance
+
# Store
# icon, infotext, objectfactory, uri, length
self.storemodel = gtk.ListStore(gtk.gdk.Pixbuf, str, object, str, str)
@@ -230,10 +231,10 @@ class SourceList(gtk.VBox, Loggable):
# Connect to project. We must remove and reset the callbacks when
# changing project.
self.project_signals = SignalGroup()
- self._connectToProject(instance.PiTiVi.current)
- instance.PiTiVi.connect("new-project-loaded",
+ self._connectToProject(self.app.current)
+ self.app.connect("new-project-loaded",
self._newProjectLoadedCb)
- instance.PiTiVi.connect("new-project-failed",
+ self.app.connect("new-project-failed",
self._newProjectFailedCb)
# default pixbufs
@@ -268,7 +269,7 @@ class SourceList(gtk.VBox, Loggable):
)
self.actiongroup = gtk.ActionGroup("sourcelist")
self.actiongroup.add_actions(actions)
- uiman = instance.PiTiVi.gui.uimanager
+ uiman = self.app.gui.uimanager
uiman.insert_action_group(self.actiongroup, 0)
uiman.add_ui_from_string(ui)
@@ -363,7 +364,7 @@ class SourceList(gtk.VBox, Loggable):
chooser_action = gtk.FILE_CHOOSER_ACTION_OPEN
dialogtitle = _("Import a clip")
close_after = gtk.CheckButton(_("Close after importing files"))
- close_after.set_active(instance.PiTiVi.settings.closeImportDialog)
+ close_after.set_active(self.app.settings.closeImportDialog)
self._importDialog = gtk.FileChooserDialog(dialogtitle, None,
chooser_action,
@@ -373,7 +374,7 @@ class SourceList(gtk.VBox, Loggable):
self._importDialog.set_default_response(gtk.RESPONSE_OK)
self._importDialog.set_select_multiple(True)
self._importDialog.set_modal(False)
- self._importDialog.set_current_folder(instance.PiTiVi.settings.lastImportFolder)
+ self._importDialog.set_current_folder(self.app.settings.lastImportFolder)
self._importDialog.connect('response', self._dialogBoxResponseCb, select_folders)
self._importDialog.connect('close', self._dialogBoxCloseCb)
@@ -381,11 +382,11 @@ class SourceList(gtk.VBox, Loggable):
def addFiles(self, files):
""" Add files to the list """
- instance.PiTiVi.current.sources.addUris(files)
+ self.app.current.sources.addUris(files)
def addFolders(self, folders):
""" walks the trees of the folders in the list and adds the files it finds """
- instance.PiTiVi.threads.addThread(PathWalker, folders, instance.PiTiVi.current.sources.addUris)
+ self.app.threads.addThread(PathWalker, folders, self.app.current.sources.addUris)
def _addFactory(self, factory):
video = factory.getOutputStreams(VideoStream)
@@ -473,15 +474,15 @@ class SourceList(gtk.VBox, Loggable):
self.debug("response:%r", response)
if response == gtk.RESPONSE_OK:
lastfolder = dialogbox.get_current_folder()
- instance.PiTiVi.settings.lastImportFolder = lastfolder
- instance.PiTiVi.settings.closeImportDialog = \
+ self.app.settings.lastImportFolder = lastfolder
+ self.app.settings.closeImportDialog = \
dialogbox.props.extra_widget.get_active()
filenames = dialogbox.get_uris()
if select_folders:
self.addFolders(filenames)
else:
self.addFiles(filenames)
- if instance.PiTiVi.settings.closeImportDialog:
+ if self.app.settings.closeImportDialog:
dialogbox.destroy()
self._importDialog = None
else:
@@ -510,7 +511,7 @@ class SourceList(gtk.VBox, Loggable):
selected.sort(reverse=True)
for path in selected:
uri = model[path][COL_URI]
- del instance.PiTiVi.current.sources[uri]
+ del self.app.current.sources[uri]
def _playButtonClickedCb(self, unused_widget):
""" Called when a user clicks on the play button """
diff --git a/pitivi/ui/videofxlist.py b/pitivi/ui/videofxlist.py
index 2ca8cdf..c24f794 100644
--- a/pitivi/ui/videofxlist.py
+++ b/pitivi/ui/videofxlist.py
@@ -25,7 +25,6 @@ Video effects list widget
import gtk
import pango
-import pitivi.instance as instance
from gettext import gettext as _
(COL_NAME,
@@ -35,9 +34,10 @@ from gettext import gettext as _
class VideoFxList(gtk.VBox):
""" Widget for listing video effects """
- def __init__(self):
+ def __init__(self, instance):
gtk.VBox.__init__(self)
self.set_border_width(5)
+ self.app = instance
# model
self.storemodel = gtk.ListStore(str, str, object)
@@ -68,7 +68,7 @@ class VideoFxList(gtk.VBox):
self._fillUpModel()
def _fillUpModel(self):
- for factory in instance.PiTiVi.effects.simple_video:
+ for factory in self.app.effects.simple_video:
self.storemodel.append([factory.get_longname(),
factory.get_description(),
factory])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]