~ubuntu-branches/debian/sid/claws-mail/sid

« back to all changes in this revision

Viewing changes to src/plugins/rssyl/rssyl_feed_props.c

  • Committer: Package Import Robot
  • Author(s): Ricardo Mones
  • Date: 2015-08-18 16:37:25 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20150818163725-1it32n9mzqkwy2ef
Tags: 3.12.0-1
* New upstream release:
- 'cannot reorganize mailboxes' (Closes: #777208)
- 'dropdown menu bar has disappeared…'(Closes: #778886)
- 'depends on plugins libraries'  (Closes: #779824)
- 'new upstream version (3.12.0)…' (Closes: #793665)
* 14CVE_2010_5109.patch, 15fix_crash_open_folder.patch,
  13desktop_file_categories.patch
- Remove patches applied upstream
* debian/control, debian/copyright, debian/claws-mail-managesieve*
- Add managesieve plugin (new in this release)
* debian/rules
- Set perl-plugin manpage release version automatically
* 12fix_manpage_header.patch
- Update patch to cope with upstream changes
* debian/control, debian/watch
- Update VCS-* and watch URLs (thanks Julian Wollrath)

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
static void rssyl_gtk_prop_store(RFolderItem *ritem)
43
43
{
44
 
        gchar *url;
 
44
        gchar *url, *auth_user, *auth_pass;
45
45
        gint x, old_ri, old_fetch_comments;
46
46
        gboolean use_default_ri = FALSE, keep_old = FALSE;
47
47
        FolderItem *item;
58
58
                ritem->url = g_strdup(url);
59
59
        }
60
60
 
 
61
        ritem->auth->type = gtk_combo_box_get_active(GTK_COMBO_BOX(ritem->feedprop->auth_type));
 
62
 
 
63
        auth_user = (gchar *)gtk_entry_get_text(GTK_ENTRY(ritem->feedprop->auth_username));
 
64
        if (auth_user != NULL) {
 
65
                if (ritem->auth->username) {
 
66
                        g_free(ritem->auth->username);
 
67
                }
 
68
                ritem->auth->username = g_strdup(auth_user);
 
69
        }
 
70
 
 
71
        auth_pass = (gchar *)gtk_entry_get_text(GTK_ENTRY(ritem->feedprop->auth_password));
 
72
        if (auth_pass != NULL) {
 
73
                if (ritem->auth->password) {
 
74
                        g_free(ritem->auth->password);
 
75
                }
 
76
                ritem->auth->password = g_strdup(auth_pass);
 
77
        }
 
78
 
61
79
        use_default_ri = gtk_toggle_button_get_active(
62
80
                        GTK_TOGGLE_BUTTON(ritem->feedprop->default_refresh_interval));
63
81
        ritem->default_refresh_interval = use_default_ri;
140
158
        return FALSE;
141
159
}
142
160
 
 
161
static void
 
162
rssyl_feedprop_auth_type_changed_cb(GtkComboBox *cb, gpointer data)
 
163
{
 
164
        RFeedProp *feedprop = (RFeedProp *)data;
 
165
        gboolean enable = (FEED_AUTH_NONE != gtk_combo_box_get_active(cb));
 
166
        gtk_widget_set_sensitive(GTK_WIDGET(feedprop->auth_username), enable);
 
167
        gtk_widget_set_sensitive(GTK_WIDGET(feedprop->auth_password), enable);
 
168
}
143
169
 
144
170
static gboolean
145
171
rssyl_props_cancel_cb(GtkWidget *widget, gpointer data)
210
236
        MainWindow *mainwin = mainwindow_get_mainwindow();
211
237
        RFeedProp *feedprop;
212
238
        GtkWidget *vbox, *urllabel, *urlframe, *urlalign, *table, *label,
 
239
                *inner_vbox, *auth_hbox, *auth_user_label, *auth_pass_label,
213
240
                                                *hsep, *sep, *bbox, *cancel_button, *cancel_align,
214
241
                                                *cancel_hbox, *cancel_image, *cancel_label, *ok_button, *ok_align,
215
242
                                                *ok_hbox, *ok_image, *ok_label, *trim_button, *silent_update_label;
216
243
        GtkObject *adj;
217
 
#if !(GTK_CHECK_VERSION(2, 12, 0))
218
 
        GtkTooltips *tooltips;
219
 
#endif
220
244
        gint refresh;
221
245
        gint row = 0;
222
246
 
229
253
        /* Window */
230
254
        feedprop->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
231
255
 
232
 
#if !(GTK_CHECK_VERSION(2, 12, 0))
233
 
        tooltips = gtk_tooltips_new();
234
 
        gtk_tooltips_enable(tooltips);
235
 
#endif
236
 
 
237
256
        /* URL entry */
238
257
        feedprop->url = gtk_entry_new();
239
258
        gtk_entry_set_text(GTK_ENTRY(feedprop->url), ritem->url);
240
259
 
 
260
        /* URL auth type combo */
 
261
#if !GTK_CHECK_VERSION(2, 24, 0)
 
262
        feedprop->auth_type = gtk_combo_box_new_text();
 
263
        gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->auth_type),
 
264
#else
 
265
        feedprop->auth_type = gtk_combo_box_text_new();
 
266
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->auth_type),
 
267
#endif
 
268
                        _("No authentication"));
 
