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 8ba1e864b..781456c8a 100644 Binary files a/src/lang/qbittorrent_pl.qm and b/src/lang/qbittorrent_pl.qm differ 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);