- // MENUBAR
- QMenuBar *menuBar = new QMenuBar();
- QMenu *tempMenu = NULL;
-
- tempMenu = menuBar->addMenu(tr("&File"));
- QAction *openAction = tempMenu->addAction(tr("&Open"));
- QAction *removeAction = tempMenu->addAction(tr("&Remove"));
- removeAction->setEnabled(false);
- QAction *quitAction = tempMenu->addAction(tr("&Quit"));
-
- tempMenu = menuBar->addMenu(tr("&Settings"));
- QAction *preferencesAction = tempMenu->addAction(tr("&Preferences"));
-
- tempMenu = menuBar->addMenu(tr("&Help"));
- QAction *aboutAction = tempMenu->addAction(tr("&About"));
- QAction *aboutQtAction = tempMenu->addAction(tr("About &Qt"));
-
- setMenuBar(menuBar);
- connect(openAction, SIGNAL(triggered()), this, SLOT(on_openAction_clicked()));
- connect(removeAction, SIGNAL(triggered()), this, SLOT(on_removeAction_clicked()));
- connect(this, SIGNAL(itemSelected(bool)), removeAction, SLOT(setEnabled(bool)));
- connect(quitAction, SIGNAL(triggered()), this, SLOT(on_quitAction_clicked()));
- connect(preferencesAction, SIGNAL(triggered()), this, SLOT(on_preferencesAction_clicked()));
- connect(aboutAction, SIGNAL(triggered()), this, SLOT(on_aboutAction_clicked()));
- connect(aboutQtAction, SIGNAL(triggered()), this, SLOT(on_aboutQtAction_clicked()));
-
- // TABWIDGET (central widget)
- tabWidget_ = new QTabWidget();
- tabWidget_->setTabsClosable(true);
-
- /// @todo Exception handling
- dlView_ = new DownloadView(this);
- seedView_ = new SeedView(this);
- tabWidget_->addTab(dlView_, tr("Downloads"));
- tabWidget_->addTab(seedView_, tr("Seeds"));
- connect(dlView_, SIGNAL(itemSelectionChanged()), this,
- SLOT(on_downloadItemSelectionChanged()));
- connect(seedView_, SIGNAL(itemSelectionChanged()), this,
- SLOT(on_seedItemSelectionChanged()));
-
-
- // Tab widget as central widget.
- setCentralWidget(tabWidget_);
-
- // TOOLBAR
- QToolBar *toolBar = new QToolBar();
- toolBar->addAction(tr("Open"));
- removeAction = toolBar->addAction(tr("Remove"));
- removeAction->setEnabled(false);
- addToolBar(Qt::TopToolBarArea, toolBar);
-
- connect(this, SIGNAL(itemSelected(bool)), removeAction,
- SLOT(setEnabled(bool)));
- connect(toolBar, SIGNAL(actionTriggered(QAction*)), this,
- SLOT(handleToolBarAction(QAction*)));
-
- connect(&btSession_, SIGNAL(alert(std::auto_ptr<Alert>)),
- this, SLOT(on_alert(std::auto_ptr<Alert>)));
-
- LoadPlugins();
+ // MENUBAR
+ QMenuBar *menuBar = new QMenuBar();
+ QMenu *tempMenu = NULL;
+
+ tempMenu = menuBar->addMenu(tr("&File"));
+ QAction *openAction = tempMenu->addAction(tr("&Open"));
+ QAction *removeAction = tempMenu->addAction(tr("&Remove"));
+ removeAction->setEnabled(false);
+ QAction *quitAction = tempMenu->addAction(tr("&Quit"));
+
+ tempMenu = menuBar->addMenu(tr("&Settings"));
+ QAction *preferencesAction = tempMenu->addAction(tr("&Preferences"));
+
+ tempMenu = menuBar->addMenu(tr("&Help"));
+ QAction *aboutAction = tempMenu->addAction(tr("&About"));
+ QAction *aboutQtAction = tempMenu->addAction(tr("About &Qt"));
+
+ setMenuBar(menuBar);
+ connect(openAction, SIGNAL(triggered()), this, SLOT(on_openAction_clicked()));
+ connect(removeAction, SIGNAL(triggered()), this, SLOT(on_removeAction_clicked()));
+ connect(this, SIGNAL(itemSelected(bool)), removeAction, SLOT(setEnabled(bool)));
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(on_quitAction_clicked()));
+ connect(preferencesAction, SIGNAL(triggered()), this, SLOT(on_preferencesAction_clicked()));
+ connect(aboutAction, SIGNAL(triggered()), this, SLOT(on_aboutAction_clicked()));
+ connect(aboutQtAction, SIGNAL(triggered()), this, SLOT(on_aboutQtAction_clicked()));
+
+ // TABWIDGET (central widget)
+ tabWidget_ = new QTabWidget();
+ tabWidget_->setTabsClosable(true);
+
+ /// @todo Exception handling
+ dlView_ = new DownloadView(this);
+ seedView_ = new SeedView(this);
+ tabWidget_->addTab(dlView_, tr("Downloads"));
+ tabWidget_->addTab(seedView_, tr("Seeds"));
+ connect(dlView_, SIGNAL(itemSelectionChanged()), this,
+ SLOT(on_downloadItemSelectionChanged()));
+ connect(seedView_, SIGNAL(itemSelectionChanged()), this,
+ SLOT(on_seedItemSelectionChanged()));
+
+
+ // Tab widget as central widget.
+ setCentralWidget(tabWidget_);
+
+ // TOOLBAR
+ QToolBar *toolBar = new QToolBar();
+ toolBar->addAction(tr("Open"));
+ removeAction = toolBar->addAction(tr("Remove"));
+ removeAction->setEnabled(false);
+ addToolBar(Qt::TopToolBarArea, toolBar);
+
+ connect(this, SIGNAL(itemSelected(bool)), removeAction,
+ SLOT(setEnabled(bool)));
+ connect(toolBar, SIGNAL(actionTriggered(QAction*)), this,
+ SLOT(handleToolBarAction(QAction*)));
+ connect (tabWidget_, SIGNAL(tabCloseRequested(int)), this, SLOT(on_tabWidget_tabCloseRequested(int)));
+
+ connect(&btSession_, SIGNAL(alert(std::auto_ptr<Alert>)),
+ this, SLOT(on_alert(std::auto_ptr<Alert>)));
+
+ LoadPlugins();
+ RestoreSettings();