Exemplo n.º 1
0
		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 ();
			}
		}
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
 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 ();
     }
 }
Exemplo n.º 6
0
 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 ();
     }
 }
Exemplo n.º 7
0
 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 ();
     }
 }
Exemplo n.º 8
0
        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 ();
            }
        }