After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 421652 - render button should be in the main toolbar
render button should be in the main toolbar
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: User interface
Git
Other Linux
: Normal normal
: 0.10.3
Assigned To: Pitivi maintainers
Pitivi maintainers
: 352402 (view as bug list)
Depends on:
Blocks: 337894
 
 
Reported: 2007-03-22 21:14 UTC by Jean-François Fortin Tam
Modified: 2007-04-23 11:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch proposal to move the renderer's button (15.44 KB, patch)
2007-04-20 16:23 UTC, Thibaut GIRKA
none Details | Review
New patch proposal, smallest and cleanier code. Override the (15.50 KB, patch)
2007-04-20 16:46 UTC, Thibaut GIRKA
none Details | Review
Again, a corrected patch. (15.85 KB, patch)
2007-04-20 17:00 UTC, Thibaut GIRKA
committed Details | Review

Description Jean-François Fortin Tam 2007-03-22 21:14:22 UTC
The "Render" button (which currently uses the stock GTK "record" icon...) needs to be in the main toolbar at the top, not in the playback toolbar.

The reasoning behind this is that rendering is a "project-wide" action, or at least that applies to a portion of the timeline (when implemented). Rendering does not apply to the individual video clip, and putting that button near the playback controls is bad for usability.

As the "render" functionality is important, I would recommend setting this new gtk toolbar button as "is_important", because having text underneath it would help newbies.
Comment 1 Thibaut GIRKA 2007-04-20 16:23:34 UTC
Created attachment 86705 [details] [review]
Patch proposal to move the renderer's button
Comment 2 Thibaut GIRKA 2007-04-20 16:37:27 UTC
Comment on attachment 86705 [details] [review]
Patch proposal to move the renderer's button

Index: pitivi/ui/viewer.py
===================================================================
--- pitivi/ui/viewer.py (révision 928)
+++ pitivi/ui/viewer.py (copie de travail)
@@ -119,11 +119,6 @@
         boxalign.add(bbox)
         self.pack_start(boxalign, expand=False)
 
-        self.record_button = gtk.ToolButton(gtk.STOCK_MEDIA_RECORD)
-        self.record_button.connect("clicked", self._recordCb)
-        self.record_button.set_sensitive(False)
-        bbox.pack_start(self.record_button, expand=False)
-
         self.rewind_button = gtk.ToolButton(gtk.STOCK_MEDIA_REWIND)
         self.rewind_button.connect("clicked", self._rewindCb)
         self.rewind_button.set_sensitive(False)
@@ -314,7 +309,6 @@
     def _asyncTimelineDurationChanged(self, duration):
         gst.debug("duration : %d" % duration)
         # deactivate record button is the duration is null
-        self.record_button.set_sensitive((duration > 0) and True or False)
 
         self.posadjust.upper = float(duration)
         self.timelabel.set_markup("<tt>%s / %s</tt>" % (time_to_string(self.current_time), time_to_string(instance.PiTiVi.playground.current.length)))
@@ -366,18 +360,6 @@
 
     ## Control gtk.Button callbacks
 
-    def _encodingDialogDestroyCb(self, unused_dialog):
-        instance.PiTiVi.gui.set_sensitive(True)
-
-    def _recordCb(self, unused_button):
-        # pause timeline !
-        instance.PiTiVi.playground.pause()
-
-        win = EncodingDialog(instance.PiTiVi.current)
-        win.window.connect("destroy", self._encodingDialogDestroyCb)
-        instance.PiTiVi.gui.set_sensitive(False)
-        win.show()
-
     def _rewindCb(self, unused_button):
         pass
 
@@ -411,20 +393,14 @@
             self.playpause_button.set_sensitive(False)
             self.next_button.set_sensitive(False)
             self.back_button.set_sensitive(False)
-            self.record_button.set_sensitive(False)
         else:
             if isinstance(smartbin, SmartTimelineBin):
                 gst.info("switching to Timeline, setting duration to %s" % (gst.TIME_ARGS(smartbin.project.timeline.videocomp.duration)))
                 self.posadjust.upper = float(smartbin.project.timeline.videocomp.duration)
                 smartbin.project.timeline.videocomp.connect("start-duration-changed",
                                                             self._timelineDurationChangedCb)
-                if smartbin.project.timeline.videocomp.duration > 0:
-                    self.record_button.set_sensitive(True)
-                else:
-                    self.record_button.set_sensitive(False)
             else:
                 self.posadjust.upper = float(smartbin.factory.length)
-                self.record_button.set_sensitive(False)
             self._newTime(0)
             self.slider.set_sensitive(True)
             self.playpause_button.set_sensitive(True)
@@ -524,99 +500,4 @@
             self.playing = True
 
 
-class EncodingDialog(GladeWindow):
-    """ Encoding dialog box """
-    glade_file = "encodingdialog.glade"
 
-    def __init__(self, project):
-        GladeWindow.__init__(self)
-        self.project = project
-        self.bin = project.getBin()
-        self.bus = self.bin.get_bus()
-        self.bus.add_signal_watch()
-        self.eosid = self.bus.connect("message::eos", self._eosCb)
-        self.outfile = None
-        self.progressbar = self.widgets["progressbar"]
-        self.cancelbutton = self.widgets["cancelbutton"]
-        self.recordbutton = self.widgets["recordbutton"]
-        self.recordbutton.set_sensitive(False)
-        self.positionhandler = 0
-        self.rendering = False
-        self.settings = project.getSettings()
-        self.timestarted = 0
-        self.vinfo = self.widgets["videoinfolabel"]
-        self.ainfo = self.widgets["audioinfolabel"]
-        self._displaySettings()
-
-    def _displaySettings(self):
-        self.vinfo.set_markup(self.settings.getVideoDescription())
-        self.ainfo.set_markup(self.settings.getAudioDescription())
-
-    def _fileButtonClickedCb(self, button):
-
-        dialog = gtk.FileChooserDialog(title=_("Choose file to render to"),
-                                       parent=self.window,
-                                       buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
-                                                gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT),
-                                       action=gtk.FILE_CHOOSER_ACTION_SAVE)
-        if self.outfile:
-            dialog.set_current_name(self.outfile)
-        res = dialog.run()
-        dialog.hide()
-        if res == gtk.RESPONSE_ACCEPT:
-            self.outfile = dialog.get_uri()
-            button.set_label(os.path.basename(self.outfile))
-            self.recordbutton.set_sensitive(True)
-            self.progressbar.set_text(_(""))
-        dialog.destroy()
-
-    def _positionCb(self, unused_playground, unused_smartbin, position):
-        timediff = time.time() - self.timestarted
-        self.progressbar.set_fraction(float(position) / float(self.bin.length))
-        if timediff > 5.0:
-            # only display ETA after 5s in order to have enough averaging
-            totaltime = (timediff * float(self.bin.length) / float(position)) - timediff
-            self.progressbar.set_text(_("Finished in %dm%ds") % (int(totaltime) / 60,
-                                                              int(totaltime) % 60))
-
-    def _recordButtonClickedCb(self, unused_button):
-        if self.outfile and not self.rendering:
-            if self.bin.record(self.outfile, self.settings):
-                self.timestarted = time.time()
-                self.positionhandler = instance.PiTiVi.playground.connect('position', self._positionCb)
-                self.rendering = True
-                self.cancelbutton.set_label("gtk-cancel")
-                self.progressbar.set_text(_("Rendering"))
-            else:
-                self.progressbar.set_text(_("Couldn't start rendering"))
-
-    def _settingsButtonClickedCb(self, unused_button):
-        dialog = ExportSettingsDialog(self.settings)
-        res = dialog.run()
-        dialog.hide()
-        if res == gtk.RESPONSE_ACCEPT:
-            self.settings = dialog.getSettings()
-            self._displaySettings()
-        dialog.destroy()
-
-    def do_destroy(self):
-        gst.debug("cleaning up...")
-        self.bus.remove_signal_watch()
-        gobject.source_remove(self.eosid)
-
-    def _eosCb(self, unused_bus, unused_message):
-        self.rendering = False
-        if self.positionhandler:
-            instance.PiTiVi.playground.disconnect(self.positionhandler)
-            self.positionhandler = 0
-        self.progressbar.set_text(_("Rendering Complete"))
-        self.progressbar.set_fraction(1.0)
-        self.cancelbutton.set_label("gtk-close")
-
-    def _cancelButtonClickedCb(self, unused_button):
-        self.bin.stopRecording()
-        if self.positionhandler:
-            instance.PiTiVi.playground.disconnect(self.positionhandler)
-            self.positionhandler = 0
-        instance.PiTiVi.playground.pause()
-        self.destroy()
Index: pitivi/ui/actions.xml
===================================================================
--- pitivi/ui/actions.xml       (révision 928)
+++ pitivi/ui/actions.xml       (copie de travail)
@@ -9,6 +9,7 @@
       <separator />
       <menuitem action="ImportSources" />
       <menuitem action="ImportSourcesFolder" />
+      <menuitem action="RenderProject" />
       <separator />
       <menuitem action="Quit" />
     </menu>
@@ -30,5 +31,6 @@
     <separator />
     <toolitem action="FullScreen" />
     <toolitem action="AdvancedView" />
+    <toolitem action="RenderProject" />
   </toolbar>
 </ui>
