public static void ShowOpeningLocationError(Gtk.Window parent, string url, string error) { string message = String.Format("{0}: {1}", url, error); HIGMessageDialog dialog = new HIGMessageDialog(parent, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, Catalog.GetString("Cannot open location"), message); dialog.Run(); dialog.Destroy(); }
static void OnNewNoteAction(object sender, EventArgs args) { try { Note new_note = manager.Create(); new_note.Window.Show(); } catch (Exception e) { HIGMessageDialog dialog = new HIGMessageDialog( null, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString("Cannot create new note"), e.Message); dialog.Run(); dialog.Destroy(); } }
/// <summary> /// Shows a success dialog when export is complete /// </summary> /// <param name="detail"> A string with details of the export folder.</param> private static void ShowSuccessDialog(string output_folder) { string detail = String.Format( Catalog.GetString("Your notes were exported to \"{0}\"."), output_folder); HIGMessageDialog msg_dialog = new HIGMessageDialog( null, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, Catalog.GetString("Notes exported successfully"), detail); msg_dialog.Run(); msg_dialog.Destroy(); }
/// <summary> /// Shows an error dialog if things go wrong. /// </summary> /// <param name="output_folder"> /// A <see cref="System.String"/> with the name of the folder /// that couldn't be exported to. /// </param> /// <param name="dialog"> /// The parent <see cref="ExportMultipleDialog"/>. /// </param> /// <param name="error_message"> /// A <see cref="System.String"/> with an error description. /// </param> private static void ShowErrorDialog(string output_folder, ExportMultipleDialog dialog, string error_message) { string msg = String.Format( Catalog.GetString("Could not save the files in \"{0}\""), output_folder); HIGMessageDialog msg_dialog = new HIGMessageDialog( dialog, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, msg, error_message); msg_dialog.Run(); msg_dialog.Destroy(); dialog.Destroy(); Logger.Error(error_message); }
public static void ShowHelp(string project, string page, Gdk.Screen screen, Gtk.Window parent) { try { Services.NativeApplication.DisplayHelp(project, page, screen); } catch { string message = Catalog.GetString("The \"Tomboy Notes Manual\" could " + "not be found. Please verify " + "that your installation has been " + "completed successfully."); HIGMessageDialog dialog = new HIGMessageDialog(parent, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString("Help not found"), message); dialog.Run(); dialog.Destroy(); } }