Пример #1
0
        protected virtual void OnDeleteDockButtonClicked(object sender, System.EventArgs e)
        {
            if (!(Docky.Controller.Docks.Count() > 1))
            {
                return;
            }

            if (ActiveDock != null)
            {
                Gtk.MessageDialog md = new Gtk.MessageDialog(null,
                                                             0,
                                                             Gtk.MessageType.Warning,
                                                             Gtk.ButtonsType.None,
                                                             "<b><big>" + Catalog.GetString("Delete the currently selected dock?") + "</big></b>");
                md.Icon          = DockServices.Drawing.LoadIcon("docky", 22);
                md.SecondaryText = Catalog.GetString("If you choose to delete the dock, all settings\n" +
                                                     "for the deleted dock will be permanently lost.");
                md.Modal     = true;
                md.KeepAbove = true;
                md.Stick();

                md.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
                md.AddButton(Catalog.GetString("_Delete Dock"), Gtk.ResponseType.Ok);
                md.DefaultResponse = Gtk.ResponseType.Ok;

                if ((ResponseType)md.Run() == Gtk.ResponseType.Ok)
                {
                    ActiveDock.ConfigurationClick -= HandleDockConfigurationClick;
                    ActiveDock.LeaveConfigurationMode();
                    Docky.Controller.DeleteDock(ActiveDock);
                    if (Docky.Controller.Docks.Count() == 1)
                    {
                        ActiveDock = Docky.Controller.Docks.First();
                    }
                    else
                    {
                        ActiveDock = null;
                    }
                }

                md.Destroy();
            }
        }
		protected virtual void OnDeleteDockButtonClicked (object sender, System.EventArgs e)
		{
			if (!(Docky.Controller.Docks.Count () > 1))
				return;
			
			if (ActiveDock != null) {
				Gtk.MessageDialog md = new Gtk.MessageDialog (null, 
						  0,
						  Gtk.MessageType.Warning, 
						  Gtk.ButtonsType.None,
						  "<b><big>" + Catalog.GetString ("Delete the currently selected dock?") + "</big></b>");
				md.Icon = DockServices.Drawing.LoadIcon ("docky", 22);
				md.SecondaryText = Catalog.GetString ("If you choose to delete the dock, all settings\n" +
					"for the deleted dock will be permanently lost.");
				md.Modal = true;
				md.KeepAbove = true;
				md.Stick ();
				
				md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
				md.AddButton (Catalog.GetString ("_Delete Dock"), Gtk.ResponseType.Ok);
				md.DefaultResponse = Gtk.ResponseType.Ok;
			
				if ((ResponseType)md.Run () == Gtk.ResponseType.Ok) {
					ActiveDock.ConfigurationClick -= HandleDockConfigurationClick;
					ActiveDock.LeaveConfigurationMode ();
					Docky.Controller.DeleteDock (ActiveDock);
					if (Docky.Controller.Docks.Count () == 1)
						ActiveDock = Docky.Controller.Docks.First ();
					else
						ActiveDock = null;
				}
				
				md.Destroy ();
			}
		}