Changeset 11720


Ignore:
Timestamp:
Jan 20, 2011, 7:48:13 PM (12 years ago)
Author:
jordan
Message:

(trunk) #3926: use "Open Torrent" instead of "Add Torrent" in GTK+ and Qt clients -- text changed.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/actions.c

    r11709 r11720  
    108108    { "help-menu", NULL, N_( "_Help" ), NULL, NULL, NULL },
    109109    { "copy-magnet-link-to-clipboard",  GTK_STOCK_COPY, N_("Copy _Magnet Link to Clipboard" ), "<control>M", NULL,  G_CALLBACK( action_cb ) },
    110     { "add-torrent-from-url",  GTK_STOCK_ADD, N_("Add _URL..." ), NULL, N_( "Add URL..." ),  G_CALLBACK( action_cb ) },
    111     { "add-torrent-toolbar",  GTK_STOCK_ADD, NULL, NULL, N_( "Add a torrent" ),  G_CALLBACK( action_cb ) },
    112     { "add-torrent-menu", GTK_STOCK_ADD, N_( "_Add File..." ), "<control>D", N_( "Add a torrent" ), G_CALLBACK( action_cb ) },
     110    { "open-torrent-from-url",  GTK_STOCK_OPEN, N_("Open _URL..." ), "<control>U", N_( "Open URL..." ),  G_CALLBACK( action_cb ) },
     111    { "open-torrent-toolbar",  GTK_STOCK_OPEN, NULL, NULL, N_( "Open a torrent" ),  G_CALLBACK( action_cb ) },
     112    { "open-torrent-menu", GTK_STOCK_OPEN, NULL, NULL, N_( "Open a torrent" ), G_CALLBACK( action_cb ) },
    113113    { "start-torrent", GTK_STOCK_MEDIA_PLAY, N_( "_Start" ), "<control>S", N_( "Start torrent" ), G_CALLBACK( action_cb ) },
    114114    { "show-stats", NULL, N_( "_Statistics" ), NULL, NULL, G_CALLBACK( action_cb ) },
  • trunk/gtk/add-dialog.c

    r11709 r11720  
    8787****/
    8888
    89 struct AddData
     89struct OpenData
    9090{
    9191    TrCore *     core;
     
    101101
    102102static void
    103 removeOldTorrent( struct AddData * data )
     103removeOldTorrent( struct OpenData * data )
    104104{
    105105    if( data->gtor )
     
    117117               gpointer    gdata )
    118118{
    119     struct AddData * data = gdata;
     119    struct OpenData * data = gdata;
    120120
    121121    if( data->gtor )
     
    151151
    152152static void
    153 updateTorrent( struct AddData * o )
     153updateTorrent( struct OpenData * o )
    154154{
    155155    const gboolean isLocalFile = tr_ctorGetSourceFile( o->ctor ) != NULL;
     
    181181sourceChanged( GtkFileChooserButton * b, gpointer gdata )
    182182{
    183     struct AddData * data = gdata;
     183    struct OpenData * data = gdata;
    184184    char * filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) );
    185185
     
    222222downloadDirChanged( GtkFileChooserButton * b, gpointer gdata )
    223223{
    224     struct AddData * data = gdata;
     224    struct OpenData * data = gdata;
    225225    char * fname = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) );
    226226
     
    267267    GtkWidget *      grab;
    268268    GtkWidget *      source_chooser;
    269     struct AddData * data;
     269    struct OpenData * data;
    270270    uint8_t          flag;
    271271    GSList *         list;
     
    277277                                     NULL );
    278278    gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL );
    279     grab = gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT );
     279    grab = gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT );
    280280    gtk_dialog_set_default_response( GTK_DIALOG( d ),
    281281                                     GTK_RESPONSE_ACCEPT );
     
    289289    g_assert( str );
    290290
    291     data = g_new0( struct AddData, 1 );
     291    data = g_new0( struct OpenData, 1 );
    292292    data->core = core;
    293293    data->ctor = ctor;
     
    394394
    395395static void
    396 onAddDialogResponse( GtkDialog * dialog,
    397                      int         response,
    398                      gpointer    core )
     396onOpenDialogResponse( GtkDialog * dialog, int response, gpointer core )
    399397{
    400398    char * folder;
     
    422420
    423421GtkWidget*
    424 gtr_torrent_add_from_file_dialog_new( GtkWindow * parent, TrCore * core )
     422gtr_torrent_open_from_file_dialog_new( GtkWindow * parent, TrCore * core )
    425423{
    426424    GtkWidget *  w;
     
    428426    const char * folder;
    429427
    430     w = gtk_file_chooser_dialog_new( _( "Add a Torrent" ), parent,
     428    w = gtk_file_chooser_dialog_new( _( "Open a Torrent" ), parent,
    431429                                     GTK_FILE_CHOOSER_ACTION_OPEN,
    432430                                     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
    433                                      GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT,
     431                                     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
    434432                                     NULL );
    435433    gtk_dialog_set_alternative_button_order( GTK_DIALOG( w ),
     
    439437    gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( w ), TRUE );
    440438    addTorrentFilters( GTK_FILE_CHOOSER( w ) );
    441     g_signal_connect( w, "response", G_CALLBACK(
    442                           onAddDialogResponse ), core );
     439    g_signal_connect( w, "response", G_CALLBACK( onOpenDialogResponse ), core );
    443440
    444441    if( ( folder = gtr_pref_string_get( PREF_KEY_OPEN_DIALOG_FOLDER ) ) )
     
    459456
    460457static void
    461 onAddURLResponse( GtkDialog * dialog, int response, gpointer user_data )
     458onOpenURLResponse( GtkDialog * dialog, int response, gpointer user_data )
    462459{
    463460    gboolean destroy = TRUE;
     
    493490
    494491GtkWidget*
    495 gtr_torrent_add_from_url_dialog_new( GtkWindow * parent, TrCore * core )
     492gtr_torrent_open_from_url_dialog_new( GtkWindow * parent, TrCore * core )
    496493{
    497494    int row;
     
    500497    GtkWidget * w;
    501498
    502     w = gtk_dialog_new_with_buttons( _( "Add URL" ), parent,
     499    w = gtk_dialog_new_with_buttons( _( "Open URL" ), parent,
    503500                                     GTK_DIALOG_DESTROY_WITH_PARENT,
    504501                                     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
    505                                      GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT,
     502                                     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
    506503                                     NULL );
    507504    gtk_dialog_set_alternative_button_order( GTK_DIALOG( w ),
     
    509506                                             GTK_RESPONSE_CANCEL,
    510507                                             -1 );
    511     g_signal_connect( w, "response", G_CALLBACK( onAddURLResponse ), core );
     508    g_signal_connect( w, "response", G_CALLBACK( onOpenURLResponse ), core );
    512509
    513510    row = 0;
    514511    t = hig_workarea_create( );
    515     hig_workarea_add_section_title( t, &row, _( "Add torrent from URL" ) );
     512    hig_workarea_add_section_title( t, &row, _( "Open torrent from URL" ) );
    516513    e = gtk_entry_new( );
    517514    gtk_widget_set_size_request( e, 400, -1 );
  • trunk/gtk/add-dialog.h

    r11709 r11720  
    1111 */
    1212
    13 #ifndef GTR_ADD_DIALOG_H
    14 #define GTR_ADD_DIALOG_H
     13#ifndef GTR_OPEN_DIALOG_H
     14#define GTR_OPEN_DIALOG_H
    1515
    1616#include <gtk/gtk.h>
    1717#include "tr-core.h"
    1818
    19 GtkWidget* gtr_torrent_add_from_url_dialog_new ( GtkWindow * parent, TrCore * core );
    20 GtkWidget* gtr_torrent_add_from_file_dialog_new( GtkWindow * parent, TrCore * core );
     19GtkWidget* gtr_torrent_open_from_url_dialog_new ( GtkWindow * parent, TrCore * core );
     20GtkWidget* gtr_torrent_open_from_file_dialog_new( GtkWindow * parent, TrCore * core );
    2121
    2222/* This dialog assumes ownership of the ctor */
  • trunk/gtk/main.c

    r11709 r11720  
    17031703    gboolean        changed = FALSE;
    17041704
    1705     if( !strcmp( action_name, "add-torrent-from-url" ) )
    1706     {
    1707         GtkWidget * w = gtr_torrent_add_from_url_dialog_new( data->wind, data->core );
     1705    if( !strcmp( action_name, "open-torrent-from-url" ) )
     1706    {
     1707        GtkWidget * w = gtr_torrent_open_from_url_dialog_new( data->wind, data->core );
    17081708        gtk_widget_show( w );
    17091709    }
    1710     else if(  !strcmp( action_name, "add-torrent-menu" )
    1711       || !strcmp( action_name, "add-torrent-toolbar" ) )
    1712     {
    1713         GtkWidget * w = gtr_torrent_add_from_file_dialog_new( data->wind, data->core );
     1710    else if(  !strcmp( action_name, "open-torrent-menu" )
     1711      || !strcmp( action_name, "open-torrent-toolbar" ) )
     1712    {
     1713        GtkWidget * w = gtr_torrent_open_from_file_dialog_new( data->wind, data->core );
    17141714        gtk_widget_show( w );
    17151715    }
  • trunk/gtk/tr-window.c

    r11709 r11720  
    608608    /* toolbar */
    609609    toolbar = p->toolbar = gtr_action_get_widget( "/main-window-toolbar" );
    610     gtr_action_set_important( "add-torrent-toolbar", TRUE );
     610    gtr_action_set_important( "open-torrent-toolbar", TRUE );
    611611    gtr_action_set_important( "show-torrent-properties", TRUE );
    612612
  • trunk/gtk/ui.h

    r11197 r11720  
    33    "  <menubar name='main-window-menu'>\n"
    44    "    <menu action='file-menu'>\n"
    5     "      <menuitem action='add-torrent-menu'/>\n"
    6     "      <menuitem action='add-torrent-from-url'/>\n"
     5    "      <menuitem action='open-torrent-menu'/>\n"
     6    "      <menuitem action='open-torrent-from-url'/>\n"
    77    "      <menuitem action='new-torrent'/>\n"
    88    "      <separator/>\n"
     
    6363    "\n"
    6464    "  <toolbar name='main-window-toolbar'>\n"
    65     "    <toolitem action='add-torrent-toolbar'/>\n"
     65    "    <toolitem action='open-torrent-toolbar'/>\n"
    6666    "    <toolitem action='start-torrent'/>\n"
    6767    "    <toolitem action='pause-torrent'/>\n"
     
    103103    "    <menuitem action='toggle-main-window'/>\n"
    104104    "    <separator/>\n"
    105     "    <menuitem action='add-torrent-menu'/>\n"
    106     "    <menuitem action='add-torrent-from-url'/>\n"
     105    "    <menuitem action='open-torrent-menu'/>\n"
     106    "    <menuitem action='open-torrent-from-url'/>\n"
    107107    "    <separator/>\n"
    108108    "    <menuitem action='pause-all-torrents'/>\n"
  • trunk/qt/mainwin.cc

    r11263 r11720  
    105105
    106106    // icons
    107     ui.action_AddFile->setIcon( getStockIcon( "list-add", QStyle::SP_DialogOpenButton ) );
     107    ui.action_OpenFile->setIcon( getStockIcon( "folder-open", QStyle::SP_DialogOpenButton ) );
    108108    ui.action_New->setIcon( getStockIcon( "document-new", QStyle::SP_DesktopIcon ) );
    109109    ui.action_Properties->setIcon( getStockIcon( "document-properties", QStyle::SP_DesktopIcon ) );
     
    145145    connect( ui.action_StartAll, SIGNAL(triggered()), this, SLOT(startAll()));
    146146    connect( ui.action_PauseAll, SIGNAL(triggered()), this, SLOT(pauseAll()));
    147     connect( ui.action_AddFile, SIGNAL(triggered()), this, SLOT(openTorrent()));
     147    connect( ui.action_OpenFile, SIGNAL(triggered()), this, SLOT(openTorrent()));
    148148    connect( ui.action_AddURL, SIGNAL(triggered()), this, SLOT(openURL()));
    149149    connect( ui.action_New, SIGNAL(triggered()), this, SLOT(newTorrent()));
     
    215215
    216216    QMenu * menu = new QMenu( );
    217     menu->addAction( ui.action_AddFile );
     217    menu->addAction( ui.action_OpenFile );
    218218    menu->addAction( ui.action_AddURL );
    219219    menu->addSeparator( );
     
    10281028    QFileDialog * myFileDialog;
    10291029    myFileDialog = new QFileDialog( this,
    1030                                     tr( "Add Torrent" ),
     1030                                    tr( "Open Torrent" ),
    10311031                                    myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ),
    10321032                                    tr( "Torrent Files (*.torrent);;All Files (*.*)" ) );
  • trunk/qt/mainwin.ui

    r11196 r11720  
    127127     <string>&amp;File</string>
    128128    </property>
    129     <addaction name="action_AddFile"/>
     129    <addaction name="action_OpenFile"/>
    130130    <addaction name="action_AddURL"/>
    131131    <addaction name="action_New"/>
     
    170170    <bool>false</bool>
    171171   </attribute>
    172    <addaction name="action_AddFile"/>
     172   <addaction name="action_OpenFile"/>
    173173   <addaction name="action_Start"/>
    174174   <addaction name="action_Pause"/>
     
    177177   <addaction name="action_Properties"/>
    178178  </widget>
    179   <action name="action_AddFile">
    180    <property name="text">
    181     <string>&amp;Add File...</string>
     179  <action name="action_OpenFile">
     180   <property name="text">
     181    <string>&amp;Open...</string>
    182182   </property>
    183183   <property name="iconText">
    184     <string>Add</string>
    185    </property>
    186    <property name="toolTip">
    187     <string>Add a torrent</string>
     184    <string>Open</string>
     185   </property>
     186   <property name="toolTip">
     187    <string>Open a torrent</string>
    188188   </property>
    189189   <property name="shortcut">
     
    267267    <string>Verify local data</string>
    268268   </property>
     269   <property name="shortcut">
     270    <string>Ctrl+V</string>
     271   </property>
    269272  </action>
    270273  <action name="action_Remove">
     
    574577  <action name="action_AddURL">
    575578   <property name="text">
    576     <string>Add &amp;URL...</string>
     579    <string>Open &amp;URL...</string>
     580   </property>
     581   <property name="shortcut">
     582    <string>Ctrl+U</string>
    577583   </property>
    578584  </action>
  • trunk/qt/options.cc

    r11112 r11720  
    8888
    8989{
    90     setWindowTitle( tr( "Add Torrent" ) );
     90    setWindowTitle( tr( "Open Torrent" ) );
    9191    QFontMetrics fontMetrics( font( ) );
    9292    QGridLayout * layout = new QGridLayout( this );
     
    160160    layout->addWidget( c, ++row, 0, 1, 2, Qt::AlignLeft );
    161161
    162     QDialogButtonBox * b = new QDialogButtonBox( QDialogButtonBox::Ok|QDialogButtonBox::Cancel, Qt::Horizontal, this );
     162    QDialogButtonBox * b = new QDialogButtonBox( QDialogButtonBox::Open|QDialogButtonBox::Cancel, Qt::Horizontal, this );
    163163    connect( b, SIGNAL(rejected()), this, SLOT(deleteLater()) );
    164164    connect( b, SIGNAL(accepted()), this, SLOT(onAccepted()) );
     
    402402    {
    403403        QFileDialog * d = new QFileDialog( this,
    404                                            tr( "Add Torrent" ),
     404                                           tr( "Open Torrent" ),
    405405                                           QFileInfo(myAdd.filename).absolutePath(),
    406406                                           tr( "Torrent Files (*.torrent);;All Files (*.*)" ) );
  • trunk/qt/qtr.pro

    r11616 r11720  
    1717
    1818# if you have libevent2 installed in a custom path, specify it here
    19 EVENT_TOP = /usr
     19EVENT_TOP = /home/charles/opt/libevent
    2020INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH}
    2121
Note: See TracChangeset for help on using the changeset viewer.