~ubuntu-branches/ubuntu/feisty/elinks/feisty-updates

« back to all changes in this revision

Viewing changes to src/cookies/dialogs.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-06-30 08:57:43 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630085743-l81fgbw9dehvl1ds
Tags: 0.11.1-1ubuntu1
* Merge to Debian unstable.
* Removed gnutls12 porting, this is upstream now.
* Only Ubuntu changes left:
  - Killed type-handling.
  - Add X-Ubuntu-Gettext-Domain to .desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Cookie-related dialogs */
2
 
/* $Id: dialogs.c,v 1.76.4.3 2005/04/06 09:11:18 jonas Exp $ */
3
2
 
4
3
#ifdef HAVE_CONFIG_H
5
4
#include "config.h"
16
15
#include "cookies/dialogs.h"
17
16
#include "dialogs/edit.h"
18
17
#include "intl/gettext/libintl.h"
19
 
#include "sched/session.h"
 
18
#include "main/object.h"
 
19
#include "session/session.h"
20
20
#include "terminal/draw.h"
21
21
#include "terminal/terminal.h"
22
22
#include "util/conv.h"
23
23
#include "util/lists.h"
24
24
#include "util/memory.h"
25
 
#include "util/object.h"
26
25
#include "util/string.h"
27
26
 
28
27
 
79
78
                string.source,
80
79
                cookie, 2,
81
80
                N_("~Accept"), accept_cookie, B_ENTER,
82
 
                N_("~Reject"), free_cookie, B_ESC);
 
81
                N_("~Reject"), done_cookie, B_ESC);
83
82
}
84
83
 
85
84
 
173
172
}
174
173
 
175
174
static void
176
 
delete_cookie(struct listbox_item *item, int last)
 
175
delete_cookie_item(struct listbox_item *item, int last)
177
176
{
178
177
        struct cookie *cookie = item->udata;
179
178
 
183
182
                /* Releasing refcounts on the cookie_server will automagically
184
183
                 * delete it. */
185
184
                foreachsafe (item, next, root->child)
186
 
                        delete_cookie(item, 0);
 
185
                        delete_cookie_item(item, 0);
187
186
        } else {
188
187
                assert(!is_object_used(cookie));
189
188
 
190
 
                del_from_list(cookie);
191
 
                free_cookie(cookie);
 
189
                delete_cookie(cookie);
192
190
        }
193
191
 
194
192
        if (last
234
232
        get_cookie_root,
235
233
        NULL,
236
234
        can_delete_cookie,
237
 
        delete_cookie,
 
235
        delete_cookie_item,
238
236
        NULL,
239
237
        &cookies_messages,
240
238
};
241
239
 
242
 
static t_handler_event_status
 
240
static widget_handler_status_T
243
241
set_cookie_name(struct dialog_data *dlg_data, struct widget_data *widget_data)
244
242
{
245
243
        struct cookie *cookie = dlg_data->dlg->udata;
250
248
        return EVENT_PROCESSED;
251
249
}
252
250
 
253
 
static t_handler_event_status
 
251
static widget_handler_status_T
254
252
set_cookie_value(struct dialog_data *dlg_data, struct widget_data *widget_data)
255
253
{
256
254
        struct cookie *cookie = dlg_data->dlg->udata;
261
259
        return EVENT_PROCESSED;
262
260
}
263
261
 
264
 
static t_handler_event_status
 
262
static widget_handler_status_T
265
263
set_cookie_domain(struct dialog_data *dlg_data, struct widget_data *widget_data)
266
264
{
267
265
        struct cookie *cookie = dlg_data->dlg->udata;
272
270
        return EVENT_PROCESSED;
273
271
}
274
272
 
275
 
static t_handler_event_status
 
273
static widget_handler_status_T
276
274
set_cookie_expires(struct dialog_data *dlg_data, struct widget_data *widget_data)
277
275
{
278
276
        struct cookie *cookie = dlg_data->dlg->udata;
286
284
        number = strtol(value, (char **) &end, 10);
287
285
        if (errno || *end || number < 0) return EVENT_NOT_PROCESSED;
288
286
 
289
 
        cookie->expires = (ttime) number;
 
287
        cookie->expires = (time_t) number;
290
288
        return EVENT_PROCESSED;
291
289
}
292
290
 
293
 
static t_handler_event_status
 
291
static widget_handler_status_T
294
292
set_cookie_secure(struct dialog_data *dlg_data, struct widget_data *widget_data)
295
293
{
296
294
        struct cookie *cookie = dlg_data->dlg->udata;
362
360
#undef EDIT_WIDGETS_COUNT
363
361
}
364
362
 
365
 
static t_handler_event_status
 
363
static widget_handler_status_T
366
364
push_edit_button(struct dialog_data *dlg_data, struct widget_data *button)
367
365
{
368
366
        struct listbox_data *box = get_dlg_listbox_data(dlg_data);
377
375
        return EVENT_PROCESSED;
378
376
}
379
377
 
380
 
static t_handler_event_status
 
378
static widget_handler_status_T
381
379
push_add_button(struct dialog_data *dlg_data, struct widget_data *button)
382
380
{
383
381
        struct listbox_data *box = get_dlg_listbox_data(dlg_data);
410
408
        return EVENT_PROCESSED;
411
409
}
412
410
 
413
 
static t_handler_event_status
 
411
static widget_handler_status_T
414
412
push_save_button(struct dialog_data *dlg_data, struct widget_data *button)
415
413
{
416
414
        save_cookies();
421
419
        { N_("~Info"),          push_hierbox_info_button,       1 },
422
420
        { N_("~Add"),           push_add_button,                1 },
423
421
        { N_("~Edit"),          push_edit_button,               1 },
424
 
        { N_("~Delete"),                push_hierbox_delete_button,     1 },
425
 
        { N_("~Clear"),         push_hierbox_clear_button,      1 },
 
422
        { N_("~Delete"),        push_hierbox_delete_button,     1 },
 
423
        { N_("C~lear"),         push_hierbox_clear_button,      1 },
426
424
        { N_("Sa~ve"),          push_save_button,               0 },
427
425
};
428
426