Index: pitivi/ui/mainwindow.py
===================================================================
--- pitivi/ui/mainwindow.py     (révision 928)
+++ pitivi/ui/mainwindow.py     (copie de travail)
@@ -42,8 +42,10 @@
 from timeline import TimelineWidget
 from sourcefactories import SourceFactoriesWidget
 from viewer import PitiviViewer
+from pitivi.bin import SmartTimelineBin
 from projectsettings import ProjectSettingsDialog
 from pitivi.configure import pitivi_version, APPNAME
+from glade import GladeWindow
 
 if have_gconf:
     D_G_INTERFACE = "/desktop/gnome/interface"
@@ -57,6 +59,7 @@
     Pitivi's main window
     """
 
+
     def __init__(self):
         """ initialize with the Pitivi object """
         gst.log("Creating MainWindow")
@@ -75,6 +78,31 @@
         instance.PiTiVi.playground.connect("error", self._playGroundErrorCb)
         self.show_all()
 
+    def _encodingDialogDestroyCb(self, unused_dialog):
+        instance.PiTiVi.gui.set_sensitive(True)
+
+    def _recordCb(self, unused_button):
+        # pause timeline !
+        instance.PiTiVi.playground.pause()
+
+        win = EncodingDialog(instance.PiTiVi.current)
+        win.window.connect("destroy", self._encodingDialogDestroyCb)
+        instance.PiTiVi.gui.set_sensitive(False)
+        win.show()
+
+    def _currentPlaygroundChangedCb(self, playground, smartbin):
+       if smartbin == playground.default:
+           self.render_button.set_sensitive(False)
+        else:
+            if isinstance(smartbin, SmartTimelineBin):
+                gst.info("switching to Timeline, setting duration to %s" % (gst.TIME_ARGS(smartbin.project.timeline.videocomp.duration)))
+                if smartbin.project.timeline.videocomp.duration > 0:
+                   self.render_button.set_sensitive(True)
+                else:
+                   self.render_button.set_sensitive(False)
+            else:
+               self.render_button.set_sensitive(True)
+
     def _createStockIcons(self):
         """ Creates the pitivi-only stock icons """
         gtk.stock_add([('pitivi-advanced-mode', 'Advanced Mode', 0, 0, 'pitivi')])
@@ -95,6 +123,7 @@
             ("ProjectSettings", gtk.STOCK_PROPERTIES, _("Project Settings"), None, _("Edit the project settings"), self._projectSettingsCb),
             ("ImportSources", gtk.STOCK_ADD, _("_Import Sources..."), None, _("Import sources to use"), self._importSourcesCb),
             ("ImportSourcesFolder", gtk.STOCK_ADD, _("_Import Folder of sources..."), None, _("Import folder of sources to use"), self._importSourcesFolderC
b),
+           ("RenderProject", gtk.STOCK_MEDIA_RECORD, _("_Render project"), None, _("Render project"), self._recordCb),
             ("Quit", gtk.STOCK_QUIT, None, None, None, self._quitCb),
             ("FullScreen", gtk.STOCK_FULLSCREEN, None, None, _("View the main window on the whole screen"), self._fullScreenCb),
             ("About", gtk.STOCK_ABOUT, None, None, _("Information about %s") % APPNAME, self._aboutCb),
@@ -114,6 +143,8 @@
         # deactivating non-functional actions
         # FIXME : reactivate them
         for action in self.actiongroup.list_actions():
+            if action.get_name() == "RenderProject":
+                self.render_button = action;
             if action.get_name() in ["ProjectSettings", "Quit", "File", "Help",
                                      "About", "View", "FullScreen", "ImportSources",
                                      "ImportSourcesFolder", "AdvancedView"]:
@@ -164,6 +195,8 @@
         # Viewer
         self.viewer = PitiviViewer()
 
+       instance.PiTiVi.playground.connect("current-changed", self._currentPlaygroundChangedCb)
+
         hpaned.pack1(self.sourcefactories, resize=False, shrink=False)
         hpaned.pack2(self.viewer, resize=True, shrink=False)
 
@@ -278,3 +311,100 @@
 
     def _notProjectCb(self, pitivi, uri):
         raise NotImplementedError
+
+class EncodingDialog(GladeWindow):
+    """ Encoding dialog box """
+    glade_file = "encodingdialog.glade"
+
+    def __init__(self, project):
+        GladeWindow.__init__(self)
+        self.project = project
+        self.bin = project.getBin()
+        self.bus = self.bin.get_bus()
+        self.bus.add_signal_watch()
+        self.eosid = self.bus.connect("message::eos", self._eosCb)
+        self.outfile = None
+        self.progressbar = self.widgets["progressbar"]
+        self.cancelbutton = self.widgets["cancelbutton"]
+        self.recordbutton = self.widgets["recordbutton"]
+        self.recordbutton.set_sensitive(False)
+        self.positionhandler = 0
+        self.rendering = False
+        self.settings = project.getSettings()
+        self.timestarted = 0
+        self.vinfo = self.widgets["videoinfolabel"]
+        self.ainfo = self.widgets["audioinfolabel"]
+        self._displaySettings()
+
+    def _displaySettings(self):
+        self.vinfo.set_markup(self.settings.getVideoDescription())
+        self.ainfo.set_markup(self.settings.getAudioDescription())
+
+    def _fileButtonClickedCb(self, button):
+
+        dialog = gtk.FileChooserDialog(title=_("Choose file to render to"),
+                                       parent=self.window,
+                                       buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
+                                                gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT),
+                                       action=gtk.FILE_CHOOSER_ACTION_SAVE)
+        if self.outfile:
+            dialog.set_current_name(self.outfile)
+        res = dialog.run()
+        dialog.hide()
+        if res == gtk.RESPONSE_ACCEPT:
+            self.outfile = dialog.get_uri()
+            button.set_label(os.path.basename(self.outfile))
+            self.recordbutton.set_sensitive(True)
+            self.progressbar.set_text(_(""))
+        dialog.destroy()
+
+    def _positionCb(self, unused_playground, unused_smartbin, position):
+        timediff = time.time() - self.timestarted
+        self.progressbar.set_fraction(float(position) / float(self.bin.length))
+        if timediff > 5.0:
+            # only display ETA after 5s in order to have enough averaging
+            totaltime = (timediff * float(self.bin.length) / float(position)) - timediff
+            self.progressbar.set_text(_("Finished in %dm%ds") % (int(totaltime) / 60,
+                                                              int(totaltime) % 60))
+
+    def _recordButtonClickedCb(self, unused_button):
+        if self.outfile and not self.rendering:
+            if self.bin.record(self.outfile, self.settings):
+                self.timestarted = time.time()
+                self.positionhandler = instance.PiTiVi.playground.connect('position', self._positionCb)
+                self.rendering = True
+                self.cancelbutton.set_label("gtk-cancel")
+                self.progressbar.set_text(_("Rendering"))
+            else:
+                self.progressbar.set_text(_("Couldn't start rendering"))
+
+    def _settingsButtonClickedCb(self, unused_button):
+        dialog = ExportSettingsDialog(self.settings)
+        res = dialog.run()
+        dialog.hide()
+        if res == gtk.RESPONSE_ACCEPT:
+            self.settings = dialog.getSettings()
+            self._displaySettings()
+        dialog.destroy()
+
+    def do_destroy(self):
+        gst.debug("cleaning up...")
+        self.bus.remove_signal_watch()
+        gobject.source_remove(self.eosid)
+
+    def _eosCb(self, unused_bus, unused_message):
+        self.rendering = False
+        if self.positionhandler:
+            instance.PiTiVi.playground.disconnect(self.positionhandler)
+            self.positionhandler = 0
+        self.progressbar.set_text(_("Rendering Complete"))
+        self.progressbar.set_fraction(1.0)
+        self.cancelbutton.set_label("gtk-close")
+
+    def _cancelButtonClickedCb(self, unused_button):
+        self.bin.stopRecording()
+        if self.positionhandler:
+            instance.PiTiVi.playground.disconnect(self.positionhandler)
+            self.positionhandler = 0
+        instance.PiTiVi.playground.pause()
+        self.destroy()
Comment 3 Thibaut GIRKA 2007-04-20 16:46:10 UTC
Created attachment 86707 [details] [review]
New patch proposal, smallest and cleanier code. Override the
Comment 4 Thibaut GIRKA 2007-04-20 17:00:19 UTC
Created attachment 86708 [details] [review]
Again, a corrected patch.
Comment 5 Edward Hervey 2007-04-23 10:21:38 UTC
Patch commited. Thanks a lot.

2007-04-23  Edward Hervey  <edward@fluendo.com>

	* pitivi/ui/actions.xml:
	* pitivi/ui/mainwindow.py:
	* pitivi/ui/viewer.py:
	Move render button to toolbar/menu.
	Patch by: Thibaut Girka <thibaut.girka@gmail.com>
	Fixes #421652
	* pitivi/pixmaps/pitivi-file.png:
	* pitivi/pixmaps/pitivi-sound.png:
	Remove no longer used icons.
	* pitivi/pixmaps/pitivi-advanced.png:
	* pitivi/pixmaps/pitivi-advanced-22.png:
	* pitivi/pixmaps/pitivi-advanced-24.png:
	* pitivi/pixmaps/pitivi-render-22.png:
	* pitivi/pixmaps/pitivi-render-24.png:
	Rename icons.
	New render icon by Andreas Nilsson.

Comment 6 Edward Hervey 2007-04-23 11:32:31 UTC
*** Bug 352402 has been marked as a duplicate of this bug. ***