]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
When I implemented the GTK messagebox() function and everything that
authorSimon Tatham <anakin@pobox.com>
Fri, 11 Apr 2003 18:44:05 +0000 (18:44 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 11 Apr 2003 18:44:05 +0000 (18:44 +0000)
needed to use it, I completely forgot about askappend(). D'oh.

[originally from svn r3101]

unix/gtkdlg.c
unix/pterm.c

index 000fe04ab5bc0f325c5c61ff8ed7b79de4526996..63e510100a30eba0243f73ee27fe423d5b70f885 100644 (file)
@@ -2739,3 +2739,31 @@ void logevent_dlg(void *estuff, char *string)
     }
     es->nevents++;
 }
+
+int askappend(void *frontend, Filename filename)
+{
+    static const char msgtemplate[] =
+       "The session log file \"%.*s\" already exists. "
+       "You can overwrite it with a new session log, "
+       "append your session log to the end of it, "
+       "or disable session logging for this session.";
+    char *message;
+    char *mbtitle;
+    int mbret;
+
+    message = dupprintf(msgtemplate, FILENAME_MAX, filename.path);
+    mbtitle = dupprintf("%s Log to File", appname);
+
+    mbret = messagebox(get_window(frontend), mbtitle, message,
+                      string_width("LINE OF TEXT SUITABLE FOR THE"
+                                   " ASKAPPEND WIDTH"),
+                      "Overwrite", 'o', 1, 2,
+                      "Append", 'a', 0, 1,
+                      "Disable", 'd', -1, 0,
+                      NULL);
+
+    sfree(message);
+    sfree(mbtitle);
+
+    return mbret;
+}
index 70317d5cbc324116e65ebb8fa6f6a3419df32ab7..d787da91d0642ce298035ec18aa85c5037270aec 100644 (file)
@@ -152,17 +152,6 @@ void ldisc_update(void *frontend, int echo, int edit)
      */
 }
 
-int askappend(void *frontend, Filename filename)
-{
-    /*
-     * Logging in an xterm-alike is liable to be something you only
-     * do at serious diagnostic need. Hence, I'm going to take the
-     * easy option for now and assume we always want to overwrite
-     * log files. I can always make it properly configurable later.
-     */
-    return 2;
-}
-
 int from_backend(void *frontend, int is_stderr, const char *data, int len)
 {
     struct gui_data *inst = (struct gui_data *)frontend;