Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-addins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez Gual <lluis@novell.com>2011-02-15 21:02:39 +0300
committerLluis Sanchez Gual <lluis@novell.com>2011-02-15 21:02:39 +0300
commit3464cc173c8338aad177a8906ce9abf426120e0c (patch)
tree96766541f41281fd289c0135604b9d0764266d7e /Mono.Addins.Gui
parent330db58a10bfcce705cad9fcfceb2f5e732da368 (diff)
Show an installed icon overlay when an add-in package is installed.
Diffstat (limited to 'Mono.Addins.Gui')
-rw-r--r--Mono.Addins.Gui/Makefile.am1
-rw-r--r--Mono.Addins.Gui/Mono.Addins.Gui.csproj3
-rw-r--r--Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs1
-rw-r--r--Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs20
-rw-r--r--Mono.Addins.Gui/icons/installed-overlay.pngbin0 -> 672 bytes
5 files changed, 15 insertions, 10 deletions
diff --git a/Mono.Addins.Gui/Makefile.am b/Mono.Addins.Gui/Makefile.am
index 8b16047..9f7b6d5 100644
--- a/Mono.Addins.Gui/Makefile.am
+++ b/Mono.Addins.Gui/Makefile.am
@@ -52,6 +52,7 @@ DATA_FILES =
RESOURCES = \
gtk-gui/gui.stetic \
icons/download.png \
+ icons/installed-overlay.png \
icons/package-x-generic.png \
icons/package-x-generic_16.png \
icons/package-x-generic_22.png \
diff --git a/Mono.Addins.Gui/Mono.Addins.Gui.csproj b/Mono.Addins.Gui/Mono.Addins.Gui.csproj
index da8e693..60ba8a2 100644
--- a/Mono.Addins.Gui/Mono.Addins.Gui.csproj
+++ b/Mono.Addins.Gui/Mono.Addins.Gui.csproj
@@ -144,6 +144,9 @@
<EmbeddedResource Include="icons\software-update-available.png">
<LogicalName>software-update-available.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\installed-overlay.png">
+ <LogicalName>installed-overlay.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs
index e30745b..3d11a3b 100644
--- a/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs
+++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs
@@ -77,6 +77,7 @@ namespace Mono.Addins.Gui
tree = new AddinTreeWidget (addinTree);
addinTree.Selection.Changed += OnSelectionChanged;
tree.VersionVisible = false;
+ tree.ShowInstalledMarkers = false;
galleryTreeView.Selection.Mode = SelectionMode.Multiple;
galleryTree = new AddinTreeWidget (galleryTreeView);
diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs
index cc36a36..639c1bb 100644
--- a/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs
+++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs
@@ -55,6 +55,7 @@ namespace Mono.Addins.Gui
Gdk.Pixbuf iconInstalled;
Gdk.Pixbuf iconNotInstalled;
Gdk.Pixbuf updateOverlay;
+ Gdk.Pixbuf installedOverlay;
public event EventHandler SelectionChanged;
@@ -72,6 +73,7 @@ namespace Mono.Addins.Gui
iconInstalled = Gdk.Pixbuf.LoadFromResource ("plugin-32.png");
iconNotInstalled = Gdk.Pixbuf.LoadFromResource ("plugin-avail-32.png");
updateOverlay = Gdk.Pixbuf.LoadFromResource ("software-update-available-overlay.png");
+ installedOverlay = Gdk.Pixbuf.LoadFromResource ("installed-overlay.png");
this.treeView = treeView;
ArrayList list = new ArrayList ();
@@ -300,23 +302,21 @@ namespace Mono.Addins.Gui
return pix;
}
+ internal bool ShowInstalledMarkers = true;
+
void StoreIcon (TreeIter it, string iconId, Gdk.Pixbuf customPix, AddinStatus status)
{
+ if (customPix == null)
+ customPix = iconInstalled;
+
if ((status & AddinStatus.Installed) == 0) {
- if (customPix == null)
- customPix = iconNotInstalled;
- else {
- customPix = GetCachedIcon (iconId, "Fade", delegate {
- return Services.FadeIcon (customPix);
- });
- }
treeStore.SetValue (it, ColImage, customPix);
return;
+ } else if (ShowInstalledMarkers && (status & AddinStatus.HasUpdate) == 0) {
+ customPix = GetCachedIcon (iconId, "InstalledOverlay", delegate { return Services.AddIconOverlay (customPix, installedOverlay); });
+ iconId = iconId + "_Installed";
}
- if (customPix == null)
- customPix = iconInstalled;
-
if ((status & AddinStatus.Disabled) != 0) {
customPix = GetCachedIcon (iconId, "Desaturate", delegate { return Services.DesaturateIcon (customPix); });
iconId = iconId + "_Desaturate";
diff --git a/Mono.Addins.Gui/icons/installed-overlay.png b/Mono.Addins.Gui/icons/installed-overlay.png
new file mode 100644
index 0000000..8eb59a3
--- /dev/null
+++ b/Mono.Addins.Gui/icons/installed-overlay.png
Binary files differ