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

This commit is contained in:
Charles Kerr 2008-02-19 05:52:37 +00:00
parent 3aae015468
commit bcecbbba99
5 changed files with 35 additions and 10 deletions

View File

@ -117,7 +117,7 @@ startToggled( GtkToggleButton * tb, gpointer ctor )
tr_ctorSetPaused( ctor, TR_FORCE, !gtk_toggle_button_get_active( tb ) );
}
void
GtkWidget*
promptfordir( GtkWindow * parent, TrCore * core, GList * files, tr_ctor * ctor )
{
uint8_t flag = 0;
@ -171,7 +171,8 @@ promptfordir( GtkWindow * parent, TrCore * core, GList * files, tr_ctor * ctor )
g_signal_connect( G_OBJECT( wind ), "response",
G_CALLBACK( promptresp ), stuff );
gtk_widget_show_all(wind);
gtk_widget_show_all( wind );
return wind;
}
/***

View File

@ -30,7 +30,10 @@
#include "util.h"
/* prompt for a download directory for torrents, then add them */
void promptfordir( GtkWindow* parent, TrCore*, GList* filenames, tr_ctor* );
GtkWidget* promptfordir( GtkWindow * parent,
TrCore * core,
GList * filenames,
tr_ctor * ctor );
/* prompt if the user wants to quit, calls func with cbdata if they do */
void askquit( TrCore*, GtkWindow* parent, callbackfunc_t func, void* cbdata );

View File

@ -743,6 +743,17 @@ coreerr( TrCore * core UNUSED, enum tr_core_err code, const char * msg,
g_assert_not_reached();
}
#if GTK_CHECK_VERSION(2,8,0)
static void
on_main_window_focus_in( GtkWidget * widget UNUSED,
GdkEventFocus * event UNUSED,
gpointer gdata )
{
struct cbdata * cbdata = gdata;
gtk_window_set_urgency_hint( GTK_WINDOW( cbdata->wind ), FALSE );
}
#endif
static void
coreprompt( TrCore * core,
GList * paths,
@ -751,13 +762,21 @@ coreprompt( TrCore * core,
{
struct cbdata * cbdata = gdata;
const int len = g_list_length( paths );
GtkWidget * w;
if( len > 1 )
promptfordir( cbdata->wind, core, paths, ctor );
w = promptfordir( cbdata->wind, core, paths, ctor );
else {
if( len == 1 )
tr_ctorSetMetainfoFromFile( ctor, paths->data );
makeaddwind( cbdata->wind, core, ctor );
w = makeaddwind( cbdata->wind, core, ctor );
}
#if GTK_CHECK_VERSION(2,8,0)
gtk_window_set_urgency_hint( GTK_WINDOW( cbdata->wind ), TRUE );
g_signal_connect( w, "focus-in-event",
G_CALLBACK(on_main_window_focus_in), cbdata );
#endif
}
static void
@ -990,7 +1009,8 @@ doAction ( const char * action_name, gpointer user_data )
if ( !strcmp (action_name, "open-torrent-menu") || !strcmp( action_name, "open-torrent-toolbar" ))
{
tr_core_add_list( data->core, NULL, tr_ctorNew( tr_core_handle( data->core ) ) );
tr_core_add_list( data->core, NULL,
tr_ctorNew( tr_core_handle( data->core ) ) );
}
else if (!strcmp (action_name, "show-stats"))
{

View File

@ -126,7 +126,7 @@ destinationChanged( GtkFileChooserButton * b, gpointer gdata )
*****
****/
void
GtkWidget*
makeaddwind( GtkWindow * parent,
TrCore * core,
tr_ctor * ctor )
@ -233,4 +233,5 @@ makeaddwind( GtkWindow * parent,
gtk_box_pack_start_defaults( GTK_BOX( GTK_DIALOG( d )->vbox ), t );
gtk_widget_show_all( d );
return d;
}

View File

@ -16,8 +16,8 @@
#include <gtk/gtkwindow.h>
#include "tr_core.h"
void makeaddwind( GtkWindow * parent,
TrCore * core,
tr_ctor * ctor );
GtkWidget* makeaddwind( GtkWindow * parent,
TrCore * core,
tr_ctor * ctor );
#endif /* TR_GTK_OPEN_DIALOG */