X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgui%2FMainWindow.h;h=6f104d25970a41982ac2900567706b3eb66c7f37;hb=a988ddfbc3be7773bccd4017a70fcd8ce990d8c7;hp=1b1155e67df0b37f47716f45b5d8dc1d7b8ddd61;hpb=b00c42d2b71e46b466d5796900f5bf5cb6017063;p=qtrapids diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 1b1155e..6f104d2 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -21,42 +21,72 @@ #define MAINWINDOW_H #include +#include +#include +#include +#include "PluginInterface.h" #include "QBittorrentSession.h" class QTabWidget; class DownloadView; class SeedView; - +class PreferencesDialog; /** @author Lassi Väätämöinen */ -class MainWindow : public QMainWindow { +class MainWindow : public QMainWindow, public qtrapids::PluginHostInterface { Q_OBJECT public: MainWindow(); - ~MainWindow(); + virtual ~MainWindow(); + + // Implemented from PluginHostInterface + virtual bool setGui(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addPluginWidget(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addToolbar(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addToolItem(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addMenu(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addMenuItem(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual bool eventRequest(QVariant param, PluginRequest req = UNKNOWN_REQUEST); + + signals: + void itemSelected(bool enabled); public slots: private slots: void on_openAction_clicked(); + void on_removeAction_clicked(); void on_quitAction_clicked(); + void on_preferencesAction_clicked(); void on_aboutAction_clicked(); void on_aboutQtAction_clicked(); + void on_downloadItemSelectionChanged(); + void on_seedItemSelectionChanged(); void handleToolBarAction(QAction* action); void on_torrentFileSelected(const QString& file); + void on_alert(std::auto_ptr al); + + private: + void LoadPlugins(); private: QTabWidget *tabWidget_; DownloadView *dlView_; SeedView *seedView_; + PreferencesDialog *preferencesDialog_; + QSettings settings_; + QList pluginDirs_; + QStringList pluginFileNames_; + //std::vector< std::auto_ptr const > torrentHandles_; - QBittorrentSession btSession_; + qtrapids::QBittorrentSession btSession_; + //bool IsNewTorrent(std::auto_ptr handlePtr); }; #endif