diff --git a/src/core/misc.cpp b/src/core/misc.cpp index 50c12dc12..1bedf3a1d 100644 --- a/src/core/misc.cpp +++ b/src/core/misc.cpp @@ -28,6 +28,7 @@ * Contact : chris@qbittorrent.org */ +#include "core/unicodestrings.h" #include "misc.h" #include @@ -405,7 +406,7 @@ QString misc::magnetUriToHash(const QString& magnet_uri) QString misc::userFriendlyDuration(qlonglong seconds) { if (seconds < 0 || seconds >= MAX_ETA) - return QString::fromUtf8("∞"); + return QString::fromUtf8(C_INFINITY); if (seconds == 0) return "0"; if (seconds < 60) @@ -421,7 +422,7 @@ QString misc::userFriendlyDuration(qlonglong seconds) hours = hours - days * 24; if (days < 100) return QCoreApplication::translate("misc", "%1d %2h", "e.g: 2days 10hours").arg(QString::number(days)).arg(QString::number(hours)); - return QString::fromUtf8("∞"); + return QString::fromUtf8(C_INFINITY); } QString misc::getUserIDString() diff --git a/src/core/unicodestrings.h b/src/core/unicodestrings.h new file mode 100644 index 000000000..81d533bff --- /dev/null +++ b/src/core/unicodestrings.h @@ -0,0 +1,123 @@ +/* + * Bittorrent Client using Qt and libtorrent. + * Copyright (C) 2015 Mike Tzou + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * In addition, as a special exception, the copyright holders give permission to + * link this program with the OpenSSL project's "OpenSSL" library (or with + * modified versions of it that use the same license as the "OpenSSL" library), + * and distribute the linked executables. You must obey the GNU General Public + * License in all respects for all of the code used other than "OpenSSL". If you + * modify file(s), you may extend this exception to your version of the file(s), + * but you are not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + */ + +#ifdef _MSC_VER +#pragma execution_character_set("utf-8") +#endif + +const char C_INFINITY[] = "∞"; +const char C_UP[] = "▲"; +const char C_DOWN[] = "▼"; +const char C_COPYRIGHT[] = "©"; +const char C_LOCALE_ENGLISH[] = "English"; +const char C_LOCALE_ENGLISH_AUSTRALIA[] = "English(Australia)"; +const char C_LOCALE_ENGLISH_UNITEDKINGDOM[] = "English(United Kingdom)"; +const char C_LOCALE_FRENCH[] = "Français"; +const char C_LOCALE_GERMAN[] = "Deutsch"; +const char C_LOCALE_HUNGARIAN[] = "Magyar"; +const char C_LOCALE_INDONESIAN[] = "Bahasa Indonesia"; +const char C_LOCALE_ITALIAN[] = "Italiano"; +const char C_LOCALE_DUTCH[] = "Nederlands"; +const char C_LOCALE_SPANISH[] = "Español"; +const char C_LOCALE_CATALAN[] = "Català"; +const char C_LOCALE_GALICIAN[] = "Galego"; +const char C_LOCALE_PORTUGUESE[] = "Português"; +const char C_LOCALE_PORTUGUESE_BRAZIL[] = "Português brasileiro"; +const char C_LOCALE_POLISH[] = "Polski"; +const char C_LOCALE_LITHUANIAN[] = "Lietuvių"; +const char C_LOCALE_CZECH[] = "Čeština"; +const char C_LOCALE_SLOVAK[] = "Slovenčina"; +const char C_LOCALE_SERBIAN[] = "Српски"; +const char C_LOCALE_CROATIAN[] = "Hrvatski"; +const char C_LOCALE_ARMENIAN[] = "Հայերեն"; +const char C_LOCALE_ROMANIAN[] = "Română"; +const char C_LOCALE_TURKISH[] = "Türkçe"; +const char C_LOCALE_GREEK[] = "Ελληνικά"; +const char C_LOCALE_SWEDISH[] = "Svenska"; +const char C_LOCALE_FINNISH[] = "Suomi"; +const char C_LOCALE_NORWEGIAN[] = "Norsk"; +const char C_LOCALE_DANISH[] = "Dansk"; +const char C_LOCALE_BULGARIAN[] = "Български"; +const char C_LOCALE_UKRAINIAN[] = "Українська"; +const char C_LOCALE_RUSSIAN[] = "Русский"; +const char C_LOCALE_JAPANESE[] = "日本語"; +const char C_LOCALE_HEBREW[] = "עברית"; +const char C_LOCALE_HINDI[] = "हिन्दी, हिंदी"; +const char C_LOCALE_ARABIC[] = "عربي"; +const char C_LOCALE_GEORGIAN[] = "ქართული"; +const char C_LOCALE_BYELORUSSIAN[] = "Беларуская"; +const char C_LOCALE_BASQUE[] = "Euskara"; +const char C_LOCALE_VIETNAMESE[] = "tiếng Việt"; +const char C_LOCALE_CHINESE_TRADITIONAL[] = "中文 (繁體)"; +const char C_LOCALE_CHINESE_SIMPLIFIED[] = "中文 (简体)"; +const char C_LOCALE_KOREAN[] = "한글"; +const char C_THANKS[] = + "

I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.

\ +

I am pleased that people from all over the world are contributing to qBittorrent: Ishan Arora (India), Arnaud Demaizière (France) and Stephanos Antaris (Greece). Their help is greatly appreciated

\ +

I also want to thank Στέφανος Αντάρης (santaris@csd.auth.gr) and Mirco Chinelli (infinity89@fastwebmail.it) for working on Mac OS X packaging.

\ +

I am grateful to Peter Koeleman (peter@qbittorrent.org) and Mohammad Dib (mdib@qbittorrent.org) for working on qBittorrent port to Windows.

\ +

Thanks a lot to our graphist Mateusz Toboła (tobejodok@qbittorrent.org) for his great work.

"; +const char C_TRANSLATORS[] = + ""; diff --git a/src/gui/about_imp.h b/src/gui/about_imp.h index e322cec30..e2bf593c5 100644 --- a/src/gui/about_imp.h +++ b/src/gui/about_imp.h @@ -36,6 +36,7 @@ #include #include #include +#include "core/unicodestrings.h" class about : public QDialog, private Ui::AboutDlg{ Q_OBJECT @@ -53,7 +54,7 @@ class about : public QDialog, private Ui::AboutDlg{ QString::fromUtf8("

") + tr("An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar.") + QString::fromUtf8("

") + - trUtf8("Copyright ©2006-2015 The qBittorrent project") + + trUtf8("Copyright %1 2006-2015 The qBittorrent project").arg(C_COPYRIGHT) + QString::fromUtf8("

") + tr("Home Page: ") + QString::fromUtf8("http://www.qbittorrent.org

") + @@ -71,53 +72,10 @@ class about : public QDialog, private Ui::AboutDlg{ //Title lb_name->setText(QString::fromUtf8("

qBittorrent")+QString::fromUtf8(" " VERSION"

")); // Thanks - QString thanks_txt; - thanks_txt += QString::fromUtf8("

I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.

"); - thanks_txt += QString::fromUtf8("

I am pleased that people from all over the world are contributing to qBittorrent: Ishan Arora (India), Arnaud Demaizière (France) and Stephanos Antaris (Greece). Their help is greatly appreciated

"); - thanks_txt += QString::fromUtf8("

I also want to thank Στέφανος Αντάρης (santaris@csd.auth.gr) and Mirco Chinelli (infinity89@fastwebmail.it) for working on Mac OS X packaging.

"); - thanks_txt += QString::fromUtf8("

I am grateful to Peter Koeleman (peter@qbittorrent.org) and Mohammad Dib (mdib@qbittorrent.org) for working on qBittorrent port to Windows.

"); - thanks_txt += QString::fromUtf8("

Thanks a lot to our graphist Mateusz Toboła (tobejodok@qbittorrent.org) for his great work.

"); - te_thanks->setHtml(thanks_txt); + te_thanks->setHtml(QString::fromUtf8(C_THANKS)); // Translation QString trans_txt = "

"+tr("I would like to thank the following people who volunteered to translate qBittorrent:")+"

"; - trans_txt += QString::fromUtf8("
  • Arabic: SDERAWI (abz8868@msn.com), sn51234 (nesseyan@gmail.com) and Ibrahim Saed ibraheem_alex(Transifex)
  • \ -
  • Armenian: Hrant Ohanyan (hrantohanyan@mail.am)
  • \ -
  • Basque: Xabier Aramendi (azpidatziak@gmail.com)
  • \ -
  • Belarusian: Mihas Varantsou (meequz@gmail.com)
  • \ -
  • Bulgarian: Tsvetan & Boyko Bankoff (emerge_life@users.sourceforge.net)
  • \ -
  • Catalan: Francisco Luque Contreras (frannoe@ya.com)
  • \ -
  • Chinese (Simplified): Guo Yue (yue.guo0418@gmail.com)
  • \ -
  • Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com) and 冥王歐西里斯 s8321414(Transifex)
  • \ -
  • Croatian: Oliver Mucafir (oliver.untwist@gmail.com)
  • \ -
  • Czech: Jirka Vilim (web@tets.cz) and Petr Cernobila abr(Transifex)
  • \ -
  • Danish: Mathias Nielsen (comoneo@gmail.com)
  • \ -
  • Dutch: Pieter Heyvaert (pieter_heyvaert@hotmail.com)
  • \ -
  • English(Australia): Robert Readman readmanr(Transifex)
  • \ -
  • English(United Kingdom): Robert Readman readmanr(Transifex)
  • \ -
  • Finnish: Niklas Laxström (nikerabbit@users.sourceforge.net), Pekka Niemi (pekka.niemi@iki.fi) and Jiri Grönroos artnay(Transifex)
  • \ -
  • Galician: Marcos Lans (marcoslansgarza@gmail.com) and antiparvos(Transifex)
  • \ -
  • Georgian: Beqa Arabuli (arabulibeqa@yahoo.com)
  • \ -
  • German: Niels Hoffmann (zentralmaschine@users.sourceforge.net), schnurlos (schnurlos@gmail.com)
  • \ -
  • Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net), Stephanos Antaris (santaris@csd.auth.gr), sledgehammer999(hammered999@gmail.com), Γιάννης Ανθυμίδης Evropi(Transifex) and Panagiotis Tabakis(tabakisp@gmail.com)
  • \ -
  • Hebrew: David Deutsch (d.deffo@gmail.com)
  • \ -
  • Hungarian: Majoros Péter (majoros.peterj@gmail.com)
  • \ -
  • Italian: bovirus (bovirus@live.it) and Matteo Sechi (bu17714@gmail.com)
  • \ -
  • Japanese: Masato Hashimoto (cabezon.hashimoto@gmail.com)
  • \ -
  • Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
  • \ -
  • Lithuanian: Naglis Jonaitis (njonaitis@gmail.com)
  • \ -
  • Norwegian: Tomaso
  • \ -
  • Polish: Mariusz Fik (fisiu@opensuse.org)
  • \ -
  • Portuguese: Sérgio Marques smarquespt(Transifex)
  • \ -
  • Portuguese(Brazil): Nick Marinho (nickmarinho@gmail.com)
  • \ -
  • Romanian: Obada Denis (obadadenis@users.sourceforge.net), Adrian Gabor Adriannho(Transifex) and Mihai Coman z0id(Transifex)
  • \ -
  • Russian: Nick Khazov (m2k3d0n at users.sourceforge.net), Alexey Morsov (samurai@ricom.ru), Nick Tiskov Dayman(daymansmail (at) gmail (dot) com), Dmitry DmitryKX(Transifex) and kraleksandr kraleksandr(Transifex)
  • \ -
  • Serbian: Anaximandar Milet (anaximandar@operamail.com)
  • \ -
  • Slovak: helix84
  • \ -
  • Spanish: Alfredo Monclús (alfrix), Francisco Luque Contreras (frannoe@ya.com), José Antonio Moray moray33(Transifex) and Diego de las Heras(Transifex)
  • \ -
  • Swedish: Daniel Nylander (po@danielnylander.se) and Emil Hammarberg Ooglogput(Transifex)
  • \ -
  • Turkish: Hasan YILMAZ (iletisim@hedefturkce.com) and Erdem Bingöl (erdem84@gmail.com)
  • \ -
  • Ukrainian: Oleh Prypin (blaxpirit@gmail.com)
  • \ -
  • Vietnamese: Anh Phan ppanhh(Transifex)
