- Added PluginInterface and SearchPlugin
[qtrapids] / src / gui / MainWindow.cpp
index d45cc96..4ccddd9 100644 (file)
@@ -37,7 +37,8 @@ const QString ABOUT_TEXT
        = QString(QObject::trUtf8("QtRapids, a simple BitTorrent client based on"
                "\nQt and Libtorrent."
                "\n\nURL: http://qtrapids.garage.maemo.org/"
-               "\n\nAuthor(s):\nLassi Väätämöinen, lassi.vaatamoinen@ixonos.com"
+               "\n\nAuthors:\nLassi Väätämöinen, lassi.vaatamoinen@ixonos.com"
+               "\nDenis Zalievsky, denis.zalewsky@ixonos.com"
                "\n\nIxonos Plc, Finland\n"));
 
 
@@ -128,7 +129,7 @@ void MainWindow::on_openAction_clicked()
 
 void MainWindow::on_removeAction_clicked()
 {
-       QTorrentHandle handle = dlView_->removeSelected();
+       qtrapids::QTorrentHandle handle = dlView_->removeSelected();
        btSession_.removeTorrent(handle);
 }
 
@@ -161,7 +162,9 @@ void MainWindow::on_aboutQtAction_clicked()
 
 void MainWindow::on_downloadItemSelectionChanged()
 {
+#ifdef QTRAPIDS_DEBUG
        qDebug() << "MainWindow::on_seedItemSelectionChanged():" << dlView_->currentItem();
+#endif
        if (dlView_->currentItem() != NULL) {
                emit(itemSelected(true));
        } else {
@@ -171,7 +174,9 @@ void MainWindow::on_downloadItemSelectionChanged()
 
 void MainWindow::on_seedItemSelectionChanged()
 {
+#ifdef QTRAPIDS_DEBUG
        qDebug() << "MainWindow::on_seedItemSelectionChanged():" << seedView_->currentItem();
+#endif
        if (seedView_->currentItem() != NULL) {
                emit(itemSelected(true));
        } else {
@@ -190,7 +195,9 @@ void MainWindow::handleToolBarAction(QAction* action)
 
 void MainWindow::on_torrentFileSelected(const QString& file)
 {
+#ifdef QTRAPIDS_DEBUG
        qDebug() << " MainWindow::on_torrentFileSelected(): " << file;
+#endif
        // Torrent filename empty, do nothing.
        if (file == "") {
                return;
@@ -205,24 +212,30 @@ void MainWindow::on_torrentFileSelected(const QString& file)
        // save_path is the only mandatory parameter, rest are optional.
        addParams.save_path = boost::filesystem::path(settings_.value("download/directory").toString().toStdString()); 
        //addParams.storage_mode = libtorrent::storage_mode_allocate;
-       QTorrentHandle handle = btSession_.addTorrent(addParams);
+       qtrapids::QTorrentHandle handle = btSession_.addTorrent(addParams);
        dlView_->newItem(handle);
 //     torrentHandles_.push_back(handlePtr);
+#ifdef QTRAPIDS_DEBUG
        qDebug() << "Is valid: " << handle.isValid();
+#endif
 }
 
 
 void MainWindow::on_alert(std::auto_ptr<Alert> al)
 {
+
+       
        if (al.get() != NULL) {
-               qDebug() 
-                               << "MainWindow::on_torrentAlert(): " 
-                               << QString::fromStdString(al->message());
-               
+//             qDebug() 
+//                             << "MainWindow::on_torrentAlert(): " 
+//                             << QString::fromStdString(al->message());
+
                TorrentAlert *torrentAlert 
                                = dynamic_cast<TorrentAlert*> (al.get());
+
                if (torrentAlert) {
-                       dlView_->updateItem(QTorrentHandle(torrentAlert->handle));
+                       qtrapids::QTorrentHandle torrentHandle = qtrapids::QTorrentHandle(torrentAlert->handle);
+                       dlView_->updateItem(qtrapids::QTorrentHandle(torrentAlert->handle));
                }
        
        }
@@ -232,7 +245,7 @@ void MainWindow::on_alert(std::auto_ptr<Alert> al)
 }
 
 /*
-bool MainWindow::IsNewTorrent(std::auto_ptr<QTorrentHandle> handlePtr)
+bool MainWindow::IsNewTorrent(std::auto_ptr<qtrapids::QTorrentHandle> handlePtr)
 {
        for (unsigned i = 0; i < torrentHandles_.size(); ++i) {
                if (torrentHandles_.at(i).get() == handlePtr.get()) {