Mercurial > pidgin
comparison src/gtkrequest.c @ 13267:f3ae450fb947
[gaim-migrate @ 15633]
Part of SF Patch #1175520 from dennisne
This adds a request API function to select a folder.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 13 Feb 2006 03:40:00 +0000 |
parents | 339c7dda758d |
children | 3638606a5afa |
comparison
equal
deleted
inserted
replaced
13266:d1088b7771d4 | 13267:f3ae450fb947 |
---|---|
1949 gtk_widget_show(filesel); | 1949 gtk_widget_show(filesel); |
1950 | 1950 |
1951 return (void *)data; | 1951 return (void *)data; |
1952 } | 1952 } |
1953 | 1953 |
1954 static void * | |
1955 gaim_gtk_request_folder(const char *title, const char *dirname, | |
1956 GCallback ok_cb, GCallback cancel_cb, | |
1957 void *user_data) | |
1958 { | |
1959 GaimGtkRequestData *data; | |
1960 GtkWidget *dirsel; | |
1961 | |
1962 data = g_new0(GaimGtkRequestData, 1); | |
1963 data->type = GAIM_REQUEST_FOLDER; | |
1964 data->user_data = user_data; | |
1965 data->cb_count = 2; | |
1966 data->cbs = g_new0(GCallback, 2); | |
1967 data->cbs[0] = cancel_cb; | |
1968 data->cbs[1] = ok_cb; | |
1969 data->u.file.savedialog = FALSE; | |
1970 | |
1971 dirsel = gtk_file_chooser_dialog_new( | |
1972 title ? title : _("Select Folder..."), | |
1973 NULL, | |
1974 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, | |
1975 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | |
1976 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, | |
1977 NULL); | |
1978 gtk_dialog_set_default_response(GTK_DIALOG(dirsel), GTK_RESPONSE_ACCEPT); | |
1979 | |
1980 if ((dirname != NULL) && (*dirname != '\0')) | |
1981 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dirsel), dirname); | |
1982 | |
1983 g_signal_connect(G_OBJECT(GTK_FILE_CHOOSER(dirsel)), "response", | |
1984 G_CALLBACK(file_ok_check_if_exists_cb), data); | |
1985 | |
1986 data->dialog = dirsel; | |
1987 gtk_widget_show(dirsel); | |
1988 | |
1989 return (void *)data; | |
1990 } | |
1991 | |
1954 static void | 1992 static void |
1955 gaim_gtk_close_request(GaimRequestType type, void *ui_handle) | 1993 gaim_gtk_close_request(GaimRequestType type, void *ui_handle) |
1956 { | 1994 { |
1957 GaimGtkRequestData *data = (GaimGtkRequestData *)ui_handle; | 1995 GaimGtkRequestData *data = (GaimGtkRequestData *)ui_handle; |
1958 | 1996 |
1974 gaim_gtk_request_input, | 2012 gaim_gtk_request_input, |
1975 gaim_gtk_request_choice, | 2013 gaim_gtk_request_choice, |
1976 gaim_gtk_request_action, | 2014 gaim_gtk_request_action, |
1977 gaim_gtk_request_fields, | 2015 gaim_gtk_request_fields, |
1978 gaim_gtk_request_file, | 2016 gaim_gtk_request_file, |
1979 gaim_gtk_close_request | 2017 gaim_gtk_close_request, |
2018 gaim_gtk_request_folder | |
1980 }; | 2019 }; |
1981 | 2020 |
1982 GaimRequestUiOps * | 2021 GaimRequestUiOps * |
1983 gaim_gtk_request_get_ui_ops(void) | 2022 gaim_gtk_request_get_ui_ops(void) |
1984 { | 2023 { |