Merge lp:~voldyman/pantheon-terminal/special-chars-working-dir into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Akshay Shekher
Status: Merged
Approved by: David Gomes
Approved revision: 671
Merged at revision: 669
Proposed branch: lp:~voldyman/pantheon-terminal/special-chars-working-dir
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 84 lines (+15/-27)
2 files modified
src/PantheonTerminal.vala (+13/-27)
src/PantheonTerminalWindow.vala (+2/-0)
To merge this branch: bzr merge lp:~voldyman/pantheon-terminal/special-chars-working-dir
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+245401@code.launchpad.net

Commit message

Fixes -w on paths with special characters.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PantheonTerminal.vala'
2--- src/PantheonTerminal.vala 2014-10-03 17:31:43 +0000
3+++ src/PantheonTerminal.vala 2014-12-27 20:43:27 +0000
4@@ -74,7 +74,7 @@
5 }
6
7 public void new_window () {
8- new PantheonTerminalWindow (this);
9+ new PantheonTerminalWindow (this).present ();
10 }
11
12 public PantheonTerminalWindow new_window_with_coords (int x, int y, bool should_recreate_tabs=true) {
13@@ -155,12 +155,19 @@
14 return 0;
15 }
16
17- if (command_e != null)
18+ if (command_e != null) {
19 run_commands (command_e);
20- else if (working_directory != null)
21+
22+ } else if (working_directory != null) {
23 start_terminal_with_working_directory (working_directory);
24- else
25+
26+ } else if (print_version) {
27+ stdout.printf ("Pantheon Terminal %s\n", Build.VERSION);
28+ stdout.printf ("Copyright 2011-2014 Pantheon Terminal Developers.\n");
29+
30+ } else {
31 new_window ();
32+ }
33
34 // Do not save the value until the next instance of
35 // Pantheon Terminal is started
36@@ -203,34 +210,13 @@
37 { "version", 'v', 0, OptionArg.NONE, out print_version, N_("Print version info and exit"), null },
38 { "about", 'a', 0, OptionArg.NONE, out show_about_dialog, N_("Show about dialog"), null },
39 { "execute" , 'e', 0, OptionArg.STRING_ARRAY, ref command_e, N_("Run a program in terminal"), "" },
40- { "working-directory", 'w', 0, OptionArg.STRING, ref working_directory, N_("Set shell working directory"), "" },
41+ { "working-directory", 'w', 0, OptionArg.FILENAME, ref working_directory, N_("Set shell working directory"), "" },
42 { null }
43 };
44
45 public static int main (string[] args) {
46- var context = new OptionContext ("Terminal");
47- context.add_main_entries (entries, Build.GETTEXT_PACKAGE);
48-
49- string[] args_primary_instance = args;
50-
51- try {
52- context.parse(ref args);
53- } catch (Error e) {
54- error (e.message);
55- }
56-
57- if (print_version) {
58- stdout.printf ("Pantheon Terminal %s\n", Build.VERSION);
59- stdout.printf ("Copyright 2011-2014 Pantheon Terminal Developers.\n");
60-
61- return 0;
62- }
63-
64- Gtk.init (ref args);
65- Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
66-
67 var app = new PantheonTerminalApp ();
68- return app.run (args_primary_instance);
69+ return app.run (args);
70 }
71 }
72 } // Namespace
73
74=== modified file 'src/PantheonTerminalWindow.vala'
75--- src/PantheonTerminalWindow.vala 2014-12-06 15:09:22 +0000
76+++ src/PantheonTerminalWindow.vala 2014-12-27 20:43:27 +0000
77@@ -101,6 +101,8 @@
78 icon_name = "utilities-terminal";
79 set_application (app);
80
81+ Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
82+
83 Notify.init (app.program_name);
84 set_visual (Gdk.Screen.get_default ().get_rgba_visual ());
85

Subscribers

People subscribed via source and target branches