[pitivi/1.0] render: Allow opening the folder of the rendered file
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/1.0] render: Allow opening the folder of the rendered file
- Date: Wed, 14 Mar 2018 07:11:46 +0000 (UTC)
commit 61f9c817f1599696cdfdf2c5b0d4e307317bb9c7
Author: Sivakar Sithamparanathan <sivakar12 outlook com>
Date: Sat Mar 10 15:51:19 2018 +0530
render: Allow opening the folder of the rendered file
Fixes #2141
data/ui/renderingprogress.ui | 54 ++++++++++++++++++++++++++++----------------
pitivi/render.py | 9 ++++++++
2 files changed, 44 insertions(+), 19 deletions(-)
---
diff --git a/data/ui/renderingprogress.ui b/data/ui/renderingprogress.ui
index cb8ddf5f..dc2c6730 100644
--- a/data/ui/renderingprogress.ui
+++ b/data/ui/renderingprogress.ui
@@ -17,23 +17,6 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="informational_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="opacity">0.69999999999999996</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><small>This process may take a long time
depending on the selected codecs, the image resolution, your computer's processing power, applied effects and
the length of your movie.</small></property>
- <property name="use_markup">True</property>
- <property name="wrap">True</property>
- <property name="width_chars">50</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
@@ -79,6 +62,22 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="show_in_file_manager_button">
+ <property name="label" translatable="yes">Open Folder</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="_show_in_file_manager_button_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
@@ -92,7 +91,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
@@ -103,6 +102,23 @@
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="informational_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="opacity">0.69999999999999996</property>
+ <property name="label" translatable="yes"><small>This process may take a long time
depending on the selected codecs, the image resolution, your computer's processing power, applied effects and
the length of your movie.</small></property>
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ <property name="width_chars">50</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkProgressBar" id="progressbar">
<property name="visible">True</property>
@@ -136,8 +152,8 @@
<child>
<object class="GtkLabel" id="estimated_filesize_label">
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Estimated filesize:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/pitivi/render.py b/pitivi/render.py
index 74b87aac..e0c0be22 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -18,6 +18,7 @@
# Boston, MA 02110-1301, USA.
"""Rendering-related classes and utilities."""
import os
+import posixpath
import time
from gettext import gettext as _
@@ -312,6 +313,8 @@ class RenderingProgressDialog(GObject.Object):
self.play_rendered_file_button = self.builder.get_object(
"play_rendered_file_button")
self.close_button = self.builder.get_object("close_button")
+ self.show_in_file_manager_button = self.builder.get_object(
+ "show_in_file_manager_button")
self.cancel_button = self.builder.get_object("cancel_button")
self._filesize_est_label = self.builder.get_object(
"estimated_filesize_label")
@@ -325,6 +328,7 @@ class RenderingProgressDialog(GObject.Object):
# We will only show the close/play buttons when the render is done:
self.play_rendered_file_button.hide()
self.close_button.hide()
+ self.show_in_file_manager_button.hide()
def updatePosition(self, fraction):
self.progressbar.set_fraction(fraction)
@@ -369,6 +373,10 @@ class RenderingProgressDialog(GObject.Object):
def _playRenderedFileButtonClickedCb(self, unused_button):
Gio.AppInfo.launch_default_for_uri(self.main_render_dialog.outfile, None)
+ def _show_in_file_manager_button_clicked_cb(self, unused_button):
+ directory_uri = posixpath.dirname(self.main_render_dialog.outfile)
+ Gio.AppInfo.launch_default_for_uri(directory_uri, None)
+
class RenderDialog(Loggable):
"""Render dialog box.
@@ -1062,6 +1070,7 @@ class RenderDialog(Loggable):
self._maybe_play_finished_sound()
self.progress.play_rendered_file_button.show()
self.progress.close_button.show()
+ self.progress.show_in_file_manager_button.show()
self.progress.cancel_button.hide()
self.progress.play_pause_button.hide()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]