From: <arn...@us...> - 2008-01-03 19:21:34
|
Revision: 955 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=955&view=rev Author: arnetheduck Date: 2008-01-03 11:21:30 -0800 (Thu, 03 Jan 2008) Log Message: ----------- Start work on a downloadsframe Modified Paths: -------------- dcplusplus/trunk/SConstruct dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/ConnectionManager.cpp dcplusplus/trunk/dcpp/DCPlusPlus.h dcplusplus/trunk/dcpp/NmdcHub.cpp dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/dcpp/SettingsManager.h dcplusplus/trunk/dcpp/UserConnection.cpp dcplusplus/trunk/dcpp/stdinc.h dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMDIFrame.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRichTextBox.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetWindow.h dcplusplus/trunk/win32/DirectoryListingFrame.h dcplusplus/trunk/win32/FinishedFrameBase.h dcplusplus/trunk/win32/HubFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/PublicHubsFrame.h dcplusplus/trunk/win32/QueueFrame.h dcplusplus/trunk/win32/SearchFrame.h dcplusplus/trunk/win32/StaticFrame.h dcplusplus/trunk/win32/TransferView.cpp dcplusplus/trunk/win32/TransferView.h dcplusplus/trunk/win32/TypedListView.h dcplusplus/trunk/win32/TypedTreeView.h dcplusplus/trunk/win32/UsersFrame.h dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h dcplusplus/trunk/win32/main.cpp dcplusplus/trunk/win32/stdafx.h Added Paths: ----------- dcplusplus/trunk/win32/DownloadsFrame.cpp dcplusplus/trunk/win32/DownloadsFrame.h dcplusplus/trunk/win32/po/dcpp-win32.pot Removed Paths: ------------- dcplusplus/trunk/dcpp/po/dcpp.pot Modified: dcplusplus/trunk/SConstruct =================================================================== --- dcplusplus/trunk/SConstruct 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/SConstruct 2008-01-03 19:21:30 UTC (rev 955) @@ -156,9 +156,10 @@ mo_bld = Builder (action = Action([mo_args], 'Compiling message catalog $TARGET from $SOURCES')) env.Append(BUILDERS = {'MoBuild' : mo_bld}) -pot_args = ['xgettext','--from-code=UTF-8', '--foreign-user', '--package-name=$PACKAGE', +pot_args = ['xgettext', '--from-code=UTF-8', '--foreign-user', '--package-name=$PACKAGE', '--copyright-holder=Jacek Sieka', '--msgid-bugs-address=dcp...@li...', - '--no-wrap', '--keyword=_', '--keyword=T_', '--output=$TARGET', '$SOURCES'] + '--no-wrap', '--keyword=_', '--keyword=T_', '--keyword=TF_', '--keyword=TFN_:1,2', + '--keyword=F_', '--boost', '--output=$TARGET', '$SOURCES'] pot_bld = Builder (action = Action([pot_args], 'Extracting messages to $TARGET from $SOURCES')) env.Append(BUILDERS = {'PotBuild' : pot_bld}) Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/changelog.txt 2008-01-03 19:21:30 UTC (rev 955) @@ -7,7 +7,8 @@ * [ADC] Implemented test version of bloom filters which will dramatically reduce hub bandwidth usage for TTH searches * Fixed a crash with partial list browsing * Replaced homegrown i18n solution with gettext -§ +* Fixed an issue with nick encodings and nmdc connections (thanks stanislav maslovski) + -- 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/ConnectionManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ConnectionManager.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/ConnectionManager.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -423,9 +423,12 @@ } aSource->setToken(i.first); aSource->setHubUrl(i.second); + aSource->setEncoding(ClientManager::getInstance()->findHubEncoding(i.second)); } - CID cid = ClientManager::getInstance()->makeCid(aNick, aSource->getHubUrl()); + string nick = Text::toUtf8(aNick, aSource->getEncoding()); + CID cid = ClientManager::getInstance()->makeCid(nick, aSource->getHubUrl()); + // First, we try looking in the pending downloads...hopefully it's one of them... { Lock l(cs); @@ -445,7 +448,7 @@ aSource->setUser(ClientManager::getInstance()->findUser(cid)); if(!aSource->getUser() || !ClientManager::getInstance()->isOnline(aSource->getUser())) { - dcdebug("CM::onMyNick Incoming connection from unknown user %s\n", aNick.c_str()); + dcdebug("CM::onMyNick Incoming connection from unknown user %s\n", nick.c_str()); putConnection(aSource); return; } Modified: dcplusplus/trunk/dcpp/DCPlusPlus.h =================================================================== --- dcplusplus/trunk/dcpp/DCPlusPlus.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/DCPlusPlus.h 2008-01-03 19:21:30 UTC (rev 955) @@ -171,7 +171,8 @@ #ifdef BUILDING_DCPP #define PACKAGE "dcpp" #define LOCALEDIR Util::getLocalePath().c_str() -#define _(String) dgettext(PACKAGE, String) +#define _(String) dgettext(PACKAGE, String) +#define F_(String) boost::format(dgettext(PACKAGE, String)) #endif } // namespace dcpp Modified: dcplusplus/trunk/dcpp/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/NmdcHub.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/NmdcHub.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -738,8 +738,9 @@ void NmdcHub::connectToMe(const OnlineUser& aUser) { checkstate(); dcdebug("NmdcHub::connectToMe %s\n", aUser.getIdentity().getNick().c_str()); - ConnectionManager::getInstance()->nmdcExpect(aUser.getIdentity().getNick(), getMyNick(), getHubUrl()); - send("$ConnectToMe " + fromUtf8(aUser.getIdentity().getNick()) + " " + getLocalIp() + ":" + Util::toString(ConnectionManager::getInstance()->getPort()) + "|"); + string nick = fromUtf8(aUser.getIdentity().getNick()); + ConnectionManager::getInstance()->nmdcExpect(nick, getMyNick(), getHubUrl()); + send("$ConnectToMe " + nick + " " + getLocalIp() + ":" + Util::toString(ConnectionManager::getInstance()->getPort()) + "|"); } void NmdcHub::revConnectToMe(const OnlineUser& aUser) { Modified: dcplusplus/trunk/dcpp/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/SettingsManager.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -47,7 +47,7 @@ "LogFilePrivateChat", "LogFileStatus", "LogFileUpload", "LogFileDownload", "LogFileSystem", "LogFormatSystem", "LogFormatStatus", "DirectoryListingFrameOrder", "DirectoryListingFrameWidths", "TLSPrivateKeyFile", "TLSCertificateFile", "TLSTrustedCertificatesPath", "BeepFile", - "Language", + "Language", "DownloadsFrameOrder", "DownloadsFrameWidth", "SENTRY", // Ints "IncomingConnections", "InPort", "Slots", "AutoFollow", "ClearSearch", Modified: dcplusplus/trunk/dcpp/SettingsManager.h =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/SettingsManager.h 2008-01-03 19:21:30 UTC (rev 955) @@ -58,7 +58,7 @@ LOG_FILE_PRIVATE_CHAT, LOG_FILE_STATUS, LOG_FILE_UPLOAD, LOG_FILE_DOWNLOAD, LOG_FILE_SYSTEM, LOG_FORMAT_SYSTEM, LOG_FORMAT_STATUS, DIRECTORLISTINGFRAME_ORDER, DIRECTORLISTINGFRAME_WIDTHS, TLS_PRIVATE_KEY_FILE, TLS_CERTIFICATE_FILE, TLS_TRUSTED_CERTIFICATES_PATH, BEEPFILE, - LANGUAGE, + LANGUAGE, DOWNLOADSFRAME_ORDER, DOWNLOADSFRAME_WIDTHS, STR_LAST }; enum IntSetting { INT_FIRST = STR_LAST + 1, @@ -90,7 +90,7 @@ USE_TLS, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, SPY_FRAME_IGNORE_TTH_SEARCHES, DONT_DL_ALREADY_QUEUED, MAX_COMMAND_LENGTH, ALLOW_UNTRUSTED_HUBS, ALLOW_UNTRUSTED_CLIENTS, TLS_PORT, FAST_HASH, SORT_FAVUSERS_FIRST, SHOW_SHELL_MENU, MIN_SEGMENT_SIZE, FOLLOW_LINKS, - SEND_BLOOM, + SEND_BLOOM, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/dcpp/UserConnection.cpp =================================================================== --- dcplusplus/trunk/dcpp/UserConnection.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/UserConnection.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -75,7 +75,7 @@ if(cmd == "$MyNick") { if(!param.empty()) - fire(UserConnectionListener::MyNick(), this, Text::toUtf8(param, encoding)); + fire(UserConnectionListener::MyNick(), this, param); } else if(cmd == "$Direction") { x = param.find(" "); if(x != string::npos) { Deleted: dcplusplus/trunk/dcpp/po/dcpp.pot =================================================================== --- dcplusplus/trunk/dcpp/po/dcpp.pot 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/po/dcpp.pot 2008-01-03 19:21:30 UTC (rev 955) @@ -1,22 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Jacek Sieka -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: dcpp\n" -"Report-Msgid-Bugs-To: dcp...@li...\n" -"POT-Creation-Date: 2007-12-29 13:55+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL...@li...>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: dcpp/DCPlusPlus.cpp:92 -#, c-format -msgid "test" -msgstr "" Modified: dcplusplus/trunk/dcpp/stdinc.h =================================================================== --- dcplusplus/trunk/dcpp/stdinc.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/dcpp/stdinc.h 2008-01-03 19:21:30 UTC (rev 955) @@ -119,6 +119,8 @@ #include <limits> #include <libintl.h> +#include <boost/format.hpp> + #ifdef _STLPORT_VERSION #include <unordered_map> Modified: dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/WidgetFactoryPlatformSmartWinDesktop.h 2008-01-03 19:21:30 UTC (rev 955) @@ -99,7 +99,7 @@ /// Creates a Rich Edit Control and returns a pointer to it. /** DON'T delete the returned pointer!!! */ - WidgetRichTextBoxPtr createRichTextBox( const typename WidgetRichTextBox::Seed & cs = WidgetRichTextBox::getDefaultSeed() ) + WidgetRichTextBoxPtr createRichTextBox( const typename WidgetRichTextBox::Seed & cs = WidgetRichTextBox::Seed() ) { return WidgetCreator< WidgetRichTextBox >::create( this, cs ); } @@ -138,7 +138,7 @@ /// Creates a Cool Bar and returns a pointer to it. /** DON'T delete the returned pointer!!! */ - WidgetCoolbarPtr createCoolbar( const typename WidgetCoolbar::Seed & cs = WidgetCoolbar::getDefaultSeed() ) + WidgetCoolbarPtr createCoolbar( const typename WidgetCoolbar::Seed & cs = WidgetCoolbar::Seed() ) { return WidgetCreator< WidgetCoolbar >::create( this, cs ); } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h 2008-01-03 19:21:30 UTC (rev 955) @@ -114,9 +114,6 @@ Seed(); }; - /// Default values for creation - static const Seed & getDefaultSeed(); - /// ComboBox object type. typedef WidgetComboBox::ObjectType WidgetComboBoxPtr; Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h 2008-01-03 19:21:30 UTC (rev 955) @@ -127,9 +127,6 @@ SORT_FLOAT }; - /// Default values for creation - static const Seed & getDefaultSeed(); - // Aspect expectation implementation static const Message & getSelectionChangedMessage(); @@ -478,7 +475,7 @@ * directly. <br> * Only if you DERIVE from class you should call this function directly. */ - void create( const Seed & cs = getDefaultSeed() ); + void create( const Seed & cs = Seed() ); // Constructor Taking pointer to parent explicit WidgetListView( SmartWin::Widget * parent ); Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMDIFrame.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMDIFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetMDIFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -101,7 +101,7 @@ * is ready, createInvisibleWindow() lets you add Widgets while * the main Widget is not visible. Of course you could do code like <br> * - * Seed defInvisible = getDefaultSeed(); <br> + * Seed defInvisible = Seed(); <br> * defInvisible.style= defInvisible.style & ( ~ WS_VISIBLE ); <br> * createWindow( defInvisible ); <br> * Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h 2008-01-03 19:21:30 UTC (rev 955) @@ -73,9 +73,6 @@ Seed(const SmartUtil::tstring& caption_ = SmartUtil::tstring()); }; - /// Default values for creation - static const Seed & getDefaultSeed(); - /// Returns true if the RadioButton is selected /** Call this function to determine if the RadioButton is selected or not, * returns true if it is selected Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRichTextBox.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRichTextBox.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRichTextBox.h 2008-01-03 19:21:30 UTC (rev 955) @@ -85,15 +85,12 @@ Seed(); }; - /// Default values for creation - static const Seed & getDefaultSeed(); - /// Actually creates the Rich Edit Control /** You should call WidgetFactory::createRichTextBox if you instantiate class * directly. <br> * Only if you DERIVE from class you should call this function directly. */ - void create( const Seed & cs = getDefaultSeed() ); + void create( const Seed & cs = Seed() ); /// Sets the background color of the WidgetRichTextBox /** Call this function to alter the background color of the WidgetRichEdit. <br> Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetWindow.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetWindow.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetWindow.h 2008-01-03 19:21:30 UTC (rev 955) @@ -116,7 +116,7 @@ * is ready, createInvisibleWindow() lets you add Widgets while * the main Widget is not visible. Of course you could do code like <br> * - * Seed defInvisible = getDefaultSeed(); <br> + * Seed defInvisible = Seed(); <br> * defInvisible.style= defInvisible.style & ( ~ WS_VISIBLE ); <br> * createWindow( defInvisible ); <br> * @@ -188,7 +188,7 @@ /// Actually creates the window /** This one creates the window. It is implemented in case somebody wants to use * createWindow() without parameters. If it wasn't declared, the compiler would - * call WidgetWindow::create with WidgetWindow::getDefaultSeed, which wouldn't + * call WidgetWindow::create with WidgetWindow::Seed, which wouldn't * create a child window. */ void createWindow( const Seed& cs = Seed() ) Modified: dcplusplus/trunk/win32/DirectoryListingFrame.h =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/DirectoryListingFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -128,10 +128,10 @@ tstring columns[COLUMN_LAST]; }; - typedef TypedTreeView<DirectoryListingFrame, ItemInfo> WidgetDirs; + typedef TypedTreeView<ItemInfo> WidgetDirs; typedef WidgetDirs* WidgetDirsPtr; WidgetDirsPtr dirs; - typedef TypedListView<DirectoryListingFrame, ItemInfo> WidgetFiles; + typedef TypedListView<ItemInfo> WidgetFiles; typedef WidgetFiles* WidgetFilesPtr; WidgetFilesPtr files; Added: dcplusplus/trunk/win32/DownloadsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DownloadsFrame.cpp (rev 0) +++ dcplusplus/trunk/win32/DownloadsFrame.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "stdafx.h" + +#include <dcpp/SettingsManager.h> +#include <dcpp/QueueItem.h> +#include <dcpp/QueueManager.h> +#include <dcpp/Download.h> + +#include "DownloadsFrame.h" +#include "HoldRedraw.h" + +int DownloadsFrame::columnIndexes[] = { COLUMN_FILE, COLUMN_PATH, COLUMN_STATUS, COLUMN_TIMELEFT, COLUMN_SPEED, COLUMN_SIZE }; +int DownloadsFrame::columnSizes[] = { 200, 300, 150, 200, 125, 100}; + +static ResourceManager::Strings columnNames[] = { ResourceManager::FILENAME, ResourceManager::PATH, + ResourceManager::STATUS, ResourceManager::TIME_LEFT, ResourceManager::SPEED, ResourceManager::SIZE }; + +DownloadsFrame::DownloadsFrame(SmartWin::WidgetTabView* mdiParent) : + BaseType(mdiParent, T_("Downloads")), + downloads(0), + startup(true) +{ + { + downloads = SmartWin::WidgetCreator<WidgetDownloads>::create(this, WinUtil::Seeds::listView); + addWidget(downloads); + + downloads->createColumns(ResourceManager::getInstance()->getStrings(columnNames)); + downloads->setColumnOrder(WinUtil::splitTokens(SETTING(HUBFRAME_ORDER), columnIndexes)); + downloads->setColumnWidths(WinUtil::splitTokens(SETTING(HUBFRAME_WIDTHS), columnSizes)); + downloads->setSort(COLUMN_STATUS); + downloads->setColor(WinUtil::textColor, WinUtil::bgColor); + + downloads->onKeyDown(std::tr1::bind(&DownloadsFrame::handleKeyDown, this, _1)); + downloads->onContextMenu(std::tr1::bind(&DownloadsFrame::handleContextMenu, this, _1)); + } + + initStatus(); + + layout(); + + startup = false; + + onSpeaker(std::tr1::bind(&DownloadsFrame::handleSpeaker, this, _1, _2)); +} + +DownloadsFrame::~DownloadsFrame() { + +} + +void DownloadsFrame::layout() { + SmartWin::Rectangle r(SmartWin::Point(0, 0), getClientAreaSize()); + + layoutStatus(r); + + downloads->setBounds(r); +} + +bool DownloadsFrame::preClosing() { + return true; +} + +void DownloadsFrame::postClosing() { + SettingsManager::getInstance()->set(SettingsManager::DOWNLOADSFRAME_ORDER, WinUtil::toString(downloads->getColumnOrder())); + SettingsManager::getInstance()->set(SettingsManager::DOWNLOADSFRAME_WIDTHS, WinUtil::toString(downloads->getColumnWidths())); +} + +DownloadsFrame::DownloadInfo::DownloadInfo(const string& filename, int64_t size_) : path(filename), done(0), size(size), users(0) { + columns[COLUMN_FILE] = Text::toT(Util::getFileName(filename)); + columns[COLUMN_PATH] = Text::toT(Util::getFilePath(filename)); + columns[COLUMN_SIZE] = Text::toT(Util::toString(size)); +} + +void DownloadsFrame::DownloadInfo::update(const DownloadsFrame::TickInfo& ti) { + users = ti.users; + done = ti.done; // TODO Add done from queuemanager... + bps = ti.bps; +} + +void DownloadsFrame::DownloadInfo::update() { + if(users == 0) { + columns[COLUMN_STATUS] = T_("Waiting for slot"); + columns[COLUMN_TIMELEFT].clear(); + columns[COLUMN_SPEED].clear(); + } else { + double timeleft = bps > 0 ? (size - done) / bps : 0; + columns[COLUMN_STATUS] = str(TFN_("Downloading from %1% user", "Downloading from %1% users", users) % users); + columns[COLUMN_TIMELEFT] = Text::toT(Util::formatSeconds(static_cast<int64_t>(timeleft))); + columns[COLUMN_SPEED] = str(TF_("%1%/s") % Text::toT(Util::formatBytes(static_cast<int64_t>(bps)))); + } +} + +bool DownloadsFrame::handleKeyDown(int c) { + switch(c) { + } + return false; +} + +bool DownloadsFrame::handleContextMenu(SmartWin::ScreenCoordinate pt) { + if (downloads->hasSelection()) { + if(pt.x() == -1 && pt.y() == -1) { + pt = downloads->getContextMenuPos(); + } + + WidgetMenuPtr menu = createMenu(true); + + menu->trackPopupMenu(this, pt, TPM_LEFTALIGN | TPM_RIGHTBUTTON); + + return true; + } + return false; +} + +int DownloadsFrame::find(const string& path) { + for(size_t i = 0; i < downloads->size(); ++i) { + DownloadInfo* di = downloads->getData(i); + if(Util::stricmp(di->path, path) == 0) { + return i; + } + } + return -1; +} + +LRESULT DownloadsFrame::handleSpeaker(WPARAM wParam, LPARAM lParam) { + if(wParam == SPEAKER_TICK) { + boost::scoped_ptr<TickInfo> ti(reinterpret_cast<TickInfo*>(lParam)); + int i = find(ti->path); + if(i == -1) { + // TODO get size + i = downloads->insert(new DownloadInfo(ti->path, 0)); + } + DownloadInfo* di = downloads->getData(i); + di->update(*ti); + } else if(wParam == SPEAKER_DISCONNECTED) { + boost::scoped_ptr<string> path(reinterpret_cast<string*>(lParam)); + + int i = find(*path); + if(i != -1) { + DownloadInfo* di = downloads->getData(i); + di->users--; + di->update(); + } + } else if(wParam == SPEAKER_REMOVED) { + boost::scoped_ptr<string> path(reinterpret_cast<string*>(lParam)); + int i = find(*path); + if(i != -1) { + downloads->erase(i); + } + } + return 0; +} + +void DownloadsFrame::on(DownloadManagerListener::Tick, const DownloadList& l) throw() { + std::vector<TickInfo*> dis; + for(DownloadList::const_iterator i = l.begin(); i != l.end(); ++i) { + Download* d = *i; + TickInfo* ti = 0; + for(std::vector<TickInfo*>::iterator j = dis.begin(); j != dis.end(); ++j) { + TickInfo* ti2 = *j; + if(Util::stricmp(ti2->path, d->getPath()) == 0) { + ti = ti2; + break; + } + } + if(!ti) { + ti = new TickInfo(d->getPath()); + } + ti->users++; + ti->bps += d->getAverageSpeed(); + ti->done += d->getPos(); + } + + for(std::vector<TickInfo*>::iterator i = dis.begin(); i != dis.end(); ++i) { + speak(SPEAKER_TICK, reinterpret_cast<LPARAM>(*i)); + } +} + +void DownloadsFrame::on(DownloadManagerListener::Complete, Download* d) throw() { + speak(SPEAKER_DISCONNECTED, reinterpret_cast<LPARAM>(new string(d->getPath()))); +} + +void DownloadsFrame::on(DownloadManagerListener::Failed, Download* d, const string&) throw() { + speak(SPEAKER_DISCONNECTED, reinterpret_cast<LPARAM>(new string(d->getPath()))); +} + +void DownloadsFrame::on(QueueManagerListener::Removed, QueueItem* qi) throw() { + speak(SPEAKER_REMOVED, reinterpret_cast<LPARAM>(new string(qi->getTarget()))); +} Added: dcplusplus/trunk/win32/DownloadsFrame.h =================================================================== --- dcplusplus/trunk/win32/DownloadsFrame.h (rev 0) +++ dcplusplus/trunk/win32/DownloadsFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2001-2007 Jacek Sieka, arnetheduck on gmail point com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef DCPLUSPLUS_WIN32_DOWNLOADS_FRAME_H +#define DCPLUSPLUS_WIN32_DOWNLOADS_FRAME_H + +#include <dcpp/DownloadManagerListener.h> +#include <dcpp/ConnectionManagerListener.h> +#include <dcpp/forward.h> +#include <dcpp/ResourceManager.h> + +#include "TypedListView.h" +#include "StaticFrame.h" +#include "AspectSpeaker.h" + +class DownloadsFrame : + public StaticFrame<DownloadsFrame>, + private DownloadManagerListener, + private ConnectionManagerListener +{ +public: + enum Status { + STATUS_STATUS, + STATUS_LAST + }; + static const unsigned ICON_RESOURCE = IDR_QUEUE; + +protected: + typedef StaticFrame<DownloadsFrame> BaseType; + friend class StaticFrame<DownloadsFrame>; + friend class MDIChildFrame<DownloadsFrame>; + + DownloadsFrame(SmartWin::WidgetTabView* mdiParent); + virtual ~DownloadsFrame(); + + void layout(); + + bool preClosing(); + void postClosing(); + +private: + enum { + COLUMN_FIRST, + COLUMN_FILE = COLUMN_FIRST, + COLUMN_PATH, + COLUMN_STATUS, + COLUMN_TIMELEFT, + COLUMN_SPEED, + COLUMN_SIZE, + COLUMN_LAST + }; + + enum { + SPEAKER_DISCONNECTED, + SPEAKER_REMOVED, + SPEAKER_TICK + }; + + struct TickInfo { + TickInfo(const string& path_) : path(path_), done(0), bps(0), users(0) { } + + string path; + int64_t done; + double bps; + int users; + }; + + class DownloadInfo { + public: + DownloadInfo(const string& filename, int64_t size); + + const tstring& getText(int col) const { + return columns[col]; + } + + int getImage() const { + return 0; + } + + static int compareItems(DownloadInfo* a, DownloadInfo* b, int col) { + return lstrcmpi(a->columns[col].c_str(), b->columns[col].c_str()); + } + + void update(); + void update(const TickInfo& ti); + + string path; + int64_t done; + int64_t size; + double bps; + int users; + + tstring columns[COLUMN_LAST]; + }; + + typedef TypedListView<DownloadInfo> WidgetDownloads; + typedef WidgetDownloads* WidgetDownloadsPtr; + WidgetDownloadsPtr downloads; + + static int columnSizes[COLUMN_LAST]; + static int columnIndexes[COLUMN_LAST]; + + bool startup; + + int find(const string& path); + + bool handleKeyDown(int c); + bool handleContextMenu(SmartWin::ScreenCoordinate pt); + LRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); + + virtual void on(DownloadManagerListener::Tick, const DownloadList&) throw(); + virtual void on(DownloadManagerListener::Complete, Download*) throw(); + virtual void on(DownloadManagerListener::Failed, Download*, const string&) throw(); + + virtual void on(QueueManagerListener::Removed, QueueItem*) throw(); +}; + +#endif Modified: dcplusplus/trunk/win32/FinishedFrameBase.h =================================================================== --- dcplusplus/trunk/win32/FinishedFrameBase.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/FinishedFrameBase.h 2008-01-03 19:21:30 UTC (rev 955) @@ -173,7 +173,7 @@ tstring columns[COLUMN_LAST]; }; - typedef TypedListView<T, ItemInfo> WidgetItems; + typedef TypedListView<ItemInfo> WidgetItems; typedef WidgetItems* WidgetItemsPtr; WidgetItemsPtr items; Modified: dcplusplus/trunk/win32/HubFrame.h =================================================================== --- dcplusplus/trunk/win32/HubFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/HubFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -149,7 +149,7 @@ WidgetVPanedPtr paned; WidgetCheckBoxPtr showUsers; - typedef TypedListView<HubFrame, UserInfo, false> WidgetUsers; + typedef TypedListView<UserInfo, false> WidgetUsers; typedef WidgetUsers* WidgetUsersPtr; WidgetUsersPtr users; Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/MainWindow.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -59,6 +59,7 @@ #include <dcpp/ShareManager.h> #include <dcpp/QueueManager.h> #include <dcpp/ClientManager.h> +#include <dcpp/Download.h> MainWindow::MainWindow() : WidgetFactory<SmartWin::WidgetWindow>(0), Modified: dcplusplus/trunk/win32/PublicHubsFrame.h =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/PublicHubsFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -94,7 +94,7 @@ tstring columns[COLUMN_LAST]; }; - typedef TypedListView<PublicHubsFrame, HubInfo> WidgetHubs; + typedef TypedListView<HubInfo> WidgetHubs; typedef WidgetHubs* WidgetHubsPtr; WidgetHubsPtr hubs; Modified: dcplusplus/trunk/win32/QueueFrame.h =================================================================== --- dcplusplus/trunk/win32/QueueFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/QueueFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -204,11 +204,11 @@ TaskQueue tasks; - typedef TypedTreeView<QueueFrame, DirItemInfo> WidgetDirs; + typedef TypedTreeView<DirItemInfo> WidgetDirs; typedef WidgetDirs* WidgetDirsPtr; WidgetDirsPtr dirs; - typedef TypedListView<QueueFrame, QueueItemInfo, false> WidgetFiles; + typedef TypedListView<QueueItemInfo, false> WidgetFiles; typedef WidgetFiles* WidgetFilesPtr; WidgetFilesPtr files; WidgetVPanedPtr paned; Modified: dcplusplus/trunk/win32/SearchFrame.h =================================================================== --- dcplusplus/trunk/win32/SearchFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/SearchFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -171,13 +171,13 @@ bool onlyFree; WidgetStaticPtr hubsLabel; - typedef TypedListView<SearchFrame, HubInfo> WidgetHubs; + typedef TypedListView<HubInfo> WidgetHubs; typedef WidgetHubs* WidgetHubsPtr; WidgetHubsPtr hubs; WidgetButtonPtr doSearch; - typedef TypedListView<SearchFrame, SearchInfo> WidgetResults; + typedef TypedListView<SearchInfo> WidgetResults; typedef WidgetResults* WidgetResultsPtr; WidgetResultsPtr results; Modified: dcplusplus/trunk/win32/StaticFrame.h =================================================================== --- dcplusplus/trunk/win32/StaticFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/StaticFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -27,6 +27,13 @@ template<class T> class StaticFrame : public MDIChildFrame<T> { public: + + StaticFrame(SmartWin::WidgetTabView* mdiClient, const tstring& title) : + MDIChildFrame<T>(mdiClient, title, SmartWin::IconPtr(new SmartWin::Icon(T::ICON_RESOURCE))) + { + } + + /** @deprecated */ StaticFrame(SmartWin::WidgetTabView* mdiClient) : MDIChildFrame<T>(mdiClient, TSTRING_I(T::TITLE_RESOURCE), SmartWin::IconPtr(new SmartWin::Icon(T::ICON_RESOURCE))) { Modified: dcplusplus/trunk/win32/TransferView.cpp =================================================================== --- dcplusplus/trunk/win32/TransferView.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/TransferView.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -31,6 +31,8 @@ #include <dcpp/UploadManager.h> #include <dcpp/QueueManager.h> #include <dcpp/ClientManager.h> +#include <dcpp/Download.h> +#include <dcpp/Upload.h> int TransferView::columnIndexes[] = { COLUMN_USER, COLUMN_HUB, COLUMN_STATUS, COLUMN_TIMELEFT, COLUMN_SPEED, COLUMN_FILE, COLUMN_SIZE, COLUMN_PATH, COLUMN_IP, COLUMN_RATIO, COLUMN_CID, COLUMN_CIPHER }; int TransferView::columnSizes[] = { 150, 100, 250, 75, 75, 175, 100, 200, 50, 75, 125, 125 }; @@ -617,6 +619,14 @@ speak(); } +void TransferView::on(DownloadManagerListener::Complete, Download* aDownload) throw() { + onTransferComplete(aDownload, false); +} + +void TransferView::on(UploadManagerListener::Complete, Upload* aUpload) throw() { + onTransferComplete(aUpload, true); +} + void TransferView::onTransferComplete(Transfer* aTransfer, bool isUpload) { UpdateInfo* ui = new UpdateInfo(aTransfer->getUser(), !isUpload); Modified: dcplusplus/trunk/win32/TransferView.h =================================================================== --- dcplusplus/trunk/win32/TransferView.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/TransferView.h 2008-01-03 19:21:30 UTC (rev 955) @@ -25,8 +25,6 @@ #include <dcpp/TaskQueue.h> #include <dcpp/forward.h> #include <dcpp/Util.h> -#include <dcpp/Download.h> -#include <dcpp/Upload.h> #include "AspectSpeaker.h" #include "TypedListView.h" @@ -173,7 +171,7 @@ static int columnIndexes[]; static int columnSizes[]; - typedef TypedListView<TransferView, ItemInfo> WidgetTransfers; + typedef TypedListView<ItemInfo> WidgetTransfers; typedef WidgetTransfers* WidgetTransfersPtr; WidgetTransfersPtr transfers; SmartWin::WidgetTabView* mdi; @@ -207,14 +205,14 @@ virtual void on(ConnectionManagerListener::Removed, ConnectionQueueItem* aCqi) throw(); virtual void on(ConnectionManagerListener::StatusChanged, ConnectionQueueItem* aCqi) throw(); - virtual void on(DownloadManagerListener::Complete, Download* aDownload) throw() { onTransferComplete(aDownload, false);} + virtual void on(DownloadManagerListener::Complete, Download* aDownload) throw(); virtual void on(DownloadManagerListener::Failed, Download* aDownload, const string& aReason) throw(); virtual void on(DownloadManagerListener::Starting, Download* aDownload) throw(); virtual void on(DownloadManagerListener::Tick, const DownloadList& aDownload) throw(); virtual void on(UploadManagerListener::Starting, Upload* aUpload) throw(); virtual void on(UploadManagerListener::Tick, const UploadList& aUpload) throw(); - virtual void on(UploadManagerListener::Complete, Upload* aUpload) throw() { onTransferComplete(aUpload, true); } + virtual void on(UploadManagerListener::Complete, Upload* aUpload) throw(); void onTransferComplete(Transfer* aTransfer, bool isUpload); Modified: dcplusplus/trunk/win32/TypedListView.h =================================================================== --- dcplusplus/trunk/win32/TypedListView.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/TypedListView.h 2008-01-03 19:21:30 UTC (rev 955) @@ -19,12 +19,14 @@ #ifndef DCPLUSPLUS_WIN32_TYPED_LIST_VIEW_H #define DCPLUSPLUS_WIN32_TYPED_LIST_VIEW_H -template<class T, class ContentType, bool managed = true> -class TypedListView : public T::WidgetListView +#include <dcpp/Util.h> + +template<class ContentType, bool managed = true> +class TypedListView : public SmartWin::WidgetListView { private: - typedef typename T::WidgetListView BaseType; - typedef TypedListView<T, ContentType, managed> ThisType; + typedef typename SmartWin::WidgetListView BaseType; + typedef TypedListView<ContentType, managed> ThisType; public: typedef ThisType* ObjectType; @@ -38,7 +40,7 @@ this->clear(); } - void create( const typename BaseType::Seed & cs = BaseType::getDefaultSeed() ) { + void create( const typename BaseType::Seed & cs = BaseType::Seed() ) { BaseType::create(cs); this->setCallback( Modified: dcplusplus/trunk/win32/TypedTreeView.h =================================================================== --- dcplusplus/trunk/win32/TypedTreeView.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/TypedTreeView.h 2008-01-03 19:21:30 UTC (rev 955) @@ -20,19 +20,19 @@ #define DCPLUSPLUS_WIN32_TYPED_TREE_VIEW_H -template<class T, class ContentType> -class TypedTreeView : public T::WidgetTreeView +template<class ContentType> +class TypedTreeView : public SmartWin::WidgetTreeView { private: - typedef typename T::WidgetTreeView BaseType; - typedef TypedTreeView<T, ContentType> ThisType; + typedef typename SmartWin::WidgetTreeView BaseType; + typedef TypedTreeView<ContentType> ThisType; public: typedef ThisType* ObjectType; explicit TypedTreeView( SmartWin::Widget* parent ) : BaseType(parent) { } - void create( const typename BaseType::Seed & cs = BaseType::getDefaultSeed() ) { + void create( const typename BaseType::Seed & cs = BaseType::Seed() ) { BaseType::create(cs); this->setCallback( SmartWin::Message( WM_NOTIFY, TVN_GETDISPINFO ), &TypedTreeViewDispatcher Modified: dcplusplus/trunk/win32/UsersFrame.h =================================================================== --- dcplusplus/trunk/win32/UsersFrame.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/UsersFrame.h 2008-01-03 19:21:30 UTC (rev 955) @@ -93,7 +93,7 @@ tstring columns[COLUMN_LAST]; }; - typedef TypedListView<UsersFrame, UserInfo> WidgetUsers; + typedef TypedListView<UserInfo> WidgetUsers; typedef WidgetUsers* WidgetUsersPtr; WidgetUsersPtr users; Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -39,6 +39,7 @@ #include "MagnetDlg.h" #include "HubFrame.h" #include "SearchFrame.h" +#include "MainWindow.h" tstring WinUtil::tth; SmartWin::BrushPtr WinUtil::bgBrush; @@ -52,8 +53,7 @@ int WinUtil::dirIconIndex; int WinUtil::dirMaskedIndex; TStringList WinUtil::lastDirs; -SmartWin::Widget* WinUtil::mainWindow = 0; -SmartWin::WidgetTabView* WinUtil::mdiParent = 0; +MainWindow* WinUtil::mainWindow = 0; bool WinUtil::urlDcADCRegistered = false; bool WinUtil::urlMagnetRegistered = false; WinUtil::ImageMap WinUtil::fileIndexes; @@ -252,7 +252,7 @@ } } else if(Util::stricmp(cmd.c_str(), _T("search")) == 0) { if(!param.empty()) { - SearchFrame::openWindow(mdiParent, param); + SearchFrame::openWindow(mainWindow->getMDIParent(), param); } else { status = TSTRING(SPECIFY_SEARCH_STRING); } @@ -373,7 +373,7 @@ } void WinUtil::searchHash(const TTHValue& aHash) { - SearchFrame::openWindow(mdiParent, Text::toT(aHash.toBase32()), 0, SearchManager::SIZE_DONTCARE, SearchManager::TYPE_TTH); + SearchFrame::openWindow(mainWindow->getMDIParent(), Text::toT(aHash.toBase32()), 0, SearchManager::SIZE_DONTCARE, SearchManager::TYPE_TTH); } tstring WinUtil::escapeMenu(tstring str) { @@ -941,7 +941,7 @@ uint16_t port = 411; Util::decodeUrl(Text::fromT(aUrl), server, port, file); if(!server.empty()) { - HubFrame::openWindow(mdiParent, server + ":" + Util::toString(port)); + HubFrame::openWindow(mainWindow->getMDIParent(), server + ":" + Util::toString(port)); } if(!file.empty()) { if(file[0] == '/') // Remove any '/' in from of the file @@ -962,7 +962,7 @@ uint16_t port = 0; //make sure we get a port since adc doesn't have a standard one Util::decodeUrl(Text::fromT(aUrl), server, port, file); if(!server.empty() && port > 0) { - HubFrame::openWindow(mdiParent, "adc://" + server + ":" + Util::toString(port)); + HubFrame::openWindow(mainWindow->getMDIParent(), "adc://" + server + ":" + Util::toString(port)); } } Modified: dcplusplus/trunk/win32/WinUtil.h =================================================================== --- dcplusplus/trunk/win32/WinUtil.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/WinUtil.h 2008-01-03 19:21:30 UTC (rev 955) @@ -40,6 +40,8 @@ #endif +class MainWindow; + class WinUtil { public: static tstring tth; @@ -56,8 +58,8 @@ static int dirIconIndex; static int dirMaskedIndex; static TStringList lastDirs; - static SmartWin::Widget* mainWindow; - static SmartWin::WidgetTabView* mdiParent; + static MainWindow* mainWindow; + //static SmartWin::WidgetTabView* mdiParent; static DWORD helpCookie; typedef unordered_map<string, int> ImageMap; Modified: dcplusplus/trunk/win32/main.cpp =================================================================== --- dcplusplus/trunk/win32/main.cpp 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/main.cpp 2008-01-03 19:21:30 UTC (rev 955) @@ -145,7 +145,7 @@ WinUtil::init(); MainWindow* wnd = new MainWindow; WinUtil::mainWindow = wnd; - WinUtil::mdiParent = wnd->getMDIParent(); + //WinUtil::mdiParent = wnd->getMDIParent(); splash->close(); ret = app.run(); } catch(const SmartWin::xCeption& e) { Added: dcplusplus/trunk/win32/po/dcpp-win32.pot =================================================================== --- dcplusplus/trunk/win32/po/dcpp-win32.pot (rev 0) +++ dcplusplus/trunk/win32/po/dcpp-win32.pot 2008-01-03 19:21:30 UTC (rev 955) @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Jacek Sieka +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: dcpp-win32\n" +"Report-Msgid-Bugs-To: dcp...@li...\n" +"POT-Creation-Date: 2008-01-03 20:12+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL...@li...>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: win32/DownloadsFrame.cpp:36 +msgid "Downloads" +msgstr "" + +#: win32/DownloadsFrame.cpp:98 +msgid "Waiting for slot" +msgstr "" + +#: win32/DownloadsFrame.cpp:103 +#, boost-format +msgid "Downloading from %1% user" +msgid_plural "Downloading from %1% users" +msgstr[0] "" +msgstr[1] "" + +#: win32/DownloadsFrame.cpp:105 +#, boost-format +msgid "%1%/s" +msgstr "" + +#: win32/AppearancePage.cpp:86 win32/AppearancePage.cpp:109 +msgid "Default" +msgstr "" Modified: dcplusplus/trunk/win32/stdafx.h =================================================================== --- dcplusplus/trunk/win32/stdafx.h 2007-12-29 22:04:05 UTC (rev 954) +++ dcplusplus/trunk/win32/stdafx.h 2008-01-03 19:21:30 UTC (rev 955) @@ -48,5 +48,10 @@ #define PACKAGE "dcpp-win32" #define _(String) gettext(String) #define T_(String) Text::toT(gettext(String)) - +#ifdef UNICODE +#define TF_(String) boost::wformat(Text::toT(gettext(String))) +#define TFN_(String1,String2, N) boost::wformat(Text::toT(ngettext(String1, String2, N))) +#else +#define TF_(String) boost::format(Text::toT(gettext(String))) #endif +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |