Commit 1ec98d0b authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 3.1.3

parent f70524f4
[main]
host = https://www.transifex.com
[qbittorrent.qbittorrent_ents]
[qbittorrent.qbittorrent_v3_1_x]
file_filter = src/lang/qbittorrent_<lang>.ts
source_file = src/lang/qbittorrent_en.ts
source_lang = en
......@@ -10,7 +10,7 @@ minimum_perc = 23
mode = developer
[qbittorrent.qbittorrentdesktop]
[qbittorrent.qbittorrentdesktop_master]
source_file = src/Icons/qBittorrent.desktop
source_lang = en
type = DESKTOP
......
......@@ -81,7 +81,7 @@ Translations authors:
* files: src/lang/*.ts
* file: src/Icons/qBittorrent.desktop
copyright:
- Arabic: SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)
- 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)
......@@ -90,11 +90,13 @@ Translations authors:
- 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)
- 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: Christophe Dumez (chris@qbittorrent.org)
- Finnish: Niklas Laxström (nikerabbit@users.sourceforge.net)
- 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)
- French: Christophe Dumez (chris@qbittorrent.org)
- Galician: Marcos Lans (marcoslansgarza@gmail.com) and antiparvos(Transifex)
- Georgian: Beqa Arabuli (arabulibeqa@yahoo.com)
......@@ -110,12 +112,12 @@ Translations authors:
- 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)
- 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 at operamail.com)
- Slovak: helix84
- Spanish: Francisco Luque Contreras (frannoe@ya.com), Alfredo Monclus alfrix(Transifex) and José Antonio Moray moray33(Transifex)
- Swedish: Daniel Nylander (po@danielnylander.se)
- Swedish: Daniel Nylander (po@danielnylander.se) and Emil Hammarberg Ooglogput(Transifex)
- Turkish: Hasan Yilmaz (iletisim@hedefturkce.com)
- Ukrainian: Oleh Prypin (blaxpirit@gmail.com) and zubr139(Transifex)
- Vietnamese: Anh Phan ppanhh(Transifex)
......
* Mon Nov 20 2013 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.1.3
- FEATURE: Add a key shortcut to "Add link to torrent..." (Angel Alonso)
- BUGFIX: Make all columns and headers use the same text alignment in the transferlist. (sledgehammer999)
- BUGFIX: Fix build system for Unix/Linux. (sledgehammer999)
- BUGFIX: Case insensitive sort in Peers list. Closes #1066. (sledgehammer999)
- BUGFIX: Small optimization of WebUI responses when there isn't a data payload. (sledgehammer999)
- BUGFIX: Hide empty folders after filtering. Closes #74. (sledgehammer999)
- BUGFIX: Expand folders when filtering files. Closes #1076. (sledgehammer999)
- BUGFIX: Updated search plugin's URL (Zach Thibeau)
- BUGFIX: Strip some png to fix incorrect sRGB profiles. (Angel Alonso)
- BUGFIX: Fixed font issues on OSX Mavericks (Zach Thibeau)
- BUGFIX: Improve text in the About dialog (Artem S. Tashkinov)
- BUGFIX: Always show a peer IP address as a tool tip (Artem S. Tashkinov)
- BUGFIX: Fix inhibit system functionality. Closes #766. (sledgehammer999)
- BUGFIX: WebUI: Don't gzip too small payloads. (sledgehammer999)
- BUGFIX: Correctly detect if the browser supports gzip compression. (sledgehammer999)
- BUGFIX: Fix WebUI link to 'Anonymous mode' explanation. Closes #1093. (sledgehammer999)
- BUGFIX: Correctly update tracker tier number in the trackers tab. Closes #1075. (sledgehammer999)
- BUGFIX: Speed improvements.(sledgehammer999)
- OTHER: Updated translations.
* Tue Nov 05 2013 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.1.2
- BUGFIX: Fix WebUI gzip compression. Closes #1037. (sledgehammer999)
- BUGFIX: Fix compilation with qt < 4.8.0. Closes #1043. (sledgehammer999)
- OTHER: Updated translations.
* Mon Oct 28 2013 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.1.1
- FEATURE: Show external IP in the log. Closes #968. (sledgehammer999)
- FEATURE: Enable gzip compression in the webui. It should be faster now. (sledgehammer999)
- FEATURE: Torrents show more states(queued for checking, downloading metadata, allocating, checking resume). (sledgehammer999)
- FEATURE: Reenable "force reannounce" to all trackers. (sledgehammer999)
- FEATURE: Allow to clear the UI lock password. Closes #973. (sledgehammer999)
- FEATURE: New translations: English(Australia) and English(United Kingdom)
- BUGFIX: Expose all available translation in the WebUI. Closes #976. (sledgehammer999)
- BUGFIX: Copy IP copied wrong data. Closes #970 (sledgehammer999)
- BUGFIX: "Preview file..." didn't work on single file torrents. (sledgehammer999)
- BUGFIX: Fix and improve the scheduler (Gelmir and sledgehammer999)
- BUGFIX: RSS fixes. Closes #960, #998 (Gelmir)
- BUGFIX: Fix 'append label to save path' with magnet links. (sledgehammer999)
- BUGFIX: Can download up to 10MB .torrent file when a link is provided. Closes #879 (sledgehammer999)
- OTHER: Updated translations.
- LINUX: Fix missing conf.pri error (leigh123linux)
- WINDOWS: Don't remove file associations if they aren't our own. (sledgehammer999)
* Sat Oct 12 2013 - Christophe Dumez <chris@qbittorrent.org> and sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.1.0
- FEATURE: Add command line option to daemonize qbittorrent-nox (ngaro)
- FEATURE: Add "Shutdown qBittorrent" button to Web UI (ngaro)
......
This diff was suppressed by a .gitattributes entry.
......@@ -11,6 +11,9 @@ Type=Application
# Translations
# Translations
GenericName[ar]=العميل BitTorrent
Comment[be]=Сцягванне і раздача файлаў праз пратакол BitTorrent
......@@ -18,12 +21,19 @@ GenericName[be]=BitTorrent-кліент
Name[be]=qBittorrent
Icon[be]=qbittorrent
GenericName[bg]=Торент клиент
Comment[cs]=Stahování a sdílení souborů přes síť BitTorrent
GenericName[cs]=BitTorrent klient
Name[cs]=qBittorrent
Icon[cs]=qbittorrent
GenericName[de]=BitTorren Client
Comment[el]=Λήψη και διαμοιρασμός αρχείων μέσω BitTorrent
GenericName[el]=BitTorrent πελάτης
Name[el]=qBittorrent
Icon[el]=qbittorrent
Comment[en_GB]=Download and share files over BitTorrent
GenericName[en_GB]=BitTorrent client
Name[en_GB]=qBittorrent
Icon[en_GB]=qbittorrent
Comment[es]=Descarga y comparte archivos por BitTorrent
GenericName[es]=Cliente BitTorrent
Name[es]=qBittorrent
......@@ -32,7 +42,10 @@ Comment[eu]=Jeitsi eta elkarbanatu agiriak BitTorrent-en
GenericName[eu]=BitTorrent bezeroa
Name[eu]=qBittorrent
Icon[eu]=qbittorrent
Comment[fi]=Lataa ja jaa tiedostoja BitTorrentia käyttäen
GenericName[fi]=BitTorrent-ohjelma
Name[fi]=qBittorrent
Icon[fi]=qbittorrent
Comment[fr]=Télécharger et partager des fichiers avec BitTorrent
GenericName[fr]=Client BitTorrent
Comment[gl]=Descargue e comparta ficheiros co protocolo BitTorrent
......@@ -73,16 +86,25 @@ Comment[pt_BR]=Baixe e compartilhe arquivos através do qBittorrent
GenericName[pt_BR]=Cliente BitTorrent
Name[pt_BR]=qBittorrent
Icon[pt_BR]=qbittorrent
Comment[ro]=Descărcați și partajați fișiere prin BitTorrent
GenericName[ro]=Client BitTorrent
Name[ro]=qBittorrent
Icon[ro]=qbittorrent
Comment[ru]=Скачивайте и делитесь файлами с помощью BitTorrent
GenericName[ru]=клиент BitTorrent
Name[ru]=qBittorrent
Icon[ru]=qbittorrent
GenericName[sk]=Klient siete BitTorrent
GenericName[sr]=BitTorrent-клијент
Comment[sv]=Hämta och dela filer över BitTorrent
GenericName[sv]=BitTorrent-klient
Name[sv]=qBittorrent
Icon[sv]=qbittorrent
GenericName[tr]=BitTorrent istemcisi
Comment[uk]=Завантажувати і обмінюватися файлами через BitTorrent
GenericName[uk]=BitTorrent-клієнт
Name[uk]=qBittorrent
Icon[uk]=qbittorrent
Comment[vi]=Tải về và chia sẻ các tập tin thông qua BitTorrent
GenericName[vi]=Máy trạm dạng BitTorrent
Name[vi]=qBittorrent
......@@ -91,3 +113,7 @@ Comment[zh_TW]=經由 BitTorrent 下載並分享檔案
GenericName[zh_TW]=BitTorrent 客戶端
Name[zh_TW]=qBittorrent
Icon[zh_TW]=qbittorrent
Comment[en_AU]=Download and share files over BitTorrent
GenericName[en_AU]=BitTorrent client
Name[en_AU]=qBittorrent
Icon[en_AU]=qbittorrent
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -50,7 +50,7 @@ class about : public QDialog, private Ui::AboutDlg{
setAttribute(Qt::WA_DeleteOnClose);
// About
QString aboutText =
QString::fromUtf8("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\"><html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; }</style></head><body style=\" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">") +
QString::fromUtf8("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\"><html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; }</style></head><body style=\" font-size:11pt; font-weight:400; font-style:normal;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">") +
tr("An advanced BitTorrent client programmed in C++, based on Qt4 toolkit and libtorrent-rasterbar.") +
QString::fromUtf8(" <br /><br />") +
trUtf8("Copyright ©2006-2013 The qBittorrent project") +
......@@ -80,7 +80,7 @@ class about : public QDialog, private Ui::AboutDlg{
te_thanks->setHtml(thanks_txt);
// Translation
QString trans_txt = "<p>"+tr("I would like to thank the following people who volunteered to translate qBittorrent:")+"</p>";
trans_txt += QString::fromUtf8("<ul><li><u>Arabic:</u> SDERAWI (abz8868@msn.com) and sn51234 (nesseyan@gmail.com)</li>\
trans_txt += QString::fromUtf8("<ul><li><u>Arabic:</u> SDERAWI (abz8868@msn.com), sn51234 (nesseyan@gmail.com) and Ibrahim Saed ibraheem_alex(Transifex)</li>\
<li><u>Armenian:</u> Hrant Ohanyan (hrantohanyan@mail.am)</li>\
<li><u>Basque:</u> Xabier Aramendi (azpidatziak@gmail.com)</li>\
<li><u>Belarusian:</u> Mihas Varantsou (meequz@gmail.com)</li>\
......@@ -89,10 +89,12 @@ class about : public QDialog, private Ui::AboutDlg{
<li><u>Chinese (Simplified):</u> Guo Yue (yue.guo0418@gmail.com)</li>\
<li><u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com) and 冥王歐西里斯 s8321414(Transifex)</li>\
<li><u>Croatian:</u> Oliver Mucafir (oliver.untwist@gmail.com)</li>\
<li><u>Czech:</u> Jirka Vilim (web@tets.cz)</li>\
<li><u>Czech:</u> Jirka Vilim (web@tets.cz) and Petr Cernobila abr(Transifex)</li>\
<li><u>Danish:</u> Mathias Nielsen (comoneo@gmail.com)</li>\
<li><u>Dutch:</u> Pieter Heyvaert (pieter_heyvaert@hotmail.com)</li>\
<li><u>Finnish:</u> Niklas Laxström (nikerabbit@users.sourceforge.net) and Pekka Niemi (pekka.niemi@iki.fi)</li>\
<li><u>English(Australia):</u> Robert Readman readmanr(Transifex)</li>\
<li><u>English(United Kingdom):</u> Robert Readman readmanr(Transifex)</li>\
<li><u>Finnish:</u> Niklas Laxström (nikerabbit@users.sourceforge.net), Pekka Niemi (pekka.niemi@iki.fi) and Jiri Grönroos artnay(Transifex)</li>\
<li><u>Galician:</u> Marcos Lans (marcoslansgarza@gmail.com) and antiparvos(Transifex)</li>\
<li><u>Georgian:</u> Beqa Arabuli (arabulibeqa@yahoo.com)</li>\
<li><u>German:</u> Niels Hoffmann (zentralmaschine@users.sourceforge.net)</li>\
......@@ -107,12 +109,12 @@ class about : public QDialog, private Ui::AboutDlg{
<li><u>Polish:</u> Mariusz Fik (fisiu@opensuse.org)</li>\
<li><u>Portuguese:</u> Sérgio Marques smarquespt(Transifex)</li>\
<li><u>Portuguese(Brazil):</u> Nick Marinho (nickmarinho@gmail.com)</li>\
<li><u>Romanian:</u> Obada Denis (obadadenis@users.sourceforge.net)</li>\
<li><u>Romanian:</u> Obada Denis (obadadenis@users.sourceforge.net), Adrian Gabor Adriannho(Transifex) and Mihai Coman z0id(Transifex)</li>\
<li><u>Russian:</u> 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)</li>\
<li><u>Serbian:</u> Anaximandar Milet (anaximandar@operamail.com)</li>\
<li><u>Slovak:</u> helix84</li>\
<li><u>Spanish:</u> Alfredo Monclús (alfrix), Francisco Luque Contreras (frannoe@ya.com) and José Antonio Moray moray33(Transifex)</li>\
<li><u>Swedish:</u> Daniel Nylander (po@danielnylander.se)</li>\
<li><u>Swedish:</u> Daniel Nylander (po@danielnylander.se) and Emil Hammarberg Ooglogput(Transifex)</li>\
<li><u>Turkish:</u> Hasan YILMAZ (iletisim@hedefturkce.com) and Erdem Bingöl (erdem84@gmail.com)</li>\
<li><u>Ukrainian:</u> Oleh Prypin (blaxpirit@gmail.com)</li>\
<li><u>Vietnamese:</u> Anh Phan ppanhh(Transifex)</li></ul>");
......
......@@ -202,16 +202,16 @@ void DownloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal)
if (!reply) return;
if (bytesTotal > 0) {
// Total number of bytes is available
if (bytesTotal > 1048576) {
// More than 1MB, this is probably not a torrent file, aborting...
if (bytesTotal > 1048576*10) {
// More than 10MB, this is probably not a torrent file, aborting...
reply->abort();
reply->deleteLater();
} else {
disconnect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64)));
}
} else {
if (bytesReceived > 1048576) {
// More than 1MB, this is probably not a torrent file, aborting...
if (bytesReceived > 1048576*10) {
// More than 10MB, this is probably not a torrent file, aborting...
reply->abort();
reply->deleteLater();
}
......
......@@ -9,6 +9,8 @@
<file>lang/qbittorrent_de.qm</file>
<file>lang/qbittorrent_el.qm</file>
<file>lang/qbittorrent_en.qm</file>
<file>lang/qbittorrent_en_AU.qm</file>
<file>lang/qbittorrent_en_GB.qm</file>
<file>lang/qbittorrent_es.qm</file>
<file>lang/qbittorrent_eu.qm</file>
<file>lang/qbittorrent_fi.qm</file>
......
For future maintainers on how to update translations from Transifex.
Project page: https://www.transifex.com/projects/p/qbittorrent/
Most of the options are setup in the .tx/config file. You will need to have the Transifex client app in your path.
The examples use the tx app on Windows. Other OSs should be similar.
===Updating the translations===
1. In the root folder of the project just run "tx pull"
2. Commit to git
===Pulling new translation files===
1. In the root folder of the project just run "tx pull -a"
2. Commit to git each translation file separately with its own message.
3. After you commit all new files expose them in app. Edit:
a. lang.qrc
b. options_imp.cpp: options_imp::languageToLocalizedString()
c. src.pro: The TRANSLATIONS var
d. preferences_content.html: search for: <select id="locale_select">
Note: This will also pull updated translations if you haven't already 'tx pull'.
===Updating the qBittorrent.desktop file===
1. In the root folder of the project just run "tx pull -s -r qbittorrent.qbittorrentdesktop_master"
2. Commit to git
It will pull the source file (en). However, in this case .desktop files contain all other translations
when you pull the source file.
===When making new branch===
1. Switch to new branch
2. Edit the .tx.config file. You should change the resource for the qbt translations from 'qbittorrent.qbittorrent_master'
to eg 'qbittorrent.qbittorrent_v3_1_x'. It follows this spec: <project>.<resource_slug>_<branchname>'
3. Commit to git
4. Use this command to create the new resource on the server and push the translations files "tx push -s -t"
===Updating the source file==
When you run lupdate Transifex needs to know that the source is updated. When creating a new resource on transifex
you should go to the website, select the resource and hit "edit resource". From there you should update the
"Source file URL". It should point to the exact file in the github repository(eg src/lang/qbittorrent_en.ts). Be sure to copy
the 'raw' link presented by github and not the regular one. This will make Transifex fetch automatically the source file
from the repo(maybe once a day). If you want to instantly update the resouce then on the correct branch run "tx push -s"
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -18,20 +18,20 @@ QT_END_NAMESPACE
class LineEdit : public QLineEdit
{
Q_OBJECT
Q_OBJECT
public:
LineEdit(QWidget *parent = 0);
LineEdit(QWidget *parent = 0);
protected:
void resizeEvent(QResizeEvent *);
void resizeEvent(QResizeEvent *);
private slots:
void updateCloseButton(const QString &text);
void updateCloseButton(const QString &text);
private:
QToolButton *clearButton;
QToolButton *searchButton;
QToolButton *clearButton;
QToolButton *searchButton;
};
#endif // LIENEDIT_H
......@@ -45,7 +45,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<string>3.1.3</string>
<key>CFBundleSignature</key>
<string>qBit</string>
<key>CFBundleExecutable</key>
......
......@@ -187,6 +187,14 @@ void sigabrtHandler(int) {
// Main
int main(int argc, char *argv[]) {
#ifdef Q_OS_MACX
if ( QSysInfo::MacintoshVersion > QSysInfo::MV_10_8 )
{
// fix Mac OS X 10.9 (mavericks) font issue
// https://bugreports.qt-project.org/browse/QTBUG-32789
QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
}
#endif
// Create Application
QString uid = misc::getUserIDString();
#ifdef DISABLE_GUI
......@@ -260,13 +268,13 @@ int main(int argc, char *argv[]) {
)) {
qDebug("Qt %s locale recognized, using translation.", qPrintable(locale));
}else{
qDebug("Qt %s locale unrecognized, using default (en_GB).", qPrintable(locale));
qDebug("Qt %s locale unrecognized, using default (en).", qPrintable(locale));
}
app.installTranslator(&qtTranslator);
if (translator.load(QString::fromUtf8(":/lang/qbittorrent_") + locale)) {
qDebug("%s locale recognized, using translation.", qPrintable(locale));
}else{
qDebug("%s locale unrecognized, using default (en_GB).", qPrintable(locale));
qDebug("%s locale unrecognized, using default (en).", qPrintable(locale));
}
app.installTranslator(&translator);
#ifndef DISABLE_GUI
......
......@@ -148,6 +148,8 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
QMenu *lockMenu = new QMenu(this);
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
QAction *clearUiLockPasswdAct = lockMenu->addAction(tr("Clear the password"));
connect(clearUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(clearUILockPassword()));
actionLock_qBittorrent->setMenu(lockMenu);
// Creating Bittorrent session
connect(QBtSession::instance(), SIGNAL(fullDiskError(QTorrentHandle, QString)), this, SLOT(fullDiskError(QTorrentHandle, QString)));
......@@ -412,6 +414,12 @@ void MainWindow::defineUILockPassword() {
}
}
void MainWindow::clearUILockPassword() {
QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Clear the password"), tr("Are you sure you want to clear the password?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
if (answer == QMessageBox::Yes)
Preferences().clearUILockPassword();
}
void MainWindow::on_actionLock_qBittorrent_triggered() {
Preferences pref;
// Check if there is a password
......@@ -547,6 +555,7 @@ void MainWindow::fullDiskError(const QTorrentHandle& h, QString msg) const {
void MainWindow::createKeyboardShortcuts() {
actionCreate_torrent->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+N")));
actionOpen->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+O")));
actionDownload_from_URL->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+O")));
actionExit->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Q")));
switchTransferShortcut = new QShortcut(QKeySequence("Alt+1"), this);
connect(switchTransferShortcut, SIGNAL(activated()), this, SLOT(displayTransferTab()));
......@@ -1408,11 +1417,7 @@ void MainWindow::on_actionAutoShutdown_system_toggled(bool enabled)
void MainWindow::checkForActiveTorrents()
{
const TorrentStatusReport report = transferList->getSourceModel()->getTorrentStatusReport();
if (report.nb_active > 0) // Active torrents are present; prevent system from suspend
m_pwr->setActivityState(true);
else
m_pwr->setActivityState(false);
m_pwr->setActivityState(transferList->getSourceModel()->inhibitSystem());
}
QIcon MainWindow::getSystrayIcon() const
......
......@@ -107,6 +107,7 @@ protected slots:
void tab_changed(int);
void on_actionLock_qBittorrent_triggered();
void defineUILockPassword();
void clearUILockPassword();
bool unlockUI();
void notifyOfUpdate(QString);
void showConnectionSettings();
......
......@@ -278,9 +278,8 @@ void options_imp::initializeLanguageCombo()
foreach (QString lang_file, lang_files) {
QString localeStr = lang_file.mid(12); // remove "qbittorrent_"
localeStr.chop(3); // Remove ".qm"
QLocale locale(localeStr);
const QString country = locale.name().split("_").last().toLower();
QString language_name = languageToLocalizedString(locale.language(), country);
QLocale locale(localeStr);
QString language_name = languageToLocalizedString(locale);
comboI18n->addItem(/*QIcon(":/Icons/flags/"+country+".png"), */language_name, locale.name());
qDebug() << "Supported locale:" << locale.name();
}
......@@ -361,7 +360,7 @@ void options_imp::saveOptions() {
if (translator->load(QString::fromUtf8(":/lang/qbittorrent_") + locale)) {
qDebug("%s locale recognized, using translation.", qPrintable(locale));
}else{
qDebug("%s locale unrecognized, using default (en_GB).", qPrintable(locale));
qDebug("%s locale unrecognized, using default (en).", qPrintable(locale));
}
qApp->installTranslator(translator);
}
......@@ -1304,10 +1303,16 @@ void options_imp::handleIPFilterParsed(bool error, int ruleCount)
disconnect(QBtSession::instance(), SIGNAL(ipFilterParsed(bool, int)), this, SLOT(handleIPFilterParsed(bool, int)));
}
QString options_imp::languageToLocalizedString(QLocale::Language language, const QString& country)
QString options_imp::languageToLocalizedString(const QLocale &locale)
{
switch(language) {
case QLocale::English: return "English";
switch(locale.language()) {
case QLocale::English: {
if (locale.country() == QLocale::Australia)
return "English(Australia)";
else if (locale.country() == QLocale::UnitedKingdom)
return "English(United Kingdom)";
return "English";
}
case QLocale::French: return QString::fromUtf8("Français");
case QLocale::German: return QString::fromUtf8("Deutsch");
case QLocale::Hungarian: return QString::fromUtf8("Magyar");
......@@ -1317,7 +1322,7 @@ QString options_imp::languageToLocalizedString(QLocale::Language language, const
case QLocale::Catalan: return QString::fromUtf8("Català");
case QLocale::Galician: return QString::fromUtf8("Galego");
case QLocale::Portuguese: {
if (country == "br")
if (locale.country() == QLocale::Brazil)
return QString::fromUtf8("Português brasileiro");
return QString::fromUtf8("Português");
}
......@@ -1346,14 +1351,14 @@ QString options_imp::languageToLocalizedString(QLocale::Language language, const
case QLocale::Basque: return QString::fromUtf8("Euskara");
case QLocale::Vietnamese: return QString::fromUtf8("tiếng Việt");
case QLocale::Chinese: {
if (country == "cn")
if (locale.country() == QLocale::China)
return QString::fromUtf8("中文 (简体)");
return QString::fromUtf8("中文 (繁體)");
}
case QLocale::Korean: return QString::fromUtf8("한글");
default: {
// Fallback to English
const QString eng_lang = QLocale::languageToString(language);
const QString eng_lang = QLocale::languageToString(locale.language());
qWarning() << "Unrecognized language name: " << eng_lang;
return eng_lang;
}
......@@ -1414,8 +1419,6 @@ bool options_imp::schedTimesOk() {
if (schedule_from->time() == schedule_to->time())
msg = tr("The start time and the end time can't be the same.");
else if (schedule_from->time() > schedule_to->time())
msg = tr("The start time can't be after the end time.");
if (!msg.isEmpty()) {
QMessageBox::critical(this, tr("Time Error"), msg);
......
......@@ -92,7 +92,7 @@ private:
void saveOptions();
void loadOptions();
void initializeLanguageCombo();
static QString languageToLocalizedString(QLocale::Language language, const QString& country);
static QString languageToLocalizedString(const QLocale &locale);
// General options
QString getLocale() const;
bool systrayIntegration() const;
......
......@@ -923,6 +923,10 @@ public:
setValue("Locking/password", md5_password);
}
void clearUILockPassword() {
remove("Locking/password");
}
QString getUILockPasswordMD5() const {
return value("Locking/password", QString()).toString();
}
......@@ -1256,7 +1260,7 @@ public:
settings.setValue("qBittorrent/shell/open/command/Default", command_str);
settings.setValue("qBittorrent/Content Type/Default", "application/x-bittorrent");
settings.setValue("qBittorrent/DefaultIcon/Default", icon_str);
} else {
} else if (isTorrentFileAssocSet()) {
settings.remove(".torrent/Default");
settings.remove(".torrent/Content Type");
settings.remove("qBittorrent/shell/Default");
......@@ -1280,7 +1284,7 @@ public:
settings.setValue("Magnet/DefaultIcon/Default", icon_str);
settings.setValue("Magnet/shell/Default", "open");
settings.setValue("Magnet/shell/open/command/Default", command_str);
} else {
} else if (isMagnetLinkAssocSet()) {
settings.remove("Magnet/Default");
settings.remove("Magnet/Content Type");
settings.remove("Magnet/URL Protocol");
......
......@@ -75,6 +75,9 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
}
}
previewList->selectionModel()->select(previewListModel->index(0, NAME), QItemSelectionModel::Select);
previewList->selectionModel()->select(previewListModel->index(0, SIZE), QItemSelectionModel::Select);
previewList->selectionModel()->select(previewListModel->index(0, PROGRESS), QItemSelectionModel::Select);
if (!previewListModel->rowCount()) {
QMessageBox::critical(0, tr("Preview impossible"), tr("Sorry, we can't preview this file"));
close();
......
......@@ -40,7 +40,7 @@ class PeerListDelegate: public QItemDelegate {
public:
enum PeerListColumns {COUNTRY, IP, CONNECTION, FLAGS, CLIENT, PROGRESS, DOWN_SPEED, UP_SPEED,
TOT_DOWN, TOT_UP, COL_COUNT};
TOT_DOWN, TOT_UP, IP_HIDDEN, COL_COUNT};
public:
PeerListDelegate(QObject *parent) : QItemDelegate(parent) {}
......
......@@ -75,19 +75,21 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent):
m_proxyModel = new PeerListSortModel();
m_proxyModel->setDynamicSortFilter(true);
m_proxyModel->setSourceModel(m_listModel);
m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
setModel(m_proxyModel);
//Explicitly set the column visibility. When columns are added/removed
//between versions this prevents some of them being hidden due to
//incorrect restoreState() being used.
for (unsigned int i=0; i<PeerListDelegate::COL_COUNT; i++)
for (unsigned int i=0; i<PeerListDelegate::IP_HIDDEN; i++)
showColumn(i);
hideColumn(PeerListDelegate::IP_HIDDEN);
hideColumn(PeerListDelegate::COL_COUNT);
if (!Preferences().resolvePeerCountries())
hideColumn(PeerListDelegate::COUNTRY);
//To also migitate the above issue, we have to resize each column when
//its size is 0, because explicitely 'showing' the column isn't enough
//in the above scenario.
for (unsigned int i=0; i<PeerListDelegate::COL_COUNT; i++)
for (unsigned int i=0; i<PeerListDelegate::IP_HIDDEN; i++)
if (!columnWidth(i))
resizeColumnToContents(i);
// Context menu
......@@ -148,7 +150,7 @@ void PeerListWidget::showPeerListMenu(const QPoint&)
QStringList selectedPeerIPs;
foreach (const QModelIndex &index, selectedIndexes) {
int row = m_proxyModel->mapToSource(index).row();
QString myip = m_listModel->data(m_listModel->index(row, PeerListDelegate::IP)).toString();
QString myip = m_listModel->data(m_listModel->index(row, PeerListDelegate::IP_HIDDEN)).toString();
selectedPeerIPs << myip;
}
// Add Peer Action
......@@ -368,6 +370,8 @@ QStandardItem* PeerListWidget::addPeer(const QString& ip, const peer_info& peer)
// Adding Peer to peer list
m_listModel->insertRow(row);
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP), ip);
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP), ip, Qt::ToolTipRole);
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP_HIDDEN), ip);
if (m_displayFlags) {
const QIcon ico = GeoIPManager::CountryISOCodeToIcon(peer.country);
if (!ico.isNull()) {
......
......@@ -79,7 +79,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
filesList->setSortingEnabled(true);
// Torrent content filtering
m_contentFilerLine = new LineEdit(this);
connect(m_contentFilerLine, SIGNAL(textChanged(QString)), PropListModel, SLOT(setFilterFixedString(QString)));
connect(m_contentFilerLine, SIGNAL(textChanged(QString)), this, SLOT(filterText(QString)));
contentFilterLayout->insertWidget(1, m_contentFilerLine);
// SIGNAL/SLOTS
......@@ -736,3 +736,13 @@ void PropertiesWidget::filteredFilesChanged() {
applyPriorities();
}
}
void PropertiesWidget::filterText(const QString& filter) {
PropListModel->setFilterFixedString(filter);
if (filter.isEmpty()) {
filesList->collapseAll();
filesList->expand(PropListModel->index(0, 0));
}
else
filesList->expandAll();
}
......@@ -116,6 +116,9 @@ private:
QShortcut *editHotkeyFile;
QShortcut *editHotkeyWeb;
QShortcut *deleteHotkeyWeb;
private slots: