mirror of
https://github.com/transmission/transmission
synced 2024-12-23 00:04:06 +00:00
(trunk gtk) #2895 "'Set Location' doesn't tell the user when it fails" -- fixed in trunk for 1.90
This commit is contained in:
parent
b7b5a0e427
commit
9de93d039b
1 changed files with 18 additions and 3 deletions
|
@ -25,6 +25,7 @@ static char * previousLocation = NULL;
|
||||||
struct UpdateData
|
struct UpdateData
|
||||||
{
|
{
|
||||||
GtkDialog * dialog;
|
GtkDialog * dialog;
|
||||||
|
GtkDialog * moving_dialog;
|
||||||
int done;
|
int done;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,11 +35,24 @@ static gboolean
|
||||||
onTimer( gpointer gdata )
|
onTimer( gpointer gdata )
|
||||||
{
|
{
|
||||||
struct UpdateData * data = gdata;
|
struct UpdateData * data = gdata;
|
||||||
const tr_bool done = data->done;
|
const int done = data->done;
|
||||||
|
|
||||||
if( done != TR_LOC_MOVING )
|
if( done == TR_LOC_ERROR )
|
||||||
{
|
{
|
||||||
gtk_widget_destroy( GTK_WIDGET( data->dialog ) );
|
const int flags = GTK_DIALOG_MODAL
|
||||||
|
| GTK_DIALOG_DESTROY_WITH_PARENT;
|
||||||
|
GtkWidget * w = gtk_message_dialog_new( GTK_WINDOW( data->moving_dialog ),
|
||||||
|
flags,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
"%s",
|
||||||
|
_( "Couldn't move torrent" ) );
|
||||||
|
gtk_dialog_run( GTK_DIALOG( w ) );
|
||||||
|
gtk_widget_destroy( GTK_WIDGET( data->moving_dialog ) );
|
||||||
|
}
|
||||||
|
else if( done != TR_LOC_MOVING )
|
||||||
|
{
|
||||||
|
gtk_widget_destroy( GTK_WIDGET( data->moving_dialog ) );
|
||||||
g_free( data );
|
g_free( data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +88,7 @@ onResponse( GtkDialog * dialog, int response, gpointer unused UNUSED )
|
||||||
/* start the move and periodically check its status */
|
/* start the move and periodically check its status */
|
||||||
updateData = g_new( struct UpdateData, 1 );
|
updateData = g_new( struct UpdateData, 1 );
|
||||||
updateData->dialog = dialog;
|
updateData->dialog = dialog;
|
||||||
|
updateData->moving_dialog = GTK_DIALOG( w );
|
||||||
updateData->done = FALSE;
|
updateData->done = FALSE;
|
||||||
tr_torrentSetLocation( tor, location, do_move, NULL, &updateData->done );
|
tr_torrentSetLocation( tor, location, do_move, NULL, &updateData->done );
|
||||||
gtr_timeout_add_seconds( 1, onTimer, updateData );
|
gtr_timeout_add_seconds( 1, onTimer, updateData );
|
||||||
|
|
Loading…
Reference in a new issue