Added build script of Debian
[qtrapids] / src / gui / MainWindow.cpp
index 273aadc..b1ec1a3 100644 (file)
@@ -1,11 +1,9 @@
 /***************************************************************************
- *   Copyright (C) 2009 by Lassi Väätämöinen   *
- *   lassi.vaatamoinen@ixonos.com   *
+ *   Copyright (C) 2010 by Ixonos Plc   *
  *                                                                         *
  *   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.                                   *
+ *   the Free Software Foundation; version 2 of the License.               *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
@@ -119,6 +117,7 @@ MainWindow::MainWindow():
                this, SLOT(on_alert(std::auto_ptr<Alert>)));
 
        LoadPlugins();
+       RestoreSettings();
 }
 
 
@@ -268,6 +267,12 @@ void MainWindow::LoadPlugins()
 }
 
 
+void MainWindow::RestoreSettings()
+{
+       btSession_.setUploadRateLimit(settings_.value("network/uploadRate").toInt());
+       btSession_.setDownloadRateLimit(settings_.value("network/downloadRate").toInt());
+}
+
 
 // Opens torrent information from buffer data and adds torrent to session 
 void MainWindow::StartTorrentFromBufferData(char const* data, int size)
@@ -314,8 +319,9 @@ void MainWindow::on_quitAction_clicked()
 void MainWindow::on_preferencesAction_clicked()
 {
        if (!preferencesDialog_) {
-               preferencesDialog_ = new PreferencesDialog(this);
+               preferencesDialog_ = new PreferencesDialog(this, NULL, &btSession_);
        }
+
        preferencesDialog_->show();
        preferencesDialog_->raise();
        preferencesDialog_->activateWindow();