Merge lp:~elementary-dev-community/pantheon-terminal/fix-1329550 into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Cameron Norman
Status: Merged
Merged at revision: 601
Proposed branch: lp:~elementary-dev-community/pantheon-terminal/fix-1329550
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 72 lines (+11/-5)
3 files modified
data/pantheon-terminal.desktop (+5/-1)
src/PantheonTerminal.vala (+6/-3)
src/PantheonTerminalWindow.vala (+0/-1)
To merge this branch: bzr merge lp:~elementary-dev-community/pantheon-terminal/fix-1329550
Reviewer Review Type Date Requested Status
Raphael Isemann (community) functionality, code-style Approve
David Gomes (community) Approve
Review via email: mp+229683@code.launchpad.net

Commit message

Adds an --about (-a) command line option and a corresponding quicklist item

Description of the change

This adds an --about (-a) command line option and a corresponding quicklist item. It leaves the item in the right click menu intact, so that users on desktops that do not implement quicklists can still access the about dialog via GUI.

To post a comment you must log in.
Revision history for this message
Raphael Isemann (teemperor) wrote :

1. Instead of

43 stdout.printf ("pantheon-terminal: ERROR: " + e.message + "\n");
44
45 return 0;

use

error (e.message);

2. Not sure about the relevant part in the code, but the dark GTK+ theme isn't active when you start the About-Dialog from the quicklist and no terminal-instance is already running. In this case the about-window uses the normal GTK+ theme (so, a white window in elementary).

review: Needs Fixing
Revision history for this message
Cameron Norman (cameronnemo) wrote :

1) is not my code, but I can definitely include that change.

2) This may be a granite deficiency, as the about option here works by relying on the Granite.Application's behavior when running with the --about option. I think that when Granite creates the about dialog when the app is already running, the Gtk setting has already been set (in PantheonTerminalWindow.vala), but when it creates the dialog without a running app, no such setting has been made, and it comes up light. I tried setting the dark theme before running the main app, but it did not work. I got this error message:

[_LOG_LEVEL_FATAL 16:24:08.038999] [GLib-GObject] g_object_set: assertion 'G_IS_OBJECT (object)' failed
[_LOG_LEVEL_FATAL 16:24:08.039074] PantheonTerminal will not function properly.

Perhaps a dark_theme value in Granite.Application is necessary? Or am I doing something wrong? I will try to investigate a little later.

Revision history for this message
Cameron Norman (cameronnemo) wrote :

Ok, I managed to get around (2) by initializing Gtk in main() and then setting the dark theme.

Revision history for this message
David Gomes (davidgomes) :
review: Approve
Revision history for this message
Raphael Isemann (teemperor) wrote :

Works not, thanks for fixing the code anyway.

review: Approve (functionality, code-style)
Revision history for this message
RabbitBot (rabbitbot-a) wrote :

Attempt to merge into lp:pantheon-terminal failed due to conflicts:

text conflict in data/pantheon-terminal.desktop

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/pantheon-terminal.desktop'
--- data/pantheon-terminal.desktop 2014-05-22 22:07:48 +0000
+++ data/pantheon-terminal.desktop 2014-08-07 00:18:37 +0000
@@ -10,7 +10,7 @@
10StartupNotify=true10StartupNotify=true
11X-GNOME-Gettext-Domain=pantheon-terminal11X-GNOME-Gettext-Domain=pantheon-terminal
12Keywords=command;prompt;cmd;commandline;run;12Keywords=command;prompt;cmd;commandline;run;
13Actions=NewWindow;NewRootWindow;13Actions=NewWindow;NewRootWindow;AboutDialog;
1414
15[Desktop Action NewWindow]15[Desktop Action NewWindow]
16Name=New Window16Name=New Window
@@ -21,3 +21,7 @@
21Name=New Root Window21Name=New Root Window
22Icon=utilities-terminal22Icon=utilities-terminal
23Exec=gksu pantheon-terminal23Exec=gksu pantheon-terminal
24
25[Desktop Action AboutDialog]
26Name=About Terminal
27Exec=pantheon-terminal --about
2428
=== modified file 'src/PantheonTerminal.vala'
--- src/PantheonTerminal.vala 2014-07-03 23:20:40 +0000
+++ src/PantheonTerminal.vala 2014-08-07 00:18:37 +0000
@@ -31,6 +31,7 @@
31 private static string[]? command_e = null;31 private static string[]? command_e = null;
3232
33 private static bool print_version = false;33 private static bool print_version = false;
34 private static bool show_about_dialog = false;
3435
35 public int minimum_width;36 public int minimum_width;
36 public int minimum_height;37 public int minimum_height;
@@ -196,6 +197,7 @@
196197
197 static const OptionEntry[] entries = {198 static const OptionEntry[] entries = {
198 { "version", 'v', 0, OptionArg.NONE, out print_version, N_("Print version info and exit"), null },199 { "version", 'v', 0, OptionArg.NONE, out print_version, N_("Print version info and exit"), null },
200 { "about", 'a', 0, OptionArg.NONE, out show_about_dialog, N_("Show about dialog"), null },
199 { "execute" , 'e', 0, OptionArg.STRING_ARRAY, ref command_e, N_("Run a program in terminal"), "" },201 { "execute" , 'e', 0, OptionArg.STRING_ARRAY, ref command_e, N_("Run a program in terminal"), "" },
200 { "working-directory", 'w', 0, OptionArg.STRING, ref working_directory, N_("Set shell working directory"), "" },202 { "working-directory", 'w', 0, OptionArg.STRING, ref working_directory, N_("Set shell working directory"), "" },
201 { null }203 { null }
@@ -212,9 +214,7 @@
212 try {214 try {
213 context.parse(ref args);215 context.parse(ref args);
214 } catch (Error e) {216 } catch (Error e) {
215 stdout.printf ("pantheon-terminal: ERROR: " + e.message + "\n");217 error (e.message);
216
217 return 0;
218 }218 }
219219
220 if (print_version) {220 if (print_version) {
@@ -224,6 +224,9 @@
224 return 0;224 return 0;
225 }225 }
226226
227 Gtk.init (ref args);
228 Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
229
227 var app = new PantheonTerminalApp ();230 var app = new PantheonTerminalApp ();
228 return app.run (args_primary_instance);231 return app.run (args_primary_instance);
229 }232 }
230233
=== modified file 'src/PantheonTerminalWindow.vala'
--- src/PantheonTerminalWindow.vala 2014-08-05 23:02:15 +0000
+++ src/PantheonTerminalWindow.vala 2014-08-07 00:18:37 +0000
@@ -104,7 +104,6 @@
104 Notify.init (app.program_name);104 Notify.init (app.program_name);
105 set_visual (Gdk.Screen.get_default ().get_rgba_visual ());105 set_visual (Gdk.Screen.get_default ().get_rgba_visual ());
106106
107 Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
108 title = _("Terminal");107 title = _("Terminal");
109 restore_saved_state (restore_pos);108 restore_saved_state (restore_pos);
110109

Subscribers

People subscribed via source and target branches