Commit 6be9765a authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.4.3

parent f8c239db
......@@ -12,7 +12,7 @@ Contributors:
* Silvan Scherrer <silvan.scherrer@aroa.ch>
Code from other projects:
* files src/qtsingleapp/*
* files src/qtsingleapp/* src/lineedit/*
copyright: Nokia Corporation
license: LGPL
......
* Wed Jul 21 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.11
- BUGFIX: Fix parsing of program arguments with spaces
- BUGFIX: Fix possible crash when using alternative speed limits (#598272)
- BUGFIX: Fix possible crash on exit when using
- BUGFIX: Require GTK+ headers on compilation when libnotify is used
- BUGFIX: Added configure flag to avoid using the shipped qtsingleapplication
* Wed Jun 23 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.10
- BUGFIX: Fix Web UI in qBittorrent nox version
- BUGFIX: Improved ETA display (more user friendly)
- BUGFIX: Fix possible compilation errors with libtorrent v0.15
- BUGFIX: Fix minor issues in torrent creation tool
- BUGFIX: Use checkable actions to avoid issues on systems hiding menu icons (e.g. recent Gnome)
- BUGFIX: Use busy cursor for search plugin updates
- BUGFIX: Free disk space calculation now works if destination folder does not exist
- BUGFIX: Fix "append .!qB extension to incomplete files" feature
- BUGFIX: Several OS/2 fixes by Silvan Scherrer
- COSMETIC: Display "Alternative speed limits" button as pressed when enabled
* Sun Jun 13 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.9
- FEATURE: Official support for Win32 platform
- FEATURE: Better integration with Mac OS
- BUGFIX: Fix torrent availability computation (closes #587337)
- BUGFIX: Disable torrent addition dialog as a default
- BUGFIX: Fix Web UI authentication with Opera Browser
- BUGFIX: Fix Javascript error in Web UI when using IE
- BUGFIX: Fix a lot of encoding problems on non UTF-8 systems
- BUGFIX: Fix race condition allowing to run multiple instances (closes #286968)
- BUGFIX: Fix window hiding problem when having a modal window (closes #589070)
* Mon May 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.8
- BUGFIX: ETA for finished torrent is now 0 instead of Infinite (closes #583704)
- BUGFIX: Fix sorting of ETA column when having infinite values (closes #583347)
- BUGFIX: Torrent queue position now starts at 1 (closes #581130)
- BUGFIX: Fix unicode issue in start seeding after torrent creation code
- BUGFIX: Fix torrent error state clearance on resuming
- BUGFIX: Fix possible checkbox update in Web UI
- COSMETIC: Fix torrent properties layout
* Wed May 12 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.7
- BUGFIX: Fix unicode problem in torrent moving code
- BUGFIX: Fix possible initialization problem in Web UI
- BUGFIX: Fix torrent moving after completion feature
- BUGFIX: Improved empty folder removing code
- BUGFIX: Use guid or news url as RSS items identifier (instead of title)
- BUGFIX: Fix possible crash in RSS item selection code
- BUGFIX: Added support for url encoded ampersands in RSS
- COSMETIC: Sort torrent labels in popup menu
- I18N: Added Croatian translation
* Sun Apr 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.6
- BUGFIX: Announce to all trackers at once
- BUGFIX: Added support for single-thread boost
- BUGFIX: Remove old folder when moving a torrent
- BUGFIX: Improved reliability of torrent moving
- BUGFIX: Stop rechecking torrents when they are moved
- BUGFIX: Status filters height stays correct when the visual style changes
- I18N: Added Arabic translation
* Wed Apr 07 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.5
- BUGFIX: Fix crash when adding a new torrent label
- BUGFIX: Fix HTTPS protocol support in torrent/rss downloader
- BUGFIX: Fix default width of file name column in torrent content
- BUGFIX: Fix torrent addition dialog buttons height
- BUGFIX: Fix deprecation warnings with libtorrent v0.15
- BUGFIX: Fix "Download from URL" title size in Web UI
- BUGFIX: Fix transparency of speed limits icons
- BUGFIX: Dropped dependency on Qt gif library
- BUGFIX: Improved libboost detection by configure file
- BUGFIX: Bring back compatibility with boost v1.34
- COSMETIC: Added icons to menu actions in Web UI
* Tue Apr 06 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.4
- BUGFIX: Fix possible crash when adding a torrent
- BUGFIX: Fix failure to remember some torrents on startup
- BUGFIX: Fix torrent addition window layout (torrent content not expanding)
- BUGFIX: Fix about dialog in Web UI
- BUGFIX: Correctly clear trackers error messages once they work
- BUGFIX: Display correct share ratio for paused torrents
- COSMETIC: Improved alternative speed limits icons
* Sun Apr 04 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.3
- BUGFIX: Fix possible crash when deleting a torrent just after pausing it
- BUGFIX: Enable Apply button when alternative rate limits are changed
- BUGFIX: Source compatibility with Windows (Thanks Ishan Arora)
- BUGFIX: Source compatibility with eCS (OS/2) (Thanks Silvan Scherrer)
- BUGFIX: Cleaner binutils gold linker support
- BUGFIX: Clean fix for progress display with cleanlooks style
* Mon Mar 22 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.2
- FEATURE: DHT port can be set from Web UI
- BUGFIX: Fix possible crash with folder scanning
- BUGFIX: Fix Mac compilation
- BUGFIX: Save fast resume data every 3 minutes (for robustness)
- I18N: Updated Polish translation (thanks Szymon Świerkosz)
* Sat Mar 20 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.1
- FEATURE: Display pieces that are being downloaded
- FEATURE: Added back folder watching in Web UI
- FEATURE: Added back file prioritizing in Web UI
- BUGFIX: Fix compilation with Qt 4.4
- BUGFIX: Fix Web UI compatibility with Safari
- BUGFIX: Fix progress display with cleanlook style
- BUGFIX: Fix file filtering in complex torrents
- BUGFIX: Ask for user confirmation for recursive torrent download
- BUGFIX: Fix "add file" dialog in torrent creation tool
- BUGFIX: Fix "Ctrl+A" in Web UI
* Tue Sep 28 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.3
- BUGFIX: Fix encoding issue in command line parameters processing
- BUGFIX: Fix possible crash when changing the save path in addition dialog
- BUGFIX: Fix wrong mapping to source model
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.2
- BUGFIX: Fix display of torrent content in addition dialog
- BUGFIX: Really fix manual editing of save path in torrent addition dialog
* Sun Sep 26 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.1
- I18N: Updated Arabic translation
- I18N: Fixes to German translation
- BUGFIX: Save path can now be edited in torrent addition dialog
- BUGFIX: Fix save path encoding on non-utf8 systems
- BUGFIX: Fix saving to drive root on Windows
- BUGFIX: OGV can now be previewed
- BUGFIX: Maximum download limit is now 10MB/s
- BUGFIX: Fix 'download in scan dir' persistence
- BUGFIX: Add .torrent extension only when missing (torrent creator)
- BUGFIX: Fix possible issue with temporary download path persistence
- BUGFIX: Added support for | (OR) operator in RSS feed downloader
- BUGFIX: Fix Web UI for spanish users
- BUGFIX: Fix locale switching from Web UI
- BUGFIX: Use AND operator for torrentdownloads.net searches
- BUGFIX: Limit torrent addition dialog width to fit the screen
- COSMETIC: Fix progress bars style on Windows
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
- FEATURE: Added actions to "Move to top/bottom" of priority queue
- FEATURE: Auto-Shutdown on downloads completion
- FEATURE: Email notification on download completion
- FEATURE: Added button to password-lock the UI
- FEATURE: Added label-level Pause/Resume/Delete actions
- FEATURE: Torrents can now be filtered by name
- FEATURE: Run external program on torrent completion
- FEATURE: Detect executable updates in order to advise the user to restart
* Tue Jul 27 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
- FEATURE: Simplified torrent root folder renaming/truncating (< v2.3.0 is no longer forward compatible)
- FEATURE: Remember previous save paths in torrent addition dialog
- FEATURE: Max number of half-open connections can now be edited
- FEATURE: Added support for strict super seeding
- FEATURE: The user can force listening on a particular network interface
- FEATURE: Added cookie support for RSS feeds
- FEATURE: User can force tracker reannounce
- FEATURE: Added "No action" setting for double-click action
- FEATURE: Several torrents can be moved at once
- FEATURE: Added error state for torrents (error is displayed in a tooltip)
- FEATURE: Added filter for paused/error torrents
- FEATURE: Add Check/Uncheck all feature in Web UI
- FEATURE: Search engine can now be disabled
- FEATURE: Torrents can be automatically paused once they reach a given ratio
- FEATURE: Several files can now be disabled at once
- FEATURE: Added "Select All/None" buttons to files list
- FEATURE: Added support for BitComet links (bc://bt/...)
- BUGFIX: Hide seeding torrents files priorities in Web UI
- BUGFIX: The user can disable permanently recursive torrent download
- BUGFIX: Peer Exchange status is now correctly reported
- BUGFIX: Use an INI file instead of the registry on Windows (More reliable)
- BUGFIX: Removed client spoofing feature to avoid tracker blacklisting
- COSMETIC: Display peers country name in tooltip
- COSMETIC: Display number of torrents in transfers tab label
- COSMETIC: Simplified program preferences
- COSMETIC: Fix naming of actions opening new dialogs (use Name...)
* Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0
- FEATURE: User can set alternative speed limits for fast toggling
......
This diff is collapsed.
......@@ -37,8 +37,6 @@
#include "ui_mainwindow.h"
#include "qtorrenthandle.h"
enum TabIndex{TAB_TRANSFER, TAB_SEARCH, TAB_RSS};
class Bittorrent;
class QTimer;
class downloadFromURL;
......@@ -58,6 +56,9 @@ class consoleDlg;
class about;
class createtorrent;
class downloadFromURL;
class HidableTabWidget;
class LineEdit;
class QFileSystemWatcher;
class GUI : public QMainWindow, private Ui::MainWindow{
Q_OBJECT
......@@ -67,9 +68,10 @@ public:
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
~GUI();
// Methods
int getCurrentTabIndex() const;
QWidget* getCurrentTabWidget() const;
TransferListWidget* getTransferList() const { return transferList; }
QMenu* getTrayIconMenu();
PropertiesWidget *getProperties() const { return properties; }
public slots:
void trackerAuthenticationRequired(QTorrentHandle& h);
......@@ -77,6 +79,7 @@ public slots:
void showNotificationBaloon(QString title, QString msg) const;
void downloadFromURLList(const QStringList& urls);
void updateAltSpeedsBtn(bool alternative);
void updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused);
protected slots:
// GUI related slots
......@@ -97,6 +100,10 @@ protected slots:
void handleDownloadFromUrlFailure(QString, QString) const;
void createSystrayDelayed();
void tab_changed(int);
void on_actionLock_qBittorrent_triggered();
void defineUILockPassword();
bool unlockUI();
void notifyOfUpdate(QString);
// Keyboard shortcuts
void createKeyboardShortcuts();
void displayTransferTab() const;
......@@ -127,14 +134,16 @@ protected:
void showEvent(QShowEvent *);
bool event(QEvent * event);
void displayRSSTab(bool enable);
void displaySearchTab(bool enable);
private:
QFileSystemWatcher *executable_watcher;
// Bittorrent
Bittorrent *BTSession;
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
// GUI related
QTimer *guiUpdater;
QTabWidget *tabs;
HidableTabWidget *tabs;
StatusBar *status_bar;
QPointer<options_imp> options;
QPointer<consoleDlg> console;
......@@ -149,6 +158,8 @@ private:
PropertiesWidget *properties;
bool displaySpeedInTitle;
bool force_exit;
bool ui_locked;
LineEdit *search_filter;
// Keyboard shortcuts
QShortcut *switchSearchShortcut;
QShortcut *switchSearchShortcut2;
......@@ -159,10 +170,18 @@ private:
QAction *prioSeparator2;
QSplitter *hSplitter;
QSplitter *vSplitter;
QMenu *lockMenu;
// Search
SearchEngine *searchEngine;
QPointer<SearchEngine> searchEngine;
// RSS
QPointer<RSSImp> rssWidget;
private slots:
void on_actionSearch_engine_triggered();
void on_actionRSS_Reader_triggered();
void on_actionSpeed_in_title_bar_triggered();
void on_actionTop_tool_bar_triggered();
void on_actionShutdown_when_downloads_complete_triggered();
};
#endif
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.
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.2.11
Comment=V2.4.3
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[ar]=العميل Bittorrent
......
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.
......@@ -10,13 +10,13 @@
<string>torrent</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>qbittorrentDocument</string>
<string>qBitTorrentDocument</string>
<key>CFBundleTypeName</key>
<string>BitTorrent Document</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/x-bittorrent</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/x-bittorrent</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
......@@ -47,7 +47,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>2.2.11</string>
<string>2.4.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
......
......@@ -47,7 +47,6 @@ class about : public QDialog, private Ui::AboutDlg{
setAttribute(Qt::WA_DeleteOnClose);
// Set icons
logo->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/qbittorrent22.png")));
mascot_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/mascot.png")));
//Title
lb_name->setText(QString::fromUtf8("<b><h1>")+tr("qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
// Thanks
......
......@@ -5,19 +5,22 @@
#include <QHeaderView>
#include <QSpinBox>
#include <QCheckBox>
#include <QComboBox>
#include <QNetworkInterface>
#include <libtorrent/version.hpp>
#include "preferences.h"
enum AdvSettingsCols {PROPERTY, VALUE};
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS };
#define ROW_COUNT 9
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS };
#define ROW_COUNT 13
class AdvancedSettings: public QTableWidget {
Q_OBJECT
private:
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh;
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts;
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen;
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding, *cb_program_notifications;
QComboBox *combo_iface;
public:
AdvancedSettings(QWidget *parent=0): QTableWidget(parent) {
......@@ -46,6 +49,10 @@ public:
delete spin_list_refresh;
delete cb_resolve_countries;
delete cb_resolve_hosts;
delete spin_maxhalfopen;
delete cb_super_seeding;
delete combo_iface;
delete cb_program_notifications;
}
public slots:
......@@ -66,6 +73,21 @@ public slots:
// Peer resolution
Preferences::resolvePeerCountries(cb_resolve_countries->isChecked());
Preferences::resolvePeerHostNames(cb_resolve_hosts->isChecked());
// Max Half-Open connections
Preferences::setMaxHalfOpenConnections(spin_maxhalfopen->value());
#if LIBTORRENT_VERSION_MINOR > 14
// Super seeding
Preferences::enableSuperSeeding(cb_super_seeding->isChecked());
#endif
// Network interface
if(combo_iface->currentIndex() == 0) {
// All interfaces (default)
Preferences::setNetworkInterface(QString::null);
} else {
Preferences::setNetworkInterface(combo_iface->currentText());
}
// Program notification
Preferences::useProgramNotification(cb_program_notifications->isChecked());
}
protected slots:
......@@ -134,6 +156,45 @@ protected slots:
connect(cb_resolve_hosts, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
cb_resolve_hosts->setChecked(Preferences::resolvePeerHostNames());
setCellWidget(RESOLVE_HOSTS, VALUE, cb_resolve_hosts);
// Max Half Open connections
setItem(MAX_HALF_OPEN, PROPERTY, new QTableWidgetItem(tr("Maximum number of half-open connections [0: Disabled]")));
spin_maxhalfopen = new QSpinBox();
connect(spin_maxhalfopen, SIGNAL(valueChanged(int)), this, SLOT(emitSettingsChanged()));
spin_maxhalfopen->setMinimum(0);
spin_maxhalfopen->setMaximum(99999);
spin_maxhalfopen->setValue(Preferences::getMaxHalfOpenConnections());
setCellWidget(MAX_HALF_OPEN, VALUE, spin_maxhalfopen);
// Super seeding
setItem(SUPER_SEEDING, PROPERTY, new QTableWidgetItem(tr("Strict super seeding")));
cb_super_seeding = new QCheckBox();
connect(cb_super_seeding, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
#if LIBTORRENT_VERSION_MINOR > 14
cb_super_seeding->setChecked(Preferences::isSuperSeedingEnabled());
#else
cb_super_seeding->setEnabled(false);
#endif
setCellWidget(SUPER_SEEDING, VALUE, cb_super_seeding);
// Network interface
setItem(NETWORK_IFACE, PROPERTY, new QTableWidgetItem(tr("Network Interface (requires restart)")));
combo_iface = new QComboBox;
combo_iface->addItem(tr("Any interface", "i.e. Any network interface"));
const QString current_iface = Preferences::getNetworkInterface();
int i = 1;
foreach(const QNetworkInterface& iface, QNetworkInterface::allInterfaces()) {
if(iface.name() == "lo") continue;
combo_iface->addItem(iface.name());
if(!current_iface.isEmpty() && iface.name() == current_iface)
combo_iface->setCurrentIndex(i);
++i;
}
connect(combo_iface, SIGNAL(currentIndexChanged(int)), this, SLOT(emitSettingsChanged()));
setCellWidget(NETWORK_IFACE, VALUE, combo_iface);
// Program notifications
setItem(PROGRAM_NOTIFICATIONS, PROPERTY, new QTableWidgetItem(tr("Display program notification baloons")));
cb_program_notifications = new QCheckBox();
connect(cb_program_notifications, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
cb_program_notifications->setChecked(Preferences::useProgramNotification());
setCellWidget(PROGRAM_NOTIFICATIONS, VALUE, cb_program_notifications);
}
void emitSettingsChanged() {
......
This diff is collapsed.
......@@ -108,6 +108,7 @@ public:
session* getSession() const;
QHash<QString, TrackerInfos> getTrackersInfo(QString hash) const;
bool hasActiveTorrents() const;
bool hasDownloadingTorrents() const;
bool isQueueingEnabled() const;
int getMaximumActiveDownloads() const;
int getMaximumActiveTorrents() const;
......@@ -118,6 +119,7 @@ public:
bool useTemporaryFolder() const;
QString getDefaultSavePath() const;
ScanFoldersModel* getScanFoldersModel() const;
bool isPexEnabled() const;
#if LIBTORRENT_VERSION_MINOR < 15
void saveDHTEntry();
#endif
......@@ -153,8 +155,7 @@ public slots:
void setMaxUploadsPerTorrent(int max);
void setDownloadRateLimit(long rate);
void setUploadRateLimit(long rate);
void setGlobalRatio(float ratio);
void setDeleteRatio(float ratio);
void setMaxRatio(float ratio);
void setDHTPort(int dht_port);
void setPeerProxySettings(const proxy_settings &proxySettings);
void setHTTPProxySettings(const proxy_settings &proxySettings);
......@@ -162,10 +163,10 @@ public slots:
void startTorrentsInPause(bool b);
void setDefaultTempPath(QString temppath);
void setAppendLabelToSavePath(bool append);
void appendLabelToTorrentSavePath(QTorrentHandle h);
void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label);
void appendLabelToTorrentSavePath(QTorrentHandle &h);
void changeLabelInTorrentSavePath(QTorrentHandle &h, QString old_label, QString new_label);
#if LIBTORRENT_VERSION_MINOR > 14
void appendqBextensionToTorrent(QTorrentHandle h, bool append);
void appendqBextensionToTorrent(QTorrentHandle &h, bool append);
void setAppendqBExtension(bool append);
#endif
void applyEncryptionSettings(pe_settings se);
......@@ -189,16 +190,19 @@ public slots:
void recursiveTorrentDownload(const QTorrentHandle &h);
protected:
QString getSavePath(QString hash, bool fromScanDir = false, QString filePath = QString());
QString getSavePath(QString hash, bool fromScanDir = false, QString filePath = QString::null, QString root_folder=QString::null);
bool initWebUi(QString username, QString password, int port);
protected slots:
void addTorrentsFromScanFolder(QStringList&);
void readAlerts();
void deleteBigRatios();
void processBigRatios();
void takeETASamples();
void exportTorrentFiles(QString path);
void saveTempFastResumeData();
void sendNotificationEmail(QTorrentHandle h);
void autoRunExternalProgram(QTorrentHandle h, bool async=true);
void cleanUpAutoRunProcess(int);
signals:
void addedTorrent(QTorrentHandle& h);
......@@ -226,6 +230,7 @@ private:
QPointer<BandwidthScheduler> bd_scheduler;
QMap<QUrl, QString> savepath_fromurl;
QHash<QString, QHash<QString, TrackerInfos> > trackersInfos;
QHash<QString, QString> savePathsToRemove;
QStringList torrentsToPausedAfterChecking;
QTimer resumeDataTimer;
// Ratio
......@@ -241,6 +246,7 @@ private:
bool preAllocateAll;
bool addInPause;
float ratio_limit;
int high_ratio_action;
bool UPnPEnabled;
bool NATPMPEnabled;
bool LSDEnabled;
......
/*
* Bittorrent Client using Qt4 and libtorrent.
* Copyright (C) 2010 Christophe Dumez
*
* 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.
*
* Contact : chris@qbittorrent.org arnaud@qbittorrent.org
*/
#include "cookiesdlg.h"
#include "ui_cookiesdlg.h"
#include <QNetworkCookie>
enum CookiesCols { COOKIE_KEY, COOKIE_VALUE};
CookiesDlg::CookiesDlg(QWidget *parent, const QList<QByteArray> &raw_cookies) :
QDialog(parent),
ui(new Ui::CookiesDlg)
{
ui->setupUi(this);
ui->infos_lbl->setText(tr("Common keys for cookies are : '%1', '%2'.\nYou should get this information from your Web browser preferences.").arg("uid").arg("pass"));
foreach(const QByteArray &raw_cookie, raw_cookies) {
QList<QByteArray> cookie_parts = raw_cookie.split('=');
if(cookie_parts.size() != 2) continue;
const int i = ui->cookiesTable->rowCount();
ui->cookiesTable->setRowCount(i+1);
ui->cookiesTable->setItem(i, COOKIE_KEY, new QTableWidgetItem(cookie_parts.first().data()));
ui->cookiesTable->setItem(i, COOKIE_VALUE, new QTableWidgetItem(cookie_parts.last().data()));
}
}
CookiesDlg::~CookiesDlg()
{
delete ui;
}
void CookiesDlg::on_add_btn_clicked() {
ui->cookiesTable->setRowCount(ui->cookiesTable->rowCount()+1);
// Edit first column
ui->cookiesTable->editItem(ui->cookiesTable->item(ui->cookiesTable->rowCount()-1, COOKIE_KEY));
}
void CookiesDlg::on_del_btn_clicked() {
// Get selected cookie
QList<QTableWidgetItem*> selection = ui->cookiesTable->selectedItems();
if(!selection.isEmpty()) {
ui->cookiesTable->removeRow(selection.first()->row());
}
}
QList<QByteArray> CookiesDlg::getCookies() const {
QList<QByteArray> ret;
for(int i=0; i<ui->cookiesTable->rowCount(); ++i) {
QString key = ui->cookiesTable->item(i, COOKIE_KEY)->text().trimmed();
QString value = ui->cookiesTable->item(i, COOKIE_VALUE)->text().trimmed();
if(!key.isEmpty() && !value.isEmpty()) {
const QString raw_cookie = key+"="+value;
qDebug("Cookie: %s", qPrintable(raw_cookie));
ret << raw_cookie.toLocal8Bit();
}
}
return ret;
}
QList<QByteArray> CookiesDlg::askForCookies(QWidget *parent, const QList<QByteArray> &raw_cookies, bool *ok) {
CookiesDlg dlg(parent, raw_cookies);
if(dlg.exec()) {
*ok = true;
return dlg.getCookies();
}
*ok = false;
return QList<QByteArray>();
}
/*
* Bittorrent Client using Qt4 and libtorrent.
* Copyright (C) 2010 Christophe Dumez
*
* 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.
*
* Contact : chris@qbittorrent.org arnaud@qbittorrent.org
*/
#ifndef COOKIESDLG_H
#define COOKIESDLG_H
#include <QDialog>
namespace Ui {
class CookiesDlg;
}