summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <qulogic@pidgin.im>2010-02-19 07:40:34 +0000
committerElliott Sales de Andrade <qulogic@pidgin.im>2010-02-19 07:40:34 +0000
commita75e74ee70d3ac90d95fa10aab89aa4c944ce9f4 (patch)
tree587be6b9416ebff8a75cafaa2f567292f35cd880
parent0bc2d9edf899092275de1769c7793a3e4453c589 (diff)
downloadpidgin-a75e74ee70d3ac90d95fa10aab89aa4c944ce9f4.tar.gz
Remove GTK version checks which are no longer necessary. Refs #1332 too.
-rw-r--r--pidgin/gtkprivacy.c42
-rw-r--r--pidgin/gtkrequest.c36
-rw-r--r--pidgin/gtksavedstatuses.c70
3 files changed, 1 insertions, 147 deletions
diff --git a/pidgin/gtkprivacy.c b/pidgin/gtkprivacy.c
index 730225b15c..369863f0dd 100644
--- a/pidgin/gtkprivacy.c
+++ b/pidgin/gtkprivacy.c
@@ -220,11 +220,7 @@ select_account_cb(GtkWidget *dropdown, PurpleAccount *account,
for (i = 0; i < menu_entry_count; i++) {
if (menu_entries[i].num == account->perm_deny) {
-#if GTK_CHECK_VERSION(2,4,0)
gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i);
-#else
- gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), i);
-#endif
break;
}
}
@@ -237,17 +233,10 @@ select_account_cb(GtkWidget *dropdown, PurpleAccount *account,
* TODO: Setting the permit/deny setting needs to go through privacy.c
* Even better: the privacy API needs to not suck.
*/
-#if GTK_CHECK_VERSION(2,4,0)
static void
type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog)
{
int new_type = menu_entries[gtk_combo_box_get_active(combo)].num;
-#else
-static void
-type_changed_cb(GtkOptionMenu *optmenu, PidginPrivacyDialog *dialog)
-{
- int new_type = menu_entries[gtk_option_menu_get_history(optmenu)].num;
-#endif
dialog->account->perm_deny = new_type;
serv_set_permit_deny(purple_account_get_connection(dialog->account));
@@ -354,10 +343,7 @@ privacy_dialog_new(void)
GtkWidget *button;
GtkWidget *dropdown;
GtkWidget *label;
-#if !GTK_CHECK_VERSION(2,4,0)
- GtkWidget *menu;
-#endif
- int selected = 0;
+ int selected = -1;
int i;
dialog = g_new0(PidginPrivacyDialog, 1);
@@ -385,7 +371,6 @@ privacy_dialog_new(void)
dialog->account = pidgin_account_option_menu_get_selected(dropdown);
/* Add the drop-down list with the allow/block types. */
-#if GTK_CHECK_VERSION(2,4,0)
dialog->type_menu = gtk_combo_box_new_text();
gtk_box_pack_start(GTK_BOX(vbox), dialog->type_menu, FALSE, FALSE, 0);
gtk_widget_show(dialog->type_menu);
@@ -402,27 +387,6 @@ privacy_dialog_new(void)
g_signal_connect(G_OBJECT(dialog->type_menu), "changed",
G_CALLBACK(type_changed_cb), dialog);
-#else
- dialog->type_menu = gtk_option_menu_new();
- gtk_box_pack_start(GTK_BOX(vbox), dialog->type_menu, FALSE, FALSE, 0);
- gtk_widget_show(dialog->type_menu);
-
- /* Build the menu for that. */
- menu = gtk_menu_new();
-
- for (i = 0; i < menu_entry_count; i++) {
- pidgin_new_item(menu, _(menu_entries[i].text));
-
- if (menu_entries[i].num == dialog->account->perm_deny)
- selected = i;
- }
-
- gtk_option_menu_set_menu(GTK_OPTION_MENU(dialog->type_menu), menu);
- gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), selected);
-
- g_signal_connect(G_OBJECT(dialog->type_menu), "changed",
- G_CALLBACK(type_changed_cb), dialog);
-#endif
/* Build the treeview for the allow list. */
dialog->allow_widget = build_allow_list(dialog);
@@ -453,11 +417,7 @@ privacy_dialog_new(void)
button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog);
dialog->close_button = button;
-#if GTK_CHECK_VERSION(2,4,0)
type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog);
-#else
- type_changed_cb(GTK_OPTION_MENU(dialog->type_menu), dialog);
-#endif
#if 0
if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) {
gtk_widget_show(dialog->allow_widget);
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
index c9e8e7d638..b74293f83d 100644
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -229,21 +229,12 @@ field_bool_cb(GtkToggleButton *button, PurpleRequestField *field)
gtk_toggle_button_get_active(button));
}
-#if GTK_CHECK_VERSION(2,4,0)
static void
field_choice_menu_cb(GtkComboBox *menu, PurpleRequestField *field)
{
purple_request_field_choice_set_value(field,
gtk_combo_box_get_active(menu));
}
-#else
-static void
-field_choice_menu_cb(GtkOptionMenu *menu, PurpleRequestField *field)
-{
- purple_request_field_choice_set_value(field,
- gtk_option_menu_get_history(menu));
-}
-#endif
static void
field_choice_option_cb(GtkRadioButton *button, PurpleRequestField *field)
@@ -937,7 +928,6 @@ create_choice_field(PurpleRequestField *field)
if (num_labels > 5)
{
-#if GTK_CHECK_VERSION(2,4,0)
widget = gtk_combo_box_new_text();
for (l = labels; l != NULL; l = l->next)
@@ -951,32 +941,6 @@ create_choice_field(PurpleRequestField *field)
g_signal_connect(G_OBJECT(widget), "changed",
G_CALLBACK(field_choice_menu_cb), field);
-#else
- GtkWidget *menu;
- GtkWidget *item;
-
- widget = gtk_option_menu_new();
-
- menu = gtk_menu_new();
-
- for (l = labels; l != NULL; l = l->next)
- {
- const char *text = l->data;
-
- item = gtk_menu_item_new_with_label(text);
- gtk_widget_show(item);
-
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- }
-
- gtk_widget_show(menu);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(widget), menu);
- gtk_option_menu_set_history(GTK_OPTION_MENU(widget),
- purple_request_field_choice_get_default_value(field));
-
- g_signal_connect(G_OBJECT(widget), "changed",
- G_CALLBACK(field_choice_menu_cb), field);
-#endif
}
else
{
diff --git a/pidgin/gtksavedstatuses.c b/pidgin/gtksavedstatuses.c
index 339695bf69..d1f8bbe519 100644
--- a/pidgin/gtksavedstatuses.c
+++ b/pidgin/gtksavedstatuses.c
@@ -118,11 +118,7 @@ typedef struct
gchar *original_title;
GtkEntry *title;
-#if GTK_CHECK_VERSION(2,4,0)
GtkComboBox *type;
-#else
- GtkOptionMenu *type;
-#endif
GtkIMHtml *message;
} StatusEditor;
@@ -746,11 +742,7 @@ status_editor_ok_cb(GtkButton *button, gpointer user_data)
return;
}
-#if GTK_CHECK_VERSION(2,4,0)
type = gtk_combo_box_get_active(dialog->type) + (PURPLE_STATUS_UNSET + 1);
-#else
- type = gtk_option_menu_get_history(dialog->type) + (PURPLE_STATUS_UNSET + 1);
-#endif
message = gtk_imhtml_get_markup(dialog->message);
unformatted = purple_markup_strip_html(message);
@@ -844,8 +836,6 @@ editor_title_changed_cb(GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive(GTK_WIDGET(dialog->save_button), (*text != '\0'));
}
-#if GTK_CHECK_VERSION(2,4,0)
-
enum {
STATUS_MENU_STOCK_ICON,
STATUS_MENU_NAME,
@@ -900,62 +890,6 @@ create_status_type_menu(PurpleStatusPrimitive type)
return dropdown;
}
-#else
-
-static GtkWidget *
-create_stock_item(const gchar *str, const gchar *icon)
-{
- GtkWidget *menuitem = gtk_menu_item_new();
- GtkWidget *label = gtk_label_new_with_mnemonic(str);
- GtkWidget *hbox = gtk_hbox_new(FALSE, 4);
- GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
- GtkWidget *image = gtk_image_new_from_stock(icon, icon_size);
-
- gtk_widget_show(label);
- gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
-
- gtk_container_add(GTK_CONTAINER(menuitem), hbox);
-
- return menuitem;
-}
-
-static GtkWidget *
-create_status_type_menu(PurpleStatusPrimitive type)
-{
- int i;
- GtkWidget *dropdown;
- GtkWidget *menu;
- GtkWidget *item;
-
- dropdown = gtk_option_menu_new();
- menu = gtk_menu_new();
-
- for (i = PURPLE_STATUS_UNSET + 1; i < PURPLE_STATUS_NUM_PRIMITIVES; i++)
- {
- if (i == PURPLE_STATUS_MOBILE || i == PURPLE_STATUS_TUNE)
- /*
- * Special-case these. They're intended to be independent
- * status types, so don't show them in the list.
- */
- continue;
-
- item = create_stock_item(purple_primitive_get_name_from_type(i),
- get_stock_icon_from_primitive(i));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- }
-
- gtk_menu_set_active(GTK_MENU(menu), type - (PURPLE_STATUS_UNSET + 1));
- gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
- gtk_widget_show_all(menu);
-
- return dropdown;
-}
-
-#endif
-
static void edit_substatus(StatusEditor *status_editor, PurpleAccount *account);
static void
@@ -1221,11 +1155,7 @@ pidgin_status_editor_show(gboolean edit, PurpleSavedStatus *saved_status)
dropdown = create_status_type_menu(purple_savedstatus_get_type(saved_status));
else
dropdown = create_status_type_menu(PURPLE_STATUS_AWAY);
-#if GTK_CHECK_VERSION(2,4,0)
dialog->type = GTK_COMBO_BOX(dropdown);
-#else
- dialog->type = GTK_OPTION_MENU(dropdown);
-#endif
pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Status:"), sg, dropdown, TRUE, NULL);
/* Status message */