From 1e2e2b3010c8474ef0b5d93b7c20af5eead5c31d Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 24 Jan 2005 08:36:17 +0000 Subject: use GTK stock button for button set. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@36 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 10 ++++++++++ ChangeLog.ja | 10 ++++++++++ src/addressbook.c | 16 ++++++++-------- src/compose.c | 6 +++--- src/messageview.c | 2 +- src/mimeview.c | 2 +- src/passphrase.c | 44 ++++++++++---------------------------------- src/select-keys.c | 2 +- src/sigstatus.c | 1 + 9 files changed, 45 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b6acb6a..cf45d9aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-01-24 + + * src/compose.c + src/addressbook.c + src/messageview.c + src/mimeview.c + src/select-keys.c + src/sigstatus.c: use GTK stock button for button set. + * src/passphrase.c: improved the passphrase dialog. + 2005-01-24 * src/alertpanel.c: use GTK stock icon instead of pixmap. diff --git a/ChangeLog.ja b/ChangeLog.ja index d8cd58f7..efbe7744 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,13 @@ +2005-01-24 + + * src/compose.c + src/addressbook.c + src/messageview.c + src/mimeview.c + src/select-keys.c + src/sigstatus.c: ボタンセットに GTK のストックボタンを使用。 + * src/passphrase.c: パスフレーズダイアログを改良。 + 2005-01-24 * src/alertpanel.c: pixmap の代わりに GTK のストックアイコンを使用。 diff --git a/src/addressbook.c b/src/addressbook.c index c0d717e1..ec87466c 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -837,7 +837,7 @@ static void addressbook_del_clicked(GtkButton *button, gpointer data) /* Confirm deletion */ aval = alertpanel( _("Delete address(es)"), _("Really delete the address(es)?"), - _("Yes"), _("No"), NULL ); + GTK_STOCK_YES, GTK_STOCK_NO, NULL ); if( aval != G_ALERTDEFAULT ) return; /* Process deletions */ @@ -1662,13 +1662,13 @@ static void addressbook_treenode_delete_cb(gpointer data, guint action, "Do you want to delete the folder AND all addresses in `%s' ? \n" \ "If deleting the folder only, addresses will be moved into parent folder." ), obj->name ); - aval = alertpanel( _("Delete"), message, _("Folder only"), _("Folder and Addresses"), _("Cancel") ); + aval = alertpanel( _("Delete"), message, _("Folder only"), _("Folder and Addresses"), GTK_STOCK_CANCEL ); g_free(message); if( aval == G_ALERTOTHER ) return; } else { message = g_strdup_printf(_("Really delete `%s' ?"), obj->name); - aval = alertpanel(_("Delete"), message, _("Yes"), _("No"), NULL); + aval = alertpanel(_("Delete"), message, GTK_STOCK_YES, GTK_STOCK_NO, NULL); g_free(message); if (aval != G_ALERTDEFAULT) return; } @@ -2397,11 +2397,11 @@ static gboolean addressbook_convert( AddressIndex *addrIndex ) { } if( errFlag ) { debug_print( "Error\n%s\n", msg ); - alertpanel( _( "Addressbook conversion error" ), msg, _( "Close" ), NULL, NULL ); + alertpanel( _( "Addressbook conversion error" ), msg, GTK_STOCK_CLOSE, NULL, NULL ); } else if( msg ) { debug_print( "Warning\n%s\n", msg ); - alertpanel( _( "Addressbook conversion" ), msg, _( "Close" ), NULL, NULL ); + alertpanel( _( "Addressbook conversion" ), msg, GTK_STOCK_CLOSE, NULL, NULL ); } return retVal; @@ -2438,7 +2438,7 @@ void addressbook_read_file( void ) { addrindex_print_index( addrIndex, stdout ); alertpanel( _( "Addressbook Error" ), _( "Could not read address index" ), - _( "Close" ), NULL, NULL ); + GTK_STOCK_CLOSE, NULL, NULL ); } debug_print( "done.\n" ); } @@ -2544,13 +2544,13 @@ void addressbook_read_file_old( void ) { if( errFlag ) { debug_print( "Error\n%s\n", msg ); alertpanel( _( "Addressbook Conversion Error" ), msg, - _( "Close" ), NULL, NULL ); + GTK_STOCK_CLOSE, NULL, NULL ); } else { if( msg ) { debug_print( "Warning\n%s\n", msg ); alertpanel( _( "Addressbook Conversion" ), msg, - _( "Close" ), NULL, NULL ); + GTK_STOCK_CLOSE, NULL, NULL ); } } if( msg ) g_free( msg ); diff --git a/src/compose.c b/src/compose.c index 668891eb..495f10c6 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2521,7 +2521,7 @@ static gboolean compose_check_entries(Compose *compose) aval = alertpanel(_("Send"), _("Subject is empty. Send it anyway?"), - _("Yes"), _("No"), NULL); + GTK_STOCK_YES, GTK_STOCK_NO, NULL); if (aval != G_ALERTDEFAULT) return FALSE; } @@ -5533,7 +5533,7 @@ static void compose_close_cb(gpointer data, guint action, GtkWidget *widget) if (compose->modified) { val = alertpanel(_("Discard message"), _("This message has been modified. discard it?"), - _("Discard"), _("to Draft"), _("Cancel")); + _("Discard"), _("to Draft"), GTK_STOCK_CANCEL); switch (val) { case G_ALERTDEFAULT: @@ -5569,7 +5569,7 @@ static void compose_template_activate_cb(GtkWidget *widget, gpointer data) msg = g_strdup_printf(_("Do you want to apply the template `%s' ?"), tmpl->name); val = alertpanel(_("Apply template"), msg, - _("Replace"), _("Insert"), _("Cancel")); + _("Replace"), _("Insert"), GTK_STOCK_CANCEL); g_free(msg); if (val == G_ALERTDEFAULT) diff --git a/src/messageview.c b/src/messageview.c index 707da43d..dc0952c8 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -620,7 +620,7 @@ void messageview_save_as(MessageView *messageview) aval = alertpanel(_("Overwrite"), _("Overwrite existing file?"), - _("OK"), _("Cancel"), NULL); + GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL); if (G_ALERTDEFAULT != aval) return; } diff --git a/src/mimeview.c b/src/mimeview.c index 3d36c4f8..b13fc8d7 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -806,7 +806,7 @@ static void mimeview_save_as(MimeView *mimeview) aval = alertpanel(_("Overwrite"), _("Overwrite existing file?"), - _("OK"), _("Cancel"), NULL); + GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL); if (G_ALERTDEFAULT != aval) return; } diff --git a/src/passphrase.c b/src/passphrase.c index 445db517..16651086 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -75,8 +75,6 @@ passphrase_mbox (const gchar *desc) { gchar *the_passphrase = NULL; GtkWidget *vbox; - GtkWidget *table; - GtkWidget *pass_label; GtkWidget *confirm_box; GtkWidget *window; GtkWidget *pass_entry; @@ -86,7 +84,6 @@ passphrase_mbox (const gchar *desc) window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), _("Passphrase")); gtk_widget_set_size_request(window, 450, -1); - gtk_container_set_border_width(GTK_CONTAINER(window), 4); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_set_modal(GTK_WINDOW(window), TRUE); gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); @@ -99,46 +96,24 @@ passphrase_mbox (const gchar *desc) vbox = gtk_vbox_new(FALSE, 8); gtk_container_add(GTK_CONTAINER(window), vbox); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); if (desc) { GtkWidget *label; label = create_description (desc); - gtk_box_pack_start (GTK_BOX(vbox), label, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0); } - table = gtk_table_new(2, 2, FALSE); - gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(table), 8); - gtk_table_set_row_spacings(GTK_TABLE(table), 12); - gtk_table_set_col_spacings(GTK_TABLE(table), 8); - - - pass_label = gtk_label_new(""); - gtk_table_attach (GTK_TABLE(table), pass_label, 0, 1, 0, 1, - GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0); - gtk_misc_set_alignment (GTK_MISC (pass_label), 1, 0.5); - pass_entry = gtk_entry_new(); - gtk_table_attach (GTK_TABLE(table), pass_entry, 1, 2, 0, 1, - GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0); - gtk_entry_set_visibility (GTK_ENTRY(pass_entry), FALSE); - gtk_widget_grab_focus (pass_entry); - - - confirm_box = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX(confirm_box), GTK_BUTTONBOX_END); - gtk_box_set_spacing (GTK_BOX(confirm_box), 5); - - ok_button = gtk_button_new_with_label (_("OK")); - GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX(confirm_box), ok_button, TRUE, TRUE, 0); - - cancel_button = gtk_button_new_with_label (_("Cancel")); - GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT); - gtk_box_pack_start(GTK_BOX(confirm_box), cancel_button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(vbox), pass_entry, FALSE, FALSE, 0); + gtk_entry_set_visibility(GTK_ENTRY(pass_entry), FALSE); + gtk_widget_grab_focus(pass_entry); + gtkut_stock_button_set_create(&confirm_box, &ok_button, GTK_STOCK_OK, + &cancel_button, GTK_STOCK_CANCEL, + NULL, NULL); gtk_box_pack_end(GTK_BOX(vbox), confirm_box, FALSE, FALSE, 0); - gtk_widget_grab_default (ok_button); + gtk_widget_grab_default(ok_button); g_signal_connect(G_OBJECT(ok_button), "clicked", G_CALLBACK(passphrase_ok_cb), NULL); @@ -277,6 +252,7 @@ create_description (const gchar *desc) linelen (uid), uid, linelen (info), info); label = gtk_label_new (buf); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); g_free (buf); return label; diff --git a/src/select-keys.c b/src/select-keys.c index ccfd1ad1..93234e2a 100644 --- a/src/select-keys.c +++ b/src/select-keys.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include "intl.h" #include "select-keys.h" diff --git a/src/sigstatus.c b/src/sigstatus.c index cd75350c..59624f24 100644 --- a/src/sigstatus.c +++ b/src/sigstatus.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3