mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07:00
MainWindow cleanups.
All MainWindow child widgets use constructors with 'parent' parameter that allows parent widget to delete them at its destruction. Some other MainWindow cleanup code replaced to destructor. Application manages MainWindow instance and remove it when aboutToQuit() signal emitted.
This commit is contained in:
parent
0c50a8b98b
commit
458b216b74
5 changed files with 70 additions and 131 deletions
|
@ -48,11 +48,9 @@ class TransferListWidget;
|
|||
class TransferListFiltersWidget;
|
||||
class PropertiesWidget;
|
||||
class StatusBar;
|
||||
class consoleDlg;
|
||||
class about;
|
||||
class TorrentCreatorDlg;
|
||||
class downloadFromURL;
|
||||
class HidableTabWidget;
|
||||
class LineEdit;
|
||||
class ExecutionLog;
|
||||
class PowerManagement;
|
||||
|
@ -73,6 +71,7 @@ class MainWindow: public QMainWindow, private Ui::MainWindow
|
|||
public:
|
||||
// Construct / Destruct
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
// Methods
|
||||
QWidget* getCurrentTabWidget() const;
|
||||
TransferListWidget* getTransferList() const { return transferList; }
|
||||
|
@ -86,13 +85,10 @@ public slots:
|
|||
void downloadFromURLList(const QStringList& urls);
|
||||
void updateAltSpeedsBtn(bool alternative);
|
||||
void updateNbTorrents();
|
||||
void shutdownCleanUp();
|
||||
void activate();
|
||||
|
||||
protected slots:
|
||||
// GUI related slots
|
||||
void dropEvent(QDropEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void toggleVisibility(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
|
||||
void on_actionAbout_triggered();
|
||||
void on_actionStatistics_triggered();
|
||||
|
@ -144,6 +140,8 @@ protected slots:
|
|||
#endif
|
||||
|
||||
protected:
|
||||
void dropEvent(QDropEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void closeEvent(QCloseEvent *);
|
||||
void showEvent(QShowEvent *);
|
||||
bool event(QEvent * event);
|
||||
|
@ -169,10 +167,9 @@ private:
|
|||
// GUI related
|
||||
bool m_posInitialized;
|
||||
QTimer *guiUpdater;
|
||||
HidableTabWidget *tabs;
|
||||
QTabWidget *tabs;
|
||||
StatusBar *status_bar;
|
||||
QPointer<options_imp> options;
|
||||
QPointer<consoleDlg> console;
|
||||
QPointer<about> aboutDlg;
|
||||
QPointer<StatsDialog> statsDlg;
|
||||
QPointer<TorrentCreatorDlg> createTorrentDlg;
|
||||
|
@ -189,11 +186,6 @@ private:
|
|||
bool unlockDlgShowing;
|
||||
LineEdit *search_filter;
|
||||
QAction *searchFilterAct;
|
||||
// Keyboard shortcuts
|
||||
QShortcut *switchSearchShortcut;
|
||||
QShortcut *switchSearchShortcut2;
|
||||
QShortcut *switchTransferShortcut;
|
||||
QShortcut *switchRSSShortcut;
|
||||
// Widgets
|
||||
QAction *prioSeparator;
|
||||
QAction *prioSeparatorMenu;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue