changeset 25284:fe5179d40a51

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.
author Etan Reisner <pidgin@unreliablesource.net>
date Thu, 08 Jan 2009 04:37:42 +0000
parents 06ab3599f0db
children ca4ccf646993
files pidgin/gtkaccount.c pidgin/gtkpounce.c pidgin/gtksmiley.c
diffstat 3 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkaccount.c	Wed Jan 07 15:57:08 2009 +0000
+++ b/pidgin/gtkaccount.c	Thu Jan 08 04:37:42 2009 +0000
@@ -1545,7 +1545,10 @@
 	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;
--- a/pidgin/gtkpounce.c	Wed Jan 07 15:57:08 2009 +0000
+++ b/pidgin/gtkpounce.c	Thu Jan 08 04:37:42 2009 +0000
@@ -484,7 +484,7 @@
 
 void
 pidgin_pounce_editor_show(PurpleAccount *account, const char *name,
-							PurplePounce *cur_pounce)
+                          PurplePounce *cur_pounce)
 {
 	PidginPounceDialog *dialog;
 	GtkWidget *window;
@@ -848,10 +848,12 @@
 	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 @@
 	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);
 
--- a/pidgin/gtksmiley.c	Wed Jan 07 15:57:08 2009 +0000
+++ b/pidgin/gtksmiley.c	Thu Jan 08 04:37:42 2009 +0000
@@ -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 @@
 			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 @@
 			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 @@
 			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 @@
 	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);