Changeset 5073


Ignore:
Timestamp:
Feb 19, 2008, 5:52:37 AM (14 years ago)
Author:
charles
Message:

(gtk) #312: Attention notification when using "Open with"

Location:
trunk/gtk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/dialogs.c

    r5064 r5073  
    118118}
    119119
    120 void
     120GtkWidget*
    121121promptfordir( GtkWindow * parent, TrCore * core, GList * files, tr_ctor * ctor )
    122122{
     
    172172                      G_CALLBACK( promptresp ), stuff );
    173173
    174     gtk_widget_show_all(wind);
     174    gtk_widget_show_all( wind );
     175    return wind;
    175176}
    176177
  • trunk/gtk/dialogs.h

    r5064 r5073  
    3131
    3232/* prompt for a download directory for torrents, then add them */
    33 void promptfordir( GtkWindow* parent, TrCore*, GList* filenames, tr_ctor* );
     33GtkWidget* promptfordir( GtkWindow  * parent,
     34                         TrCore     * core,
     35                         GList      * filenames,
     36                         tr_ctor    * ctor );
    3437
    3538/* prompt if the user wants to quit, calls func with cbdata if they do */
  • trunk/gtk/main.c

    r5065 r5073  
    744744}
    745745
     746#if GTK_CHECK_VERSION(2,8,0)
     747static void
     748on_main_window_focus_in( GtkWidget      * widget UNUSED,
     749                         GdkEventFocus  * event UNUSED,
     750                         gpointer         gdata )
     751{
     752    struct cbdata * cbdata = gdata;
     753    gtk_window_set_urgency_hint( GTK_WINDOW( cbdata->wind ), FALSE );
     754}
     755#endif
     756
    746757static void
    747758coreprompt( TrCore                 * core,
     
    752763    struct cbdata * cbdata = gdata;
    753764    const int len = g_list_length( paths );
     765    GtkWidget * w;
     766
    754767    if( len > 1 )
    755         promptfordir( cbdata->wind, core, paths, ctor );
     768        w = promptfordir( cbdata->wind, core, paths, ctor );
    756769    else {
    757770        if( len == 1 )
    758771            tr_ctorSetMetainfoFromFile( ctor, paths->data );
    759         makeaddwind( cbdata->wind, core, ctor );
    760     }
     772        w = makeaddwind( cbdata->wind, core, ctor );
     773    }
     774
     775#if GTK_CHECK_VERSION(2,8,0)
     776    gtk_window_set_urgency_hint( GTK_WINDOW( cbdata->wind ), TRUE );
     777    g_signal_connect( w, "focus-in-event",
     778                      G_CALLBACK(on_main_window_focus_in),  cbdata );
     779#endif
    761780}
    762781
     
    9911010    if ( !strcmp (action_name, "open-torrent-menu") || !strcmp( action_name, "open-torrent-toolbar" ))
    9921011    {
    993         tr_core_add_list( data->core, NULL, tr_ctorNew( tr_core_handle( data->core ) ) );
     1012        tr_core_add_list( data->core, NULL,
     1013                          tr_ctorNew( tr_core_handle( data->core ) ) );
    9941014    }
    9951015    else if (!strcmp (action_name, "show-stats"))
  • trunk/gtk/open-dialog.c

    r5068 r5073  
    127127****/
    128128
    129 void
     129GtkWidget*
    130130makeaddwind( GtkWindow  * parent,
    131131             TrCore     * core,
     
    234234    gtk_box_pack_start_defaults( GTK_BOX( GTK_DIALOG( d )->vbox ), t );
    235235    gtk_widget_show_all( d );
    236 }
     236    return d;
     237}
  • trunk/gtk/open-dialog.h

    r5064 r5073  
    1717#include "tr_core.h"
    1818
    19 void makeaddwind( GtkWindow  * parent,
    20                   TrCore     * core,
    21                   tr_ctor    * ctor );
     19GtkWidget* makeaddwind( GtkWindow  * parent,
     20                        TrCore     * core,
     21                        tr_ctor    * ctor );
    2222
    2323#endif /* TR_GTK_OPEN_DIALOG */
Note: See TracChangeset for help on using the changeset viewer.