Commit c2962301 authored by Sivakar Sithamparanathan's avatar Sivakar Sithamparanathan Committed by Alexandru Băluț

render: Allow opening the folder of the rendered file

Fixes #2141
parent a9058c74
Pipeline #5792 failed with stage
in 146 minutes and 53 seconds
......@@ -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">&lt;small&gt;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.&lt;/small&gt;</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">&lt;small&gt;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.&lt;/small&gt;</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>
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment