Feature request (code supplied) Add quick exit option

Feature requests for the GTK+ version of Transmission
Post Reply
jjjj4096
Posts: 1
Joined: Wed Jul 11, 2012 4:44 am

Feature request (code supplied) Add quick exit option

Post by jjjj4096 » Wed Jul 11, 2012 4:59 am

Hi,
Please add an option to make "Quit Now" work by default. For now one has to click the "Quit now" button each time to exit instantly, otherwise Transmission takes like 5-15 seconds to exit. Screenshot of the GUI option attached.

Here's the code (for Gtk+) that does the job:

add this to gtk/tr-prefs.h

Code: Select all

#define PREF_KEY_QUIT_NOW_BY_DEFAULT                     "quit-now-by-default"
add this to gtk/tr-prefs.c

Code: Select all

static GtkWidget*
desktopPage( GObject * core )
{
....
//insert this after option "Show Transmission icon in the _notification area"
s = _( "Exit _quickly by default" );
    w = new_check_button( s, PREF_KEY_QUIT_NOW_BY_DEFAULT, core );
    hig_workarea_add_wide_control( t, &row, w );
}

add this to gtk/tr-core.c

Code: Select all

void
gtr_core_close( TrCore * core )
{
	//insert this at function start
	if(gtr_pref_flag_get( PREF_KEY_QUIT_NOW_BY_DEFAULT)) {
		exit(0);
	}
...
Attachments
screen.jpeg
screen.jpeg (48.89 KiB) Viewed 2511 times

Post Reply