Changeset 6338


Ignore:
Timestamp:
Jul 16, 2008, 2:31:08 AM (14 years ago)
Author:
charles
Message:

(gtk) add "Launch Clutch" button to the web tab in the preferences dialog. that way users won't have to dig through documentation to find the "http://localhost:port/transmission/clutch" URL.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-prefs.c

    r6334 r6338  
    300300
    301301#ifdef HAVE_GIO
    302         s = _( "Automatically add torrents from:" );
     302        s = _( "Automatically _add torrents from:" );
    303303        l = new_check_button( s, PREF_KEY_DIR_WATCH_ENABLED, core );
    304304        w = new_path_chooser_button( PREF_KEY_DIR_WATCH, core );
     
    768768}
    769769
     770static void
     771onLaunchClutchCB( GtkButton * w UNUSED, gpointer data UNUSED )
     772{
     773    int port = pref_int_get( PREF_KEY_RPC_PORT );
     774    char * url = g_strdup_printf( "http://localhost:%d/transmission/web", port );
     775    gtr_open_file( url );
     776    g_free( url );
     777}
     778
    770779static GtkWidget*
    771780webPage( GObject * core )
     
    775784    GtkWidget * t;
    776785    GtkWidget * w;
     786    GtkWidget * h;
    777787    struct remote_page * page = g_new0( struct remote_page, 1 );
    778788
     
    785795
    786796        /* "enabled" checkbutton */
    787         s = _( "Allow remote access" );
     797        s = _( "_Allow remote access" );
    788798        w = new_check_button( s, PREF_KEY_RPC_ENABLED, core );
    789         hig_workarea_add_wide_control( t, &row, w );
    790799        page->rpc_tb = GTK_TOGGLE_BUTTON( w );
    791800        g_signal_connect( w, "clicked", G_CALLBACK(onRPCToggled), page );
     801        h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     802        gtk_box_pack_start_defaults( GTK_BOX(h), w );
     803        w = gtk_button_new_with_mnemonic( _( "_Launch Web GUI" ) );
     804        page->widgets = g_slist_append( page->widgets, w );
     805        g_signal_connect( w, "clicked", G_CALLBACK(onLaunchClutchCB), NULL );
     806        gtk_box_pack_start( GTK_BOX(h), w, FALSE, FALSE, 0 );
     807        hig_workarea_add_wide_control( t, &row, h );
    792808
    793809        /* require authentication */
    794         s = _( "Require _authentication" );
     810        s = _( "Require _username" );
    795811        w = new_check_button( s, PREF_KEY_RPC_AUTH_ENABLED, core );
    796812        hig_workarea_add_wide_control( t, &row, w );
  • trunk/libtransmission/platform.c

    r6334 r6338  
    591591
    592592        if( !*path )
     593        {
     594            tr_strlcpy( path, "/dev/null", sizeof( path ) );
    593595            tr_err( _( "Couldn't find the web interface's files!  To customize this, set the CLUTCH_HOME environmental variable to the folder where index.html is located." ) );
     596        }
    594597
    595598        s = tr_strdup( path );
Note: See TracChangeset for help on using the changeset viewer.