public static int RunToInstallFile (Gtk.Window parent, Setup.SetupService service, string file) { var dlg = new InstallDialog (parent, service); try { dlg.InitForInstall (new [] { file }); return dlg.Run (); } 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(); } InstallDialog idlg = new InstallDialog(this, service); try { idlg.InitForInstall(files); if (idlg.Run() == (int)Gtk.ResponseType.Ok) { LoadAll(); } } finally { idlg.Destroy(); } }
protected virtual void OnUpdateClicked(object sender, System.EventArgs e) { List <AddinRepositoryEntry> selectedEntry = ((AddinInfoView)sender).SelectedEntries; InstallDialog dlg = new InstallDialog(this, service); try { 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); InstallDialog dlg = new InstallDialog(this, service); 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; InstallDialog dlg = new InstallDialog (this, service); try { 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); InstallDialog dlg = new InstallDialog (this, service); try { dlg.InitForInstall (entries); if (dlg.Run () == (int) Gtk.ResponseType.Ok) LoadAll (); } finally { dlg.Destroy (); } }
protected virtual void OnUninstallClicked(object sender, System.EventArgs e) { List<Addin> selectedAddin = ((AddinInfoView)sender).SelectedAddins; InstallDialog dlg = new InstallDialog (this, service); try { dlg.InitForUninstall (selectedAddin.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 (); } InstallDialog idlg = new InstallDialog (this, service); try { idlg.InitForInstall (files); if (idlg.Run () == (int) Gtk.ResponseType.Ok) LoadAll (); } finally { idlg.Destroy (); } }