fixed addtorrent signal, add bool onstartup to connect methods

This commit is contained in:
Arnaud Demaiziere 2007-06-29 13:42:10 +00:00
parent 478a275bb5
commit dcc54a7f35
2 changed files with 9 additions and 8 deletions

View File

@ -845,7 +845,7 @@ void GUI::dropEvent(QDropEvent *event){
foreach(file, files){ foreach(file, files){
if(useTorrentAdditionDialog){ if(useTorrentAdditionDialog){
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this);
connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&)));
connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&)));
dialog->showLoad(file.trimmed().replace("file://", "")); dialog->showLoad(file.trimmed().replace("file://", ""));
}else{ }else{
@ -884,8 +884,8 @@ void GUI::on_actionOpen_triggered(){
for(unsigned int i=0; i<listSize; ++i){ for(unsigned int i=0; i<listSize; ++i){
if(useTorrentAdditionDialog){ if(useTorrentAdditionDialog){
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this);
connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&)));
connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, true, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&)));
dialog->showLoad(pathsList.at(i)); dialog->showLoad(pathsList.at(i));
}else{ }else{
BTSession.addTorrent(pathsList.at(i)); BTSession.addTorrent(pathsList.at(i));
@ -1114,7 +1114,7 @@ void GUI::processParams(const QStringList& params){
}else{ }else{
if(useTorrentAdditionDialog){ if(useTorrentAdditionDialog){
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this);
connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&)));
connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&)));
dialog->showLoad(param); dialog->showLoad(param);
}else{ }else{
@ -1131,7 +1131,7 @@ void GUI::processScannedFiles(const QStringList& params){
foreach(param, params){ foreach(param, params){
if(useTorrentAdditionDialog){ if(useTorrentAdditionDialog){
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this);
connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&)));
connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&)));
dialog->showLoad(param, true); dialog->showLoad(param, true);
}else{ }else{
@ -1145,7 +1145,7 @@ void GUI::processDownloadedFiles(const QString& path, const QString& url){
bool useTorrentAdditionDialog = settings.value("Options/Misc/TorrentAdditionDialog/Enabled", true).toBool(); bool useTorrentAdditionDialog = settings.value("Options/Misc/TorrentAdditionDialog/Enabled", true).toBool();
if(useTorrentAdditionDialog){ if(useTorrentAdditionDialog){
torrentAdditionDialog *dialog = new torrentAdditionDialog(this); torrentAdditionDialog *dialog = new torrentAdditionDialog(this);
connect(dialog, SIGNAL(torrentAddition(const QString&, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&))); connect(dialog, SIGNAL(torrentAddition(const QString&, bool, bool, const QString&)), &BTSession, SLOT(addTorrent(const QString&, bool, bool, const QString&)));
connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&))); connect(dialog, SIGNAL(setInfoBarGUI(const QString&, const QString&)), this, SLOT(setInfoBar(const QString&, const QString&)));
dialog->showLoad(path, false, url); dialog->showLoad(path, false, url);
}else{ }else{

View File

@ -45,7 +45,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
signals: signals:
void setInfoBarGUI(const QString& info, const QString& color); void setInfoBarGUI(const QString& info, const QString& color);
void torrentAddition(const QString& filePath, bool fromScanDir, const QString& from_url); void torrentAddition(const QString& filePath, bool fromScanDir, bool onStartup, const QString& from_url);
private: private:
QString fileName; QString fileName;
@ -237,7 +237,8 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
// save filtered files // save filtered files
savePiecesPriorities(); savePiecesPriorities();
// Add to download list // Add to download list
emit torrentAddition(filePath, fromScanDir, from_url); // TODO : quick fix
emit torrentAddition(filePath, fromScanDir, false, from_url);
close(); close();
} }