From 035f2bdf182fa3a9ad7ce2177a3f110740e5283e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 8 Oct 2006 00:37:51 +0000 Subject: [PATCH] - Selective download should be fixed - updated polish translation --- Changelog | 8 +-- src/GUI.cpp | 5 +- src/lang/qbittorrent_pl.qm | Bin 15309 -> 17780 bytes src/lang/qbittorrent_pl.ts | 99 +++++++++++++++++++------------------ src/properties_imp.cpp | 77 ++++++++++++++++++++--------- src/properties_imp.h | 2 + 6 files changed, 115 insertions(+), 76 deletions(-) diff --git a/Changelog b/Changelog index 1450fb066..58dd48b2c 100644 --- a/Changelog +++ b/Changelog @@ -1,12 +1,12 @@ * Unknown - Christophe Dumez - v0.7.0 - FEATURE: Based on new libtorrent v0.11 (a lot of bugfixes, new features) - - FEATURE: Added DHT (Trackerless) support - - FEATURE: Added support for incremental download (slower but good for previewing) + - FEATURE: Added DHT (Trackerless - Decentralized BT) support - FEATURE: Audio/Video File previewing while downloading - - FEATURE: Tracker authentication support + - FEATURE: Added support for incremental download (slower but great for previewing) + - FEATURE: Added Tracker authentication support - FEATURE: Defined qBittorrent fingerprint so that it doesn't use libtorrent fingerprint anymore - FEATURE: Display an explicit error message when a download from url fails - - FEATURE: Allow the download multiple torrents from their url at once + - FEATURE: Allow the download multiple torrents from urls at once - FEATURE: New context menu on main window (Add, Start all, Pause all, Exit...) - FEATURE: Now supports one new search engines (MegaNova) - FEATURE: Rewritten search engine plugin (by fab31) diff --git a/src/GUI.cpp b/src/GUI.cpp index 41bf02aae..4ebd6feae 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -735,16 +735,19 @@ bool GUI::loadFilteredPieces(torrent_handle &h){ std::cout << "Error: Corrupted pieces file\n"; return has_filtered_pieces; } + std::vector selectionBitmask; for(int i=0; i 1){ isFiltered = 0; } - h.filter_piece(i, pieces_selection_list.at(i).toInt()); + selectionBitmask.push_back(isFiltered); +// h.filter_piece(i, isFiltered); if(isFiltered){ has_filtered_pieces = true; } } + h.filter_files(selectionBitmask); return has_filtered_pieces; } diff --git a/src/lang/qbittorrent_pl.qm b/src/lang/qbittorrent_pl.qm index 8ba1e864bb13a1a704606f6920a41fb9cac7f342..781456c8a66bed0d89a92cac37841f404a2fb69d 100644 GIT binary patch delta 4231 zcma);2~<^e9>;(8y?5Vo-^MPW!jljlyC{eEo;(otP`1olQ!Sqeb1%isWZoepa1{f_y2AG-*S)D z{jf*~?6=zy-1_axH;#4da$xeB{htjaGECkUC0H10n?fb}%K*a;q| z@l74zRm$7=I@m$^nJ`Feq0(9?&<>&cITc_Hy=oZ^uA?0lvEMHoYit283m2;3xnvNog%*Ih!nF;#;ETeo^D>c3YEdayAhoMv|64_5Oi}g! zFcy4Pl~)k}wy0{2so-%{^KE!${7!Ww-~%F4FV*RRcy5}ix@sK+E>v|KJqqqq`}^C# zv+6E~I)UGLXbx8Qu6&8eoTi@m%`PxcJ!$J{a*^4kF4&;KgG=h-{!nc3S66(b14pS} zb|T~!S>33D0?T&w$(Z@z&l;bW)kM}vj87)WkMYoBW_-N7|ap3s273-;?7_w445sR$yE~t#%Ke+ zMA8N3YC}gLX95>{c|!YSp9-QNQJZz}0vM&uYC~j#vbA|xwP3w=@?IDkv`Slh5?9eF zLOaW)g}_cDwX+mfX=mxb#QqiS?2&JQE47U)!ocI&jYkQcmMu2c2GRfM>8L1S@MA=h=T(612c z&_JEtG6$^JJ>%yDm+7h(?*R|#8jm-F*L3m~c-&c~lW&axhw0WVy-w6MQ+G0w`JC>P zd;Z{D-PJst>$*)Jy&eX1y{M0GuOtdH>ND3PGGTM|SuVT}+ogZX{Tg_}r5|G*Nfh2+ z|7-XGU2Hw^m zyy7J4=A&;tj7WCNHfR?=4^A{#yL|=z(O{o>3A|{CX~ek**OP{%TNW%z3@Lv>Xd~7c zo~z3NFBm2*{Fvwo(aY{$4l>lg(t_vthB?jU;Bv#N3&)8f!wrAli}H<}VraS23c3wj zV=}=LhP_)3gWnqVzJqe?t~XpBQUOLAZfee;{=3gHb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Yn{ zr4WT$rN9;}AoO)9yg3+_NV5WR;m6WK6K+YEmz10_3R9)U>6kDqUt0Y2Ls%hYWbViP z4^w{+C~Qc2|2HHIdn_GsYb3JdNR^vx@B^uKRDx%u#(4bE@{QD(@BluPI=*cnvKpix zu4rI{bh~IDTxJZ}kE61_=d{(Bq)EW|x^dB7G_`fonB9bh+5(I@^LudrZ7Ife0zR;f z8FM#XA_`A2uCGN2!{0TQ2&Z6+@zNFaLilfTj2+z{5h~BIOv2CQR9gvAq$Fo;nGNIQ zU5mnCmRxut5mw5MzHLNNvRs#n_fe7ZIY%knCaZtVfo<}mH!`Mzad{%vmneFg$xGS} zUorWwMo&cVG1XnhMA0Wr4aLJmvka!r(>LI3Q}@BAaL_bVKTZ_mW*WMH1;@O+2|vYZ zfl$h-p3+fPy(0H&7_;)Br&;0L-%-AG&r-K~Y+#iM^C8vM`vXSp^=V<0`Tk4Q6aITN z>d6`NSml?Qr<8vOZB>hdhgs$gWzy`Wq$j$l=fdI`#cIu0+N`J5eA{+L35s~C9FIJt zq(_}qgQ88W@?lK9`sldy!bt%?oEEo{2xZ5LYV*n diff --git a/src/lang/qbittorrent_pl.ts b/src/lang/qbittorrent_pl.ts index 209b6266b..7d8d505d6 100644 --- a/src/lang/qbittorrent_pl.ts +++ b/src/lang/qbittorrent_pl.ts @@ -128,19 +128,19 @@ Wszystkie prawa zastrżeżone © 2006 Christophe Dumez<br>(new line) Birthday: - + Urodzony: Occupation: - + Zawód: 03/05/1985 - 03/05/1985 + 03/05/1985 Student in computer science - + Student informatyki @@ -422,23 +422,23 @@ Wszystkie prawa zastrżeżone © 2006 Christophe Dumez<br>(new line) DHT (Trackerless): - + DHT (Trackerless): Disable DHT (Trackerless) support - + Wyłącz obsługę DHT (trackerless) Automatically clear finished downloads - + Automatycznie usuń zakończone Preview program - + Otwórz za pomocą Audio/Video player: - + Odtwarzacz multimedialny: @@ -817,35 +817,36 @@ Changelog: Preview process already running - + Podgląd jest już uruchomiony There is already another preview process running. Please close the other one first. - + Podgląd jest już uruchomiony. +Zamknij najpierw okno podglądu. Couldn't download Couldn't download <file> - + Nie można pobrać reason: Reason why the download failed - + powód: Downloading Example: Downloading www.example.com/test.torrent - Pobieranie + Pobieranie Please wait... - + Proszę czekać... Transfers - + Prędkość @@ -1048,26 +1049,26 @@ Please close the other one first. Transfers - + Prędkość Preview file - + Podgląd pliku Clear log - + Wyczyść logi PropListDelegate False - Nie + Nie True - Tak + Tak @@ -1109,62 +1110,62 @@ Please close the other one first. Preview impossible - + Nie ma możliwość podglądu Sorry, we can't preview this file - + Przepraszamy, podgląd pliku jest niedostępny Name - Nazwa + Nazwa Size - Rozmiar + Rozmiar Progress - Postęp + Postęp No URL entered - + Nie wprowadzono adresu URL Please type at least one URL. - + Proszę podać przynajmniej jeden adres URL. authentication Tracker authentication - + Autoryzacja do tracker-a Tracker: - + Tracker: Login - + Login Username: - + Nazwa użytkownika: Password: - Hasło: + Hasło: Log in - + Zaloguj Cancel - Anuluj + Anuluj @@ -1277,23 +1278,23 @@ Please close the other one first. downloadFromURL Download Torrents from URLs - + Pobierz Torrenty z adresów URL Only one URL per line - + W linii możesz podać tylko jeden adres URL Download - Pobierz + Pobierz Cancel - Anuluj + Anuluj Download from urls - + Pobierz z adresów @@ -1439,30 +1440,30 @@ Please close the other one first. Choose your favourite preview program - + Wybierz program którym zawsze chcesz otwierać dany typ plików preview Preview selection - + Podgląd wybranego File preview - + Podgląd pliku The following files support previewing, <br>please select one of them: - + Istnieje możliwość podglądu następujących typów plików, <br> proszę wybrać jeden z nich: Preview - + Podgląd Cancel - Anuluj + Anuluj @@ -1641,15 +1642,15 @@ Please close the other one first. Options - Opcje + Opcje Download in correct order (slower but good for previewing) - + Pobierz w ustalonej kolejności (wolniejsze ale lepsze przy korzystaniu z opcji poglądu) Share Ratio: - + Ratio: diff --git a/src/properties_imp.cpp b/src/properties_imp.cpp index 8d085ac82..487a8399b 100644 --- a/src/properties_imp.cpp +++ b/src/properties_imp.cpp @@ -130,14 +130,8 @@ properties::properties(QWidget *parent, torrent_handle h, QStringList trackerErr PropListModel->setData(PropListModel->index(row, NAME), QVariant(torrentInfo.file_at(i).path.leaf().c_str())); PropListModel->setData(PropListModel->index(row, SIZE), QVariant((qlonglong)torrentInfo.file_at(i).size)); PropListModel->setData(PropListModel->index(row, PROGRESS), QVariant((double)fp[i])); - if(h.is_piece_filtered(i)){ - PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(false)); - setRowColor(row, "red"); - }else{ - PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(true)); - setRowColor(row, "green"); - } } + loadFilteredPieces(); // Incremental download if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+QString(torrentInfo.name().c_str())+".incremental")){ incrementalDownload->setChecked(true); @@ -147,12 +141,6 @@ properties::properties(QWidget *parent, torrent_handle h, QStringList trackerErr updateProgressTimer = new QTimer(this); connect(updateProgressTimer, SIGNAL(timeout()), this, SLOT(updateProgress())); updateProgressTimer->start(2000); - std::vector filters = h.filtered_pieces(); -// std::cout << "filtered pieces: "; -// for(int i=0; i pieces_selection_list = pieces_selection.split('\n'); + if(pieces_selection_list.size() != torrentInfo.num_files()+1){ + std::cout << "Error: Corrupted pieces file\n"; + selectionBitmask.assign(torrentInfo.num_files(), 0); + return; + } + for(int i=0; i 1){ + isFiltered = 0; + } + selectionBitmask.push_back(isFiltered); +// h.filter_piece(i, isFiltered); + if(isFiltered){ + PropListModel->setData(PropListModel->index(i, SELECTED), QVariant(false)); + setRowColor(i, "red"); + }else{ + PropListModel->setData(PropListModel->index(i, SELECTED), QVariant(true)); + setRowColor(i, "green"); + } + } +} + void properties::updateProgress(){ std::vector fp; h.file_progress(fp); @@ -181,19 +203,24 @@ void properties::setRowColor(int row, QString color){ // double click on it. void properties::toggleSelectedState(const QModelIndex& index){ int row = index.row(); - if(h.is_piece_filtered(row)){ + if(selectionBitmask.at(row)){ // File is selected - h.filter_piece(row, false); + selectionBitmask.erase(selectionBitmask.begin()+row); + selectionBitmask.insert(selectionBitmask.begin()+row, 0); +// h.filter_piece(row, false); // Update list infos setRowColor(row, "green"); PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(true)); }else{ // File is not selected - h.filter_piece(row, true); + selectionBitmask.erase(selectionBitmask.begin()+row); + selectionBitmask.insert(selectionBitmask.begin()+row, 1); +// h.filter_piece(row, true); // Update list infos setRowColor(row, "red"); PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(false)); } + h.filter_files(selectionBitmask); // Save filtered pieces to a file to remember them saveFilteredPieces(); } @@ -220,9 +247,12 @@ void properties::on_select_clicked(){ foreach(index, selectedIndexes){ if(index.column() == NAME){ int row = index.row(); - if(h.is_piece_filtered(row)){ + if(selectionBitmask.at(row)){ // File is selected - h.filter_piece(row, false); + selectionBitmask.erase(selectionBitmask.begin()+row); + selectionBitmask.insert(selectionBitmask.begin()+row, 0); + h.filter_files(selectionBitmask); +// h.filter_piece(row, false); // Update list infos setRowColor(row, "green"); PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(true)); @@ -244,9 +274,12 @@ void properties::on_unselect_clicked(){ foreach(index, selectedIndexes){ if(index.column() == NAME){ int row = index.row(); - if(!h.is_piece_filtered(row)){ + if(!selectionBitmask.at(row)){ // File is selected - h.filter_piece(row, true); + selectionBitmask.erase(selectionBitmask.begin()+row); + selectionBitmask.insert(selectionBitmask.begin()+row, 1); + h.filter_files(selectionBitmask); +// h.filter_piece(row, true); // Update list infos setRowColor(row, "red"); PropListModel->setData(PropListModel->index(row, SELECTED), QVariant(false)); @@ -270,11 +303,11 @@ void properties::saveFilteredPieces(){ return; } for(int i=0; i selectionBitmask; protected slots: void on_select_clicked(); @@ -48,6 +49,7 @@ class properties : public QDialog, private Ui::properties{ void toggleSelectedState(const QModelIndex& index); void saveFilteredPieces(); void updateProgress(); + void loadFilteredPieces(); signals: void changedFilteredPieces(torrent_handle h, bool compact_mode);