mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
(trunk gtk) #2190: removing download items makes property window useless
This commit is contained in:
parent
7a32ae131a
commit
11f8f93cfa
2 changed files with 21 additions and 19 deletions
|
@ -1978,7 +1978,7 @@ response_cb( GtkDialog * dialog, int a UNUSED, gpointer b UNUSED )
|
||||||
{
|
{
|
||||||
GtkWidget * w = GTK_WIDGET( dialog );
|
GtkWidget * w = GTK_WIDGET( dialog );
|
||||||
torrent_inspector_set_torrents( w, NULL );
|
torrent_inspector_set_torrents( w, NULL );
|
||||||
gtk_widget_hide( w );
|
gtk_widget_destroy( w );
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
|
|
38
gtk/main.c
38
gtk/main.c
|
@ -84,8 +84,8 @@ struct cbdata
|
||||||
GtkWidget * prefs;
|
GtkWidget * prefs;
|
||||||
GSList * errqueue;
|
GSList * errqueue;
|
||||||
GSList * dupqueue;
|
GSList * dupqueue;
|
||||||
|
GSList * details;
|
||||||
GtkTreeSelection * sel;
|
GtkTreeSelection * sel;
|
||||||
gpointer details;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CBDATA_PTR "callback-data-pointer"
|
#define CBDATA_PTR "callback-data-pointer"
|
||||||
|
@ -205,7 +205,7 @@ refreshActions( struct cbdata * data )
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
refreshDetailsDialog( struct cbdata * data )
|
refreshDetailsDialog( struct cbdata * data, GtkWidget * details )
|
||||||
{
|
{
|
||||||
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
||||||
GtkTreeModel * model;
|
GtkTreeModel * model;
|
||||||
|
@ -213,9 +213,6 @@ refreshDetailsDialog( struct cbdata * data )
|
||||||
GList * selrows = NULL;
|
GList * selrows = NULL;
|
||||||
GList * l;
|
GList * l;
|
||||||
|
|
||||||
if( data->details == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* build a list of the selected torrents' ids */
|
/* build a list of the selected torrents' ids */
|
||||||
s = tr_window_get_selection( data->wind );
|
s = tr_window_get_selection( data->wind );
|
||||||
for( selrows=l=gtk_tree_selection_get_selected_rows(s,&model); l; l=l->next ) {
|
for( selrows=l=gtk_tree_selection_get_selected_rows(s,&model); l; l=l->next ) {
|
||||||
|
@ -227,7 +224,7 @@ refreshDetailsDialog( struct cbdata * data )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
torrent_inspector_set_torrents( GTK_WIDGET( data->details ), ids );
|
torrent_inspector_set_torrents( details, ids );
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
g_slist_free( ids );
|
g_slist_free( ids );
|
||||||
|
@ -239,7 +236,6 @@ static void
|
||||||
selectionChangedCB( GtkTreeSelection * s UNUSED, gpointer data )
|
selectionChangedCB( GtkTreeSelection * s UNUSED, gpointer data )
|
||||||
{
|
{
|
||||||
refreshActions( data );
|
refreshActions( data );
|
||||||
refreshDetailsDialog( data );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -621,8 +617,10 @@ quitThreadFunc( gpointer gdata )
|
||||||
tr_core_close( cbdata->core );
|
tr_core_close( cbdata->core );
|
||||||
|
|
||||||
/* shutdown the gui */
|
/* shutdown the gui */
|
||||||
if( cbdata->details )
|
if( cbdata->details ) {
|
||||||
gtk_widget_destroy( GTK_WIDGET( cbdata->details ) );
|
g_slist_foreach( cbdata->details, (GFunc)gtk_widget_destroy, NULL );
|
||||||
|
g_slist_free( cbdata->details );
|
||||||
|
}
|
||||||
if( cbdata->prefs )
|
if( cbdata->prefs )
|
||||||
gtk_widget_destroy( GTK_WIDGET( cbdata->prefs ) );
|
gtk_widget_destroy( GTK_WIDGET( cbdata->prefs ) );
|
||||||
if( cbdata->wind )
|
if( cbdata->wind )
|
||||||
|
@ -925,9 +923,7 @@ prefschanged( TrCore * core UNUSED,
|
||||||
|
|
||||||
if( !strcmp( key, TR_PREFS_KEY_ENCRYPTION ) )
|
if( !strcmp( key, TR_PREFS_KEY_ENCRYPTION ) )
|
||||||
{
|
{
|
||||||
const int encryption = pref_int_get( key );
|
tr_sessionSetEncryption( tr, pref_int_get( key ) );
|
||||||
g_message( "setting encryption to %d", encryption );
|
|
||||||
tr_sessionSetEncryption( tr, encryption );
|
|
||||||
}
|
}
|
||||||
else if( !strcmp( key, TR_PREFS_KEY_DOWNLOAD_DIR ) )
|
else if( !strcmp( key, TR_PREFS_KEY_DOWNLOAD_DIR ) )
|
||||||
{
|
{
|
||||||
|
@ -1283,6 +1279,13 @@ getFirstSelectedTorrent( struct cbdata * data )
|
||||||
return tor;
|
return tor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
detailsClosed( gpointer gdata, GObject * dead )
|
||||||
|
{
|
||||||
|
struct cbdata * data = gdata;
|
||||||
|
data->details = g_slist_remove( data->details, dead );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
doAction( const char * action_name, gpointer user_data )
|
doAction( const char * action_name, gpointer user_data )
|
||||||
{
|
{
|
||||||
|
@ -1342,12 +1345,11 @@ doAction( const char * action_name, gpointer user_data )
|
||||||
}
|
}
|
||||||
else if( !strcmp( action_name, "show-torrent-properties" ) )
|
else if( !strcmp( action_name, "show-torrent-properties" ) )
|
||||||
{
|
{
|
||||||
if( data->details == NULL ) {
|
GtkWidget * w = torrent_inspector_new( GTK_WINDOW( data->wind ), data->core );
|
||||||
data->details = torrent_inspector_new( GTK_WINDOW( data->wind ), data->core );
|
data->details = g_slist_prepend( data->details, w );
|
||||||
g_object_add_weak_pointer( G_OBJECT( data->details ), &data->details );
|
g_object_weak_ref( G_OBJECT( w ), detailsClosed, data );
|
||||||
}
|
refreshDetailsDialog( data, w );
|
||||||
refreshDetailsDialog( data );
|
gtk_widget_show( w );
|
||||||
gtk_widget_show( GTK_WIDGET( data->details ) );
|
|
||||||
}
|
}
|
||||||
else if( !strcmp( action_name, "update-tracker" ) )
|
else if( !strcmp( action_name, "update-tracker" ) )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue