Merge lp:~raof/do-plugins/fix-firefox-icon into lp:do-plugins

Proposed by Chris Halse Rogers
Status: Merged
Merged at revision: 716
Proposed branch: lp:~raof/do-plugins/fix-firefox-icon
Merge into: lp:do-plugins
Diff against target: 168 lines (+72/-14)
6 files modified
Firefox/Firefox.mdp (+13/-11)
Firefox/Makefile.am (+2/-0)
Firefox/src/BrowseBookmarkItem.cs (+1/-1)
Firefox/src/BrowseHistoryItem.cs (+1/-1)
Firefox/src/FirefoxHelpers.cs (+54/-0)
Firefox/src/PlacesItemSource.cs (+1/-1)
To merge this branch: bzr merge lp:~raof/do-plugins/fix-firefox-icon
Reviewer Review Type Date Requested Status
Do Plugins Team Pending
Review via email: mp+18809@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

Wander through a list of possible firefox icons to try and grab one that actually exists.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Firefox/Firefox.mdp'
2--- Firefox/Firefox.mdp 2009-06-29 08:47:41 +0000
3+++ Firefox/Firefox.mdp 2010-02-07 22:08:13 +0000
4@@ -1,27 +1,28 @@
5-<Project name="Firefox" fileversion="2.0" language="C#" clr-version="Net_2_0" targetFramework="3.5" ctype="DotNetProject">
6+<Project name="Firefox" fileversion="2.0" DefaultNamespace="Firefox" language="C#" clr-version="Net_2_0" targetFramework="3.5" ctype="DotNetProject">
7 <Configurations active="Debug">
8 <Configuration name="Debug" ctype="DotNetProjectConfiguration">
9 <Output directory="bin/Debug" assembly="Firefox" />
10 <Build debugmode="True" target="Library" />
11- <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
12+ <Execution consolepause="False" runwithwarnings="True" runtime="MsNet" clr-version="Net_2_0" />
13 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
14 </Configuration>
15 <Configuration name="Release" ctype="DotNetProjectConfiguration">
16 <Output directory="bin/Release" assembly="Firefox" />
17 <Build debugmode="False" target="Library" />
18- <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
19+ <Execution consolepause="False" runwithwarnings="True" runtime="MsNet" clr-version="Net_2_0" />
20 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
21 </Configuration>
22 </Configurations>
23 <Contents>
24- <File name="." subtype="Directory" buildaction="Compile" />
25- <File name="src" subtype="Directory" buildaction="Compile" />
26- <File name="Resources/Firefox.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
27- <File name="src/PlacesItemSource.cs" subtype="Code" buildaction="Compile" />
28- <File name="src/BrowseBookmarkItem.cs" subtype="Code" buildaction="Compile" />
29- <File name="src/BrowseHistoryItem.cs" subtype="Code" buildaction="Compile" />
30- <File name="src/FolderItem.cs" subtype="Code" buildaction="Compile" />
31- <File name="src/PlaceItem.cs" subtype="Code" buildaction="Compile" />
32+ <File subtype="Directory" buildaction="Compile" name="." />
33+ <File subtype="Directory" buildaction="Compile" name="src" />
34+ <File subtype="Code" buildaction="EmbedAsResource" name="Resources/Firefox.addin.xml" />
35+ <File subtype="Code" buildaction="Compile" name="src/PlacesItemSource.cs" />
36+ <File subtype="Code" buildaction="Compile" name="src/BrowseBookmarkItem.cs" />
37+ <File subtype="Code" buildaction="Compile" name="src/BrowseHistoryItem.cs" />
38+ <File subtype="Code" buildaction="Compile" name="src/FolderItem.cs" />
39+ <File subtype="Code" buildaction="Compile" name="src/PlaceItem.cs" />
40+ <File subtype="Code" buildaction="Compile" name="src/FirefoxHelpers.cs" />
41 </Contents>
42 <References>
43 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
44@@ -34,5 +35,6 @@
45 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.9.0.0, Culture=neutral" />
46 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform.Linux, Version=0.9.0.0, Culture=neutral" />
47 <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.9.0.0, Culture=neutral" />
48+ <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
49 </References>
50 </Project>
51\ No newline at end of file
52
53=== modified file 'Firefox/Makefile.am'
54--- Firefox/Makefile.am 2009-06-22 04:05:16 +0000
55+++ Firefox/Makefile.am 2010-02-07 22:08:14 +0000
56@@ -5,6 +5,7 @@
57 FILES = \
58 src/BrowseBookmarkItem.cs \
59 src/BrowseHistoryItem.cs \
60+ src/FirefoxHelpers.cs \
61 src/FolderItem.cs \
62 src/PlaceItem.cs \
63 src/PlacesItemSource.cs
64@@ -17,5 +18,6 @@
65 System.Core \
66 System.Data \
67 Mono.Data.SqliteClient \
68+ $(GTK_SHARP_20_LIBS) \
69 $(DO_PLATFORM_LIBS) \
70 $(DO_UNIVERSE_LIBS)
71
72=== modified file 'Firefox/src/BrowseBookmarkItem.cs'
73--- Firefox/src/BrowseBookmarkItem.cs 2009-06-22 04:05:16 +0000
74+++ Firefox/src/BrowseBookmarkItem.cs 2010-02-07 22:08:13 +0000
75@@ -35,7 +35,7 @@
76 }
77
78 public override string Icon {
79- get { return "firefox-3.0"; }
80+ get { return FirefoxHelpers.IconName; }
81 }
82 }
83 }
84
85=== modified file 'Firefox/src/BrowseHistoryItem.cs'
86--- Firefox/src/BrowseHistoryItem.cs 2009-06-22 04:05:16 +0000
87+++ Firefox/src/BrowseHistoryItem.cs 2010-02-07 22:08:13 +0000
88@@ -37,7 +37,7 @@
89 }
90
91 public override string Icon {
92- get { return "firefox-3.0"; }
93+ get { return FirefoxHelpers.IconName; }
94 }
95 }
96 }
97
98=== added file 'Firefox/src/FirefoxHelpers.cs'
99--- Firefox/src/FirefoxHelpers.cs 1970-01-01 00:00:00 +0000
100+++ Firefox/src/FirefoxHelpers.cs 2010-02-07 22:08:13 +0000
101@@ -0,0 +1,54 @@
102+// FirefoxHelpers.cs
103+// GNOME Do is the legal property of its developers, whose names are too
104+// numerous to list here. Please refer to the COPYRIGHT file distributed with
105+// this source distribution.
106+//
107+// This program is free software: you can redistribute it and/or modify
108+// it under the terms of the GNU General Public License as published by
109+// the Free Software Foundation, either version 3 of the License, or
110+// (at your option) any later version.
111+//
112+// This program is distributed in the hope that it will be useful,
113+// but WITHOUT ANY WARRANTY; without even the implied warranty of
114+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
115+// GNU General Public License for more details.
116+//
117+// You should have received a copy of the GNU General Public License
118+// along with this program. If not, see <http://www.gnu.org/licenses/>.
119+
120+using System;
121+using Gtk;
122+
123+namespace Firefox
124+{
125+ public static class FirefoxHelpers
126+ {
127+ public static string IconName {get; private set;}
128+
129+ static FirefoxHelpers ()
130+ {
131+ // List a whole bunch of possible names for the firefox icon.
132+ string[] iconNames = new string [] {
133+ "firefox",
134+ "iceweasel",
135+ "firefox-4.0",
136+ "firefox-3.9",
137+ "firefox-3.8",
138+ "firefox-3.7",
139+ "firefox-3.6",
140+ "firefox-3.5",
141+ "firefox-3.0",
142+ };
143+
144+ // Start with "firefox". If we can't find an icon in the theme,
145+ // at least "firefox" makes our intent clear.
146+ IconName = "firefox";
147+ foreach (string iconName in iconNames) {
148+ if (IconTheme.Default.HasIcon (iconName)) {
149+ IconName = iconName;
150+ break;
151+ }
152+ }
153+ }
154+ }
155+}
156
157=== modified file 'Firefox/src/PlacesItemSource.cs'
158--- Firefox/src/PlacesItemSource.cs 2009-09-05 02:06:59 +0000
159+++ Firefox/src/PlacesItemSource.cs 2010-02-07 22:08:13 +0000
160@@ -74,7 +74,7 @@
161 }
162
163 public override string Icon {
164- get { return "firefox-3.0"; }
165+ get { return FirefoxHelpers.IconName; }
166 }
167
168 public override IEnumerable<Item> Items {

Subscribers

People subscribed via source and target branches