Changeset 10993 for trunk/gtk/dialogs.c


Ignore:
Timestamp:
Jul 11, 2010, 6:46:46 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) #3416 "clicking close on the transmission window causes new "Quit Transmission?" dialog even if one already exists" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/dialogs.c

    r10660 r10993  
    6565}
    6666
    67 static gboolean
    68 countActiveTorrents( GtkTreeModel *       model,
    69                      GtkTreePath   * path UNUSED,
    70                      GtkTreeIter *        iter,
    71                      gpointer             activeTorrentCount )
    72 {
    73     int activity = -1;
    74     gtk_tree_model_get( model, iter, MC_ACTIVITY, &activity, -1 );
    75     if( activity != TR_STATUS_STOPPED )
    76         *(int*)activeTorrentCount += 1;
    77     return FALSE; /* keep iterating */
    78 }
    79 
    80 void
     67GtkWidget *
    8168askquit( TrCore *       core,
    8269         GtkWindow *    parent,
     
    8875    GtkWidget *       wind;
    8976    GtkWidget *       dontask;
    90     GtkTreeModel *    model;
    91     int               activeTorrentCount;
    92 
    93     /* if the user doesn't want to be asked, don't ask */
    94     if( !pref_flag_get( PREF_KEY_ASKQUIT ) )
    95     {
    96         func( cbdata );
    97         return;
    98     }
    99 
    100     /* if there aren't any active torrents, don't ask */
    101     model = tr_core_model( core );
    102     activeTorrentCount = 0;
    103     gtk_tree_model_foreach( model, countActiveTorrents, &activeTorrentCount );
    104     if( !activeTorrentCount )
    105     {
    106         func( cbdata );
    107         return;
    108     }
    10977
    11078    stuff          = g_new( struct quitdata, 1 );
     
    143111
    144112    gtk_widget_show_all( wind );
     113
     114    return wind;
    145115}
    146116
Note: See TracChangeset for help on using the changeset viewer.