diff options
author | Lluis Sanchez Gual <lluis@novell.com> | 2011-01-25 16:22:21 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@novell.com> | 2011-01-25 16:22:21 +0300 |
commit | 24b0e2866fcd233395235a92c495aed01750df12 (patch) | |
tree | cab7540b18bf59de83498fa63e9ae1dd085366c5 /Mono.Addins.Gui | |
parent | a562fde848bb6f75a27d165ff614e1af6a9c8495 (diff) |
Initial version of the redesigned add-in manager
Diffstat (limited to 'Mono.Addins.Gui')
28 files changed, 3191 insertions, 494 deletions
diff --git a/Mono.Addins.Gui/Makefile.am b/Mono.Addins.Gui/Makefile.am index 01fb5a9..ac4fbbe 100644 --- a/Mono.Addins.Gui/Makefile.am +++ b/Mono.Addins.Gui/Makefile.am @@ -22,14 +22,17 @@ FILES = \ AssemblyInfo.cs \ gtk-gui/generated.cs \ gtk-gui/Mono.Addins.Gui.AddinInfoDialog.cs \ + gtk-gui/Mono.Addins.Gui.AddinInfoView.cs \ gtk-gui/Mono.Addins.Gui.AddinInstallDialog.cs \ gtk-gui/Mono.Addins.Gui.AddinInstallerDialog.cs \ gtk-gui/Mono.Addins.Gui.AddinManagerDialog.cs \ gtk-gui/Mono.Addins.Gui.ErrorDialog.cs \ + gtk-gui/Mono.Addins.Gui.InstallDialog.cs \ gtk-gui/Mono.Addins.Gui.ManageSitesDialog.cs \ gtk-gui/Mono.Addins.Gui.NewSiteDialog.cs \ gtk-gui/Mono.Addins.Gui.ProgressDialog.cs \ Mono.Addins.Gui/AddinInfoDialog.cs \ + Mono.Addins.Gui/AddinInfoView.cs \ Mono.Addins.Gui/AddinInstallDialog.cs \ Mono.Addins.Gui/AddinInstaller.cs \ Mono.Addins.Gui/AddinInstallerDialog.cs \ @@ -37,19 +40,35 @@ FILES = \ Mono.Addins.Gui/AddinManagerWindow.cs \ Mono.Addins.Gui/AddinTreeWidget.cs \ Mono.Addins.Gui/ErrorDialog.cs \ + Mono.Addins.Gui/HeaderBox.cs \ + Mono.Addins.Gui/HoverImageButton.cs \ + Mono.Addins.Gui/HslColor.cs \ + Mono.Addins.Gui/InstallDialog.cs \ Mono.Addins.Gui/ManageSitesDialog.cs \ Mono.Addins.Gui/NewSiteDialog.cs \ Mono.Addins.Gui/ProgressDialog.cs \ + Mono.Addins.Gui/SearchEntry.cs \ Mono.Addins.Gui/Services.cs DATA_FILES = RESOURCES = \ gtk-gui/gui.stetic \ + icons/download.png \ icons/package-x-generic.png \ icons/package-x-generic_16.png \ icons/package-x-generic_22.png \ + icons/plugin-16.png \ + icons/plugin-22.png \ + icons/plugin-32.png \ + icons/plugin-avail-16.png \ + icons/plugin-avail-32.png \ + icons/plugin-disabled-32.png \ + icons/plugin-update-16.png \ + icons/plugin-update-22.png \ + icons/plugin-update-32.png \ icons/system-software-update.png \ + icons/system-software-update_22.png \ icons/user-package.png EXTRAS = \ @@ -58,6 +77,7 @@ EXTRAS = \ REFERENCES = \ -pkg:glib-sharp-2.0 \ -pkg:gtk-sharp-2.0 \ + -r:Mono.Cairo \ -r:Mono.Posix \ -r:System diff --git a/Mono.Addins.Gui/Mono.Addins.Gui.csproj b/Mono.Addins.Gui/Mono.Addins.Gui.csproj index 1aa55e8..469caea 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui.csproj +++ b/Mono.Addins.Gui/Mono.Addins.Gui.csproj @@ -21,6 +21,7 @@ <WarningLevel>4</WarningLevel> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> <ConsolePause>false</ConsolePause> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -30,25 +31,17 @@ <WarningLevel>4</WarningLevel> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> <ConsolePause>false</ConsolePause> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <ItemGroup> - <Reference Include="glib-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"> - <SpecificVersion>False</SpecificVersion> - </Reference> - <Reference Include="pango-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"> - <SpecificVersion>False</SpecificVersion> - </Reference> - <Reference Include="atk-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"> - <SpecificVersion>False</SpecificVersion> - </Reference> - <Reference Include="gdk-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"> - <SpecificVersion>False</SpecificVersion> - </Reference> - <Reference Include="gtk-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"> - <SpecificVersion>False</SpecificVersion> - </Reference> <Reference Include="System" /> <Reference Include="Mono.Posix" /> + <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="Mono.Cairo" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Mono.Addins\Mono.Addins.csproj"> @@ -85,6 +78,14 @@ <Compile Include="gtk-gui\Mono.Addins.Gui.AddinInstallerDialog.cs" /> <Compile Include="gtk-gui\Mono.Addins.Gui.ProgressDialog.cs" /> <Compile Include="Mono.Addins.Gui\ProgressDialog.cs" /> + <Compile Include="gtk-gui\Mono.Addins.Gui.InstallDialog.cs" /> + <Compile Include="Mono.Addins.Gui\InstallDialog.cs" /> + <Compile Include="Mono.Addins.Gui\AddinInfoView.cs" /> + <Compile Include="gtk-gui\Mono.Addins.Gui.AddinInfoView.cs" /> + <Compile Include="Mono.Addins.Gui\HeaderBox.cs" /> + <Compile Include="Mono.Addins.Gui\HslColor.cs" /> + <Compile Include="Mono.Addins.Gui\SearchEntry.cs" /> + <Compile Include="Mono.Addins.Gui\HoverImageButton.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="icons\package-x-generic.png"> @@ -105,6 +106,39 @@ <EmbeddedResource Include="icons\system-software-update.png"> <LogicalName>system-software-update.png</LogicalName> </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-avail-16.png"> + <LogicalName>plugin-avail-16.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-update-16.png"> + <LogicalName>plugin-update-16.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-16.png"> + <LogicalName>plugin-16.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-32.png"> + <LogicalName>plugin-32.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-avail-32.png"> + <LogicalName>plugin-avail-32.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-update-32.png"> + <LogicalName>plugin-update-32.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-disabled-32.png"> + <LogicalName>plugin-disabled-32.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\system-software-update_22.png"> + <LogicalName>system-software-update_22.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\download.png"> + <LogicalName>download.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-22.png"> + <LogicalName>plugin-22.png</LogicalName> + </EmbeddedResource> + <EmbeddedResource Include="icons\plugin-update-22.png"> + <LogicalName>plugin-update-22.png</LogicalName> + </EmbeddedResource> </ItemGroup> <ItemGroup> <None Include="Makefile.am" /> diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs new file mode 100644 index 0000000..03f453b --- /dev/null +++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs @@ -0,0 +1,253 @@ +// +// AddinInfoView.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2011 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using Mono.Addins.Setup; +using System.Text; +using Mono.Unix; + +namespace Mono.Addins.Gui +{ + [System.ComponentModel.ToolboxItem(true)] + partial class AddinInfoView : Gtk.Bin + { + List<AddinRepositoryEntry> selectedEntry = new List<AddinRepositoryEntry> (); + List<Addin> selectedAddin = new List<Addin> (); + SetupService service; + + public event EventHandler InstallClicked; + public event EventHandler UninstallClicked; + public event EventHandler UpdateClicked; + public event EventHandler EnableDisableClicked; + + public AddinInfoView () + { + this.Build (); + AllowInstall = true; + + HeaderBox hb = new HeaderBox (1,1,1,1); + hb.Show (); + hb.Replace (this); + + hb = new HeaderBox (1,0,0,0); + hb.SetPadding (6,6,6,6); + hb.Show (); + hb.GradientBackround = true; + hb.Replace (eboxButs); + } + + public void Init (SetupService service) + { + this.service = service; + } + + public bool AllowInstall { get; set; } + + public List<AddinRepositoryEntry> SelectedEntries { + get { + return this.selectedEntry; + } + } + + public List<Addin> SelectedAddins { + get { + return this.selectedAddin; + } + } + + public void ShowAddins (object[] data) + { + selectedEntry.Clear (); + selectedAddin.Clear (); + eboxButs.Visible = true; + + if (data.Length == 1) { + headerBox.Show (); + ShowAddin (data[0]); + } + else if (data.Length > 1) { + headerBox.Hide (); + StringBuilder sb = new StringBuilder (); + sb.Append (Catalog.GetString ("Multiple selection:\n\n")); + bool allowUpdate = AllowInstall; + bool allowInstall = true; + bool allowUninstall = AllowInstall; + bool allowEnable = true; + bool allowDisable = true; + + foreach (object o in data) { + Addin installed; + if (o is Addin) { + Addin a = (Addin)o; + installed = a; + selectedAddin.Add (a); + sb.Append (a.Name); + } + else { + AddinRepositoryEntry entry = (AddinRepositoryEntry) o; + selectedEntry.Add (entry); + sb.Append (entry.Addin.Name); + installed = AddinManager.Registry.GetAddin (Addin.GetIdName (entry.Addin.Id)); + } + if (installed != null) { + if (GetUpdate (installed) == null) + allowUpdate = false; + allowInstall = false; + if (installed.Enabled) + allowEnable = false; + else + allowDisable = false; + } else + allowEnable = allowDisable = allowUninstall = allowUpdate = false; + + sb.Append ('\n'); + labelDesc.Text = sb.ToString (); + + if (allowEnable) { + btnDisable.Visible = true; + btnDisable.Label = Catalog.GetString ("Enable"); + } else if (allowDisable) { + btnDisable.Visible = true; + btnDisable.Label = Catalog.GetString ("Disable"); + } else + btnDisable.Visible = false; + btnInstall.Visible = allowInstall; + btnUninstall.Visible = allowUninstall; + btnUpdate.Visible = allowUpdate; + } + } + else { + headerBox.Hide (); + btnDisable.Visible = false; + btnInstall.Visible = false; + btnUninstall.Visible = false; + btnUpdate.Visible = false; + eboxButs.Visible = false; + labelDesc.Text = Catalog.GetString ("No selection"); + } + } + + + void ShowAddin (object data) + { + AddinHeader sinfo = null; + Addin installed = null; + AddinHeader updateInfo = null; + + if (data is Addin) { + installed = (Addin) data; + sinfo = SetupService.GetAddinHeader (installed); + updateInfo = GetUpdate (installed); + selectedEntry.Clear (); + } + else if (data is AddinRepositoryEntry) { + sinfo = ((AddinRepositoryEntry)data).Addin; + installed = AddinManager.Registry.GetAddin (Addin.GetIdName (sinfo.Id)); + if (installed != null && Addin.CompareVersions (installed.Version, sinfo.Version) > 0) + updateInfo = sinfo; + selectedEntry.Add ((AddinRepositoryEntry)data); + } else + selectedEntry.Clear (); + + selectedAddin.Add (installed); + + if (sinfo == null) { + btnDisable.Visible = false; + btnUninstall.Visible = false; + btnUpdate.Visible = false; + } else { + string version; + if (installed != null) { + btnInstall.Visible = false; + btnUpdate.Visible = updateInfo != null && AllowInstall; + btnDisable.Visible = true; + btnDisable.Label = installed.Enabled ? "Disable" : "Enable"; + btnDisable.Visible = installed.Description.CanDisable; + btnUninstall.Visible = installed.Description.CanUninstall; + version = installed.Version; + } else { + btnInstall.Visible = AllowInstall; + btnUpdate.Visible = false; + btnDisable.Visible = false; + btnUninstall.Visible = false; + version = sinfo.Version; + } + labelName.Markup = "<b><big>" + GLib.Markup.EscapeText(sinfo.Name) + "</big></b>"; + labelVersion.Text = "Version " + version; + labelDesc.Text = sinfo.Description; + } + } + + public AddinHeader GetUpdate (Addin a) + { + AddinRepositoryEntry[] updates = service.Repositories.GetAvailableAddinUpdates (Addin.GetIdName (a.Id)); + AddinHeader best = null; + string bestVersion = a.Version; + foreach (AddinRepositoryEntry e in updates) { + if (Addin.CompareVersions (bestVersion, e.Addin.Version) > 0) { + best = e.Addin; + bestVersion = e.Addin.Version; + } + } + return best; + } + + protected virtual void OnBtnInstallClicked (object sender, System.EventArgs e) + { + if (InstallClicked != null) + InstallClicked (this, e); + } + + protected virtual void OnBtnDisableClicked (object sender, System.EventArgs e) + { + if (EnableDisableClicked != null) + EnableDisableClicked (this, e); + } + + protected virtual void OnBtnUpdateClicked (object sender, System.EventArgs e) + { + if (UpdateClicked != null) + UpdateClicked (this, e); + } + + protected virtual void OnBtnUninstallClicked (object sender, System.EventArgs e) + { + if (UninstallClicked != null) + UninstallClicked (this, e); + } + + protected override void OnRealized () + { + base.OnRealized (); + HslColor gcol = ebox.Style.Background (Gtk.StateType.Normal); + gcol.L -= 0.03; + ebox.ModifyBg (Gtk.StateType.Normal, gcol); + ebox2.ModifyBg (Gtk.StateType.Normal, gcol); + scrolledwindow.ModifyBg (Gtk.StateType.Normal, gcol); + } + } +} + diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs index 5b3dcf0..5ea597d 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs +++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs @@ -30,21 +30,34 @@ using System; using Gtk; using Mono.Addins.Setup; using Mono.Addins; +using Mono.Unix; +using System.Threading; +using System.Text; +using System.Collections.Generic; namespace Mono.Addins.Gui { partial class AddinManagerDialog : Dialog, IDisposable { AddinTreeWidget tree; + AddinTreeWidget galleryTree; + AddinTreeWidget updatesTree; + SetupService service = new SetupService (); + ListStore repoStore; + int lastRepoActive; + SearchEntry filterEntry; + Label updatesTabLabel; + + const string AllRepoMarker = "__ALL"; + const string ManageRepoMarker = "__MANAGE"; internal bool AllowInstall { set { - this.btnInstall.Visible = value; - this.btnRepositories.Visible = value; - this.hseparator4.Visible = value; - this.btnUninstall.Visible = value; + addininfoInstalled.AllowInstall = value; + addininfoGallery.AllowInstall = value; + addininfoUpdates.AllowInstall = value; } } @@ -52,10 +65,113 @@ namespace Mono.Addins.Gui { Build (); TransientFor = parent; - + HasSeparator = false; + + addininfoInstalled.Init (service); + addininfoGallery.Init (service); + + addinTree.Selection.Mode = SelectionMode.Multiple; tree = new AddinTreeWidget (addinTree); - LoadAddins (); - UpdateButtons (); + addinTree.Selection.Changed += OnSelectionChanged; + tree.VersionVisible = false; + + galleryTreeView.Selection.Mode = SelectionMode.Multiple; + galleryTree = new AddinTreeWidget (galleryTreeView); + galleryTree.VersionVisible = false; + galleryTreeView.Selection.Changed += OnGallerySelectionChanged; + + updatesTreeView.Selection.Mode = SelectionMode.Multiple; + updatesTree = new AddinTreeWidget (updatesTreeView); + updatesTree.VersionVisible = false; + updatesTree.ShowCategories = false; + updatesTreeView.Selection.Changed += OnGallerySelectionChanged; + + repoStore = new ListStore (typeof(string), typeof(string)); + repoCombo.Model = repoStore; + CellRendererText crt = new CellRendererText (); + repoCombo.PackStart (crt, true); + repoCombo.AddAttribute (crt, "text", 0); + repoCombo.RowSeparatorFunc = delegate(TreeModel model, TreeIter iter) { + string val = (string) model.GetValue (iter, 0); + return val == "---"; + }; + + // Make sure the tree has the focus when switching tabs + + vboxUpdates.FocusChain = new Widget [] { scrolledUpdates, eboxRepoUpdates }; + vboxGallery.FocusChain = new Widget [] { scrolledGallery, eboxRepo }; + + // Improve the look of the headers + + HBox tab = new HBox (false, 3); + tab.PackStart (new Image (Gdk.Pixbuf.LoadFromResource ("plugin-22.png")), false, false, 0); + tab.PackStart (new Label (Catalog.GetString ("Installed")), true, true, 0); + tab.BorderWidth = 3; + tab.ShowAll (); + notebook.SetTabLabel (notebook.GetNthPage (0), tab); + + tab = new HBox (false, 3); + tab.PackStart (new Image (Gdk.Pixbuf.LoadFromResource ("plugin-update-22.png")), false, false, 0); + updatesTabLabel = new Label (Catalog.GetString ("Updates")); + tab.PackStart (updatesTabLabel, true, true, 0); + tab.BorderWidth = 3; + tab.ShowAll (); + notebook.SetTabLabel (notebook.GetNthPage (1), tab); + + tab = new HBox (false, 3); + tab.PackStart (new Image (Gdk.Pixbuf.LoadFromResource ("system-software-update_22.png")), false, false, 0); + tab.PackStart (new Label (Catalog.GetString ("Gallery")), true, true, 0); + tab.BorderWidth = 3; + tab.ShowAll (); + notebook.SetTabLabel (notebook.GetNthPage (2), tab); + + // Gradient header for the updates and gallery tabs + + HeaderBox hb = new HeaderBox (1, 0, 1, 1); + hb.SetPadding (6,6,6,6); + hb.GradientBackround = true; + hb.Show (); + hb.Replace (eboxRepo); + + hb = new HeaderBox (1, 0, 1, 1); + hb.SetPadding (6,6,6,6); + hb.GradientBackround = true; + hb.Show (); + hb.Replace (eboxRepoUpdates); + + InsertFilterEntry (); + + FillRepos (); + repoCombo.Active = 0; + + LoadAll (); + } + + void InsertFilterEntry () + { + filterEntry = new SearchEntry (); + filterEntry.Entry.SetSizeRequest (200, filterEntry.Entry.SizeRequest ().Height); + filterEntry.Parent = notebook; + filterEntry.Show (); + notebook.SizeAllocated += delegate { + RepositionFilter (); + }; + filterEntry.TextChanged += delegate { + tree.SetFilter (filterEntry.Text); + galleryTree.SetFilter (filterEntry.Text); + updatesTree.SetFilter (filterEntry.Text); + LoadAll (); + addinTree.ExpandAll (); + galleryTreeView.ExpandAll (); + }; + RepositionFilter (); + } + + void RepositionFilter () + { + int w = filterEntry.SizeRequest ().Width; + int h = filterEntry.SizeRequest ().Height; + filterEntry.Allocation = new Gdk.Rectangle (notebook.Allocation.Right - w - 1, notebook.Allocation.Y, w, h); } public override void Dispose () @@ -66,117 +182,304 @@ namespace Mono.Addins.Gui internal void OnSelectionChanged (object sender, EventArgs args) { - UpdateButtons (); + UpdateAddinInfo (); } - internal void OnInstall (object sender, EventArgs e) + internal void OnManageRepos (object sender, EventArgs e) { - AddinInstallDialog dlg = new AddinInstallDialog (service); + ManageSitesDialog dlg = new ManageSitesDialog (service); + dlg.TransientFor = this; try { dlg.Run (); - LoadAddins (); } finally { dlg.Destroy (); } } - internal void OnUpdate (object sender, EventArgs e) + void LoadAll () + { + LoadInstalled (); + LoadGallery (); + LoadUpdates (); + UpdateAddinInfo (); + } + + void UpdateAddinInfo () + { + addininfoInstalled.ShowAddins (tree.ActiveAddinsData); + addininfoGallery.ShowAddins (galleryTree.ActiveAddinsData); + addininfoUpdates.ShowAddins (updatesTree.ActiveAddinsData); + } + + void LoadInstalled () + { + object s = tree.SaveStatus (); + + bool addinsFound = false; + tree.Clear (); + foreach (Addin ainfo in AddinManager.Registry.GetAddins ()) { + if (Services.InApplicationNamespace (service, ainfo.Id) && !ainfo.Description.IsHidden) { + AddinHeader ah = SetupService.GetAddinHeader (ainfo); + if (IsFiltered (ah)) + continue; + AddinStatus st = AddinStatus.Installed; + if (addininfoInstalled.GetUpdate (ainfo) != null) + st = AddinStatus.HasUpdate; + tree.AddAddin (ah, ainfo, ainfo.Enabled, st); + addinsFound = true; + } + } + + if (addinsFound) + tree.RestoreStatus (s); + else + tree.ShowEmptyMessage (); + + UpdateAddinInfo (); + } + + void FillRepos () + { + int i = repoCombo.Active; + repoStore.Clear (); + + repoStore.AppendValues (Catalog.GetString ("All registered repositories"), AllRepoMarker); + + foreach (AddinRepository rep in service.Repositories.GetRepositories ()) { + repoStore.AppendValues (rep.Title, rep.Url); + } + repoStore.AppendValues ("---", ""); + repoStore.AppendValues (Catalog.GetString ("Manage Repositories..."), ManageRepoMarker); + repoCombo.Active = i; + } + + string GetRepoSelection () + { + Gtk.TreeIter iter; + if (!repoCombo.GetActiveIter (out iter)) + return null; + return (string) repoStore.GetValue (iter, 1); + } + + void LoadGallery () + { + object s = galleryTree.SaveStatus (); + + galleryTree.Clear (); + + string rep = GetRepoSelection (); + + AddinRepositoryEntry[] reps; + if (rep == AllRepoMarker) + reps = service.Repositories.GetAvailableAddins (); + else + reps = service.Repositories.GetAvailableAddins (rep); + + bool addinsFound = false; + + foreach (AddinRepositoryEntry arep in reps) + { + if (!Services.InApplicationNamespace (service, arep.Addin.Id)) + continue; + + if (IsFiltered (arep.Addin)) + continue; + + AddinStatus status = AddinStatus.NotInstalled; + + // Find whatever version is installed + Addin sinfo = AddinManager.Registry.GetAddin (Addin.GetIdName (arep.Addin.Id)); + + if (sinfo != null) { + if (Addin.CompareVersions (sinfo.Version, arep.Addin.Version) > 0) + status = AddinStatus.HasUpdate; + else + status = AddinStatus.Installed; + } + galleryTree.AddAddin (arep.Addin, arep, sinfo == null || sinfo.Enabled, status); + addinsFound = true; + } + + if (addinsFound) + galleryTree.RestoreStatus (s); + else + galleryTree.ShowEmptyMessage (); + } + + void LoadUpdates () + { + object s = updatesTree.SaveStatus (); + + updatesTree.Clear (); + + AddinRepositoryEntry[] reps; + reps = service.Repositories.GetAvailableAddins (); + + int count = 0; + bool addinsFound = false; + + foreach (AddinRepositoryEntry arep in reps) + { + if (!Services.InApplicationNamespace (service, arep.Addin.Id)) + continue; + + // Find whatever version is installed + Addin sinfo = AddinManager.Registry.GetAddin (Addin.GetIdName (arep.Addin.Id)); + if (sinfo == null || Addin.CompareVersions (sinfo.Version, arep.Addin.Version) <= 0) + continue; + + count++; + + if (IsFiltered (arep.Addin)) + continue; + + updatesTree.AddAddin (arep.Addin, arep, sinfo.Enabled, AddinStatus.HasUpdate); + addinsFound = true; + } + + labelUpdates.Text = string.Format (Catalog.GetPluralString ("{0} update available", "{0} updates available", count), count); + updatesTabLabel.Text = Catalog.GetString ("Updates"); + if (count > 0) + updatesTabLabel.Text += " (" + count + ")"; + + buttonUpdateAll.Visible = count > 0; + + if (addinsFound) + updatesTree.RestoreStatus (s); + else + updatesTree.ShowEmptyMessage (); + } + + bool IsFiltered (AddinHeader ah) { + if (filterEntry.Text.Length == 0) + return false; + if (ah.Name.IndexOf (filterEntry.Text, StringComparison.CurrentCultureIgnoreCase) != -1) + return false; + if (ah.Description.IndexOf (filterEntry.Text, StringComparison.CurrentCultureIgnoreCase) != -1) + return false; + if (ah.Id.IndexOf (filterEntry.Text, StringComparison.CurrentCultureIgnoreCase) != -1) + return false; + return true; } - internal void OnUninstall (object sender, EventArgs e) + void ManageSites () { - AddinHeader info = (AddinHeader) tree.ActiveAddin; - AddinInstallDialog dlg = new AddinInstallDialog (service); + ManageSitesDialog dlg = new ManageSitesDialog (service); + dlg.TransientFor = this; try { - dlg.SetUninstallMode (info); dlg.Run (); - LoadAddins (); + repoCombo.Active = lastRepoActive; + FillRepos (); } finally { dlg.Destroy (); } } - internal void OnEnable (object sender, EventArgs e) + protected virtual void OnRepoComboChanged (object sender, System.EventArgs e) { - try { - Addin sinfo = (Addin) tree.ActiveAddinData; - if (sinfo == null) - return; - sinfo.Enabled = true; - LoadAddins (); - } - catch (Exception ex) { - Services.ShowError (ex, null, this, true); + if (GetRepoSelection () == ManageRepoMarker) + ManageSites (); + else + LoadGallery (); + lastRepoActive = repoCombo.Active; + } + + protected virtual void OnGallerySelectionChanged (object sender, System.EventArgs e) + { + UpdateAddinInfo (); + } + + protected virtual void OnButtonRefreshClicked (object sender, System.EventArgs e) + { + ProgressDialog pdlg = new ProgressDialog (); + pdlg.Show (); + pdlg.SetMessage (AddinManager.CurrentLocalizer.GetString ("Updating repository")); + bool updateDone = false; + + Thread t = new Thread (delegate () { + try { + service.Repositories.UpdateAllRepositories (pdlg); + } finally { + updateDone = true; + } + }); + t.Start (); + while (!updateDone) { + while (Gtk.Application.EventsPending ()) + Gtk.Application.RunIteration (); + Thread.Sleep (50); } + pdlg.Destroy (); + LoadGallery (); + LoadUpdates (); } - internal void OnDisable (object sender, EventArgs e) + protected virtual void OnInstallClicked (object sender, System.EventArgs e) { + InstallDialog dlg = new InstallDialog (this, service); try { - Addin sinfo = (Addin) tree.ActiveAddinData; - if (sinfo == null) - return; - sinfo.Enabled = false; - LoadAddins (); - } - catch (Exception ex) { - Services.ShowError (ex, null, this, true); + List<AddinRepositoryEntry> selectedEntry = ((AddinInfoView)sender).SelectedEntries; + dlg.InitForInstall (selectedEntry.ToArray ()); + if (dlg.Run () == (int) Gtk.ResponseType.Ok) + LoadAll (); + } finally { + dlg.Destroy (); } } - internal void OnShowInfo (object sender, EventArgs e) + protected virtual void OnUninstallClicked (object sender, System.EventArgs e) { - Addin sinfo = (Addin) tree.ActiveAddinData; - if (sinfo == null) - return; - - AddinInfoDialog dlg = new AddinInfoDialog (SetupService.GetAddinHeader (sinfo)); + List<Addin> selectedAddin = ((AddinInfoView)sender).SelectedAddins; + InstallDialog dlg = new InstallDialog (this, service); try { - dlg.Run (); + dlg.InitForUninstall (selectedAddin.ToArray ()); + if (dlg.Run () == (int) Gtk.ResponseType.Ok) { + LoadAll (); + } } finally { dlg.Destroy (); } } - internal void OnManageRepos (object sender, EventArgs e) + protected virtual void OnUpdateClicked (object sender, System.EventArgs e) { - ManageSitesDialog dlg = new ManageSitesDialog (service); - dlg.TransientFor = this; + List<AddinRepositoryEntry> selectedEntry = ((AddinInfoView)sender).SelectedEntries; + InstallDialog dlg = new InstallDialog (this, service); try { - dlg.Run (); + dlg.InitForInstall (selectedEntry.ToArray ()); + if (dlg.Run () == (int) Gtk.ResponseType.Ok) + LoadAll (); } finally { dlg.Destroy (); } } - void LoadAddins () + protected virtual void OnEnableDisableClicked (object sender, System.EventArgs e) { - object s = tree.SaveStatus (); - - tree.Clear (); - foreach (Addin ainfo in AddinManager.Registry.GetAddins ()) { - if (Services.InApplicationNamespace (service, ainfo.Id) && !ainfo.Description.IsHidden) - tree.AddAddin (SetupService.GetAddinHeader (ainfo), ainfo, ainfo.Enabled, ainfo.IsUserAddin); + try { + foreach (Addin a in ((AddinInfoView)sender).SelectedAddins) { + a.Enabled = !a.Enabled; + } + LoadAll (); + } + catch (Exception ex) { + Services.ShowError (ex, null, this, true); } - - tree.RestoreStatus (s); - UpdateButtons (); } - void UpdateButtons () + protected virtual void OnUpdateAll (object sender, System.EventArgs e) { - Addin sinfo = (Addin) tree.ActiveAddinData; - if (sinfo == null) { - btnEnable.Sensitive = false; - btnDisable.Sensitive = false; - btnUninstall.Sensitive = false; - btnInfo.Sensitive = false; - } else { - btnEnable.Sensitive = !sinfo.Enabled && sinfo.Description.CanDisable; - btnDisable.Sensitive = sinfo.Enabled && sinfo.Description.CanDisable; - btnUninstall.Sensitive = true && sinfo.Description.CanUninstall; - btnInfo.Sensitive = true; + object[] data = updatesTree.AddinsData; + AddinRepositoryEntry[] entries = new AddinRepositoryEntry [data.Length]; + Array.Copy (data, entries, data.Length); + InstallDialog dlg = new InstallDialog (this, service); + try { + dlg.InitForInstall (entries); + if (dlg.Run () == (int) Gtk.ResponseType.Ok) + LoadAll (); + } finally { + dlg.Destroy (); } } } diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs index 22a53c5..4f90e57 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs +++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinTreeWidget.cs @@ -34,6 +34,8 @@ using Gdk; using Mono.Addins; using Mono.Addins.Setup; using Mono.Unix; +using System.Collections.Generic; +using System.Text; namespace Mono.Addins.Gui { @@ -44,9 +46,13 @@ namespace Mono.Addins.Gui bool allowSelection; ArrayList selected = new ArrayList (); Hashtable addinData = new Hashtable (); + TreeViewColumn versionColumn; + string filter; - Gdk.Pixbuf package; - Gdk.Pixbuf userPackage; + Gdk.Pixbuf iconInstalled; + Gdk.Pixbuf iconNotInstalled; + Gdk.Pixbuf iconHasUpdate; + Gdk.Pixbuf iconDisabled; public event EventHandler SelectionChanged; @@ -61,8 +67,10 @@ namespace Mono.Addins.Gui public AddinTreeWidget (Gtk.TreeView treeView) { - package = Gdk.Pixbuf.LoadFromResource ("package-x-generic_22.png"); - userPackage = Gdk.Pixbuf.LoadFromResource ("user-package.png"); + iconInstalled = Gdk.Pixbuf.LoadFromResource ("plugin-32.png"); + iconNotInstalled = Gdk.Pixbuf.LoadFromResource ("plugin-avail-32.png"); + iconHasUpdate = Gdk.Pixbuf.LoadFromResource ("plugin-update-32.png"); + iconDisabled = Gdk.Pixbuf.LoadFromResource ("plugin-disabled-32.png"); this.treeView = treeView; ArrayList list = new ArrayList (); @@ -71,6 +79,17 @@ namespace Mono.Addins.Gui treeStore = new Gtk.TreeStore (types); treeView.Model = treeStore; CreateColumns (); + ShowCategories = true; + } + + internal void SetFilter (string text) + { + this.filter = text; + } + + internal void ShowEmptyMessage () + { + treeStore.AppendValues (null, null, Catalog.GetString ("No add-ins found"), "", false, false, null, false); } protected virtual void AddStoreTypes (ArrayList list) @@ -112,6 +131,7 @@ namespace Mono.Addins.Gui col.Title = Catalog.GetString ("Version"); col.PackStart (crt, true); col.AddAttribute (crt, "markup", ColVersion); + versionColumn = col; treeView.AppendColumn (col); } @@ -120,6 +140,18 @@ namespace Mono.Addins.Gui set { allowSelection = value; } } + public bool VersionVisible { + get { + return versionColumn.Visible; + } + set { + versionColumn.Visible = value; + treeView.HeadersVisible = value; + } + } + + public bool ShowCategories { get; set; } + void OnAddinToggled (object o, ToggledArgs args) { TreeIter it; @@ -151,27 +183,40 @@ namespace Mono.Addins.Gui public TreeIter AddAddin (AddinHeader info, object dataItem, bool enabled) { - return AddAddin (info, dataItem, enabled, false); + return AddAddin (info, dataItem, enabled, true); } public TreeIter AddAddin (AddinHeader info, object dataItem, bool enabled, bool userDir) { - Gdk.Pixbuf icon; - if (userDir) - icon = userPackage; - else - icon = package; + return AddAddin (info, dataItem, enabled, AddinStatus.Installed); + } + + public TreeIter AddAddin (AddinHeader info, object dataItem, bool enabled, AddinStatus status) + { + Gdk.Pixbuf icon = null; + switch (status) { + case AddinStatus.HasUpdate: icon = iconHasUpdate; break; + case AddinStatus.Installed: icon = iconInstalled; break; + case AddinStatus.NotInstalled: icon = iconNotInstalled; break; + } + + if (!enabled) + icon = iconDisabled; addinData [info] = dataItem; - TreeIter piter = TreeIter.Zero; - if (info.Category == "") { - string otherCat = Catalog.GetString ("Other"); - piter = FindCategory (otherCat); + TreeIter iter; + if (ShowCategories) { + TreeIter piter = TreeIter.Zero; + if (info.Category == "") { + string otherCat = Catalog.GetString ("Other"); + piter = FindCategory (otherCat); + } else { + piter = FindCategory (info.Category); + } + iter = treeStore.AppendNode (piter); } else { - piter = FindCategory (info.Category); + iter = treeStore.AppendNode (); } - - TreeIter iter = treeStore.AppendNode (piter); UpdateRow (iter, info, dataItem, enabled, icon); return iter; } @@ -183,13 +228,22 @@ namespace Mono.Addins.Gui treeStore.SetValue (iter, ColAddin, info); treeStore.SetValue (iter, ColData, dataItem); + string name = EscapeWithFilterMarker (info.Name); + if (!string.IsNullOrEmpty (info.Description)) { + string desc = info.Description; + int i = desc.IndexOf ('\n'); + if (i != -1) + desc = desc.Substring (0, i); + name += "\n<small><span foreground=\"darkgrey\">" + EscapeWithFilterMarker (desc) + "</span></small>"; + } + if (enabled) { - treeStore.SetValue (iter, ColName, info.Name); + treeStore.SetValue (iter, ColName, name); treeStore.SetValue (iter, ColVersion, info.Version); treeStore.SetValue (iter, ColAllowSelection, allowSelection); } else { - treeStore.SetValue (iter, ColName, "<span foreground=\"grey\">" + info.Name + "</span>"); + treeStore.SetValue (iter, ColName, "<span foreground=\"grey\">" + name + "</span>"); treeStore.SetValue (iter, ColVersion, "<span foreground=\"grey\">" + info.Version + "</span>"); treeStore.SetValue (iter, ColAllowSelection, false); } @@ -200,6 +254,25 @@ namespace Mono.Addins.Gui treeStore.SetValue (iter, ColSelected, sel); } + string EscapeWithFilterMarker (string txt) + { + if (string.IsNullOrEmpty (filter)) + return GLib.Markup.EscapeText (txt); + + StringBuilder sb = new StringBuilder (); + int last = 0; + int i = txt.IndexOf (filter, StringComparison.CurrentCultureIgnoreCase); + while (i != -1) { + sb.Append (GLib.Markup.EscapeText (txt.Substring (last, i - last))); + sb.Append ("<span color='blue'>").Append (txt.Substring (i, filter.Length)).Append ("</span>"); + last = i + filter.Length; + i = txt.IndexOf (filter, last, StringComparison.CurrentCultureIgnoreCase); + } + if (last < txt.Length) + sb.Append (GLib.Markup.EscapeText (txt.Substring (last, txt.Length - last))); + return sb.ToString (); + } + public object GetAddinData (AddinHeader info) { return addinData [info]; @@ -248,12 +321,25 @@ namespace Mono.Addins.Gui public AddinHeader ActiveAddin { get { - Gtk.TreeModel foo; - Gtk.TreeIter iter; - if (!treeView.Selection.GetSelected (out foo, out iter)) + AddinHeader[] sel = ActiveAddins; + if (sel.Length > 0) + return sel[0]; + else return null; - - return (AddinHeader) treeStore.GetValue (iter, 0); + } + } + + public AddinHeader[] ActiveAddins { + get { + List<AddinHeader> list = new List<AddinHeader> (); + foreach (TreePath p in treeView.Selection.GetSelectedRows ()) { + TreeIter iter; + treeStore.GetIter (out iter, p); + AddinHeader ah = (AddinHeader) treeStore.GetValue (iter, 0); + if (ah != null) + list.Add (ah); + } + return list.ToArray (); } } @@ -264,17 +350,31 @@ namespace Mono.Addins.Gui } } + public object[] ActiveAddinsData { + get { + List<object> res = new List<object> (); + foreach (AddinHeader ai in ActiveAddins) { + res.Add (GetAddinData (ai)); + } + return res.ToArray (); + } + } + + public object[] AddinsData { + get { + object[] data = new object [addinData.Count]; + addinData.Values.CopyTo (data, 0); + return data; + } + } + public object SaveStatus () { TreeIter iter; ArrayList list = new ArrayList (); // Save the current selection - Gtk.TreeModel foo; - if (treeView.Selection.GetSelected (out foo, out iter)) - list.Add (treeStore.GetPath (iter)); - else - list.Add (null); + list.Add (treeView.Selection.GetSelectedRows ()); if (!treeStore.GetIterFirst (out iter)) return null; @@ -306,14 +406,14 @@ namespace Mono.Addins.Gui // The first element is the selection ArrayList list = (ArrayList) ob; - TreePath selpath = (TreePath) list [0]; + TreePath[] selpaths = (TreePath[]) list [0]; list.RemoveAt (0); foreach (TreePath path in list) treeView.ExpandRow (path, false); - - if (selpath != null) - treeView.Selection.SelectPath (selpath); + + foreach (TreePath p in selpaths) + treeView.Selection.SelectPath (p); } public void SelectAll () @@ -372,4 +472,11 @@ namespace Mono.Addins.Gui } } } + + public enum AddinStatus + { + NotInstalled, + Installed, + HasUpdate + } } diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/HeaderBox.cs b/Mono.Addins.Gui/Mono.Addins.Gui/HeaderBox.cs new file mode 100644 index 0000000..078c447 --- /dev/null +++ b/Mono.Addins.Gui/Mono.Addins.Gui/HeaderBox.cs @@ -0,0 +1,160 @@ +// +// HeaderBox.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2011 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using Gtk; + +namespace Mono.Addins.Gui +{ + class HeaderBox: Bin + { + Gtk.Widget child; + int topMargin; + int bottomMargin; + int leftMargin; + int rightMargin; + + int topPadding; + int bottomPadding; + int leftPadding; + int rightPadding; + + public HeaderBox () + { + } + + public HeaderBox (int topMargin, int bottomMargin, int leftMargin, int rightMargin) + { + SetMargins (topMargin, bottomMargin, leftMargin, rightMargin); + } + + public void Replace (Gtk.Bin parent) + { + Gtk.Widget c = parent.Child; + parent.Remove (c); + Add (c); + parent.Add (this); + } + + public void SetMargins (int topMargin, int bottomMargin, int leftMargin, int rightMargin) + { + this.topMargin = topMargin; + this.bottomMargin = bottomMargin; + this.leftMargin = leftMargin; + this.rightMargin = rightMargin; + } + + public void SetPadding (int topPadding, int bottomPadding, int leftPadding, int rightPadding) + { + this.topPadding = topPadding; + this.bottomPadding = bottomPadding; + this.leftPadding = leftPadding; + this.rightPadding = rightPadding; + } + + public bool GradientBackround { get; set; } + + protected override void OnAdded (Widget widget) + { + base.OnAdded (widget); + child = widget; + } + + protected override void OnSizeRequested (ref Requisition requisition) + { + if (child != null) { + requisition = child.SizeRequest (); + requisition.Width += leftMargin + rightMargin + leftPadding + rightPadding; + requisition.Height += topMargin + bottomMargin + topPadding + bottomPadding; + } else { + requisition.Width = 0; + requisition.Height = 0; + } + } + + protected override void OnSizeAllocated (Gdk.Rectangle allocation) + { + base.OnSizeAllocated (allocation); + if (allocation.Width > leftMargin + rightMargin + leftPadding + rightPadding) { + allocation.X += leftMargin + leftPadding; + allocation.Width -= leftMargin + rightMargin + leftPadding + rightPadding; + } + if (allocation.Height > topMargin + bottomMargin + topPadding + bottomPadding) { + allocation.Y += topMargin + topPadding; + allocation.Height -= topMargin + bottomMargin + topPadding + bottomPadding; + } + if (child != null) + child.SizeAllocate (allocation); + } + + protected override bool OnExposeEvent (Gdk.EventExpose evnt) + { + Gdk.Rectangle rect; + + if (GradientBackround) { + rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); + HslColor gcol = Parent.Style.Background (Gtk.StateType.Normal); + + using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { + cr.NewPath (); + cr.MoveTo (rect.X, rect.Y); + cr.RelLineTo (rect.Width, 0); + cr.RelLineTo (0, rect.Height); + cr.RelLineTo (-rect.Width, 0); + cr.RelLineTo (0, -rect.Height); + cr.ClosePath (); + Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, rect.Bottom); + Cairo.Color color1 = gcol; + pat.AddColorStop (0, color1); + gcol.L -= 0.1; + if (gcol.L < 0) gcol.L = 0; + pat.AddColorStop (1, gcol); + cr.Pattern = pat; + cr.FillPreserve (); + } + } + + bool res = base.OnExposeEvent (evnt); + + Gdk.GC borderColor = Parent.Style.DarkGC (Gtk.StateType.Normal); + + rect = Allocation; + for (int n=0; n<topMargin; n++) + GdkWindow.DrawLine (borderColor, rect.X, rect.Y + n, rect.Right - 1, rect.Y + n); + + for (int n=0; n<bottomMargin; n++) + GdkWindow.DrawLine (borderColor, rect.X, rect.Bottom - n - 1, rect.Right - 1, rect.Bottom - n - 1); + + for (int n=0; n<leftMargin; n++) + GdkWindow.DrawLine (borderColor, rect.X + n, rect.Y, rect.X + n, rect.Bottom - 1); + + for (int n=0; n<rightMargin; n++) + GdkWindow.DrawLine (borderColor, rect.Right - n - 1, rect.Y, rect.Right - n - 1, rect.Bottom - 1); + + return res; + } + } +} + diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/HoverImageButton.cs b/Mono.Addins.Gui/Mono.Addins.Gui/HoverImageButton.cs new file mode 100644 index 0000000..504ce98 --- /dev/null +++ b/Mono.Addins.Gui/Mono.Addins.Gui/HoverImageButton.cs @@ -0,0 +1,266 @@ +/*************************************************************************** + * HoverImageButton.cs + * + * Copyright (C) 2007 Novell, Inc. + * Written by Aaron Bockover <abockover@novell.com> + ****************************************************************************/ + +/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW: + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using Gtk; + +namespace Mono.Addins.Gui +{ + class HoverImageButton : EventBox + { + private static Gdk.Cursor hand_cursor = new Gdk.Cursor(Gdk.CursorType.Hand1); + + private IconSize icon_size = IconSize.Menu; + private string [] icon_names = { "image-missing", Stock.MissingImage }; + private Gdk.Pixbuf normal_pixbuf; + private Gdk.Pixbuf active_pixbuf; + private Image image; + private bool is_hovering; + private bool is_pressed; + + private bool draw_focus = true; + + private event EventHandler clicked; + + public event EventHandler Clicked { + add { clicked += value; } + remove { clicked -= value; } + } + + public HoverImageButton() + { + CanFocus = true; + + image = new Image(); + image.Show(); + Add(image); + } + + public HoverImageButton(IconSize size, string icon_name) : this(size, new string [] { icon_name }) + { + } + + public HoverImageButton(IconSize size, string [] icon_names) : this() + { + this.icon_size = size; + this.icon_names = icon_names; + } + + public new void Activate() + { + EventHandler handler = clicked; + if(handler != null) { + handler(this, EventArgs.Empty); + } + } + + private bool changing_style = false; + protected override void OnStyleSet(Style previous_style) + { + if(changing_style) { + return; + } + + changing_style = true; + if (normal_pixbuf == null) + LoadPixbufs(); + changing_style = false; + } + + protected override bool OnEnterNotifyEvent(Gdk.EventCrossing evnt) + { + image.GdkWindow.Cursor = hand_cursor; + is_hovering = true; + UpdateImage(); + return base.OnEnterNotifyEvent(evnt); + } + + protected override bool OnLeaveNotifyEvent(Gdk.EventCrossing evnt) + { + is_hovering = false; + UpdateImage(); + return base.OnLeaveNotifyEvent(evnt); + } + + protected override bool OnFocusInEvent(Gdk.EventFocus evnt) + { + bool ret = base.OnFocusInEvent(evnt); + UpdateImage(); + return ret; + } + + protected override bool OnFocusOutEvent(Gdk.EventFocus evnt) + { + bool ret = base.OnFocusOutEvent(evnt); + UpdateImage(); + return ret; + } + + protected override bool OnButtonPressEvent(Gdk.EventButton evnt) + { + if(evnt.Button != 1) { + return base.OnButtonPressEvent(evnt); + } + + HasFocus = true; + is_pressed = true; + QueueDraw(); + + return base.OnButtonPressEvent(evnt); + } + + protected override bool OnButtonReleaseEvent(Gdk.EventButton evnt) + { + if(evnt.Button != 1) { + return base.OnButtonReleaseEvent(evnt); + } + + is_pressed = false; + QueueDraw(); + Activate(); + + return base.OnButtonReleaseEvent(evnt); + } + + protected override bool OnExposeEvent(Gdk.EventExpose evnt) + { + base.OnExposeEvent(evnt); + + PropagateExpose(Child, evnt); + + if(HasFocus && draw_focus) { + Style.PaintFocus(Style, GdkWindow, StateType.Normal, evnt.Area, this, "button", + 0, 0, Allocation.Width, Allocation.Height); + } + + return true; + } + + private void UpdateImage() + { + image.Pixbuf = is_hovering || is_pressed || HasFocus + ? active_pixbuf : normal_pixbuf; + } + + private void LoadPixbufs() + { + int width, height; + Icon.SizeLookup(icon_size, out width, out height); + IconTheme theme = IconTheme.GetForScreen(Screen); + + if(normal_pixbuf != null) { + normal_pixbuf.Dispose(); + normal_pixbuf = null; + } + + if(active_pixbuf != null) { + active_pixbuf.Dispose(); + active_pixbuf = null; + } + + for(int i = 0; i < icon_names.Length; i++) { + try { + normal_pixbuf = theme.LoadIcon(icon_names[i], width, 0); + active_pixbuf = ColorShiftPixbuf(normal_pixbuf, 30); + break; + } catch { + } + } + + UpdateImage(); + } + + public Gdk.Pixbuf Pixbuf { + get { return this.normal_pixbuf; } + set { + this.normal_pixbuf = value; + active_pixbuf = ColorShiftPixbuf(normal_pixbuf, 30); + UpdateImage(); + } + } + + + private static byte PixelClamp(int val) + { + return (byte)System.Math.Max(0, System.Math.Min(255, val)); + } + + private unsafe Gdk.Pixbuf ColorShiftPixbuf(Gdk.Pixbuf src, byte shift) + { + Gdk.Pixbuf dest = new Gdk.Pixbuf(src.Colorspace, src.HasAlpha, src.BitsPerSample, src.Width, src.Height); + + byte *src_pixels_orig = (byte *)src.Pixels; + byte *dest_pixels_orig = (byte *)dest.Pixels; + + for(int i = 0; i < src.Height; i++) { + byte *src_pixels = src_pixels_orig + i * src.Rowstride; + byte *dest_pixels = dest_pixels_orig + i * dest.Rowstride; + + for(int j = 0; j < src.Width; j++) { + *(dest_pixels++) = PixelClamp(*(src_pixels++) + shift); + *(dest_pixels++) = PixelClamp(*(src_pixels++) + shift); + *(dest_pixels++) = PixelClamp(*(src_pixels++) + shift); + + if(src.HasAlpha) { + *(dest_pixels++) = *(src_pixels++); + } + } + } + + return dest; + } + + public string [] IconNames { + get { return icon_names; } + set { + icon_names = value; + LoadPixbufs(); + } + } + + public IconSize IconSize { + get { return icon_size; } + set { + icon_size = value; + LoadPixbufs(); + } + } + + public Image Image { + get { return image; } + } + + public bool DrawFocus { + get { return draw_focus; } + set { + draw_focus = value; + QueueDraw(); + } + } + } +} diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/HslColor.cs b/Mono.Addins.Gui/Mono.Addins.Gui/HslColor.cs new file mode 100644 index 0000000..0862ffa --- /dev/null +++ b/Mono.Addins.Gui/Mono.Addins.Gui/HslColor.cs @@ -0,0 +1,164 @@ +// +// HslColor.cs +// +// Author: +// Mike Krüger <mkrueger@novell.com> +// +// Copyright (c) 2009 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using Gdk; + +namespace Mono.Addins.Gui +{ + struct HslColor + { + public double H { + get; + set; + } + + public double S { + get; + set; + } + + public double L { + get; + set; + } + + static Gdk.Color black = new Gdk.Color (0, 0, 0); + public static implicit operator Color (HslColor hsl) + { + if (hsl.L > 1) hsl.L = 1; + if (hsl.L < 0) hsl.L = 0; + if (hsl.H > 1) hsl.H = 1; + if (hsl.H < 0) hsl.H = 0; + if (hsl.S > 1) hsl.S = 1; + if (hsl.S < 0) hsl.S = 0; + + double r = 0, g = 0, b = 0; + + if (hsl.L == 0) + return black; + + if (hsl.S == 0) { + r = g = b = hsl.L; + } else { + double temp2 = hsl.L <= 0.5 ? hsl.L * (1.0 + hsl.S) : hsl.L + hsl.S -(hsl.L * hsl.S); + double temp1 = 2.0 * hsl.L - temp2; + + double[] t3 = new double[] { hsl.H + 1.0 / 3.0, hsl.H, hsl.H - 1.0 / 3.0}; + double[] clr= new double[] { 0, 0, 0}; + for (int i = 0; i < 3; i++) { + if (t3[i] < 0) + t3[i] += 1.0; + if (t3[i] > 1) + t3[i]-=1.0; + if (6.0 * t3[i] < 1.0) + clr[i] = temp1 + (temp2 - temp1) * t3[i] * 6.0; + else if (2.0 * t3[i] < 1.0) + clr[i] = temp2; + else if (3.0 * t3[i] < 2.0) + clr[i] = (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - t3[i]) * 6.0); + else + clr[i] = temp1; + } + + r = clr[0]; + g = clr[1]; + b = clr[2]; + } + return new Color ((byte)(255 * r), + (byte)(255 * g), + (byte)(255 * b)); + } + + public static Cairo.Color ToCairoColor (Gdk.Color color) + { + return new Cairo.Color ((double)color.Red / ushort.MaxValue, + (double)color.Green / ushort.MaxValue, + (double)color.Blue / ushort.MaxValue); + } + + public static implicit operator Cairo.Color (HslColor hsl) + { + return ToCairoColor ((Gdk.Color)hsl); + } + + public static implicit operator HslColor (Color color) + { + return new HslColor (color); + } + + public HslColor (Color color) : this () + { + double r = color.Red / (double)ushort.MaxValue; + double g = color.Green / (double)ushort.MaxValue; + double b = color.Blue / (double)ushort.MaxValue; + + double v = System.Math.Max (r, g); + v = System.Math.Max (v, b); + + double m = System.Math.Min (r, g); + m = System.Math.Min (m, b); + + this.L = (m + v) / 2.0; + if (this.L <= 0.0) + return; + double vm = v - m; + this.S = vm; + + if (this.S > 0.0) { + this.S /= (this.L <= 0.5) ? (v + m) : (2.0 - v - m); + } else { + return; + } + + double r2 = (v - r) / vm; + double g2 = (v - g) / vm; + double b2 = (v - b) / vm; + + if (r == v) { + this.H = (g == m ? 5.0 + b2 : 1.0 - g2); + } else if (g == v) { + this.H = (b == m ? 1.0 + r2 : 3.0 - b2); + } else { + this.H = (r == m ? 3.0 + g2 : 5.0 - r2); + } + this.H /= 6.0; + } + + public static double Brightness (Gdk.Color c) + { + double r = c.Red / (double)ushort.MaxValue; + double g = c.Green / (double)ushort.MaxValue; + double b = c.Blue / (double)ushort.MaxValue; + return System.Math.Sqrt (r * .241 + g * .691 + b * .068); + } + + public override string ToString () + { + return string.Format ("[HslColor: H={0}, S={1}, L={2}]", H, S, L); + } + } +} diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/InstallDialog.cs b/Mono.Addins.Gui/Mono.Addins.Gui/InstallDialog.cs new file mode 100644 index 0000000..0585bbc --- /dev/null +++ b/Mono.Addins.Gui/Mono.Addins.Gui/InstallDialog.cs @@ -0,0 +1,239 @@ +// +// InstallDialog.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2011 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using Mono.Addins.Setup; +using Mono.Addins.Description; +using System.Text; +using Mono.Unix; +using System.Threading; + +namespace Mono.Addins.Gui +{ + internal partial class InstallDialog : Gtk.Dialog + { + AddinRepositoryEntry[] addinsToInstall; + PackageCollection packagesToInstall; + SetupService service; + Gtk.ResponseType response = Gtk.ResponseType.None; + string uninstallId; + InstallMonitor installMonitor; + bool installing; + + public InstallDialog (Gtk.Window parent, SetupService service) + { + this.Build (); + this.service = service; + TransientFor = parent; + WindowPosition = Gtk.WindowPosition.CenterOnParent; + boxProgress.Visible = false; + } + + public void InitForInstall (AddinRepositoryEntry[] addinsToInstall) + { + this.addinsToInstall = addinsToInstall; + FillSummaryPage (); + } + + public void InitForUninstall (Addin[] info) + { + this.uninstallId = info[0].Id; + + StringBuilder sb = new StringBuilder (); + sb.Append ("<b>").Append (Catalog.GetString ("The following packages will be uninstalled:")).Append ("</b>\n\n"); + sb.Append (info[0].Name + "\n\n"); + + Addin[] sinfos = service.GetDependentAddins (uninstallId, true); + if (sinfos.Length > 0) { + sb.Append ("<b>").Append (Catalog.GetString ("There are other add-ins that depend on the previous ones which will also be uninstalled:")).Append ("</b>\n\n"); + foreach (Addin si in sinfos) + sb.Append (si.Description.Name + "\n"); + } + ShowMessage (sb.ToString ()); + } + + void FillSummaryPage () + { + PackageCollection packs = new PackageCollection (); + foreach (AddinRepositoryEntry arep in addinsToInstall) { + packs.Add (Package.FromRepository (arep)); + } + + packagesToInstall = new PackageCollection (packs); + + PackageCollection toUninstall; + DependencyCollection unresolved; + bool res; + + InstallMonitor m = new InstallMonitor (); + res = service.ResolveDependencies (m, packs, out toUninstall, out unresolved); + + StringBuilder sb = new StringBuilder (); + if (!res) { + sb.Append ("<b><span foreground=\"red\">").Append (Catalog.GetString ("The selected add-ins can't be installed because there are dependency conflicts.")).Append ("</span></b>\n"); + foreach (string s in m.Errors) { + sb.Append ("<b><span foreground=\"red\">" + s + "</span></b>\n"); + } + sb.Append ("\n"); + } + + if (m.Warnings.Count != 0) { + foreach (string w in m.Warnings) { + sb.Append ("<b><span foreground=\"red\">" + w + "</span></b>\n"); + } + sb.Append ("\n"); + } + + sb.Append ("<b>").Append (Catalog.GetString ("The following packages will be installed:")).Append ("</b>\n\n"); + foreach (Package p in packs) { + sb.Append (p.Name); + if (!p.SharedInstall) + sb.Append (Catalog.GetString (" (in user directory)")); + sb.Append ("\n"); + } + sb.Append ("\n"); + + if (toUninstall.Count > 0) { + sb.Append ("<b>").Append (Catalog.GetString ("The following packages need to be uninstalled:")).Append ("</b>\n\n"); + foreach (Package p in toUninstall) { + sb.Append (p.Name + "\n"); + } + sb.Append ("\n"); + } + + if (unresolved.Count > 0) { + sb.Append ("<b>").Append (Catalog.GetString ("The following dependencies could not be resolved:")).Append ("</b>\n\n"); + foreach (Dependency p in unresolved) { + sb.Append (p.Name + "\n"); + } + sb.Append ("\n"); + } + buttonOk.Sensitive = res; + ShowMessage (sb.ToString ()); + } + + void ShowMessage (string txt) + { + labelInfo.Markup = txt; + if (labelInfo.SizeRequest ().Height > 400) + scrolledwindow1.VscrollbarPolicy = Gtk.PolicyType.Automatic; + } + + protected virtual void OnButtonOkClicked (object sender, System.EventArgs e) + { + if (response != Gtk.ResponseType.None) { + Respond (response); + return; + } + Install (); + } + + protected virtual void OnButtonCancelClicked (object sender, System.EventArgs e) + { + if (installing) { + if (Services.AskQuestion (Catalog.GetString ("Are you sure you want to cancel the installation?"))) + installMonitor.Cancel (); + } else + Respond (Gtk.ResponseType.Cancel); + } + + void Install () + { + boxProgress.Visible = true; + buttonOk.Sensitive = false; + + string txt; + string errmessage; + string warnmessage; + + ThreadStart oper; + + if (uninstallId == null) { + installMonitor = new InstallMonitor (globalProgressLabel, mainProgressBar, Catalog.GetString ("Installing Add-ins")); + oper = new ThreadStart (RunInstall); + errmessage = Catalog.GetString ("The installation failed!"); + warnmessage = Catalog.GetString ("The installation has completed with warnings."); + } else { + installMonitor = new InstallMonitor (globalProgressLabel, mainProgressBar, Catalog.GetString ("Uninstalling Add-ins")); + oper = new ThreadStart (RunUninstall); + errmessage = Catalog.GetString ("The uninstallation failed!"); + warnmessage = Catalog.GetString ("The uninstallation has completed with warnings."); + } + + Thread t = new Thread (oper); + t.Start (); + + installing = true; + installMonitor.WaitForCompleted (); + installing = false; + + buttonCancel.Visible = false; + buttonOk.Label = Gtk.Stock.Close; + buttonOk.UseStock = true; + + if (installMonitor.Success && installMonitor.Warnings.Count == 0) { + Respond (Gtk.ResponseType.Ok); + return; + } else if (installMonitor.Success) { + txt = "<b>" + warnmessage + "</b>\n\n"; + foreach (string s in installMonitor.Warnings) + txt += GLib.Markup.EscapeText (s) + "\n"; + response = Gtk.ResponseType.Ok; + } else { + buttonCancel.Label = Gtk.Stock.Close; + buttonCancel.UseStock = true; + txt = "<span foreground=\"red\"><b>" + errmessage + "</b></span>\n\n"; + foreach (string s in installMonitor.Errors) + txt += GLib.Markup.EscapeText (s) + "\n"; + response = Gtk.ResponseType.Cancel; + } + + ShowMessage (txt); + } + + void RunInstall () + { + try { + service.Install (installMonitor, packagesToInstall); + } catch { + // Nothing + } finally { + installMonitor.Dispose (); + } + } + + void RunUninstall () + { + try { + service.Uninstall (installMonitor, uninstallId); + } catch { + // Nothing + } finally { + installMonitor.Dispose (); + } + } + } +} + diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/ManageSitesDialog.cs b/Mono.Addins.Gui/Mono.Addins.Gui/ManageSitesDialog.cs index 668f918..6dae61c 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui/ManageSitesDialog.cs +++ b/Mono.Addins.Gui/Mono.Addins.Gui/ManageSitesDialog.cs @@ -48,15 +48,13 @@ namespace Mono.Addins.Gui this.service = service; treeStore = new Gtk.ListStore (typeof (string), typeof (string)); repoTree.Model = treeStore; - repoTree.HeadersVisible = true; - repoTree.AppendColumn (Catalog.GetString ("Name"), new Gtk.CellRendererText (), "text", 1); - repoTree.AppendColumn (Catalog.GetString ("Url"), new Gtk.CellRendererText (), "text", 0); + repoTree.HeadersVisible = false; + repoTree.AppendColumn ("", new Gtk.CellRendererText (), "markup", 1); repoTree.Selection.Changed += new EventHandler(OnSelect); AddinRepository[] reps = service.Repositories.GetRepositories (); - foreach (AddinRepository rep in reps) { - treeStore.AppendValues (rep.Url, rep.Title); - } + foreach (AddinRepository rep in reps) + AppendRepository (rep); btnRemove.Sensitive = false; } @@ -67,6 +65,12 @@ namespace Mono.Addins.Gui Destroy (); } + void AppendRepository (AddinRepository rep) + { + string txt = GLib.Markup.EscapeText (rep.Title) + "\n<span color='darkgray'>" + GLib.Markup.EscapeText (rep.Url) + "</span>"; + treeStore.AppendValues (rep.Url, txt); + } + protected void OnAdd (object sender, EventArgs e) { NewSiteDialog dlg = new NewSiteDialog (); @@ -122,7 +126,7 @@ namespace Mono.Addins.Gui return; } - treeStore.AppendValues (rr.Url, rr.Title); + AppendRepository (rr); } } } finally { diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/SearchEntry.cs b/Mono.Addins.Gui/Mono.Addins.Gui/SearchEntry.cs new file mode 100644 index 0000000..635d94d --- /dev/null +++ b/Mono.Addins.Gui/Mono.Addins.Gui/SearchEntry.cs @@ -0,0 +1,126 @@ +// +// SearchEntry.cs +// +// Author: +// Aaron Bockover <abockover@novell.com> +// Gabriel Burt <gburt@novell.com> +// +// Copyright 2007-2010 Novell, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using Gtk; + +namespace Mono.Addins.Gui +{ + [System.ComponentModel.ToolboxItem(true)] + class SearchEntry : EventBox + { + HBox box = new HBox (); + Gtk.Entry entry = new Gtk.Entry (); + HoverImageButton iconFind; + HoverImageButton iconClean; + const int notifyDelay = 50; + bool notifying; + + public SearchEntry () + { + entry.HasFrame = false; + box.PackStart (entry, true, true, 0); + iconFind = new HoverImageButton (IconSize.Menu, Gtk.Stock.Find); + box.PackStart (iconFind, false, false, 0); + iconClean = new HoverImageButton (IconSize.Menu, Gtk.Stock.Clear); + box.PackStart (iconClean, false, false, 0); + box.BorderWidth = 1; + Add (box); + + ModifyBg (StateType.Normal, entry.Style.Base (StateType.Normal)); + iconClean.ModifyBg (StateType.Normal, entry.Style.Base (StateType.Normal)); + iconFind.ModifyBg (StateType.Normal, entry.Style.Base (StateType.Normal)); + + iconClean.BorderWidth = 1; + iconClean.CanFocus = false; + iconFind.BorderWidth = 1; + iconFind.CanFocus = false; + + iconClean.Clicked += delegate { + entry.Text = string.Empty; + }; + + iconFind.Clicked += delegate { + FireSearch (); + }; + + entry.Activated += delegate { + FireSearch (); + }; + + ShowAll (); + UpdateIcon (); + + entry.Changed += delegate { + UpdateIcon (); + FireSearch (); + }; + } + + public event EventHandler TextChanged; + + public Gtk.Entry Entry { + get { + return this.entry; + } + set { + entry = value; + } + } + + public string Text { + get { return entry.Text; } + } + + void UpdateIcon () + { + if (entry.Text.Length > 0) { + iconFind.Hide (); + iconClean.Show (); + } + else { + iconFind.Show (); + iconClean.Hide (); + } + } + + void FireSearch () + { + if (!notifying) { + notifying = true; + GLib.Timeout.Add (notifyDelay, delegate { + notifying = false; + if (TextChanged != null) + TextChanged (this, EventArgs.Empty); + return false; + }); + } + } + } +} diff --git a/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInfoView.cs b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInfoView.cs new file mode 100644 index 0000000..7f837e2 --- /dev/null +++ b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInfoView.cs @@ -0,0 +1,217 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace Mono.Addins.Gui +{ + internal partial class AddinInfoView + { + private global::Gtk.EventBox ebox; + private global::Gtk.VBox vbox6; + private global::Gtk.VBox vbox3; + private global::Gtk.HBox headerBox; + private global::Gtk.VBox vbox4; + private global::Gtk.Label labelName; + private global::Gtk.Label labelVersion; + private global::Gtk.ScrolledWindow scrolledwindow; + private global::Gtk.EventBox ebox2; + private global::Gtk.VBox vbox7; + private global::Gtk.Label labelDesc; + private global::Gtk.EventBox eboxButs; + private global::Gtk.HBox hbox1; + private global::Gtk.Button btnInstall; + private global::Gtk.Button btnUpdate; + private global::Gtk.Button btnDisable; + private global::Gtk.Button btnUninstall; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget Mono.Addins.Gui.AddinInfoView + global::Stetic.BinContainer.Attach (this); + this.Name = "Mono.Addins.Gui.AddinInfoView"; + // Container child Mono.Addins.Gui.AddinInfoView.Gtk.Container+ContainerChild + this.ebox = new global::Gtk.EventBox (); + this.ebox.Name = "ebox"; + // Container child ebox.Gtk.Container+ContainerChild + this.vbox6 = new global::Gtk.VBox (); + this.vbox6.Name = "vbox6"; + this.vbox6.Spacing = 6; + // Container child vbox6.Gtk.Box+BoxChild + this.vbox3 = new global::Gtk.VBox (); + this.vbox3.Name = "vbox3"; + this.vbox3.Spacing = 6; + this.vbox3.BorderWidth = ((uint)(12)); + // Container child vbox3.Gtk.Box+BoxChild + this.headerBox = new global::Gtk.HBox (); + this.headerBox.Name = "headerBox"; + this.headerBox.Spacing = 6; + // Container child headerBox.Gtk.Box+BoxChild + this.vbox4 = new global::Gtk.VBox (); + this.vbox4.Name = "vbox4"; + this.vbox4.Spacing = 3; + // Container child vbox4.Gtk.Box+BoxChild + this.labelName = new global::Gtk.Label (); + this.labelName.WidthRequest = 250; + this.labelName.Name = "labelName"; + this.labelName.Xalign = 0F; + this.labelName.LabelProp = global::Mono.Unix.Catalog.GetString ("<b><big>Some Addin</big></b>"); + this.labelName.UseMarkup = true; + this.labelName.Wrap = true; + this.vbox4.Add (this.labelName); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.labelName])); + w1.Position = 0; + w1.Expand = false; + w1.Fill = false; + // Container child vbox4.Gtk.Box+BoxChild + this.labelVersion = new global::Gtk.Label (); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Xalign = 0F; + this.labelVersion.LabelProp = global::Mono.Unix.Catalog.GetString ("Version 2.6"); + this.vbox4.Add (this.labelVersion); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.labelVersion])); + w2.Position = 1; + w2.Expand = false; + w2.Fill = false; + this.headerBox.Add (this.vbox4); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.headerBox [this.vbox4])); + w3.Position = 0; + this.vbox3.Add (this.headerBox); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.headerBox])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.scrolledwindow = new global::Gtk.ScrolledWindow (); + this.scrolledwindow.CanFocus = true; + this.scrolledwindow.Name = "scrolledwindow"; + this.scrolledwindow.HscrollbarPolicy = ((global::Gtk.PolicyType)(2)); + // Container child scrolledwindow.Gtk.Container+ContainerChild + global::Gtk.Viewport w5 = new global::Gtk.Viewport (); + w5.ShadowType = ((global::Gtk.ShadowType)(0)); + // Container child GtkViewport.Gtk.Container+ContainerChild + this.ebox2 = new global::Gtk.EventBox (); + this.ebox2.Name = "ebox2"; + // Container child ebox2.Gtk.Container+ContainerChild + this.vbox7 = new global::Gtk.VBox (); + this.vbox7.Name = "vbox7"; + this.vbox7.Spacing = 6; + // Container child vbox7.Gtk.Box+BoxChild + this.labelDesc = new global::Gtk.Label (); + this.labelDesc.WidthRequest = 250; + this.labelDesc.Name = "labelDesc"; + this.labelDesc.Xalign = 0F; + this.labelDesc.LabelProp = global::Mono.Unix.Catalog.GetString ("Long description of the add-in. Long description of the add-in. Long description of the add-in. Long description of the add-in. Long description of the add-in. Long description of the add-in. "); + this.labelDesc.Wrap = true; + this.vbox7.Add (this.labelDesc); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.labelDesc])); + w6.Position = 0; + w6.Expand = false; + w6.Fill = false; + this.ebox2.Add (this.vbox7); + w5.Add (this.ebox2); + this.scrolledwindow.Add (w5); + this.vbox3.Add (this.scrolledwindow); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.scrolledwindow])); + w10.Position = 1; + this.vbox6.Add (this.vbox3); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.vbox3])); + w11.Position = 0; + // Container child vbox6.Gtk.Box+BoxChild + this.eboxButs = new global::Gtk.EventBox (); + this.eboxButs.Name = "eboxButs"; + // Container child eboxButs.Gtk.Container+ContainerChild + this.hbox1 = new global::Gtk.HBox (); + this.hbox1.Name = "hbox1"; + this.hbox1.Spacing = 6; + // Container child hbox1.Gtk.Box+BoxChild + this.btnInstall = new global::Gtk.Button (); + this.btnInstall.CanFocus = true; + this.btnInstall.Name = "btnInstall"; + this.btnInstall.UseUnderline = true; + // Container child btnInstall.Gtk.Container+ContainerChild + global::Gtk.Alignment w12 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w13 = new global::Gtk.HBox (); + w13.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w14 = new global::Gtk.Image (); + w14.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("download.png"); + w13.Add (w14); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w16 = new global::Gtk.Label (); + w16.LabelProp = global::Mono.Unix.Catalog.GetString ("Install..."); + w16.UseUnderline = true; + w13.Add (w16); + w12.Add (w13); + this.btnInstall.Add (w12); + this.hbox1.Add (this.btnInstall); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnInstall])); + w20.Position = 0; + w20.Expand = false; + w20.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.btnUpdate = new global::Gtk.Button (); + this.btnUpdate.CanFocus = true; + this.btnUpdate.Name = "btnUpdate"; + this.btnUpdate.UseUnderline = true; + // Container child btnUpdate.Gtk.Container+ContainerChild + global::Gtk.Alignment w21 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w22 = new global::Gtk.HBox (); + w22.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w23 = new global::Gtk.Image (); + w23.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("download.png"); + w22.Add (w23); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w25 = new global::Gtk.Label (); + w25.LabelProp = global::Mono.Unix.Catalog.GetString ("Update"); + w25.UseUnderline = true; + w22.Add (w25); + w21.Add (w22); + this.btnUpdate.Add (w21); + this.hbox1.Add (this.btnUpdate); + global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnUpdate])); + w29.Position = 1; + w29.Expand = false; + w29.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.btnDisable = new global::Gtk.Button (); + this.btnDisable.CanFocus = true; + this.btnDisable.Name = "btnDisable"; + this.btnDisable.UseUnderline = true; + this.btnDisable.Label = global::Mono.Unix.Catalog.GetString ("Disable"); + this.hbox1.Add (this.btnDisable); + global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnDisable])); + w30.Position = 2; + w30.Expand = false; + w30.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.btnUninstall = new global::Gtk.Button (); + this.btnUninstall.CanFocus = true; + this.btnUninstall.Name = "btnUninstall"; + this.btnUninstall.UseUnderline = true; + this.btnUninstall.Label = global::Mono.Unix.Catalog.GetString ("_Uninstall..."); + this.hbox1.Add (this.btnUninstall); + global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnUninstall])); + w31.Position = 3; + w31.Expand = false; + w31.Fill = false; + this.eboxButs.Add (this.hbox1); + this.vbox6.Add (this.eboxButs); + global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.eboxButs])); + w33.Position = 1; + w33.Expand = false; + w33.Fill = false; + this.ebox.Add (this.vbox6); + this.Add (this.ebox); + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.Hide (); + this.btnInstall.Clicked += new global::System.EventHandler (this.OnBtnInstallClicked); + this.btnUpdate.Clicked += new global::System.EventHandler (this.OnBtnUpdateClicked); + this.btnDisable.Clicked += new global::System.EventHandler (this.OnBtnDisableClicked); + this.btnUninstall.Clicked += new global::System.EventHandler (this.OnBtnUninstallClicked); + } + } +} diff --git a/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInstallDialog.cs b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInstallDialog.cs index a574b9b..8de5d99 100644 --- a/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInstallDialog.cs +++ b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinInstallDialog.cs @@ -472,6 +472,7 @@ namespace Mono.Addins.Gui w45.Fill = false; // Internal child Mono.Addins.Gui.AddinInstallDialog.ActionArea global::Gtk.HButtonBox w46 = this.ActionArea; + w46.Name = "hbuttonbox1"; w46.Spacing = 6; w46.BorderWidth = ((uint)(5)); w46.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); diff --git a/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinManagerDialog.cs b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinManagerDialog.cs index d6637b9..58d3d6e 100644 --- a/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinManagerDialog.cs +++ b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.AddinManagerDialog.cs @@ -5,23 +5,40 @@ namespace Mono.Addins.Gui internal partial class AddinManagerDialog { private global::Gtk.VBox vbox93; - private global::Gtk.HBox hbox85; - private global::Gtk.Image imageInstall; - private global::Gtk.Label label144; - private global::Gtk.HBox hbox73; - private global::Gtk.Label label134; private global::Gtk.HBox hbox65; private global::Gtk.HBox hbox72; + private global::Gtk.Notebook notebook; + private global::Gtk.HBox hbox2; + private global::Gtk.VBox vbox6; private global::Gtk.ScrolledWindow scrolledwindow13; private global::Gtk.TreeView addinTree; - private global::Gtk.VBox vbox933; - private global::Gtk.Button btnInstall; - private global::Gtk.Button btnRepositories; - private global::Gtk.HSeparator hseparator4; - private global::Gtk.Button btnUninstall; - private global::Gtk.Button btnEnable; - private global::Gtk.Button btnDisable; - private global::Gtk.Button btnInfo; + private global::Gtk.EventBox eventbox2; + private global::Mono.Addins.Gui.AddinInfoView addininfoInstalled; + private global::Gtk.Label label7; + private global::Gtk.HBox boxUpdates; + private global::Gtk.VBox vboxUpdates; + private global::Gtk.EventBox eboxRepoUpdates; + private global::Gtk.HBox hbox67; + private global::Gtk.Label labelUpdates; + private global::Gtk.Button buttonRefreshUpdates; + private global::Gtk.Button buttonUpdateAll; + private global::Gtk.ScrolledWindow scrolledUpdates; + private global::Gtk.TreeView updatesTreeView; + private global::Gtk.EventBox eventbox3; + private global::Mono.Addins.Gui.AddinInfoView addininfoUpdates; + private global::Gtk.Label label4; + private global::Gtk.HBox hbox4; + private global::Gtk.VBox vboxGallery; + private global::Gtk.EventBox eboxRepo; + private global::Gtk.HBox hbox66; + private global::Gtk.Label label112; + private global::Gtk.ComboBox repoCombo; + private global::Gtk.Button buttonRefresh; + private global::Gtk.ScrolledWindow scrolledGallery; + private global::Gtk.TreeView galleryTreeView; + private global::Gtk.EventBox eventbox1; + private global::Mono.Addins.Gui.AddinInfoView addininfoGallery; + private global::Gtk.Label label8; private global::Gtk.Button btnClose; protected virtual void Build () @@ -45,54 +62,6 @@ namespace Mono.Addins.Gui this.vbox93.Spacing = 6; this.vbox93.BorderWidth = ((uint)(6)); // Container child vbox93.Gtk.Box+BoxChild - this.hbox85 = new global::Gtk.HBox (); - this.hbox85.Name = "hbox85"; - this.hbox85.Spacing = 12; - // Container child hbox85.Gtk.Box+BoxChild - this.imageInstall = new global::Gtk.Image (); - this.imageInstall.Name = "imageInstall"; - this.imageInstall.Yalign = 0F; - this.imageInstall.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("system-software-update.png"); - this.hbox85.Add (this.imageInstall); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox85 [this.imageInstall])); - w2.Position = 0; - w2.Expand = false; - w2.Fill = false; - // Container child hbox85.Gtk.Box+BoxChild - this.label144 = new global::Gtk.Label (); - this.label144.Name = "label144"; - this.label144.LabelProp = global::Mono.Unix.Catalog.GetString ("<big><b>Add-in Manager</b></big>"); - this.label144.UseMarkup = true; - this.hbox85.Add (this.label144); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox85 [this.label144])); - w3.Position = 1; - w3.Expand = false; - w3.Fill = false; - this.vbox93.Add (this.hbox85); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox93 [this.hbox85])); - w4.Position = 0; - w4.Expand = false; - w4.Fill = false; - // Container child vbox93.Gtk.Box+BoxChild - this.hbox73 = new global::Gtk.HBox (); - this.hbox73.Name = "hbox73"; - this.hbox73.Spacing = 12; - // Container child hbox73.Gtk.Box+BoxChild - this.label134 = new global::Gtk.Label (); - this.label134.Name = "label134"; - this.label134.Xalign = 0F; - this.label134.LabelProp = global::Mono.Unix.Catalog.GetString ("The following add-ins are currently installed:"); - this.hbox73.Add (this.label134); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox73 [this.label134])); - w5.Position = 0; - w5.Expand = false; - w5.Fill = false; - this.vbox93.Add (this.hbox73); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox93 [this.hbox73])); - w6.Position = 1; - w6.Expand = false; - w6.Fill = false; - // Container child vbox93.Gtk.Box+BoxChild this.hbox65 = new global::Gtk.HBox (); this.hbox65.Name = "hbox65"; this.hbox65.Spacing = 12; @@ -101,6 +70,21 @@ namespace Mono.Addins.Gui this.hbox72.Name = "hbox72"; this.hbox72.Spacing = 12; // Container child hbox72.Gtk.Box+BoxChild + this.notebook = new global::Gtk.Notebook (); + this.notebook.CanFocus = true; + this.notebook.Name = "notebook"; + this.notebook.CurrentPage = 2; + this.notebook.ShowBorder = false; + // Container child notebook.Gtk.Notebook+NotebookChild + this.hbox2 = new global::Gtk.HBox (); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 9; + this.hbox2.BorderWidth = ((uint)(9)); + // Container child hbox2.Gtk.Box+BoxChild + this.vbox6 = new global::Gtk.VBox (); + this.vbox6.Name = "vbox6"; + this.vbox6.Spacing = 6; + // Container child vbox6.Gtk.Box+BoxChild this.scrolledwindow13 = new global::Gtk.ScrolledWindow (); this.scrolledwindow13.CanFocus = true; this.scrolledwindow13.Name = "scrolledwindow13"; @@ -110,168 +94,276 @@ namespace Mono.Addins.Gui this.addinTree.CanFocus = true; this.addinTree.Name = "addinTree"; this.scrolledwindow13.Add (this.addinTree); - this.hbox72.Add (this.scrolledwindow13); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox72 [this.scrolledwindow13])); + this.vbox6.Add (this.scrolledwindow13); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.scrolledwindow13])); + w3.Position = 0; + this.hbox2.Add (this.vbox6); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox6])); + w4.Position = 0; + // Container child hbox2.Gtk.Box+BoxChild + this.eventbox2 = new global::Gtk.EventBox (); + this.eventbox2.Name = "eventbox2"; + // Container child eventbox2.Gtk.Container+ContainerChild + this.addininfoInstalled = new global::Mono.Addins.Gui.AddinInfoView (); + this.addininfoInstalled.Events = ((global::Gdk.EventMask)(256)); + this.addininfoInstalled.Name = "addininfoInstalled"; + this.addininfoInstalled.AllowInstall = false; + this.eventbox2.Add (this.addininfoInstalled); + this.hbox2.Add (this.eventbox2); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.eventbox2])); + w6.Position = 1; + w6.Expand = false; + w6.Fill = false; + this.notebook.Add (this.hbox2); + // Notebook tab + this.label7 = new global::Gtk.Label (); + this.label7.Name = "label7"; + this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("Installed"); + this.notebook.SetTabLabel (this.hbox2, this.label7); + this.label7.ShowAll (); + // Container child notebook.Gtk.Notebook+NotebookChild + this.boxUpdates = new global::Gtk.HBox (); + this.boxUpdates.Name = "boxUpdates"; + this.boxUpdates.Spacing = 9; + this.boxUpdates.BorderWidth = ((uint)(9)); + // Container child boxUpdates.Gtk.Box+BoxChild + this.vboxUpdates = new global::Gtk.VBox (); + this.vboxUpdates.Name = "vboxUpdates"; + // Container child vboxUpdates.Gtk.Box+BoxChild + this.eboxRepoUpdates = new global::Gtk.EventBox (); + this.eboxRepoUpdates.Name = "eboxRepoUpdates"; + // Container child eboxRepoUpdates.Gtk.Container+ContainerChild + this.hbox67 = new global::Gtk.HBox (); + this.hbox67.Name = "hbox67"; + this.hbox67.Spacing = 6; + // Container child hbox67.Gtk.Box+BoxChild + this.labelUpdates = new global::Gtk.Label (); + this.labelUpdates.Name = "labelUpdates"; + this.labelUpdates.LabelProp = global::Mono.Unix.Catalog.GetString ("No updates found"); + this.hbox67.Add (this.labelUpdates); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox67 [this.labelUpdates])); w8.Position = 0; - // Container child hbox72.Gtk.Box+BoxChild - this.vbox933 = new global::Gtk.VBox (); - this.vbox933.Name = "vbox933"; - this.vbox933.Spacing = 5; - // Container child vbox933.Gtk.Box+BoxChild - this.btnInstall = new global::Gtk.Button (); - this.btnInstall.CanFocus = true; - this.btnInstall.Name = "btnInstall"; - this.btnInstall.UseUnderline = true; - // Container child btnInstall.Gtk.Container+ContainerChild + w8.Expand = false; + w8.Fill = false; + // Container child hbox67.Gtk.Box+BoxChild + this.buttonRefreshUpdates = new global::Gtk.Button (); + this.buttonRefreshUpdates.CanFocus = true; + this.buttonRefreshUpdates.Name = "buttonRefreshUpdates"; + this.buttonRefreshUpdates.UseUnderline = true; + this.buttonRefreshUpdates.Relief = ((global::Gtk.ReliefStyle)(2)); + // Container child buttonRefreshUpdates.Gtk.Container+ContainerChild global::Gtk.Alignment w9 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild global::Gtk.HBox w10 = new global::Gtk.HBox (); w10.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Image w11 = new global::Gtk.Image (); - w11.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Button); + w11.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-refresh", global::Gtk.IconSize.Menu); w10.Add (w11); // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Label w13 = new global::Gtk.Label (); - w13.LabelProp = global::Mono.Unix.Catalog.GetString ("_Install Add-ins..."); + w13.LabelProp = global::Mono.Unix.Catalog.GetString ("Refresh"); w13.UseUnderline = true; w10.Add (w13); w9.Add (w10); - this.btnInstall.Add (w9); - this.vbox933.Add (this.btnInstall); - global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.btnInstall])); - w17.Position = 0; + this.buttonRefreshUpdates.Add (w9); + this.hbox67.Add (this.buttonRefreshUpdates); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox67 [this.buttonRefreshUpdates])); + w17.PackType = ((global::Gtk.PackType)(1)); + w17.Position = 1; w17.Expand = false; w17.Fill = false; - // Container child vbox933.Gtk.Box+BoxChild - this.btnRepositories = new global::Gtk.Button (); - this.btnRepositories.CanFocus = true; - this.btnRepositories.Name = "btnRepositories"; - this.btnRepositories.UseUnderline = true; - this.btnRepositories.Label = global::Mono.Unix.Catalog.GetString ("_Repositories..."); - this.vbox933.Add (this.btnRepositories); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.btnRepositories])); - w18.Position = 1; - w18.Expand = false; - w18.Fill = false; - // Container child vbox933.Gtk.Box+BoxChild - this.hseparator4 = new global::Gtk.HSeparator (); - this.hseparator4.Name = "hseparator4"; - this.vbox933.Add (this.hseparator4); - global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.hseparator4])); - w19.Position = 2; - w19.Expand = false; - w19.Fill = false; - // Container child vbox933.Gtk.Box+BoxChild - this.btnUninstall = new global::Gtk.Button (); - this.btnUninstall.CanFocus = true; - this.btnUninstall.Name = "btnUninstall"; - this.btnUninstall.UseUnderline = true; - // Container child btnUninstall.Gtk.Container+ContainerChild - global::Gtk.Alignment w20 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); + // Container child hbox67.Gtk.Box+BoxChild + this.buttonUpdateAll = new global::Gtk.Button (); + this.buttonUpdateAll.CanFocus = true; + this.buttonUpdateAll.Name = "buttonUpdateAll"; + this.buttonUpdateAll.UseUnderline = true; + this.buttonUpdateAll.Relief = ((global::Gtk.ReliefStyle)(2)); + // Container child buttonUpdateAll.Gtk.Container+ContainerChild + global::Gtk.Alignment w18 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w21 = new global::Gtk.HBox (); - w21.Spacing = 2; + global::Gtk.HBox w19 = new global::Gtk.HBox (); + w19.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w22 = new global::Gtk.Image (); - w22.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Button); - w21.Add (w22); + global::Gtk.Image w20 = new global::Gtk.Image (); + w20.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("download.png"); + w19.Add (w20); // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w24 = new global::Gtk.Label (); - w24.LabelProp = global::Mono.Unix.Catalog.GetString ("_Uninstall..."); - w24.UseUnderline = true; - w21.Add (w24); - w20.Add (w21); - this.btnUninstall.Add (w20); - this.vbox933.Add (this.btnUninstall); - global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.btnUninstall])); - w28.Position = 3; + global::Gtk.Label w22 = new global::Gtk.Label (); + w22.LabelProp = global::Mono.Unix.Catalog.GetString ("Update All"); + w22.UseUnderline = true; + w19.Add (w22); + w18.Add (w19); + this.buttonUpdateAll.Add (w18); + this.hbox67.Add (this.buttonUpdateAll); + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox67 [this.buttonUpdateAll])); + w26.PackType = ((global::Gtk.PackType)(1)); + w26.Position = 2; + w26.Expand = false; + w26.Fill = false; + this.eboxRepoUpdates.Add (this.hbox67); + this.vboxUpdates.Add (this.eboxRepoUpdates); + global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vboxUpdates [this.eboxRepoUpdates])); + w28.Position = 0; w28.Expand = false; w28.Fill = false; - // Container child vbox933.Gtk.Box+BoxChild - this.btnEnable = new global::Gtk.Button (); - this.btnEnable.CanFocus = true; - this.btnEnable.Name = "btnEnable"; - this.btnEnable.UseUnderline = true; - // Container child btnEnable.Gtk.Container+ContainerChild - global::Gtk.Alignment w29 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w30 = new global::Gtk.HBox (); - w30.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w31 = new global::Gtk.Image (); - w31.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-yes", global::Gtk.IconSize.Button); - w30.Add (w31); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w33 = new global::Gtk.Label (); - w33.LabelProp = global::Mono.Unix.Catalog.GetString ("Enable"); - w33.UseUnderline = true; - w30.Add (w33); - w29.Add (w30); - this.btnEnable.Add (w29); - this.vbox933.Add (this.btnEnable); - global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.btnEnable])); - w37.Position = 4; - w37.Expand = false; - w37.Fill = false; - // Container child vbox933.Gtk.Box+BoxChild - this.btnDisable = new global::Gtk.Button (); - this.btnDisable.CanFocus = true; - this.btnDisable.Name = "btnDisable"; - this.btnDisable.UseUnderline = true; - // Container child btnDisable.Gtk.Container+ContainerChild - global::Gtk.Alignment w38 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); + // Container child vboxUpdates.Gtk.Box+BoxChild + this.scrolledUpdates = new global::Gtk.ScrolledWindow (); + this.scrolledUpdates.CanFocus = true; + this.scrolledUpdates.Name = "scrolledUpdates"; + this.scrolledUpdates.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child scrolledUpdates.Gtk.Container+ContainerChild + this.updatesTreeView = new global::Gtk.TreeView (); + this.updatesTreeView.CanFocus = true; + this.updatesTreeView.Name = "updatesTreeView"; + this.scrolledUpdates.Add (this.updatesTreeView); + this.vboxUpdates.Add (this.scrolledUpdates); + global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vboxUpdates [this.scrolledUpdates])); + w30.Position = 1; + this.boxUpdates.Add (this.vboxUpdates); + global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.boxUpdates [this.vboxUpdates])); + w31.Position = 0; + // Container child boxUpdates.Gtk.Box+BoxChild + this.eventbox3 = new global::Gtk.EventBox (); + this.eventbox3.Name = "eventbox3"; + // Container child eventbox3.Gtk.Container+ContainerChild + this.addininfoUpdates = new global::Mono.Addins.Gui.AddinInfoView (); + this.addininfoUpdates.Events = ((global::Gdk.EventMask)(256)); + this.addininfoUpdates.Name = "addininfoUpdates"; + this.addininfoUpdates.AllowInstall = false; + this.eventbox3.Add (this.addininfoUpdates); + this.boxUpdates.Add (this.eventbox3); + global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.boxUpdates [this.eventbox3])); + w33.Position = 1; + w33.Expand = false; + w33.Fill = false; + this.notebook.Add (this.boxUpdates); + global::Gtk.Notebook.NotebookChild w34 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.boxUpdates])); + w34.Position = 1; + // Notebook tab + this.label4 = new global::Gtk.Label (); + this.label4.Name = "label4"; + this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Updates"); + this.notebook.SetTabLabel (this.boxUpdates, this.label4); + this.label4.ShowAll (); + // Container child notebook.Gtk.Notebook+NotebookChild + this.hbox4 = new global::Gtk.HBox (); + this.hbox4.Name = "hbox4"; + this.hbox4.Spacing = 9; + this.hbox4.BorderWidth = ((uint)(9)); + // Container child hbox4.Gtk.Box+BoxChild + this.vboxGallery = new global::Gtk.VBox (); + this.vboxGallery.Name = "vboxGallery"; + // Container child vboxGallery.Gtk.Box+BoxChild + this.eboxRepo = new global::Gtk.EventBox (); + this.eboxRepo.Name = "eboxRepo"; + // Container child eboxRepo.Gtk.Container+ContainerChild + this.hbox66 = new global::Gtk.HBox (); + this.hbox66.Name = "hbox66"; + this.hbox66.Spacing = 6; + // Container child hbox66.Gtk.Box+BoxChild + this.label112 = new global::Gtk.Label (); + this.label112.Name = "label112"; + this.label112.LabelProp = global::Mono.Unix.Catalog.GetString ("Repository:"); + this.hbox66.Add (this.label112); + global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox66 [this.label112])); + w35.Position = 0; + w35.Expand = false; + w35.Fill = false; + // Container child hbox66.Gtk.Box+BoxChild + this.repoCombo = new global::Gtk.ComboBox (); + this.repoCombo.Name = "repoCombo"; + this.hbox66.Add (this.repoCombo); + global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.hbox66 [this.repoCombo])); + w36.Position = 1; + // Container child hbox66.Gtk.Box+BoxChild + this.buttonRefresh = new global::Gtk.Button (); + this.buttonRefresh.CanFocus = true; + this.buttonRefresh.Name = "buttonRefresh"; + this.buttonRefresh.UseUnderline = true; + this.buttonRefresh.Relief = ((global::Gtk.ReliefStyle)(2)); + // Container child buttonRefresh.Gtk.Container+ContainerChild + global::Gtk.Alignment w37 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w39 = new global::Gtk.HBox (); - w39.Spacing = 2; + global::Gtk.HBox w38 = new global::Gtk.HBox (); + w38.Spacing = 2; // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w40 = new global::Gtk.Image (); - w40.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-no", global::Gtk.IconSize.Button); - w39.Add (w40); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w42 = new global::Gtk.Label (); - w42.LabelProp = global::Mono.Unix.Catalog.GetString ("Disable"); - w42.UseUnderline = true; - w39.Add (w42); + global::Gtk.Image w39 = new global::Gtk.Image (); + w39.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-refresh", global::Gtk.IconSize.Menu); w38.Add (w39); - this.btnDisable.Add (w38); - this.vbox933.Add (this.btnDisable); - global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.btnDisable])); - w46.Position = 5; - w46.Expand = false; - w46.Fill = false; - // Container child vbox933.Gtk.Box+BoxChild - this.btnInfo = new global::Gtk.Button (); - this.btnInfo.CanFocus = true; - this.btnInfo.Name = "btnInfo"; - this.btnInfo.UseStock = true; - this.btnInfo.UseUnderline = true; - this.btnInfo.Label = "gtk-dialog-info"; - this.vbox933.Add (this.btnInfo); - global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.vbox933 [this.btnInfo])); - w47.Position = 6; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w41 = new global::Gtk.Label (); + w38.Add (w41); + w37.Add (w38); + this.buttonRefresh.Add (w37); + this.hbox66.Add (this.buttonRefresh); + global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.hbox66 [this.buttonRefresh])); + w45.Position = 2; + w45.Expand = false; + w45.Fill = false; + this.eboxRepo.Add (this.hbox66); + this.vboxGallery.Add (this.eboxRepo); + global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.vboxGallery [this.eboxRepo])); + w47.Position = 0; w47.Expand = false; w47.Fill = false; - this.hbox72.Add (this.vbox933); - global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.hbox72 [this.vbox933])); - w48.Position = 1; - w48.Expand = false; - w48.Fill = false; + // Container child vboxGallery.Gtk.Box+BoxChild + this.scrolledGallery = new global::Gtk.ScrolledWindow (); + this.scrolledGallery.CanFocus = true; + this.scrolledGallery.Name = "scrolledGallery"; + this.scrolledGallery.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child scrolledGallery.Gtk.Container+ContainerChild + this.galleryTreeView = new global::Gtk.TreeView (); + this.galleryTreeView.CanFocus = true; + this.galleryTreeView.Name = "galleryTreeView"; + this.scrolledGallery.Add (this.galleryTreeView); + this.vboxGallery.Add (this.scrolledGallery); + global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.vboxGallery [this.scrolledGallery])); + w49.Position = 1; + this.hbox4.Add (this.vboxGallery); + global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.vboxGallery])); + w50.Position = 0; + // Container child hbox4.Gtk.Box+BoxChild + this.eventbox1 = new global::Gtk.EventBox (); + this.eventbox1.Name = "eventbox1"; + // Container child eventbox1.Gtk.Container+ContainerChild + this.addininfoGallery = new global::Mono.Addins.Gui.AddinInfoView (); + this.addininfoGallery.Events = ((global::Gdk.EventMask)(256)); + this.addininfoGallery.Name = "addininfoGallery"; + this.addininfoGallery.AllowInstall = false; + this.eventbox1.Add (this.addininfoGallery); + this.hbox4.Add (this.eventbox1); + global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.eventbox1])); + w52.Position = 1; + w52.Expand = false; + w52.Fill = false; + this.notebook.Add (this.hbox4); + global::Gtk.Notebook.NotebookChild w53 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.hbox4])); + w53.Position = 2; + // Notebook tab + this.label8 = new global::Gtk.Label (); + this.label8.Name = "label8"; + this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Gallery"); + this.notebook.SetTabLabel (this.hbox4, this.label8); + this.label8.ShowAll (); + this.hbox72.Add (this.notebook); + global::Gtk.Box.BoxChild w54 = ((global::Gtk.Box.BoxChild)(this.hbox72 [this.notebook])); + w54.Position = 0; this.hbox65.Add (this.hbox72); - global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.hbox65 [this.hbox72])); - w49.Position = 0; + global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.hbox65 [this.hbox72])); + w55.Position = 0; this.vbox93.Add (this.hbox65); - global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.vbox93 [this.hbox65])); - w50.Position = 2; + global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.vbox93 [this.hbox65])); + w56.Position = 0; w1.Add (this.vbox93); - global::Gtk.Box.BoxChild w51 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox93])); - w51.Position = 0; + global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox93])); + w57.Position = 0; // Internal child Mono.Addins.Gui.AddinManagerDialog.ActionArea - global::Gtk.HButtonBox w52 = this.ActionArea; - w52.Name = "dialog-action_area8"; - w52.Spacing = 6; - w52.BorderWidth = ((uint)(5)); - w52.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w58 = this.ActionArea; + w58.Name = "dialog-action_area8"; + w58.Spacing = 6; + w58.BorderWidth = ((uint)(5)); + w58.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog-action_area8.Gtk.ButtonBox+ButtonBoxChild this.btnClose = new global::Gtk.Button (); this.btnClose.CanDefault = true; @@ -281,20 +373,29 @@ namespace Mono.Addins.Gui this.btnClose.UseUnderline = true; this.btnClose.Label = "gtk-close"; this.AddActionWidget (this.btnClose, -7); - global::Gtk.ButtonBox.ButtonBoxChild w53 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w52 [this.btnClose])); - w53.Expand = false; - w53.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w59 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w58 [this.btnClose])); + w59.Expand = false; + w59.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } this.Show (); - this.addinTree.CursorChanged += new global::System.EventHandler (this.OnSelectionChanged); - this.btnInstall.Clicked += new global::System.EventHandler (this.OnInstall); - this.btnRepositories.Clicked += new global::System.EventHandler (this.OnManageRepos); - this.btnUninstall.Clicked += new global::System.EventHandler (this.OnUninstall); - this.btnEnable.Clicked += new global::System.EventHandler (this.OnEnable); - this.btnDisable.Clicked += new global::System.EventHandler (this.OnDisable); - this.btnInfo.Clicked += new global::System.EventHandler (this.OnShowInfo); + this.addininfoInstalled.InstallClicked += new global::System.EventHandler (this.OnInstallClicked); + this.addininfoInstalled.UninstallClicked += new global::System.EventHandler (this.OnUninstallClicked); + this.addininfoInstalled.UpdateClicked += new global::System.EventHandler (this.OnUpdateClicked); + this.addininfoInstalled.EnableDisableClicked += new global::System.EventHandler (this.OnEnableDisableClicked); + this.buttonUpdateAll.Clicked += new global::System.EventHandler (this.OnUpdateAll); + this.buttonRefreshUpdates.Clicked += new global::System.EventHandler (this.OnButtonRefreshClicked); + this.addininfoUpdates.InstallClicked += new global::System.EventHandler (this.OnInstallClicked); + this.addininfoUpdates.UninstallClicked += new global::System.EventHandler (this.OnUninstallClicked); + this.addininfoUpdates.UpdateClicked += new global::System.EventHandler (this.OnUpdateClicked); + this.addininfoUpdates.EnableDisableClicked += new global::System.EventHandler (this.OnEnableDisableClicked); + this.repoCombo.Changed += new global::System.EventHandler (this.OnRepoComboChanged); + this.buttonRefresh.Clicked += new global::System.EventHandler (this.OnButtonRefreshClicked); + this.addininfoGallery.InstallClicked += new global::System.EventHandler (this.OnInstallClicked); + this.addininfoGallery.UninstallClicked += new global::System.EventHandler (this.OnUninstallClicked); + this.addininfoGallery.UpdateClicked += new global::System.EventHandler (this.OnUpdateClicked); + this.addininfoGallery.EnableDisableClicked += new global::System.EventHandler (this.OnEnableDisableClicked); } } } diff --git a/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.InstallDialog.cs b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.InstallDialog.cs new file mode 100644 index 0000000..6194728 --- /dev/null +++ b/Mono.Addins.Gui/gtk-gui/Mono.Addins.Gui.InstallDialog.cs @@ -0,0 +1,133 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace Mono.Addins.Gui +{ + internal partial class InstallDialog + { + private global::Gtk.VBox vbox3; + private global::Gtk.ScrolledWindow scrolledwindow1; + private global::Gtk.VBox vbox4; + private global::Gtk.Label labelInfo; + private global::Gtk.VBox boxProgress; + private global::Gtk.Label globalProgressLabel; + private global::Gtk.ProgressBar mainProgressBar; + private global::Gtk.Button buttonCancel; + private global::Gtk.Button buttonOk; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget Mono.Addins.Gui.InstallDialog + this.Name = "Mono.Addins.Gui.InstallDialog"; + this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + // Internal child Mono.Addins.Gui.InstallDialog.VBox + global::Gtk.VBox w1 = this.VBox; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); + // Container child dialog1_VBox.Gtk.Box+BoxChild + this.vbox3 = new global::Gtk.VBox (); + this.vbox3.Name = "vbox3"; + this.vbox3.Spacing = 6; + this.vbox3.BorderWidth = ((uint)(9)); + // Container child vbox3.Gtk.Box+BoxChild + this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); + this.scrolledwindow1.CanFocus = true; + this.scrolledwindow1.Name = "scrolledwindow1"; + this.scrolledwindow1.VscrollbarPolicy = ((global::Gtk.PolicyType)(2)); + this.scrolledwindow1.HscrollbarPolicy = ((global::Gtk.PolicyType)(2)); + // Container child scrolledwindow1.Gtk.Container+ContainerChild + global::Gtk.Viewport w2 = new global::Gtk.Viewport (); + w2.ShadowType = ((global::Gtk.ShadowType)(0)); + // Container child GtkViewport.Gtk.Container+ContainerChild + this.vbox4 = new global::Gtk.VBox (); + this.vbox4.Name = "vbox4"; + this.vbox4.Spacing = 6; + // Container child vbox4.Gtk.Box+BoxChild + this.labelInfo = new global::Gtk.Label (); + this.labelInfo.WidthRequest = 400; + this.labelInfo.Name = "labelInfo"; + this.labelInfo.Xalign = 0F; + this.labelInfo.Yalign = 0F; + this.labelInfo.LabelProp = global::Mono.Unix.Catalog.GetString ("label3"); + this.labelInfo.Wrap = true; + this.vbox4.Add (this.labelInfo); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.labelInfo])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; + w2.Add (this.vbox4); + this.scrolledwindow1.Add (w2); + this.vbox3.Add (this.scrolledwindow1); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.scrolledwindow1])); + w6.Position = 0; + // Container child vbox3.Gtk.Box+BoxChild + this.boxProgress = new global::Gtk.VBox (); + this.boxProgress.Name = "boxProgress"; + this.boxProgress.Spacing = 6; + // Container child boxProgress.Gtk.Box+BoxChild + this.globalProgressLabel = new global::Gtk.Label (); + this.globalProgressLabel.Name = "globalProgressLabel"; + this.globalProgressLabel.Xalign = 0F; + this.globalProgressLabel.Ellipsize = ((global::Pango.EllipsizeMode)(3)); + this.boxProgress.Add (this.globalProgressLabel); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxProgress [this.globalProgressLabel])); + w7.Position = 0; + w7.Expand = false; + w7.Fill = false; + // Container child boxProgress.Gtk.Box+BoxChild + this.mainProgressBar = new global::Gtk.ProgressBar (); + this.mainProgressBar.Name = "mainProgressBar"; + this.boxProgress.Add (this.mainProgressBar); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.boxProgress [this.mainProgressBar])); + w8.Position = 1; + w8.Expand = false; + w8.Fill = false; + this.vbox3.Add (this.boxProgress); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.boxProgress])); + w9.Position = 1; + w9.Expand = false; + w9.Fill = false; + w1.Add (this.vbox3); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox3])); + w10.Position = 0; + // Internal child Mono.Addins.Gui.InstallDialog.ActionArea + global::Gtk.HButtonBox w11 = this.ActionArea; + w11.Name = "dialog1_ActionArea"; + w11.Spacing = 10; + w11.BorderWidth = ((uint)(5)); + w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonCancel = new global::Gtk.Button (); + this.buttonCancel.CanDefault = true; + this.buttonCancel.CanFocus = true; + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.UseStock = true; + this.buttonCancel.UseUnderline = true; + this.buttonCancel.Label = "gtk-cancel"; + w11.Add (this.buttonCancel); + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + w12.Expand = false; + w12.Fill = false; + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonOk = new global::Gtk.Button (); + this.buttonOk.CanDefault = true; + this.buttonOk.CanFocus = true; + this.buttonOk.Name = "buttonOk"; + this.buttonOk.UseUnderline = true; + this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Install"); + w11.Add (this.buttonOk); + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + w13.Position = 1; + w13.Expand = false; + w13.Fill = false; + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.DefaultWidth = 494; + this.DefaultHeight = 217; + this.Show (); + this.buttonCancel.Clicked += new global::System.EventHandler (this.OnButtonCancelClicked); + this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked); + } + } +} diff --git a/Mono.Addins.Gui/gtk-gui/generated.cs b/Mono.Addins.Gui/gtk-gui/generated.cs index d608548..36abc51 100644 --- a/Mono.Addins.Gui/gtk-gui/generated.cs +++ b/Mono.Addins.Gui/gtk-gui/generated.cs @@ -48,6 +48,58 @@ namespace Stetic } } + internal class BinContainer + { + private Gtk.Widget child; + private Gtk.UIManager uimanager; + + public static BinContainer Attach (Gtk.Bin bin) + { + BinContainer bc = new BinContainer (); + bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); + bin.Added += new Gtk.AddedHandler (bc.OnAdded); + return bc; + } + + private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + { + if ((this.child != null)) { + args.Requisition = this.child.SizeRequest (); + } + } + + private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) + { + if ((this.child != null)) { + this.child.Allocation = args.Allocation; + } + } + + private void OnAdded (object sender, Gtk.AddedArgs args) + { + this.child = args.Widget; + } + + public void SetUiManager (Gtk.UIManager uim) + { + this.uimanager = uim; + this.child.Realized += new System.EventHandler (this.OnRealized); + } + + private void OnRealized (object sender, System.EventArgs args) + { + if ((this.uimanager != null)) { + Gtk.Widget w; + w = this.child.Toplevel; + if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) { + ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); + this.uimanager = null; + } + } + } + } + internal class ActionGroups { public static Gtk.ActionGroup GetActionGroup (System.Type type) diff --git a/Mono.Addins.Gui/gtk-gui/gui.stetic b/Mono.Addins.Gui/gtk-gui/gui.stetic index afb2969..1ba1e3d 100644 --- a/Mono.Addins.Gui/gtk-gui/gui.stetic +++ b/Mono.Addins.Gui/gtk-gui/gui.stetic @@ -2,7 +2,7 @@ <stetic-interface> <configuration> <images-root-path>..</images-root-path> - <target-gtk-version>2.8</target-gtk-version> + <target-gtk-version>2.12</target-gtk-version> </configuration> <import> <widget-library name="../../bin/Mono.Addins.Gui.dll" internal="true" /> @@ -138,11 +138,15 @@ <property name="ResponseId">-5</property> <property name="label">gtk-ok</property> </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> </child> </widget> </child> </widget> - <widget class="Gtk.Dialog" id="Mono.Addins.Gui.AddinManagerDialog" design-size="524 432"> + <widget class="Gtk.Dialog" id="Mono.Addins.Gui.AddinManagerDialog" design-size="840 534"> <property name="MemberName" /> <property name="GeneratePublic">False</property> <property name="Title" translatable="yes">Add-in Manager</property> @@ -163,69 +167,6 @@ <property name="Spacing">6</property> <property name="BorderWidth">6</property> <child> - <widget class="Gtk.HBox" id="hbox85"> - <property name="MemberName" /> - <property name="Spacing">12</property> - <child> - <widget class="Gtk.Image" id="imageInstall"> - <property name="MemberName" /> - <property name="Yalign">0</property> - <property name="Pixbuf">resource:system-software-update.png</property> - </widget> - <packing> - <property name="Position">0</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - <child> - <widget class="Gtk.Label" id="label144"> - <property name="MemberName" /> - <property name="LabelProp" translatable="yes"><big><b>Add-in Manager</b></big></property> - <property name="UseMarkup">True</property> - </widget> - <packing> - <property name="Position">1</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="Position">0</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - <child> - <widget class="Gtk.HBox" id="hbox73"> - <property name="MemberName" /> - <property name="Spacing">12</property> - <child> - <widget class="Gtk.Label" id="label134"> - <property name="MemberName" /> - <property name="Xalign">0</property> - <property name="LabelProp" translatable="yes">The following add-ins are currently installed:</property> - </widget> - <packing> - <property name="Position">0</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="Position">1</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - <child> <widget class="Gtk.HBox" id="hbox65"> <property name="MemberName" /> <property name="Spacing">12</property> @@ -234,145 +175,340 @@ <property name="MemberName" /> <property name="Spacing">12</property> <child> - <widget class="Gtk.ScrolledWindow" id="scrolledwindow13"> + <widget class="Gtk.Notebook" id="notebook"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="ShadowType">In</property> + <property name="CurrentPage">2</property> + <property name="ShowBorder">False</property> <child> - <widget class="Gtk.TreeView" id="addinTree"> + <widget class="Gtk.HBox" id="hbox2"> <property name="MemberName" /> - <property name="CanFocus">True</property> - <signal name="CursorChanged" handler="OnSelectionChanged" /> + <property name="Spacing">9</property> + <property name="BorderWidth">9</property> + <child> + <widget class="Gtk.VBox" id="vbox6"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.ScrolledWindow" id="scrolledwindow13"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="ShadowType">In</property> + <child> + <widget class="Gtk.TreeView" id="addinTree"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + </widget> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + </packing> + </child> + <child> + <widget class="Gtk.EventBox" id="eventbox2"> + <property name="MemberName" /> + <child> + <widget class="Mono.Addins.Gui.AddinInfoView" id="addininfoInstalled"> + <property name="MemberName" /> + <property name="Events">ButtonPressMask</property> + <property name="AllowInstall">False</property> + <signal name="InstallClicked" handler="OnInstallClicked" /> + <signal name="UninstallClicked" handler="OnUninstallClicked" /> + <signal name="UpdateClicked" handler="OnUpdateClicked" /> + <signal name="EnableDisableClicked" handler="OnEnableDisableClicked" /> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> </widget> </child> - </widget> - <packing> - <property name="Position">0</property> - <property name="AutoSize">False</property> - </packing> - </child> - <child> - <widget class="Gtk.VBox" id="vbox933"> - <property name="MemberName" /> - <property name="Spacing">5</property> <child> - <widget class="Gtk.Button" id="btnInstall"> + <widget class="Gtk.Label" id="label7"> <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="Type">TextAndIcon</property> - <property name="Icon">stock:gtk-add Button</property> - <property name="Label" translatable="yes">_Install Add-ins...</property> - <property name="UseUnderline">True</property> - <signal name="Clicked" handler="OnInstall" /> + <property name="LabelProp" translatable="yes">Installed</property> </widget> <packing> - <property name="Position">0</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> + <property name="type">tab</property> </packing> </child> <child> - <widget class="Gtk.Button" id="btnRepositories"> + <widget class="Gtk.HBox" id="boxUpdates"> <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="Type">TextOnly</property> - <property name="Label" translatable="yes">_Repositories...</property> - <property name="UseUnderline">True</property> - <signal name="Clicked" handler="OnManageRepos" /> + <property name="Spacing">9</property> + <property name="BorderWidth">9</property> + <child> + <widget class="Gtk.VBox" id="vboxUpdates"> + <property name="MemberName" /> + <child> + <widget class="Gtk.EventBox" id="eboxRepoUpdates"> + <property name="MemberName" /> + <child> + <widget class="Gtk.HBox" id="hbox67"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="labelUpdates"> + <property name="MemberName" /> + <property name="LabelProp" translatable="yes">No updates found</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="buttonRefreshUpdates"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-refresh Menu</property> + <property name="Label" translatable="yes">Refresh</property> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + <signal name="Clicked" handler="OnButtonRefreshClicked" /> + </widget> + <packing> + <property name="PackType">End</property> + <property name="Position">1</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="buttonUpdateAll"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">resource:download.png</property> + <property name="Label" translatable="yes">Update All</property> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + <signal name="Clicked" handler="OnUpdateAll" /> + </widget> + <packing> + <property name="PackType">End</property> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.ScrolledWindow" id="scrolledUpdates"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="ShadowType">In</property> + <child> + <widget class="Gtk.TreeView" id="updatesTreeView"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + </packing> + </child> + <child> + <widget class="Gtk.EventBox" id="eventbox3"> + <property name="MemberName" /> + <child> + <widget class="Mono.Addins.Gui.AddinInfoView" id="addininfoUpdates"> + <property name="MemberName" /> + <property name="Events">ButtonPressMask</property> + <property name="AllowInstall">False</property> + <signal name="InstallClicked" handler="OnInstallClicked" /> + <signal name="UninstallClicked" handler="OnUninstallClicked" /> + <signal name="UpdateClicked" handler="OnUpdateClicked" /> + <signal name="EnableDisableClicked" handler="OnEnableDisableClicked" /> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> </widget> <packing> <property name="Position">1</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - <child> - <widget class="Gtk.HSeparator" id="hseparator4"> - <property name="MemberName" /> - </widget> - <packing> - <property name="Position">2</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> </packing> </child> <child> - <widget class="Gtk.Button" id="btnUninstall"> + <widget class="Gtk.Label" id="label4"> <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="Type">TextAndIcon</property> - <property name="Icon">stock:gtk-remove Button</property> - <property name="Label" translatable="yes">_Uninstall...</property> - <property name="UseUnderline">True</property> - <signal name="Clicked" handler="OnUninstall" /> + <property name="LabelProp" translatable="yes">Updates</property> </widget> <packing> - <property name="Position">3</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> - </packing> - </child> - <child> - <widget class="Gtk.Button" id="btnEnable"> - <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="Type">TextAndIcon</property> - <property name="Icon">stock:gtk-yes Button</property> - <property name="Label" translatable="yes">Enable</property> - <property name="UseUnderline">True</property> - <signal name="Clicked" handler="OnEnable" /> - </widget> - <packing> - <property name="Position">4</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> + <property name="type">tab</property> </packing> </child> <child> - <widget class="Gtk.Button" id="btnDisable"> + <widget class="Gtk.HBox" id="hbox4"> <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="Type">TextAndIcon</property> - <property name="Icon">stock:gtk-no Button</property> - <property name="Label" translatable="yes">Disable</property> - <property name="UseUnderline">True</property> - <signal name="Clicked" handler="OnDisable" /> + <property name="Spacing">9</property> + <property name="BorderWidth">9</property> + <child> + <widget class="Gtk.VBox" id="vboxGallery"> + <property name="MemberName" /> + <child> + <widget class="Gtk.EventBox" id="eboxRepo"> + <property name="MemberName" /> + <child> + <widget class="Gtk.HBox" id="hbox66"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="label112"> + <property name="MemberName" /> + <property name="LabelProp" translatable="yes">Repository:</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.ComboBox" id="repoCombo"> + <property name="MemberName" /> + <property name="IsTextCombo">False</property> + <property name="Items" translatable="yes" /> + <signal name="Changed" handler="OnRepoComboChanged" /> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="buttonRefresh"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-refresh Menu</property> + <property name="Label" translatable="yes" /> + <property name="UseUnderline">True</property> + <property name="Relief">None</property> + <signal name="Clicked" handler="OnButtonRefreshClicked" /> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.ScrolledWindow" id="scrolledGallery"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="ShadowType">In</property> + <child> + <widget class="Gtk.TreeView" id="galleryTreeView"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + </packing> + </child> + <child> + <widget class="Gtk.EventBox" id="eventbox1"> + <property name="MemberName" /> + <child> + <widget class="Mono.Addins.Gui.AddinInfoView" id="addininfoGallery"> + <property name="MemberName" /> + <property name="Events">ButtonPressMask</property> + <property name="AllowInstall">False</property> + <signal name="InstallClicked" handler="OnInstallClicked" /> + <signal name="UninstallClicked" handler="OnUninstallClicked" /> + <signal name="UpdateClicked" handler="OnUpdateClicked" /> + <signal name="EnableDisableClicked" handler="OnEnableDisableClicked" /> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> </widget> <packing> - <property name="Position">5</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> + <property name="Position">2</property> </packing> </child> <child> - <widget class="Gtk.Button" id="btnInfo"> + <widget class="Gtk.Label" id="label8"> <property name="MemberName" /> - <property name="CanFocus">True</property> - <property name="UseStock">True</property> - <property name="Type">StockItem</property> - <property name="StockId">gtk-dialog-info</property> - <signal name="Clicked" handler="OnShowInfo" /> - <property name="label">gtk-dialog-info</property> + <property name="LabelProp" translatable="yes">Gallery</property> </widget> <packing> - <property name="Position">6</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> + <property name="type">tab</property> </packing> </child> </widget> <packing> - <property name="Position">1</property> - <property name="AutoSize">False</property> - <property name="Expand">False</property> - <property name="Fill">False</property> + <property name="Position">0</property> + <property name="AutoSize">True</property> </packing> </child> </widget> @@ -383,7 +519,7 @@ </child> </widget> <packing> - <property name="Position">2</property> + <property name="Position">0</property> <property name="AutoSize">False</property> </packing> </child> @@ -413,6 +549,10 @@ <property name="ResponseId">-7</property> <property name="label">gtk-close</property> </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> </child> </widget> </child> @@ -942,6 +1082,10 @@ asd <signal name="Clicked" handler="OnCancel" /> <property name="label">gtk-cancel</property> </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> </child> <child> <widget class="Gtk.Button" id="btnPrev"> @@ -956,6 +1100,8 @@ asd </widget> <packing> <property name="Position">1</property> + <property name="Expand">False</property> + <property name="Fill">False</property> </packing> </child> <child> @@ -971,6 +1117,8 @@ asd </widget> <packing> <property name="Position">2</property> + <property name="Expand">False</property> + <property name="Fill">False</property> </packing> </child> <child> @@ -987,6 +1135,8 @@ asd </widget> <packing> <property name="Position">3</property> + <property name="Expand">False</property> + <property name="Fill">False</property> </packing> </child> </widget> @@ -1120,6 +1270,10 @@ asd <property name="ResponseId">-7</property> <property name="label">gtk-close</property> </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> </child> </widget> </child> @@ -1343,6 +1497,10 @@ asd <property name="ResponseId">-6</property> <property name="label">gtk-cancel</property> </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> </child> <child> <widget class="Gtk.Button" id="btnOk"> @@ -1357,6 +1515,8 @@ asd </widget> <packing> <property name="Position">1</property> + <property name="Expand">False</property> + <property name="Fill">False</property> </packing> </child> </widget> @@ -1460,6 +1620,10 @@ asd <property name="ResponseId">-7</property> <property name="label">gtk-close</property> </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> </child> </widget> </child> @@ -1709,4 +1873,357 @@ asd </widget> </child> </widget> + <widget class="Gtk.Dialog" id="Mono.Addins.Gui.InstallDialog" design-size="494 217"> + <property name="MemberName" /> + <property name="GeneratePublic">False</property> + <property name="WindowPosition">CenterOnParent</property> + <property name="Buttons">2</property> + <property name="HelpButton">False</property> + <child internal-child="VBox"> + <widget class="Gtk.VBox" id="dialog1_VBox"> + <property name="MemberName" /> + <property name="BorderWidth">2</property> + <child> + <widget class="Gtk.VBox" id="vbox3"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <property name="BorderWidth">9</property> + <child> + <widget class="Gtk.ScrolledWindow" id="scrolledwindow1"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="VscrollbarPolicy">Never</property> + <property name="HscrollbarPolicy">Never</property> + <child> + <widget class="Gtk.Viewport" id="GtkViewport"> + <property name="MemberName" /> + <property name="ShadowType">None</property> + <child> + <widget class="Gtk.VBox" id="vbox4"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="labelInfo"> + <property name="MemberName" /> + <property name="WidthRequest">400</property> + <property name="Xalign">0</property> + <property name="Yalign">0</property> + <property name="LabelProp" translatable="yes">label3</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + </packing> + </child> + <child> + <widget class="Gtk.VBox" id="boxProgress"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="globalProgressLabel"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="Ellipsize">End</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.ProgressBar" id="mainProgressBar"> + <property name="MemberName" /> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + </child> + <child internal-child="ActionArea"> + <widget class="Gtk.HButtonBox" id="dialog1_ActionArea"> + <property name="MemberName" /> + <property name="Spacing">10</property> + <property name="BorderWidth">5</property> + <property name="Size">2</property> + <property name="LayoutStyle">End</property> + <child> + <widget class="Gtk.Button" id="buttonCancel"> + <property name="MemberName" /> + <property name="CanDefault">True</property> + <property name="CanFocus">True</property> + <property name="UseStock">True</property> + <property name="Type">StockItem</property> + <property name="StockId">gtk-cancel</property> + <property name="ResponseId">-1</property> + <signal name="Clicked" handler="OnButtonCancelClicked" /> + <property name="label">gtk-cancel</property> + </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="buttonOk"> + <property name="MemberName" /> + <property name="CanDefault">True</property> + <property name="CanFocus">True</property> + <property name="Type">TextOnly</property> + <property name="Label" translatable="yes">Install</property> + <property name="UseUnderline">True</property> + <property name="ResponseId">-1</property> + <signal name="Clicked" handler="OnButtonOkClicked" /> + </widget> + <packing> + <property name="Position">1</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="Gtk.Bin" id="Mono.Addins.Gui.AddinInfoView" design-size="325 456"> + <property name="MemberName" /> + <property name="Visible">False</property> + <property name="GeneratePublic">False</property> + <child> + <widget class="Gtk.EventBox" id="ebox"> + <property name="MemberName" /> + <child> + <widget class="Gtk.VBox" id="vbox6"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.VBox" id="vbox3"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <property name="BorderWidth">12</property> + <child> + <widget class="Gtk.HBox" id="headerBox"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.VBox" id="vbox4"> + <property name="MemberName" /> + <property name="Spacing">3</property> + <child> + <widget class="Gtk.Label" id="labelName"> + <property name="MemberName" /> + <property name="WidthRequest">250</property> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes"><b><big>Some Addin</big></b></property> + <property name="UseMarkup">True</property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Label" id="labelVersion"> + <property name="MemberName" /> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes">Version 2.6</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">False</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.ScrolledWindow" id="scrolledwindow"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="HscrollbarPolicy">Never</property> + <child> + <widget class="Gtk.Viewport" id="GtkViewport"> + <property name="MemberName" /> + <property name="ShadowType">None</property> + <child> + <widget class="Gtk.EventBox" id="ebox2"> + <property name="MemberName" /> + <child> + <widget class="Gtk.VBox" id="vbox7"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="labelDesc"> + <property name="MemberName" /> + <property name="WidthRequest">250</property> + <property name="Xalign">0</property> + <property name="LabelProp" translatable="yes">Long description of the add-in. Long description of the add-in. Long description of the add-in. Long description of the add-in. Long description of the add-in. Long description of the add-in. </property> + <property name="Wrap">True</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + </packing> + </child> + <child> + <widget class="Gtk.EventBox" id="eboxButs"> + <property name="MemberName" /> + <child> + <widget class="Gtk.HBox" id="hbox1"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Button" id="btnInstall"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">resource:download.png</property> + <property name="Label" translatable="yes">Install...</property> + <property name="UseUnderline">True</property> + <signal name="Clicked" handler="OnBtnInstallClicked" /> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="btnUpdate"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">resource:download.png</property> + <property name="Label" translatable="yes">Update</property> + <property name="UseUnderline">True</property> + <signal name="Clicked" handler="OnBtnUpdateClicked" /> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="btnDisable"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextOnly</property> + <property name="Label" translatable="yes">Disable</property> + <property name="UseUnderline">True</property> + <signal name="Clicked" handler="OnBtnDisableClicked" /> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="btnUninstall"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextOnly</property> + <property name="Label" translatable="yes">_Uninstall...</property> + <property name="UseUnderline">True</property> + <signal name="Clicked" handler="OnBtnUninstallClicked" /> + </widget> + <packing> + <property name="Position">3</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> </stetic-interface>
\ No newline at end of file diff --git a/Mono.Addins.Gui/icons/download.png b/Mono.Addins.Gui/icons/download.png Binary files differnew file mode 100644 index 0000000..1920b1b --- /dev/null +++ b/Mono.Addins.Gui/icons/download.png diff --git a/Mono.Addins.Gui/icons/plugin-16.png b/Mono.Addins.Gui/icons/plugin-16.png Binary files differnew file mode 100644 index 0000000..e2fb70d --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-16.png diff --git a/Mono.Addins.Gui/icons/plugin-22.png b/Mono.Addins.Gui/icons/plugin-22.png Binary files differnew file mode 100644 index 0000000..d72fdbe --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-22.png diff --git a/Mono.Addins.Gui/icons/plugin-32.png b/Mono.Addins.Gui/icons/plugin-32.png Binary files differnew file mode 100644 index 0000000..45bcfec --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-32.png diff --git a/Mono.Addins.Gui/icons/plugin-avail-16.png b/Mono.Addins.Gui/icons/plugin-avail-16.png Binary files differnew file mode 100644 index 0000000..231c4c2 --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-avail-16.png diff --git a/Mono.Addins.Gui/icons/plugin-avail-32.png b/Mono.Addins.Gui/icons/plugin-avail-32.png Binary files differnew file mode 100644 index 0000000..c2a1252 --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-avail-32.png diff --git a/Mono.Addins.Gui/icons/plugin-disabled-32.png b/Mono.Addins.Gui/icons/plugin-disabled-32.png Binary files differnew file mode 100644 index 0000000..16550b2 --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-disabled-32.png diff --git a/Mono.Addins.Gui/icons/plugin-update-16.png b/Mono.Addins.Gui/icons/plugin-update-16.png Binary files differnew file mode 100644 index 0000000..4928879 --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-update-16.png diff --git a/Mono.Addins.Gui/icons/plugin-update-22.png b/Mono.Addins.Gui/icons/plugin-update-22.png Binary files differnew file mode 100644 index 0000000..8f130b4 --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-update-22.png diff --git a/Mono.Addins.Gui/icons/plugin-update-32.png b/Mono.Addins.Gui/icons/plugin-update-32.png Binary files differnew file mode 100644 index 0000000..071d326 --- /dev/null +++ b/Mono.Addins.Gui/icons/plugin-update-32.png diff --git a/Mono.Addins.Gui/icons/system-software-update_22.png b/Mono.Addins.Gui/icons/system-software-update_22.png Binary files differnew file mode 100644 index 0000000..5f7a362 --- /dev/null +++ b/Mono.Addins.Gui/icons/system-software-update_22.png |