Merge lp:~vikoadi/pantheon-photos/about into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: meese
Approved revision: 2606
Merged at revision: 2616
Proposed branch: lp:~vikoadi/pantheon-photos/about
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 231 lines (+61/-31)
8 files modified
Makefile (+6/-2)
misc/shotwell-viewer.desktop.head (+1/-0)
misc/shotwell-viewer.desktop.tail (+3/-0)
misc/shotwell.desktop.head (+2/-0)
misc/shotwell.desktop.tail (+3/-0)
src/Application.vala (+3/-27)
src/Resources.vala (+6/-2)
src/main.vala (+37/-0)
To merge this branch: bzr merge lp:~vikoadi/pantheon-photos/about
Reviewer Review Type Date Requested Status
meese Approve
Review via email: mp+233246@code.launchpad.net

Commit message

add about to quicklist and commandline

Description of the change

* add --about to shotwell commmandline option,
* call it from shotwell.desktop as desktop action

To post a comment you must log in.
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

please note that we cant differentiate between Photos and Photos Viewer except if we have one more commandline option for the viewer (which i choose not to do)

Revision history for this message
meese (meese) wrote :

Translate URL should be "https://translations.launchpad.net/pantheon-photos" and the about quicklist item is not showing up in it's context menu from the dock for me?

lp:~vikoadi/pantheon-photos/about updated
2604. By Viko Adi Rahmawan

add .tail file, modify Makefile to add About Photos desktop action

2605. By Viko Adi Rahmawan

add About Photos to shotwell viewr too

2606. By Viko Adi Rahmawan

change translation url

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

sorry, modify wrong file

Revision history for this message
meese (meese) wrote :

Looks good

