[pitivi: 25/28] Move the StartUpWizard key-press-event connection to startupwizard.ui
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 25/28] Move the StartUpWizard key-press-event connection to startupwizard.ui
- Date: Thu, 14 Jul 2011 16:25:18 +0000 (UTC)
commit 4da04aad02b0e8dd43390f77093dce435acaa37e
Author: Alex BÄluÈ <alexandru balut gmail com>
Date: Sun Jul 10 11:13:36 2011 +0200
Move the StartUpWizard key-press-event connection to startupwizard.ui
data/ui/startupwizard.ui | 1 +
pitivi/ui/startupwizard.py | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/startupwizard.ui b/data/ui/startupwizard.ui
index 29d7a98..40127ef 100644
--- a/data/ui/startupwizard.ui
+++ b/data/ui/startupwizard.ui
@@ -13,6 +13,7 @@
<property name="type_hint">normal</property>
<property name="skip_taskbar_hint">True</property>
<signal name="destroy_event" handler="_dialogCloseCb"/>
+ <signal name="key_press_event" handler="_keyPressCb"/>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
diff --git a/pitivi/ui/startupwizard.py b/pitivi/ui/startupwizard.py
index c539042..3f85745 100644
--- a/pitivi/ui/startupwizard.py
+++ b/pitivi/ui/startupwizard.py
@@ -49,7 +49,6 @@ class StartUpWizard(object):
self.builder.connect_signals(self)
self.window = self.builder.get_object("window1")
- self.window.connect("key-press-event", self._keypressCb)
self.recent_chooser = self.builder.get_object("recentchooser2")
# FIXME: gtk creates a combo box with only one item, but there is no
@@ -60,12 +59,14 @@ class StartUpWizard(object):
self.recent_chooser.add_filter(filter)
def _newProjectCb(self, unused_button):
+ """Handle a click on the New (Project) button."""
self.hide()
# A new project has already been created, so only display
# the Project Settings dialog.
self.app.gui.showProjectSettingsDialog()
def _loadCb(self, unused_recent_chooser):
+ """Handle a double-click on the recent chooser."""
self.app.projectManager.loadProject(self._getFileName())
def _getFileName(self):
@@ -73,11 +74,14 @@ class StartUpWizard(object):
uri = self.recent_chooser.get_current_uri()
return unquote(uri)
- def _keypressCb(self, widget, event):
- if event.keyval == gtk.keysyms.Escape: # If the user presses "Esc"
+ def _keyPressCb(self, widget, event):
+ """Handle a key press event on the dialog."""
+ if event.keyval == gtk.keysyms.Escape:
+ # The user pressed "Esc".
self.hide()
def _onBrowseButtonClickedCb(self, unused_button6):
+ """Handle a click on the Browse button."""
self.app.gui.openProject()
def _userManualCb(self, unused_button):
@@ -85,6 +89,7 @@ class StartUpWizard(object):
webbrowser.open(APPMANUALURL)
def _dialogCloseCb(self, unused_widget):
+ """Handle the closing of the dialog."""
self.hide()
def show(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]