/** Use to create new search folders and to edit existing ones */ SearchFolderDialog * search_folder_dialog_new (nodePtr node) { GtkWidget *dialog; SearchFolderDialog *sfd; sfd = SEARCH_FOLDER_DIALOG (g_object_new (SEARCH_FOLDER_DIALOG_TYPE, NULL)); sfd->priv->node = node; sfd->priv->vfolder = (vfolderPtr)node->data; sfd->priv->re = rule_editor_new (sfd->priv->vfolder->itemset); /* Create the dialog */ dialog = liferea_dialog_new (NULL, "vfolderdialog"); /* Setup search folder name */ sfd->priv->nameEntry = liferea_dialog_lookup (dialog, "searchNameEntry"); gtk_entry_set_text (GTK_ENTRY (sfd->priv->nameEntry), node_get_title (node)); /* Set up rule match type */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (dialog, sfd->priv->vfolder->itemset->anyMatch?"anyRuleRadioBtn":"allRuleRadioBtn")), TRUE); /* Set up rule list vbox */ gtk_container_add (GTK_CONTAINER (liferea_dialog_lookup (dialog, "ruleview_vfolder_dialog")), rule_editor_get_widget (sfd->priv->re)); /* bind buttons */ g_signal_connect (liferea_dialog_lookup (dialog, "addrulebtn"), "clicked", G_CALLBACK (on_addrulebtn_clicked), sfd); g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (on_propdialog_response), sfd); return sfd; }
SearchDialog * search_dialog_open (const gchar *query) { SearchDialog *sd; if (search) return search; sd = SEARCH_DIALOG (g_object_new (SEARCH_DIALOG_TYPE, NULL)); sd->priv->dialog = liferea_dialog_new (NULL, "searchdialog"); if (query) itemset_add_rule (sd->priv->vfolder->itemset, "exact", query, TRUE); sd->priv->re = rule_editor_new (sd->priv->vfolder); /* Note: the following code is somewhat duplicated from search_folder_dialog.c */ /* Setting default rule match type */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (sd->priv->dialog, "anyRuleRadioBtn2")), TRUE); /* Set up rule list vbox */ gtk_container_add (GTK_CONTAINER (liferea_dialog_lookup (sd->priv->dialog, "ruleview_search_dialog")), rule_editor_get_widget (sd->priv->re)); /* bind buttons */ g_signal_connect (liferea_dialog_lookup (sd->priv->dialog, "addrulebtn2"), "clicked", G_CALLBACK (on_addrulebtn_clicked), sd); g_signal_connect (G_OBJECT (sd->priv->dialog), "response", G_CALLBACK (on_search_dialog_response), sd); gtk_widget_show_all (sd->priv->dialog); search = sd; return sd; }
static void on_about_activate (GtkMenuItem *menuitem, gpointer user_data) { GtkWidget *dialog; dialog = liferea_dialog_new (NULL, "aboutdialog"); gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), VERSION); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_hide), NULL); gtk_widget_show (dialog); }
static void auth_dialog_init (AuthDialog *ad) { ad->priv = AUTH_DIALOG_GET_PRIVATE (ad); ad->priv->dialog = liferea_dialog_new ("auth.ui", "authdialog"); ad->priv->username = liferea_dialog_lookup (ad->priv->dialog, "usernameEntry"); ad->priv->password = liferea_dialog_lookup (ad->priv->dialog, "passwordEntry"); g_signal_connect (G_OBJECT (ad->priv->dialog), "response", G_CALLBACK (on_authdialog_response), ad); gtk_widget_show_all (ad->priv->dialog); }
void feed_list_view_rename_node (nodePtr node) { GtkWidget *nameentry, *dialog; dialog = liferea_dialog_new ("rename_node"); nameentry = liferea_dialog_lookup (dialog, "nameentry"); gtk_entry_set_text (GTK_ENTRY (nameentry), node_get_title (node)); g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (on_nodenamedialog_response), node); gtk_widget_show (dialog); }
void feed_list_node_rename (nodePtr node) { GtkWidget *nameentry; if (!nodenamedialog || !G_IS_OBJECT (nodenamedialog)) nodenamedialog = liferea_dialog_new (NULL, "nodenamedialog"); nameentry = liferea_dialog_lookup (nodenamedialog, "nameentry"); gtk_entry_set_text (GTK_ENTRY (nameentry), node_get_title (node)); g_signal_connect (G_OBJECT (nodenamedialog), "response", G_CALLBACK (on_nodenamedialog_response), node); gtk_widget_show (nodenamedialog); }
gboolean ui_folder_add (void) { GtkWidget *foldernameentry; if (!newfolderdialog || !G_IS_OBJECT (newfolderdialog)) newfolderdialog = liferea_dialog_new (NULL, "newfolderdialog"); foldernameentry = liferea_dialog_lookup (newfolderdialog, "foldertitleentry"); gtk_entry_set_text (GTK_ENTRY (foldernameentry), ""); gtk_widget_show (newfolderdialog); return TRUE; }
void on_menu_show_update_monitor(GSimpleAction *action, GVariant *parameter, gpointer user_data) { GtkCellRenderer *textRenderer, *iconRenderer; GtkTreeViewColumn *column; GtkTreeView *view; if(!umdialog) { umdialog = liferea_dialog_new ("update_monitor"); g_signal_connect (G_OBJECT (umdialog), "destroy", G_CALLBACK (on_update_monitor_destroyed_cb), NULL); /* Set up left store and view */ view = GTK_TREE_VIEW(liferea_dialog_lookup(umdialog, "left")); um1store = gtk_tree_store_new(UM_LEN, G_TYPE_ICON, G_TYPE_STRING); gtk_tree_view_set_model(view, GTK_TREE_MODEL(um1store)); textRenderer = gtk_cell_renderer_text_new(); iconRenderer = gtk_cell_renderer_pixbuf_new(); column = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start(column, iconRenderer, FALSE); gtk_tree_view_column_pack_start(column, textRenderer, TRUE); gtk_tree_view_column_add_attribute(column, iconRenderer, "gicon", UM_FAVICON); gtk_tree_view_column_add_attribute(column, textRenderer, "markup", UM_REQUEST_TITLE); gtk_tree_view_append_column(view, column); /* Set up right store and view */ view = GTK_TREE_VIEW(liferea_dialog_lookup(umdialog, "right")); um2store = gtk_tree_store_new(UM_LEN, G_TYPE_ICON, G_TYPE_STRING); gtk_tree_view_set_model(view, GTK_TREE_MODEL(um2store)); textRenderer = gtk_cell_renderer_text_new(); iconRenderer = gtk_cell_renderer_pixbuf_new(); column = gtk_tree_view_column_new(); gtk_tree_view_column_pack_start(column, iconRenderer, FALSE); gtk_tree_view_column_pack_start(column, textRenderer, TRUE); gtk_tree_view_column_add_attribute(column, iconRenderer, "gicon", UM_FAVICON); gtk_tree_view_column_add_attribute(column, textRenderer, "markup", UM_REQUEST_TITLE); gtk_tree_view_append_column(view, column); /* Fill in data */ um1hash = g_hash_table_new(g_str_hash, g_str_equal); um2hash = g_hash_table_new(g_str_hash, g_str_equal); (void)g_timeout_add_seconds(1, ui_update_monitor_update, NULL); } gtk_window_present(GTK_WINDOW(umdialog)); }
static void subscription_prop_dialog_init (SubscriptionPropDialog *spd) { GtkWidget *propdialog; spd->priv = SUBSCRIPTION_PROP_DIALOG_GET_PRIVATE (spd); spd->priv->dialog = propdialog = liferea_dialog_new (NULL, "propdialog"); /* set default update interval spin button and unit combo box */ ui_common_setup_combo_menu (liferea_dialog_lookup (propdialog, "refreshIntervalUnitComboBox"), default_update_interval_unit_options, NULL /* no callback */, -1 /* default value */ ); spd->priv->feedNameEntry = liferea_dialog_lookup (propdialog, "feedNameEntry"); spd->priv->refreshInterval = liferea_dialog_lookup (propdialog, "refreshIntervalSpinButton"); spd->priv->refreshIntervalUnit = liferea_dialog_lookup (propdialog, "refreshIntervalUnitComboBox"); spd->priv->sourceEntry = liferea_dialog_lookup (propdialog, "sourceEntry"); spd->priv->selectFile = liferea_dialog_lookup (propdialog, "selectSourceFileButton"); spd->priv->fileRadio = liferea_dialog_lookup (propdialog, "feed_loc_file"); spd->priv->urlRadio = liferea_dialog_lookup (propdialog, "feed_loc_url"); spd->priv->cmdRadio = liferea_dialog_lookup (propdialog, "feed_loc_command"); spd->priv->authcheckbox = liferea_dialog_lookup (propdialog, "HTTPauthCheck"); spd->priv->username = liferea_dialog_lookup (propdialog, "usernameEntry"); spd->priv->password = liferea_dialog_lookup (propdialog, "passwordEntry"); spd->priv->credTable = liferea_dialog_lookup (propdialog, "table4"); g_signal_connect (spd->priv->selectFile, "clicked", G_CALLBACK (on_selectfile_pressed), spd->priv); g_signal_connect (spd->priv->urlRadio, "toggled", G_CALLBACK (on_feed_prop_url_radio), spd->priv); g_signal_connect (spd->priv->fileRadio, "toggled", G_CALLBACK (on_feed_prop_url_radio), spd->priv); g_signal_connect (spd->priv->cmdRadio, "toggled", G_CALLBACK (on_feed_prop_url_radio), spd->priv); g_signal_connect (spd->priv->authcheckbox, "toggled", G_CALLBACK (on_feed_prop_authcheck), spd->priv); g_signal_connect (liferea_dialog_lookup (propdialog, "filterCheckbox"), "toggled", G_CALLBACK (on_feed_prop_filtercheck), spd->priv); g_signal_connect (liferea_dialog_lookup (propdialog, "filterSelectFile"), "clicked", G_CALLBACK (on_selectfile_pressed), spd->priv); g_signal_connect (liferea_dialog_lookup (propdialog, "feedCacheLimited"), "toggled", G_CALLBACK (on_feed_prop_cache_radio), spd->priv); g_signal_connect (liferea_dialog_lookup (propdialog, "updateIntervalSpecific"), "toggled", G_CALLBACK(on_feed_prop_update_radio), spd->priv); g_signal_connect (G_OBJECT (propdialog), "response", G_CALLBACK (on_propdialog_response), spd); gtk_widget_show_all (propdialog); }
void on_action_mark_all_read (GSimpleAction *action, GVariant *parameter, gpointer user_data) { nodePtr feedlist; gboolean confirm_mark_read; gboolean do_mark_read = TRUE; if (!g_strcmp0 (g_action_get_name (G_ACTION (action)), "mark-all-feeds-read")) feedlist = feedlist_get_root (); else if (user_data) feedlist = (nodePtr) user_data; else feedlist = feedlist_get_selected (); conf_get_bool_value (CONFIRM_MARK_ALL_READ, &confirm_mark_read); if (confirm_mark_read) { gint result; GtkMessageDialog *confirm_dialog = GTK_MESSAGE_DIALOG (liferea_dialog_new ("mark_read_dialog")); GtkWidget *dont_ask_toggle = liferea_dialog_lookup (GTK_WIDGET (confirm_dialog), "dontAskAgainToggle"); const gchar *feed_title = (feedlist_get_root () == feedlist) ? _("all feeds"):node_get_title (feedlist); gchar *primary_message = g_strdup_printf (_("Mark %s as read ?"), feed_title); g_object_set (confirm_dialog, "text", primary_message, NULL); g_free (primary_message); gtk_message_dialog_format_secondary_text (confirm_dialog, _("Are you sure you want to mark all items in %s as read ?"), feed_title); conf_bind (CONFIRM_MARK_ALL_READ, dont_ask_toggle, "active", G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_INVERT_BOOLEAN); result = gtk_dialog_run (GTK_DIALOG (confirm_dialog)); if (result != GTK_RESPONSE_OK) do_mark_read = FALSE; gtk_widget_destroy (GTK_WIDGET (confirm_dialog)); } if (do_mark_read) feedlist_mark_all_read (feedlist); }
SimpleSearchDialog * simple_search_dialog_open (void) { SimpleSearchDialog *ssd; if (simpleSearch) return simpleSearch; ssd = SIMPLE_SEARCH_DIALOG (g_object_new (SIMPLE_SEARCH_DIALOG_TYPE, NULL)); ssd->priv->dialog = liferea_dialog_new (NULL, "simplesearchdialog"); ssd->priv->query = liferea_dialog_lookup (ssd->priv->dialog, "searchentry"); gtk_window_set_focus (GTK_WINDOW (ssd->priv->dialog), ssd->priv->query); g_signal_connect (G_OBJECT (ssd->priv->dialog), "response", G_CALLBACK (on_simple_search_dialog_response), ssd); g_signal_connect (G_OBJECT (ssd->priv->query), "changed", G_CALLBACK (on_searchentry_changed), ssd); g_signal_connect (G_OBJECT (ssd->priv->query), "activate", G_CALLBACK (on_searchentry_activated), ssd); gtk_widget_show_all (ssd->priv->dialog); simpleSearch = ssd; return ssd; }
void preferences_dialog_init (PreferencesDialog *pd) { GtkWidget *widget, *entry; GtkComboBox *combo; GtkListStore *store; GtkTreeIter treeiter; GtkAdjustment *itemCount; GtkTreeStore *treestore; GtkTreeViewColumn *column; GSList *list; gchar *proxyport; gchar *configuredBrowser, *name; gboolean enabled; static int manual; struct browser *iter; gint tmp, i, iSetting, proxy_port; gboolean bSetting, show_tray_icon; gchar *proxy_host, *proxy_user, *proxy_passwd; gchar *browser_command; prefdialog = pd; pd->priv = PREFERENCES_DIALOG_GET_PRIVATE (pd); pd->priv->dialog = liferea_dialog_new ("prefs.ui", "prefdialog"); /* Set up browser selection popup */ store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); for(i = 0, iter = browser_get_all (); iter->id != NULL; iter++, i++) { gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, _(iter->display), 1, i, -1); } manual = i; /* This allows the user to choose their own browser by typing in the command. */ gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, _("Manual"), 1, i, -1); combo = GTK_COMBO_BOX (liferea_dialog_lookup (pd->priv->dialog, "browserpopup")); gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); ui_common_setup_combo_text (combo, 0); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(on_browser_changed), pd); /* Create location menu */ store = gtk_list_store_new (1, G_TYPE_STRING); combo = GTK_COMBO_BOX (liferea_dialog_lookup (pd->priv->dialog, "browserlocpopup")); gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); ui_common_setup_combo_text (combo, 0); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(on_browser_place_changed), pd); gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, _("Browser default"), -1); gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, _("Existing window"), -1); gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, _("New window"), -1); gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, _("New tab"), -1); /* ================== panel 1 "feeds" ==================== */ /* check box for feed startup update */ conf_get_int_value (STARTUP_FEED_ACTION, &iSetting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "startupactionbtn")), (iSetting == 0)); /* cache size setting */ widget = liferea_dialog_lookup (pd->priv->dialog, "itemCountBtn"); itemCount = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)); conf_get_int_value (DEFAULT_MAX_ITEMS, &iSetting); gtk_adjustment_set_value (itemCount, iSetting); /* set default update interval spin button and unit combo box */ ui_common_setup_combo_menu (liferea_dialog_lookup (pd->priv->dialog, "globalRefreshIntervalUnitComboBox"), default_update_interval_unit_options, G_CALLBACK (on_default_update_interval_unit_changed), -1); widget = liferea_dialog_lookup (pd->priv->dialog, "globalRefreshIntervalUnitComboBox"); conf_get_int_value (DEFAULT_UPDATE_INTERVAL, &tmp); if (tmp % 1440 == 0) { /* days */ gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 2); tmp /= 1440; } else if (tmp % 60 == 0) { /* hours */ gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1); tmp /= 60; } else { /* minutes */ gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); } widget = liferea_dialog_lookup (pd->priv->dialog,"globalRefreshIntervalSpinButton"); gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), tmp); g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (on_default_update_interval_value_changed), pd); /* ================== panel 2 "folders" ==================== */ g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "updateAllFavicons")), "clicked", G_CALLBACK(on_updateallfavicons_clicked), pd); conf_get_int_value (FOLDER_DISPLAY_MODE, &iSetting); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "folderdisplaybtn")), iSetting?TRUE:FALSE); conf_get_bool_value (FOLDER_DISPLAY_HIDE_READ, &bSetting); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "hidereadbtn")), bSetting?TRUE:FALSE); /* ================== panel 3 "headlines" ==================== */ conf_get_int_value (BROWSE_KEY_SETTING, &iSetting); ui_common_setup_combo_menu (liferea_dialog_lookup (pd->priv->dialog, "skimKeyCombo"), browser_skim_key_options, G_CALLBACK (on_skim_key_changed), iSetting); conf_get_int_value (DEFAULT_VIEW_MODE, &iSetting); ui_common_setup_combo_menu (liferea_dialog_lookup (pd->priv->dialog, "defaultViewModeCombo"), default_view_mode_options, G_CALLBACK (on_default_view_mode_changed), iSetting); /* Setup social bookmarking list */ i = 0; conf_get_str_value (SOCIAL_BM_SITE, &name); store = gtk_list_store_new (1, G_TYPE_STRING); list = bookmarkSites; while (list) { socialSitePtr siter = list->data; if (name && !strcmp (siter->name, name)) tmp = i; gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, 0, siter->name, -1); list = g_slist_next (list); i++; } combo = GTK_COMBO_BOX (liferea_dialog_lookup (pd->priv->dialog, "socialpopup")); g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (on_socialsite_changed), pd); gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); ui_common_setup_combo_text (combo, 0); gtk_combo_box_set_active (combo, tmp); /* ================== panel 4 "browser" ==================== */ /* set the inside browsing flag */ widget = liferea_dialog_lookup(pd->priv->dialog, "browseinwindow"); conf_get_bool_value(BROWSE_INSIDE_APPLICATION, &bSetting); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), bSetting); /* set the javascript-disabled flag */ widget = liferea_dialog_lookup(pd->priv->dialog, "disablejavascript"); conf_get_bool_value(DISABLE_JAVASCRIPT, &bSetting); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), bSetting); /* set the enable Plugins flag */ widget = liferea_dialog_lookup(pd->priv->dialog, "enableplugins"); conf_get_bool_value(ENABLE_PLUGINS, &bSetting); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), bSetting); tmp = 0; conf_get_str_value(BROWSER_ID, &configuredBrowser); if(!strcmp(configuredBrowser, "manual")) tmp = manual; else for(i=0, iter = browser_get_all (); iter->id != NULL; iter++, i++) if(!strcmp(configuredBrowser, iter->id)) tmp = i; gtk_combo_box_set_active(GTK_COMBO_BOX(liferea_dialog_lookup(pd->priv->dialog, "browserpopup")), tmp); g_free(configuredBrowser); conf_get_int_value (BROWSER_PLACE, &iSetting); gtk_combo_box_set_active(GTK_COMBO_BOX(liferea_dialog_lookup(pd->priv->dialog, "browserlocpopup")), iSetting); conf_get_str_value (BROWSER_COMMAND, &browser_command); entry = liferea_dialog_lookup(pd->priv->dialog, "browsercmd"); gtk_entry_set_text(GTK_ENTRY(entry), browser_command); g_free (browser_command); gtk_widget_set_sensitive (GTK_WIDGET (entry), tmp == manual); gtk_widget_set_sensitive (liferea_dialog_lookup (pd->priv->dialog, "manuallabel"), tmp == manual); gtk_widget_set_sensitive (liferea_dialog_lookup (pd->priv->dialog, "urlhintlabel"), tmp == manual); /* ================== panel 4 "GUI" ================ */ widget = liferea_dialog_lookup (pd->priv->dialog, "popupwindowsoptionbtn"); conf_get_bool_value (SHOW_POPUP_WINDOWS, &bSetting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), bSetting); widget = liferea_dialog_lookup (pd->priv->dialog, "trayiconoptionbtn"); conf_get_bool_value (SHOW_TRAY_ICON, &show_tray_icon); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), show_tray_icon); widget = liferea_dialog_lookup (pd->priv->dialog, "newcountintraybtn"); conf_get_bool_value (SHOW_NEW_COUNT_IN_TRAY, &bSetting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), bSetting); gtk_widget_set_sensitive (liferea_dialog_lookup (pd->priv->dialog, "newcountintraybtn"), show_tray_icon); widget = liferea_dialog_lookup (pd->priv->dialog, "minimizetotraybtn"); conf_get_bool_value (DONT_MINIMIZE_TO_TRAY, &bSetting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), bSetting); gtk_widget_set_sensitive (liferea_dialog_lookup (pd->priv->dialog, "minimizetotraybtn"), show_tray_icon); widget = liferea_dialog_lookup (pd->priv->dialog, "startintraybtn"); conf_get_bool_value (START_IN_TRAY, &bSetting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), bSetting); gtk_widget_set_sensitive (liferea_dialog_lookup (pd->priv->dialog, "startintraybtn"), show_tray_icon); if (ui_indicator_is_visible ()) { /* If we use the indicator applet: - The "show tray icon" and "minimize to tray icon" settings are interpreted as "show indicator" and "minimize to indicator" - The "new count in tray icon" setting doesn't make sense and is ignored by indicator handling code */ gtk_widget_hide (liferea_dialog_lookup (pd->priv->dialog, "newcountintraybtn")); gtk_button_set_label (GTK_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "trayiconoptionbtn")), _("Integrate with the messaging menu (indicator)")); gtk_button_set_label (GTK_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "minimizetotraybtn")), _("Terminate instead of minimizing to the messaging menu")); gtk_button_set_label (GTK_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "startintraybtn")), _("Start minimized to the messaging menu")); } /* tool bar settings */ widget = liferea_dialog_lookup (pd->priv->dialog, "hidetoolbarbtn"); conf_get_bool_value(DISABLE_TOOLBAR, &bSetting); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), bSetting); /* select currently active toolbar style option */ conf_get_str_value (TOOLBAR_STYLE, &name); for (i = 0; gui_toolbar_style_values[i] != NULL; ++i) { if (strcmp (name, gui_toolbar_style_values[i]) == 0) break; } g_free (name); /* On invalid key value: revert to default */ if (gui_toolbar_style_values[i] == NULL) i = 0; /* create toolbar style menu */ ui_common_setup_combo_menu (liferea_dialog_lookup (pd->priv->dialog, "toolbarCombo"), gui_toolbar_style_options, G_CALLBACK (on_gui_toolbar_style_changed), i); /* ================= panel 5 "proxy" ======================== */ conf_get_str_value (PROXY_HOST, &proxy_host); gtk_entry_set_text (GTK_ENTRY (liferea_dialog_lookup (pd->priv->dialog, "proxyhostentry")), proxy_host); g_free (proxy_host); conf_get_int_value (PROXY_PORT, &proxy_port); proxyport = g_strdup_printf ("%d", proxy_port); gtk_entry_set_text (GTK_ENTRY (liferea_dialog_lookup (pd->priv->dialog, "proxyportentry")), proxyport); g_free (proxyport); conf_get_bool_value (PROXY_USEAUTH, &enabled); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "useProxyAuth")), enabled); conf_get_str_value (PROXY_USER, &proxy_user); gtk_entry_set_text (GTK_ENTRY (liferea_dialog_lookup (pd->priv->dialog, "proxyusernameentry")), proxy_user); g_free (proxy_user); conf_get_str_value (PROXY_PASSWD, &proxy_passwd); gtk_entry_set_text (GTK_ENTRY (liferea_dialog_lookup (pd->priv->dialog, "proxypasswordentry")), proxy_passwd); g_free (proxy_passwd); gtk_widget_set_sensitive (GTK_WIDGET (liferea_dialog_lookup(pd->priv->dialog, "proxyauthtable")), enabled); conf_get_int_value (PROXY_DETECT_MODE, &i); switch (i) { default: case 0: /* proxy auto detect */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "proxyAutoDetectRadio")), TRUE); enabled = FALSE; break; case 1: /* no proxy */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "noProxyRadio")), TRUE); enabled = FALSE; break; case 2: /* manual proxy */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (pd->priv->dialog, "manualProxyRadio")), TRUE); enabled = TRUE; break; } gtk_widget_set_sensitive (GTK_WIDGET (liferea_dialog_lookup (pd->priv->dialog, "proxybox")), enabled); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "proxyAutoDetectRadio")), "clicked", G_CALLBACK (on_proxyAutoDetect_clicked), pd); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "noProxyRadio")), "clicked", G_CALLBACK (on_noProxy_clicked), pd); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "manualProxyRadio")), "clicked", G_CALLBACK (on_manualProxy_clicked), pd); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "proxyhostentry")), "changed", G_CALLBACK (on_proxyhostentry_changed), pd); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "proxyportentry")), "changed", G_CALLBACK (on_proxyportentry_changed), pd); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "proxyusernameentry")), "changed", G_CALLBACK (on_proxyusernameentry_changed), pd); g_signal_connect (G_OBJECT (liferea_dialog_lookup (pd->priv->dialog, "proxypasswordentry")), "changed", G_CALLBACK (on_proxypasswordentry_changed), pd); /* ================= panel 6 "Enclosures" ======================== */ /* menu for download tool */ conf_get_int_value (DOWNLOAD_TOOL, &iSetting); ui_common_setup_combo_menu (liferea_dialog_lookup (pd->priv->dialog, "downloadToolCombo"), enclosure_download_tool_options, G_CALLBACK (on_enclosure_download_tool_changed), iSetting); /* set up list of configured enclosure types */ treestore = gtk_tree_store_new (FTS_LEN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); list = (GSList *)enclosure_mime_types_get (); while (list) { GtkTreeIter *newIter = g_new0 (GtkTreeIter, 1); gtk_tree_store_append (treestore, newIter, NULL); gtk_tree_store_set (treestore, newIter, FTS_TYPE, (NULL != ((encTypePtr)(list->data))->mime)?((encTypePtr)(list->data))->mime:((encTypePtr)(list->data))->extension, FTS_CMD, ((encTypePtr)(list->data))->cmd, FTS_PTR, list->data, -1); list = g_slist_next (list); } widget = liferea_dialog_lookup (pd->priv->dialog, "enc_action_view"); gtk_tree_view_set_model (GTK_TREE_VIEW (widget), GTK_TREE_MODEL (treestore)); column = gtk_tree_view_column_new_with_attributes (_("Type"), gtk_cell_renderer_text_new (), "text", FTS_TYPE, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column); gtk_tree_view_column_set_sort_column_id (column, FTS_TYPE); column = gtk_tree_view_column_new_with_attributes (_("Program"), gtk_cell_renderer_text_new (), "text", FTS_CMD, NULL); gtk_tree_view_column_set_sort_column_id (column, FTS_CMD); gtk_tree_view_append_column (GTK_TREE_VIEW(widget), column); gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW(widget)), GTK_SELECTION_SINGLE); /* ================= panel 7 "Plugins" ======================== */ pd->priv->plugins_box = liferea_dialog_lookup (pd->priv->dialog, "plugins_box"); g_assert (pd->priv->plugins_box != NULL); GtkWidget *alignment; alignment = gtk_alignment_new (0., 0., 1., 1.); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 12, 12, 12); widget = peas_gtk_plugin_manager_new (NULL); g_assert (widget != NULL); gtk_container_add (GTK_CONTAINER (alignment), widget); gtk_box_pack_start (GTK_BOX (pd->priv->plugins_box), alignment, TRUE, TRUE, 0); g_signal_connect_object (pd->priv->dialog, "destroy", G_CALLBACK (preferences_dialog_destroy_cb), pd, 0); gtk_widget_show_all (pd->priv->dialog); gtk_window_present (GTK_WINDOW (pd->priv->dialog)); }