2006-08-13 00:26:52 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* $Id$
|
|
|
|
*
|
2008-01-01 17:20:20 +00:00
|
|
|
* Copyright (c) 2005-2008 Transmission authors and contributors
|
2006-08-13 00:26:52 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*****************************************************************************/
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-07-28 22:06:53 +00:00
|
|
|
#include <locale.h>
|
2006-07-16 19:39:23 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <glib/gi18n.h>
|
|
|
|
#include <glib/gstdio.h>
|
|
|
|
|
2008-09-01 04:47:02 +00:00
|
|
|
#include <libtransmission/transmission.h>
|
2008-12-03 05:15:17 +00:00
|
|
|
#include <libtransmission/rpcimpl.h>
|
2008-09-01 04:47:02 +00:00
|
|
|
#include <libtransmission/utils.h>
|
2008-05-06 19:27:42 +00:00
|
|
|
#include <libtransmission/version.h>
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
#include "actions.h"
|
2008-04-03 02:11:15 +00:00
|
|
|
#include "add-dialog.h"
|
2006-07-16 19:39:23 +00:00
|
|
|
#include "conf.h"
|
2008-02-19 03:57:03 +00:00
|
|
|
#include "details.h"
|
2006-07-16 19:39:23 +00:00
|
|
|
#include "dialogs.h"
|
2008-03-13 20:47:58 +00:00
|
|
|
#include "hig.h"
|
2007-06-18 03:40:41 +00:00
|
|
|
#include "makemeta-ui.h"
|
2006-08-20 22:45:29 +00:00
|
|
|
#include "msgwin.h"
|
2008-02-24 15:42:31 +00:00
|
|
|
#include "notify.h"
|
2009-05-13 15:54:04 +00:00
|
|
|
#include "relocate.h"
|
2007-11-27 03:29:51 +00:00
|
|
|
#include "stats.h"
|
2008-02-26 19:58:03 +00:00
|
|
|
#include "tr-core.h"
|
|
|
|
#include "tr-icon.h"
|
|
|
|
#include "tr-prefs.h"
|
|
|
|
#include "tr-torrent.h"
|
|
|
|
#include "tr-window.h"
|
2006-07-16 19:39:23 +00:00
|
|
|
#include "util.h"
|
2007-06-18 03:40:41 +00:00
|
|
|
#include "ui.h"
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-12-13 23:17:36 +00:00
|
|
|
#define MY_NAME "transmission"
|
|
|
|
|
2009-03-05 17:18:36 +00:00
|
|
|
#define REFRESH_INTERVAL_SECONDS 2
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
#if GTK_CHECK_VERSION( 2, 8, 0 )
|
|
|
|
#define SHOW_LICENSE
|
|
|
|
static const char * LICENSE =
|
2009-05-08 18:52:06 +00:00
|
|
|
"Most of Transmission is covered by the MIT license."
|
2008-09-23 19:11:04 +00:00
|
|
|
"\n\n"
|
|
|
|
"Some files are copyrighted by Charles Kerr and are covered by "
|
|
|
|
"the GPL version 2. Works owned by the Transmission project "
|
|
|
|
"are granted a special exemption to clause 2(b) so that the bulk "
|
|
|
|
"of its code can remain under the MIT license. This exemption does "
|
|
|
|
"not extend to original or derived works not owned by the "
|
|
|
|
"Transmission project. "
|
|
|
|
"\n\n"
|
|
|
|
"Permission is hereby granted, free of charge, to any person obtaining "
|
|
|
|
"a copy of this software and associated documentation files (the "
|
|
|
|
"'Software'), to deal in the Software without restriction, including "
|
|
|
|
"without limitation the rights to use, copy, modify, merge, publish, "
|
|
|
|
"distribute, sublicense, and/or sell copies of the Software, and to "
|
|
|
|
"permit persons to whom the Software is furnished to do so, subject to "
|
|
|
|
"the following conditions: "
|
|
|
|
"\n\n"
|
|
|
|
"The above copyright notice and this permission notice shall be included "
|
|
|
|
"in all copies or substantial portions of the Software. "
|
|
|
|
"\n\n"
|
|
|
|
"THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, "
|
|
|
|
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
|
|
|
|
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. "
|
|
|
|
"IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY "
|
|
|
|
"CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
|
|
|
|
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE "
|
|
|
|
"SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.";
|
2007-06-09 17:08:25 +00:00
|
|
|
#endif
|
2007-06-09 15:20:32 +00:00
|
|
|
|
2008-01-28 22:18:43 +00:00
|
|
|
struct cbdata
|
|
|
|
{
|
2009-04-24 01:37:04 +00:00
|
|
|
gboolean isIconified;
|
|
|
|
gboolean isClosing;
|
|
|
|
guint timer;
|
|
|
|
gpointer icon;
|
|
|
|
GtkWindow * wind;
|
|
|
|
TrCore * core;
|
|
|
|
GtkWidget * msgwin;
|
|
|
|
GtkWidget * prefs;
|
|
|
|
GSList * errqueue;
|
|
|
|
GSList * dupqueue;
|
|
|
|
GtkTreeSelection * sel;
|
2009-05-15 15:15:52 +00:00
|
|
|
gpointer details;
|
2006-07-16 19:39:23 +00:00
|
|
|
};
|
|
|
|
|
2007-11-09 16:11:10 +00:00
|
|
|
#define CBDATA_PTR "callback-data-pointer"
|
2007-02-07 07:35:33 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
static GtkUIManager * myUIManager = NULL;
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
static void appsetup( TrWindow * wind,
|
|
|
|
GSList * args,
|
|
|
|
struct cbdata *,
|
|
|
|
gboolean paused,
|
|
|
|
gboolean minimized );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
static void winsetup( struct cbdata * cbdata,
|
|
|
|
TrWindow * wind );
|
|
|
|
|
|
|
|
static void wannaquit( void * vdata );
|
|
|
|
|
|
|
|
static void setupdrag( GtkWidget * widget,
|
|
|
|
struct cbdata *data );
|
|
|
|
|
|
|
|
static void gotdrag( GtkWidget * widget,
|
|
|
|
GdkDragContext * dc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *sel,
|
|
|
|
guint info,
|
|
|
|
guint time,
|
|
|
|
gpointer gdata );
|
|
|
|
|
2009-04-07 23:44:38 +00:00
|
|
|
static void coreerr( TrCore *, guint, const char *, struct cbdata * );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
static void onAddTorrent( TrCore *,
|
|
|
|
tr_ctor *,
|
|
|
|
gpointer );
|
|
|
|
|
|
|
|
static void prefschanged( TrCore * core,
|
|
|
|
const char * key,
|
|
|
|
gpointer data );
|
|
|
|
|
|
|
|
static gboolean updatemodel( gpointer gdata );
|
2007-02-07 07:35:33 +00:00
|
|
|
|
2007-10-26 23:29:19 +00:00
|
|
|
struct counts_data
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int totalCount;
|
|
|
|
int activeCount;
|
|
|
|
int inactiveCount;
|
2007-10-26 23:29:19 +00:00
|
|
|
};
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
accumulateStatusForeach( GtkTreeModel * model,
|
2007-06-18 03:40:41 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer user_data )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-10-20 17:54:56 +00:00
|
|
|
int activity = 0;
|
2007-10-26 23:29:19 +00:00
|
|
|
struct counts_data * counts = user_data;
|
|
|
|
|
|
|
|
++counts->totalCount;
|
|
|
|
|
2008-10-20 17:54:56 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_ACTIVITY, &activity, -1 );
|
2007-12-19 02:46:30 +00:00
|
|
|
|
2009-04-17 17:34:21 +00:00
|
|
|
if( activity == TR_STATUS_STOPPED )
|
2007-10-26 23:29:19 +00:00
|
|
|
++counts->inactiveCount;
|
2009-04-17 17:34:21 +00:00
|
|
|
else
|
|
|
|
++counts->activeCount;
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
|
|
|
|
2007-07-30 17:11:00 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
accumulateCanUpdateForeach( GtkTreeModel * model,
|
2007-07-30 17:11:00 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer accumulated_status )
|
2007-07-30 17:11:00 +00:00
|
|
|
{
|
2007-12-28 06:22:40 +00:00
|
|
|
tr_torrent * tor;
|
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT_RAW, &tor, -1 );
|
|
|
|
*(int*)accumulated_status |= tr_torrentCanManualUpdate( tor );
|
2007-07-30 17:11:00 +00:00
|
|
|
}
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
static void
|
2009-04-24 01:37:04 +00:00
|
|
|
refreshActions( struct cbdata * data )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2009-02-18 18:40:38 +00:00
|
|
|
int canUpdate;
|
2007-10-26 23:29:19 +00:00
|
|
|
struct counts_data counts;
|
2008-12-03 05:15:17 +00:00
|
|
|
GtkTreeSelection * s = data->sel;
|
2007-10-26 23:29:19 +00:00
|
|
|
|
|
|
|
counts.activeCount = 0;
|
|
|
|
counts.inactiveCount = 0;
|
|
|
|
counts.totalCount = 0;
|
2008-12-03 05:15:17 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, accumulateStatusForeach, &counts );
|
2008-09-23 19:11:04 +00:00
|
|
|
action_sensitize( "pause-torrent", counts.activeCount != 0 );
|
|
|
|
action_sensitize( "start-torrent", counts.inactiveCount != 0 );
|
|
|
|
action_sensitize( "remove-torrent", counts.totalCount != 0 );
|
|
|
|
action_sensitize( "delete-torrent", counts.totalCount != 0 );
|
|
|
|
action_sensitize( "verify-torrent", counts.totalCount != 0 );
|
|
|
|
action_sensitize( "open-torrent-folder", counts.totalCount == 1 );
|
2009-05-13 15:54:04 +00:00
|
|
|
action_sensitize( "relocate-torrent", counts.totalCount == 1 );
|
2007-10-26 23:29:19 +00:00
|
|
|
|
|
|
|
canUpdate = 0;
|
2008-12-03 05:15:17 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, accumulateCanUpdateForeach, &canUpdate );
|
2008-09-23 19:11:04 +00:00
|
|
|
action_sensitize( "update-tracker", canUpdate != 0 );
|
2008-03-19 20:34:35 +00:00
|
|
|
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeView * view = gtk_tree_selection_get_tree_view( s );
|
2008-03-19 20:34:35 +00:00
|
|
|
GtkTreeModel * model = gtk_tree_view_get_model( view );
|
2009-02-18 18:40:38 +00:00
|
|
|
const int torrentCount = gtk_tree_model_iter_n_children( model, NULL ) != 0;
|
2008-09-23 19:11:04 +00:00
|
|
|
action_sensitize( "select-all", torrentCount != 0 );
|
|
|
|
action_sensitize( "deselect-all", torrentCount != 0 );
|
2008-03-19 20:34:35 +00:00
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
tr_session * session = tr_core_session( data->core );
|
2009-02-18 18:40:38 +00:00
|
|
|
const int active = tr_sessionGetActiveTorrentCount( session );
|
|
|
|
const int total = tr_sessionCountTorrents( session );
|
|
|
|
action_sensitize( "pause-all-torrents", active != 0 );
|
|
|
|
action_sensitize( "start-all-torrents", active != total );
|
2008-12-03 05:15:17 +00:00
|
|
|
}
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
|
|
|
|
2009-04-24 01:37:04 +00:00
|
|
|
static void
|
|
|
|
refreshDetailsDialog( struct cbdata * data )
|
|
|
|
{
|
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
|
|
|
GtkTreeModel * model;
|
|
|
|
GSList * ids = NULL;
|
|
|
|
GList * selrows = NULL;
|
|
|
|
GList * l;
|
|
|
|
|
|
|
|
if( data->details == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* build a list of the selected torrents' ids */
|
|
|
|
s = tr_window_get_selection( data->wind );
|
|
|
|
for( selrows=l=gtk_tree_selection_get_selected_rows(s,&model); l; l=l->next ) {
|
|
|
|
GtkTreeIter iter;
|
|
|
|
if( gtk_tree_model_get_iter( model, &iter, l->data ) ) {
|
|
|
|
tr_torrent * tor;
|
|
|
|
gtk_tree_model_get( model, &iter, MC_TORRENT_RAW, &tor, -1 );
|
|
|
|
ids = g_slist_append( ids, GINT_TO_POINTER( tr_torrentId( tor ) ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-05-15 15:15:52 +00:00
|
|
|
torrent_inspector_set_torrents( GTK_WIDGET( data->details ), ids );
|
2009-04-24 01:37:04 +00:00
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
g_slist_free( ids );
|
|
|
|
g_list_foreach( selrows, (GFunc)gtk_tree_path_free, NULL );
|
|
|
|
g_list_free( selrows );
|
|
|
|
}
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
static void
|
2008-12-03 05:15:17 +00:00
|
|
|
selectionChangedCB( GtkTreeSelection * s UNUSED, gpointer data )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2009-04-24 01:37:04 +00:00
|
|
|
refreshActions( data );
|
|
|
|
refreshDetailsDialog( data );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
|
|
|
|
2008-04-21 20:58:39 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onMainWindowSizeAllocated( GtkWidget * window,
|
2008-04-21 20:58:39 +00:00
|
|
|
GtkAllocation * alloc UNUSED,
|
|
|
|
gpointer gdata UNUSED )
|
|
|
|
{
|
|
|
|
const gboolean isMaximized = window->window
|
2008-10-07 15:17:52 +00:00
|
|
|
&& ( gdk_window_get_state( window->window )
|
|
|
|
& GDK_WINDOW_STATE_MAXIMIZED );
|
2008-04-21 20:58:39 +00:00
|
|
|
|
|
|
|
if( !isMaximized )
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
gtk_window_get_position( GTK_WINDOW( window ), &x, &y );
|
|
|
|
gtk_window_get_size( GTK_WINDOW( window ), &w, &h );
|
|
|
|
pref_int_set( PREF_KEY_MAIN_WINDOW_X, x );
|
|
|
|
pref_int_set( PREF_KEY_MAIN_WINDOW_Y, y );
|
|
|
|
pref_int_set( PREF_KEY_MAIN_WINDOW_WIDTH, w );
|
|
|
|
pref_int_set( PREF_KEY_MAIN_WINDOW_HEIGHT, h );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-28 17:51:54 +00:00
|
|
|
static sig_atomic_t global_sigcount = 0;
|
|
|
|
|
|
|
|
static void
|
|
|
|
fatalsig( int sig )
|
|
|
|
{
|
2008-10-07 15:17:52 +00:00
|
|
|
/* revert to default handler after this many */
|
|
|
|
static const int SIGCOUNT_MAX = 3;
|
2008-02-28 17:51:54 +00:00
|
|
|
|
|
|
|
if( ++global_sigcount >= SIGCOUNT_MAX )
|
|
|
|
{
|
|
|
|
signal( sig, SIG_DFL );
|
|
|
|
raise( sig );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
setupsighandlers( void )
|
|
|
|
{
|
|
|
|
#ifdef G_OS_WIN32
|
2008-09-23 19:11:04 +00:00
|
|
|
const int sigs[] = { SIGINT, SIGTERM };
|
2008-02-28 17:51:54 +00:00
|
|
|
#else
|
2008-09-23 19:11:04 +00:00
|
|
|
const int sigs[] = { SIGHUP, SIGINT, SIGQUIT, SIGTERM };
|
2008-02-28 17:51:54 +00:00
|
|
|
#endif
|
2008-09-23 19:11:04 +00:00
|
|
|
guint i;
|
2008-02-28 17:51:54 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( i = 0; i < G_N_ELEMENTS( sigs ); ++i )
|
|
|
|
signal( sigs[i], fatalsig );
|
2008-02-28 17:51:54 +00:00
|
|
|
}
|
|
|
|
|
2008-10-02 16:42:35 +00:00
|
|
|
static tr_rpc_callback_status
|
2008-10-28 19:49:33 +00:00
|
|
|
onRPCChanged( tr_session * session UNUSED,
|
2008-10-02 16:42:35 +00:00
|
|
|
tr_rpc_callback_type type,
|
|
|
|
struct tr_torrent * tor,
|
|
|
|
void * gdata )
|
2008-05-18 16:44:30 +00:00
|
|
|
{
|
2008-10-02 16:42:35 +00:00
|
|
|
struct cbdata * cbdata = gdata;
|
|
|
|
gdk_threads_enter( );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-10-02 16:42:35 +00:00
|
|
|
switch( type )
|
2008-05-18 16:44:30 +00:00
|
|
|
{
|
|
|
|
case TR_RPC_TORRENT_ADDED:
|
2008-10-02 16:42:35 +00:00
|
|
|
tr_core_add_torrent( cbdata->core,
|
|
|
|
tr_torrent_new_preexisting( tor ) );
|
2008-05-18 16:44:30 +00:00
|
|
|
break;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
case TR_RPC_TORRENT_STARTED:
|
|
|
|
/* this should be automatic */
|
|
|
|
break;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
case TR_RPC_TORRENT_STOPPED:
|
|
|
|
/* this should be automatic */
|
|
|
|
break;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-22 19:24:11 +00:00
|
|
|
case TR_RPC_TORRENT_REMOVING:
|
2008-10-02 16:42:35 +00:00
|
|
|
tr_core_torrent_destroyed( cbdata->core, tr_torrentId( tor ) );
|
2008-05-18 16:44:30 +00:00
|
|
|
break;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
case TR_RPC_TORRENT_CHANGED:
|
|
|
|
case TR_RPC_SESSION_CHANGED:
|
|
|
|
/* nothing interesting to do here */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-10-02 16:42:35 +00:00
|
|
|
gdk_threads_leave( );
|
2008-08-14 02:12:29 +00:00
|
|
|
return TR_RPC_OK;
|
2008-05-18 16:44:30 +00:00
|
|
|
}
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
int
|
2008-09-23 19:11:04 +00:00
|
|
|
main( int argc,
|
|
|
|
char ** argv )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
char * err = NULL;
|
|
|
|
struct cbdata * cbdata;
|
|
|
|
GSList * argfiles;
|
|
|
|
GError * gerr;
|
|
|
|
gboolean didinit = FALSE;
|
|
|
|
gboolean didlock = FALSE;
|
2008-11-02 20:16:08 +00:00
|
|
|
gboolean showversion = FALSE;
|
2008-09-23 19:11:04 +00:00
|
|
|
gboolean startpaused = FALSE;
|
|
|
|
gboolean startminimized = FALSE;
|
2009-03-05 17:18:36 +00:00
|
|
|
const char * domain = MY_NAME;
|
2008-09-23 19:11:04 +00:00
|
|
|
char * configDir = NULL;
|
2008-08-17 12:39:26 +00:00
|
|
|
tr_lockfile_state_t tr_state;
|
2008-04-05 20:12:11 +00:00
|
|
|
|
2008-10-07 15:17:52 +00:00
|
|
|
GOptionEntry entries[] = {
|
|
|
|
{ "paused", 'p', 0, G_OPTION_ARG_NONE,
|
|
|
|
&startpaused, _( "Start with all torrents paused" ), NULL },
|
2008-11-02 20:16:08 +00:00
|
|
|
{ "version", '\0', 0, G_OPTION_ARG_NONE,
|
|
|
|
&showversion, _( "Show version number and exit" ), NULL },
|
2008-01-23 16:22:52 +00:00
|
|
|
#ifdef STATUS_ICON_SUPPORTED
|
2008-10-07 15:17:52 +00:00
|
|
|
{ "minimized", 'm', 0, G_OPTION_ARG_NONE,
|
2008-09-23 19:11:04 +00:00
|
|
|
&startminimized,
|
|
|
|
_( "Start minimized in system tray" ), NULL },
|
2008-01-23 16:22:52 +00:00
|
|
|
#endif
|
2008-10-07 15:17:52 +00:00
|
|
|
{ "config-dir", 'g', 0, G_OPTION_ARG_FILENAME, &configDir,
|
2008-04-19 00:41:32 +00:00
|
|
|
_( "Where to look for configuration files" ), NULL },
|
2008-10-07 15:17:52 +00:00
|
|
|
{ NULL, 0, 0, 0, NULL, NULL, NULL }
|
2007-10-12 19:53:30 +00:00
|
|
|
};
|
|
|
|
|
2008-01-28 22:18:43 +00:00
|
|
|
cbdata = g_new0( struct cbdata, 1 );
|
|
|
|
|
2007-10-12 19:53:30 +00:00
|
|
|
/* bind the gettext domain */
|
2008-07-25 11:50:17 +00:00
|
|
|
setlocale( LC_ALL, "" );
|
2007-10-12 19:53:30 +00:00
|
|
|
bindtextdomain( domain, TRANSMISSIONLOCALEDIR );
|
|
|
|
bind_textdomain_codeset( domain, "UTF-8" );
|
|
|
|
textdomain( domain );
|
|
|
|
g_set_application_name( _( "Transmission" ) );
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2007-10-12 19:53:30 +00:00
|
|
|
/* initialize gtk */
|
2008-09-23 19:11:04 +00:00
|
|
|
if( !g_thread_supported( ) )
|
2008-08-17 12:39:34 +00:00
|
|
|
g_thread_init( NULL );
|
|
|
|
|
2007-12-30 18:23:45 +00:00
|
|
|
gerr = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
if( !gtk_init_with_args( &argc, &argv, _( "[torrent files]" ), entries,
|
2009-03-05 17:18:36 +00:00
|
|
|
(char*)domain, &gerr ) )
|
2008-09-23 19:11:04 +00:00
|
|
|
{
|
2008-11-02 20:16:08 +00:00
|
|
|
fprintf( stderr, "%s\n", gerr->message );
|
2007-12-30 18:23:45 +00:00
|
|
|
g_clear_error( &gerr );
|
|
|
|
return 0;
|
|
|
|
}
|
2008-11-02 20:16:08 +00:00
|
|
|
|
|
|
|
if( showversion )
|
|
|
|
{
|
|
|
|
fprintf( stderr, "%s %s\n", g_get_application_name( ), LONG_VERSION_STRING );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
if( configDir == NULL )
|
2008-12-13 23:17:36 +00:00
|
|
|
configDir = (char*) tr_getDefaultConfigDir( MY_NAME );
|
2007-12-30 18:23:45 +00:00
|
|
|
|
2008-02-24 15:42:31 +00:00
|
|
|
tr_notify_init( );
|
2008-04-05 20:12:11 +00:00
|
|
|
didinit = cf_init( configDir, NULL ); /* must come before actions_init */
|
2008-12-13 23:17:36 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
myUIManager = gtk_ui_manager_new ( );
|
2007-10-12 19:53:30 +00:00
|
|
|
actions_init ( myUIManager, cbdata );
|
2008-12-13 23:17:36 +00:00
|
|
|
gtk_ui_manager_add_ui_from_string ( myUIManager, fallback_ui_file, -1, NULL );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_ui_manager_ensure_update ( myUIManager );
|
2008-12-13 23:17:36 +00:00
|
|
|
gtk_window_set_default_icon_name ( MY_NAME );
|
2007-10-12 19:53:30 +00:00
|
|
|
|
2007-10-13 03:15:02 +00:00
|
|
|
setupsighandlers( ); /* set up handlers for fatal signals */
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
/* either get a lockfile s.t. this is the one instance of
|
|
|
|
* transmission that's running, OR if there are files to
|
|
|
|
* be added, delegate that to the running instance via dbus */
|
2008-08-17 12:39:26 +00:00
|
|
|
didlock = cf_lock( &tr_state, &err );
|
2008-09-23 19:11:04 +00:00
|
|
|
argfiles = checkfilenames( argc - 1, argv + 1 );
|
2008-05-18 16:44:30 +00:00
|
|
|
if( !didlock && argfiles )
|
|
|
|
{
|
|
|
|
GSList * l;
|
|
|
|
gboolean delegated = FALSE;
|
2008-09-23 19:11:04 +00:00
|
|
|
for( l = argfiles; l; l = l->next )
|
2008-05-18 16:44:30 +00:00
|
|
|
delegated |= gtr_dbus_add_torrent( l->data );
|
|
|
|
if( delegated )
|
|
|
|
err = NULL;
|
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
else if( ( !didlock ) && ( tr_state == TR_LOCKFILE_ELOCK ) )
|
2008-08-17 12:39:26 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
gtr_dbus_present_window( );
|
2008-08-17 12:39:26 +00:00
|
|
|
err = NULL;
|
|
|
|
}
|
2008-05-18 16:44:30 +00:00
|
|
|
|
|
|
|
if( didlock && ( didinit || cf_init( configDir, &err ) ) )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2009-03-05 02:40:58 +00:00
|
|
|
const char * str;
|
2008-08-11 19:05:02 +00:00
|
|
|
GtkWindow * win;
|
2008-12-13 23:17:36 +00:00
|
|
|
tr_session * session;
|
2008-08-11 19:05:02 +00:00
|
|
|
|
2009-03-05 02:40:58 +00:00
|
|
|
/* ensure the directories are created */
|
|
|
|
if(( str = pref_string_get( PREF_KEY_DIR_WATCH )))
|
|
|
|
mkdir_p( str, 0777 );
|
|
|
|
if(( str = pref_string_get( TR_PREFS_KEY_DOWNLOAD_DIR )))
|
|
|
|
mkdir_p( str, 0777 );
|
|
|
|
|
2008-12-13 23:17:36 +00:00
|
|
|
/* initialize the libtransmission session */
|
|
|
|
session = tr_sessionInit( "gtk", configDir, TRUE, pref_get_all( ) );
|
2009-03-28 16:47:01 +00:00
|
|
|
pref_flag_set( TR_PREFS_KEY_ALT_SPEED_ENABLED, tr_sessionUsesAltSpeed( session ) );
|
2009-04-07 04:30:16 +00:00
|
|
|
pref_int_set( TR_PREFS_KEY_PEER_PORT, tr_sessionGetPeerPort( session ) );
|
2008-12-13 23:17:36 +00:00
|
|
|
cbdata->core = tr_core_new( session );
|
2007-12-19 19:16:36 +00:00
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
/* create main window now to be a parent to any error dialogs */
|
2008-08-11 19:05:02 +00:00
|
|
|
win = GTK_WINDOW( tr_window_new( myUIManager, cbdata->core ) );
|
2008-12-13 23:17:36 +00:00
|
|
|
g_signal_connect( win, "size-allocate", G_CALLBACK( onMainWindowSizeAllocated ), cbdata );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-04-21 20:58:39 +00:00
|
|
|
appsetup( win, argfiles, cbdata, startpaused, startminimized );
|
2008-12-13 23:17:36 +00:00
|
|
|
tr_sessionSetRPCCallback( session, onRPCChanged, cbdata );
|
2009-04-07 20:13:08 +00:00
|
|
|
|
|
|
|
/* on startup, check & see if it's time to update the blocklist */
|
|
|
|
if( pref_flag_get( PREF_KEY_BLOCKLIST_UPDATES_ENABLED )
|
|
|
|
&& ( time( NULL ) - pref_int_get( "blocklist-date" ) > ( 60 * 60 * 24 * 7 ) ) )
|
|
|
|
tr_core_blocklist_update( cbdata->core );
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_main( );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
2008-05-18 16:44:30 +00:00
|
|
|
else if( err )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
|
|
|
gtk_widget_show( errmsg_full( NULL, (callbackfunc_t)gtk_main_quit,
|
|
|
|
NULL, "%s", err ) );
|
|
|
|
g_free( err );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_main( );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
appsetup( TrWindow * wind,
|
|
|
|
GSList * torrentFiles,
|
2008-01-23 16:22:52 +00:00
|
|
|
struct cbdata * cbdata,
|
2008-09-23 19:11:04 +00:00
|
|
|
gboolean forcepause,
|
2008-11-15 04:38:31 +00:00
|
|
|
gboolean isIconified )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
const pref_flag_t start =
|
|
|
|
forcepause ? PREF_FLAG_FALSE : PREF_FLAG_DEFAULT;
|
2008-03-19 14:54:32 +00:00
|
|
|
const pref_flag_t prompt = PREF_FLAG_DEFAULT;
|
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
/* fill out cbdata */
|
2008-11-15 04:38:31 +00:00
|
|
|
cbdata->wind = NULL;
|
|
|
|
cbdata->icon = NULL;
|
|
|
|
cbdata->msgwin = NULL;
|
|
|
|
cbdata->prefs = NULL;
|
|
|
|
cbdata->timer = 0;
|
|
|
|
cbdata->isClosing = 0;
|
|
|
|
cbdata->errqueue = NULL;
|
|
|
|
cbdata->dupqueue = NULL;
|
|
|
|
cbdata->isIconified = isIconified;
|
|
|
|
|
|
|
|
if( isIconified )
|
2008-06-06 20:03:19 +00:00
|
|
|
pref_flag_set( PREF_KEY_SHOW_TRAY_ICON, TRUE );
|
2008-05-24 23:23:20 +00:00
|
|
|
|
2007-12-19 18:42:33 +00:00
|
|
|
actions_set_core( cbdata->core );
|
|
|
|
|
2007-05-24 02:50:28 +00:00
|
|
|
/* set up core handlers */
|
2007-05-23 17:59:35 +00:00
|
|
|
g_signal_connect( cbdata->core, "error", G_CALLBACK( coreerr ), cbdata );
|
2008-03-18 01:22:11 +00:00
|
|
|
g_signal_connect( cbdata->core, "add-torrent-prompt",
|
|
|
|
G_CALLBACK( onAddTorrent ), cbdata );
|
2007-05-24 03:29:23 +00:00
|
|
|
g_signal_connect_swapped( cbdata->core, "quit",
|
|
|
|
G_CALLBACK( wannaquit ), cbdata );
|
2007-05-24 13:55:57 +00:00
|
|
|
g_signal_connect( cbdata->core, "prefs-changed",
|
|
|
|
G_CALLBACK( prefschanged ), cbdata );
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2007-05-24 02:50:28 +00:00
|
|
|
/* add torrents from command-line and saved state */
|
2008-02-13 03:00:21 +00:00
|
|
|
tr_core_load( cbdata->core, forcepause );
|
2008-03-19 14:54:32 +00:00
|
|
|
tr_core_add_list( cbdata->core, torrentFiles, start, prompt );
|
2008-03-18 01:22:11 +00:00
|
|
|
torrentFiles = NULL;
|
2007-05-24 02:50:28 +00:00
|
|
|
tr_core_torrents_added( cbdata->core );
|
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
/* set up main window */
|
|
|
|
winsetup( cbdata, wind );
|
|
|
|
|
2008-05-24 23:23:20 +00:00
|
|
|
/* set up the icon */
|
2008-06-06 20:03:19 +00:00
|
|
|
prefschanged( cbdata->core, PREF_KEY_SHOW_TRAY_ICON, cbdata );
|
2008-03-08 17:37:13 +00:00
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
/* start model update timer */
|
2009-03-05 17:18:36 +00:00
|
|
|
cbdata->timer = gtr_timeout_add_seconds( REFRESH_INTERVAL_SECONDS, updatemodel, cbdata );
|
2007-02-19 22:09:05 +00:00
|
|
|
updatemodel( cbdata );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-04-11 14:36:29 +00:00
|
|
|
/* either show the window or iconify it */
|
2008-11-15 04:38:31 +00:00
|
|
|
if( !isIconified )
|
2008-04-11 14:36:29 +00:00
|
|
|
gtk_widget_show( GTK_WIDGET( wind ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
else
|
|
|
|
{
|
2008-02-03 01:43:47 +00:00
|
|
|
gtk_window_iconify( wind );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_window_set_skip_taskbar_hint( cbdata->wind,
|
|
|
|
cbdata->icon != NULL );
|
2008-02-07 01:10:34 +00:00
|
|
|
}
|
2008-02-03 01:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-11-15 04:38:31 +00:00
|
|
|
tr_window_present( GtkWindow * window )
|
2008-02-03 01:43:47 +00:00
|
|
|
{
|
2008-11-15 04:38:31 +00:00
|
|
|
#if GTK_CHECK_VERSION( 2, 8, 0 )
|
|
|
|
gtk_window_present_with_time( window, gtk_get_current_event_time( ) );
|
|
|
|
#else
|
|
|
|
gtk_window_present( window );
|
2008-02-07 01:10:34 +00:00
|
|
|
#endif
|
2008-02-03 01:43:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
toggleMainWindow( struct cbdata * cbdata,
|
2008-11-15 04:38:31 +00:00
|
|
|
gboolean doPresent )
|
2008-02-03 01:43:47 +00:00
|
|
|
{
|
2008-02-07 01:10:34 +00:00
|
|
|
GtkWindow * window = GTK_WINDOW( cbdata->wind );
|
2008-11-15 04:38:31 +00:00
|
|
|
const int doShow = cbdata->isIconified;
|
|
|
|
static int x = 0;
|
|
|
|
static int y = 0;
|
2008-02-07 01:10:34 +00:00
|
|
|
|
2008-11-15 04:38:31 +00:00
|
|
|
if( doShow || doPresent )
|
2008-02-07 01:10:34 +00:00
|
|
|
{
|
2008-11-15 04:38:31 +00:00
|
|
|
cbdata->isIconified = 0;
|
|
|
|
gtk_window_set_skip_taskbar_hint( window, FALSE );
|
|
|
|
gtk_window_move( window, x, y );
|
|
|
|
gtk_widget_show( GTK_WIDGET( window ) );
|
|
|
|
tr_window_present( window );
|
2008-02-07 01:10:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-11-15 04:38:31 +00:00
|
|
|
gtk_window_get_position( window, &x, &y );
|
|
|
|
gtk_window_set_skip_taskbar_hint( window, TRUE );
|
|
|
|
gtk_widget_hide( GTK_WIDGET( window ) );
|
|
|
|
cbdata->isIconified = 1;
|
2008-02-07 01:10:34 +00:00
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
static gboolean
|
2008-09-23 19:11:04 +00:00
|
|
|
winclose( GtkWidget * w UNUSED,
|
|
|
|
GdkEvent * event UNUSED,
|
|
|
|
gpointer gdata )
|
2007-02-07 07:35:33 +00:00
|
|
|
{
|
2007-10-13 03:15:02 +00:00
|
|
|
struct cbdata * cbdata = gdata;
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
if( cbdata->icon != NULL )
|
2008-09-23 19:11:04 +00:00
|
|
|
action_activate ( "toggle-main-window" );
|
2007-06-18 03:40:41 +00:00
|
|
|
else
|
2007-07-16 18:45:51 +00:00
|
|
|
askquit( cbdata->core, cbdata->wind, wannaquit, cbdata );
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
return TRUE; /* don't propagate event further */
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-06-18 03:40:41 +00:00
|
|
|
rowChangedCB( GtkTreeModel * model UNUSED,
|
2008-12-03 05:15:17 +00:00
|
|
|
GtkTreePath * path,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter UNUSED,
|
2008-12-03 05:15:17 +00:00
|
|
|
gpointer gdata )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-12-03 05:15:17 +00:00
|
|
|
struct cbdata * data = gdata;
|
|
|
|
if( gtk_tree_selection_path_is_selected ( data->sel, path ) )
|
2009-04-24 01:37:04 +00:00
|
|
|
refreshActions( gdata );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
winsetup( struct cbdata * cbdata,
|
|
|
|
TrWindow * wind )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeModel * model;
|
2007-06-18 03:40:41 +00:00
|
|
|
GtkTreeSelection * sel;
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
g_assert( NULL == cbdata->wind );
|
|
|
|
cbdata->wind = GTK_WINDOW( wind );
|
2008-12-03 05:15:17 +00:00
|
|
|
cbdata->sel = sel = GTK_TREE_SELECTION( tr_window_get_selection( cbdata->wind ) );
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2008-12-03 05:15:17 +00:00
|
|
|
g_signal_connect( sel, "changed", G_CALLBACK( selectionChangedCB ), cbdata );
|
|
|
|
selectionChangedCB( sel, cbdata );
|
2007-06-18 03:40:41 +00:00
|
|
|
model = tr_core_model( cbdata->core );
|
2008-12-03 05:15:17 +00:00
|
|
|
g_signal_connect( model, "row-changed", G_CALLBACK( rowChangedCB ), cbdata );
|
2007-06-18 03:40:41 +00:00
|
|
|
g_signal_connect( wind, "delete-event", G_CALLBACK( winclose ), cbdata );
|
2009-04-24 01:37:04 +00:00
|
|
|
refreshActions( cbdata );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
setupdrag( GTK_WIDGET( wind ), cbdata );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-11-09 16:11:10 +00:00
|
|
|
static gpointer
|
2009-04-25 14:08:40 +00:00
|
|
|
quitThreadFunc( gpointer gdata )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2009-04-25 14:08:40 +00:00
|
|
|
struct cbdata * cbdata = gdata;
|
|
|
|
|
|
|
|
tr_core_close( cbdata->core );
|
|
|
|
|
|
|
|
/* shutdown the gui */
|
|
|
|
if( cbdata->details )
|
|
|
|
gtk_widget_destroy( GTK_WIDGET( cbdata->details ) );
|
|
|
|
if( cbdata->prefs )
|
|
|
|
gtk_widget_destroy( GTK_WIDGET( cbdata->prefs ) );
|
|
|
|
if( cbdata->wind )
|
|
|
|
gtk_widget_destroy( GTK_WIDGET( cbdata->wind ) );
|
|
|
|
g_object_unref( cbdata->core );
|
|
|
|
if( cbdata->icon )
|
|
|
|
g_object_unref( cbdata->icon );
|
|
|
|
if( cbdata->errqueue ) {
|
|
|
|
g_slist_foreach( cbdata->errqueue, (GFunc)g_free, NULL );
|
|
|
|
g_slist_free( cbdata->errqueue );
|
|
|
|
}
|
|
|
|
if( cbdata->dupqueue ) {
|
|
|
|
g_slist_foreach( cbdata->dupqueue, (GFunc)g_free, NULL );
|
|
|
|
g_slist_free( cbdata->dupqueue );
|
|
|
|
}
|
|
|
|
g_free( cbdata );
|
|
|
|
|
2007-11-09 16:11:10 +00:00
|
|
|
gtk_main_quit( );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-12-14 18:36:19 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
do_exit_cb( GtkWidget *w UNUSED,
|
|
|
|
gpointer data UNUSED )
|
2007-12-14 18:36:19 +00:00
|
|
|
{
|
|
|
|
exit( 0 );
|
|
|
|
}
|
|
|
|
|
2007-11-09 16:11:10 +00:00
|
|
|
static void
|
|
|
|
wannaquit( void * vdata )
|
|
|
|
{
|
2009-04-24 01:37:04 +00:00
|
|
|
GtkWidget *r, *p, *b, *w, *c;
|
|
|
|
struct cbdata *cbdata = vdata;
|
2007-11-09 16:11:10 +00:00
|
|
|
|
|
|
|
/* stop the update timer */
|
2008-09-23 19:11:04 +00:00
|
|
|
if( cbdata->timer )
|
|
|
|
{
|
2007-11-09 16:11:10 +00:00
|
|
|
g_source_remove( cbdata->timer );
|
|
|
|
cbdata->timer = 0;
|
|
|
|
}
|
|
|
|
|
2007-12-14 18:36:19 +00:00
|
|
|
c = GTK_WIDGET( cbdata->wind );
|
|
|
|
gtk_container_remove( GTK_CONTAINER( c ), gtk_bin_get_child( GTK_BIN( c ) ) );
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
r = gtk_alignment_new( 0.5, 0.5, 0.01, 0.01 );
|
|
|
|
gtk_container_add( GTK_CONTAINER( c ), r );
|
2007-12-14 18:36:19 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
p = gtk_table_new( 3, 2, FALSE );
|
2008-03-13 20:47:58 +00:00
|
|
|
gtk_table_set_col_spacings( GTK_TABLE( p ), GUI_PAD_BIG );
|
|
|
|
gtk_container_add( GTK_CONTAINER( r ), p );
|
2007-12-14 18:36:19 +00:00
|
|
|
|
|
|
|
w = gtk_image_new_from_stock( GTK_STOCK_NETWORK, GTK_ICON_SIZE_DIALOG );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_table_attach_defaults( GTK_TABLE( p ), w, 0, 1, 0, 2 );
|
2007-12-14 18:36:19 +00:00
|
|
|
|
2008-03-13 20:47:58 +00:00
|
|
|
w = gtk_label_new( NULL );
|
|
|
|
gtk_label_set_markup( GTK_LABEL( w ), _( "<b>Closing Connections</b>" ) );
|
|
|
|
gtk_misc_set_alignment( GTK_MISC( w ), 0.0, 0.5 );
|
|
|
|
gtk_table_attach_defaults( GTK_TABLE( p ), w, 1, 2, 0, 1 );
|
|
|
|
|
|
|
|
w = gtk_label_new( _( "Sending upload/download totals to tracker..." ) );
|
|
|
|
gtk_misc_set_alignment( GTK_MISC( w ), 0.0, 0.5 );
|
|
|
|
gtk_table_attach_defaults( GTK_TABLE( p ), w, 1, 2, 1, 2 );
|
2007-12-14 18:36:19 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
b = gtk_alignment_new( 0.0, 1.0, 0.01, 0.01 );
|
2008-09-03 16:29:59 +00:00
|
|
|
w = gtr_button_new_from_stock( GTK_STOCK_QUIT, _( "_Quit Now" ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK( do_exit_cb ), NULL );
|
|
|
|
gtk_container_add( GTK_CONTAINER( b ), w );
|
2009-04-24 01:37:04 +00:00
|
|
|
gtk_table_attach( GTK_TABLE( p ), b, 1, 2, 2, 3, GTK_FILL, GTK_FILL, 0, 10 );
|
2007-12-14 18:36:19 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_widget_show_all( r );
|
2007-11-29 02:32:10 +00:00
|
|
|
|
2007-11-11 20:38:59 +00:00
|
|
|
/* clear the UI */
|
|
|
|
gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
|
2007-11-29 02:32:10 +00:00
|
|
|
|
2007-11-09 16:11:10 +00:00
|
|
|
/* shut down libT */
|
2009-04-25 14:08:40 +00:00
|
|
|
g_thread_create( quitThreadFunc, vdata, TRUE, NULL );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-02-07 07:35:33 +00:00
|
|
|
static void
|
2007-10-12 19:53:30 +00:00
|
|
|
gotdrag( GtkWidget * widget UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GdkDragContext * dc,
|
|
|
|
gint x UNUSED,
|
|
|
|
gint y UNUSED,
|
|
|
|
GtkSelectionData * sel,
|
|
|
|
guint info UNUSED,
|
|
|
|
guint time,
|
|
|
|
gpointer gdata )
|
2007-10-12 19:53:30 +00:00
|
|
|
{
|
|
|
|
struct cbdata * data = gdata;
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList * paths = NULL;
|
|
|
|
GSList * freeme = NULL;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
#if 0
|
2008-09-23 19:11:04 +00:00
|
|
|
int i;
|
|
|
|
char * sele = gdk_atom_name( sel->selection );
|
|
|
|
char * targ = gdk_atom_name( sel->target );
|
|
|
|
char * type = gdk_atom_name( sel->type );
|
2007-10-12 19:53:30 +00:00
|
|
|
|
2007-10-13 03:15:02 +00:00
|
|
|
g_message( "dropped file: sel=%s targ=%s type=%s fmt=%i len=%i",
|
|
|
|
sele, targ, type, sel->format, sel->length );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_free( sele );
|
|
|
|
g_free( targ );
|
|
|
|
g_free( type );
|
|
|
|
if( sel->format == 8 )
|
|
|
|
{
|
|
|
|
for( i = 0; i < sel->length; ++i )
|
|
|
|
fprintf( stderr, "%02X ", sel->data[i] );
|
|
|
|
fprintf( stderr, "\n" );
|
2007-10-12 19:53:30 +00:00
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
#endif
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
if( ( sel->format == 8 )
|
|
|
|
&& ( sel->selection == gdk_atom_intern( "XdndSelection", FALSE ) ) )
|
2007-10-12 19:53:30 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int i;
|
|
|
|
char * str = g_strndup( (char*)sel->data, sel->length );
|
2007-10-12 19:53:30 +00:00
|
|
|
gchar ** files = g_strsplit_set( str, "\r\n", -1 );
|
2008-09-23 19:11:04 +00:00
|
|
|
for( i = 0; files && files[i]; ++i )
|
2007-10-12 19:53:30 +00:00
|
|
|
{
|
|
|
|
char * filename;
|
|
|
|
if( !*files[i] ) /* empty filename... */
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* decode the filename */
|
2008-01-20 15:50:42 +00:00
|
|
|
filename = decode_uri( files[i] );
|
2008-03-18 01:22:11 +00:00
|
|
|
freeme = g_slist_prepend( freeme, filename );
|
2007-10-12 19:53:30 +00:00
|
|
|
if( !g_utf8_validate( filename, -1, NULL ) )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* walk past "file://", if present */
|
2008-09-23 19:11:04 +00:00
|
|
|
if( g_str_has_prefix( filename, "file:" ) )
|
|
|
|
{
|
2007-10-12 19:53:30 +00:00
|
|
|
filename += 5;
|
|
|
|
while( g_str_has_prefix( filename, "//" ) )
|
|
|
|
++filename;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if the file doesn't exist, the first part
|
|
|
|
might be a hostname ... walk past it. */
|
2008-09-23 19:11:04 +00:00
|
|
|
if( !g_file_test( filename, G_FILE_TEST_EXISTS ) )
|
|
|
|
{
|
2007-10-12 19:53:30 +00:00
|
|
|
char * pch = strchr( filename + 1, '/' );
|
|
|
|
if( pch != NULL )
|
|
|
|
filename = pch;
|
|
|
|
}
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/* finally, add it to the list of torrents to try adding */
|
2007-10-12 19:53:30 +00:00
|
|
|
if( g_file_test( filename, G_FILE_TEST_EXISTS ) )
|
2008-03-18 01:22:11 +00:00
|
|
|
paths = g_slist_prepend( paths, g_strdup( filename ) );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-10-12 19:53:30 +00:00
|
|
|
/* try to add any torrents we found */
|
2008-03-18 01:22:11 +00:00
|
|
|
if( paths )
|
2007-10-12 19:53:30 +00:00
|
|
|
{
|
2008-03-18 01:22:11 +00:00
|
|
|
paths = g_slist_reverse( paths );
|
2008-03-19 14:54:32 +00:00
|
|
|
tr_core_add_list_defaults( data->core, paths );
|
2007-10-12 19:53:30 +00:00
|
|
|
tr_core_torrents_added( data->core );
|
|
|
|
}
|
|
|
|
|
|
|
|
freestrlist( freeme );
|
|
|
|
g_strfreev( files );
|
|
|
|
g_free( str );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_drag_finish( dc, ( NULL != paths ), FALSE, time );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-02-07 07:35:33 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
setupdrag( GtkWidget * widget,
|
|
|
|
struct cbdata *data )
|
|
|
|
{
|
|
|
|
GtkTargetEntry targets[] = {
|
2009-03-05 17:18:36 +00:00
|
|
|
{ (char*)"STRING", 0, 0 },
|
|
|
|
{ (char*)"text/plain", 0, 0 },
|
|
|
|
{ (char*)"text/uri-list", 0, 0 },
|
2008-09-23 19:11:04 +00:00
|
|
|
};
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( widget, "drag_data_received", G_CALLBACK(
|
|
|
|
gotdrag ), data );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_drag_dest_set( widget, GTK_DEST_DEFAULT_ALL, targets,
|
|
|
|
ALEN( targets ), GDK_ACTION_COPY | GDK_ACTION_MOVE );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2008-07-09 16:33:00 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
flushAddTorrentErrors( GtkWindow * window,
|
|
|
|
const char * primary,
|
|
|
|
GSList ** files )
|
2008-07-09 16:33:00 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GString * s = g_string_new( NULL );
|
|
|
|
GSList * l;
|
2008-07-09 16:33:00 +00:00
|
|
|
GtkWidget * w;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-12-03 06:01:38 +00:00
|
|
|
if( g_slist_length( *files ) > 1 ) {
|
|
|
|
for( l=*files; l!=NULL; l=l->next )
|
|
|
|
g_string_append_printf( s, "\xE2\x88\x99 %s\n", (const char*)l->data );
|
|
|
|
} else {
|
|
|
|
for( l=*files; l!=NULL; l=l->next )
|
|
|
|
g_string_append_printf( s, "%s\n", (const char*)l->data );
|
|
|
|
}
|
2008-07-09 16:33:00 +00:00
|
|
|
w = gtk_message_dialog_new( window,
|
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
GTK_MESSAGE_ERROR,
|
|
|
|
GTK_BUTTONS_CLOSE,
|
2008-10-09 20:03:34 +00:00
|
|
|
"%s", primary );
|
|
|
|
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( w ),
|
|
|
|
"%s", s->str );
|
2008-07-09 16:33:00 +00:00
|
|
|
g_signal_connect_swapped( w, "response",
|
|
|
|
G_CALLBACK( gtk_widget_destroy ), w );
|
|
|
|
gtk_widget_show_all( w );
|
|
|
|
g_string_free( s, TRUE );
|
|
|
|
|
|
|
|
g_slist_foreach( *files, (GFunc)g_free, NULL );
|
|
|
|
g_slist_free( *files );
|
|
|
|
*files = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
showTorrentErrors( struct cbdata * cbdata )
|
|
|
|
{
|
|
|
|
if( cbdata->errqueue )
|
|
|
|
flushAddTorrentErrors( GTK_WINDOW( cbdata->wind ),
|
|
|
|
ngettext( "Couldn't add corrupt torrent",
|
2008-12-03 06:01:38 +00:00
|
|
|
"Couldn't add corrupt torrents",
|
|
|
|
g_slist_length( cbdata->errqueue ) ),
|
2008-07-09 16:33:00 +00:00
|
|
|
&cbdata->errqueue );
|
|
|
|
|
|
|
|
if( cbdata->dupqueue )
|
|
|
|
flushAddTorrentErrors( GTK_WINDOW( cbdata->wind ),
|
|
|
|
ngettext( "Couldn't add duplicate torrent",
|
2008-12-03 06:01:38 +00:00
|
|
|
"Couldn't add duplicate torrents",
|
|
|
|
g_slist_length( cbdata->dupqueue ) ),
|
2008-07-09 16:33:00 +00:00
|
|
|
&cbdata->dupqueue );
|
|
|
|
}
|
|
|
|
|
2007-05-23 17:59:35 +00:00
|
|
|
static void
|
2009-04-07 23:44:38 +00:00
|
|
|
coreerr( TrCore * core UNUSED, guint code, const char * msg, struct cbdata * c )
|
2007-05-23 17:59:35 +00:00
|
|
|
{
|
|
|
|
switch( code )
|
|
|
|
{
|
2008-07-09 16:33:00 +00:00
|
|
|
case TR_EINVALID:
|
2008-09-23 19:11:04 +00:00
|
|
|
c->errqueue =
|
|
|
|
g_slist_append( c->errqueue, g_path_get_basename( msg ) );
|
2008-07-09 16:33:00 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TR_EDUPLICATE:
|
2008-12-03 06:01:38 +00:00
|
|
|
c->dupqueue = g_slist_append( c->dupqueue, g_strdup( msg ) );
|
2008-07-09 16:33:00 +00:00
|
|
|
break;
|
|
|
|
|
2007-05-23 17:59:35 +00:00
|
|
|
case TR_CORE_ERR_NO_MORE_TORRENTS:
|
2008-07-09 16:33:00 +00:00
|
|
|
showTorrentErrors( c );
|
|
|
|
break;
|
|
|
|
|
2007-05-23 17:59:35 +00:00
|
|
|
case TR_CORE_ERR_SAVE_STATE:
|
2008-07-09 16:33:00 +00:00
|
|
|
errmsg( c->wind, "%s", msg );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2008-09-23 19:11:04 +00:00
|
|
|
g_assert_not_reached( );
|
2008-07-09 16:33:00 +00:00
|
|
|
break;
|
2007-05-23 17:59:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
#if GTK_CHECK_VERSION( 2, 8, 0 )
|
2008-02-19 05:52:37 +00:00
|
|
|
static void
|
|
|
|
on_main_window_focus_in( GtkWidget * widget UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GdkEventFocus * event UNUSED,
|
|
|
|
gpointer gdata )
|
2008-02-19 05:52:37 +00:00
|
|
|
{
|
|
|
|
struct cbdata * cbdata = gdata;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-02-19 05:52:37 +00:00
|
|
|
gtk_window_set_urgency_hint( GTK_WINDOW( cbdata->wind ), FALSE );
|
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-02-19 05:52:37 +00:00
|
|
|
#endif
|
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onAddTorrent( TrCore * core,
|
|
|
|
tr_ctor * ctor,
|
|
|
|
gpointer gdata )
|
2007-05-24 10:37:07 +00:00
|
|
|
{
|
|
|
|
struct cbdata * cbdata = gdata;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkWidget * w = addSingleTorrentDialog( cbdata->wind, core, ctor );
|
|
|
|
|
|
|
|
#if GTK_CHECK_VERSION( 2, 8, 0 )
|
|
|
|
g_signal_connect( w, "focus-in-event",
|
|
|
|
G_CALLBACK( on_main_window_focus_in ), cbdata );
|
2008-03-18 01:22:11 +00:00
|
|
|
gtk_window_set_urgency_hint( cbdata->wind, TRUE );
|
2008-02-19 05:52:37 +00:00
|
|
|
#endif
|
2007-05-24 02:50:28 +00:00
|
|
|
}
|
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
prefschanged( TrCore * core UNUSED,
|
|
|
|
const char * key,
|
|
|
|
gpointer data )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-10-28 19:49:33 +00:00
|
|
|
struct cbdata * cbdata = data;
|
|
|
|
tr_session * tr = tr_core_session( cbdata->core );
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2008-12-13 23:17:36 +00:00
|
|
|
if( !strcmp( key, TR_PREFS_KEY_ENCRYPTION ) )
|
2007-09-28 00:46:22 +00:00
|
|
|
{
|
2008-06-12 16:25:36 +00:00
|
|
|
const int encryption = pref_int_get( key );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_message( "setting encryption to %d", encryption );
|
2008-06-12 16:25:36 +00:00
|
|
|
tr_sessionSetEncryption( tr, encryption );
|
2007-09-28 00:46:22 +00:00
|
|
|
}
|
2008-12-14 23:26:25 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_DOWNLOAD_DIR ) )
|
|
|
|
{
|
|
|
|
tr_sessionSetDownloadDir( tr, pref_string_get( key ) );
|
|
|
|
}
|
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_MSGLEVEL ) )
|
|
|
|
{
|
|
|
|
tr_setMessageLevel( pref_int_get( key ) );
|
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PEER_PORT ) )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetPeerPort( tr, pref_int_get( key ) );
|
2007-09-27 20:57:58 +00:00
|
|
|
}
|
2008-12-14 22:41:44 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_BLOCKLIST_ENABLED ) )
|
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_blocklistSetEnabled( tr, pref_flag_get( key ) );
|
2008-12-14 22:41:44 +00:00
|
|
|
}
|
2008-06-06 20:03:19 +00:00
|
|
|
else if( !strcmp( key, PREF_KEY_SHOW_TRAY_ICON ) )
|
2008-05-24 23:23:20 +00:00
|
|
|
{
|
|
|
|
const int show = pref_flag_get( key );
|
|
|
|
if( show && !cbdata->icon )
|
|
|
|
cbdata->icon = tr_icon_new( cbdata->core );
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !show && cbdata->icon ) {
|
2008-05-24 23:23:20 +00:00
|
|
|
g_object_unref( cbdata->icon );
|
|
|
|
cbdata->icon = NULL;
|
|
|
|
}
|
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_DSPEED_ENABLED ) )
|
2007-09-27 20:57:58 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionLimitSpeed( tr, TR_DOWN, pref_flag_get( key ) );
|
2007-09-27 20:57:58 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_DSPEED ) )
|
2007-09-27 20:57:58 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetSpeedLimit( tr, TR_DOWN, pref_int_get( key ) );
|
2007-09-27 20:57:58 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_USPEED_ENABLED ) )
|
2007-09-27 20:57:58 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionLimitSpeed( tr, TR_UP, pref_flag_get( key ) );
|
2007-09-27 20:57:58 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_USPEED ) )
|
2007-09-27 20:57:58 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetSpeedLimit( tr, TR_UP, pref_int_get( key ) );
|
2007-09-27 20:57:58 +00:00
|
|
|
}
|
2009-02-13 18:23:56 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RATIO_ENABLED ) )
|
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetRatioLimited( tr, pref_flag_get( key ) );
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RATIO ) )
|
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetRatioLimit( tr, pref_double_get( key ) );
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PORT_FORWARDING ) )
|
2007-09-27 20:57:58 +00:00
|
|
|
{
|
2008-12-14 23:46:57 +00:00
|
|
|
tr_sessionSetPortForwardingEnabled( tr, pref_flag_get( key ) );
|
2007-09-27 20:57:58 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PEX_ENABLED ) )
|
2007-09-27 20:57:58 +00:00
|
|
|
{
|
2008-12-14 23:46:57 +00:00
|
|
|
tr_sessionSetPexEnabled( tr, pref_flag_get( key ) );
|
2008-05-18 16:44:30 +00:00
|
|
|
}
|
2009-05-21 00:15:54 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_DHT_ENABLED ) )
|
|
|
|
{
|
|
|
|
tr_sessionSetDHTEnabled( tr, pref_flag_get( key ) );
|
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_PORT ) )
|
2008-05-18 16:44:30 +00:00
|
|
|
{
|
2008-05-18 16:52:25 +00:00
|
|
|
tr_sessionSetRPCPort( tr, pref_int_get( key ) );
|
2008-05-18 16:44:30 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_ENABLED ) )
|
2008-05-18 16:44:30 +00:00
|
|
|
{
|
2008-05-24 23:23:20 +00:00
|
|
|
tr_sessionSetRPCEnabled( tr, pref_flag_get( key ) );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_WHITELIST ) )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetRPCWhitelist( tr, pref_string_get( key ) );
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_WHITELIST_ENABLED ) )
|
2008-10-01 22:59:29 +00:00
|
|
|
{
|
|
|
|
tr_sessionSetRPCWhitelistEnabled( tr, pref_flag_get( key ) );
|
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_USERNAME ) )
|
2008-06-05 16:23:03 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetRPCUsername( tr, pref_string_get( key ) );
|
2008-06-05 16:23:03 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_PASSWORD ) )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetRPCPassword( tr, pref_string_get( key ) );
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_RPC_AUTH_REQUIRED ) )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetRPCPasswordEnabled( tr, pref_flag_get( key ) );
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY ) )
|
2008-06-06 20:03:19 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetProxy( tr, pref_string_get( key ) );
|
2008-06-06 20:03:19 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY_TYPE ) )
|
2008-06-11 20:45:53 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetProxyType( tr, pref_int_get( key ) );
|
2008-06-11 20:45:53 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY_ENABLED ) )
|
2008-06-06 20:03:19 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetProxyEnabled( tr, pref_flag_get( key ) );
|
2008-06-06 20:03:19 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY_AUTH_ENABLED ) )
|
2008-06-06 20:03:19 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetProxyAuthEnabled( tr, pref_flag_get( key ) );
|
2008-06-06 20:03:19 +00:00
|
|
|
}
|
2008-12-13 23:17:36 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY_USERNAME ) )
|
2008-06-06 20:03:19 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetProxyUsername( tr, pref_string_get( key ) );
|
2008-06-06 20:03:19 +00:00
|
|
|
}
|
2008-12-14 23:26:25 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY_PASSWORD ) )
|
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetProxyPassword( tr, pref_string_get( key ) );
|
2008-12-14 23:26:25 +00:00
|
|
|
}
|
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PROXY_PORT ) )
|
|
|
|
{
|
|
|
|
tr_sessionSetProxyPort( tr, pref_int_get( key ) );
|
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_UP ) )
|
2008-06-06 20:03:19 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetAltSpeed( tr, TR_UP, pref_int_get( key ) );
|
2008-06-06 20:03:19 +00:00
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_DOWN ) )
|
2009-03-25 19:18:00 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetAltSpeed( tr, TR_DOWN, pref_int_get( key ) );
|
2009-03-25 19:18:00 +00:00
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_ENABLED ) )
|
2009-03-25 19:18:00 +00:00
|
|
|
{
|
2009-05-16 19:41:41 +00:00
|
|
|
const gboolean b = pref_flag_get( key );
|
|
|
|
tr_sessionUseAltSpeed( tr, b );
|
|
|
|
action_toggle( key, b );
|
2009-03-25 19:18:00 +00:00
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN ) )
|
2009-03-25 19:18:00 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetAltSpeedBegin( tr, pref_int_get( key ) );
|
2009-03-25 19:18:00 +00:00
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_TIME_END ) )
|
2009-03-25 19:18:00 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionSetAltSpeedEnd( tr, pref_int_get( key ) );
|
2009-03-25 19:18:00 +00:00
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED ) )
|
2009-03-25 19:18:00 +00:00
|
|
|
{
|
2009-03-28 16:47:01 +00:00
|
|
|
tr_sessionUseAltSpeedTime( tr, pref_flag_get( key ) );
|
2009-03-25 19:18:00 +00:00
|
|
|
}
|
2009-04-05 14:53:22 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_ALT_SPEED_TIME_DAY ) )
|
|
|
|
{
|
|
|
|
tr_sessionSetAltSpeedDay( tr, pref_int_get( key ) );
|
|
|
|
}
|
2009-04-05 16:07:51 +00:00
|
|
|
else if( !strcmp( key, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START ) )
|
|
|
|
{
|
|
|
|
tr_sessionSetPeerPortRandomOnStart( tr, pref_flag_get( key ) );
|
|
|
|
}
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2008-08-11 19:05:02 +00:00
|
|
|
static gboolean
|
2008-07-13 18:14:24 +00:00
|
|
|
updatemodel( gpointer gdata )
|
|
|
|
{
|
|
|
|
struct cbdata *data = gdata;
|
2008-11-15 04:38:31 +00:00
|
|
|
const gboolean done = data->isClosing || global_sigcount;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-07-13 18:14:24 +00:00
|
|
|
if( !done )
|
|
|
|
{
|
|
|
|
/* update the torrent data in the model */
|
|
|
|
tr_core_update( data->core );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-07-13 18:14:24 +00:00
|
|
|
/* update the main window's statusbar and toolbar buttons */
|
|
|
|
if( data->wind )
|
|
|
|
tr_window_update( data->wind );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-07-13 18:14:24 +00:00
|
|
|
/* update the actions */
|
2009-04-24 01:37:04 +00:00
|
|
|
refreshActions( data );
|
2008-07-13 18:14:24 +00:00
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-07-13 18:14:24 +00:00
|
|
|
return !done;
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2008-05-25 13:22:14 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
aboutDialogActivateLink( GtkAboutDialog * dialog UNUSED,
|
|
|
|
const gchar * link_,
|
2008-05-25 13:22:14 +00:00
|
|
|
gpointer user_data UNUSED )
|
|
|
|
{
|
|
|
|
gtr_open_file( link_ );
|
|
|
|
}
|
|
|
|
|
2007-06-09 15:20:32 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
about( GtkWindow * parent )
|
2007-06-09 15:20:32 +00:00
|
|
|
{
|
2008-02-07 19:42:54 +00:00
|
|
|
const char *authors[] =
|
|
|
|
{
|
|
|
|
"Charles Kerr (Backend; GTK+)",
|
|
|
|
"Mitchell Livingston (Backend; OS X)",
|
2009-06-02 04:03:52 +00:00
|
|
|
"Kevin Glowacz (Web client)",
|
2008-02-07 19:42:54 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2008-08-15 17:45:18 +00:00
|
|
|
const char *website_url = "http://www.transmissionbt.com/";
|
|
|
|
|
2008-05-25 13:22:14 +00:00
|
|
|
gtk_about_dialog_set_url_hook( aboutDialogActivateLink, NULL, NULL );
|
|
|
|
|
2008-02-07 19:42:54 +00:00
|
|
|
gtk_show_about_dialog( parent,
|
2008-09-23 19:11:04 +00:00
|
|
|
"name", g_get_application_name( ),
|
|
|
|
"comments",
|
|
|
|
_( "A fast and easy BitTorrent client" ),
|
|
|
|
"version", LONG_VERSION_STRING,
|
|
|
|
"website", website_url,
|
|
|
|
"website-label", website_url,
|
|
|
|
"copyright",
|
2009-01-10 23:09:07 +00:00
|
|
|
_( "Copyright 2005-2009 The Transmission Project" ),
|
2008-12-13 23:17:36 +00:00
|
|
|
"logo-icon-name", MY_NAME,
|
2007-06-09 17:08:25 +00:00
|
|
|
#ifdef SHOW_LICENSE
|
2008-09-23 19:11:04 +00:00
|
|
|
"license", LICENSE,
|
|
|
|
"wrap-license", TRUE,
|
2007-06-09 17:08:25 +00:00
|
|
|
#endif
|
2008-09-23 19:11:04 +00:00
|
|
|
"authors", authors,
|
|
|
|
/* Translators: translate "translator-credits" as
|
|
|
|
your name
|
|
|
|
to have it appear in the credits in the "About"
|
|
|
|
dialog */
|
|
|
|
"translator-credits", _( "translator-credits" ),
|
|
|
|
NULL );
|
2007-06-09 15:20:32 +00:00
|
|
|
}
|
|
|
|
|
2007-02-07 07:35:33 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
startTorrentForeach( GtkTreeModel * model,
|
2007-06-18 03:40:41 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer data UNUSED )
|
2007-02-07 07:35:33 +00:00
|
|
|
{
|
2008-05-27 17:47:39 +00:00
|
|
|
tr_torrent * tor = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-27 17:47:39 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT_RAW, &tor, -1 );
|
|
|
|
tr_torrentStart( tor );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
stopTorrentForeach( GtkTreeModel * model,
|
2007-06-18 03:40:41 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer data UNUSED )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-05-27 17:47:39 +00:00
|
|
|
tr_torrent * tor = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-27 17:47:39 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT_RAW, &tor, -1 );
|
|
|
|
tr_torrentStop( tor );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
|
|
|
|
2007-07-30 17:11:00 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
updateTrackerForeach( GtkTreeModel * model,
|
2007-07-30 17:11:00 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer data UNUSED )
|
2007-07-30 17:11:00 +00:00
|
|
|
{
|
2008-05-27 17:47:39 +00:00
|
|
|
tr_torrent * tor = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-05-27 17:47:39 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT_RAW, &tor, -1 );
|
|
|
|
tr_torrentManualUpdate( tor );
|
2007-07-30 17:11:00 +00:00
|
|
|
}
|
|
|
|
|
2008-04-11 02:21:33 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
openFolderForeach( GtkTreeModel * model,
|
|
|
|
GtkTreePath * path UNUSED,
|
|
|
|
GtkTreeIter * iter,
|
2008-04-11 02:21:33 +00:00
|
|
|
gpointer user_data UNUSED )
|
|
|
|
{
|
|
|
|
TrTorrent * gtor = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-04-11 02:21:33 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT, >or, -1 );
|
|
|
|
tr_torrent_open_folder( gtor );
|
|
|
|
g_object_unref( G_OBJECT( gtor ) );
|
|
|
|
}
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
recheckTorrentForeach( GtkTreeModel * model,
|
2007-06-18 03:40:41 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer data UNUSED )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
|
|
|
TrTorrent * gtor = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2007-06-26 18:45:03 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT, >or, -1 );
|
2008-02-27 17:38:39 +00:00
|
|
|
tr_torrentVerify( tr_torrent_handle( gtor ) );
|
2007-06-18 03:40:41 +00:00
|
|
|
g_object_unref( G_OBJECT( gtor ) );
|
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
static gboolean
|
2008-03-02 15:54:58 +00:00
|
|
|
msgwinclosed( void )
|
2007-09-21 16:29:09 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
action_toggle( "toggle-message-log", FALSE );
|
|
|
|
return FALSE;
|
2007-09-21 16:29:09 +00:00
|
|
|
}
|
|
|
|
|
2008-03-02 15:54:58 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
accumulateSelectedTorrents( GtkTreeModel * model,
|
2008-03-02 15:54:58 +00:00
|
|
|
GtkTreePath * path UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter * iter,
|
|
|
|
gpointer gdata )
|
2008-03-02 15:54:58 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList ** data = ( GSList** ) gdata;
|
2008-03-02 15:54:58 +00:00
|
|
|
TrTorrent * tor = NULL;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-03-02 15:54:58 +00:00
|
|
|
gtk_tree_model_get( model, iter, MC_TORRENT, &tor, -1 );
|
2008-03-18 01:22:11 +00:00
|
|
|
*data = g_slist_prepend( *data, tor );
|
2008-03-02 15:54:58 +00:00
|
|
|
}
|
|
|
|
|
2008-03-07 16:58:44 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
removeSelected( struct cbdata * data,
|
|
|
|
gboolean delete_files )
|
2008-03-02 15:54:58 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList * l = NULL;
|
2008-03-02 15:54:58 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-03-02 15:54:58 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, accumulateSelectedTorrents, &l );
|
|
|
|
gtk_tree_selection_unselect_all( s );
|
2008-09-23 19:11:04 +00:00
|
|
|
if( l )
|
|
|
|
{
|
2008-03-18 01:22:11 +00:00
|
|
|
l = g_slist_reverse( l );
|
2008-03-07 17:47:42 +00:00
|
|
|
confirmRemove( data->wind, data->core, l, delete_files );
|
2008-03-18 01:22:11 +00:00
|
|
|
}
|
2008-03-02 15:54:58 +00:00
|
|
|
}
|
|
|
|
|
2009-02-18 18:40:38 +00:00
|
|
|
static void
|
|
|
|
startAllTorrents( struct cbdata * data )
|
|
|
|
{
|
|
|
|
tr_session * session = tr_core_session( data->core );
|
|
|
|
const char * cmd = "{ \"method\": \"torrent-start\" }";
|
|
|
|
tr_rpc_request_exec_json( session, cmd, strlen( cmd ), NULL, NULL );
|
|
|
|
}
|
|
|
|
|
2008-12-03 05:15:17 +00:00
|
|
|
static void
|
|
|
|
pauseAllTorrents( struct cbdata * data )
|
|
|
|
{
|
|
|
|
tr_session * session = tr_core_session( data->core );
|
|
|
|
const char * cmd = "{ \"method\": \"torrent-stop\" }";
|
2009-01-18 15:29:22 +00:00
|
|
|
tr_rpc_request_exec_json( session, cmd, strlen( cmd ), NULL, NULL );
|
2008-12-03 05:15:17 +00:00
|
|
|
}
|
|
|
|
|
2009-05-13 15:54:04 +00:00
|
|
|
static tr_torrent*
|
|
|
|
getFirstSelectedTorrent( struct cbdata * data )
|
|
|
|
{
|
|
|
|
tr_torrent * tor = NULL;
|
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
|
|
|
GtkTreeModel * m;
|
|
|
|
GList * l = gtk_tree_selection_get_selected_rows( s, &m );
|
|
|
|
if( l != NULL ) {
|
|
|
|
GtkTreePath * p = l->data;
|
|
|
|
GtkTreeIter i;
|
|
|
|
if( gtk_tree_model_get_iter( m, &i, p ) )
|
|
|
|
gtk_tree_model_get( m, &i, MC_TORRENT_RAW, &tor, -1 );
|
|
|
|
}
|
|
|
|
g_list_foreach( l, (GFunc)gtk_tree_path_free, NULL );
|
|
|
|
g_list_free( l );
|
|
|
|
return tor;
|
|
|
|
}
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
void
|
2008-12-03 05:15:17 +00:00
|
|
|
doAction( const char * action_name, gpointer user_data )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-01-28 22:18:43 +00:00
|
|
|
struct cbdata * data = user_data;
|
2008-09-23 19:11:04 +00:00
|
|
|
gboolean changed = FALSE;
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2008-12-03 05:15:17 +00:00
|
|
|
if( !strcmp( action_name, "add-torrent-menu" )
|
2008-09-23 19:11:04 +00:00
|
|
|
|| !strcmp( action_name, "add-torrent-toolbar" ) )
|
2007-05-23 00:49:31 +00:00
|
|
|
{
|
2008-04-03 02:11:15 +00:00
|
|
|
addDialog( data->wind, data->core );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "show-stats" ) )
|
2007-11-27 03:29:51 +00:00
|
|
|
{
|
2008-12-03 05:15:17 +00:00
|
|
|
GtkWidget * dialog = stats_dialog_create( data->wind, data->core );
|
2007-11-27 03:29:51 +00:00
|
|
|
gtk_widget_show( dialog );
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "start-torrent" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2007-06-18 03:40:41 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, startTorrentForeach, NULL );
|
|
|
|
changed |= gtk_tree_selection_count_selected_rows( s ) != 0;
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "pause-all-torrents" ) )
|
|
|
|
{
|
|
|
|
pauseAllTorrents( data );
|
|
|
|
}
|
2009-02-18 18:40:38 +00:00
|
|
|
else if( !strcmp( action_name, "start-all-torrents" ) )
|
|
|
|
{
|
|
|
|
startAllTorrents( data );
|
|
|
|
}
|
2009-05-13 15:54:04 +00:00
|
|
|
else if( !strcmp( action_name, "relocate-torrent" ) )
|
|
|
|
{
|
|
|
|
tr_torrent * tor = getFirstSelectedTorrent( data );
|
|
|
|
if( tor )
|
|
|
|
{
|
|
|
|
GtkWindow * parent = GTK_WINDOW( data->wind );
|
|
|
|
GtkWidget * w = gtr_relocate_dialog_new( parent, tor );
|
|
|
|
gtk_widget_show( w );
|
|
|
|
}
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "pause-torrent" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2007-06-18 03:40:41 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, stopTorrentForeach, NULL );
|
|
|
|
changed |= gtk_tree_selection_count_selected_rows( s ) != 0;
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "verify-torrent" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2007-06-18 03:40:41 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, recheckTorrentForeach, NULL );
|
|
|
|
changed |= gtk_tree_selection_count_selected_rows( s ) != 0;
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "open-torrent-folder" ) )
|
2008-04-11 02:21:33 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2008-04-11 02:21:33 +00:00
|
|
|
gtk_tree_selection_selected_foreach( s, openFolderForeach, data );
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "show-torrent-properties" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2009-05-02 15:17:03 +00:00
|
|
|
if( data->details == NULL ) {
|
2009-04-24 01:37:04 +00:00
|
|
|
data->details = torrent_inspector_new( GTK_WINDOW( data->wind ), data->core );
|
2009-05-15 15:15:52 +00:00
|
|
|
g_object_add_weak_pointer( G_OBJECT( data->details ), &data->details );
|
2009-05-02 15:17:03 +00:00
|
|
|
}
|
2009-04-24 01:37:04 +00:00
|
|
|
refreshDetailsDialog( data );
|
2009-05-15 15:15:52 +00:00
|
|
|
gtk_widget_show( GTK_WIDGET( data->details ) );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
else if( !strcmp( action_name, "update-tracker" ) )
|
2007-07-30 17:11:00 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
|
|
|
gtk_tree_selection_selected_foreach( s, updateTrackerForeach,
|
|
|
|
data->wind );
|
2007-07-30 17:11:00 +00:00
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "new-torrent" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2007-10-13 03:15:02 +00:00
|
|
|
GtkWidget * w = make_meta_ui( GTK_WINDOW( data->wind ),
|
2008-10-28 19:49:33 +00:00
|
|
|
tr_core_session( data->core ) );
|
2007-06-18 03:40:41 +00:00
|
|
|
gtk_widget_show_all( w );
|
|
|
|
}
|
2008-03-07 17:47:42 +00:00
|
|
|
else if( !strcmp( action_name, "remove-torrent" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-03-07 17:47:42 +00:00
|
|
|
removeSelected( data, FALSE );
|
2008-03-02 15:54:58 +00:00
|
|
|
}
|
|
|
|
else if( !strcmp( action_name, "delete-torrent" ) )
|
|
|
|
{
|
2008-03-07 17:47:42 +00:00
|
|
|
removeSelected( data, TRUE );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "quit" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2007-07-16 18:45:51 +00:00
|
|
|
askquit( data->core, data->wind, wannaquit, data );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "select-all" ) )
|
2007-07-30 15:51:37 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2007-07-30 15:51:37 +00:00
|
|
|
gtk_tree_selection_select_all( s );
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "deselect-all" ) )
|
2007-07-30 15:51:37 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
2007-07-30 15:51:37 +00:00
|
|
|
gtk_tree_selection_unselect_all( s );
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "edit-preferences" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
|
|
|
if( NULL == data->prefs )
|
|
|
|
{
|
2008-10-07 15:17:52 +00:00
|
|
|
data->prefs = tr_prefs_dialog_new( G_OBJECT( data->core ),
|
|
|
|
data->wind );
|
2007-06-18 03:40:41 +00:00
|
|
|
g_signal_connect( data->prefs, "destroy",
|
2008-10-07 15:17:52 +00:00
|
|
|
G_CALLBACK( gtk_widget_destroyed ), &data->prefs );
|
2007-06-18 03:40:41 +00:00
|
|
|
gtk_widget_show( GTK_WIDGET( data->prefs ) );
|
|
|
|
}
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "toggle-message-log" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2007-09-21 16:29:09 +00:00
|
|
|
if( !data->msgwin )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-03-16 15:18:19 +00:00
|
|
|
GtkWidget * win = msgwin_new( data->core );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( win, "destroy", G_CALLBACK( msgwinclosed ),
|
|
|
|
NULL );
|
2007-09-21 16:29:09 +00:00
|
|
|
data->msgwin = win;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
action_toggle( "toggle-message-log", FALSE );
|
2007-09-21 16:29:09 +00:00
|
|
|
gtk_widget_destroy( data->msgwin );
|
|
|
|
data->msgwin = NULL;
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "show-about-dialog" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-02-07 19:42:54 +00:00
|
|
|
about( data->wind );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
else if( !strcmp ( action_name, "help" ) )
|
2008-05-06 19:20:19 +00:00
|
|
|
{
|
#963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of
#963 (gtk) for online help URLs, use branch names (1.2x) instead of specific version names (1.21) so that we don't have to add a URL for every release.
2008-05-22 17:39:20 +00:00
|
|
|
char * url = gtr_get_help_url( );
|
|
|
|
gtr_open_file( url );
|
|
|
|
g_free( url );
|
2008-05-06 19:20:19 +00:00
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "toggle-main-window" ) )
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
2008-08-17 12:39:26 +00:00
|
|
|
toggleMainWindow( data, FALSE );
|
|
|
|
}
|
2008-12-03 05:15:17 +00:00
|
|
|
else if( !strcmp( action_name, "present-main-window" ) )
|
2008-08-17 12:39:26 +00:00
|
|
|
{
|
|
|
|
toggleMainWindow( data, TRUE );
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
else g_error ( "Unhandled action: %s", action_name );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-10-12 20:50:03 +00:00
|
|
|
if( changed )
|
2007-06-18 03:40:41 +00:00
|
|
|
updatemodel( data );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|