diff --git a/cli/transmissioncli.c b/cli/transmissioncli.c index ca2e64f32..e18d83ada 100644 --- a/cli/transmissioncli.c +++ b/cli/transmissioncli.c @@ -99,8 +99,8 @@ int main( int argc, char ** argv ) tr_stat_t * s; tr_handle_status_t * hstat; - printf( "Transmission %s (%d) - http://transmission.m0k.org/\n\n", - VERSION_STRING, VERSION_REVISION ); + printf( "Transmission %s - http://transmission.m0k.org/\n\n", + LONG_VERSION_STRING ); /* Get options */ if( parseCommandLine( argc, argv ) ) diff --git a/daemon/client.c b/daemon/client.c index 9d21ccfb4..4d39ce00b 100644 --- a/daemon/client.c +++ b/daemon/client.c @@ -857,7 +857,7 @@ sendvers( struct con * con ) uint8_t * buf; size_t len; - buf = ipc_mkvers( &len, "Transmission remote" VERSION_STRING ); + buf = ipc_mkvers( &len, "Transmission remote" LONG_VERSION_STRING ); if( NULL == buf ) { if( EPERM == errno ) diff --git a/daemon/daemon.c b/daemon/daemon.c index b450e263e..40ea3b3d6 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -119,7 +119,7 @@ usage( const char * msg, ... ) printf( "usage: %s [-dfh]\n" "\n" - "Transmission %s (r%d) http://transmission.m0k.org/\n" + "Transmission %s http://transmission.m0k.org/\n" "A free, lightweight BitTorrent client with a simple, intuitive interface\n" "\n" " -d --debug Print data send and received, implies -f\n" @@ -128,7 +128,7 @@ usage( const char * msg, ... ) " -s --socket Place the socket file at \n" "\n" "To add torrents or set options, use the transmission-remote program.\n", - getmyname(), VERSION_STRING, VERSION_REVISION ); + getmyname(), LONG_VERSION_STRING ); exit( 0 ); } diff --git a/daemon/proxy.c b/daemon/proxy.c index ade518dc9..0cbf71e98 100644 --- a/daemon/proxy.c +++ b/daemon/proxy.c @@ -127,14 +127,14 @@ usage( const char * msg, ... ) printf( "usage: %s [options] [files]...\n" "\n" - "Transmission %s (r%d) http://transmission.m0k.org/\n" + "Transmission %s http://transmission.m0k.org/\n" "A free, lightweight BitTorrent client with a simple, intuitive interface.\n" "\n" " -h --help Display this message and exit\n" " -t --type daemon Use the daemon frontend, transmission-daemon\n" " -t --type gtk Use the GTK+ frontend, transmission-gtk\n" " -t --type mac Use the Mac OS X frontend\n", - getmyname(), VERSION_STRING, VERSION_REVISION ); + getmyname(), LONG_VERSION_STRING ); exit( EXIT_SUCCESS ); } diff --git a/daemon/remote.c b/daemon/remote.c index af242b0fb..3167b2780 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -224,7 +224,7 @@ usage( const char * msg, ... ) printf( "usage: %s [options]\n" "\n" - "Transmission %s (r%d) http://transmission.m0k.org/\n" + "Transmission %s http://transmission.m0k.org/\n" "A free, lightweight BitTorrent client with a simple, intuitive interface.\n" "\n" " -a --add Add a torrent\n" @@ -252,7 +252,7 @@ usage( const char * msg, ... ) " -u --upload-limit Max upload rate in KiB/s\n" " -U --upload-unlimited No upload rate limit\n" " -x --proxy Use proxy command to connect to frontend\n", - getmyname(), VERSION_STRING, VERSION_REVISION ); + getmyname(), LONG_VERSION_STRING ); exit( 0 ); } diff --git a/daemon/server.c b/daemon/server.c index bdaa7fe1c..79d288052 100644 --- a/daemon/server.c +++ b/daemon/server.c @@ -255,7 +255,7 @@ newclient( int fd, short event UNUSED, void * arg ) } bufferevent_enable( clev, EV_READ ); - buf = ipc_mkvers( &buflen, "Transmission daemon " VERSION_STRING ); + buf = ipc_mkvers( &buflen, "Transmission daemon " LONG_VERSION_STRING ); if( 0 > queuemsg( client, buf, buflen ) ) { free( buf ); diff --git a/gtk/ipc.c b/gtk/ipc.c index 4f6a999fd..150ffe982 100644 --- a/gtk/ipc.c +++ b/gtk/ipc.c @@ -340,7 +340,7 @@ client_connect(char *path, struct constate *con) { return FALSE; } - buf = ipc_mkvers( &size, "Transmission GTK+ " VERSION_STRING ); + buf = ipc_mkvers( &size, "Transmission GTK+ " LONG_VERSION_STRING ); if( NULL == buf ) { close( con->fd ); @@ -381,7 +381,7 @@ srv_io_accept(GSource *source SHUTUP, int fd, struct sockaddr *sa SHUTUP, return; } - buf = ipc_mkvers( &size, "Transmission GTK+ " VERSION_STRING ); + buf = ipc_mkvers( &size, "Transmission GTK+ " LONG_VERSION_STRING ); if( NULL == buf ) { ipc_freecon( newcon->ipc ); diff --git a/gtk/main.c b/gtk/main.c index 2a2928528..73f096bdf 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -298,7 +298,7 @@ readargs( int argc, char ** argv, gboolean * sendquit, gboolean * startpaused ) printf( _("usage: %s [-hpq] [files...]\n" "\n" - "Transmission %s (r%d) http://transmission.m0k.org/\n" + "Transmission %s http://transmission.m0k.org/\n" "A free, lightweight BitTorrent client with a simple, intuitive interface\n" "\n" " -h --help display this message and exit\n" @@ -309,7 +309,7 @@ _("usage: %s [-hpq] [files...]\n" "torrent files may be loaded at startup by adding them to the command\n" "line. If %s is already running, those torrents will be\n" "opened in the running instance.\n"), - name, VERSION_STRING, VERSION_REVISION, + name, LONG_VERSION_STRING, name, name, name ); exit(0); break; @@ -888,7 +888,6 @@ getselection( struct cbdata * cbdata ) static void about ( void ) { - char buf[128]; GtkWidget * w = gtk_about_dialog_new (); GtkAboutDialog * a = GTK_ABOUT_DIALOG (w); const char *authors[] = { "Eric Petit (Back-end; OS X)", @@ -897,8 +896,7 @@ about ( void ) "Charles Kerr (Back-end; GTK+)", "Bryan Varner (BeOS)", NULL }; - g_snprintf (buf, sizeof(buf), _("%s (%d)"), VERSION_STRING, VERSION_REVISION); - gtk_about_dialog_set_version (a, buf); + gtk_about_dialog_set_version (a, LONG_VERSION_STRING ); #ifdef SHOW_LICENSE gtk_about_dialog_set_license (a, LICENSE); gtk_about_dialog_set_wrap_license (a, TRUE); diff --git a/gtk/torrent-inspector.c b/gtk/torrent-inspector.c index 02fcb98d0..14fa848a5 100644 --- a/gtk/torrent-inspector.c +++ b/gtk/torrent-inspector.c @@ -1305,6 +1305,7 @@ file_page_new ( TrTorrent * gtor ) GtkWidget * view, * scroll; GtkCellRenderer * rend; GtkCellRenderer * priority_rend; + GtkCellRenderer * enabled_rend; GtkTreeViewColumn * col; GtkTreeSelection * sel; GtkTreeModel * model; @@ -1366,6 +1367,16 @@ file_page_new ( TrTorrent * gtor ) g_signal_connect( sel, "changed", G_CALLBACK(fileSelectionChangedCB), NULL ); fileSelectionChangedCB( sel, NULL ); + /* add "download" checkbox column */ + col = gtk_tree_view_column_new (); + gtk_tree_view_column_set_sort_column_id( col, FC_ENABLED ); + rend = enabled_rend = gtk_cell_renderer_toggle_new (); + col = gtk_tree_view_column_new_with_attributes (_("Download"), + rend, + "active", FC_ENABLED, + NULL); + gtk_tree_view_append_column( GTK_TREE_VIEW( view ), col ); + /* add priority column */ model = priority_model_new (); col = gtk_tree_view_column_new (); @@ -1382,16 +1393,6 @@ file_page_new ( TrTorrent * gtor ) gtk_tree_view_column_add_attribute (col, rend, "text", FC_PRIORITY); gtk_tree_view_append_column( GTK_TREE_VIEW( view ), col ); - /* download enabled column */ - col = gtk_tree_view_column_new (); - gtk_tree_view_column_set_sort_column_id( col, FC_ENABLED ); - rend = gtk_cell_renderer_toggle_new (); - col = gtk_tree_view_column_new_with_attributes (_("Enabled"), - rend, - "active", FC_ENABLED, - NULL); - gtk_tree_view_append_column( GTK_TREE_VIEW( view ), col ); - /* create the scrolled window and stick the view in it */ scroll = gtk_scrolled_window_new( NULL, NULL ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scroll ), @@ -1410,7 +1411,7 @@ file_page_new ( TrTorrent * gtor ) data->selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ); g_object_set_data_full (G_OBJECT(ret), "file-data", data, g_free); g_signal_connect (G_OBJECT(priority_rend), "edited", G_CALLBACK(priority_changed_cb), data); - g_signal_connect( rend, "toggled", G_CALLBACK(enabled_toggled), data ); + g_signal_connect(enabled_rend, "toggled", G_CALLBACK(enabled_toggled), data ); return ret; } diff --git a/libtransmission/http.c b/libtransmission/http.c index d909cc471..79132d639 100644 --- a/libtransmission/http.c +++ b/libtransmission/http.c @@ -451,9 +451,9 @@ tr_httpClient( int method, const char * host, int port, const char * fmt, ... ) if( tr_sprintf( EXPANDBUF( http->header ), " HTTP/1.1" CR LF "Host: %s:%d" CR LF - "User-Agent: %s/%d.%d%d" CR LF + "User-Agent: " TR_NAME "/" LONG_VERSION_STRING CR LF "Connection: close" CR LF, - http->host, http->port, TR_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_MAINTENANCE ) ) + http->host, http->port ) ) { goto err; } diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index 14ee3c92b..54a569b8d 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -357,7 +357,7 @@ static void tr_realMakeMetaInfo ( tr_metainfo_builder_t * builder ) tr_bencInitStrDup( val, builder->announce ); val = tr_bencDictAdd( &top, "created by" ); - tr_bencInitStrDup( val, TR_NAME " " VERSION_STRING ); + tr_bencInitStrDup( val, TR_NAME "/" LONG_VERSION_STRING ); val = tr_bencDictAdd( &top, "creation date" ); tr_bencInitInt( val, time(0) ); diff --git a/libtransmission/peeraz.h b/libtransmission/peeraz.h index 2b8d9acc5..b888f41be 100644 --- a/libtransmission/peeraz.h +++ b/libtransmission/peeraz.h @@ -133,7 +133,7 @@ makeAZHandshake( tr_torrent_t * tor, tr_peer_t * peer, int * buflen ) tr_bencInitStr( tr_bencDictAdd( &val, "identity" ), tor->azId, TR_AZ_ID_LEN, 1 ); tr_bencInitStr( tr_bencDictAdd( &val, "client" ), TR_NAME, 0, 1 ); - tr_bencInitStr( tr_bencDictAdd( &val, "version" ), VERSION_STRING, 0, 1 ); + tr_bencInitStr( tr_bencDictAdd( &val, "version" ), SHORT_VERSION_STRING, 0, 1 ); if( 0 < tor->publicPort ) { tr_bencInitInt( tr_bencDictAdd( &val, "tcp_port" ), tor->publicPort ); diff --git a/libtransmission/peerext.h b/libtransmission/peerext.h index 2c7dd5d73..66b325d44 100644 --- a/libtransmission/peerext.h +++ b/libtransmission/peerext.h @@ -120,21 +120,13 @@ static char * makeExtendedHandshake( tr_torrent_t * tor, tr_peer_t * peer, int * len ) { benc_val_t val, * msgsval; - char * buf, * vers; - - /* get human-readable version string */ - vers = NULL; - asprintf( &vers, "%s %s", TR_NAME, VERSION_STRING ); - if( NULL == vers ) - { - return NULL; - } + char * buf; + char * vers = tr_strdup( TR_NAME " " SHORT_VERSION_STRING ); /* reserve space in toplevel dictionary for v, m, and possibly p */ tr_bencInit( &val, TYPE_DICT ); if( tr_bencDictReserve( &val, ( 0 < tor->publicPort ? 3 : 2 ) ) ) { - free( vers ); tr_bencFree( &val ); return NULL; } diff --git a/libtransmission/transmission.c b/libtransmission/transmission.c index 42f7a68d9..69d3d04ed 100644 --- a/libtransmission/transmission.c +++ b/libtransmission/transmission.c @@ -56,8 +56,8 @@ tr_handle_t * tr_init( const char * tag ) /* Generate a peer id : "-TRxxyz-" + 12 random alphanumeric characters, where xx is the major version number, y is the minor version number, and z is the maintenance number (Azureus-style) */ - snprintf( h->id, sizeof h->id, "-TR%02d%01d%01d-", - VERSION_MAJOR, VERSION_MINOR, VERSION_MAINTENANCE ); + snprintf( h->id, sizeof h->id, "-TR" VERSION_MAJOR VERSION_MINOR VERSION_MAINTENANCE VERSION_BETA "-" ); + assert( strlen(h->id) == 8 ); for( i=8; ishared = tr_sharedInit( h ); - tr_inf( TR_NAME " " VERSION_STRING " started" ); + tr_inf( TR_NAME " " LONG_VERSION_STRING " started" ); return h; } diff --git a/mk/lib.mk b/mk/lib.mk index 8fe9dc40a..2cd6dda19 100644 --- a/mk/lib.mk +++ b/mk/lib.mk @@ -3,11 +3,11 @@ include ../mk/config.mk include ../mk/common.mk -SRCS = bencode.c choking.c clients.c completion.c fastresume.c fdlimit.c \ - http.c inout.c ipcparse.c list.c makemeta.c metainfo.c natpmp.c \ - net.c peer.c platform.c ratecontrol.c sha1.c shared.c strlcat.c \ - strlcpy.c torrent.c tracker.c transmission.c upnp.c utils.c xml.c \ - basename.c dirname.c +SRCS = basename.c bencode.c choking.c clients.c completion.c dirname.c \ + fastresume.c fdlimit.c http.c inout.c ipcparse.c list.c makemeta.c \ + metainfo.c natpmp.c net.c peer.c platform.c ratecontrol.c sha1.c \ + shared.c strlcat.c strlcpy.c torrent.c tracker.c transmission.c \ + upnp.c utils.c xml.c OBJS = $(SRCS:%.c=%.o) diff --git a/version.sh b/version.sh index 213cfb763..76636111a 100755 --- a/version.sh +++ b/version.sh @@ -2,9 +2,12 @@ # # $Id$ -MAJOR=0 -MINOR=7 -MAINT=2 +# constraint: strlen(MAJOR MINOR MAINT BETA) must be 4 +# convention: BETA: "Z" for a beta, "0" for a stable +MAJOR="0" +MINOR="7" +MAINT="2" +BETA="Z" STRING=0.80-svn # Get current SVN revision from Ids in all source files @@ -30,21 +33,23 @@ replace_if_differs () # Generate version.mk cat > mk/version.mk.new << EOF -VERSION_MAJOR = $MAJOR -VERSION_MINOR = $MINOR -VERSION_MAINTENANCE = $MAINT -VERSION_STRING = $STRING -VERSION_REVISION = $REV +VERSION_MAJOR = "$MAJOR" +VERSION_MINOR = "$MINOR" +VERSION_MAINTENANCE = "$MAINT" +VERSION_REVISION = "$REV" +VERSION_STRING = "$MAJOR.$MINOR$MAINT$BETA (r$REV)" EOF replace_if_differs mk/version.mk.new mk/version.mk # Generate version.h cat > libtransmission/version.h.new << EOF -#define VERSION_MAJOR $MAJOR -#define VERSION_MINOR $MINOR -#define VERSION_MAINTENANCE $MAINT -#define VERSION_STRING "$STRING" -#define VERSION_REVISION $REV +#define VERSION_MAJOR "$MAJOR" +#define VERSION_MINOR "$MINOR" +#define VERSION_MAINTENANCE "$MAINT" +#define VERSION_REVISION "$REV" +#define VERSION_BETA "$BETA" +#define SHORT_VERSION_STRING "$MAJOR.$MINOR$MAINT$BETA" +#define LONG_VERSION_STRING "$MAJOR.$MINOR$MAINT$BETA (r$REV)" EOF replace_if_differs libtransmission/version.h.new libtransmission/version.h