pidgin: db60bd57: Make dialogs that double as add and save...

deryni at pidgin.im deryni at pidgin.im
Wed Jan 7 23:50:36 EST 2009


-----------------------------------------------------------------
Revision: db60bd5786600dd75cd3a30a548e17f2ef7ffd93
Ancestor: d6e38b24a5b289e3e7632def307f1d98b177d697
Author: deryni at pidgin.im
Date: 2009-01-08T04:37:42
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/db60bd5786600dd75cd3a30a548e17f2ef7ffd93

Modified files:
        pidgin/gtkaccount.c pidgin/gtkpounce.c pidgin/gtksmiley.c

ChangeLog: 

Make dialogs that double as add and save dialogs indicate the current action
in the text of the confirm button as well as in the window title. This applies
to the "Add/Modify Account" dialog and the "New/Edit Buddy Pounce" dialog.

Also use the "Modify..." button in the "Custom Smiley Manager" dialog instead
of an "Edit" button. The other dialogs all use Modify.

This should all be translation neutral as all the new strings should have
already existed as these are stock buttons.

-------------- next part --------------
============================================================
--- pidgin/gtkaccount.c	8bb797f888360061f572e89e24d7eb1afb643da8
+++ pidgin/gtkaccount.c	533de85d1e05e724680a4c4faaac3dd0c286ae95
@@ -1545,7 +1545,10 @@ pidgin_account_dialog_show(PidginAccount
 	pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CANCEL, G_CALLBACK(cancel_account_prefs_cb), dialog);
 
 	/* Save button */
-	button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_SAVE, G_CALLBACK(ok_account_prefs_cb), dialog);
+	button = pidgin_dialog_add_button(GTK_DIALOG(win),
+	                                  (type == PIDGIN_ADD_ACCOUNT_DIALOG) ? GTK_STOCK_ADD : GTK_STOCK_SAVE,
+	                                  G_CALLBACK(ok_account_prefs_cb),
+	                                  dialog);
 	if (dialog->account == NULL)
 		gtk_widget_set_sensitive(button, FALSE);
 	dialog->ok_button = button;
============================================================
--- pidgin/gtkpounce.c	25877f36abfbd3bb6018db6f220e6646d7469ee9
+++ pidgin/gtkpounce.c	e0b0aeb90e742dc4fe3c4ecff9c819e6b172ed31
@@ -484,7 +484,7 @@ pidgin_pounce_editor_show(PurpleAccount 
 
 void
 pidgin_pounce_editor_show(PurpleAccount *account, const char *name,
-							PurplePounce *cur_pounce)
+                          PurplePounce *cur_pounce)
 {
 	PidginPounceDialog *dialog;
 	GtkWidget *window;
@@ -848,10 +848,12 @@ pidgin_pounce_editor_show(PurpleAccount 
 	g_signal_connect(G_OBJECT(button), "clicked",
 					 G_CALLBACK(cancel_cb), dialog);
 
-	/* Save button */
-	dialog->save_button = button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_SAVE, GTK_RESPONSE_OK);
+	/* Save/Add button */
+	dialog->save_button = button = gtk_dialog_add_button(GTK_DIALOG(window),
+	                                                     (cur_pounce == NULL ? GTK_STOCK_ADD : GTK_STOCK_SAVE),
+	                                                     GTK_RESPONSE_OK);
 	g_signal_connect(G_OBJECT(button), "clicked",
-					 G_CALLBACK(save_pounce_cb), dialog);
+	                 G_CALLBACK(save_pounce_cb), dialog);
 
 	if (*gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)) == '\0')
 		gtk_widget_set_sensitive(button, FALSE);
@@ -1274,7 +1276,6 @@ create_pounces_list(PouncesManager *dial
 	g_signal_connect(G_OBJECT(treeview), "button_press_event",
 					 G_CALLBACK(pounce_double_click_cb), dialog);
 
-
 	gtk_container_add(GTK_CONTAINER(sw), treeview);
 	gtk_widget_show(treeview);
 
============================================================
--- pidgin/gtksmiley.c	2bfcace1f94d80a84a6631685205de2ef9d3f717
+++ pidgin/gtksmiley.c	063e5c9ac68e011da4f6656fd20aa289967c67f2
@@ -37,7 +37,7 @@
 #include "gtkutils.h"
 #include "pidginstock.h"
 
-#define PIDGIN_RESPONSE_EDIT 1000
+#define PIDGIN_RESPONSE_MODIFY 1000
 
 struct _PidginSmiley
 {
@@ -590,7 +590,7 @@ static void smile_selected_cb(GtkTreeSel
 			GTK_RESPONSE_NO, selected > 0);
 
 	gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog->window),
-			PIDGIN_RESPONSE_EDIT, selected > 0);
+	                                  PIDGIN_RESPONSE_MODIFY, selected > 0);
 }
 
 static void
@@ -682,7 +682,7 @@ static void smiley_manager_select_cb(Gtk
 			g_free(smiley_manager);
 			smiley_manager = NULL;
 			break;
-		case PIDGIN_RESPONSE_EDIT:
+		case PIDGIN_RESPONSE_MODIFY:
 			/* Find smiley of selection... */
 			selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
 			gtk_tree_selection_selected_foreach(selection, edit_selected_cb, dialog);
@@ -713,7 +713,7 @@ void pidgin_smiley_manager_show(void)
 			NULL,
 			GTK_DIALOG_DESTROY_WITH_PARENT,
 			GTK_STOCK_ADD, GTK_RESPONSE_YES,
-			PIDGIN_STOCK_EDIT, PIDGIN_RESPONSE_EDIT,
+			PIDGIN_STOCK_MODIFY, PIDGIN_RESPONSE_MODIFY,
 			GTK_STOCK_DELETE, GTK_RESPONSE_NO,
 			GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
 			NULL);
@@ -722,8 +722,8 @@ void pidgin_smiley_manager_show(void)
 	gtk_window_set_role(GTK_WINDOW(win), "custom_smiley_manager");
 	gtk_container_set_border_width(GTK_CONTAINER(win),PIDGIN_HIG_BORDER);
 	gtk_dialog_set_response_sensitive(GTK_DIALOG(win), GTK_RESPONSE_NO, FALSE);
-	gtk_dialog_set_response_sensitive(GTK_DIALOG(win), PIDGIN_RESPONSE_EDIT,
-									  FALSE);
+	gtk_dialog_set_response_sensitive(GTK_DIALOG(win),
+	                                  PIDGIN_RESPONSE_MODIFY, FALSE);
 
 	g_signal_connect(win, "response", G_CALLBACK(smiley_manager_select_cb),
 			dialog);


More information about the Commits mailing list