Exemple #1
0
        public void OnConfigure(object o, EventArgs args)
        {
            if (vmview.Selection.CountSelectedRows () == 0) {
                return;
            }

            ConfigDialog dialog = new ConfigDialog (vmview.GetSelectedMachine (), window);
            dialog.Response += delegate (object d, ResponseArgs rargs) {
                bool saveResult = true;
                if (rargs.ResponseId == ResponseType.Ok) {
                    saveResult = dialog.Save ();
                }

                if (saveResult) {
                    dialog.Destroy ();
                }
            };

            dialog.Show ();
        }
Exemple #2
0
        public void OnCreateBlank(object o, EventArgs args)
        {
            VirtualMachine machine = manager.CreateDefaultMachine ();

            ConfigDialog dialog = new ConfigDialog (machine, window);
            dialog.Response += delegate (object d, ResponseArgs respargs) {
                bool saveResult = true;
                if (respargs.ResponseId == ResponseType.Ok) {
                    manager.AddMachine (machine);
                    saveResult = dialog.Save ();
                }

                if (saveResult) {
                    dialog.Destroy ();
                }
            };

            dialog.Show ();
        }