Revision history for this message
meese (meese) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2014-08-27 06:20:32 +0000
3+++ Makefile 2014-09-04 12:56:20 +0000
4@@ -148,7 +148,9 @@
5 SYS_INTEGRATION_FILES = \
6 shotwell.appdata.xml \
7 shotwell.desktop.head \
8+ shotwell.desktop.tail \
9 shotwell-viewer.desktop.head \
10+ shotwell-viewer.desktop.tail \
11 org.yorba.shotwell.gschema.xml \
12 org.yorba.shotwell-extras.gschema.xml \
13 shotwell.convert
14@@ -464,7 +466,7 @@
15 cp $(DIST_TAR_XZ) $(PACKAGE_ORIG_XZ)
16 rm -f $(DIST_TAR_XZ)
17
18-misc/shotwell.desktop: misc/shotwell.desktop.head $(EXPANDED_CORE_PO_FILES)
19+misc/shotwell.desktop: misc/shotwell.desktop.head misc/shotwell.desktop.tail $(EXPANDED_CORE_PO_FILES)
20 cp misc/shotwell.desktop.head misc/shotwell.desktop
21 @ $(foreach lang,$(CORE_SUPPORTED_LANGUAGES), echo X-GNOME-FullName[$(lang)]=`TEXTDOMAINDIR=locale-langpack \
22 LANGUAGE=$(lang) gettext --domain=shotwell $(DESKTOP_APP_FULL_NAME)` \
23@@ -475,6 +477,7 @@
24 --domain=shotwell $(DESKTOP_APPLICATION_COMMENT)` >> misc/shotwell.desktop ; \
25 echo Keywords[$(lang)]=`TEXTDOMAINDIR=locale-langpack LANGUAGE=$(lang) gettext \
26 --domain=shotwell $(DESKTOP_APP_KEYWORDS)` >> misc/shotwell.desktop ;)
27+ cat misc/shotwell.desktop.tail >> misc/shotwell.desktop
28 ifndef DISABLE_DESKTOP_VALIDATE
29 @ desktop-file-validate misc/shotwell.desktop 1>misc/shotwell.desktop.errors 2>&1; \
30 if test -s misc/shotwell.desktop.errors; then \
31@@ -484,7 +487,7 @@
32 fi
33 endif
34
35-misc/shotwell-viewer.desktop: misc/shotwell-viewer.desktop.head $(EXPANDED_CORE_PO_FILES)
36+misc/shotwell-viewer.desktop: misc/shotwell-viewer.desktop.head misc/shotwell-viewer.desktop.tail $(EXPANDED_CORE_PO_FILES)
37 cp misc/shotwell-viewer.desktop.head misc/shotwell-viewer.desktop
38 $(foreach lang,$(CORE_SUPPORTED_LANGUAGES), echo X-GNOME-FullName[$(lang)]=`TEXTDOMAINDIR=locale-langpack \
39 LANGUAGE=$(lang) gettext --domain=shotwell $(DESKTOP_APP_FULL_NAME)` \
40@@ -492,6 +495,7 @@
41 --domain=shotwell $(DIRECT_EDIT_DESKTOP_APP_FULL_NAME)` >> misc/shotwell-viewer.desktop ; \
42 echo GenericName[$(lang)]=`TEXTDOMAINDIR=locale-langpack LANGUAGE=$(lang) gettext \
43 --domain=shotwell $(DIRECT_EDIT_DESKTOP_APPLICATION_CLASS)` >> misc/shotwell-viewer.desktop ;)
44+ cat misc/shotwell-viewer.desktop.tail >> misc/shotwell-viewer.desktop
45 ifndef DISABLE_DESKTOP_VALIDATE
46 @ desktop-file-validate misc/shotwell-viewer.desktop 1>misc/shotwell-viewer.desktop.errors 2>&1; \
47 if test -s misc/shotwell-viewer.desktop.errors; then \
48
49=== modified file 'misc/shotwell-viewer.desktop.head'
50--- misc/shotwell-viewer.desktop.head 2014-05-22 03:09:31 +0000
51+++ misc/shotwell-viewer.desktop.head 2014-09-04 12:56:20 +0000
52@@ -12,3 +12,4 @@
53 X-GIO-NoFuse=true
54 X-GNOME-Gettext-Domain=shotwell
55 X-GNOME-FullName=Photo Viewer
56+Actions=AboutDialog;
57
58=== added file 'misc/shotwell-viewer.desktop.tail'
59--- misc/shotwell-viewer.desktop.tail 1970-01-01 00:00:00 +0000
60+++ misc/shotwell-viewer.desktop.tail 2014-09-04 12:56:20 +0000
61@@ -0,0 +1,3 @@
62+[Desktop Action AboutDialog]
63+Name=About Photos
64+Exec=shotwell --about
65\ No newline at end of file
66
67=== modified file 'misc/shotwell.desktop.head'
68--- misc/shotwell.desktop.head 2014-05-22 03:09:31 +0000
69+++ misc/shotwell.desktop.head 2014-09-04 12:56:20 +0000
70@@ -13,3 +13,5 @@
71 X-GIO-NoFuse=true
72 X-GNOME-Gettext-Domain=shotwell
73 X-GNOME-FullName=Photos
74+Actions=AboutDialog;
75+
76
77=== added file 'misc/shotwell.desktop.tail'
78--- misc/shotwell.desktop.tail 1970-01-01 00:00:00 +0000
79+++ misc/shotwell.desktop.tail 2014-09-04 12:56:20 +0000
80@@ -0,0 +1,3 @@
81+[Desktop Action AboutDialog]
82+Name=About Photos
83+Exec=shotwell --about
84\ No newline at end of file
85
86=== modified file 'src/Application.vala'
87--- src/Application.vala 2014-08-08 21:13:09 +0000
88+++ src/Application.vala 2014-09-04 12:56:20 +0000
89@@ -211,33 +211,9 @@
90 * @param parent This widget is the window that is calling the about page being created.
91 */
92 public override void show_about (Gtk.Widget parent) {
93- assert (parent is Gtk.Window);
94-
95- var developers_string = _ ("Developers");
96- string about_copyright =
97- "2009-2014 Yorba Foundation\n" +
98- "Copyright © %s %s %s".printf (app_years, program_name, developers_string);
99-
100- Granite.Widgets.show_about_dialog ((Gtk.Window) parent,
101- "program_name", program_name,
102- "version", build_version,
103- "logo_icon_name", app_icon,
104-
105- "comments", about_comments,
106- "copyright", about_copyright,
107- "website", main_url,
108- "website_label", _ ("Website"),
109-
110- "authors", about_authors,
111- "documenters", about_documenters,
112- "artists", about_artists,
113- "translator_credits", about_translators,
114- "license", about_license,
115- "license_type", about_license_type,
116-
117- "help", help_url,
118- "translate", translate_url,
119- "bug", bug_url);
120+ var dialog = create_about_dialog (app_get_is_direct ());
121+ dialog.run ();
122+ dialog.destroy ();
123 }
124
125 public void exit () {
126
127=== modified file 'src/Resources.vala'
128--- src/Resources.vala 2014-09-02 20:04:38 +0000
129+++ src/Resources.vala 2014-09-04 12:56:20 +0000
130@@ -14,6 +14,7 @@
131
132 namespace Resources {
133 public const string APP_TITLE = _("Photos");
134+public const string APP_TITLE_VIEWER = _("Photos Viewer");
135 public const string APP_LIBRARY_ROLE = _("Photo Manager");
136 public const string APP_DIRECT_ROLE = _("Photo Viewer");
137 public const string APP_VERSION = _VERSION;
138@@ -24,13 +25,16 @@
139 public const string? GIT_VERSION = null;
140 #endif
141
142-public const string COPYRIGHT = _("Copyright 2009-2013 Yorba Foundation");
143+public const string COPYRIGHT = _("2009-2014 Yorba Foundation\nCopyright © 2014 Photos Developers");
144 public const string APP_GETTEXT_PACKAGE = GETTEXT_PACKAGE;
145
146 public const string YORBA_URL = "http://www.yorba.org";
147 public const string WIKI_URL = "http://redmine.yorba.org/projects/shotwell/wiki/Shotwell";
148 public const string FAQ_URL = "http://redmine.yorba.org/projects/shotwell/wiki/ShotwellFAQ";
149+public const string PROJECT_URL = "https://launchpad.net/pantheon-photos";
150 public const string BUG_DB_URL = "https://bugs.launchpad.net/pantheon-photos";
151+public const string TRANSLATE_URL = "https://translations.launchpad.net/pantheon-photos";
152+public const string HELP_URL = "http://elementaryos.org/answers/+/shotwell/all/newest";
153 public const string DIR_PATTERN_URI_SYSWIDE = "ghelp:shotwell?other-files";
154
155 private const string LIB = _LIB;
156@@ -1204,4 +1208,4 @@
157
158 public const string ONIMAGE_FONT_COLOR = "#000000";
159 public const string ONIMAGE_FONT_BACKGROUND = "rgba(255,255,255,0.5)";
160-}
161+}
162\ No newline at end of file
163
164=== modified file 'src/main.vala'
165--- src/main.vala 2014-08-22 08:57:09 +0000
166+++ src/main.vala 2014-09-04 12:56:20 +0000
167@@ -282,6 +282,7 @@
168 string data_dir = null;
169 bool show_version = false;
170 bool no_runtime_monitoring = false;
171+bool show_about = false;
172
173 private OptionEntry[]? entries = null;
174
175@@ -309,6 +310,11 @@
176 };
177 entries += version;
178
179+ OptionEntry about = { "about", 'a', 0, OptionArg.NONE, &show_about,
180+ _ ("Show About dialog"), null
181+ };
182+ entries += about;
183+
184 OptionEntry terminator = { null, 0, 0, 0, null, null, null };
185 entries += terminator;
186
187@@ -316,6 +322,26 @@
188 }
189 }
190
191+public Granite.Widgets.AboutDialog create_about_dialog (bool is_direct = false) {
192+ var build_version = Resources.APP_VERSION;
193+
194+ var about = new Granite.Widgets.AboutDialog ();
195+ about.program_name = is_direct ? Resources.APP_TITLE_VIEWER : Resources.APP_TITLE;
196+ about.version = build_version;
197+ about.logo_icon_name = "multimedia-photo-viewer";
198+ about.copyright = Resources.COPYRIGHT;
199+ about.website = Resources.PROJECT_URL;
200+ about.authors = Resources.AUTHORS;
201+ about.documenters = {};
202+ about.artists = {};
203+ about.translator_credits = "Launchpad Translators";
204+ about.license = Resources.LICENSE;
205+ about.help = Resources.HELP_URL;
206+ about.translate = Resources.TRANSLATE_URL;
207+ about.bug = Resources.BUG_DB_URL;
208+ return about;
209+}
210+
211 void main (string[] args) {
212 // Call AppDirs init *before* calling Gtk.init_with_args, as it will strip the
213 // exec file from the array
214@@ -357,6 +383,17 @@
215 return;
216 }
217
218+ // for now we create new Granite AboutDialog
219+ // later it should be parsed in Application.
220+ if (CommandlineOptions.show_about) {
221+ var about = create_about_dialog ();
222+ about.run ();
223+ about.destroy ();
224+
225+ AppDirs.terminate ();
226+ return;
227+ }
228+
229 // init debug prior to anything else (except Gtk, which it relies on, and AppDirs, which needs
230 // to be set ASAP) ... since we need to know what mode we're in, examine the command-line
231 // first

Subscribers

People subscribed via source and target branches