mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
When I implemented the GTK messagebox() function and everything that
needed to use it, I completely forgot about askappend(). D'oh. [originally from svn r3101]
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user