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
1=== modified file 'data/pantheon-terminal.desktop'
2--- data/pantheon-terminal.desktop 2014-05-22 22:07:48 +0000
3+++ data/pantheon-terminal.desktop 2014-08-07 00:18:37 +0000
4@@ -10,7 +10,7 @@
5 StartupNotify=true
6 X-GNOME-Gettext-Domain=pantheon-terminal
7 Keywords=command;prompt;cmd;commandline;run;
8-Actions=NewWindow;NewRootWindow;
9+Actions=NewWindow;NewRootWindow;AboutDialog;
10
11 [Desktop Action NewWindow]
12 Name=New Window
13@@ -21,3 +21,7 @@
14 Name=New Root Window
15 Icon=utilities-terminal
16 Exec=gksu pantheon-terminal
17+
18+[Desktop Action AboutDialog]
19+Name=About Terminal
20+Exec=pantheon-terminal --about
21
22=== modified file 'src/PantheonTerminal.vala'
23--- src/PantheonTerminal.vala 2014-07-03 23:20:40 +0000
24+++ src/PantheonTerminal.vala 2014-08-07 00:18:37 +0000
25@@ -31,6 +31,7 @@
26 private static string[]? command_e = null;
27
28 private static bool print_version = false;
29+ private static bool show_about_dialog = false;
30
31 public int minimum_width;
32 public int minimum_height;
33@@ -196,6 +197,7 @@
34
35 static const OptionEntry[] entries = {
36 { "version", 'v', 0, OptionArg.NONE, out print_version, N_("Print version info and exit"), null },
37+ { "about", 'a', 0, OptionArg.NONE, out show_about_dialog, N_("Show about dialog"), null },
38 { "execute" , 'e', 0, OptionArg.STRING_ARRAY, ref command_e, N_("Run a program in terminal"), "" },
39 { "working-directory", 'w', 0, OptionArg.STRING, ref working_directory, N_("Set shell working directory"), "" },
40 { null }
41@@ -212,9 +214,7 @@
42 try {
43 context.parse(ref args);
44 } catch (Error e) {
45- stdout.printf ("pantheon-terminal: ERROR: " + e.message + "\n");
46-
47- return 0;
48+ error (e.message);
49 }
50
51 if (print_version) {
52@@ -224,6 +224,9 @@
53 return 0;
54 }
55
56+ Gtk.init (ref args);
57+ Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
58+
59 var app = new PantheonTerminalApp ();
60 return app.run (args_primary_instance);
61 }
62
63=== modified file 'src/PantheonTerminalWindow.vala'
64--- src/PantheonTerminalWindow.vala 2014-08-05 23:02:15 +0000
65+++ src/PantheonTerminalWindow.vala 2014-08-07 00:18:37 +0000
66@@ -104,7 +104,6 @@
67 Notify.init (app.program_name);
68 set_visual (Gdk.Screen.get_default ().get_rgba_visual ());
69
70- Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
71 title = _("Terminal");
72 restore_saved_state (restore_pos);
73

Subscribers

People subscribed via source and target branches