1
"""Dialog box to quickstart Pitivi"""
7
from pitivi.configure import LIBDIR
8
from projectsettings import ProjectSettingsDialog
9
from pitivi.configure import APPMANUALURL
11
from urllib import unquote
13
class StartUpWizard(object):
14
"""A Wizard displaying recent projects and allowing the user to either:
16
load one, skip,see the quick start manual or
18
configure a new project with the settings dialog.
22
def __init__(self, app):
23
if 'pitivi.exe' in __file__.lower():
26
glade_dir = os.path.dirname(os.path.abspath(__file__))
28
self.builder = gtk.Builder()
29
gladefile = os.path.join(glade_dir, "startupwizard.glade")
30
self.builder.add_from_file(gladefile)
31
self.builder.connect_signals(self)
33
self.window = self.builder.get_object("window1")
34
self.window.connect("key-press-event", self._keypressCb)
36
chooser = self.builder.get_object("recentchooser2")
37
# FIXME: gtk creates a combo box with only one item, but there is no
38
# simple way to hide it.
39
filtre = gtk.RecentFilter()
40
filtre.set_name("Projects")
41
filtre.add_pattern("*.xptv")
42
chooser.add_filter(filtre)
44
def _newProjectCb(self, unused_button4):
46
self.app.gui.showProjectSettingsDialog()
48
def _loadCb(self, unused_button3):
49
self.data = unquote(self.data)
50
self.app.projectManager.loadProject(self.data)
52
def _keypressCb(self, widget, event):
53
if event.keyval == gtk.keysyms.Escape: # If the user presses "Esc"
56
def _onBrowseButtonClickedCb(self, unused_button6):
57
self.app.gui.openProject()
59
def _getFileNameCb(self, chooser):
60
self.data = chooser.get_current_uri()
63
def _quick_start_manual(self, unused_button5):
64
webbrowser.open(APPMANUALURL)
66
def _dialogCloseCb(self, unused_widget):
70
self.window.set_transient_for(self.app.gui)
72
self.window.grab_focus()