From: <arn...@us...> - 2008-01-22 22:48:03
|
Revision: 973 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=973&view=rev Author: arnetheduck Date: 2008-01-22 14:47:59 -0800 (Tue, 22 Jan 2008) Log Message: ----------- win32 translations done, use boost intrusive_ptr Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/Pointer.h dcplusplus/trunk/dcpp/User.h dcplusplus/trunk/dcpp/forward.h dcplusplus/trunk/win32/DirectoryListingFrame.cpp dcplusplus/trunk/win32/FinishedFrameBase.h dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/PrivateFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.cpp dcplusplus/trunk/win32/QueueFrame.cpp dcplusplus/trunk/win32/SearchFrame.cpp dcplusplus/trunk/win32/SpyFrame.cpp dcplusplus/trunk/win32/SpyFrame.h dcplusplus/trunk/win32/StaticFrame.h dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/UserInfoBase.h dcplusplus/trunk/win32/WaitingUsersFrame.cpp dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/stdafx.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/changelog.txt 2008-01-22 22:47:59 UTC (rev 973) @@ -12,8 +12,8 @@ * Chat timestamps on by default * Added tab drag/drop (thanks poy) * Changed Pothead to mikejj +* Fixed search spy crash - -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) * Use system header arrows on common controls 6+ (thanks poy) Modified: dcplusplus/trunk/dcpp/Pointer.h =================================================================== --- dcplusplus/trunk/dcpp/Pointer.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/dcpp/Pointer.h 2008-01-22 22:47:59 UTC (rev 973) @@ -16,14 +16,15 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(DCPLUSPLUS_DCPP_POINTER_H) +#ifndef DCPLUSPLUS_DCPP_POINTER_H #define DCPLUSPLUS_DCPP_POINTER_H +#include <boost/intrusive_ptr.hpp> #include "Thread.h" namespace dcpp { -class PointerBase +class intrusive_ptr_base { public: void inc() throw() { @@ -44,9 +45,9 @@ } protected: - PointerBase() throw() : ref(0) { } + intrusive_ptr_base() throw() : ref(0) { } - virtual ~PointerBase() throw() { + virtual ~intrusive_ptr_base() throw() { dcassert(!ref); } @@ -54,107 +55,9 @@ volatile long ref; }; -/** - * Note; don't forget to make the destructor virtual if deriving from this class - */ -template <class T> -class Pointer -{ -public: - Pointer ( PointerBase *aBase = 0) throw() : base(aBase) { - if ( base ) { - base->inc(); - } - } +inline void intrusive_ptr_add_ref(intrusive_ptr_base* p) { p->inc(); } +inline void intrusive_ptr_release(intrusive_ptr_base* p) { p->dec(); } - Pointer( const Pointer &rhs ) throw() : base(rhs.base) { - if ( base ) { - base->inc(); - } - } - - Pointer &operator =( const Pointer &rhs ) throw() { - if ( rhs.base ) { - rhs.base->inc(); - } - - if ( base ) { - base->dec(); - } - - base = rhs.base; - return *this; - } - - Pointer &operator =( T* rhs ) throw() { - if (rhs) { - rhs->inc(); - if ( base ) { - base->dec(); - } - base = rhs; - } - - - return *this; - } - - ~Pointer() throw() { - if ( base ) { - base->dec(); - } - } - - T* operator->() { return asT(); } - T& operator* () { return *asT(); } - const T* operator->() const { return asT(); } - const T& operator* () const { return *asT(); } - - operator bool() const { return base != NULL; } - - bool operator==(T* rhs) const { return (T*)base == rhs; } - bool operator==(const Pointer& rhs) const { return base == rhs.base; } - bool operator!=(T* rhs) const { return (T*)base != rhs; } - bool operator!=(const Pointer& rhs) const { return base != rhs.base; } - bool operator<(T* rhs) const { return (T*)base < rhs; } - bool operator<(const Pointer& rhs) const { return base < rhs.base; } - bool operator>(T* rhs) const { return (T*)base > rhs; } - bool operator>(const Pointer& rhs) const { return base > rhs.base; } - - - static void swap ( Pointer &lhs, Pointer &rhs ) { - PointerBase *temp = lhs.base; - lhs.base = rhs.base; - rhs.base = temp; - } - - void release() { - if ( base ) { - base->dec(); - base = 0; - } - } -private: - PointerBase* base; - - T* asT () { - dcassert(base); - return (T*)base; - } - - const T* asT() const { - dcassert(base); - return (T*)base; - } -}; - -template <class T> -bool operator==(T* lhs, const Pointer<T>& rhs) { return rhs == lhs; } -template <class T> -bool operator<(T* lhs, const Pointer<T>& rhs) { return rhs > lhs; } -template <class T> -bool operator>(T* lhs, const Pointer<T>& rhs) { return rhs < lhs; } - struct DeleteFunction { template<typename T> void operator()(const T& p) const { delete p; } Modified: dcplusplus/trunk/dcpp/User.h =================================================================== --- dcplusplus/trunk/dcpp/User.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/dcpp/User.h 2008-01-22 22:47:59 UTC (rev 973) @@ -30,7 +30,7 @@ namespace dcpp { /** A user connected to one or more hubs. */ -class User : public FastAlloc<User>, public PointerBase, public Flags +class User : public FastAlloc<User>, public intrusive_ptr_base, public Flags { public: enum Bits { Modified: dcplusplus/trunk/dcpp/forward.h =================================================================== --- dcplusplus/trunk/dcpp/forward.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/dcpp/forward.h 2008-01-22 22:47:59 UTC (rev 973) @@ -86,7 +86,7 @@ typedef std::vector<UploadPtr> UploadList; class User; -typedef Pointer<User> UserPtr; +typedef boost::intrusive_ptr<User> UserPtr; typedef std::vector<UserPtr> UserList; class UserCommand; Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -308,11 +308,11 @@ DirectoryListingFrame::WidgetMenuPtr DirectoryListingFrame::makeSingleMenu(ItemInfo* ii) { WidgetMenuPtr menu = createMenu(true); - menu->appendItem(IDC_DOWNLOAD, T_("Download"), std::tr1::bind(&DirectoryListingFrame::handleDownload, this)); + menu->appendItem(IDC_DOWNLOAD, T_("&Download"), std::tr1::bind(&DirectoryListingFrame::handleDownload, this)); addTargets(menu, ii); if(ii->type == ItemInfo::FILE) { - menu->appendItem(IDC_VIEW_AS_TEXT, T_("View as text"), std::tr1::bind(&DirectoryListingFrame::handleViewAsText, this)); + menu->appendItem(IDC_VIEW_AS_TEXT, T_("&View as text"), std::tr1::bind(&DirectoryListingFrame::handleViewAsText, this)); menu->appendSeparatorItem(); @@ -322,7 +322,7 @@ if((ii->type == ItemInfo::FILE && ii->file->getAdls()) || (ii->type == ItemInfo::DIRECTORY && ii->dir->getAdls() && ii->dir->getParent() != dl->getRoot()) ) { menu->appendSeparatorItem(); - menu->appendItem(IDC_GO_TO_DIRECTORY, T_("Go to directory"), std::tr1::bind(&DirectoryListingFrame::handleGoToDirectory, this)); + menu->appendItem(IDC_GO_TO_DIRECTORY, T_("&Go to directory"), std::tr1::bind(&DirectoryListingFrame::handleGoToDirectory, this)); } addUserCommands(menu); @@ -333,7 +333,7 @@ DirectoryListingFrame::WidgetMenuPtr DirectoryListingFrame::makeMultiMenu() { WidgetMenuPtr menu = createMenu(true); - menu->appendItem(IDC_DOWNLOAD, T_("Download"), std::tr1::bind(&DirectoryListingFrame::handleDownload, this)); + menu->appendItem(IDC_DOWNLOAD, T_("&Download"), std::tr1::bind(&DirectoryListingFrame::handleDownload, this)); addTargets(menu); addUserCommands(menu); @@ -345,7 +345,7 @@ DirectoryListingFrame::WidgetMenuPtr DirectoryListingFrame::makeDirMenu() { WidgetMenuPtr menu = createMenu(true); - menu->appendItem(IDC_DOWNLOAD, T_("Download"), std::tr1::bind(&DirectoryListingFrame::handleDownload, this)); + menu->appendItem(IDC_DOWNLOAD, T_("&Download"), std::tr1::bind(&DirectoryListingFrame::handleDownload, this)); addTargets(menu); return menu; } @@ -355,7 +355,7 @@ } void DirectoryListingFrame::addTargets(const WidgetMenuPtr& parent, ItemInfo* ii) { - WidgetMenuPtr menu = parent->appendPopup(T_("Download to...")); + WidgetMenuPtr menu = parent->appendPopup(T_("Download &to...")); StringPairList spl = FavoriteManager::getInstance()->getFavoriteDirs(); size_t i = 0; for(; i < spl.size(); ++i) { @@ -366,7 +366,7 @@ menu->appendSeparatorItem(); } - menu->appendItem(IDC_DOWNLOAD_BROWSE, T_("Browse..."), std::tr1::bind(&DirectoryListingFrame::handleDownloadBrowse, this)); + menu->appendItem(IDC_DOWNLOAD_BROWSE, T_("&Browse..."), std::tr1::bind(&DirectoryListingFrame::handleDownloadBrowse, this)); targets.clear(); Modified: dcplusplus/trunk/win32/FinishedFrameBase.h =================================================================== --- dcplusplus/trunk/win32/FinishedFrameBase.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/FinishedFrameBase.h 2008-01-22 22:47:59 UTC (rev 973) @@ -61,7 +61,7 @@ items->setListViewStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT); addWidget(items); - items->createColumns(ResourceManager::getInstance()->getStrings(columnNames)); + items->createColumns(WinUtil::getStrings(columnNames)); items->setColumnOrder(WinUtil::splitTokens(SettingsManager::getInstance()->get(in_UL ? SettingsManager::FINISHED_UL_ORDER : SettingsManager::FINISHED_ORDER), columnIndexes)); items->setColumnWidths(WinUtil::splitTokens(SettingsManager::getInstance()->get(in_UL ? SettingsManager::FINISHED_UL_WIDTHS : SettingsManager::FINISHED_WIDTHS), columnSizes)); items->setSort(COLUMN_DONE); @@ -128,7 +128,7 @@ static int columnSizes[COLUMN_LAST]; static int columnIndexes[COLUMN_LAST]; - static ResourceManager::Strings columnNames[COLUMN_LAST]; + static const char* columnNames[COLUMN_LAST]; class ItemInfo : public FastAlloc<ItemInfo> { public: @@ -220,12 +220,12 @@ shellMenu.SetPath(Text::utf8ToWide(path)); typename T::WidgetMenuPtr pShellMenu = this->createMenu(true); - pShellMenu->appendItem(IDC_VIEW_AS_TEXT, T_("View as text"), std::tr1::bind(&ThisType::handleViewAsText, this)); - pShellMenu->appendItem(IDC_OPEN_FILE, T_("Open"), std::tr1::bind(&ThisType::handleOpenFile, this)); - pShellMenu->appendItem(IDC_OPEN_FOLDER, T_("Open folder"), std::tr1::bind(&ThisType::handleOpenFolder, this)); + pShellMenu->appendItem(IDC_VIEW_AS_TEXT, T_("&View as text"), std::tr1::bind(&ThisType::handleViewAsText, this)); + pShellMenu->appendItem(IDC_OPEN_FILE, T_("&Open"), std::tr1::bind(&ThisType::handleOpenFile, this)); + pShellMenu->appendItem(IDC_OPEN_FOLDER, T_("Open &folder"), std::tr1::bind(&ThisType::handleOpenFolder, this)); pShellMenu->appendSeparatorItem(); - pShellMenu->appendItem(IDC_REMOVE, TSTRING(REMOVE), std::tr1::bind(&ThisType::handleRemove, this)); - pShellMenu->appendItem(IDC_REMOVE_ALL, T_("Remove all"), std::tr1::bind(&ThisType::handleRemoveAll, this)); + pShellMenu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&ThisType::handleRemove, this)); + pShellMenu->appendItem(IDC_REMOVE_ALL, T_("Remove &all"), std::tr1::bind(&ThisType::handleRemoveAll, this)); pShellMenu->appendSeparatorItem(); UINT idCommand = shellMenu.ShowContextMenu(pShellMenu, static_cast<T*>(this), pt); @@ -236,12 +236,12 @@ } typename T::WidgetMenuPtr contextMenu = this->createMenu(true); - contextMenu->appendItem(IDC_VIEW_AS_TEXT, T_("View as text"), std::tr1::bind(&ThisType::handleViewAsText, this)); - contextMenu->appendItem(IDC_OPEN_FILE, T_("Open"), std::tr1::bind(&ThisType::handleOpenFile, this)); - contextMenu->appendItem(IDC_OPEN_FOLDER, T_("Open folder"), std::tr1::bind(&ThisType::handleOpenFolder, this)); + contextMenu->appendItem(IDC_VIEW_AS_TEXT, T_("&View as text"), std::tr1::bind(&ThisType::handleViewAsText, this)); + contextMenu->appendItem(IDC_OPEN_FILE, T_("&Open"), std::tr1::bind(&ThisType::handleOpenFile, this)); + contextMenu->appendItem(IDC_OPEN_FOLDER, T_("Open &folder"), std::tr1::bind(&ThisType::handleOpenFolder, this)); contextMenu->appendSeparatorItem(); - contextMenu->appendItem(IDC_REMOVE, TSTRING(REMOVE), std::tr1::bind(&ThisType::handleRemove, this)); - contextMenu->appendItem(IDC_REMOVE_ALL, T_("Remove all"), std::tr1::bind(&ThisType::handleRemoveAll, this)); + contextMenu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&ThisType::handleRemove, this)); + contextMenu->appendItem(IDC_REMOVE_ALL, T_("Remove &all"), std::tr1::bind(&ThisType::handleRemoveAll, this)); contextMenu->setDefaultItem(IDC_OPEN_FILE); contextMenu->trackPopupMenu(static_cast<T*>(this), pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; @@ -330,8 +330,15 @@ int FinishedFrameBase<T, in_UL>::columnSizes[] = { 100, 110, 290, 125, 80, 80, 80, 90 }; template <class T, bool in_UL> -ResourceManager::Strings FinishedFrameBase<T, in_UL>::columnNames[] = { ResourceManager::FILENAME, ResourceManager::TIME, ResourceManager::PATH, -ResourceManager::NICK, ResourceManager::HUB, ResourceManager::SIZE, ResourceManager::SPEED, ResourceManager::CRC_CHECKED +const char* FinishedFrameBase<T, in_UL>::columnNames[] = { + N_("Filename"), + N_("Time"), + N_("Path"), + N_("Nick"), + N_("Hub"), + N_("Size"), + N_("Speed"), + N_("CRC Checked") }; #endif // !defined(DCPLUSPLUS_WIN32_FINISHED_FRAME_BASE_H) Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/HubFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -27,7 +27,6 @@ #include <dcpp/Client.h> #include <dcpp/LogManager.h> #include <dcpp/User.h> -#include <dcpp/ResourceManager.h> #include <dcpp/FavoriteManager.h> #include <dcpp/ConnectionManager.h> #include <dcpp/SearchManager.h> @@ -824,7 +823,7 @@ } void HubFrame::on(Connecting, Client*) throw() { - speak(ADD_STATUS_LINE, STRING(CONNECTING_TO) + client->getHubUrl() + "..."); + speak(ADD_STATUS_LINE, str(F_("Connecting to %1%...") % client->getHubUrl())); speak(SET_WINDOW_TITLE, client->getHubUrl()); } void HubFrame::on(Connected, Client*) throw() { @@ -846,14 +845,14 @@ void HubFrame::on(Redirect, Client*, const string& line) throw() { if(ClientManager::getInstance()->isConnected(line)) { - speak(ADD_STATUS_LINE, STRING(REDIRECT_ALREADY_CONNECTED)); + speak(ADD_STATUS_LINE, _("Redirect request received to a hub that's already connected")); return; } redirect = line; if(BOOLSETTING(AUTO_FOLLOW)) { speak(FOLLOW); } else { - speak(ADD_STATUS_LINE, STRING(PRESS_FOLLOW) + line); + speak(ADD_STATUS_LINE, str(F_("Press the follow redirect button to connect to %1%") % line)); } } @@ -908,7 +907,7 @@ } void HubFrame::on(SearchFlood, Client*, const string& line) throw() { - speak(ADD_STATUS_LINE, STRING(SEARCH_SPAM_FROM) + line); + speak(ADD_STATUS_LINE, str(F_("Search spam detected from %1%") % line)); } tstring HubFrame::getStatusShared() const { @@ -1158,7 +1157,7 @@ WidgetMenuPtr menu = createMenu(true); appendUserItems(getParent(), menu); - menu->appendItem(IDC_COPY_NICK, T_("Copy nick to clipboard"), std::tr1::bind(&HubFrame::handleCopyNick, this)); + menu->appendItem(IDC_COPY_NICK, T_("Copy &nick to clipboard"), std::tr1::bind(&HubFrame::handleCopyNick, this)); menu->setDefaultItem(IDC_GETLIST); prepareMenu(menu, UserCommand::CONTEXT_CHAT, client->getHubUrl()); @@ -1174,15 +1173,15 @@ WidgetMenuPtr menu = createMenu(true); if(!FavoriteManager::getInstance()->isFavoriteHub(url)) { - menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To Favorites"), std::tr1::bind(&HubFrame::addAsFavorite, this)); + menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&HubFrame::addAsFavorite, this)); } - menu->appendItem(IDC_RECONNECT, TSTRING(MENU_RECONNECT), std::tr1::bind(&HubFrame::handleReconnect, this)); - menu->appendItem(IDC_COPY_HUB, T_("Copy address to clipboard"), std::tr1::bind(&HubFrame::handleCopyHub, this)); + menu->appendItem(IDC_RECONNECT, T_("&Reconnect\tCtrl+R"), std::tr1::bind(&HubFrame::handleReconnect, this)); + menu->appendItem(IDC_COPY_HUB, T_("Copy &address to clipboard"), std::tr1::bind(&HubFrame::handleCopyHub, this)); prepareMenu(menu, UserCommand::CONTEXT_HUB, url); menu->appendSeparatorItem(); - menu->appendItem(IDC_CLOSE_WINDOW, T_("Close"), std::tr1::bind(&HubFrame::close, this, true)); + menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&HubFrame::close, this, true)); inTabMenu = true; Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2008-01-22 22:47:59 UTC (rev 973) @@ -187,7 +187,7 @@ bool handleContextMenu(const SmartWin::ScreenCoordinate& pt) { SmartWin::WidgetMenu::ObjectType menu = SmartWin::WidgetCreator<SmartWin::WidgetMenu>::create(SmartWin::WidgetMenu::Seed(true)); - menu->appendItem(IDC_CLOSE_WINDOW, T_("Close"), std::tr1::bind(&ThisType::close, this, true)); + menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&ThisType::close, this, true)); menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -267,31 +267,31 @@ } int image = 0; - toolbar->appendItem(IDC_PUBLIC_HUBS, image++, TSTRING(PUBLIC_HUBS)); - toolbar->appendItem(IDC_RECONNECT, image++, TSTRING(MENU_RECONNECT)); - toolbar->appendItem(IDC_FOLLOW, image++, TSTRING(MENU_FOLLOW_REDIRECT)); + toolbar->appendItem(IDC_PUBLIC_HUBS, image++, T_("Public Hubs")); + toolbar->appendItem(IDC_RECONNECT, image++, T_("Reconnect")); + toolbar->appendItem(IDC_FOLLOW, image++, T_("Follow last redirect")); toolbar->appendSeparator(); - toolbar->appendItem(IDC_FAVORITE_HUBS, image++, TSTRING(FAVORITE_HUBS)); - toolbar->appendItem(IDC_FAVUSERS, image++, TSTRING(FAVORITE_USERS)); + toolbar->appendItem(IDC_FAVORITE_HUBS, image++, T_("Favorite Hubs")); + toolbar->appendItem(IDC_FAVUSERS, image++, T_("Favorite Users")); toolbar->appendSeparator(); - toolbar->appendItem(IDC_QUEUE, image++, TSTRING(DOWNLOAD_QUEUE)); - toolbar->appendItem(IDC_FINISHED_DL, image++, TSTRING(FINISHED_DOWNLOADS)); - toolbar->appendItem(IDC_WAITING_USERS, image++, TSTRING(WAITING_USERS)); - toolbar->appendItem(IDC_FINISHED_UL, image++, TSTRING(FINISHED_UPLOADS)); + toolbar->appendItem(IDC_QUEUE, image++, T_("Download Queue")); + toolbar->appendItem(IDC_FINISHED_DL, image++, T_("Finished Downloads")); + toolbar->appendItem(IDC_WAITING_USERS, image++, T_("Waiting Users")); + toolbar->appendItem(IDC_FINISHED_UL, image++, T_("Finished Uploads")); toolbar->appendSeparator(); - toolbar->appendItem(IDC_SEARCH, image++, TSTRING(SEARCH)); - toolbar->appendItem(IDC_ADL_SEARCH, image++, TSTRING(ADL_SEARCH)); - toolbar->appendItem(IDC_SEARCH_SPY, image++, TSTRING(SEARCH_SPY)); + toolbar->appendItem(IDC_SEARCH, image++, T_("Search")); + toolbar->appendItem(IDC_ADL_SEARCH, image++, T_("ADL Search")); + toolbar->appendItem(IDC_SEARCH_SPY, image++, T_("Search Spy")); toolbar->appendSeparator(); - toolbar->appendItem(IDC_OPEN_FILE_LIST, image++, TSTRING(MENU_OPEN_FILE_LIST)); - toolbar->appendItem(IDC_SETTINGS, image++, TSTRING(SETTINGS)); - toolbar->appendItem(IDC_NOTEPAD, image++, TSTRING(NOTEPAD)); + toolbar->appendItem(IDC_OPEN_FILE_LIST, image++, T_("Open file list...")); + toolbar->appendItem(IDC_SETTINGS, image++, T_("Settings")); + toolbar->appendItem(IDC_NOTEPAD, image++, T_("Notepad")); } void MainWindow::initStatusBar() { dcdebug("initStatusBar\n"); initStatus(true); - statusSizes[STATUS_AWAY] = status->getTextSize(TSTRING(AWAY)).x + 12; + statusSizes[STATUS_AWAY] = status->getTextSize(T_("AWAY")).x + 12; ///@todo set to checkbox width + resizedrag width really statusSizes[STATUS_DUMMY] = 32; } @@ -547,15 +547,13 @@ SettingsManager::getInstance()->set(SettingsManager::TOTAL_UPLOAD, SETTING(TOTAL_UPLOAD) + static_cast<int64_t>(updiff)); SettingsManager::getInstance()->set(SettingsManager::TOTAL_DOWNLOAD, SETTING(TOTAL_DOWNLOAD) + static_cast<int64_t>(downdiff)); - setStatus(STATUS_AWAY, Util::getAway() ? TSTRING(AWAY) : _T("")); + setStatus(STATUS_AWAY, Util::getAway() ? T_("AWAY") : _T("")); setStatus(STATUS_COUNTS, Text::toT(Client::getCounts())); - setStatus(STATUS_SLOTS, Text::toT(STRING(SLOTS) + ": " + Util::toString(UploadManager::getInstance()->getFreeSlots()) + '/' + Util::toString(SETTING(SLOTS)))); - setStatus(STATUS_DOWN_TOTAL, Text::toT("D: " + Util::formatBytes(down))); - setStatus(STATUS_UP_TOTAL, Text::toT("U: " + Util::formatBytes(up))); - setStatus(STATUS_DOWN_DIFF, Text::toT("D: " + Util::formatBytes((downdiff*1000)/tdiff) + "/s (" - + Util::toString(DownloadManager::getInstance()->getDownloadCount()) + ")")); - setStatus(STATUS_UP_DIFF, Text::toT("U: " + Util::formatBytes((updiff*1000)/tdiff) + "/s (" - + Util::toString(UploadManager::getInstance()->getUploadCount()) + ")")); + setStatus(STATUS_SLOTS, str(TF_("Slots: %1%/%2%") % UploadManager::getInstance()->getFreeSlots() % (SETTING(SLOTS)))); + setStatus(STATUS_DOWN_TOTAL, str(TF_("D: %1%") % Text::toT(Util::formatBytes(down)))); + setStatus(STATUS_UP_TOTAL, str(TF_("U: %1%") % Text::toT(Util::formatBytes(up)))); + setStatus(STATUS_DOWN_DIFF, str(TF_("D: %1%/s (%2%)") % Text::toT(Util::formatBytes((downdiff*1000)/tdiff)) % DownloadManager::getInstance()->getDownloadCount())); + setStatus(STATUS_UP_DIFF, str(TF_("U: %1%/s (%2%)") % Text::toT(Util::formatBytes((updiff*1000)/tdiff)) % UploadManager::getInstance()->getUploadCount())); } MainWindow::~MainWindow() { @@ -758,10 +756,9 @@ DirectoryListing dl(u); try { dl.loadFile(*i); - const size_t BUF_SIZE = STRING(MATCHED_FILES).size() + 16; - AutoArray<char> tmp(BUF_SIZE); - snprintf(tmp, BUF_SIZE, CSTRING(MATCHED_FILES), QueueManager::getInstance()->matchListing(dl)); - LogManager::getInstance()->message(Util::toString(ClientManager::getInstance()->getNicks(u->getCID())) + ": " + string(tmp)); + LogManager::getInstance()->message(str(FN_("%1%: matched %2% file", "%1%: matched %2% files", QueueManager::getInstance()->matchListing(dl)) + % Util::toString(ClientManager::getInstance()->getNicks(u->getCID())) + % QueueManager::getInstance()->matchListing(dl))); } catch(const Exception&) { } @@ -849,8 +846,7 @@ const string& msg = xml.getChildData(); createMessageBox().show(Text::toT(msg), Text::toT(title)); } else { - string msg = xml.getChildData() + "\r\n" + STRING(OPEN_DOWNLOAD_PAGE); - if(createMessageBox().show(Text::toT(msg), Text::toT(title), WidgetMessageBox::BOX_YESNO, WidgetMessageBox::BOX_ICONQUESTION) == IDYES) { + if(createMessageBox().show(str(TF_("%1%\nOpen download page?") % Text::toT(xml.getChildData())), Text::toT(title), WidgetMessageBox::BOX_YESNO, WidgetMessageBox::BOX_ICONQUESTION) == IDYES) { WinUtil::openLink(Text::toT(url)); } } @@ -1000,7 +996,7 @@ SmartWin::ScreenCoordinate pt; WidgetMenuPtr trayMenu = createMenu(true); trayMenu->appendItem(IDC_TRAY_SHOW, T_("Show"), std::tr1::bind(&MainWindow::handleRestore, this)); - trayMenu->appendItem(IDC_TRAY_QUIT, TSTRING(MENU_EXIT), std::tr1::bind(&MainWindow::close, this, true)); + trayMenu->appendItem(IDC_TRAY_QUIT, T_("Exit"), std::tr1::bind(&MainWindow::close, this, true)); trayMenu->appendItem(IDC_OPEN_DOWNLOADS, T_("Open downloads directory")); trayMenu->appendItem(IDC_SETTINGS, T_("Settings...")); trayMenu->setDefaultItem(0,TRUE); Modified: dcplusplus/trunk/win32/MainWindow.h =================================================================== --- dcplusplus/trunk/win32/MainWindow.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/MainWindow.h 2008-01-22 22:47:59 UTC (rev 973) @@ -24,6 +24,7 @@ #include <dcpp/QueueManagerListener.h> #include <dcpp/LogManager.h> #include <dcpp/HttpConnection.h> +#include <dcpp/User.h> #include "WidgetFactory.h" #include "AspectStatus.h" Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -362,15 +362,15 @@ bool PrivateFrame::handleTabContextMenu(const SmartWin::ScreenCoordinate& pt) { WidgetMenuPtr menu = createMenu(true); - menu->appendItem(IDC_GETLIST, T_("Get file list"), std::tr1::bind(&PrivateFrame::handleGetList, this)); - menu->appendItem(IDC_MATCH_QUEUE, T_("Match queue"), std::tr1::bind(&PrivateFrame::handleMatchQueue, this)); - menu->appendItem(IDC_GRANTSLOT, T_("Grant extra slot"), std::tr1::bind(&UploadManager::reserveSlot, UploadManager::getInstance(), replyTo)); + menu->appendItem(IDC_GETLIST, T_("&Get file list"), std::tr1::bind(&PrivateFrame::handleGetList, this)); + menu->appendItem(IDC_MATCH_QUEUE, T_("&Match queue"), std::tr1::bind(&PrivateFrame::handleMatchQueue, this)); + menu->appendItem(IDC_GRANTSLOT, T_("Grant &extra slot"), std::tr1::bind(&UploadManager::reserveSlot, UploadManager::getInstance(), replyTo)); if(!FavoriteManager::getInstance()->isFavoriteUser(replyTo)) - menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To Favorites"), std::tr1::bind(&FavoriteManager::addFavoriteUser, FavoriteManager::getInstance(), replyTo)); + menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&FavoriteManager::addFavoriteUser, FavoriteManager::getInstance(), replyTo)); prepareMenu(menu, UserCommand::CONTEXT_CHAT, ClientManager::getInstance()->getHubs(replyTo->getCID())); menu->appendSeparatorItem(); - menu->appendItem(IDC_CLOSE_WINDOW, T_("Close"), std::tr1::bind(&PrivateFrame::close, this, true)); + menu->appendItem(IDC_CLOSE_WINDOW, T_("&Close"), std::tr1::bind(&PrivateFrame::close, this, true)); menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return TRUE; Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -444,9 +444,9 @@ } WidgetMenuPtr menu = createMenu(true); - menu->appendItem(IDC_CONNECT, TSTRING(CONNECT), std::tr1::bind(&PublicHubsFrame::handleConnect, this)); - menu->appendItem(IDC_ADD, T_("Add To Favorites"), std::tr1::bind(&PublicHubsFrame::handleAdd, this)); - menu->appendItem(IDC_COPY_HUB, T_("Copy address to clipboard"), std::tr1::bind(&PublicHubsFrame::handleCopyHub, this)); + menu->appendItem(IDC_CONNECT, T_("&Connect"), std::tr1::bind(&PublicHubsFrame::handleConnect, this)); + menu->appendItem(IDC_ADD, T_("Add To &Favorites"), std::tr1::bind(&PublicHubsFrame::handleAdd, this)); + menu->appendItem(IDC_COPY_HUB, T_("Copy &address to clipboard"), std::tr1::bind(&PublicHubsFrame::handleCopyHub, this)); menu->setDefaultItem(IDC_CONNECT); menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; Modified: dcplusplus/trunk/win32/QueueFrame.cpp =================================================================== --- dcplusplus/trunk/win32/QueueFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/QueueFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -957,7 +957,7 @@ WidgetMenuPtr menu = createMenu(true); WinUtil::addHashItems(menu, qii->getTTH(), Text::toT(Util::getFileName(qii->getTarget()))); - menu->appendItem(IDC_MOVE, T_("Move/Rename"), std::tr1::bind(&QueueFrame::handleMove, this)); + menu->appendItem(IDC_MOVE, T_("&Move/Rename"), std::tr1::bind(&QueueFrame::handleMove, this)); addPriorityMenu(menu); addBrowseMenu(menu, qii); addPMMenu(menu, qii); @@ -965,7 +965,7 @@ addReaddMenu(menu, qii); addRemoveMenu(menu, qii); addRemoveAllMenu(menu, qii); - menu->appendItem(IDC_REMOVE, TSTRING(REMOVE), std::tr1::bind(&QueueFrame::handleRemove, this)); + menu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&QueueFrame::handleRemove, this)); return menu; } @@ -975,9 +975,9 @@ addPriorityMenu(menu); - menu->appendItem(IDC_MOVE, T_("Move/Rename"), std::tr1::bind(&QueueFrame::handleMove, this)); + menu->appendItem(IDC_MOVE, T_("&Move/Rename"), std::tr1::bind(&QueueFrame::handleMove, this)); menu->appendSeparatorItem(); - menu->appendItem(IDC_REMOVE, TSTRING(REMOVE), std::tr1::bind(&QueueFrame::handleRemove, this)); + menu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&QueueFrame::handleRemove, this)); return menu; } @@ -985,9 +985,9 @@ WidgetMenuPtr menu = createMenu(true); addPriorityMenu(menu); - menu->appendItem(IDC_MOVE, T_("Move/Rename"), std::tr1::bind(&QueueFrame::handleMove, this)); + menu->appendItem(IDC_MOVE, T_("&Move/Rename"), std::tr1::bind(&QueueFrame::handleMove, this)); menu->appendSeparatorItem(); - menu->appendItem(IDC_REMOVE, TSTRING(REMOVE), std::tr1::bind(&QueueFrame::handleRemove, this)); + menu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&QueueFrame::handleRemove, this)); return menu; } @@ -1003,7 +1003,7 @@ void QueueFrame::addBrowseMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii) { unsigned int pos = parent->getCount(); - WidgetMenuPtr menu = parent->appendPopup(T_("Get file list")); + WidgetMenuPtr menu = parent->appendPopup(T_("&Get file list")); if(addUsers(menu, IDC_BROWSELIST, &QueueFrame::handleBrowseList, qii, false) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } @@ -1011,7 +1011,7 @@ void QueueFrame::addPMMenu(const WidgetMenuPtr& parent, QueueItemInfo* qii) { unsigned int pos = parent->getCount(); - WidgetMenuPtr menu = parent->appendPopup(T_("Send private message")); + WidgetMenuPtr menu = parent->appendPopup(T_("&Send private message")); if(addUsers(menu, IDC_PM, &QueueFrame::handlePM, qii, false) == 0) { ::EnableMenuItem(menu->handle(), pos, MF_BYPOSITION | MF_GRAYED); } Modified: dcplusplus/trunk/win32/SearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SearchFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/SearchFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -21,7 +21,6 @@ #include "SearchFrame.h" -#include <dcpp/ResourceManager.h> #include <dcpp/FavoriteManager.h> #include <dcpp/QueueManager.h> #include <dcpp/ClientManager.h> @@ -740,11 +739,11 @@ StringPairList favoriteDirs = FavoriteManager::getInstance()->getFavoriteDirs(); SearchInfo::CheckTTH checkTTH = results->forEachSelectedT(SearchInfo::CheckTTH()); - menu->appendItem(IDC_DOWNLOAD, T_("Download"), std::tr1::bind(&SearchFrame::handleDownload, this)); + menu->appendItem(IDC_DOWNLOAD, T_("&Download"), std::tr1::bind(&SearchFrame::handleDownload, this)); addTargetMenu(menu, favoriteDirs, checkTTH); menu->appendItem(IDC_DOWNLOADDIR, T_("Download whole directory"), std::tr1::bind(&SearchFrame::handleDownloadDir, this)); addTargetDirMenu(menu, favoriteDirs); - menu->appendItem(IDC_VIEW_AS_TEXT, T_("View as text"), std::tr1::bind(&SearchFrame::handleViewAsText, this)); + menu->appendItem(IDC_VIEW_AS_TEXT, T_("&View as text"), std::tr1::bind(&SearchFrame::handleViewAsText, this)); menu->appendSeparatorItem(); if(checkTTH.hasTTH) { SearchInfo* si = results->getSelectedData(); @@ -753,7 +752,7 @@ menu->appendSeparatorItem(); appendUserItems(getParent(), menu); menu->appendSeparatorItem(); - menu->appendItem(IDC_REMOVE, TSTRING(REMOVE), std::tr1::bind(&SearchFrame::handleRemove, this)); + menu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&SearchFrame::handleRemove, this)); prepareMenu(menu, UserCommand::CONTEXT_SEARCH, checkTTH.hubs); menu->setDefaultItem(IDC_DOWNLOAD); @@ -772,7 +771,7 @@ } n = 0; - menu->appendItem(IDC_DOWNLOADTO, T_("Browse..."), std::tr1::bind(&SearchFrame::handleDownloadTo, this)); + menu->appendItem(IDC_DOWNLOADTO, T_("&Browse..."), std::tr1::bind(&SearchFrame::handleDownloadTo, this)); if(WinUtil::lastDirs.size() > 0) { menu->appendSeparatorItem(); for(TStringIter i = WinUtil::lastDirs.begin(); i != WinUtil::lastDirs.end(); ++i) @@ -802,7 +801,7 @@ } n = 0; - menu->appendItem(IDC_DOWNLOADDIRTO, T_("Browse..."), std::tr1::bind(&SearchFrame::handleDownloadDirTo, this)); + menu->appendItem(IDC_DOWNLOADDIRTO, T_("&Browse..."), std::tr1::bind(&SearchFrame::handleDownloadDirTo, this)); if(WinUtil::lastDirs.size() > 0) { menu->appendSeparatorItem(); for(TStringIter i = WinUtil::lastDirs.begin(); i != WinUtil::lastDirs.end(); ++i) Modified: dcplusplus/trunk/win32/SpyFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SpyFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/SpyFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -28,6 +28,8 @@ int SpyFrame::columnSizes[] = { 305, 70, 85 }; int SpyFrame::columnIndexes[] = { COLUMN_STRING, COLUMN_COUNT, COLUMN_TIME }; +const size_t SpyFrame::AVG_TIME; // TODO gcc needs this - why? + static const char* columnNames[] = { N_("Search String"), N_("Count"), @@ -104,12 +106,12 @@ bool SpyFrame::eachSecond() { size_t tot = std::accumulate(perSecond, perSecond + AVG_TIME, 0u); - size_t t = std::max(1u, std::min(cur, (size_t)AVG_TIME)); + size_t t = std::max(1u, std::min(cur, AVG_TIME)); float x = static_cast<float>(tot)/t; cur++; - perSecond[cur] = 0; + perSecond[cur % AVG_TIME] = 0; setStatus(STATUS_AVG_PER_SECOND, str(TF_("Average/s: %1%") % x)); return true; } @@ -186,7 +188,7 @@ searchString = searches->getText(searches->getSelectedIndex(), COLUMN_STRING); WidgetMenuPtr contextMenu = createMenu(true); - contextMenu->appendItem(IDC_SEARCH, T_("Search"), std::tr1::bind(&SpyFrame::handleSearch, this)); + contextMenu->appendItem(IDC_SEARCH, T_("&Search"), std::tr1::bind(&SpyFrame::handleSearch, this)); contextMenu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; Modified: dcplusplus/trunk/win32/SpyFrame.h =================================================================== --- dcplusplus/trunk/win32/SpyFrame.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/SpyFrame.h 2008-01-22 22:47:59 UTC (rev 973) @@ -50,7 +50,7 @@ void postClosing(); private: - enum { AVG_TIME = 60 }; + static const size_t AVG_TIME = 60; enum { SPEAK_SEARCH Modified: dcplusplus/trunk/win32/StaticFrame.h =================================================================== --- dcplusplus/trunk/win32/StaticFrame.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/StaticFrame.h 2008-01-22 22:47:59 UTC (rev 973) @@ -21,7 +21,6 @@ #include "MDIChildFrame.h" -#include <dcpp/ResourceManager.h> #include <dcpp/Text.h> template<class T> Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -109,10 +109,10 @@ appendUserItems(mdi, menu); menu->appendSeparatorItem(); - menu->appendItem(IDC_FORCE, T_("Force attempt"), std::tr1::bind(&TransferView::handleForce, this)); - menu->appendItem(IDC_COPY_NICK, T_("Copy nick to clipboard"), std::tr1::bind(&TransferView::handleCopyNick, this)); + menu->appendItem(IDC_FORCE, T_("&Force attempt"), std::tr1::bind(&TransferView::handleForce, this)); + menu->appendItem(IDC_COPY_NICK, T_("Copy &nick to clipboard"), std::tr1::bind(&TransferView::handleCopyNick, this)); menu->appendSeparatorItem(); - menu->appendItem(IDC_REMOVE, T_("Disconnect"), std::tr1::bind(&TransferView::handleDisconnect, this)); + menu->appendItem(IDC_REMOVE, T_("&Disconnect"), std::tr1::bind(&TransferView::handleDisconnect, this)); menu->setDefaultItem(IDC_PRIVATEMESSAGE); return menu; } Modified: dcplusplus/trunk/win32/UserInfoBase.h =================================================================== --- dcplusplus/trunk/win32/UserInfoBase.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/UserInfoBase.h 2008-01-22 22:47:59 UTC (rev 973) @@ -93,14 +93,14 @@ void appendUserItems(SmartWin::WidgetTabView* parent, MenuType menu) { T* This = static_cast<T*>(this); UserInfoBase::UserTraits traits = This->getUserList()->forEachSelectedT(UserInfoBase::UserTraits()); - menu->appendItem(IDC_GETLIST, T_("Get file list"), std::tr1::bind(&T::handleGetList, This)); + menu->appendItem(IDC_GETLIST, T_("&Get file list"), std::tr1::bind(&T::handleGetList, This)); if(traits.adcOnly) - menu->appendItem(IDC_BROWSELIST, T_("Browse file list"), std::tr1::bind(&T::handleBrowseList, This)); - menu->appendItem(IDC_MATCH_QUEUE, T_("Match queue"), std::tr1::bind(&T::handleMatchQueue, This)); - menu->appendItem(IDC_PRIVATEMESSAGE, T_("Send private message"), std::tr1::bind(&T::handlePrivateMessage, This, parent)); + menu->appendItem(IDC_BROWSELIST, T_("&Browse file list"), std::tr1::bind(&T::handleBrowseList, This)); + menu->appendItem(IDC_MATCH_QUEUE, T_("&Match queue"), std::tr1::bind(&T::handleMatchQueue, This)); + menu->appendItem(IDC_PRIVATEMESSAGE, T_("&Send private message"), std::tr1::bind(&T::handlePrivateMessage, This, parent)); if(!traits.favOnly) - menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To Favorites"), std::tr1::bind(&T::handleAddFavorite, This)); - menu->appendItem(IDC_GRANTSLOT, T_("Grant extra slot"), std::tr1::bind(&T::handleGrantSlot, This)); + menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&T::handleAddFavorite, This)); + menu->appendItem(IDC_GRANTSLOT, T_("Grant &extra slot"), std::tr1::bind(&T::handleGrantSlot, This)); if(!traits.nonFavOnly) menu->appendItem(IDC_CONNECT, T_("Connect to hub"), std::tr1::bind(&T::handleConnectFav, This, parent)); menu->appendSeparatorItem(); Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -80,12 +80,12 @@ pt = queued->getContextMenuPos(); } WidgetMenuPtr menu = createMenu(true); - menu->appendItem(IDC_GETLIST, CTSTRING(GET_FILE_LIST), std::tr1::bind(&WaitingUsersFrame::onGetList, this)); - menu->appendItem(IDC_COPY_FILENAME, CTSTRING(COPY_FILENAME), std::tr1::bind(&WaitingUsersFrame::onCopyFilename, this)); - menu->appendItem(IDC_REMOVE, CTSTRING(REMOVE), std::tr1::bind(&WaitingUsersFrame::onRemove, this)); - menu->appendItem(IDC_GRANTSLOT, CTSTRING(GRANT_EXTRA_SLOT), std::tr1::bind(&WaitingUsersFrame::onGrantSlot, this)); - menu->appendItem(IDC_ADD_TO_FAVORITES, CTSTRING(ADD_TO_FAVORITES), std::tr1::bind(&WaitingUsersFrame::onAddToFavorites, this)); - menu->appendItem(IDC_PRIVATEMESSAGE, CTSTRING(SEND_PRIVATE_MESSAGE), std::tr1::bind(&WaitingUsersFrame::onPrivateMessage, this)); + menu->appendItem(IDC_GETLIST, T_("&Get file list"), std::tr1::bind(&WaitingUsersFrame::onGetList, this)); + menu->appendItem(IDC_COPY_FILENAME, T_("Copy Filename"), std::tr1::bind(&WaitingUsersFrame::onCopyFilename, this)); + menu->appendItem(IDC_REMOVE, T_("&Remove"), std::tr1::bind(&WaitingUsersFrame::onRemove, this)); + menu->appendItem(IDC_GRANTSLOT, T_("Grant &extra slot"), std::tr1::bind(&WaitingUsersFrame::onGrantSlot, this)); + menu->appendItem(IDC_ADD_TO_FAVORITES, T_("Add To &Favorites"), std::tr1::bind(&WaitingUsersFrame::onAddToFavorites, this)); + menu->appendItem(IDC_PRIVATEMESSAGE, T_("&Send private message"), std::tr1::bind(&WaitingUsersFrame::onPrivateMessage, this)); menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); return true; } Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-01-22 22:47:59 UTC (rev 973) @@ -27,7 +27,6 @@ #include <dcpp/ShareManager.h> #include <dcpp/ClientManager.h> #include <dcpp/HashManager.h> -#include <dcpp/ResourceManager.h> #include <dcpp/LogManager.h> #include <dcpp/QueueManager.h> #include <dcpp/StringTokenizer.h> @@ -979,7 +978,7 @@ // as = acceptable substitute // dn = display name if (Util::strnicmp(aUrl.c_str(), _T("magnet:?"), 8) == 0) { - LogManager::getInstance()->message(STRING(MAGNET_DLG_TITLE) + ": " + Text::fromT(aUrl)); + LogManager::getInstance()->message(str(F_("MAGNET Link detected: %1%") % Text::fromT(aUrl))); StringTokenizer<tstring> mag(aUrl.substr(8), _T('&')); typedef map<tstring, tstring> MagMap; MagMap hashes; Modified: dcplusplus/trunk/win32/stdafx.h =================================================================== --- dcplusplus/trunk/win32/stdafx.h 2008-01-21 21:00:31 UTC (rev 972) +++ dcplusplus/trunk/win32/stdafx.h 2008-01-22 22:47:59 UTC (rev 973) @@ -51,6 +51,8 @@ #define N_(String) gettext_noop (String) #define T_(String) Text::toT(gettext(String)) #define CT_(String) T_(String).c_str() +#define F_(String) boost::format(gettext(String)) +#define FN_(String1,String2, N) boost::format(ngettext(String1, String2, N)) #ifdef UNICODE #define TF_(String) boost::wformat(Text::toT(gettext(String))) #define TFN_(String1,String2, N) boost::wformat(Text::toT(ngettext(String1, String2, N))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |