[latexila/wip/latexila-next] Add a button in the file browser panel to open the current directory
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila/wip/latexila-next] Add a button in the file browser panel to open the current directory
- Date: Sun, 22 Mar 2015 19:46:54 +0000 (UTC)
commit 12f42a8bf4fe21be9093f1de22514b65c516d912
Author: Arnaud Blouin <blouin arno gmail com>
Date: Sun Mar 22 15:45:04 2015 +0100
Add a button in the file browser panel to open the current directory
+ small modifications from swilmet.
https://bugzilla.gnome.org/show_bug.cgi?id=746441
src/file_browser.vala | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/src/file_browser.vala b/src/file_browser.vala
index b366ace..b68c48c 100644
--- a/src/file_browser.vala
+++ b/src/file_browser.vala
@@ -206,6 +206,7 @@ public class FileBrowser : Grid
toolbar.insert (get_home_button (), -1);
toolbar.insert (get_parent_button (), -1);
toolbar.insert (get_jump_button (), -1);
+ toolbar.insert (get_open_directory_button (), -1);
toolbar.insert (get_properties_button (), -1);
add (toolbar);
@@ -274,6 +275,31 @@ public class FileBrowser : Grid
return jump_button;
}
+ private ToolButton get_open_directory_button ()
+ {
+ ToolButton open_directory_button = new ToolButton (null, null);
+ open_directory_button.icon_name = "document-open";
+ open_directory_button.tooltip_text =
+ _("Open the current directory in a file manager");
+
+ open_directory_button.clicked.connect (() =>
+ {
+ return_if_fail (_current_directory != null);
+
+ try
+ {
+ Latexila.utils_show_uri (this.get_screen (),
+ _current_directory.get_uri (), Gdk.CURRENT_TIME);
+ }
+ catch (Error error)
+ {
+ handle_error (error);
+ }
+ });
+
+ return open_directory_button;
+ }
+
private ToolButton get_properties_button ()
{
/* Show build files */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]