31
32
import pitivi.instance as instance
32
33
import pitivi.configure as configure
35
from gettext import gettext as _
34
37
from timeline import TimelineWidget
35
38
from sourcefactories import SourceFactoriesWidget
36
39
from viewer import PitiviViewer
37
40
from projectsettings import ProjectSettingsDialog
38
41
from pitivi.configure import pitivi_version, APPNAME
43
D_G_INTERFACE = "/desktop/gnome/interface"
45
for gconf_dir in (D_G_INTERFACE,):
46
gconf.client_get_default ().add_dir (gconf_dir, gconf.CLIENT_PRELOAD_NONE)
40
48
class PitiviMainWindow(gtk.Window):
42
50
Pitivi's main window
62
70
def _setActions(self):
63
71
""" sets up the GtkActions """
65
("NewProject", gtk.STOCK_NEW, None, None, "Create a new project", self._newProjectCb),
66
("OpenProject", gtk.STOCK_OPEN, None, None, "Opens an existing project", self._openProjectCb),
67
("SaveProject", gtk.STOCK_SAVE, None, None, "Save the current project", self._saveProjectCb),
68
("SaveProjectAs", gtk.STOCK_SAVE_AS, None, None, "Save the current project", self._saveProjectAsCb),
69
("ProjectSettings", gtk.STOCK_PROPERTIES, "Project Settings", None, "Edit the project settings", self._projectSettingsCb),
70
("ImportSources", gtk.STOCK_ADD, "_Import Sources...", None, "Import sources to use", self._importSourcesCb),
73
("NewProject", gtk.STOCK_NEW, None, None, _("Create a new project"), self._newProjectCb),
74
("OpenProject", gtk.STOCK_OPEN, None, None, _("Open an existing project"), self._openProjectCb),
75
("SaveProject", gtk.STOCK_SAVE, None, None, _("Save the current project"), self._saveProjectCb),
76
("SaveProjectAs", gtk.STOCK_SAVE_AS, None, None, _("Save the current project"), self._saveProjectAsCb),
77
("ProjectSettings", gtk.STOCK_PROPERTIES, _("Project Settings"), None, _("Edit the project settings"), self._projectSettingsCb),
78
("ImportSources", gtk.STOCK_ADD, _("_Import Sources..."), None, _("Import sources to use"), self._importSourcesCb),
79
("ImportSourcesFolder", gtk.STOCK_ADD, _("_Import Folder of sources..."), None, _("Import folder of sources to use"), self._importSourcesFolderCb),
71
80
("Quit", gtk.STOCK_QUIT, None, None, None, self._quitCb),
72
("FullScreen", gtk.STOCK_FULLSCREEN, None, None, "View the main window on the whole screen", self._fullScreenCb),
73
("About", gtk.STOCK_ABOUT, None, None, "Information about %s" % APPNAME, self._aboutCb),
74
("File", None, "_File"),
75
("View", None, "_View"),
76
("Help", None, "_Help")
81
("FullScreen", gtk.STOCK_FULLSCREEN, None, None, _("View the main window on the whole screen"), self._fullScreenCb),
82
("About", gtk.STOCK_ABOUT, None, None, _("Information about %s") % APPNAME, self._aboutCb),
83
("File", None, _("_File")),
84
("View", None, _("_View")),
85
("Help", None, _("_Help"))
78
self.toggleactions = [
79
("AdvancedView", None, "Advanced Vie_w", None, "Switch to advanced view", self._advancedViewCb)
88
self.toggleactions = [
89
("AdvancedView", None, _("Advanced Vie_w"), None, _("Switch to advanced view"), self._advancedViewCb)
82
92
self.actiongroup = gtk.ActionGroup("mainwindow")
214
223
self.timeline.showSimpleView()
225
def _aboutResponseCb(self, dialog, unused_response):
216
228
def _aboutCb(self, unused_action):
217
229
abt = gtk.AboutDialog()
218
230
abt.set_name(APPNAME)
219
231
abt.set_version("v%s" % pitivi_version)
220
232
abt.set_website("http://www.pitivi.org/")
221
authors = ["Edward Hervey <edward@fluendo.com>" ]
233
authors = ["Edward Hervey <edward@fluendo.com>","",_("Contributors:"),
234
"Christophe Sauthier <christophe.sauthier@gmail.com> (i18n)",
235
"Laszlo Pandy <laszlok2@gmail.com> (UI)", ]
222
236
abt.set_authors(authors)
223
abt.set_license("GNU Lesser General Public License\nSee http://www.gnu.org/copyleft/lesser.html for more details")
237
abt.set_license(_("GNU Lesser General Public License\nSee http://www.gnu.org/copyleft/lesser.html for more details"))
224
238
abt.set_icon_from_file(configure.get_global_pixmap_dir() + "/pitivi.png")
239
abt.connect("response", self._aboutResponseCb)
227
242
def _importSourcesCb(self, unused_action):
228
243
self.sourcefactories.sourcelist.showImportSourcesDialog()
245
def _importSourcesFolderCb(self, unused_action):
246
self.sourcefactories.sourcelist.showImportSourcesDialog(True)
230
248
## PiTiVi main object callbacks
232
250
def _newProjectCb(self, pitivi, project):