{
struct dlgparam *dp = (struct dlgparam *)dlg;
struct uctrl *uc = dlg_find_byctrl(dp, ctrl);
- GtkContainer *cont;
assert(uc->ctrl->generic.type == CTRL_EDITBOX ||
uc->ctrl->generic.type == CTRL_LISTBOX);
assert(uc->menu != NULL || uc->list != NULL);
- cont = (uc->menu ? GTK_CONTAINER(uc->menu) : GTK_CONTAINER(uc->list));
-
- gtk_container_foreach(cont, container_remove_and_destroy, cont);
+ if (uc->menu) {
+ gtk_container_foreach(GTK_CONTAINER(uc->menu),
+ container_remove_and_destroy,
+ GTK_CONTAINER(uc->menu));
+ } else {
+ gtk_list_clear_items(GTK_LIST(uc->list), 0, -1);
+ }
}
void dlg_listbox_del(union control *ctrl, void *dlg, int index)
if (uc->menu)
activeitem = gtk_menu_get_active(GTK_MENU(uc->menu));
+ else
+ activeitem = NULL; /* unnecessarily placate gcc */
children = gtk_container_children(GTK_CONTAINER(uc->menu ? uc->menu :
uc->list));
window = gtk_dialog_new();
ctrlbox = ctrl_new_box();
- setup_config_box(ctrlbox, &sl, midsession, 0);
+ setup_config_box(ctrlbox, &sl, midsession, cfg->protocol);
unix_setup_config_box(ctrlbox, midsession, window);
gtk_window_set_title(GTK_WINDOW(window), title);
return req.width;
}
+int reallyclose(void *frontend)
+{
+ char *title = dupcat(appname, " Exit Confirmation", NULL);
+ int ret = messagebox(GTK_WIDGET(get_window(frontend)),
+ title, "Are you sure you want to close this session?",
+ string_width("Most of the width of the above text"),
+ "Yes", 'y', +1, 1,
+ "No", 'n', -1, 0,
+ NULL);
+ sfree(title);
+ return ret;
+}
+
void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
char *keystr, char *fingerprint)
{
}
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;
+}