269
#if !GTK_CHECK_VERSION(2, 24, 0)
 
270
        gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->auth_type),
 
271
#else
 
272
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->auth_type),
 
273
#endif
 
274
                        _("HTTP Basic authentication"));
 
275
        gtk_combo_box_set_active(GTK_COMBO_BOX(feedprop->auth_type),
 
276
                        ritem->auth->type);
 
277
 
 
278
        /* Auth username */
 
279
        feedprop->auth_username = gtk_entry_new();
 
280
        gtk_entry_set_text(GTK_ENTRY(feedprop->auth_username),
 
281
                        ritem->auth->username);
 
282
 
 
283
        /* Auth password */
 
284
        feedprop->auth_password = gtk_entry_new();
 
285
        gtk_entry_set_visibility(GTK_ENTRY(feedprop->auth_password), FALSE);
 
286
        gtk_entry_set_text(GTK_ENTRY(feedprop->auth_password),
 
287
                        ritem->auth->password);
 
288
 
241
289
        /* "Use default refresh interval" checkbutton */
242
290
        feedprop->default_refresh_interval = gtk_check_button_new_with_mnemonic(
243
291
                        _("Use default refresh interval"));
259
307
 
260
308
        /* "Trim" button */
261
309
        trim_button = gtk_button_new_with_mnemonic(_("_Trim"));
262
 
#if !(GTK_CHECK_VERSION(2, 12, 0))
263
 
        gtk_tooltips_set_tip(tooltips, trim_button,
264
 
                        _("Update feed, deleting items which are no longer in the source feed"), NULL);
265
 
#else
266
310
        gtk_widget_set_tooltip_text(trim_button,
267
311
                        _("Update feed, deleting items which are no longer in the source feed"));
268
 
#endif
269
312
 
270
313
        feedprop->fetch_comments = gtk_check_button_new_with_mnemonic(
271
314
                        _("Fetch comments if possible"));
321
364
        gtk_toggle_button_set_active(
322
365
                        GTK_TOGGLE_BUTTON(feedprop->ignore_title_rename),
323
366
                        ritem->ignore_title_rename);
324
 
#if !(GTK_CHECK_VERSION(2, 12, 0))
325
 
        gtk_tooltips_set_tip(tooltips, feedprop->ignore_title_rename,
326
 
                        _("Enable this to keep current folder name, even if feed author changes title of the feed."), NULL);
327
 
#else
328
367
        gtk_widget_set_tooltip_text(feedprop->ignore_title_rename,
329
368
                        _("Enable this to keep current folder name, even if feed author changes title of the feed."));
330
 
#endif
331
369
 
332
370
        /* Verify SSL peer certificate */
333
371
        feedprop->ssl_verify_peer = gtk_check_button_new_with_label(
357
395
        gtk_alignment_set_padding(GTK_ALIGNMENT(urlalign), 5, 5, 5, 5);
358
396
        gtk_container_add(GTK_CONTAINER(urlframe), urlalign);
359
397
 
 
398
        inner_vbox = gtk_vbox_new(FALSE, 5);
 
399
        gtk_box_pack_start(GTK_BOX(inner_vbox), feedprop->url, FALSE, FALSE, 0);
360
400
        gtk_entry_set_activates_default(GTK_ENTRY(feedprop->url), TRUE);
361
 
        gtk_container_add(GTK_CONTAINER(urlalign), feedprop->url);
 
401
        gtk_container_add(GTK_CONTAINER(urlalign), inner_vbox);
 
402
 
 
403
        /* Auth combo + user (label + entry) + pass (label + entry) */
 
404
        auth_hbox = gtk_hbox_new(FALSE, 5);
 
405
        gtk_box_pack_start(GTK_BOX(auth_hbox), feedprop->auth_type, FALSE, FALSE, 0);
 
406
        g_signal_connect(G_OBJECT(feedprop->auth_type), "changed",
 
407
                        G_CALLBACK(rssyl_feedprop_auth_type_changed_cb),
 
408
                        (gpointer) feedprop);
 
409
        g_signal_emit_by_name(G_OBJECT(feedprop->auth_type), "changed");
 
410
        auth_user_label = gtk_label_new(_("User name"));
 
411
        gtk_box_pack_start(GTK_BOX(auth_hbox), auth_user_label, FALSE, FALSE, 0);
 
412
        gtk_box_pack_start(GTK_BOX(auth_hbox), feedprop->auth_username, FALSE, FALSE, 0);
 
413
        auth_pass_label = gtk_label_new(_("Password"));
 
414
        gtk_box_pack_start(GTK_BOX(auth_hbox), auth_pass_label, FALSE, FALSE, 0);
 
415
        gtk_box_pack_start(GTK_BOX(auth_hbox), feedprop->auth_password, FALSE, FALSE, 0);
 
416
        gtk_box_pack_start(GTK_BOX(inner_vbox), auth_hbox, FALSE, FALSE, 0);
362
417
 
363
418
        /* Table for remaining properties */
364
419
        table = gtk_table_new(11, 2, FALSE);