1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(trunk gtk) #2707 "add confirmation dialog when resetting statistics" -- implemented

This commit is contained in:
Charles Kerr 2010-01-03 17:58:33 +00:00
parent ae6bdbae6e
commit 736d39d34e

View file

@ -102,10 +102,29 @@ dialogResponse( GtkDialog * dialog,
struct stat_ui * ui = gdata; struct stat_ui * ui = gdata;
if( response == TR_RESPONSE_RESET ) if( response == TR_RESPONSE_RESET )
{
const char * primary = _( "Reset your statistics?" );
const char * secondary = _( "These statistics are for your information only. "
"Resetting them doesn't affect the statistics logged by your BitTorrent trackers." );
const int flags = GTK_DIALOG_DESTROY_WITH_PARENT
| GTK_DIALOG_MODAL;
GtkWidget * w = gtk_message_dialog_new( GTK_WINDOW( dialog ),
flags,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
"%s", primary );
gtk_dialog_add_buttons( GTK_DIALOG( w ),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_( "_Reset" ), TR_RESPONSE_RESET,
NULL );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( w ), "%s", secondary );
if( gtk_dialog_run( GTK_DIALOG( w ) ) == TR_RESPONSE_RESET )
{ {
tr_sessionClearStats( tr_core_session( ui->core ) ); tr_sessionClearStats( tr_core_session( ui->core ) );
updateStats( ui ); updateStats( ui );
} }
gtk_widget_destroy( w );
}
if( response == GTK_RESPONSE_CLOSE ) if( response == GTK_RESPONSE_CLOSE )
{ {