Browse Source

Follow project coding style. Issue #2192.

adaptive-webui-19844
buinsky 10 years ago
parent
commit
2d0099238a
  1. 2463
      src/mainwindow.cpp
  2. 251
      src/mainwindow.h

2463
src/mainwindow.cpp

File diff suppressed because it is too large Load Diff

251
src/mainwindow.h

@ -66,152 +66,153 @@ class QTabWidget;
class QTimer; class QTimer;
QT_END_NAMESPACE QT_END_NAMESPACE
class MainWindow : public QMainWindow, private Ui::MainWindow{ class MainWindow: public QMainWindow, private Ui::MainWindow
Q_OBJECT {
Q_OBJECT
public: public:
// Construct / Destruct // Construct / Destruct
MainWindow(QWidget *parent=0, const QStringList& torrentCmdLine = QStringList()); MainWindow(QWidget *parent = 0, const QStringList& torrentCmdLine = QStringList());
// Methods // Methods
QWidget* getCurrentTabWidget() const; QWidget* getCurrentTabWidget() const;
TransferListWidget* getTransferList() const { return transferList; } TransferListWidget* getTransferList() const { return transferList; }
QMenu* getTrayIconMenu(); QMenu* getTrayIconMenu();
PropertiesWidget *getProperties() const { return properties; } PropertiesWidget *getProperties() const { return properties; }
public slots: public slots:
void trackerAuthenticationRequired(const QTorrentHandle& h); void trackerAuthenticationRequired(const QTorrentHandle& h);
void setTabText(int index, QString text) const; void setTabText(int index, QString text) const;
void showNotificationBaloon(QString title, QString msg) const; void showNotificationBaloon(QString title, QString msg) const;
void downloadFromURLList(const QStringList& urls); void downloadFromURLList(const QStringList& urls);
void updateAltSpeedsBtn(bool alternative); void updateAltSpeedsBtn(bool alternative);
void updateNbTorrents(); void updateNbTorrents();
void shutdownCleanUp(); void shutdownCleanUp();
protected slots: protected slots:
// GUI related slots // GUI related slots
void dropEvent(QDropEvent *event); void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event); void dragEnterEvent(QDragEnterEvent *event);
void toggleVisibility(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger); void toggleVisibility(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void on_actionAbout_triggered(); void on_actionAbout_triggered();
void on_actionStatistics_triggered(); void on_actionStatistics_triggered();
void on_actionCreate_torrent_triggered(); void on_actionCreate_torrent_triggered();
void on_actionWebsite_triggered() const; void on_actionWebsite_triggered() const;
void on_actionBugReport_triggered() const; void on_actionBugReport_triggered() const;
void balloonClicked(); void balloonClicked();
void writeSettings(); void writeSettings();
void readSettings(); void readSettings();
void on_actionExit_triggered(); void on_actionExit_triggered();
void createTrayIcon(); void createTrayIcon();
void fullDiskError(const QTorrentHandle& h, QString msg) const; void fullDiskError(const QTorrentHandle& h, QString msg) const;
void handleDownloadFromUrlFailure(QString, QString) const; void handleDownloadFromUrlFailure(QString, QString) const;
void createSystrayDelayed(); void createSystrayDelayed();
void tab_changed(int); void tab_changed(int);
void on_actionLock_qBittorrent_triggered(); void on_actionLock_qBittorrent_triggered();
void defineUILockPassword(); void defineUILockPassword();
void clearUILockPassword(); void clearUILockPassword();
bool unlockUI(); bool unlockUI();
void notifyOfUpdate(QString); void notifyOfUpdate(QString);
void showConnectionSettings(); void showConnectionSettings();
void minimizeWindow(); void minimizeWindow();
void updateTrayIconMenu(); void updateTrayIconMenu();
// Keyboard shortcuts // Keyboard shortcuts
void createKeyboardShortcuts(); void createKeyboardShortcuts();
void displayTransferTab() const; void displayTransferTab() const;
void displaySearchTab() const; void displaySearchTab() const;
void displayRSSTab() const; void displayRSSTab() const;
// Torrent actions // Torrent actions
void on_actionSet_global_upload_limit_triggered(); void on_actionSet_global_upload_limit_triggered();
void on_actionSet_global_download_limit_triggered(); void on_actionSet_global_download_limit_triggered();
void on_actionDocumentation_triggered() const; void on_actionDocumentation_triggered() const;
void on_actionOpen_triggered(); void on_actionOpen_triggered();
void updateGUI(); void updateGUI();
void loadPreferences(bool configure_session=true); void loadPreferences(bool configure_session = true);
void processParams(const QString& params); void processParams(const QString& params);
void processParams(const QStringList& params); void processParams(const QStringList& params);
void addTorrent(QString path); void addTorrent(QString path);
void addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &tracker); void addUnauthenticatedTracker(const QPair<QTorrentHandle,QString> &tracker);
void processDownloadedFiles(QString path, QString url); void processDownloadedFiles(QString path, QString url);
void processNewMagnetLink(const QString& link); void processNewMagnetLink(const QString& link);
void finishedTorrent(const QTorrentHandle& h) const; void finishedTorrent(const QTorrentHandle& h) const;
void askRecursiveTorrentDownloadConfirmation(const QTorrentHandle &h); void askRecursiveTorrentDownloadConfirmation(const QTorrentHandle &h);
// Options slots // Options slots
void on_actionOptions_triggered(); void on_actionOptions_triggered();
void optionsSaved(); void optionsSaved();
// HTTP slots // HTTP slots
void on_actionDownload_from_URL_triggered(); void on_actionDownload_from_URL_triggered();
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
void handleUpdateCheckFinished(bool update_available, QString new_version, bool invokedByUser); void handleUpdateCheckFinished(bool update_available, QString new_version, bool invokedByUser);
#endif #endif
protected: protected:
void closeEvent(QCloseEvent *); void closeEvent(QCloseEvent *);
void showEvent(QShowEvent *); void showEvent(QShowEvent *);
bool event(QEvent * event); bool event(QEvent * event);
void displayRSSTab(bool enable); void displayRSSTab(bool enable);
void displaySearchTab(bool enable); void displaySearchTab(bool enable);
private: private:
QIcon getSystrayIcon() const; QIcon getSystrayIcon() const;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
bool addPythonPathToEnv(); bool addPythonPathToEnv();
void installPython(); void installPython();
private slots: private slots:
void pythonDownloadSuccess(QString url, QString file_path); void pythonDownloadSuccess(QString url, QString file_path);
void pythonDownloadFailure(QString url, QString error); void pythonDownloadFailure(QString url, QString error);
#endif #endif
private: private:
QFileSystemWatcher *executable_watcher; QFileSystemWatcher *executable_watcher;
// Bittorrent // Bittorrent
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed? QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed?
// GUI related // GUI related
bool m_posInitialized; bool m_posInitialized;
QTimer *guiUpdater; QTimer *guiUpdater;
HidableTabWidget *tabs; HidableTabWidget *tabs;
StatusBar *status_bar; StatusBar *status_bar;
QPointer<options_imp> options; QPointer<options_imp> options;
QPointer<consoleDlg> console; QPointer<consoleDlg> console;
QPointer<about> aboutDlg; QPointer<about> aboutDlg;
QPointer<StatsDialog> statsDlg; QPointer<StatsDialog> statsDlg;
QPointer<TorrentCreatorDlg> createTorrentDlg; QPointer<TorrentCreatorDlg> createTorrentDlg;
QPointer<downloadFromURL> downloadFromURLDialog; QPointer<downloadFromURL> downloadFromURLDialog;
QPointer<QSystemTrayIcon> systrayIcon; QPointer<QSystemTrayIcon> systrayIcon;
QPointer<QTimer> systrayCreator; QPointer<QTimer> systrayCreator;
QPointer<QMenu> myTrayIconMenu; QPointer<QMenu> myTrayIconMenu;
TransferListWidget *transferList; TransferListWidget *transferList;
TransferListFiltersWidget *transferListFilters; TransferListFiltersWidget *transferListFilters;
PropertiesWidget *properties; PropertiesWidget *properties;
bool displaySpeedInTitle; bool displaySpeedInTitle;
bool force_exit; bool force_exit;
bool ui_locked; bool ui_locked;
bool unlockDlgShowing; bool unlockDlgShowing;
LineEdit *search_filter; LineEdit *search_filter;
QAction *searchFilterAct; QAction *searchFilterAct;
// Keyboard shortcuts // Keyboard shortcuts
QShortcut *switchSearchShortcut; QShortcut *switchSearchShortcut;
QShortcut *switchSearchShortcut2; QShortcut *switchSearchShortcut2;
QShortcut *switchTransferShortcut; QShortcut *switchTransferShortcut;
QShortcut *switchRSSShortcut; QShortcut *switchRSSShortcut;
// Widgets // Widgets
QAction *prioSeparator; QAction *prioSeparator;
QAction *prioSeparatorMenu; QAction *prioSeparatorMenu;
QSplitter *hSplitter; QSplitter *hSplitter;
QSplitter *vSplitter; QSplitter *vSplitter;
// Search // Search
QPointer<SearchEngine> searchEngine; QPointer<SearchEngine> searchEngine;
// RSS // RSS
QPointer<RSSImp> rssWidget; QPointer<RSSImp> rssWidget;
// Execution Log // Execution Log
QPointer<ExecutionLog> m_executionLog; QPointer<ExecutionLog> m_executionLog;
// Power Management // Power Management
PowerManagement *m_pwr; PowerManagement *m_pwr;
QTimer *preventTimer; QTimer *preventTimer;
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
QTimer programUpdateTimer; QTimer programUpdateTimer;
#endif #endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
bool has_python; bool has_python;
#endif #endif
private slots: private slots:

Loading…
Cancel
Save