"); + trans_txt += QString::fromUtf8(C_TRANSLATORS); trans_txt += "

"+tr("Please contact me if you would like to translate qBittorrent into your own language.")+"

"; te_translation->setHtml(trans_txt); // License diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index 2fec93f96..6f0b637d1 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -40,6 +40,7 @@ #include "fs_utils.h" #include "autoexpandabledialog.h" #include "messageboxraised.h" +#include "core/unicodestrings.h" #include #include @@ -155,7 +156,7 @@ void AddNewTorrentDialog::showEvent(QShowEvent *event) void AddNewTorrentDialog::showAdvancedSettings(bool show) { if (show) { - ui->adv_button->setText(QString::fromUtf8("▲")); + ui->adv_button->setText(QString::fromUtf8(C_UP)); ui->settings_group->setVisible(true); ui->info_group->setVisible(true); if (m_hasMetadata && (m_torrentInfo->num_files() > 1)) { @@ -169,7 +170,7 @@ void AddNewTorrentDialog::showAdvancedSettings(bool show) static_cast(layout())->insertWidget(layout()->indexOf(ui->never_show_cb) + 1, ui->adv_button); } else { - ui->adv_button->setText(QString::fromUtf8("▼")); + ui->adv_button->setText(QString::fromUtf8(C_DOWN)); ui->settings_group->setVisible(false); ui->info_group->setVisible(false); ui->buttonsHLayout->insertWidget(0, layout()->takeAt(layout()->indexOf(ui->never_show_cb) + 1)->widget()); diff --git a/src/gui/options_imp.cpp b/src/gui/options_imp.cpp index 1292c16ea..653f031a1 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/options_imp.cpp @@ -27,6 +27,7 @@ * * Contact : chris@qbittorrent.org */ + #include #include #include @@ -49,6 +50,7 @@ #include "qbtsession.h" #include "iconprovider.h" #include "dnsupdater.h" +#include "core/unicodestrings.h" #ifndef QT_NO_OPENSSL #include @@ -1328,56 +1330,56 @@ QString options_imp::languageToLocalizedString(const QLocale &locale) switch(locale.language()) { case QLocale::English: { if (locale.country() == QLocale::Australia) - return "English(Australia)"; + return QString::fromUtf8(C_LOCALE_ENGLISH_AUSTRALIA); else if (locale.country() == QLocale::UnitedKingdom) - return "English(United Kingdom)"; - return "English"; + return QString::fromUtf8(C_LOCALE_ENGLISH_UNITEDKINGDOM); + return QString::fromUtf8(C_LOCALE_ENGLISH); } - case QLocale::French: return QString::fromUtf8("Français"); - case QLocale::German: return QString::fromUtf8("Deutsch"); - case QLocale::Hungarian: return QString::fromUtf8("Magyar"); - case QLocale::Indonesian: return QString::fromUtf8("Bahasa Indonesia"); - case QLocale::Italian: return QString::fromUtf8("Italiano"); - case QLocale::Dutch: return QString::fromUtf8("Nederlands"); - case QLocale::Spanish: return QString::fromUtf8("Español"); - case QLocale::Catalan: return QString::fromUtf8("Català"); - case QLocale::Galician: return QString::fromUtf8("Galego"); + case QLocale::French: return QString::fromUtf8(C_LOCALE_FRENCH); + case QLocale::German: return QString::fromUtf8(C_LOCALE_GERMAN); + case QLocale::Hungarian: return QString::fromUtf8(C_LOCALE_HUNGARIAN); + case QLocale::Indonesian: return QString::fromUtf8(C_LOCALE_INDONESIAN); + case QLocale::Italian: return QString::fromUtf8(C_LOCALE_ITALIAN); + case QLocale::Dutch: return QString::fromUtf8(C_LOCALE_DUTCH); + case QLocale::Spanish: return QString::fromUtf8(C_LOCALE_SPANISH); + case QLocale::Catalan: return QString::fromUtf8(C_LOCALE_CATALAN); + case QLocale::Galician: return QString::fromUtf8(C_LOCALE_GALICIAN); case QLocale::Portuguese: { if (locale.country() == QLocale::Brazil) - return QString::fromUtf8("Português brasileiro"); - return QString::fromUtf8("Português"); + return QString::fromUtf8(C_LOCALE_PORTUGUESE_BRAZIL); + return QString::fromUtf8(C_LOCALE_PORTUGUESE); } - case QLocale::Polish: return QString::fromUtf8("Polski"); - case QLocale::Lithuanian: return QString::fromUtf8("Lietuvių"); - case QLocale::Czech: return QString::fromUtf8("Čeština"); - case QLocale::Slovak: return QString::fromUtf8("Slovenčina"); - case QLocale::Serbian: return QString::fromUtf8("Српски"); - case QLocale::Croatian: return QString::fromUtf8("Hrvatski"); - case QLocale::Armenian: return QString::fromUtf8("Հայերեն"); - case QLocale::Romanian: return QString::fromUtf8("Română"); - case QLocale::Turkish: return QString::fromUtf8("Türkçe"); - case QLocale::Greek: return QString::fromUtf8("Ελληνικά"); - case QLocale::Swedish: return QString::fromUtf8("Svenska"); - case QLocale::Finnish: return QString::fromUtf8("Suomi"); - case QLocale::Norwegian: return QString::fromUtf8("Norsk"); - case QLocale::Danish: return QString::fromUtf8("Dansk"); - case QLocale::Bulgarian: return QString::fromUtf8("Български"); - case QLocale::Ukrainian: return QString::fromUtf8("Українська"); - case QLocale::Russian: return QString::fromUtf8("Русский"); - case QLocale::Japanese: return QString::fromUtf8("日本語"); - case QLocale::Hebrew: return QString::fromUtf8("עברית"); - case QLocale::Hindi: return QString::fromUtf8("हिन्दी, हिंदी"); - case QLocale::Arabic: return QString::fromUtf8("عربي"); - case QLocale::Georgian: return QString::fromUtf8("ქართული"); - case QLocale::Byelorussian: return QString::fromUtf8("Беларуская"); - case QLocale::Basque: return QString::fromUtf8("Euskara"); - case QLocale::Vietnamese: return QString::fromUtf8("tiếng Việt"); + case QLocale::Polish: return QString::fromUtf8(C_LOCALE_POLISH); + case QLocale::Lithuanian: return QString::fromUtf8(C_LOCALE_LITHUANIAN); + case QLocale::Czech: return QString::fromUtf8(C_LOCALE_CZECH); + case QLocale::Slovak: return QString::fromUtf8(C_LOCALE_SLOVAK); + case QLocale::Serbian: return QString::fromUtf8(C_LOCALE_SERBIAN); + case QLocale::Croatian: return QString::fromUtf8(C_LOCALE_CROATIAN); + case QLocale::Armenian: return QString::fromUtf8(C_LOCALE_ARMENIAN); + case QLocale::Romanian: return QString::fromUtf8(C_LOCALE_ROMANIAN); + case QLocale::Turkish: return QString::fromUtf8(C_LOCALE_TURKISH); + case QLocale::Greek: return QString::fromUtf8(C_LOCALE_GREEK); + case QLocale::Swedish: return QString::fromUtf8(C_LOCALE_SWEDISH); + case QLocale::Finnish: return QString::fromUtf8(C_LOCALE_FINNISH); + case QLocale::Norwegian: return QString::fromUtf8(C_LOCALE_NORWEGIAN); + case QLocale::Danish: return QString::fromUtf8(C_LOCALE_DANISH); + case QLocale::Bulgarian: return QString::fromUtf8(C_LOCALE_BULGARIAN); + case QLocale::Ukrainian: return QString::fromUtf8(C_LOCALE_UKRAINIAN); + case QLocale::Russian: return QString::fromUtf8(C_LOCALE_RUSSIAN); + case QLocale::Japanese: return QString::fromUtf8(C_LOCALE_JAPANESE); + case QLocale::Hebrew: return QString::fromUtf8(C_LOCALE_HEBREW); + case QLocale::Hindi: return QString::fromUtf8(C_LOCALE_HINDI); + case QLocale::Arabic: return QString::fromUtf8(C_LOCALE_ARABIC); + case QLocale::Georgian: return QString::fromUtf8(C_LOCALE_GEORGIAN); + case QLocale::Byelorussian: return QString::fromUtf8(C_LOCALE_BYELORUSSIAN); + case QLocale::Basque: return QString::fromUtf8(C_LOCALE_BASQUE); + case QLocale::Vietnamese: return QString::fromUtf8(C_LOCALE_VIETNAMESE); case QLocale::Chinese: { if (locale.script() == QLocale::SimplifiedHanScript) - return QString::fromUtf8("中文 (简体)"); - return QString::fromUtf8("中文 (繁體)"); + return QString::fromUtf8(C_LOCALE_CHINESE_SIMPLIFIED); + return QString::fromUtf8(C_LOCALE_CHINESE_TRADITIONAL); } - case QLocale::Korean: return QString::fromUtf8("한글"); + case QLocale::Korean: return QString::fromUtf8(C_LOCALE_KOREAN); default: { // Fallback to English const QString eng_lang = QLocale::languageToString(locale.language()); diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index e2db2d631..f5371a4f3 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -45,6 +45,7 @@ #include "transferlistwidget.h" #include "torrentpersistentdata.h" #include "qbtsession.h" +#include "core/unicodestrings.h" #include "proplistdelegate.h" #include "torrentcontentfiltermodel.h" #include "torrentcontentmodel.h" @@ -368,8 +369,8 @@ void PropertiesWidget::loadDynamicData() { wasted->setText(misc::friendlyUnit(status.total_failed_bytes + status.total_redundant_bytes)); upTotal->setText(misc::friendlyUnit(status.all_time_upload) + " (" + misc::friendlyUnit(status.total_payload_upload) + " " + tr("session") + ")"); dlTotal->setText(misc::friendlyUnit(status.all_time_download) + " (" + misc::friendlyUnit(status.total_payload_download) + " " + tr("session") + ")"); - lbl_uplimit->setText(h.upload_limit() <= 0 ? QString::fromUtf8("∞") : misc::friendlyUnit(h.upload_limit()) + tr("/s", "/second (i.e. per second)")); - lbl_dllimit->setText(h.download_limit() <= 0 ? QString::fromUtf8("∞") : misc::friendlyUnit(h.download_limit()) + tr("/s", "/second (i.e. per second)")); + lbl_uplimit->setText(h.upload_limit() <= 0 ? QString::fromUtf8(C_INFINITY) : misc::friendlyUnit(h.upload_limit()) + tr("/s", "/second (i.e. per second)")); + lbl_dllimit->setText(h.download_limit() <= 0 ? QString::fromUtf8(C_INFINITY) : misc::friendlyUnit(h.download_limit()) + tr("/s", "/second (i.e. per second)")); QString elapsed_txt = misc::userFriendlyDuration(status.active_time); if (h.is_seed(status)) elapsed_txt += " (" + tr("Seeded for %1", "e.g. Seeded for 3m10s").arg(misc::userFriendlyDuration(status.seeding_time)) + ")"; @@ -383,7 +384,7 @@ void PropertiesWidget::loadDynamicData() { // Update ratio info const qreal ratio = QBtSession::instance()->getRealRatio(status); - shareRatio->setText(ratio > QBtSession::MAX_RATIO ? QString::fromUtf8("∞") : misc::accurateDoubleToString(ratio, 2)); + shareRatio->setText(ratio > QBtSession::MAX_RATIO ? QString::fromUtf8(C_INFINITY) : misc::accurateDoubleToString(ratio, 2)); label_seeds_val->setText(QString::number(status.num_seeds) + " " + tr("(%1 total)","e.g. (10 total)").arg(QString::number(status.list_seeds))); label_peers_val->setText(QString::number(status.num_peers - status.num_seeds) + " " + tr("(%1 total)","e.g. (10 total)").arg(QString::number(status.list_peers - status.list_seeds))); diff --git a/src/gui/speedlimitdlg.cpp b/src/gui/speedlimitdlg.cpp index 932c86f7d..fd1e2cff4 100644 --- a/src/gui/speedlimitdlg.cpp +++ b/src/gui/speedlimitdlg.cpp @@ -29,6 +29,7 @@ */ #include "speedlimitdlg.h" +#include "core/unicodestrings.h" SpeedLimitDialog::SpeedLimitDialog(QWidget *parent): QDialog(parent) { @@ -69,7 +70,7 @@ void SpeedLimitDialog::updateSpinValue(int val) const qDebug("Called updateSpinValue with %d", val); if (val <= 0) { spinBandwidth->setValue(0); - spinBandwidth->setSpecialValueText(QString::fromUtf8("∞")); + spinBandwidth->setSpecialValueText(QString::fromUtf8(C_INFINITY)); spinBandwidth->setSuffix(QString::fromUtf8("")); } else { @@ -82,7 +83,7 @@ void SpeedLimitDialog::updateSliderValue(int val) const { if (val <= 0) { spinBandwidth->setValue(0); - spinBandwidth->setSpecialValueText(QString::fromUtf8("∞")); + spinBandwidth->setSpecialValueText(QString::fromUtf8(C_INFINITY)); spinBandwidth->setSuffix(QString::fromUtf8("")); } if (val > bandwidthSlider->maximum()) diff --git a/src/gui/transferlistdelegate.cpp b/src/gui/transferlistdelegate.cpp index eb660401b..de6d94af0 100644 --- a/src/gui/transferlistdelegate.cpp +++ b/src/gui/transferlistdelegate.cpp @@ -37,6 +37,7 @@ #include "misc.h" #include "torrentmodel.h" #include "qbtsession.h" +#include "core/unicodestrings.h" #ifdef Q_OS_WIN #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) @@ -155,7 +156,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem QItemDelegate::drawBackground(painter, opt, index); const qlonglong limit = index.data().toLongLong(); opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter; - QItemDelegate::drawDisplay(painter, opt, opt.rect, limit > 0 ? misc::accurateDoubleToString(limit/1024., 1) + " " + tr("KiB/s", "KiB/second (.i.e per second)") : QString::fromUtf8("∞")); + QItemDelegate::drawDisplay(painter, opt, opt.rect, limit > 0 ? misc::accurateDoubleToString(limit/1024., 1) + " " + tr("KiB/s", "KiB/second (.i.e per second)") : QString::fromUtf8(C_INFINITY)); break; } case TorrentModelItem::TR_TIME_ELAPSED: { @@ -178,7 +179,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter; const qreal ratio = index.data().toDouble(); QItemDelegate::drawDisplay(painter, opt, opt.rect, - (ratio == -1 || ratio > QBtSession::MAX_RATIO) ? QString::fromUtf8("∞") : misc::accurateDoubleToString(ratio, 2)); + (ratio == -1 || ratio > QBtSession::MAX_RATIO) ? QString::fromUtf8(C_INFINITY) : misc::accurateDoubleToString(ratio, 2)); break; } case TorrentModelItem::TR_PRIORITY: {