Added build script of Debian
[qtrapids] / src / client / MainWindow.cpp
index 36d3081..551197a 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        *
@@ -114,14 +112,14 @@ MainWindow::MainWindow() :
 
        /// @todo Exception handling
        dlView_ = new DownloadView(this);
-       seedView_ = new SeedView(this);
+       //seedView_ = new SeedView(this);
        tabWidget_->addTab(dlView_, tr("Downloads"));
-       tabWidget_->addTab(seedView_, tr("Seeds"));
+       //tabWidget_->addTab(seedView_, tr("Seeds"));
        connect(dlView_, SIGNAL(itemSelectionChanged()), this,
                SLOT(on_downloadItemSelectionChanged()));
 
-       connect(seedView_, SIGNAL(itemSelectionChanged()), this,
-               SLOT(on_seedItemSelectionChanged()));
+       //connect(seedView_, SIGNAL(itemSelectionChanged()), this,
+       //        SLOT(on_seedItemSelectionChanged()));
 
        // Tab widget as central widget.
        setCentralWidget(tabWidget_);
@@ -131,7 +129,7 @@ MainWindow::MainWindow() :
        toolBar->addAction(tr("Open"));
        removeAction = toolBar->addAction(tr("Remove"));
        removeAction->setEnabled(false);
-       addToolBar(Qt::TopToolBarArea, toolBar);
+       addToolBar(Qt::BottomToolBarArea, toolBar);
 
        connect(this, SIGNAL(itemSelected(bool)), removeAction,
                SLOT(setEnabled(bool)));
@@ -330,11 +328,14 @@ void MainWindow::StartTorrentFromBufferData(char const* data, int size)
 // =========================== PRIVATE SLOTS =================================
 void MainWindow::on_openAction_clicked()
 {
+       QString filename = QFileDialog::getOpenFileName( this, tr("Open torrent file"), QString(), tr("Torrent files (*.torrent)") );
+       on_torrentFileSelected(filename);
+       /*
        QFileDialog *dialog = new QFileDialog( this, "Open torrent file", QString(), tr("Torrent files (*.torrent)"));
        dialog->setFileMode(QFileDialog::ExistingFile);
        connect(dialog, SIGNAL(fileSelected(const QString&)), this, SLOT(on_torrentFileSelected(const QString&)));
        dialog->show();
-
+       */
 }
 
 void MainWindow::on_removeAction_clicked()
@@ -468,7 +469,7 @@ void MainWindow::handleToolBarAction(QAction* action)
 }
 
 
-void MainWindow::on_torrentFileSelected(const QString& file)
+void MainWindow::on_torrentFileSelected(QString file)
 {
 #ifdef QTRAPIDS_DEBUG
        qDebug() << " MainWindow::on_torrentFileSelected(): " << file;