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-05-01 14:05:17 +00:00
|
|
|
#include <ctype.h> /* isxdigit() */
|
2006-07-16 19:39:23 +00:00
|
|
|
#include <stdarg.h>
|
2008-02-28 20:23:02 +00:00
|
|
|
#include <stdlib.h> /* free() */
|
|
|
|
#include <string.h> /* strcmp() */
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <glib/gi18n.h>
|
2008-03-09 15:27:08 +00:00
|
|
|
#include <glib/gstdio.h> /* g_unlink() */
|
|
|
|
#ifdef HAVE_GIO
|
|
|
|
#include <gio/gio.h> /* g_file_trash() */
|
|
|
|
#endif
|
2008-04-13 02:56:26 +00:00
|
|
|
#ifdef HAVE_DBUS_GLIB
|
|
|
|
#include <dbus/dbus-glib.h>
|
|
|
|
#endif
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-01-20 15:50:42 +00:00
|
|
|
#include <libevent/evhttp.h>
|
|
|
|
|
2008-02-28 20:23:02 +00:00
|
|
|
#include <libtransmission/transmission.h> /* TR_RATIO_NA, TR_RATIO_INF */
|
2008-04-13 02:56:26 +00:00
|
|
|
#include <libtransmission/utils.h> /* tr_inf */
|
2008-02-28 20:23:02 +00:00
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
#include "conf.h"
|
2008-06-01 15:46:20 +00:00
|
|
|
#include "hig.h"
|
2008-02-26 19:58:03 +00:00
|
|
|
#include "tr-prefs.h"
|
2006-07-16 19:39:23 +00:00
|
|
|
#include "util.h"
|
|
|
|
|
2008-01-04 18:52:39 +00:00
|
|
|
char*
|
|
|
|
tr_strlratio( char * buf, double ratio, size_t buflen )
|
|
|
|
{
|
|
|
|
if( (int)ratio == TR_RATIO_NA )
|
|
|
|
g_strlcpy( buf, _( "None" ), buflen );
|
|
|
|
else if( (int)ratio == TR_RATIO_INF )
|
|
|
|
g_strlcpy( buf, "\xE2\x88\x9E", buflen );
|
|
|
|
else if( ratio < 10.0 )
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, "%'.2f", ratio );
|
2008-01-04 18:52:39 +00:00
|
|
|
else if( ratio < 100.0 )
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, "%'.1f", ratio );
|
2008-01-04 18:52:39 +00:00
|
|
|
else
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, "%'.0f", ratio );
|
2008-01-04 18:52:39 +00:00
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
2008-03-07 15:16:25 +00:00
|
|
|
#define KILOBYTE_FACTOR 1024.0
|
|
|
|
#define MEGABYTE_FACTOR (1024.0 * 1024.0)
|
|
|
|
#define GIGABYTE_FACTOR (1024.0 * 1024.0 * 1024.0)
|
|
|
|
|
2007-12-19 02:46:30 +00:00
|
|
|
char*
|
|
|
|
tr_strlsize( char * buf, guint64 size, size_t buflen )
|
|
|
|
{
|
2008-03-07 19:27:46 +00:00
|
|
|
if( !size )
|
|
|
|
g_strlcpy( buf, _( "None" ), buflen );
|
2008-03-07 15:16:25 +00:00
|
|
|
#if GLIB_CHECK_VERSION(2,16,0)
|
2008-03-07 19:27:46 +00:00
|
|
|
else{
|
2008-03-12 19:17:54 +00:00
|
|
|
char * tmp = g_format_size_for_display( size );
|
2008-03-07 19:27:46 +00:00
|
|
|
g_strlcpy( buf, tmp, buflen );
|
|
|
|
g_free( tmp );
|
|
|
|
}
|
2008-03-07 15:16:25 +00:00
|
|
|
#else
|
2008-03-07 19:27:46 +00:00
|
|
|
else if( size < (guint64)KILOBYTE_FACTOR )
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, ngettext("%'u byte", "%'u bytes", (guint)size), (guint)size );
|
2007-12-19 02:46:30 +00:00
|
|
|
else {
|
2008-03-07 15:16:25 +00:00
|
|
|
gdouble displayed_size;
|
2008-03-07 16:09:21 +00:00
|
|
|
if (size < (guint64)MEGABYTE_FACTOR) {
|
2008-03-07 15:16:25 +00:00
|
|
|
displayed_size = (gdouble) size / KILOBYTE_FACTOR;
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, _("%'.1f KB"), displayed_size );
|
2008-03-07 16:09:21 +00:00
|
|
|
} else if (size < (guint64)GIGABYTE_FACTOR) {
|
2008-03-07 15:16:25 +00:00
|
|
|
displayed_size = (gdouble) size / MEGABYTE_FACTOR;
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, _("%'.1f MB"), displayed_size );
|
2008-03-07 15:16:25 +00:00
|
|
|
} else {
|
|
|
|
displayed_size = (gdouble) size / GIGABYTE_FACTOR;
|
2008-03-19 17:14:47 +00:00
|
|
|
g_snprintf( buf, buflen, _("%'.1f GB"), displayed_size );
|
2008-03-07 15:16:25 +00:00
|
|
|
}
|
2007-12-19 02:46:30 +00:00
|
|
|
}
|
2008-03-07 15:16:25 +00:00
|
|
|
#endif
|
2007-12-19 02:46:30 +00:00
|
|
|
return buf;
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-12-19 02:46:30 +00:00
|
|
|
char*
|
2008-03-07 20:48:36 +00:00
|
|
|
tr_strlspeed( char * buf, double kb_sec, size_t buflen )
|
2007-06-06 00:30:13 +00:00
|
|
|
{
|
2008-03-07 20:48:36 +00:00
|
|
|
const double speed = kb_sec;
|
2008-03-07 15:16:25 +00:00
|
|
|
|
|
|
|
if ( speed < 1000.0 ) /* 0.0 KB to 999.9 KB */
|
2008-03-19 20:07:27 +00:00
|
|
|
g_snprintf( buf, buflen, _( "%'.1f KB/s" ), speed );
|
2008-03-07 15:16:25 +00:00
|
|
|
else if( speed < 102400.0 ) /* 0.98 MB to 99.99 MB */
|
2008-03-19 20:07:27 +00:00
|
|
|
g_snprintf( buf, buflen, _( "%'.2f MB/s" ), (speed/1024) );
|
2008-03-07 15:16:25 +00:00
|
|
|
else if( speed < 1024000.0 ) /* 100.0 MB to 999.9 MB */
|
2008-03-19 20:07:27 +00:00
|
|
|
g_snprintf( buf, buflen, _( "%'.1f MB/s" ), (speed/1024) );
|
2008-03-07 15:16:25 +00:00
|
|
|
else /* insane speeds */
|
2008-03-19 20:07:27 +00:00
|
|
|
g_snprintf( buf, buflen, _( "%'.2f GB/s" ), (speed/1048576) );
|
2008-03-07 15:16:25 +00:00
|
|
|
|
2007-12-19 02:46:30 +00:00
|
|
|
return buf;
|
2007-06-06 00:30:13 +00:00
|
|
|
}
|
|
|
|
|
2007-12-26 06:38:33 +00:00
|
|
|
char*
|
2008-03-07 15:16:25 +00:00
|
|
|
tr_strltime( char * buf, int seconds, size_t buflen )
|
2007-12-26 06:38:33 +00:00
|
|
|
{
|
2008-07-01 22:35:32 +00:00
|
|
|
int days, hours, minutes;
|
|
|
|
char d[128], h[128], m[128], s[128];
|
2008-03-07 15:16:25 +00:00
|
|
|
|
|
|
|
if( seconds < 0 )
|
|
|
|
seconds = 0;
|
|
|
|
|
2008-07-01 22:35:32 +00:00
|
|
|
days = seconds / 86400;
|
|
|
|
hours = (seconds % 86400) / 3600;
|
|
|
|
minutes = (seconds % 3600) / 60;
|
|
|
|
seconds = (seconds % 3600) % 60;
|
2008-03-07 15:16:25 +00:00
|
|
|
|
2008-07-01 22:35:32 +00:00
|
|
|
g_snprintf( d, sizeof( d ), ngettext( "%'d day", "%'d days", days ), days );
|
|
|
|
g_snprintf( h, sizeof( h ), ngettext( "%'d hour", "%'d hours", hours ), hours );
|
|
|
|
g_snprintf( m, sizeof( m ), ngettext( "%'d minute", "%'d minutes", minutes ), minutes );
|
|
|
|
g_snprintf( s, sizeof( s ), ngettext( "%'d second", "%'d seconds", seconds ), seconds );
|
2007-12-26 06:38:33 +00:00
|
|
|
|
2008-07-01 22:35:32 +00:00
|
|
|
if( days ) {
|
|
|
|
if( days >= 4 || !hours ) {
|
|
|
|
g_strlcpy( buf, d, buflen );
|
|
|
|
} else {
|
|
|
|
g_snprintf( buf, buflen, "%s, %s", d, h );
|
|
|
|
}
|
|
|
|
} else if( hours ) {
|
|
|
|
if( hours >= 4 || !minutes ) {
|
|
|
|
g_strlcpy( buf, h, buflen );
|
|
|
|
} else {
|
|
|
|
g_snprintf( buf, buflen, "%s, %s", h, m );
|
|
|
|
}
|
|
|
|
} else if( minutes ) {
|
|
|
|
if( minutes >= 4 || !seconds ) {
|
|
|
|
g_strlcpy( buf, m, buflen );
|
|
|
|
} else {
|
|
|
|
g_snprintf( buf, buflen, "%s, %s", m, s );
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
g_strlcpy( buf, s, buflen );
|
2008-03-08 16:10:13 +00:00
|
|
|
}
|
|
|
|
|
2007-12-26 06:38:33 +00:00
|
|
|
return buf;
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2007-06-06 00:30:13 +00:00
|
|
|
char *
|
2008-07-25 14:56:28 +00:00
|
|
|
gtr_localtime( time_t time )
|
2007-06-06 00:30:13 +00:00
|
|
|
{
|
2008-05-23 20:04:41 +00:00
|
|
|
const struct tm tm = *localtime( &time );
|
2008-07-25 14:56:28 +00:00
|
|
|
char buf[256], *eoln;
|
|
|
|
|
|
|
|
g_strlcpy( buf, asctime( &tm ), sizeof( buf ) );
|
|
|
|
if(( eoln = strchr( buf, '\n' )))
|
|
|
|
*eoln = '\0';
|
|
|
|
|
2007-10-29 23:49:00 +00:00
|
|
|
return g_locale_to_utf8( buf, -1, NULL, NULL, NULL );
|
2007-06-06 00:30:13 +00:00
|
|
|
}
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
gboolean
|
2008-01-20 15:50:42 +00:00
|
|
|
mkdir_p( const char * path, mode_t mode )
|
2007-10-03 21:02:30 +00:00
|
|
|
{
|
2008-01-20 15:50:42 +00:00
|
|
|
#if GLIB_CHECK_VERSION( 2, 8, 0)
|
|
|
|
return !g_mkdir_with_parents( path, mode );
|
2007-10-03 21:02:30 +00:00
|
|
|
#else
|
2008-01-20 15:50:42 +00:00
|
|
|
return !tr_mkdirp( path, mode );
|
2007-10-03 21:02:30 +00:00
|
|
|
#endif
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 01:22:11 +00:00
|
|
|
GSList *
|
|
|
|
dupstrlist( GSList * l )
|
2007-02-07 02:59:25 +00:00
|
|
|
{
|
2008-03-18 01:22:11 +00:00
|
|
|
GSList * ret = NULL;
|
2007-10-13 03:15:02 +00:00
|
|
|
for( ; l!=NULL; l=l->next )
|
2008-03-18 01:22:11 +00:00
|
|
|
ret = g_slist_prepend( ret, g_strdup( l->data ) );
|
|
|
|
return g_slist_reverse( ret );
|
2007-02-07 02:59:25 +00:00
|
|
|
}
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
char *
|
2008-03-18 01:22:11 +00:00
|
|
|
joinstrlist(GSList *list, char *sep)
|
2007-06-06 00:30:13 +00:00
|
|
|
{
|
2008-03-18 01:22:11 +00:00
|
|
|
GSList *l;
|
2007-06-06 00:30:13 +00:00
|
|
|
GString *gstr = g_string_new (NULL);
|
|
|
|
for (l=list; l!=NULL; l=l->next) {
|
|
|
|
g_string_append (gstr, (char*)l->data);
|
|
|
|
if (l->next != NULL)
|
|
|
|
g_string_append (gstr, (sep));
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
2007-06-06 00:30:13 +00:00
|
|
|
return g_string_free (gstr, FALSE);
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-03-18 01:22:11 +00:00
|
|
|
freestrlist(GSList *list)
|
2007-06-06 00:30:13 +00:00
|
|
|
{
|
2008-03-18 01:22:11 +00:00
|
|
|
g_slist_foreach (list, (GFunc)g_free, NULL);
|
|
|
|
g_slist_free (list);
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
2008-01-20 15:50:42 +00:00
|
|
|
decode_uri( const char * uri )
|
|
|
|
{
|
2008-05-01 14:05:17 +00:00
|
|
|
gboolean in_query = FALSE;
|
|
|
|
char * ret = g_new( char, strlen( uri ) + 1 );
|
|
|
|
char * out = ret;
|
|
|
|
for( ; uri && *uri; ) {
|
|
|
|
char ch = *uri;
|
|
|
|
if( ch=='?' )
|
|
|
|
in_query = TRUE;
|
|
|
|
else if( ch=='+' && in_query )
|
|
|
|
ch = ' ';
|
|
|
|
else if( ch=='%' && isxdigit((unsigned char)uri[1])
|
|
|
|
&& isxdigit((unsigned char)uri[2])) {
|
|
|
|
char buf[3] = { uri[1], uri[2], '\0' };
|
|
|
|
ch = (char) g_ascii_strtoull( buf, NULL, 16 );
|
|
|
|
uri += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
++uri;
|
|
|
|
*out++ = ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
*out = '\0';
|
2008-01-20 15:50:42 +00:00
|
|
|
return ret;
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2008-03-18 01:22:11 +00:00
|
|
|
GSList *
|
2007-10-12 19:53:30 +00:00
|
|
|
checkfilenames( int argc, char **argv )
|
|
|
|
{
|
|
|
|
int i;
|
2008-03-18 01:22:11 +00:00
|
|
|
GSList * ret = NULL;
|
2007-10-12 19:53:30 +00:00
|
|
|
char * pwd = g_get_current_dir( );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-10-12 19:53:30 +00:00
|
|
|
for( i=0; i<argc; ++i )
|
|
|
|
{
|
|
|
|
char * filename = g_path_is_absolute( argv[i] )
|
|
|
|
? g_strdup ( argv[i] )
|
|
|
|
: g_build_filename( pwd, argv[i], NULL );
|
|
|
|
|
|
|
|
if( g_file_test( filename, G_FILE_TEST_EXISTS ) )
|
2008-03-18 01:22:11 +00:00
|
|
|
ret = g_slist_prepend( ret, filename );
|
2007-10-12 19:53:30 +00:00
|
|
|
else
|
|
|
|
g_free( filename );
|
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-10-12 19:53:30 +00:00
|
|
|
g_free( pwd );
|
2008-03-18 01:22:11 +00:00
|
|
|
return g_slist_reverse( ret );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2008-02-28 20:23:02 +00:00
|
|
|
static void
|
2008-03-18 01:22:11 +00:00
|
|
|
onErrorResponse(GtkWidget * dialog, int resp UNUSED, gpointer glist)
|
|
|
|
{
|
|
|
|
GSList * list = glist;
|
|
|
|
if( list )
|
|
|
|
{
|
|
|
|
callbackfunc_t func = list->data;
|
|
|
|
gpointer user_data = list->next->data;
|
|
|
|
func( user_data );
|
|
|
|
g_slist_free( list );
|
|
|
|
}
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-03-18 01:22:11 +00:00
|
|
|
gtk_widget_destroy( dialog );
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
|
|
|
|
2008-02-28 20:23:02 +00:00
|
|
|
static GtkWidget *
|
2007-02-19 22:09:05 +00:00
|
|
|
verrmsg_full( GtkWindow * wind, callbackfunc_t func, void * data,
|
|
|
|
const char * format, va_list ap )
|
|
|
|
{
|
2006-07-16 19:39:23 +00:00
|
|
|
GtkWidget *dialog;
|
|
|
|
char *msg;
|
2008-03-18 01:22:11 +00:00
|
|
|
GSList *funcdata = NULL;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
msg = g_strdup_vprintf(format, ap);
|
|
|
|
|
|
|
|
if(NULL == wind)
|
|
|
|
dialog = gtk_message_dialog_new(
|
|
|
|
NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", msg);
|
|
|
|
else
|
|
|
|
dialog = gtk_message_dialog_new(wind,
|
|
|
|
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", msg);
|
|
|
|
|
2008-03-18 01:22:11 +00:00
|
|
|
if( func ) {
|
|
|
|
funcdata = g_slist_append( funcdata, (gpointer)func );
|
|
|
|
funcdata = g_slist_append( funcdata, data );
|
|
|
|
}
|
|
|
|
g_signal_connect(dialog, "response", G_CALLBACK(onErrorResponse), funcdata);
|
2006-07-16 19:39:23 +00:00
|
|
|
g_free(msg);
|
|
|
|
|
|
|
|
return dialog;
|
|
|
|
}
|
|
|
|
|
2008-07-08 21:08:20 +00:00
|
|
|
void
|
|
|
|
addTorrentErrorDialog( GtkWidget * child, int err, const char * filename )
|
|
|
|
{
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * win;
|
|
|
|
const char * fmt;
|
|
|
|
char * secondary;
|
|
|
|
switch( err ) {
|
|
|
|
case TR_EINVALID: fmt = _( "The torrent file \"%s\" contains invalid data." ); break;
|
|
|
|
case TR_EDUPLICATE: fmt = _( "The torrent file \"%s\" is already in use." ); break;
|
|
|
|
default: fmt = _( "The torrent file \"%s\" encountered an unknown error." ); break;
|
|
|
|
}
|
|
|
|
secondary = g_strdup_printf( fmt, filename );
|
|
|
|
win = ( !child || GTK_IS_WINDOW( child ) )
|
|
|
|
? child
|
|
|
|
: gtk_widget_get_ancestor( child ? GTK_WIDGET( child ) : NULL, GTK_TYPE_WINDOW );
|
|
|
|
w = gtk_message_dialog_new( GTK_WINDOW( win ),
|
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
GTK_MESSAGE_ERROR,
|
|
|
|
GTK_BUTTONS_CLOSE,
|
|
|
|
_( "Error opening torrent" ) );
|
|
|
|
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( w ), secondary );
|
|
|
|
g_signal_connect_swapped( w, "response",
|
|
|
|
G_CALLBACK( gtk_widget_destroy ), w );
|
|
|
|
gtk_widget_show_all( w );
|
|
|
|
g_free( secondary );
|
|
|
|
}
|
|
|
|
|
2008-02-28 20:23:02 +00:00
|
|
|
void
|
|
|
|
errmsg( GtkWindow * wind, const char * format, ... )
|
|
|
|
{
|
|
|
|
GtkWidget * dialog;
|
|
|
|
va_list ap;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-02-28 20:23:02 +00:00
|
|
|
va_start( ap, format );
|
|
|
|
dialog = verrmsg_full( wind, NULL, NULL, format, ap );
|
|
|
|
va_end( ap );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2008-02-28 20:23:02 +00:00
|
|
|
if( NULL != wind && !GTK_WIDGET_MAPPED( GTK_WIDGET( wind ) ) )
|
|
|
|
{
|
|
|
|
g_signal_connect_swapped( wind, "map",
|
|
|
|
G_CALLBACK( gtk_widget_show ), dialog );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_show( dialog );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
errmsg_full( GtkWindow * wind, callbackfunc_t func, void * data,
|
|
|
|
const char * format, ... )
|
|
|
|
{
|
|
|
|
GtkWidget * dialog;
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start( ap, format );
|
|
|
|
dialog = verrmsg_full( wind, func, data, format, ap );
|
|
|
|
va_end( ap );
|
|
|
|
|
|
|
|
return dialog;
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2007-07-06 16:25:24 +00:00
|
|
|
typedef void (PopupFunc)(GtkWidget*, GdkEventButton*);
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
/* pop up the context menu if a user right-clicks.
|
|
|
|
if the row they right-click on isn't selected, select it. */
|
2007-07-06 16:25:24 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
gboolean
|
|
|
|
on_tree_view_button_pressed (GtkWidget * view,
|
|
|
|
GdkEventButton * event,
|
|
|
|
gpointer func)
|
|
|
|
{
|
|
|
|
GtkTreeView * tv = GTK_TREE_VIEW( view );
|
|
|
|
|
|
|
|
if (event->type == GDK_BUTTON_PRESS && event->button == 3)
|
|
|
|
{
|
|
|
|
GtkTreeSelection * selection = gtk_tree_view_get_selection(tv);
|
|
|
|
GtkTreePath *path;
|
|
|
|
if (gtk_tree_view_get_path_at_pos (tv,
|
|
|
|
(gint) event->x,
|
|
|
|
(gint) event->y,
|
|
|
|
&path, NULL, NULL, NULL))
|
|
|
|
{
|
|
|
|
if (!gtk_tree_selection_path_is_selected (selection, path))
|
|
|
|
{
|
|
|
|
gtk_tree_selection_unselect_all (selection);
|
|
|
|
gtk_tree_selection_select_path (selection, path);
|
|
|
|
}
|
|
|
|
gtk_tree_path_free(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
((PopupFunc*)func)(view, event);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-15 17:55:09 +00:00
|
|
|
gpointer
|
|
|
|
tr_object_ref_sink( gpointer object )
|
|
|
|
{
|
|
|
|
#if GLIB_CHECK_VERSION(2,10,0)
|
|
|
|
g_object_ref_sink( object );
|
|
|
|
#else
|
|
|
|
g_object_ref( object );
|
|
|
|
gtk_object_sink( GTK_OBJECT( object ) );
|
|
|
|
#endif
|
|
|
|
return object;
|
|
|
|
}
|
2008-03-09 15:27:08 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
tr_file_trash_or_unlink( const char * filename )
|
|
|
|
{
|
|
|
|
if( filename && *filename )
|
|
|
|
{
|
|
|
|
gboolean trashed = FALSE;
|
|
|
|
#ifdef HAVE_GIO
|
|
|
|
GError * err = NULL;
|
|
|
|
GFile * file = g_file_new_for_path( filename );
|
|
|
|
trashed = g_file_trash( file, NULL, &err );
|
|
|
|
g_object_unref( G_OBJECT( file ) );
|
|
|
|
#endif
|
|
|
|
if( !trashed )
|
|
|
|
g_unlink( filename );
|
|
|
|
}
|
|
|
|
}
|
2008-04-11 02:21:33 +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*
|
|
|
|
gtr_get_help_url( void )
|
|
|
|
{
|
|
|
|
const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx";
|
|
|
|
int major, minor;
|
|
|
|
sscanf( SHORT_VERSION_STRING, "%d.%d", &major, &minor );
|
|
|
|
return g_strdup_printf( fmt, major, minor/10 );
|
|
|
|
}
|
|
|
|
|
2008-04-11 02:21:33 +00:00
|
|
|
void
|
|
|
|
gtr_open_file( const char * path )
|
|
|
|
{
|
|
|
|
if( path )
|
|
|
|
{
|
|
|
|
gboolean opened = FALSE;
|
|
|
|
#ifdef HAVE_GIO
|
|
|
|
if( !opened )
|
|
|
|
{
|
|
|
|
GFile * file = g_file_new_for_path( path );
|
|
|
|
char * uri = g_file_get_uri( file );
|
|
|
|
opened = g_app_info_launch_default_for_uri( uri, NULL, NULL );
|
|
|
|
g_free( uri );
|
|
|
|
g_object_unref( G_OBJECT( file ) );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if( !opened )
|
|
|
|
{
|
|
|
|
char * argv[] = { "xdg-open", (char*)path, NULL };
|
|
|
|
g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
|
|
|
|
NULL, NULL, NULL, NULL );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-04-13 02:56:26 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
#define VALUE_SERVICE_NAME "com.transmissionbt.Transmission"
|
|
|
|
#define VALUE_SERVICE_OBJECT_PATH "/com/transmissionbt/Transmission"
|
|
|
|
#define VALUE_SERVICE_INTERFACE "com.transmissionbt.Transmission"
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gtr_dbus_add_torrent( const char * filename )
|
|
|
|
{
|
|
|
|
static gboolean success = FALSE;
|
|
|
|
#ifdef HAVE_DBUS_GLIB
|
|
|
|
DBusGProxy * proxy = NULL;
|
|
|
|
GError * err = NULL;
|
|
|
|
DBusGConnection * conn;
|
|
|
|
if(( conn = dbus_g_bus_get( DBUS_BUS_SESSION, &err )))
|
|
|
|
proxy = dbus_g_proxy_new_for_name (conn, VALUE_SERVICE_NAME,
|
|
|
|
VALUE_SERVICE_OBJECT_PATH,
|
|
|
|
VALUE_SERVICE_INTERFACE );
|
|
|
|
else if( err )
|
|
|
|
g_message( "err: %s", err->message );
|
|
|
|
if( proxy )
|
|
|
|
dbus_g_proxy_call( proxy, "AddFile", &err,
|
|
|
|
G_TYPE_STRING, filename,
|
|
|
|
G_TYPE_INVALID,
|
|
|
|
G_TYPE_BOOLEAN, &success,
|
|
|
|
G_TYPE_INVALID );
|
|
|
|
if( err )
|
|
|
|
g_message( "err: %s", err->message );
|
2008-08-14 10:58:37 +00:00
|
|
|
|
|
|
|
g_object_unref( proxy );
|
|
|
|
dbus_g_connection_unref( conn );
|
2008-05-18 16:44:30 +00:00
|
|
|
#endif
|
|
|
|
return success;
|
|
|
|
}
|
2008-06-01 15:46:20 +00:00
|
|
|
|
2008-08-17 12:39:26 +00:00
|
|
|
gboolean
|
|
|
|
gtr_dbus_present_window()
|
|
|
|
{
|
|
|
|
static gboolean success = FALSE;
|
|
|
|
#ifdef HAVE_DBUS_GLIB
|
|
|
|
DBusGProxy * proxy = NULL;
|
|
|
|
GError * err = NULL;
|
|
|
|
DBusGConnection * conn;
|
|
|
|
if(( conn = dbus_g_bus_get( DBUS_BUS_SESSION, &err )))
|
|
|
|
proxy = dbus_g_proxy_new_for_name (conn, VALUE_SERVICE_NAME,
|
|
|
|
VALUE_SERVICE_OBJECT_PATH,
|
|
|
|
VALUE_SERVICE_INTERFACE );
|
|
|
|
else if( err )
|
|
|
|
g_message( "err: %s", err->message );
|
|
|
|
if( proxy )
|
|
|
|
dbus_g_proxy_call( proxy, "PresentWindow", &err,
|
|
|
|
G_TYPE_INVALID,
|
|
|
|
G_TYPE_BOOLEAN, &success,
|
|
|
|
G_TYPE_INVALID );
|
|
|
|
if( err )
|
|
|
|
g_message( "err: %s", err->message );
|
|
|
|
|
|
|
|
g_object_unref( proxy );
|
|
|
|
dbus_g_connection_unref( conn );
|
|
|
|
#endif
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2008-06-01 15:46:20 +00:00
|
|
|
GtkWidget *
|
|
|
|
tr_button_new_from_stock( const char * stock,
|
|
|
|
const char * mnemonic )
|
|
|
|
{
|
|
|
|
GtkWidget * image = gtk_image_new_from_stock( stock, GTK_ICON_SIZE_BUTTON );
|
2008-06-02 15:07:26 +00:00
|
|
|
GtkWidget * button = gtk_button_new_with_mnemonic( mnemonic );
|
|
|
|
gtk_button_set_image( GTK_BUTTON( button ), image );
|
2008-06-01 15:46:20 +00:00
|
|
|
return button;
|
|
|
|
}
|