42
42
static void rssyl_gtk_prop_store(RFolderItem *ritem)
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;
58
58
ritem->url = g_strdup(url);
61
ritem->auth->type = gtk_combo_box_get_active(GTK_COMBO_BOX(ritem->feedprop->auth_type));
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);
68
ritem->auth->username = g_strdup(auth_user);
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);
76
ritem->auth->password = g_strdup(auth_pass);
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;
162
rssyl_feedprop_auth_type_changed_cb(GtkComboBox *cb, gpointer data)
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);
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;
217
#if !(GTK_CHECK_VERSION(2, 12, 0))
218
GtkTooltips *tooltips;
230
254
feedprop->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
232
#if !(GTK_CHECK_VERSION(2, 12, 0))
233
tooltips = gtk_tooltips_new();
234
gtk_tooltips_enable(tooltips);
238
257
feedprop->url = gtk_entry_new();
239
258
gtk_entry_set_text(GTK_ENTRY(feedprop->url), ritem->url);
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),
265
feedprop->auth_type = gtk_combo_box_text_new();
266
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->auth_type),
268
_("No authentication"));
269
#if !GTK_CHECK_VERSION(2, 24, 0)
270
gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->auth_type),
272
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->auth_type),
274
_("HTTP Basic authentication"));
275
gtk_combo_box_set_active(GTK_COMBO_BOX(feedprop->auth_type),
279
feedprop->auth_username = gtk_entry_new();
280
gtk_entry_set_text(GTK_ENTRY(feedprop->auth_username),
281
ritem->auth->username);
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);
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"));
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);
266
310
gtk_widget_set_tooltip_text(trim_button,
267
311
_("Update feed, deleting items which are no longer in the source feed"));
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);
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."));
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);
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);
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);
363
418
/* Table for remaining properties */
364
419
table = gtk_table_new(11, 2, FALSE);