Ejemplo n.º 1
0
        void ShowNameClashError(string title)
        {
            string message =
                String.Format(Catalog.GetString("A note with the title " +
                                                "<b>{0}</b> already exists. " +
                                                "Please choose another name " +
                                                "for this note before " +
                                                "continuing."),
                              title);

            /// Only pop open a warning dialog when one isn't already present
            /// Had to add this check because this method is being called twice.
            if (title_taken_dialog == null)
            {
                title_taken_dialog =
                    new HIGMessageDialog(Window,
                                         Gtk.DialogFlags.DestroyWithParent,
                                         Gtk.MessageType.Warning,
                                         Gtk.ButtonsType.Ok,
                                         Catalog.GetString("Note title taken"),
                                         message);
                title_taken_dialog.Modal     = true;
                title_taken_dialog.Response +=
                    delegate(object sender, Gtk.ResponseArgs args) {
                    title_taken_dialog.Destroy();
                    title_taken_dialog = null;
                };
            }

            title_taken_dialog.Present();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 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();
     }
 }
Ejemplo n.º 4
0
        /// <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();
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
 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();
     }
 }