Changeset 2439


Ignore:
Timestamp:
Jul 20, 2007, 2:12:07 AM (16 years ago)
Author:
charles
Message:

portability for wx 2.6 and for both unicode and ascii builds of wxWidgets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wx/xmission.cc

    r2437 r2439  
    1414#include <vector>
    1515#include <iostream>
    16 #include <wx/aboutdlg.h>
    1716#include <wx/artprov.h>
    1817#include <wx/defs.h>
     
    2221#include <wx/notebook.h>
    2322#include <wx/wx.h>
     23#if wxCHECK_VERSION(2,8,0)
     24#include <wx/aboutdlg.h>
     25#endif
    2426extern "C" {
    2527  #include <libtransmission/transmission.h>
     
    139141    };
    140142
    141     int getTorrentColumn( const wxString& wxKey )
     143    int getTorrentColumn( const wxString& key )
    142144    {
    143         const std::string key ( wxKey.c_str() );
    144         typedef std::map<std::string,int> string2key_t;
     145        typedef std::map<wxString,int> string2key_t;
    145146        static string2key_t columns;
    146147
    147148        if( columns.empty() )
    148149        {
    149             columns["#"]         = COL_NUMBER;
    150             columns["done"]      = COL_DONE;
    151             columns["dspeed"]    = COL_DOWNLOAD_SPEED;
    152             columns["eta"]       = COL_ETA;
    153             columns["hash"]      = COL_HASH;
    154             columns["name"]      = COL_NAME;
    155             columns["peers"]     = COL_PEERS;
    156             columns["ratio"]     = COL_RATIO;
    157             columns["received"]  = COL_RECEIVED;
    158             columns["remaining"] = COL_REMAINING;
    159             columns["seeds"]     = COL_SEEDS;
    160             columns["sent"]      = COL_SEND;
    161             columns["size"]      = COL_SIZE;
    162             columns["state"]     = COL_STATE;
    163             columns["status"]    = COL_STATUS;
    164             columns["total"]     = COL_TOTAL;
    165             columns["uspeed"]    = COL_UPLOAD_SPEED;
     150            columns[_T("#")]         = COL_NUMBER;
     151            columns[_T("done")]      = COL_DONE;
     152            columns[_T("dspeed")]    = COL_DOWNLOAD_SPEED;
     153            columns[_T("eta")]       = COL_ETA;
     154            columns[_T("hash")]      = COL_HASH;
     155            columns[_T("name")]      = COL_NAME;
     156            columns[_T("peers")]     = COL_PEERS;
     157            columns[_T("ratio")]     = COL_RATIO;
     158            columns[_T("received")]  = COL_RECEIVED;
     159            columns[_T("remaining")] = COL_REMAINING;
     160            columns[_T("seeds")]     = COL_SEEDS;
     161            columns[_T("sent")]      = COL_SEND;
     162            columns[_T("size")]      = COL_SIZE;
     163            columns[_T("state")]     = COL_STATE;
     164            columns[_T("status")]    = COL_STATUS;
     165            columns[_T("total")]     = COL_TOTAL;
     166            columns[_T("uspeed")]    = COL_UPLOAD_SPEED;
    166167        }
    167168
     
    379380    ico.CopyFromBitmap( wxBitmap( transmission_logo ) );
    380381
     382#if wxCHECK_VERSION(2,8,0)
    381383    wxAboutDialogInfo info;
    382384    info.SetName(_T("Xmission"));
     
    392394    info.AddDeveloper( "Bryan Varner (BeOS)" );
    393395    wxAboutBox( info );
    394 }
     396#else
     397    wxMessageBox(_T("Xmission " LONG_VERSION_STRING "\n"
     398                    "Copyright 2005-2007 The Transmission Project"),
     399                 _T("About Xmission"),
     400                wxOK|wxICON_INFORMATION, this);
     401#endif
     402
     403}
Note: See TracChangeset for help on using the changeset viewer.