protected virtual void OnInstallClicked(object sender, System.EventArgs e)
        {
            Gtk.Builder   builder = new Gtk.Builder(null, "Mono.Addins.GuiGtk3.interfaces.InstallDialog.ui", null);
            InstallDialog dlg     = new InstallDialog(service, builder, builder.GetObject("InstallDialog").Handle);

            try {
                List <AddinRepositoryEntry> selectedEntry = ((AddinInfoView)sender).SelectedEntries;
                dlg.InitForInstall(selectedEntry.ToArray());
                if (dlg.Run() == (int)Gtk.ResponseType.Ok)
                {
                    LoadAll();
                }
            } finally {
                dlg.Destroy();
            }
        }
        protected virtual void OnUpdateAll(object sender, System.EventArgs e)
        {
            object[] data = updatesTree.AddinsData;
            AddinRepositoryEntry[] entries = new AddinRepositoryEntry [data.Length];
            Array.Copy(data, entries, data.Length);
            Gtk.Builder   builder = new Gtk.Builder(null, "Mono.Addins.GuiGtk3.interfaces.InstallDialog.ui", null);
            InstallDialog dlg     = new InstallDialog(service, builder, builder.GetObject("InstallDialog").Handle);

            try {
                dlg.InitForInstall(entries);
                if (dlg.Run() == (int)Gtk.ResponseType.Ok)
                {
                    LoadAll();
                }
            } finally {
                dlg.Destroy();
            }
        }
 protected virtual void OnUpdateAll(object sender, System.EventArgs e)
 {
     object[] data = updatesTree.AddinsData;
     AddinRepositoryEntry[] entries = new AddinRepositoryEntry [data.Length];
     Array.Copy (data, entries, data.Length);
     Gtk.Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.InstallDialog.ui", null);
     InstallDialog dlg = new InstallDialog (service, builder, builder.GetObject ("InstallDialog").Handle);
     try {
         dlg.InitForInstall (entries);
         if (dlg.Run () == (int) Gtk.ResponseType.Ok)
             LoadAll ();
     } finally {
         dlg.Destroy ();
     }
 }
 protected virtual void OnUpdateClicked(object sender, System.EventArgs e)
 {
     List<AddinRepositoryEntry> selectedEntry = ((AddinInfoView)sender).SelectedEntries;
     Gtk.Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.InstallDialog.ui", null);
     InstallDialog dlg = new InstallDialog (service, builder, builder.GetObject ("InstallDialog").Handle);
     try {
         dlg.InitForInstall (selectedEntry.ToArray ());
         if (dlg.Run () == (int) Gtk.ResponseType.Ok)
             LoadAll ();
     } finally {
         dlg.Destroy ();
     }
 }
        protected virtual void OnButtonInstallFromFileClicked(object sender, System.EventArgs e)
        {
            string[] files;
            Gtk.FileChooserDialog dlg = new Gtk.FileChooserDialog (Catalog.GetString ("Install Add-in Package"), this, FileChooserAction.Open);
            try {
                if (lastFolder != null)
                    dlg.SetCurrentFolder (lastFolder);
                else
                    dlg.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
                dlg.SelectMultiple = true;

                Gtk.FileFilter f = new Gtk.FileFilter ();
                f.AddPattern ("*.mpack");
                f.Name = Catalog.GetString ("Add-in packages");
                dlg.AddFilter (f);

                f = new Gtk.FileFilter ();
                f.AddPattern ("*");
                f.Name = Catalog.GetString ("All files");
                dlg.AddFilter (f);

                dlg.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
                dlg.AddButton (Gtk.Stock.Open, ResponseType.Ok);
                if (dlg.Run () != (int) Gtk.ResponseType.Ok)
                    return;
                files = dlg.Filenames;
                lastFolder = dlg.CurrentFolder;
            } finally {
                dlg.Destroy ();
            }

            Gtk.Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.InstallDialog.ui", null);
            InstallDialog idlg = new InstallDialog (service, builder, builder.GetObject ("InstallDialog").Handle);
            try {
                idlg.InitForInstall (files);
                if (idlg.Run () == (int) Gtk.ResponseType.Ok)
                    LoadAll ();
            } finally {
                idlg.Destroy ();
            }
        }