mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
(gtk) #312: Attention notification when using "Open with"
This commit is contained in:
parent
3aae015468
commit
bcecbbba99
5 changed files with 35 additions and 10 deletions
|
@ -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;
|
||||
|
@ -172,6 +172,7 @@ promptfordir( GtkWindow * parent, TrCore * core, GList * files, tr_ctor * ctor )
|
|||
G_CALLBACK( promptresp ), stuff );
|
||||
|
||||
gtk_widget_show_all( wind );
|
||||
return wind;
|
||||
}
|
||||
|
||||
/***
|
||||
|
|
|
@ -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 );
|
||||
|
|
26
gtk/main.c
26
gtk/main.c
|
@ -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"))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <gtk/gtkwindow.h>
|
||||
#include "tr_core.h"
|
||||
|
||||
void makeaddwind( GtkWindow * parent,
|
||||
GtkWidget* makeaddwind( GtkWindow * parent,
|
||||
TrCore * core,
|
||||
tr_ctor * ctor );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue