Changeset 6182


Ignore:
Timestamp:
Jun 13, 2008, 9:12:49 PM (13 years ago)
Author:
charles
Message:

(gtk) #963: "404 error for 1.2x help" backported to 1.2x

Location:
branches/1.2x/gtk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2x/gtk/main.c

    r6181 r6182  
    11901190    else if (!strcmp (action_name, "help"))
    11911191    {
    1192         gtr_open_file( "http://www.transmissionbt.com/help/gtk/"
    1193                        SHORT_VERSION_STRING );
     1192        char * url = gtr_get_help_url( );
     1193        gtr_open_file( url );
     1194        g_free( url );
    11941195    }
    11951196    else if (!strcmp (action_name, "toggle-main-window"))
  • branches/1.2x/gtk/tr-prefs.c

    r5782 r6182  
    104104response_cb( GtkDialog * dialog, int response, gpointer unused UNUSED )
    105105{
    106     if( response == GTK_RESPONSE_HELP )
    107         gtr_open_file( "http://www.transmissionbt.com/help/gtk/"
    108                        SHORT_VERSION_STRING "/html/preferences.html" );
     106    if( response == GTK_RESPONSE_HELP ) {
     107        char * base = gtr_get_help_url( );
     108        char * url = g_strdup_printf( "%s/html/preferences.html", base );
     109        gtr_open_file( url );
     110        g_free( url );
     111        g_free( base );
     112    }
    109113
    110114    if( response == GTK_RESPONSE_CLOSE )
  • branches/1.2x/gtk/util.c

    r5735 r6182  
    429429}
    430430
     431char*
     432gtr_get_help_url( void )
     433{
     434    const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx";
     435    int major, minor;
     436    sscanf( SHORT_VERSION_STRING, "%d.%d", &major, &minor );
     437    return g_strdup_printf( fmt, major, minor/10 );
     438}
     439
    431440void
    432441gtr_open_file( const char * path )
  • branches/1.2x/gtk/util.h

    r5662 r6182  
    9090void gtr_uninhibit_hibernation( guint );
    9191
     92char* gtr_get_help_url( void );
    9293#ifdef GTK_MAJOR_VERSION
    9394
Note: See TracChangeset for help on using the changeset viewer.