void on_okButton_clicked(object o, EventArgs args) { if (Core.Settings.KeyEncrypted && !Core.Settings.CheckKeyPassword(oldPasswordEntry.Text)) { Gui.ShowErrorDialog("Old password incorrect"); oldPasswordEntry.GrabFocus(); return; } if (newPasswordEntry.Text != confirmPasswordEntry.Text) { Gui.ShowErrorDialog("New passwords do not match"); newPasswordEntry.GrabFocus(); return; } if (newPasswordEntry.Text == String.Empty) { var dialog = new Gtk.MessageDialog(base.Window, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, "Are you sure you don't want to set a password?"); dialog.Show(); int r = dialog.Run(); dialog.Destroy(); if (r != (int)Gtk.ResponseType.Yes) { return; } } Core.Settings.ChangeKeyPassword(newPasswordEntry.Text); if (!Core.Settings.FirstRun) Gui.ShowMessageDialog("Your password has been changed."); Dialog.Respond(Gtk.ResponseType.Ok); }
void EmptyTrash() { if (ConfirmTrashDelete) { Gtk.MessageDialog md = new Gtk.MessageDialog(null, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.None, "<b><big>" + Catalog.GetString("Empty all of the items from the trash?") + "</big></b>"); md.Icon = DockServices.Drawing.LoadIcon("docky", 22); md.SecondaryText = Catalog.GetString("If you choose to empty the trash, all items in it\n" + "will be permanently lost. Please note that you\n" + "can also delete them separately."); md.Modal = false; md.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); md.AddButton(Catalog.GetString("Empty _Trash"), Gtk.ResponseType.Ok); md.DefaultResponse = Gtk.ResponseType.Ok; md.Response += (o, args) => { if (args.ResponseId != Gtk.ResponseType.Cancel) { PerformEmptyTrash(); } md.Destroy(); }; md.Show(); } else { PerformEmptyTrash(); } }
void ClearRecent() { Gtk.MessageDialog md = new Gtk.MessageDialog(null, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.None, "<b><big>" + Catalog.GetString("Clear the Recent Documents list?") + "</big></b>"); md.Title = Catalog.GetString("Clear Recent Documents"); md.Icon = DockServices.Drawing.LoadIcon("docky", 22); md.SecondaryText = Catalog.GetString("If you clear the Recent Documents list, you clear the following:\n" + "\u2022 All items from the Places \u2192 Recent Documents menu item.\n" + "\u2022 All items from the recent documents list in all applications."); md.Modal = false; md.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); md.AddButton(Gtk.Stock.Clear, Gtk.ResponseType.Ok); md.DefaultResponse = Gtk.ResponseType.Ok; md.Response += (o, args) => { if (args.ResponseId != Gtk.ResponseType.Cancel) { Gtk.RecentManager.Default.PurgeItems(); } md.Destroy(); }; md.Show(); }
void on_okButton_clicked(object o, EventArgs args) { if (Core.Settings.KeyEncrypted && !Core.Settings.CheckKeyPassword(oldPasswordEntry.Text)) { Gui.ShowErrorDialog("Old password incorrect"); oldPasswordEntry.GrabFocus(); return; } if (newPasswordEntry.Text != confirmPasswordEntry.Text) { Gui.ShowErrorDialog("New passwords do not match"); newPasswordEntry.GrabFocus(); return; } if (newPasswordEntry.Text == String.Empty) { var dialog = new Gtk.MessageDialog(base.Window, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, "Are you sure you don't want to set a password?"); dialog.Show(); int r = dialog.Run(); dialog.Destroy(); if (r != (int)Gtk.ResponseType.Yes) { return; } } Core.Settings.ChangeKeyPassword(newPasswordEntry.Text); if (!Core.Settings.FirstRun) { Gui.ShowMessageDialog("Your password has been changed."); } Dialog.Respond(Gtk.ResponseType.Ok); }
void ClearRecent () { Gtk.MessageDialog md = new Gtk.MessageDialog (null, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.None, "<b><big>" + Catalog.GetString ("Clear the Recent Documents list?") + "</big></b>"); md.Title = Catalog.GetString ("Clear Recent Documents"); md.Icon = DockServices.Drawing.LoadIcon ("docky", 22); md.SecondaryText = Catalog.GetString ("If you clear the Recent Documents list, you clear the following:\n" + "\u2022 All items from the Places \u2192 Recent Documents menu item.\n" + "\u2022 All items from the recent documents list in all applications."); md.Modal = false; md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); md.AddButton (Gtk.Stock.Clear, Gtk.ResponseType.Ok); md.DefaultResponse = Gtk.ResponseType.Ok; md.Response += (o, args) => { if (args.ResponseId != Gtk.ResponseType.Cancel) Gtk.RecentManager.Default.PurgeItems (); md.Destroy (); }; md.Show (); }
void EmptyTrash () { if (ConfirmTrashDelete) { Gtk.MessageDialog md = new Gtk.MessageDialog (null, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.None, "<b><big>" + Catalog.GetString ("Empty all of the items from the trash?") + "</big></b>"); md.Icon = DockServices.Drawing.LoadIcon ("docky", 22); md.SecondaryText = Catalog.GetString ("If you choose to empty the trash, all items in it\n" + "will be permanently lost. Please note that you\n" + "can also delete them separately."); md.Modal = false; md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); md.AddButton (Catalog.GetString ("Empty _Trash"), Gtk.ResponseType.Ok); md.DefaultResponse = Gtk.ResponseType.Ok; md.Response += (o, args) => { if (args.ResponseId != Gtk.ResponseType.Cancel) PerformEmptyTrash (); md.Destroy (); }; md.Show (); } else { PerformEmptyTrash (); } }