static GtkWidget *plugin_config_frame(PurplePlugin *plugin) { GtkWidget *frame; GtkWidget *vbox, *vbox2; GtkSizeGroup *sg; GtkWidget *dd; frame = gtk_vbox_new(FALSE, 18); gtk_container_set_border_width(GTK_CONTAINER(frame), 12); vbox = pidgin_make_frame(frame, "Inform about unread..."); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); dd = pidgin_prefs_dropdown(vbox, "LED:", PURPLE_PREF_STRING, "/plugins/gtk/ftdi-hwnotify/led-one", "None", "none", "Blue", "blue", "Red", "red", "Green", "green", NULL); gtk_size_group_add_widget(sg, dd); dd = pidgin_prefs_dropdown(vbox, "Instant Messages:", PURPLE_PREF_STRING, "/plugins/gtk/ftdi-hwnotify/im", "Never", "never", "In hidden conversations", "hidden", "Always", "always", NULL); gtk_size_group_add_widget(sg, dd); dd = pidgin_prefs_dropdown(vbox, "Chat Messages:", PURPLE_PREF_STRING, "/plugins/gtk/ftdi-hwnotify/chat", "Never", "never", "When my nick is said", "nick", "Always", "always", NULL); gtk_size_group_add_widget(sg, dd); vbox2 = pidgin_make_frame(frame, "Important contacts..."); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); dd = pidgin_prefs_dropdown(vbox2, "LED:", PURPLE_PREF_STRING, "/plugins/gtk/ftdi-hwnotify/led-imp", "None", "none", "Blue", "blue", "Red", "red", "Green", "green", NULL); gtk_size_group_add_widget(sg, dd); pidgin_prefs_labeled_entry (vbox2, "Contacts:", "/plugins/gtk/ftdi-hwnotify/contacts-imp", sg); gtk_widget_show_all(frame); return frame; }
static GtkWidget * plonkers_get_config_frame(PurplePlugin *plugin) { GtkWidget *vbox, *hbox, *frame, *label; GtkSizeGroup *sg; vbox = gtk_vbox_new(FALSE, 6); gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); frame = pidgin_make_frame(vbox, _("Ignored Plonkers")); pidgin_prefs_labeled_entry(frame, _("Plonkers singular format:"), "/plugins/core/plugin_pack/plonkers/plonkers/format_singular", NULL); pidgin_prefs_labeled_entry(frame, _("Plonkers plural format:"), "/plugins/core/plugin_pack/plonkers/plonkers/format_plural", NULL); frame = pidgin_make_frame(vbox, _("Plonking")); pidgin_prefs_labeled_entry(frame, _("Plonked singular plural:"), "/plugins/core/plugin_pack/plonkers/plonked/format_singular", NULL); pidgin_prefs_labeled_entry(frame, _("Plonked plural format:"), "/plugins/core/plugin_pack/plonkers/plonked/format_plural", NULL); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); frame = pidgin_make_frame(vbox, _("Format information")); hbox = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); gtk_widget_show(hbox); label = plonkers_make_label(_("%P: List of plonkers"), sg); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); label = plonkers_make_label(_("%N: Number of plonkers"), NULL); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_widget_show_all(vbox); return vbox; }
GtkWidget *ap_prefs_labeled_entry (struct widget *w, GtkWidget *page, const gchar *title, const char *key, GtkSizeGroup *sg) { GtkWidget *result; const gchar *pref; pref = get_const_pref (w, key); result = pidgin_prefs_labeled_entry (page, title, pref, sg); purple_prefs_connect_callback (ap_get_plugin_handle (), pref, pref_callback, w); return result; }
static GtkWidget *plugin_config_frame(PurplePlugin *plugin) { GtkWidget *frame; GtkWidget *vbox; GtkSizeGroup *sg; frame = gtk_vbox_new(FALSE, 18); gtk_container_set_border_width(GTK_CONTAINER(frame), 12); vbox = pidgin_make_frame(frame, "Server settings..."); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); pidgin_prefs_labeled_entry(vbox, "IP", "/plugins/gtk/"PLUGIN_ID"/ip", sg); pidgin_prefs_labeled_entry(vbox, "Port", "/plugins/gtk/"PLUGIN_ID"/port", sg); pidgin_prefs_labeled_entry(vbox, "Mod", "/plugins/gtk/"PLUGIN_ID"/mod", sg); pidgin_prefs_labeled_entry(vbox, "Topic", "/plugins/gtk/"PLUGIN_ID"/topic", sg); gtk_widget_show_all(frame); return frame; }
static GtkWidget *plugin_config_frame(PurplePlugin *plugin) { GtkWidget *frame; GtkWidget *vbox; GtkWidget *vbox2; GtkSizeGroup *sg; GtkWidget *dd; GtkWidget *ent; frame = gtk_vbox_new(FALSE, 18); gtk_container_set_border_width(GTK_CONTAINER(frame), 12); vbox = pidgin_make_frame(frame, "Inform about unread..."); vbox2 = pidgin_make_frame(frame, "Hardware setup:"); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); dd = pidgin_prefs_dropdown(vbox, "Instant Messages:", PURPLE_PREF_STRING, "/plugins/gtk/gtk-sarah-barnot/im", "Never", "never", "In hidden conversations", "hidden", "Always", "always", NULL); gtk_size_group_add_widget(sg, dd); dd = pidgin_prefs_dropdown(vbox, "Chat Messages:", PURPLE_PREF_STRING, "/plugins/gtk/gtk-sarah-barnot/chat", "Never", "never", "When my nick is said", "nick", "Always", "always", NULL); gtk_size_group_add_widget(sg, dd); ent=pidgin_prefs_labeled_entry(vbox2,"File to be displayed on xmobar:", "/plugins/gtk/gtk-sarah-barnot/filename",sg); gtk_widget_show_all(frame); return frame; }
static GtkWidget * purplerc_make_misc_vbox(void) { /* Note: Intentionally not using the size group argument to the * pidgin_prefs_labeled_* functions they only add the text label to * the size group not the whole thing, which isn't what I want. */ GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL; GtkSizeGroup *labelsg = NULL; gsize i; vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER); hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); check = pidgin_prefs_checkbox(_("GTK+ Text Shortcut Theme"), "/plugins/gtk/purplerc/set/gtk-key-theme-name", hbox); gtk_size_group_add_widget(labelsg, check); widget = pidgin_prefs_labeled_entry(hbox, "", "/plugins/gtk/purplerc/gtk-key-theme-name", NULL); gtk_widget_set_sensitive(widget, purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name")); g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(pidgin_toggle_sensitive), widget); for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) { hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); check = pidgin_prefs_checkbox(_(widget_size_names[i]), widget_size_prefs_set[i], hbox); gtk_size_group_add_widget(labelsg, check); widget_size_widgets[i] = pidgin_prefs_labeled_spin_button(hbox, "", widget_size_prefs[i], 0, 50, NULL); gtk_widget_set_sensitive(widget_size_widgets[i], purple_prefs_get_bool(widget_size_prefs_set[i])); g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(pidgin_toggle_sensitive), widget_size_widgets[i]); } hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); pidgin_prefs_checkbox(_("Disable Typing Notification Text"), "/plugins/gtk/purplerc/set/disable-typing-notification", hbox); /* Widget boolean stuff */ /* for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) { hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); check = pidgin_prefs_checkbox(_(widget_bool_names[i]), widget_bool_prefs_set[i], hbox); gtk_size_group_add_widget(labelsg, check); widget_bool_widgets[i] = pidgin_prefs_checkbox("", widget_bool_prefs[i], hbox); gtk_widget_set_sensitive(widget_bool_widgets[i], purple_prefs_get_bool(widget_bool_prefs_set[i])); g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(pidgin_toggle_sensitive), widget_bool_widgets[i]); } */ g_object_unref(labelsg); return vbox; }