qBittorrent
MainWindow Class Referencefinal

#include <mainwindow.h>

Inheritance diagram for MainWindow:
Collaboration diagram for MainWindow:

Signals

void systemTrayIconCreated ()
 

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 
 ~MainWindow () override
 
QWidget * currentTabWidget () const
 
TransferListWidgettransferListWidget () const
 
PropertiesWidgetpropertiesWidget () const
 
bool isExecutionLogEnabled () const
 
void setExecutionLogEnabled (bool value)
 
Log::MsgTypes executionLogMsgTypes () const
 
void setExecutionLogMsgTypes (Log::MsgTypes value)
 
bool isNotificationsEnabled () const
 
void setNotificationsEnabled (bool value)
 
bool isTorrentAddedNotificationsEnabled () const
 
void setTorrentAddedNotificationsEnabled (bool value)
 
bool isDownloadTrackerFavicon () const
 
void setDownloadTrackerFavicon (bool value)
 
void activate ()
 
void cleanup ()
 
void showNotificationBalloon (const QString &title, const QString &msg) const
 

Private Slots

void showFilterContextMenu (const QPoint &)
 
void balloonClicked ()
 
void writeSettings ()
 
void readSettings ()
 
void fullDiskError (BitTorrent::Torrent *const torrent, const QString &msg) const
 
void handleDownloadFromUrlFailure (const QString &, const QString &) const
 
void tabChanged (int newTab)
 
bool defineUILockPassword ()
 
void clearUILockPassword ()
 
bool unlockUI ()
 
void notifyOfUpdate (const QString &)
 
void showConnectionSettings ()
 
void minimizeWindow ()
 
void createKeyboardShortcuts ()
 
void displayTransferTab () const
 
void displaySearchTab ()
 
void displayRSSTab ()
 
void displayExecutionLogTab ()
 
void focusSearchFilter ()
 
void reloadSessionStats ()
 
void reloadTorrentStats (const QVector< BitTorrent::Torrent * > &torrents)
 
void loadPreferences ()
 
void addTorrentFailed (const QString &error) const
 
void torrentNew (BitTorrent::Torrent *const torrent) const
 
void finishedTorrent (BitTorrent::Torrent *const torrent) const
 
void askRecursiveTorrentDownloadConfirmation (BitTorrent::Torrent *const torrent)
 
void optionsSaved ()
 
void toggleAlternativeSpeeds ()
 
void addToolbarContextMenu ()
 
void manageCookies ()
 
void downloadFromURLList (const QStringList &urlList)
 
void updateAltSpeedsBtn (bool alternative)
 
void updateNbTorrents ()
 
void handleRSSUnreadCountUpdated (int count)
 
void on_actionSearchWidget_triggered ()
 
void on_actionRSSReader_triggered ()
 
void on_actionSpeedInTitleBar_triggered ()
 
void on_actionTopToolBar_triggered ()
 
void on_actionShowStatusbar_triggered ()
 
void on_actionDonateMoney_triggered ()
 
void on_actionExecutionLogs_triggered (bool checked)
 
void on_actionNormalMessages_triggered (bool checked)
 
void on_actionInformationMessages_triggered (bool checked)
 
void on_actionWarningMessages_triggered (bool checked)
 
void on_actionCriticalMessages_triggered (bool checked)
 
void on_actionAutoExit_toggled (bool)
 
void on_actionAutoSuspend_toggled (bool)
 
void on_actionAutoHibernate_toggled (bool)
 
void on_actionAutoShutdown_toggled (bool)
 
void on_actionAbout_triggered ()
 
void on_actionStatistics_triggered ()
 
void on_actionCreateTorrent_triggered ()
 
void on_actionOptions_triggered ()
 
void on_actionSetGlobalSpeedLimits_triggered ()
 
void on_actionDocumentation_triggered () const
 
void on_actionOpen_triggered ()
 
void on_actionDownloadFromURL_triggered ()
 
void on_actionExit_triggered ()
 
void on_actionLock_triggered ()
 
void updatePowerManagementState ()
 
void toolbarMenuRequested (const QPoint &point)
 
void toolbarIconsOnly ()
 
void toolbarTextOnly ()
 
void toolbarTextBeside ()
 
void toolbarTextUnder ()
 
void toolbarFollowSystem ()
 
void toggleVisibility (const QSystemTrayIcon::ActivationReason reason=QSystemTrayIcon::Trigger)
 

Private Member Functions

void createTrayIconMenu ()
 
void createTrayIcon (int retries)
 
void dropEvent (QDropEvent *event) override
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void closeEvent (QCloseEvent *) override
 
void showEvent (QShowEvent *) override
 
void keyPressEvent (QKeyEvent *event) override
 
bool event (QEvent *e) override
 
void displayRSSTab (bool enable)
 
void displaySearchTab (bool enable)
 
void createTorrentTriggered (const QString &path={})
 
void showStatusBar (bool show)
 

Private Attributes

Ui::MainWindow * m_ui
 
QFileSystemWatcher * m_executableWatcher
 
bool m_posInitialized = false
 
QPointer< QTabWidget > m_tabs
 
QPointer< StatusBarm_statusBar
 
QPointer< OptionsDialogm_options
 
QPointer< AboutDialogm_aboutDlg
 
QPointer< StatsDialogm_statsDlg
 
QPointer< TorrentCreatorDialogm_createTorrentDlg
 
QPointer< DownloadFromURLDialogm_downloadFromURLDialog
 
QPointer< QSystemTrayIcon > m_systrayIcon
 
QPointer< QMenu > m_trayIconMenu
 
TransferListWidgetm_transferListWidget
 
TransferListFiltersWidgetm_transferListFiltersWidget
 
PropertiesWidgetm_propertiesWidget
 
bool m_displaySpeedInTitle
 
bool m_forceExit = false
 
bool m_uiLocked
 
bool m_unlockDlgShowing = false
 
LineEditm_searchFilter
 
QAction * m_searchFilterAction
 
QAction * m_queueSeparator
 
QAction * m_queueSeparatorMenu
 
QSplitter * m_splitter
 
QPointer< SearchWidgetm_searchWidget
 
QPointer< RSSWidgetm_rssWidget
 
QPointer< ExecutionLogWidgetm_executionLog
 
PowerManagementm_pwr
 
QTimer * m_preventTimer
 
bool m_hasPython = false
 
QMenu * m_toolbarMenu
 
SettingValue< bool > m_storeExecutionLogEnabled
 
SettingValue< bool > m_storeDownloadTrackerFavicon
 
SettingValue< bool > m_storeNotificationEnabled
 
SettingValue< bool > m_storeNotificationTorrentAdded
 
CachedSettingValue< Log::MsgTypes > m_storeExecutionLogTypes
 

Detailed Description

Definition at line 74 of file mainwindow.h.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QWidget *  parent = nullptr)
explicit

Definition at line 123 of file mainwindow.cpp.

124  : QMainWindow(parent)
125  , m_ui(new Ui::MainWindow)
127  , m_storeDownloadTrackerFavicon(SETTINGS_KEY("DownloadTrackerFavicon"))
131 #if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
132  , m_storeNotificationTimeOut(NOTIFICATIONS_SETTINGS_KEY("Timeout"))
133 #endif
134 {
135  m_ui->setupUi(this);
136 
137  Preferences *const pref = Preferences::instance();
138  m_uiLocked = pref->isUILocked();
139  setWindowTitle("qBittorrent " QBT_VERSION);
141  // Setting icons
142 #ifndef Q_OS_MACOS
143  const QIcon appLogo(UIThemeManager::instance()->getIcon(QLatin1String("qbittorrent"), QLatin1String("qbittorrent-tray")));
144  setWindowIcon(appLogo);
145 #endif // Q_OS_MACOS
146 
147 #if (defined(Q_OS_UNIX))
148  m_ui->actionOptions->setText(tr("Preferences"));
149 #endif
150 
152 
153  m_ui->actionOpen->setIcon(UIThemeManager::instance()->getIcon("list-add"));
154  m_ui->actionDownloadFromURL->setIcon(UIThemeManager::instance()->getIcon("insert-link"));
155  m_ui->actionSetGlobalSpeedLimits->setIcon(UIThemeManager::instance()->getIcon("speedometer"));
156  m_ui->actionCreateTorrent->setIcon(UIThemeManager::instance()->getIcon("document-edit"));
157  m_ui->actionAbout->setIcon(UIThemeManager::instance()->getIcon("help-about"));
158  m_ui->actionStatistics->setIcon(UIThemeManager::instance()->getIcon("view-statistics"));
159  m_ui->actionTopQueuePos->setIcon(UIThemeManager::instance()->getIcon("go-top"));
160  m_ui->actionIncreaseQueuePos->setIcon(UIThemeManager::instance()->getIcon("go-up"));
161  m_ui->actionDecreaseQueuePos->setIcon(UIThemeManager::instance()->getIcon("go-down"));
162  m_ui->actionBottomQueuePos->setIcon(UIThemeManager::instance()->getIcon("go-bottom"));
163  m_ui->actionDelete->setIcon(UIThemeManager::instance()->getIcon("list-remove"));
164  m_ui->actionDocumentation->setIcon(UIThemeManager::instance()->getIcon("help-contents"));
165  m_ui->actionDonateMoney->setIcon(UIThemeManager::instance()->getIcon("wallet-open"));
166  m_ui->actionExit->setIcon(UIThemeManager::instance()->getIcon("application-exit"));
167  m_ui->actionLock->setIcon(UIThemeManager::instance()->getIcon("object-locked"));
168  m_ui->actionOptions->setIcon(UIThemeManager::instance()->getIcon("configure", "preferences-system"));
169  m_ui->actionPause->setIcon(UIThemeManager::instance()->getIcon("media-playback-pause"));
170  m_ui->actionPauseAll->setIcon(UIThemeManager::instance()->getIcon("media-playback-pause"));
171  m_ui->actionStart->setIcon(UIThemeManager::instance()->getIcon("media-playback-start"));
172  m_ui->actionStartAll->setIcon(UIThemeManager::instance()->getIcon("media-playback-start"));
173  m_ui->menuAutoShutdownOnDownloadsCompletion->setIcon(UIThemeManager::instance()->getIcon("application-exit"));
174  m_ui->actionManageCookies->setIcon(UIThemeManager::instance()->getIcon("preferences-web-browser-cookies"));
175 
176  auto *lockMenu = new QMenu(this);
177  lockMenu->addAction(tr("&Set Password"), this, &MainWindow::defineUILockPassword);
178  lockMenu->addAction(tr("&Clear Password"), this, &MainWindow::clearUILockPassword);
179  m_ui->actionLock->setMenu(lockMenu);
180  connect(this, &MainWindow::systemTrayIconCreated, this, [this]()
181  {
182  m_ui->actionLock->setVisible(true);
183  });
184 
185  // Creating Bittorrent session
186  updateAltSpeedsBtn(BitTorrent::Session::instance()->isAltGlobalSpeedLimitEnabled());
187 
195 
196  qDebug("create tabWidget");
197  m_tabs = new HidableTabWidget(this);
198  connect(m_tabs.data(), &QTabWidget::currentChanged, this, &MainWindow::tabChanged);
199 
200  m_splitter = new QSplitter(Qt::Horizontal, this);
201  // vSplitter->setChildrenCollapsible(false);
202 
203  auto *hSplitter = new QSplitter(Qt::Vertical, this);
204  hSplitter->setChildrenCollapsible(false);
205  hSplitter->setFrameShape(QFrame::NoFrame);
206 
207  // Name filter
208  m_searchFilter = new LineEdit(this);
209  m_searchFilter->setPlaceholderText(tr("Filter torrent names..."));
210  m_searchFilter->setFixedWidth(Utils::Gui::scaledSize(this, 200));
211  m_searchFilter->setContextMenuPolicy(Qt::CustomContextMenu);
212  connect(m_searchFilter, &QWidget::customContextMenuRequested, this, &MainWindow::showFilterContextMenu);
213  m_searchFilterAction = m_ui->toolBar->insertWidget(m_ui->actionLock, m_searchFilter);
214 
215  QWidget *spacer = new QWidget(this);
216  spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
217  m_ui->toolBar->insertWidget(m_searchFilterAction, spacer);
218 
219  // Transfer List tab
220  m_transferListWidget = new TransferListWidget(hSplitter, this);
221  // m_transferListWidget->setStyleSheet("QTreeView {border: none;}"); // borderless
222  m_propertiesWidget = new PropertiesWidget(hSplitter);
225  hSplitter->addWidget(m_transferListWidget);
226  hSplitter->addWidget(m_propertiesWidget);
228  m_splitter->addWidget(hSplitter);
229  m_splitter->setCollapsible(0, true);
230  m_splitter->setCollapsible(1, false);
231  m_tabs->addTab(m_splitter,
232 #ifndef Q_OS_MACOS
233  UIThemeManager::instance()->getIcon("folder-remote"),
234 #endif
235  tr("Transfers"));
236 
237  connect(m_searchFilter, &LineEdit::textChanged, m_transferListWidget, &TransferListWidget::applyNameFilter);
238  connect(hSplitter, &QSplitter::splitterMoved, this, &MainWindow::writeSettings);
239  connect(m_splitter, &QSplitter::splitterMoved, this, &MainWindow::writeSettings);
244 
246  , m_transferListFiltersWidget, qOverload<const BitTorrent::Torrent *, const QString &>(&TransferListFiltersWidget::trackerSuccess));
248  , m_transferListFiltersWidget, qOverload<const BitTorrent::Torrent *, const QString &>(&TransferListFiltersWidget::trackerError));
250  , m_transferListFiltersWidget, qOverload<const BitTorrent::Torrent *, const QString &>(&TransferListFiltersWidget::trackerWarning));
251 
252 #ifdef Q_OS_MACOS
253  // Increase top spacing to avoid tab overlapping
254  m_ui->centralWidgetLayout->addSpacing(8);
255 #endif
256 
257  m_ui->centralWidgetLayout->addWidget(m_tabs);
258 
259  m_queueSeparator = m_ui->toolBar->insertSeparator(m_ui->actionTopQueuePos);
260  m_queueSeparatorMenu = m_ui->menuEdit->insertSeparator(m_ui->actionTopQueuePos);
261 
262 #ifdef Q_OS_MACOS
263  for (QAction *action : asConst(m_ui->toolBar->actions()))
264  {
265  if (action->isSeparator())
266  {
267  QWidget *spacer = new QWidget(this);
268  spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
269  spacer->setMinimumWidth(16);
270  m_ui->toolBar->insertWidget(action, spacer);
271  m_ui->toolBar->removeAction(action);
272  }
273  }
274  {
275  QWidget *spacer = new QWidget(this);
276  spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
277  spacer->setMinimumWidth(8);
278  m_ui->toolBar->insertWidget(m_ui->actionDownloadFromURL, spacer);
279  }
280  {
281  QWidget *spacer = new QWidget(this);
282  spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
283  spacer->setMinimumWidth(8);
284  m_ui->toolBar->addWidget(spacer);
285  }
286 #endif // Q_OS_MACOS
287 
288  // Transfer list slots
289  connect(m_ui->actionStart, &QAction::triggered, m_transferListWidget, &TransferListWidget::startSelectedTorrents);
290  connect(m_ui->actionStartAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::resumeAllTorrents);
291  connect(m_ui->actionPause, &QAction::triggered, m_transferListWidget, &TransferListWidget::pauseSelectedTorrents);
292  connect(m_ui->actionPauseAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::pauseAllTorrents);
293  connect(m_ui->actionDelete, &QAction::triggered, m_transferListWidget, &TransferListWidget::softDeleteSelectedTorrents);
294  connect(m_ui->actionTopQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::topQueuePosSelectedTorrents);
295  connect(m_ui->actionIncreaseQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::increaseQueuePosSelectedTorrents);
296  connect(m_ui->actionDecreaseQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::decreaseQueuePosSelectedTorrents);
297  connect(m_ui->actionBottomQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::bottomQueuePosSelectedTorrents);
298 #ifndef Q_OS_MACOS
299  connect(m_ui->actionToggleVisibility, &QAction::triggered, this, [this]() { toggleVisibility(); });
300 #endif
301  connect(m_ui->actionMinimize, &QAction::triggered, this, &MainWindow::minimizeWindow);
302  connect(m_ui->actionUseAlternativeSpeedLimits, &QAction::triggered, this, &MainWindow::toggleAlternativeSpeeds);
303 
304 #if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
305  connect(m_ui->actionCheckForUpdates, &QAction::triggered, this, [this]() { checkProgramUpdate(true); });
306 
307  // trigger an early check on startup
308  if (pref->isUpdateCheckEnabled())
309  checkProgramUpdate(false);
310 #else
311  m_ui->actionCheckForUpdates->setVisible(false);
312 #endif
313 
314  // Certain menu items should reside at specific places on macOS.
315  // Qt partially does it on its own, but updates and different languages require tuning.
316  m_ui->actionExit->setMenuRole(QAction::QuitRole);
317  m_ui->actionAbout->setMenuRole(QAction::AboutRole);
318  m_ui->actionCheckForUpdates->setMenuRole(QAction::ApplicationSpecificRole);
319  m_ui->actionOptions->setMenuRole(QAction::PreferencesRole);
320 
321  connect(m_ui->actionManageCookies, &QAction::triggered, this, &MainWindow::manageCookies);
322 
323  m_pwr = new PowerManagement(this);
324  m_preventTimer = new QTimer(this);
325  connect(m_preventTimer, &QTimer::timeout, this, &MainWindow::updatePowerManagementState);
326 
327  // Configure BT session according to options
328  loadPreferences();
329 
332 
333  // Accept drag 'n drops
334  setAcceptDrops(true);
336 
337 #ifdef Q_OS_MACOS
338  setUnifiedTitleAndToolBarOnMac(true);
339 #endif
340 
341  // View settings
342  m_ui->actionTopToolBar->setChecked(pref->isToolbarDisplayed());
343  m_ui->actionShowStatusbar->setChecked(pref->isStatusbarDisplayed());
344  m_ui->actionSpeedInTitleBar->setChecked(pref->speedInTitleBar());
345  m_ui->actionRSSReader->setChecked(pref->isRSSWidgetEnabled());
346  m_ui->actionSearchWidget->setChecked(pref->isSearchEnabled());
347  m_ui->actionExecutionLogs->setChecked(isExecutionLogEnabled());
348 
349  const Log::MsgTypes flags = executionLogMsgTypes();
350  m_ui->actionNormalMessages->setChecked(flags.testFlag(Log::NORMAL));
351  m_ui->actionInformationMessages->setChecked(flags.testFlag(Log::INFO));
352  m_ui->actionWarningMessages->setChecked(flags.testFlag(Log::WARNING));
353  m_ui->actionCriticalMessages->setChecked(flags.testFlag(Log::CRITICAL));
354 
355  displayRSSTab(m_ui->actionRSSReader->isChecked());
356  on_actionExecutionLogs_triggered(m_ui->actionExecutionLogs->isChecked());
357  on_actionNormalMessages_triggered(m_ui->actionNormalMessages->isChecked());
358  on_actionInformationMessages_triggered(m_ui->actionInformationMessages->isChecked());
359  on_actionWarningMessages_triggered(m_ui->actionWarningMessages->isChecked());
360  on_actionCriticalMessages_triggered(m_ui->actionCriticalMessages->isChecked());
361  if (m_ui->actionSearchWidget->isChecked())
362  QTimer::singleShot(0, this, &MainWindow::on_actionSearchWidget_triggered);
363 
364  // Auto shutdown actions
365  auto *autoShutdownGroup = new QActionGroup(this);
366  autoShutdownGroup->setExclusive(true);
367  autoShutdownGroup->addAction(m_ui->actionAutoShutdownDisabled);
368  autoShutdownGroup->addAction(m_ui->actionAutoExit);
369  autoShutdownGroup->addAction(m_ui->actionAutoShutdown);
370  autoShutdownGroup->addAction(m_ui->actionAutoSuspend);
371  autoShutdownGroup->addAction(m_ui->actionAutoHibernate);
372 #if (!defined(Q_OS_UNIX) || defined(Q_OS_MACOS)) || defined(QT_DBUS_LIB)
373  m_ui->actionAutoShutdown->setChecked(pref->shutdownWhenDownloadsComplete());
374  m_ui->actionAutoSuspend->setChecked(pref->suspendWhenDownloadsComplete());
375  m_ui->actionAutoHibernate->setChecked(pref->hibernateWhenDownloadsComplete());
376 #else
377  m_ui->actionAutoShutdown->setDisabled(true);
378  m_ui->actionAutoSuspend->setDisabled(true);
379  m_ui->actionAutoHibernate->setDisabled(true);
380 #endif
381  m_ui->actionAutoExit->setChecked(pref->shutdownqBTWhenDownloadsComplete());
382 
383  if (!autoShutdownGroup->checkedAction())
384  m_ui->actionAutoShutdownDisabled->setChecked(true);
385 
386  // Load Window state and sizes
387  readSettings();
388 
389 #ifdef Q_OS_MACOS
390  // Make sure the Window is visible if we don't have a tray icon
391  if (pref->startMinimized())
392  {
393  showMinimized();
394  }
395  else
396  {
397  show();
398  activateWindow();
399  raise();
400  }
401 #else
402  if (m_systrayIcon)
403  {
404  if (!(pref->startMinimized() || m_uiLocked))
405  {
406  show();
407  activateWindow();
408  raise();
409  }
410  else if (pref->startMinimized())
411  {
412  showMinimized();
413  if (pref->minimizeToTray())
414  {
415  hide();
416  if (!pref->minimizeToTrayNotified())
417  {
418  showNotificationBalloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again."));
419  pref->setMinimizeToTrayNotified(true);
420  }
421  }
422  }
423  }
424  else
425  {
426  // Make sure the Window is visible if we don't have a tray icon
427  if (pref->startMinimized())
428  {
429  showMinimized();
430  }
431  else
432  {
433  show();
434  activateWindow();
435  raise();
436  }
437  }
438 #endif
439 
441 
442  // Start watching the executable for updates
443  m_executableWatcher = new QFileSystemWatcher(this);
444  connect(m_executableWatcher, &QFileSystemWatcher::fileChanged, this, &MainWindow::notifyOfUpdate);
445  m_executableWatcher->addPath(qApp->applicationFilePath());
446 
447  m_transferListWidget->setFocus();
448 
449  // Update the number of torrents (tab)
451  connect(m_transferListWidget->getSourceModel(), &QAbstractItemModel::rowsInserted, this, &MainWindow::updateNbTorrents);
452  connect(m_transferListWidget->getSourceModel(), &QAbstractItemModel::rowsRemoved, this, &MainWindow::updateNbTorrents);
453 
454  connect(pref, &Preferences::changed, this, &MainWindow::optionsSaved);
455 
456  qDebug("GUI Built");
457 #ifdef Q_OS_WIN
458  if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet()))
459  {
460  if (QMessageBox::question(this, tr("Torrent file association"),
461  tr("qBittorrent is not the default application for opening torrent files or Magnet links.\nDo you want to make qBittorrent the default application for these?"),
462  QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
463  {
464  Preferences::setTorrentFileAssoc(true);
465  Preferences::setMagnetLinkAssoc(true);
466  }
467  else
468  {
469  pref->setNeverCheckFileAssoc();
470  }
471  }
472 #endif
473 #ifdef Q_OS_MACOS
474  setupDockClickHandler();
476  m_trayIconMenu->setAsDockMenu();
477 #endif
478 }
static Session * instance()
Definition: session.cpp:997
void trackersAdded(Torrent *torrent, const QVector< TrackerEntry > &trackers)
void trackersChanged(Torrent *torrent)
void fullDiskError(Torrent *torrent, const QString &msg)
void trackersRemoved(Torrent *torrent, const QVector< TrackerEntry > &trackers)
void loadTorrentFailed(const QString &error)
void torrentAdded(Torrent *torrent)
void trackerError(Torrent *torrent, const QString &tracker)
void speedLimitModeChanged(bool alternative)
void trackerSuccess(Torrent *torrent, const QString &tracker)
void torrentFinished(Torrent *torrent)
void recursiveTorrentDownloadPossible(Torrent *torrent)
void downloadFromUrlFailed(const QString &url, const QString &reason)
void torrentsUpdated(const QVector< Torrent * > &torrents)
void trackerWarning(Torrent *torrent, const QString &tracker)
void trackerlessStateChanged(Torrent *torrent, bool trackerless)
void handleDownloadFromUrlFailure(const QString &, const QString &) const
Definition: mainwindow.cpp:986
void readSettings()
Definition: mainwindow.cpp:818
void showNotificationBalloon(const QString &title, const QString &msg) const
PropertiesWidget * m_propertiesWidget
Definition: mainwindow.h:238
void toggleAlternativeSpeeds()
void minimizeWindow()
SettingValue< bool > m_storeNotificationEnabled
Definition: mainwindow.h:260
void updateNbTorrents()
Definition: mainwindow.cpp:756
SettingValue< bool > m_storeNotificationTorrentAdded
Definition: mainwindow.h:261
void on_actionNormalMessages_triggered(bool checked)
void askRecursiveTorrentDownloadConfirmation(BitTorrent::Torrent *const torrent)
Definition: mainwindow.cpp:960
void fullDiskError(BitTorrent::Torrent *const torrent, const QString &msg) const
Definition: mainwindow.cpp:870
void manageCookies()
Definition: mainwindow.cpp:597
void createKeyboardShortcuts()
Definition: mainwindow.cpp:877
TransferListWidget * m_transferListWidget
Definition: mainwindow.h:236
void createTrayIconMenu()
void finishedTorrent(BitTorrent::Torrent *const torrent) const
Definition: mainwindow.cpp:864
void writeSettings()
Definition: mainwindow.cpp:787
Log::MsgTypes executionLogMsgTypes() const
Definition: mainwindow.cpp:495
void addToolbarContextMenu()
Definition: mainwindow.cpp:549
void on_actionCriticalMessages_triggered(bool checked)
Ui::MainWindow * m_ui
Definition: mainwindow.h:218
SettingValue< bool > m_storeExecutionLogEnabled
Definition: mainwindow.h:258
void clearUILockPassword()
Definition: mainwindow.cpp:657
void torrentNew(BitTorrent::Torrent *const torrent) const
Definition: mainwindow.cpp:857
SettingValue< bool > m_storeDownloadTrackerFavicon
Definition: mainwindow.h:259
void on_actionSearchWidget_triggered()
void updateAltSpeedsBtn(bool alternative)
QFileSystemWatcher * m_executableWatcher
Definition: mainwindow.h:220
void tabChanged(int newTab)
Definition: mainwindow.cpp:766
PowerManagement * m_pwr
Definition: mainwindow.h:253
QAction * m_queueSeparatorMenu
Definition: mainwindow.h:247
void showFilterContextMenu(const QPoint &)
Definition: mainwindow.cpp:711
LineEdit * m_searchFilter
Definition: mainwindow.h:243
CachedSettingValue< Log::MsgTypes > m_storeExecutionLogTypes
Definition: mainwindow.h:262
bool m_displaySpeedInTitle
Definition: mainwindow.h:239
void on_actionInformationMessages_triggered(bool checked)
void updatePowerManagementState()
QPointer< QTabWidget > m_tabs
Definition: mainwindow.h:223
void addTorrentFailed(const QString &error) const
Definition: mainwindow.cpp:851
void reloadSessionStats()
void loadPreferences()
QPointer< QSystemTrayIcon > m_systrayIcon
Definition: mainwindow.h:232
void optionsSaved()
void displayRSSTab()
Definition: mainwindow.cpp:936
bool m_uiLocked
Definition: mainwindow.h:241
bool isDownloadTrackerFavicon() const
Definition: mainwindow.cpp:538
QSplitter * m_splitter
Definition: mainwindow.h:248
bool defineUILockPassword()
Definition: mainwindow.cpp:639
TransferListFiltersWidget * m_transferListFiltersWidget
Definition: mainwindow.h:237
void on_actionWarningMessages_triggered(bool checked)
QAction * m_searchFilterAction
Definition: mainwindow.h:244
QTimer * m_preventTimer
Definition: mainwindow.h:254
QAction * m_queueSeparator
Definition: mainwindow.h:246
bool isExecutionLogEnabled() const
Definition: mainwindow.cpp:485
void notifyOfUpdate(const QString &)
void on_actionExecutionLogs_triggered(bool checked)
QPointer< QMenu > m_trayIconMenu
Definition: mainwindow.h:234
void reloadTorrentStats(const QVector< BitTorrent::Torrent * > &torrents)
void systemTrayIconCreated()
bool shutdownqBTWhenDownloadsComplete() const
static Preferences * instance()
bool shutdownWhenDownloadsComplete() const
bool isStatusbarDisplayed() const
void changed()
bool suspendWhenDownloadsComplete() const
bool isSearchEnabled() const
void setMinimizeToTrayNotified(bool b)
bool speedInTitleBar() const
bool isUILocked() const
bool isRSSWidgetEnabled() const
bool isToolbarDisplayed() const
bool minimizeToTray() const
bool minimizeToTrayNotified() const
bool hibernateWhenDownloadsComplete() const
bool startMinimized() const
void loadTorrentInfos(BitTorrent::Torrent *const torrent)
void loadTrackers(BitTorrent::Torrent *const torrent)
void trackerWarning(const BitTorrent::Torrent *torrent, const QString &tracker)
void removeTrackers(const BitTorrent::Torrent *torrent, const QVector< BitTorrent::TrackerEntry > &trackers)
void trackerError(const BitTorrent::Torrent *torrent, const QString &tracker)
void changeTrackerless(const BitTorrent::Torrent *torrent, bool trackerless)
void addTrackers(const BitTorrent::Torrent *torrent, const QVector< BitTorrent::TrackerEntry > &trackers)
void trackerSuccess(const BitTorrent::Torrent *torrent, const QString &tracker)
TransferListModel * getSourceModel() const
void currentTorrentChanged(BitTorrent::Torrent *const torrent)
void applyNameFilter(const QString &name)
static UIThemeManager * instance()
constexpr std::add_const_t< T > & asConst(T &t) noexcept
Definition: global.h:42
#define NOTIFICATIONS_SETTINGS_KEY(name)
Definition: mainwindow.cpp:107
#define EXECUTIONLOG_SETTINGS_KEY(name)
Definition: mainwindow.cpp:106
#define SETTINGS_KEY(name)
Definition: mainwindow.cpp:105
@ WARNING
Definition: logger.h:47
@ NORMAL
Definition: logger.h:45
@ CRITICAL
Definition: logger.h:48
@ INFO
Definition: logger.h:46
@ ALL
Definition: logger.h:44
T scaledSize(const QWidget *widget, const T &size)
Definition: utils.h:46
action
Definition: tstool.py:143

References tstool::action, addToolbarContextMenu(), addTorrentFailed(), TransferListFiltersWidget::addTrackers(), TransferListWidget::applyNameFilter(), asConst(), askRecursiveTorrentDownloadConfirmation(), TransferListWidget::bottomQueuePosSelectedTorrents(), Preferences::changed(), TransferListFiltersWidget::changeTrackerless(), clearUILockPassword(), createKeyboardShortcuts(), createTrayIconMenu(), Log::CRITICAL, TransferListWidget::currentTorrentChanged(), TransferListWidget::decreaseQueuePosSelectedTorrents(), defineUILockPassword(), displayRSSTab(), BitTorrent::Session::downloadFromUrlFailed(), executionLogMsgTypes(), finishedTorrent(), fullDiskError(), BitTorrent::Session::fullDiskError(), TransferListWidget::getSourceModel(), handleDownloadFromUrlFailure(), Preferences::hibernateWhenDownloadsComplete(), TransferListWidget::increaseQueuePosSelectedTorrents(), Log::INFO, BitTorrent::Session::instance(), Preferences::instance(), UIThemeManager::instance(), isDownloadTrackerFavicon(), isExecutionLogEnabled(), Preferences::isRSSWidgetEnabled(), Preferences::isSearchEnabled(), Preferences::isStatusbarDisplayed(), Preferences::isToolbarDisplayed(), Preferences::isUILocked(), loadPreferences(), BitTorrent::Session::loadTorrentFailed(), PropertiesWidget::loadTorrentInfos(), PropertiesWidget::loadTrackers(), m_displaySpeedInTitle, m_executableWatcher, m_preventTimer, m_propertiesWidget, m_pwr, m_queueSeparator, m_queueSeparatorMenu, m_searchFilter, m_searchFilterAction, m_splitter, m_systrayIcon, m_tabs, m_transferListFiltersWidget, m_transferListWidget, m_trayIconMenu, m_ui, m_uiLocked, manageCookies(), Preferences::minimizeToTray(), Preferences::minimizeToTrayNotified(), minimizeWindow(), Log::NORMAL, notifyOfUpdate(), on_actionCriticalMessages_triggered(), on_actionExecutionLogs_triggered(), on_actionInformationMessages_triggered(), on_actionNormalMessages_triggered(), on_actionSearchWidget_triggered(), on_actionWarningMessages_triggered(), optionsSaved(), TransferListWidget::pauseAllTorrents(), TransferListWidget::pauseSelectedTorrents(), readSettings(), PropertiesWidget::readSettings(), BitTorrent::Session::recursiveTorrentDownloadPossible(), reloadSessionStats(), reloadTorrentStats(), TransferListFiltersWidget::removeTrackers(), TransferListWidget::resumeAllTorrents(), Utils::Gui::scaledSize(), Preferences::setMinimizeToTrayNotified(), showFilterContextMenu(), showNotificationBalloon(), Preferences::shutdownqBTWhenDownloadsComplete(), Preferences::shutdownWhenDownloadsComplete(), TransferListWidget::softDeleteSelectedTorrents(), Preferences::speedInTitleBar(), BitTorrent::Session::speedLimitModeChanged(), Preferences::startMinimized(), TransferListWidget::startSelectedTorrents(), BitTorrent::Session::statsUpdated(), Preferences::suspendWhenDownloadsComplete(), systemTrayIconCreated(), tabChanged(), toggleAlternativeSpeeds(), TransferListWidget::topQueuePosSelectedTorrents(), BitTorrent::Session::torrentAdded(), BitTorrent::Session::torrentFinished(), torrentNew(), BitTorrent::Session::torrentsUpdated(), TransferListFiltersWidget::trackerError(), BitTorrent::Session::trackerError(), BitTorrent::Session::trackerlessStateChanged(), BitTorrent::Session::trackersAdded(), BitTorrent::Session::trackersChanged(), BitTorrent::Session::trackersRemoved(), TransferListFiltersWidget::trackerSuccess(), BitTorrent::Session::trackerSuccess(), TransferListFiltersWidget::trackerWarning(), BitTorrent::Session::trackerWarning(), updateAltSpeedsBtn(), updateNbTorrents(), updatePowerManagementState(), Log::WARNING, and writeSettings().

◆ ~MainWindow()

MainWindow::~MainWindow ( )
override

Definition at line 480 of file mainwindow.cpp.

481 {
482  delete m_ui;
483 }

References m_ui.

Member Function Documentation

◆ activate()

void MainWindow::activate ( )

Definition at line 1452 of file mainwindow.cpp.

1453 {
1454  if (!m_uiLocked || unlockUI())
1455  {
1456  show();
1457  activateWindow();
1458  raise();
1459  }
1460 }
bool unlockUI()

References m_uiLocked, and unlockUI().

Here is the call graph for this function:

◆ addToolbarContextMenu

void MainWindow::addToolbarContextMenu ( )
privateslot

Definition at line 549 of file mainwindow.cpp.

550 {
551  const Preferences *const pref = Preferences::instance();
552  m_toolbarMenu = new QMenu(this);
553 
554  m_ui->toolBar->setContextMenuPolicy(Qt::CustomContextMenu);
555  connect(m_ui->toolBar, &QWidget::customContextMenuRequested, this, &MainWindow::toolbarMenuRequested);
556 
557  QAction *iconsOnly = m_toolbarMenu->addAction(tr("Icons Only"), this, &MainWindow::toolbarIconsOnly);
558  QAction *textOnly = m_toolbarMenu->addAction(tr("Text Only"), this, &MainWindow::toolbarTextOnly);
559  QAction *textBesideIcons = m_toolbarMenu->addAction(tr("Text Alongside Icons"), this, &MainWindow::toolbarTextBeside);
560  QAction *textUnderIcons = m_toolbarMenu->addAction(tr("Text Under Icons"), this, &MainWindow::toolbarTextUnder);
561  QAction *followSystemStyle = m_toolbarMenu->addAction(tr("Follow System Style"), this, &MainWindow::toolbarFollowSystem);
562 
563  auto *textPositionGroup = new QActionGroup(m_toolbarMenu);
564  textPositionGroup->addAction(iconsOnly);
565  iconsOnly->setCheckable(true);
566  textPositionGroup->addAction(textOnly);
567  textOnly->setCheckable(true);
568  textPositionGroup->addAction(textBesideIcons);
569  textBesideIcons->setCheckable(true);
570  textPositionGroup->addAction(textUnderIcons);
571  textUnderIcons->setCheckable(true);
572  textPositionGroup->addAction(followSystemStyle);
573  followSystemStyle->setCheckable(true);
574 
575  const auto buttonStyle = static_cast<Qt::ToolButtonStyle>(pref->getToolbarTextPosition());
576  if ((buttonStyle >= Qt::ToolButtonIconOnly) && (buttonStyle <= Qt::ToolButtonFollowStyle))
577  m_ui->toolBar->setToolButtonStyle(buttonStyle);
578  switch (buttonStyle)
579  {
580  case Qt::ToolButtonIconOnly:
581  iconsOnly->setChecked(true);
582  break;
583  case Qt::ToolButtonTextOnly:
584  textOnly->setChecked(true);
585  break;
586  case Qt::ToolButtonTextBesideIcon:
587  textBesideIcons->setChecked(true);
588  break;
589  case Qt::ToolButtonTextUnderIcon:
590  textUnderIcons->setChecked(true);
591  break;
592  default:
593  followSystemStyle->setChecked(true);
594  }
595 }
void toolbarMenuRequested(const QPoint &point)
Definition: mainwindow.cpp:604
void toolbarTextOnly()
Definition: mainwindow.cpp:615
void toolbarIconsOnly()
Definition: mainwindow.cpp:609
void toolbarTextBeside()
Definition: mainwindow.cpp:621
void toolbarTextUnder()
Definition: mainwindow.cpp:627
void toolbarFollowSystem()
Definition: mainwindow.cpp:633
QMenu * m_toolbarMenu
Definition: mainwindow.h:256
int getToolbarTextPosition() const

References Preferences::getToolbarTextPosition(), Preferences::instance(), m_toolbarMenu, m_ui, toolbarFollowSystem(), toolbarIconsOnly(), toolbarMenuRequested(), toolbarTextBeside(), toolbarTextOnly(), and toolbarTextUnder().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTorrentFailed

void MainWindow::addTorrentFailed ( const QString &  error) const
privateslot

Definition at line 851 of file mainwindow.cpp.

852 {
853  showNotificationBalloon(tr("Error"), tr("Failed to add torrent: %1").arg(error));
854 }

References showNotificationBalloon().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ askRecursiveTorrentDownloadConfirmation

void MainWindow::askRecursiveTorrentDownloadConfirmation ( BitTorrent::Torrent *const  torrent)
privateslot

Definition at line 960 of file mainwindow.cpp.

961 {
962  Preferences *const pref = Preferences::instance();
963  if (pref->recursiveDownloadDisabled()) return;
964 
965  const auto torrentID = torrent->id();
966 
967  QMessageBox *confirmBox = new QMessageBox(QMessageBox::Question, tr("Recursive download confirmation")
968  , tr("The torrent '%1' contains torrent files, do you want to proceed with their download?").arg(torrent->name())
969  , QMessageBox::NoButton, this);
970  confirmBox->setAttribute(Qt::WA_DeleteOnClose);
971  confirmBox->setModal(true);
972 
973  const QPushButton *yes = confirmBox->addButton(tr("Yes"), QMessageBox::YesRole);
974  /*QPushButton *no = */ confirmBox->addButton(tr("No"), QMessageBox::NoRole);
975  const QPushButton *never = confirmBox->addButton(tr("Never"), QMessageBox::NoRole);
976  connect(confirmBox, &QMessageBox::buttonClicked, this, [torrentID, yes, never](const QAbstractButton *button)
977  {
978  if (button == yes)
979  BitTorrent::Session::instance()->recursiveTorrentDownload(torrentID);
980  if (button == never)
981  Preferences::instance()->disableRecursiveDownload();
982  });
983  confirmBox->show();
984 }
TorrentID id() const
Definition: torrent.cpp:54
virtual QString name() const =0
bool recursiveDownloadDisabled() const

References BitTorrent::Torrent::id(), BitTorrent::Session::instance(), Preferences::instance(), BitTorrent::Torrent::name(), and Preferences::recursiveDownloadDisabled().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ balloonClicked

void MainWindow::balloonClicked ( )
privateslot

Definition at line 832 of file mainwindow.cpp.

833 {
834  if (isHidden())
835  {
836  if (m_uiLocked)
837  {
838  // Ask for UI lock password
839  if (!unlockUI())
840  return;
841  }
842  show();
843  if (isMinimized())
844  showNormal();
845  }
846 
847  raise();
848  activateWindow();
849 }

References m_uiLocked, and unlockUI().

Referenced by createTrayIcon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanup()

void MainWindow::cleanup ( )

Definition at line 796 of file mainwindow.cpp.

797 {
798  writeSettings();
799 
800  // delete RSSWidget explicitly to avoid crash in
801  // handleRSSUnreadCountUpdated() at application shutdown
802  delete m_rssWidget;
803 
804  delete m_executableWatcher;
805 
806  m_preventTimer->stop();
807 
808 #if (defined(Q_OS_WIN) || defined(Q_OS_MACOS))
809  if (m_programUpdateTimer)
810  m_programUpdateTimer->stop();
811 #endif
812 
813  // remove all child widgets
814  while (auto *w = findChild<QWidget *>())
815  delete w;
816 }
QPointer< RSSWidget > m_rssWidget
Definition: mainwindow.h:250

References m_executableWatcher, m_preventTimer, m_rssWidget, and writeSettings().

Here is the call graph for this function:

◆ clearUILockPassword

void MainWindow::clearUILockPassword ( )
privateslot

Definition at line 657 of file mainwindow.cpp.

658 {
659  const QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Clear the password")
660  , tr("Are you sure you want to clear the password?"), (QMessageBox::Yes | QMessageBox::No), QMessageBox::No);
661  if (answer == QMessageBox::Yes)
663 }
void setUILockPassword(const QByteArray &password)

References Preferences::instance(), and Preferences::setUILockPassword().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeEvent()

void MainWindow::closeEvent ( QCloseEvent *  e)
overrideprivate

Definition at line 1181 of file mainwindow.cpp.

1182 {
1183  Preferences *const pref = Preferences::instance();
1184 #ifdef Q_OS_MACOS
1185  if (!m_forceExit)
1186  {
1187  hide();
1188  e->accept();
1189  return;
1190  }
1191 #else
1192  const bool goToSystrayOnExit = pref->closeToTray();
1193  if (!m_forceExit && m_systrayIcon && goToSystrayOnExit && !this->isHidden())
1194  {
1195  e->ignore();
1196  QTimer::singleShot(0, this, &QWidget::hide);
1197  if (!pref->closeToTrayNotified())
1198  {
1199  showNotificationBalloon(tr("qBittorrent is closed to tray"), tr("This behavior can be changed in the settings. You won't be reminded again."));
1200  pref->setCloseToTrayNotified(true);
1201  }
1202  return;
1203  }
1204 #endif // Q_OS_MACOS
1205 
1207  {
1208  if (e->spontaneous() || m_forceExit)
1209  {
1210  if (!isVisible())
1211  show();
1212  QMessageBox confirmBox(QMessageBox::Question, tr("Exiting qBittorrent"),
1213  // Split it because the last sentence is used in the Web UI
1214  tr("Some files are currently transferring.") + '\n' + tr("Are you sure you want to quit qBittorrent?"),
1215  QMessageBox::NoButton, this);
1216  QPushButton *noBtn = confirmBox.addButton(tr("&No"), QMessageBox::NoRole);
1217  confirmBox.addButton(tr("&Yes"), QMessageBox::YesRole);
1218  QPushButton *alwaysBtn = confirmBox.addButton(tr("&Always Yes"), QMessageBox::YesRole);
1219  confirmBox.setDefaultButton(noBtn);
1220  confirmBox.exec();
1221  if (!confirmBox.clickedButton() || (confirmBox.clickedButton() == noBtn))
1222  {
1223  // Cancel exit
1224  e->ignore();
1225  m_forceExit = false;
1226  return;
1227  }
1228  if (confirmBox.clickedButton() == alwaysBtn)
1229  // Remember choice
1231  }
1232  }
1233 
1234  // Disable some UI to prevent user interactions
1235 #ifndef Q_OS_MACOS
1236  if (m_systrayIcon)
1237  {
1238  m_systrayIcon->setToolTip(tr("qBittorrent is shutting down..."));
1239  m_trayIconMenu->setEnabled(false);
1240  }
1241 #endif
1242 
1243  // Accept exit
1244  e->accept();
1245  qApp->exit();
1246 }
bool hasActiveTorrents() const
Definition: session.cpp:1747
bool m_forceExit
Definition: mainwindow.h:240
void setCloseToTrayNotified(bool b)
void setConfirmOnExit(bool confirm)
bool confirmOnExit() const
bool closeToTray() const
bool closeToTrayNotified() const

References Preferences::closeToTray(), Preferences::closeToTrayNotified(), Preferences::confirmOnExit(), nova3.nova2dl::e, BitTorrent::Session::hasActiveTorrents(), BitTorrent::Session::instance(), Preferences::instance(), m_forceExit, m_systrayIcon, m_trayIconMenu, Preferences::setCloseToTrayNotified(), Preferences::setConfirmOnExit(), and showNotificationBalloon().

Here is the call graph for this function:

◆ createKeyboardShortcuts

void MainWindow::createKeyboardShortcuts ( )
privateslot

Definition at line 877 of file mainwindow.cpp.

878 {
879  m_ui->actionCreateTorrent->setShortcut(QKeySequence::New);
880  m_ui->actionOpen->setShortcut(QKeySequence::Open);
881  m_ui->actionDelete->setShortcut(QKeySequence::Delete);
882  m_ui->actionDelete->setShortcutContext(Qt::WidgetShortcut); // nullify its effect: delete key event is handled by respective widgets, not here
883  m_ui->actionDownloadFromURL->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_O);
884  m_ui->actionExit->setShortcut(Qt::CTRL | Qt::Key_Q);
885 #ifdef Q_OS_MACOS
886  m_ui->actionCloseWindow->setShortcut(QKeySequence::Close);
887 #else
888  m_ui->actionCloseWindow->setVisible(false);
889 #endif
890 
891  const auto *switchTransferShortcut = new QShortcut((Qt::ALT | Qt::Key_1), this);
892  connect(switchTransferShortcut, &QShortcut::activated, this, &MainWindow::displayTransferTab);
893  const auto *switchSearchShortcut = new QShortcut((Qt::ALT | Qt::Key_2), this);
894  connect(switchSearchShortcut, &QShortcut::activated, this, qOverload<>(&MainWindow::displaySearchTab));
895  const auto *switchRSSShortcut = new QShortcut((Qt::ALT | Qt::Key_3), this);
896  connect(switchRSSShortcut, &QShortcut::activated, this, qOverload<>(&MainWindow::displayRSSTab));
897  const auto *switchExecutionLogShortcut = new QShortcut((Qt::ALT | Qt::Key_4), this);
898  connect(switchExecutionLogShortcut, &QShortcut::activated, this, &MainWindow::displayExecutionLogTab);
899  const auto *switchSearchFilterShortcut = new QShortcut(QKeySequence::Find, m_transferListWidget);
900  connect(switchSearchFilterShortcut, &QShortcut::activated, this, &MainWindow::focusSearchFilter);
901 
902  m_ui->actionDocumentation->setShortcut(QKeySequence::HelpContents);
903  m_ui->actionOptions->setShortcut(Qt::ALT | Qt::Key_O);
904  m_ui->actionStatistics->setShortcut(Qt::CTRL | Qt::Key_I);
905  m_ui->actionStart->setShortcut(Qt::CTRL | Qt::Key_S);
906  m_ui->actionStartAll->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_S);
907  m_ui->actionPause->setShortcut(Qt::CTRL | Qt::Key_P);
908  m_ui->actionPauseAll->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_P);
909  m_ui->actionBottomQueuePos->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Minus);
910  m_ui->actionDecreaseQueuePos->setShortcut(Qt::CTRL | Qt::Key_Minus);
911  m_ui->actionIncreaseQueuePos->setShortcut(Qt::CTRL | Qt::Key_Plus);
912  m_ui->actionTopQueuePos->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Plus);
913 #ifdef Q_OS_MACOS
914  m_ui->actionMinimize->setShortcut(Qt::CTRL + Qt::Key_M);
915  addAction(m_ui->actionMinimize);
916 #endif
917 }
void displaySearchTab()
Definition: mainwindow.cpp:925
void displayExecutionLogTab()
Definition: mainwindow.cpp:947
void displayTransferTab() const
Definition: mainwindow.cpp:920
void focusSearchFilter()
Definition: mainwindow.cpp:750

References displayExecutionLogTab(), displayRSSTab(), displaySearchTab(), displayTransferTab(), focusSearchFilter(), m_transferListWidget, and m_ui.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTorrentTriggered()

void MainWindow::createTorrentTriggered ( const QString &  path = {})
private

Definition at line 1254 of file mainwindow.cpp.

1255 {
1256  if (m_createTorrentDlg)
1257  {
1258  m_createTorrentDlg->updateInputPath(path);
1259  m_createTorrentDlg->activateWindow();
1260  }
1261  else
1262  m_createTorrentDlg = new TorrentCreatorDialog(this, path);
1263 }
QPointer< TorrentCreatorDialog > m_createTorrentDlg
Definition: mainwindow.h:228

References m_createTorrentDlg.

Referenced by dropEvent(), and on_actionCreateTorrent_triggered().

Here is the caller graph for this function:

◆ createTrayIcon()

void MainWindow::createTrayIcon ( int  retries)
private

Definition at line 1703 of file mainwindow.cpp.

1704 {
1705  if (m_systrayIcon)
1706  return;
1707 
1708  if (QSystemTrayIcon::isSystemTrayAvailable())
1709  {
1710  m_systrayIcon = new QSystemTrayIcon(UIThemeManager::instance()->getSystrayIcon(), this);
1711 
1713  m_systrayIcon->setContextMenu(m_trayIconMenu);
1714 
1715  connect(m_systrayIcon, &QSystemTrayIcon::activated, this, &MainWindow::toggleVisibility);
1716  connect(m_systrayIcon, &QSystemTrayIcon::messageClicked, this, &MainWindow::balloonClicked);
1717 
1718  m_systrayIcon->show();
1719  emit systemTrayIconCreated();
1720  }
1721  else
1722  {
1723  if (retries > 0)
1724  {
1725  LogMsg("System tray icon is not available, retrying...", Log::WARNING);
1726  QTimer::singleShot(std::chrono::seconds(2), this, [this, retries]()
1727  {
1728  if (Preferences::instance()->systemTrayEnabled())
1729  createTrayIcon(retries - 1);
1730  });
1731  }
1732  else
1733  {
1734  LogMsg("System tray icon is still not available after retries. Disabling it.", Log::WARNING);
1736  }
1737  }
1738 }
void balloonClicked()
Definition: mainwindow.cpp:832
void toggleVisibility(const QSystemTrayIcon::ActivationReason reason=QSystemTrayIcon::Trigger)
void createTrayIcon(int retries)
void setSystemTrayEnabled(bool enabled)
void LogMsg(const QString &message, const Log::MsgType &type)
Definition: logger.cpp:125

References balloonClicked(), createTrayIconMenu(), Preferences::instance(), UIThemeManager::instance(), LogMsg(), m_systrayIcon, m_trayIconMenu, Preferences::setSystemTrayEnabled(), systemTrayIconCreated(), toggleVisibility(), and Log::WARNING.

Referenced by loadPreferences().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTrayIconMenu()

void MainWindow::createTrayIconMenu ( )
private

Definition at line 1741 of file mainwindow.cpp.

1742 {
1743  if (m_trayIconMenu)
1744  return;
1745 
1746  m_trayIconMenu = new QMenu(this);
1747 
1748 #ifndef Q_OS_MACOS
1749  connect(m_trayIconMenu, &QMenu::aboutToShow, this, [this]()
1750  {
1751  m_ui->actionToggleVisibility->setText(isVisible() ? tr("Hide") : tr("Show"));
1752  });
1753 
1754  m_trayIconMenu->addAction(m_ui->actionToggleVisibility);
1755  m_trayIconMenu->addSeparator();
1756 #endif
1757 
1758  m_trayIconMenu->addAction(m_ui->actionOpen);
1759  m_trayIconMenu->addAction(m_ui->actionDownloadFromURL);
1760  m_trayIconMenu->addSeparator();
1761 
1762  m_trayIconMenu->addAction(m_ui->actionUseAlternativeSpeedLimits);
1763  m_trayIconMenu->addAction(m_ui->actionSetGlobalSpeedLimits);
1764  m_trayIconMenu->addSeparator();
1765 
1766  m_trayIconMenu->addAction(m_ui->actionStartAll);
1767  m_trayIconMenu->addAction(m_ui->actionPauseAll);
1768 
1769 #ifndef Q_OS_MACOS
1770  m_trayIconMenu->addSeparator();
1771  m_trayIconMenu->addAction(m_ui->actionExit);
1772 #endif
1773 
1774  if (m_uiLocked)
1775  m_trayIconMenu->setEnabled(false);
1776 }

References m_trayIconMenu, m_ui, and m_uiLocked.

Referenced by createTrayIcon(), and MainWindow().

Here is the caller graph for this function:

◆ currentTabWidget()

QWidget * MainWindow::currentTabWidget ( ) const

Definition at line 1023 of file mainwindow.cpp.

1024 {
1025  if (isMinimized() || !isVisible())
1026  return nullptr;
1027  if (m_tabs->currentIndex() == 0)
1028  return m_transferListWidget;
1029  return m_tabs->currentWidget();
1030 }

References m_tabs, and m_transferListWidget.

Referenced by TransferListWidget::bottomQueuePosSelectedTorrents(), TransferListWidget::decreaseQueuePosSelectedTorrents(), TransferListWidget::deleteSelectedTorrents(), TransferListWidget::increaseQueuePosSelectedTorrents(), reloadTorrentStats(), showEvent(), SearchWidget::tabStatusChanged(), and TransferListWidget::topQueuePosSelectedTorrents().

Here is the caller graph for this function:

◆ defineUILockPassword

bool MainWindow::defineUILockPassword ( )
privateslot

Definition at line 639 of file mainwindow.cpp.

640 {
641  bool ok = false;
642  const QString newPassword = AutoExpandableDialog::getText(this, tr("UI lock password")
643  , tr("Please type the UI lock password:"), QLineEdit::Password, {}, &ok);
644  if (!ok)
645  return false;
646 
647  if (newPassword.size() < 3)
648  {
649  QMessageBox::warning(this, tr("Invalid password"), tr("The password must be at least 3 characters long"));
650  return false;
651  }
652 
654  return true;
655 }
static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode=QLineEdit::Normal, const QString &text={}, bool *ok=nullptr, bool excludeExtension=false, Qt::InputMethodHints inputMethodHints=Qt::ImhNone)
QByteArray generate(const QString &password)
Definition: password.cpp:68

References Utils::Password::PBKDF2::generate(), AutoExpandableDialog::getText(), Preferences::instance(), and Preferences::setUILockPassword().

Referenced by MainWindow(), and on_actionLock_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayExecutionLogTab

void MainWindow::displayExecutionLogTab ( )
privateslot

Definition at line 947 of file mainwindow.cpp.

948 {
949  if (!m_executionLog)
950  {
951  m_ui->actionExecutionLogs->setChecked(true);
953  }
954 
955  m_tabs->setCurrentWidget(m_executionLog);
956 }
QPointer< ExecutionLogWidget > m_executionLog
Definition: mainwindow.h:251

References m_executionLog, m_tabs, m_ui, and on_actionExecutionLogs_triggered().

Referenced by createKeyboardShortcuts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayRSSTab [1/2]

void MainWindow::displayRSSTab ( )
privateslot

Definition at line 936 of file mainwindow.cpp.

937 {
938  if (!m_rssWidget)
939  {
940  m_ui->actionRSSReader->setChecked(true);
941  displayRSSTab(true);
942  }
943 
944  m_tabs->setCurrentWidget(m_rssWidget);
945 }

References m_rssWidget, m_tabs, and m_ui.

Referenced by createKeyboardShortcuts(), MainWindow(), and on_actionRSSReader_triggered().

Here is the caller graph for this function:

◆ displayRSSTab() [2/2]

void MainWindow::displayRSSTab ( bool  enable)
private

Definition at line 688 of file mainwindow.cpp.

689 {
690  if (enable)
691  {
692  // RSS tab
693  if (!m_rssWidget)
694  {
697 #ifdef Q_OS_MACOS
698  m_tabs->addTab(m_rssWidget, tr("RSS (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
699 #else
700  const int indexTab = m_tabs->addTab(m_rssWidget, tr("RSS (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
701  m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon("application-rss+xml"));
702 #endif
703  }
704  }
705  else
706  {
707  delete m_rssWidget;
708  }
709 }
void handleRSSUnreadCountUpdated(int count)
Definition: mainwindow.cpp:683
static Session * instance()
void unreadCountUpdated(int count)

References handleRSSUnreadCountUpdated(), RSS::Session::instance(), UIThemeManager::instance(), m_rssWidget, m_tabs, and RSSWidget::unreadCountUpdated().

Here is the call graph for this function:

◆ displaySearchTab [1/2]

void MainWindow::displaySearchTab ( )
privateslot

Definition at line 925 of file mainwindow.cpp.

926 {
927  if (!m_searchWidget)
928  {
929  m_ui->actionSearchWidget->setChecked(true);
930  displaySearchTab(true);
931  }
932 
933  m_tabs->setCurrentWidget(m_searchWidget);
934 }
QPointer< SearchWidget > m_searchWidget
Definition: mainwindow.h:249

References m_searchWidget, m_tabs, and m_ui.

Referenced by createKeyboardShortcuts(), and on_actionSearchWidget_triggered().

Here is the caller graph for this function:

◆ displaySearchTab() [2/2]

void MainWindow::displaySearchTab ( bool  enable)
private

Definition at line 728 of file mainwindow.cpp.

729 {
731  if (enable)
732  {
733  // RSS tab
734  if (!m_searchWidget)
735  {
736  m_searchWidget = new SearchWidget(this);
737  m_tabs->insertTab(1, m_searchWidget,
738 #ifndef Q_OS_MACOS
739  UIThemeManager::instance()->getIcon("edit-find"),
740 #endif
741  tr("Search"));
742  }
743  }
744  else
745  {
746  delete m_searchWidget;
747  }
748 }
void setSearchEnabled(bool enabled)

References Preferences::instance(), UIThemeManager::instance(), m_searchWidget, m_tabs, and Preferences::setSearchEnabled().

Here is the call graph for this function:

◆ displayTransferTab

void MainWindow::displayTransferTab ( ) const
privateslot

Definition at line 920 of file mainwindow.cpp.

921 {
922  m_tabs->setCurrentWidget(m_transferListWidget);
923 }

References m_tabs, and m_transferListWidget.

Referenced by createKeyboardShortcuts().

Here is the caller graph for this function:

◆ downloadFromURLList

void MainWindow::downloadFromURLList ( const QStringList &  urlList)
privateslot

Definition at line 1684 of file mainwindow.cpp.

1685 {
1686  const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled();
1687  for (const QString &url : urlList)
1688  {
1689  if (useTorrentAdditionDialog)
1690  AddNewTorrentDialog::show(url, this);
1691  else
1693  }
1694 }
static void show(const QString &source, const BitTorrent::AddTorrentParams &inParams, QWidget *parent)
bool addTorrent(const QString &source, const AddTorrentParams &params=AddTorrentParams())
Definition: session.cpp:2007

References BitTorrent::Session::addTorrent(), BitTorrent::Session::instance(), AddNewTorrentDialog::isEnabled(), and AddNewTorrentDialog::show().

Referenced by on_actionDownloadFromURL_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dragEnterEvent()

void MainWindow::dragEnterEvent ( QDragEnterEvent *  event)
overrideprivate

Definition at line 1383 of file mainwindow.cpp.

1384 {
1385  for (const QString &mime : asConst(event->mimeData()->formats()))
1386  qDebug("mimeData: %s", mime.toLocal8Bit().data());
1387  if (event->mimeData()->hasFormat("text/plain") || event->mimeData()->hasFormat("text/uri-list"))
1388  event->acceptProposedAction();
1389 }
bool event(QEvent *e) override

References asConst(), and event().

Here is the call graph for this function:

◆ dropEvent()

void MainWindow::dropEvent ( QDropEvent *  event)
overrideprivate

Definition at line 1327 of file mainwindow.cpp.

1328 {
1329  event->acceptProposedAction();
1330 
1331  // remove scheme
1332  QStringList files;
1333  if (event->mimeData()->hasUrls())
1334  {
1335  for (const QUrl &url : asConst(event->mimeData()->urls()))
1336  {
1337  if (url.isEmpty())
1338  continue;
1339 
1340  files << ((url.scheme().compare("file", Qt::CaseInsensitive) == 0)
1341  ? url.toLocalFile()
1342  : url.toString());
1343  }
1344  }
1345  else
1346  {
1347  files = event->mimeData()->text().split('\n');
1348  }
1349 
1350  // differentiate ".torrent" files/links & magnet links from others
1351  QStringList torrentFiles, otherFiles;
1352  for (const QString &file : asConst(files))
1353  {
1354  if (isTorrentLink(file))
1355  torrentFiles << file;
1356  else
1357  otherFiles << file;
1358  }
1359 
1360  // Download torrents
1361  const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled();
1362  for (const QString &file : asConst(torrentFiles))
1363  {
1364  if (useTorrentAdditionDialog)
1366  else
1368  }
1369  if (!torrentFiles.isEmpty()) return;
1370 
1371  // Create torrent
1372  for (const QString &file : asConst(otherFiles))
1373  {
1375 
1376  // currently only handle the first entry
1377  // this is a stub that can be expanded later to create many torrents at once
1378  break;
1379  }
1380 }
void createTorrentTriggered(const QString &path={})
flag icons free of to any person obtaining a copy of this software and associated documentation files(the "Software")
bool isTorrentLink(const QString &str)
Definition: mainwindow.cpp:114
file(GLOB QBT_TS_FILES "${qBittorrent_SOURCE_DIR}/src/lang/*.ts") set_source_files_properties($
Definition: CMakeLists.txt:5

References BitTorrent::Session::addTorrent(), asConst(), createTorrentTriggered(), event(), file(), files(), BitTorrent::Session::instance(), AddNewTorrentDialog::isEnabled(), anonymous_namespace{mainwindow.cpp}::isTorrentLink(), and AddNewTorrentDialog::show().

Here is the call graph for this function:

◆ event()

bool MainWindow::event ( QEvent *  e)
overrideprivate

Definition at line 1265 of file mainwindow.cpp.

1266 {
1267 #ifndef Q_OS_MACOS
1268  switch (e->type())
1269  {
1270  case QEvent::WindowStateChange:
1271  {
1272  qDebug("Window change event");
1273  // Now check to see if the window is minimised
1274  if (isMinimized())
1275  {
1276  qDebug("minimisation");
1277  Preferences *const pref = Preferences::instance();
1278  if (m_systrayIcon && pref->minimizeToTray())
1279  {
1280  qDebug() << "Has active window:" << (qApp->activeWindow() != nullptr);
1281  // Check if there is a modal window
1282  bool hasModalWindow = false;
1283  for (QWidget *widget : asConst(QApplication::allWidgets()))
1284  {
1285  if (widget->isModal())
1286  {
1287  hasModalWindow = true;
1288  break;
1289  }
1290  }
1291  // Iconify if there is no modal window
1292  if (!hasModalWindow)
1293  {
1294  qDebug("Minimize to Tray enabled, hiding!");
1295  e->ignore();
1296  QTimer::singleShot(0, this, &QWidget::hide);
1297  if (!pref->minimizeToTrayNotified())
1298  {
1299  showNotificationBalloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again."));
1300  pref->setMinimizeToTrayNotified(true);
1301  }
1302  return true;
1303  }
1304  }
1305  }
1306  break;
1307  }
1308  case QEvent::ToolBarChange:
1309  {
1310  qDebug("MAC: Received a toolbar change event!");
1311  bool ret = QMainWindow::event(e);
1312 
1313  qDebug("MAC: new toolbar visibility is %d", !m_ui->actionTopToolBar->isChecked());
1314  m_ui->actionTopToolBar->toggle();
1315  Preferences::instance()->setToolbarDisplayed(m_ui->actionTopToolBar->isChecked());
1316  return ret;
1317  }
1318  default:
1319  break;
1320  }
1321 #endif // Q_OS_MACOS
1322 
1323  return QMainWindow::event(e);
1324 }
void setToolbarDisplayed(bool displayed)

References asConst(), nova3.nova2dl::e, Preferences::instance(), m_systrayIcon, m_ui, Preferences::minimizeToTray(), Preferences::minimizeToTrayNotified(), Preferences::setMinimizeToTrayNotified(), Preferences::setToolbarDisplayed(), and showNotificationBalloon().

Referenced by dragEnterEvent(), dropEvent(), and keyPressEvent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ executionLogMsgTypes()

Log::MsgTypes MainWindow::executionLogMsgTypes ( ) const

◆ finishedTorrent

void MainWindow::finishedTorrent ( BitTorrent::Torrent *const  torrent) const
privateslot

Definition at line 864 of file mainwindow.cpp.

865 {
866  showNotificationBalloon(tr("Download completed"), tr("'%1' has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(torrent->name()));
867 }

References BitTorrent::Torrent::name(), and showNotificationBalloon().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ focusSearchFilter

void MainWindow::focusSearchFilter ( )
privateslot

Definition at line 750 of file mainwindow.cpp.

751 {
752  m_searchFilter->setFocus();
753  m_searchFilter->selectAll();
754 }

References m_searchFilter.

Referenced by createKeyboardShortcuts().

Here is the caller graph for this function:

◆ fullDiskError

void MainWindow::fullDiskError ( BitTorrent::Torrent *const  torrent,
const QString &  msg 
) const
privateslot

Definition at line 870 of file mainwindow.cpp.

871 {
872  showNotificationBalloon(tr("I/O Error", "i.e: Input/Output Error")
873  , tr("An I/O error occurred for torrent '%1'.\n Reason: %2"
874  , "e.g: An error occurred for torrent 'xxx.avi'.\n Reason: disk is full.").arg(torrent->name(), msg));
875 }

References BitTorrent::Torrent::name(), and showNotificationBalloon().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleDownloadFromUrlFailure

void MainWindow::handleDownloadFromUrlFailure ( const QString &  url,
const QString &  reason 
) const
privateslot

Definition at line 986 of file mainwindow.cpp.

987 {
988  // Display a message box
989  showNotificationBalloon(tr("URL download error")
990  , tr("Couldn't download file at URL '%1', reason: %2.").arg(url, reason));
991 }

References showNotificationBalloon().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleRSSUnreadCountUpdated

void MainWindow::handleRSSUnreadCountUpdated ( int  count)
privateslot

Definition at line 683 of file mainwindow.cpp.

684 {
685  m_tabs->setTabText(m_tabs->indexOf(m_rssWidget), tr("RSS (%1)").arg(count));
686 }

References m_rssWidget, and m_tabs.

Referenced by displayRSSTab().

Here is the caller graph for this function:

◆ isDownloadTrackerFavicon()

bool MainWindow::isDownloadTrackerFavicon ( ) const

Definition at line 538 of file mainwindow.cpp.

539 {
541 }

References m_storeDownloadTrackerFavicon.

Referenced by AdvancedSettings::loadAdvancedSettings(), and MainWindow().

Here is the caller graph for this function:

◆ isExecutionLogEnabled()

bool MainWindow::isExecutionLogEnabled ( ) const

Definition at line 485 of file mainwindow.cpp.

486 {
488 }

References m_storeExecutionLogEnabled.

Referenced by MainWindow().

Here is the caller graph for this function:

◆ isNotificationsEnabled()

bool MainWindow::isNotificationsEnabled ( ) const

Definition at line 506 of file mainwindow.cpp.

507 {
508  return m_storeNotificationEnabled.get(true);
509 }
T get(const T &defaultValue={}) const
Definition: settingvalue.h:46

References SettingValue< T >::get(), and m_storeNotificationEnabled.

Referenced by AdvancedSettings::loadAdvancedSettings(), showNotificationBalloon(), and SearchWidget::tabStatusChanged().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTorrentAddedNotificationsEnabled()

bool MainWindow::isTorrentAddedNotificationsEnabled ( ) const

Definition at line 516 of file mainwindow.cpp.

517 {
519 }

References m_storeNotificationTorrentAdded.

Referenced by AdvancedSettings::loadAdvancedSettings(), and torrentNew().

Here is the caller graph for this function:

◆ keyPressEvent()

void MainWindow::keyPressEvent ( QKeyEvent *  event)
overrideprivate

Definition at line 1149 of file mainwindow.cpp.

1150 {
1151  if (event->matches(QKeySequence::Paste))
1152  {
1153  const QMimeData *mimeData {QGuiApplication::clipboard()->mimeData()};
1154 
1155  if (mimeData->hasText())
1156  {
1157  const bool useTorrentAdditionDialog {AddNewTorrentDialog::isEnabled()};
1158  const QStringList lines {mimeData->text().split('\n', Qt::SkipEmptyParts)};
1159 
1160  for (QString line : lines)
1161  {
1162  line = line.trimmed();
1163 
1164  if (!isTorrentLink(line))
1165  continue;
1166 
1167  if (useTorrentAdditionDialog)
1168  AddNewTorrentDialog::show(line, this);
1169  else
1171  }
1172 
1173  return;
1174  }
1175  }
1176 
1177  QMainWindow::keyPressEvent(event);
1178 }

References BitTorrent::Session::addTorrent(), event(), BitTorrent::Session::instance(), AddNewTorrentDialog::isEnabled(), anonymous_namespace{mainwindow.cpp}::isTorrentLink(), and AddNewTorrentDialog::show().

Here is the call graph for this function:

◆ loadPreferences

void MainWindow::loadPreferences ( )
privateslot

Definition at line 1485 of file mainwindow.cpp.

1486 {
1487  const Preferences *pref = Preferences::instance();
1488 
1489 #ifndef Q_OS_MACOS
1490  // system tray icon
1491  if (pref->systemTrayEnabled())
1492  {
1493  if (m_systrayIcon)
1494  {
1495  // Reload systray icon
1496  m_systrayIcon->setIcon(UIThemeManager::instance()->getSystrayIcon());
1497  }
1498  else
1499  {
1500  createTrayIcon(20);
1501  }
1502  }
1503  else
1504  {
1505  delete m_systrayIcon;
1506  delete m_trayIconMenu;
1507  m_ui->actionLock->setVisible(false);
1508  }
1509 #endif
1510 
1511  // General
1512  if (pref->isToolbarDisplayed())
1513  {
1514  m_ui->toolBar->setVisible(true);
1515  }
1516  else
1517  {
1518  // Clear search filter before hiding the top toolbar
1519  m_searchFilter->clear();
1520  m_ui->toolBar->setVisible(false);
1521  }
1522 
1524 
1526  {
1527  if (!m_preventTimer->isActive())
1528  {
1531  }
1532  }
1533  else
1534  {
1535  m_preventTimer->stop();
1536  m_pwr->setActivityState(false);
1537  }
1538 
1539  m_transferListWidget->setAlternatingRowColors(pref->useAlternatingRowColors());
1540  m_propertiesWidget->getFilesList()->setAlternatingRowColors(pref->useAlternatingRowColors());
1541  m_propertiesWidget->getTrackerList()->setAlternatingRowColors(pref->useAlternatingRowColors());
1542  m_propertiesWidget->getPeerList()->setAlternatingRowColors(pref->useAlternatingRowColors());
1543 
1544  // Queueing System
1545  if (BitTorrent::Session::instance()->isQueueingSystemEnabled())
1546  {
1547  if (!m_ui->actionDecreaseQueuePos->isVisible())
1548  {
1550  m_ui->actionDecreaseQueuePos->setVisible(true);
1551  m_ui->actionIncreaseQueuePos->setVisible(true);
1552  m_ui->actionTopQueuePos->setVisible(true);
1553  m_ui->actionBottomQueuePos->setVisible(true);
1554 #ifndef Q_OS_MACOS
1555  m_queueSeparator->setVisible(true);
1556 #endif
1557  m_queueSeparatorMenu->setVisible(true);
1558  }
1559  }
1560  else
1561  {
1562  if (m_ui->actionDecreaseQueuePos->isVisible())
1563  {
1565  m_ui->actionDecreaseQueuePos->setVisible(false);
1566  m_ui->actionIncreaseQueuePos->setVisible(false);
1567  m_ui->actionTopQueuePos->setVisible(false);
1568  m_ui->actionBottomQueuePos->setVisible(false);
1569 #ifndef Q_OS_MACOS
1570  m_queueSeparator->setVisible(false);
1571 #endif
1572  m_queueSeparatorMenu->setVisible(false);
1573  }
1574  }
1575 
1576  // Torrent properties
1578 
1579 #if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
1580  if (pref->isUpdateCheckEnabled())
1581  {
1582  if (!m_programUpdateTimer)
1583  {
1584  m_programUpdateTimer = new QTimer(this);
1585  m_programUpdateTimer->setInterval(24h);
1586  m_programUpdateTimer->setSingleShot(true);
1587  connect(m_programUpdateTimer, &QTimer::timeout, this, [this]() { checkProgramUpdate(false); });
1588  m_programUpdateTimer->start();
1589  }
1590  }
1591  else
1592  {
1593  delete m_programUpdateTimer;
1594  m_programUpdateTimer = nullptr;
1595  }
1596 #endif
1597 
1598  qDebug("GUI settings loaded");
1599 }
void showStatusBar(bool show)
void setActivityState(bool busy)
bool preventFromSuspendWhenSeeding() const
bool useAlternatingRowColors() const
bool systemTrayEnabled() const
bool preventFromSuspendWhenDownloading() const
TrackerListWidget * getTrackerList() const
QTreeView * getFilesList() const
PeerListWidget * getPeerList() const
void hideQueuePosColumn(bool hide)
const std::chrono::seconds PREVENT_SUSPEND_INTERVAL
Definition: mainwindow.cpp:109

References createTrayIcon(), PropertiesWidget::getFilesList(), PropertiesWidget::getPeerList(), PropertiesWidget::getTrackerList(), TransferListWidget::hideQueuePosColumn(), BitTorrent::Session::instance(), Preferences::instance(), UIThemeManager::instance(), Preferences::isStatusbarDisplayed(), Preferences::isToolbarDisplayed(), m_preventTimer, m_propertiesWidget, m_pwr, m_queueSeparator, m_queueSeparatorMenu, m_searchFilter, m_systrayIcon, m_transferListWidget, m_trayIconMenu, m_ui, anonymous_namespace{mainwindow.cpp}::PREVENT_SUSPEND_INTERVAL, Preferences::preventFromSuspendWhenDownloading(), Preferences::preventFromSuspendWhenSeeding(), PropertiesWidget::reloadPreferences(), PowerManagement::setActivityState(), showStatusBar(), Preferences::systemTrayEnabled(), updatePowerManagementState(), and Preferences::useAlternatingRowColors().

Referenced by MainWindow(), and optionsSaved().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ manageCookies

void MainWindow::manageCookies ( )
privateslot

Definition at line 597 of file mainwindow.cpp.

598 {
599  auto *cookieDialog = new CookiesDialog(this);
600  cookieDialog->setAttribute(Qt::WA_DeleteOnClose);
601  cookieDialog->open();
602 }

Referenced by MainWindow().

Here is the caller graph for this function:

◆ minimizeWindow

void MainWindow::minimizeWindow ( )
privateslot

Definition at line 1969 of file mainwindow.cpp.

1970 {
1971  setWindowState(windowState() | Qt::WindowMinimized);
1972 }

Referenced by MainWindow().

Here is the caller graph for this function:

◆ notifyOfUpdate

void MainWindow::notifyOfUpdate ( const QString &  )
privateslot

Definition at line 1062 of file mainwindow.cpp.

1063 {
1064  // Show restart message
1065  m_statusBar->showRestartRequired();
1066  Logger::instance()->addMessage(tr("qBittorrent was just updated and needs to be restarted for the changes to be effective.")
1067  , Log::CRITICAL);
1068  // Delete the executable watcher
1069  delete m_executableWatcher;
1070  m_executableWatcher = nullptr;
1071 }
void addMessage(const QString &message, const Log::MsgType &type=Log::NORMAL)
Definition: logger.cpp:73
static Logger * instance()
Definition: logger.cpp:56
QPointer< StatusBar > m_statusBar
Definition: mainwindow.h:224

References Logger::addMessage(), Log::CRITICAL, Logger::instance(), m_executableWatcher, and m_statusBar.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionAbout_triggered

void MainWindow::on_actionAbout_triggered ( )
privateslot

Definition at line 1106 of file mainwindow.cpp.

1107 {
1108  // About dialog
1109  if (m_aboutDlg)
1110  m_aboutDlg->activateWindow();
1111  else
1112  m_aboutDlg = new AboutDialog(this);
1113 }
QPointer< AboutDialog > m_aboutDlg
Definition: mainwindow.h:226

References m_aboutDlg.

◆ on_actionAutoExit_toggled

void MainWindow::on_actionAutoExit_toggled ( bool  enabled)
privateslot

Definition at line 2035 of file mainwindow.cpp.

2036 {
2037  qDebug() << Q_FUNC_INFO << enabled;
2039 }
void setShutdownqBTWhenDownloadsComplete(bool shutdown)

References Preferences::instance(), and Preferences::setShutdownqBTWhenDownloadsComplete().

Here is the call graph for this function:

◆ on_actionAutoHibernate_toggled

void MainWindow::on_actionAutoHibernate_toggled ( bool  enabled)
privateslot

Definition at line 2047 of file mainwindow.cpp.

2048 {
2049  qDebug() << Q_FUNC_INFO << enabled;
2051 }
void setHibernateWhenDownloadsComplete(bool hibernate)

References Preferences::instance(), and Preferences::setHibernateWhenDownloadsComplete().

Here is the call graph for this function:

◆ on_actionAutoShutdown_toggled

void MainWindow::on_actionAutoShutdown_toggled ( bool  enabled)
privateslot

Definition at line 2053 of file mainwindow.cpp.

2054 {
2055  qDebug() << Q_FUNC_INFO << enabled;
2057 }
void setShutdownWhenDownloadsComplete(bool shutdown)

References Preferences::instance(), and Preferences::setShutdownWhenDownloadsComplete().

Here is the call graph for this function:

◆ on_actionAutoSuspend_toggled

void MainWindow::on_actionAutoSuspend_toggled ( bool  enabled)
privateslot

Definition at line 2041 of file mainwindow.cpp.

2042 {
2043  qDebug() << Q_FUNC_INFO << enabled;
2045 }
void setSuspendWhenDownloadsComplete(bool suspend)

References Preferences::instance(), and Preferences::setSuspendWhenDownloadsComplete().

Here is the call graph for this function:

◆ on_actionCreateTorrent_triggered

void MainWindow::on_actionCreateTorrent_triggered ( )
privateslot

Definition at line 1249 of file mainwindow.cpp.

1250 {
1252 }

References createTorrentTriggered().

Here is the call graph for this function:

◆ on_actionCriticalMessages_triggered

void MainWindow::on_actionCriticalMessages_triggered ( bool  checked)
privateslot

Definition at line 2026 of file mainwindow.cpp.

2027 {
2028  if (!m_executionLog)
2029  return;
2030 
2031  const Log::MsgTypes flags = executionLogMsgTypes().setFlag(Log::CRITICAL, checked);
2032  setExecutionLogMsgTypes(flags);
2033 }
void setExecutionLogMsgTypes(Log::MsgTypes value)
Definition: mainwindow.cpp:500

References Log::CRITICAL, executionLogMsgTypes(), m_executionLog, and setExecutionLogMsgTypes().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionDocumentation_triggered

void MainWindow::on_actionDocumentation_triggered ( ) const
privateslot

Definition at line 761 of file mainwindow.cpp.

762 {
763  QDesktopServices::openUrl(QUrl("http://doc.qbittorrent.org"));
764 }

◆ on_actionDonateMoney_triggered

void MainWindow::on_actionDonateMoney_triggered ( )
privateslot

Definition at line 1958 of file mainwindow.cpp.

1959 {
1960  QDesktopServices::openUrl(QUrl("https://www.qbittorrent.org/donate"));
1961 }

◆ on_actionDownloadFromURL_triggered

void MainWindow::on_actionDownloadFromURL_triggered ( )
privateslot

Definition at line 1889 of file mainwindow.cpp.

1890 {
1892  {
1895  }
1896 }
void urlsReadyToBeDownloaded(const QStringList &torrentURLs)
void downloadFromURLList(const QStringList &urlList)
QPointer< DownloadFromURLDialog > m_downloadFromURLDialog
Definition: mainwindow.h:229

References downloadFromURLList(), m_downloadFromURLDialog, and DownloadFromURLDialog::urlsReadyToBeDownloaded().

Here is the call graph for this function:

◆ on_actionExecutionLogs_triggered

void MainWindow::on_actionExecutionLogs_triggered ( bool  checked)
privateslot

Definition at line 1974 of file mainwindow.cpp.

1975 {
1976  if (checked)
1977  {
1978  Q_ASSERT(!m_executionLog);
1980 #ifdef Q_OS_MACOS
1981  m_tabs->addTab(m_executionLog, tr("Execution Log"));
1982 #else
1983  const int indexTab = m_tabs->addTab(m_executionLog, tr("Execution Log"));
1984  m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon("view-calendar-journal"));
1985 #endif
1986  }
1987  else
1988  {
1989  delete m_executionLog;
1990  }
1991 
1992  m_ui->actionNormalMessages->setEnabled(checked);
1993  m_ui->actionInformationMessages->setEnabled(checked);
1994  m_ui->actionWarningMessages->setEnabled(checked);
1995  m_ui->actionCriticalMessages->setEnabled(checked);
1996  setExecutionLogEnabled(checked);
1997 }
void setExecutionLogEnabled(bool value)
Definition: mainwindow.cpp:490

References executionLogMsgTypes(), UIThemeManager::instance(), m_executionLog, m_tabs, m_ui, and setExecutionLogEnabled().

Referenced by displayExecutionLogTab(), and MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionExit_triggered

void MainWindow::on_actionExit_triggered ( )
privateslot

Definition at line 1002 of file mainwindow.cpp.

1003 {
1004  // UI locking enforcement.
1005  if (isHidden() && m_uiLocked)
1006  // Ask for UI lock password
1007  if (!unlockUI()) return;
1008 
1009  m_forceExit = true;
1010  close();
1011 }

References m_forceExit, m_uiLocked, and unlockUI().

Here is the call graph for this function:

◆ on_actionInformationMessages_triggered

void MainWindow::on_actionInformationMessages_triggered ( bool  checked)
privateslot

Definition at line 2008 of file mainwindow.cpp.

2009 {
2010  if (!m_executionLog)
2011  return;
2012 
2013  const Log::MsgTypes flags = executionLogMsgTypes().setFlag(Log::INFO, checked);
2014  setExecutionLogMsgTypes(flags);
2015 }

References executionLogMsgTypes(), Log::INFO, m_executionLog, and setExecutionLogMsgTypes().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionLock_triggered

void MainWindow::on_actionLock_triggered ( )
privateslot

Definition at line 665 of file mainwindow.cpp.

666 {
667  Preferences *const pref = Preferences::instance();
668 
669  // Check if there is a password
670  if (pref->getUILockPassword().isEmpty())
671  {
672  if (!defineUILockPassword())
673  return;
674  }
675 
676  // Lock the interface
677  m_uiLocked = true;
678  pref->setUILocked(true);
679  m_trayIconMenu->setEnabled(false);
680  hide();
681 }
void setUILocked(bool locked)
QByteArray getUILockPassword() const

References defineUILockPassword(), Preferences::getUILockPassword(), Preferences::instance(), m_trayIconMenu, m_uiLocked, and Preferences::setUILocked().

Here is the call graph for this function:

◆ on_actionNormalMessages_triggered

void MainWindow::on_actionNormalMessages_triggered ( bool  checked)
privateslot

Definition at line 1999 of file mainwindow.cpp.

2000 {
2001  if (!m_executionLog)
2002  return;
2003 
2004  const Log::MsgTypes flags = executionLogMsgTypes().setFlag(Log::NORMAL, checked);
2005  setExecutionLogMsgTypes(flags);
2006 }

References executionLogMsgTypes(), m_executionLog, Log::NORMAL, and setExecutionLogMsgTypes().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionOpen_triggered

void MainWindow::on_actionOpen_triggered ( )
privateslot

Definition at line 1424 of file mainwindow.cpp.

1425 {
1426  Preferences *const pref = Preferences::instance();
1427  // Open File Open Dialog
1428  // Note: it is possible to select more than one file
1429  const QStringList pathsList =
1430  QFileDialog::getOpenFileNames(this, tr("Open Torrent Files"), pref->getMainLastDir(),
1431  tr("Torrent Files") + " (*" + C_TORRENT_FILE_EXTENSION + ')');
1432 
1433  if (pathsList.isEmpty())
1434  return;
1435 
1436  const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled();
1437 
1438  for (const QString &file : pathsList)
1439  {
1440  if (useTorrentAdditionDialog)
1442  else
1444  }
1445 
1446  // Save last dir to remember it
1447  QString topDir = Utils::Fs::toUniformPath(pathsList.at(0));
1448  topDir = topDir.left(topDir.lastIndexOf('/'));
1449  pref->setMainLastDir(topDir);
1450 }
void setMainLastDir(const QString &path)
QString getMainLastDir() const
const char C_TORRENT_FILE_EXTENSION[]
Definition: global.h:38
QString toUniformPath(const QString &path)
Definition: fs.cpp:69

References BitTorrent::Session::addTorrent(), C_TORRENT_FILE_EXTENSION, file(), Preferences::getMainLastDir(), BitTorrent::Session::instance(), Preferences::instance(), AddNewTorrentDialog::isEnabled(), Preferences::setMainLastDir(), AddNewTorrentDialog::show(), and Utils::Fs::toUniformPath().

Here is the call graph for this function:

◆ on_actionOptions_triggered

void MainWindow::on_actionOptions_triggered ( )
privateslot

Definition at line 1789 of file mainwindow.cpp.

1790 {
1791  if (m_options)
1792  m_options->activateWindow();
1793  else
1794  m_options = new OptionsDialog(this);
1795 }
QPointer< OptionsDialog > m_options
Definition: mainwindow.h:225

References m_options.

Referenced by showConnectionSettings().

Here is the caller graph for this function:

◆ on_actionRSSReader_triggered

void MainWindow::on_actionRSSReader_triggered ( )
privateslot

Definition at line 1821 of file mainwindow.cpp.

1822 {
1823  Preferences::instance()->setRSSWidgetVisible(m_ui->actionRSSReader->isChecked());
1824  displayRSSTab(m_ui->actionRSSReader->isChecked());
1825 }
void setRSSWidgetVisible(bool enabled)

References displayRSSTab(), Preferences::instance(), m_ui, and Preferences::setRSSWidgetVisible().

Here is the call graph for this function:

◆ on_actionSearchWidget_triggered

void MainWindow::on_actionSearchWidget_triggered ( )
privateslot

Definition at line 1827 of file mainwindow.cpp.

1828 {
1829  if (!m_hasPython && m_ui->actionSearchWidget->isChecked())
1830  {
1832 
1833  // Not installed
1834  if (!pyInfo.isValid())
1835  {
1836  m_ui->actionSearchWidget->setChecked(false);
1838 
1839 #ifdef Q_OS_WIN
1840  const QMessageBox::StandardButton buttonPressed = QMessageBox::question(this, tr("Missing Python Runtime")
1841  , tr("Python is required to use the search engine but it does not seem to be installed.\nDo you want to install it now?")
1842  , (QMessageBox::Yes | QMessageBox::No), QMessageBox::Yes);
1843  if (buttonPressed == QMessageBox::Yes)
1844  installPython();
1845 #else
1846  QMessageBox::information(this, tr("Missing Python Runtime")
1847  , tr("Python is required to use the search engine but it does not seem to be installed."));
1848 #endif
1849  return;
1850  }
1851 
1852  // Check version requirement
1853  if (!pyInfo.isSupportedVersion())
1854  {
1855  m_ui->actionSearchWidget->setChecked(false);
1857 
1858 #ifdef Q_OS_WIN
1859  const QMessageBox::StandardButton buttonPressed = QMessageBox::question(this, tr("Old Python Runtime")
1860  , tr("Your Python version (%1) is outdated. Minimum requirement: %2.\nDo you want to install a newer version now?")
1861  .arg(pyInfo.version, QLatin1String("3.5.0"))
1862  , (QMessageBox::Yes | QMessageBox::No), QMessageBox::Yes);
1863  if (buttonPressed == QMessageBox::Yes)
1864  installPython();
1865 #else
1866  QMessageBox::information(this, tr("Old Python Runtime")
1867  , tr("Your Python version (%1) is outdated. Please upgrade to latest version for search engines to work.\nMinimum requirement: %2.")
1868  .arg(pyInfo.version, QLatin1String("3.5.0")));
1869 #endif
1870  return;
1871  }
1872 
1873  m_hasPython = true;
1874  m_ui->actionSearchWidget->setChecked(true);
1876  }
1877 
1878  displaySearchTab(m_ui->actionSearchWidget->isChecked());
1879 }
bool m_hasPython
Definition: mainwindow.h:255
PythonInfo pythonInfo()

References displaySearchTab(), Preferences::instance(), Utils::ForeignApps::PythonInfo::isSupportedVersion(), Utils::ForeignApps::PythonInfo::isValid(), m_hasPython, m_ui, Utils::ForeignApps::pythonInfo(), Preferences::setSearchEnabled(), and Utils::ForeignApps::PythonInfo::version.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionSetGlobalSpeedLimits_triggered

void MainWindow::on_actionSetGlobalSpeedLimits_triggered ( )
privateslot

Definition at line 993 of file mainwindow.cpp.

994 {
995  auto dialog = new SpeedLimitDialog {this};
996  dialog->setAttribute(Qt::WA_DeleteOnClose);
997  dialog->open();
998 }

◆ on_actionShowStatusbar_triggered

void MainWindow::on_actionShowStatusbar_triggered ( )
privateslot

Definition at line 1804 of file mainwindow.cpp.

1805 {
1806  const bool isVisible = static_cast<QAction *>(sender())->isChecked();
1808  showStatusBar(isVisible);
1809 }
void setStatusbarDisplayed(bool displayed)

References Preferences::instance(), Preferences::setStatusbarDisplayed(), and showStatusBar().

Here is the call graph for this function:

◆ on_actionSpeedInTitleBar_triggered

void MainWindow::on_actionSpeedInTitleBar_triggered ( )
privateslot

Definition at line 1811 of file mainwindow.cpp.

1812 {
1813  m_displaySpeedInTitle = static_cast<QAction *>(sender())->isChecked();
1817  else
1818  setWindowTitle("qBittorrent " QBT_VERSION);
1819 }
void showSpeedInTitleBar(bool show)

References Preferences::instance(), m_displaySpeedInTitle, reloadSessionStats(), and Preferences::showSpeedInTitleBar().

Here is the call graph for this function:

◆ on_actionStatistics_triggered

void MainWindow::on_actionStatistics_triggered ( )
privateslot

Definition at line 1115 of file mainwindow.cpp.

1116 {
1117  if (m_statsDlg)
1118  m_statsDlg->activateWindow();
1119  else
1120  m_statsDlg = new StatsDialog(this);
1121 }
QPointer< StatsDialog > m_statsDlg
Definition: mainwindow.h:227

References m_statsDlg.

◆ on_actionTopToolBar_triggered

void MainWindow::on_actionTopToolBar_triggered ( )
privateslot

Definition at line 1797 of file mainwindow.cpp.

1798 {
1799  const bool isVisible = static_cast<QAction *>(sender())->isChecked();
1800  m_ui->toolBar->setVisible(isVisible);
1802 }

References Preferences::instance(), m_ui, and Preferences::setToolbarDisplayed().

Here is the call graph for this function:

◆ on_actionWarningMessages_triggered

void MainWindow::on_actionWarningMessages_triggered ( bool  checked)
privateslot

Definition at line 2017 of file mainwindow.cpp.

2018 {
2019  if (!m_executionLog)
2020  return;
2021 
2022  const Log::MsgTypes flags = executionLogMsgTypes().setFlag(Log::WARNING, checked);
2023  setExecutionLogMsgTypes(flags);
2024 }

References executionLogMsgTypes(), m_executionLog, setExecutionLogMsgTypes(), and Log::WARNING.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optionsSaved

void MainWindow::optionsSaved ( )
privateslot

Definition at line 1462 of file mainwindow.cpp.

1463 {
1464  Logger::instance()->addMessage(tr("Options saved."));
1465  loadPreferences();
1466 }

References Logger::addMessage(), Logger::instance(), and loadPreferences().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ propertiesWidget()

PropertiesWidget * MainWindow::propertiesWidget ( ) const

Definition at line 1783 of file mainwindow.cpp.

1784 {
1785  return m_propertiesWidget;
1786 }

References m_propertiesWidget.

◆ readSettings

void MainWindow::readSettings ( )
privateslot

Definition at line 818 of file mainwindow.cpp.

819 {
820  const Preferences *const pref = Preferences::instance();
821  const QByteArray mainGeo = pref->getMainGeometry();
822  if (!mainGeo.isEmpty() && restoreGeometry(mainGeo))
823  m_posInitialized = true;
824  const QByteArray splitterState = pref->getMainVSplitterState();
825  if (splitterState.isEmpty())
826  // Default sizes
827  m_splitter->setSizes({ 120, m_splitter->width() - 120 });
828  else
829  m_splitter->restoreState(splitterState);
830 }
bool m_posInitialized
Definition: mainwindow.h:222
QByteArray getMainGeometry() const
QByteArray getMainVSplitterState() const

References Preferences::getMainGeometry(), Preferences::getMainVSplitterState(), Preferences::instance(), m_posInitialized, and m_splitter.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reloadSessionStats

void MainWindow::reloadSessionStats ( )
privateslot

Definition at line 1601 of file mainwindow.cpp.

1602 {
1604 
1605  // update global information
1606 #ifdef Q_OS_MACOS
1607  if (status.payloadDownloadRate > 0)
1608  {
1609  MacUtils::setBadgeLabelText(tr("%1/s", "s is a shorthand for seconds")
1611  }
1612  else if (!MacUtils::badgeLabelText().isEmpty())
1613  {
1615  }
1616 #else
1617  if (m_systrayIcon)
1618  {
1619  const auto toolTip = QString::fromLatin1("%1\n%2").arg(
1620  tr("DL speed: %1", "e.g: Download speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate, true))
1621  , tr("UP speed: %1", "e.g: Upload speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadUploadRate, true)));
1622  m_systrayIcon->setToolTip(toolTip); // tray icon
1623  }
1624 #endif // Q_OS_MACOS
1625 
1627  {
1628  setWindowTitle(tr("[D: %1, U: %2] qBittorrent %3", "D = Download; U = Upload; %3 is qBittorrent version")
1631  , QBT_VERSION));
1632  }
1633 }
const SessionStatus & status() const
Definition: session.cpp:4301
void setBadgeLabelText(const QString &text)
QString badgeLabelText()
QString friendlyUnit(qint64 bytes, bool isSpeed=false)
Definition: misc.cpp:261

References MacUtils::badgeLabelText(), Utils::Misc::friendlyUnit(), BitTorrent::Session::instance(), m_displaySpeedInTitle, m_systrayIcon, BitTorrent::SessionStatus::payloadDownloadRate, BitTorrent::SessionStatus::payloadUploadRate, MacUtils::setBadgeLabelText(), and BitTorrent::Session::status().

Referenced by MainWindow(), and on_actionSpeedInTitleBar_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reloadTorrentStats

void MainWindow::reloadTorrentStats ( const QVector< BitTorrent::Torrent * > &  torrents)
privateslot

Definition at line 1635 of file mainwindow.cpp.

1636 {
1638  {
1639  if (torrents.contains(m_propertiesWidget->getCurrentTorrent()))
1641  }
1642 }
QWidget * currentTabWidget() const
BitTorrent::Torrent * getCurrentTorrent() const

References currentTabWidget(), PropertiesWidget::getCurrentTorrent(), PropertiesWidget::loadDynamicData(), m_propertiesWidget, and m_transferListWidget.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDownloadTrackerFavicon()

void MainWindow::setDownloadTrackerFavicon ( bool  value)

Definition at line 543 of file mainwindow.cpp.

544 {
547 }
T value(const QString &key, const T &defaultValue={})
Definition: preferences.cpp:64

References m_storeDownloadTrackerFavicon, m_transferListFiltersWidget, TransferListFiltersWidget::setDownloadTrackerFavicon(), and anonymous_namespace{preferences.cpp}::value().

Referenced by AdvancedSettings::saveAdvancedSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setExecutionLogEnabled()

void MainWindow::setExecutionLogEnabled ( bool  value)

Definition at line 490 of file mainwindow.cpp.

491 {
493 }

References m_storeExecutionLogEnabled, and anonymous_namespace{preferences.cpp}::value().

Referenced by on_actionExecutionLogs_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setExecutionLogMsgTypes()

void MainWindow::setExecutionLogMsgTypes ( Log::MsgTypes  value)

Definition at line 500 of file mainwindow.cpp.

501 {
502  m_executionLog->setMessageTypes(value);
504 }

References m_executionLog, m_storeExecutionLogTypes, and anonymous_namespace{preferences.cpp}::value().

Referenced by on_actionCriticalMessages_triggered(), on_actionInformationMessages_triggered(), on_actionNormalMessages_triggered(), and on_actionWarningMessages_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNotificationsEnabled()

void MainWindow::setNotificationsEnabled ( bool  value)

Definition at line 511 of file mainwindow.cpp.

512 {
514 }

References m_storeNotificationEnabled, and anonymous_namespace{preferences.cpp}::value().

Referenced by AdvancedSettings::saveAdvancedSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTorrentAddedNotificationsEnabled()

void MainWindow::setTorrentAddedNotificationsEnabled ( bool  value)

Definition at line 521 of file mainwindow.cpp.

522 {
524 }

References m_storeNotificationTorrentAdded, and anonymous_namespace{preferences.cpp}::value().

Referenced by AdvancedSettings::saveAdvancedSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showConnectionSettings

void MainWindow::showConnectionSettings ( )
privateslot

Definition at line 1963 of file mainwindow.cpp.

1964 {
1966  m_options->showConnectionTab();
1967 }
void on_actionOptions_triggered()

References m_options, and on_actionOptions_triggered().

Referenced by showStatusBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showEvent()

void MainWindow::showEvent ( QShowEvent *  e)
overrideprivate

Definition at line 1123 of file mainwindow.cpp.

1124 {
1125  qDebug("** Show Event **");
1126  e->accept();
1127 
1128  if (isVisible())
1129  {
1130  // preparations before showing the window
1131 
1134 
1135  // Make sure the window is initially centered
1136  if (!m_posInitialized)
1137  {
1138  move(Utils::Gui::screenCenter(this));
1139  m_posInitialized = true;
1140  }
1141  }
1142  else
1143  {
1144  // to avoid blank screen when restoring from tray icon
1145  show();
1146  }
1147 }
QPoint screenCenter(const QWidget *w)
Definition: utils.cpp:119

References currentTabWidget(), nova3.nova2dl::e, PropertiesWidget::loadDynamicData(), m_posInitialized, m_propertiesWidget, m_transferListWidget, and Utils::Gui::screenCenter().

Here is the call graph for this function:

◆ showFilterContextMenu

void MainWindow::showFilterContextMenu ( const QPoint &  )
privateslot

Definition at line 711 of file mainwindow.cpp.

712 {
713  const Preferences *pref = Preferences::instance();
714 
715  QMenu *menu = m_searchFilter->createStandardContextMenu();
716  menu->setAttribute(Qt::WA_DeleteOnClose);
717  menu->addSeparator();
718 
719  QAction *useRegexAct = menu->addAction(tr("Use regular expressions"));
720  useRegexAct->setCheckable(true);
721  useRegexAct->setChecked(pref->getRegexAsFilteringPatternForTransferList());
722  connect(useRegexAct, &QAction::toggled, pref, &Preferences::setRegexAsFilteringPatternForTransferList);
723  connect(useRegexAct, &QAction::toggled, this, [this]() { m_transferListWidget->applyNameFilter(m_searchFilter->text()); });
724 
725  menu->popup(QCursor::pos());
726 }
void setRegexAsFilteringPatternForTransferList(bool checked)
bool getRegexAsFilteringPatternForTransferList() const

References TransferListWidget::applyNameFilter(), Preferences::getRegexAsFilteringPatternForTransferList(), Preferences::instance(), m_searchFilter, m_transferListWidget, and Preferences::setRegexAsFilteringPatternForTransferList().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showNotificationBalloon()

void MainWindow::showNotificationBalloon ( const QString &  title,
const QString &  msg 
) const

Definition at line 1644 of file mainwindow.cpp.

1645 {
1646  if (!isNotificationsEnabled())
1647  return;
1648 
1649 #if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
1650  OrgFreedesktopNotificationsInterface notifications(QLatin1String("org.freedesktop.Notifications")
1651  , QLatin1String("/org/freedesktop/Notifications")
1652  , QDBusConnection::sessionBus());
1653 
1654  // Testing for 'notifications.isValid()' isn't helpful here.
1655  // If the notification daemon is configured to run 'as needed'
1656  // the above check can be false if the daemon wasn't started
1657  // by another application. In this case DBus will be able to
1658  // start the notification daemon and complete our request. Such
1659  // a daemon is xfce4-notifyd, DBus autostarts it and after
1660  // some inactivity shuts it down. Other DEs, like GNOME, choose
1661  // to start their daemons at the session startup and have it sit
1662  // idling for the whole session.
1663  const QVariantMap hints {{QLatin1String("desktop-entry"), QLatin1String("org.qbittorrent.qBittorrent")}};
1664  QDBusPendingReply<uint> reply = notifications.Notify(QLatin1String("qBittorrent"), 0
1665  , QLatin1String("qbittorrent"), title, msg, {}, hints, getNotificationTimeout());
1666 
1667  reply.waitForFinished();
1668  if (!reply.isError())
1669  return;
1670 #elif defined(Q_OS_MACOS)
1671  MacUtils::displayNotification(title, msg);
1672 #else
1673  if (m_systrayIcon && QSystemTrayIcon::supportsMessages())
1674  m_systrayIcon->showMessage(title, msg, QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
1675 #endif
1676 }
bool isNotificationsEnabled() const
Definition: mainwindow.cpp:506
void displayNotification(const QString &title, const QString &message)
Definition: macutilities.mm:85

References MacUtils::displayNotification(), isNotificationsEnabled(), m_systrayIcon, OrgFreedesktopNotificationsInterface::Notify(), and anonymous_namespace{mainwindow.cpp}::TIME_TRAY_BALLOON.

Referenced by addTorrentFailed(), closeEvent(), event(), finishedTorrent(), fullDiskError(), handleDownloadFromUrlFailure(), MainWindow(), SearchWidget::on_searchButton_clicked(), SearchWidget::tabStatusChanged(), and torrentNew().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showStatusBar()

void MainWindow::showStatusBar ( bool  show)
private

Definition at line 1468 of file mainwindow.cpp.

1469 {
1470  if (!show)
1471  {
1472  // Remove status bar
1473  setStatusBar(nullptr);
1474  }
1475  else if (!m_statusBar)
1476  {
1477  // Create status bar
1478  m_statusBar = new StatusBar;
1481  setStatusBar(m_statusBar);
1482  }
1483 }
void showConnectionSettings()
void connectionButtonClicked()
void alternativeSpeedsButtonClicked()

References StatusBar::alternativeSpeedsButtonClicked(), StatusBar::connectionButtonClicked(), m_statusBar, showConnectionSettings(), and toggleAlternativeSpeeds().

Referenced by loadPreferences(), and on_actionShowStatusbar_triggered().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ systemTrayIconCreated

void MainWindow::systemTrayIconCreated ( )
signal

Referenced by createTrayIcon(), and MainWindow().

Here is the caller graph for this function:

◆ tabChanged

void MainWindow::tabChanged ( int  newTab)
privateslot

Definition at line 766 of file mainwindow.cpp.

767 {
768  Q_UNUSED(newTab);
769  // We cannot rely on the index newTab
770  // because the tab order is undetermined now
771  if (m_tabs->currentWidget() == m_splitter)
772  {
773  qDebug("Changed tab to transfer list, refreshing the list");
775  m_searchFilterAction->setVisible(true);
776  return;
777  }
778  m_searchFilterAction->setVisible(false);
779 
780  if (m_tabs->currentWidget() == m_searchWidget)
781  {
782  qDebug("Changed tab to search engine, giving focus to search input");
783  m_searchWidget->giveFocusToSearchInput();
784  }
785 }

References PropertiesWidget::loadDynamicData(), m_propertiesWidget, m_searchFilterAction, m_searchWidget, m_splitter, and m_tabs.

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleAlternativeSpeeds

void MainWindow::toggleAlternativeSpeeds ( )
privateslot

Definition at line 1952 of file mainwindow.cpp.

1953 {
1956 }
bool isAltGlobalSpeedLimitEnabled() const
Definition: session.cpp:2726
void setAltGlobalSpeedLimitEnabled(bool enabled)
Definition: session.cpp:2731

References BitTorrent::Session::instance(), BitTorrent::Session::isAltGlobalSpeedLimitEnabled(), and BitTorrent::Session::setAltGlobalSpeedLimitEnabled().

Referenced by MainWindow(), and showStatusBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleVisibility

void MainWindow::toggleVisibility ( const QSystemTrayIcon::ActivationReason  reason = QSystemTrayIcon::Trigger)
privateslot

Definition at line 1075 of file mainwindow.cpp.

1076 {
1077  switch (reason)
1078  {
1079  case QSystemTrayIcon::Trigger:
1080  if (isHidden())
1081  {
1082  if (m_uiLocked && !unlockUI()) // Ask for UI lock password
1083  return;
1084 
1085  // Make sure the window is not minimized
1086  setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
1087 
1088  // Then show it
1089  show();
1090  raise();
1091  activateWindow();
1092  }
1093  else
1094  {
1095  hide();
1096  }
1097  break;
1098 
1099  default:
1100  break;
1101  }
1102 }

References m_uiLocked, and unlockUI().

Referenced by createTrayIcon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbarFollowSystem

void MainWindow::toolbarFollowSystem ( )
privateslot

Definition at line 633 of file mainwindow.cpp.

634 {
635  m_ui->toolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
636  Preferences::instance()->setToolbarTextPosition(Qt::ToolButtonFollowStyle);
637 }
void setToolbarTextPosition(int position)

References Preferences::instance(), m_ui, and Preferences::setToolbarTextPosition().

Referenced by addToolbarContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbarIconsOnly

void MainWindow::toolbarIconsOnly ( )
privateslot

Definition at line 609 of file mainwindow.cpp.

610 {
611  m_ui->toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
612  Preferences::instance()->setToolbarTextPosition(Qt::ToolButtonIconOnly);
613 }

References Preferences::instance(), m_ui, and Preferences::setToolbarTextPosition().

Referenced by addToolbarContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbarMenuRequested

void MainWindow::toolbarMenuRequested ( const QPoint &  point)
privateslot

Definition at line 604 of file mainwindow.cpp.

605 {
606  m_toolbarMenu->popup(m_ui->toolBar->mapToGlobal(point));
607 }

References m_toolbarMenu, and m_ui.

Referenced by addToolbarContextMenu().

Here is the caller graph for this function:

◆ toolbarTextBeside

void MainWindow::toolbarTextBeside ( )
privateslot

Definition at line 621 of file mainwindow.cpp.

622 {
623  m_ui->toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
624  Preferences::instance()->setToolbarTextPosition(Qt::ToolButtonTextBesideIcon);
625 }

References Preferences::instance(), m_ui, and Preferences::setToolbarTextPosition().

Referenced by addToolbarContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbarTextOnly

void MainWindow::toolbarTextOnly ( )
privateslot

Definition at line 615 of file mainwindow.cpp.

616 {
617  m_ui->toolBar->setToolButtonStyle(Qt::ToolButtonTextOnly);
618  Preferences::instance()->setToolbarTextPosition(Qt::ToolButtonTextOnly);
619 }

References Preferences::instance(), m_ui, and Preferences::setToolbarTextPosition().

Referenced by addToolbarContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbarTextUnder

void MainWindow::toolbarTextUnder ( )
privateslot

Definition at line 627 of file mainwindow.cpp.

628 {
629  m_ui->toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
630  Preferences::instance()->setToolbarTextPosition(Qt::ToolButtonTextUnderIcon);
631 }

References Preferences::instance(), m_ui, and Preferences::setToolbarTextPosition().

Referenced by addToolbarContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ torrentNew

void MainWindow::torrentNew ( BitTorrent::Torrent *const  torrent) const
privateslot

Definition at line 857 of file mainwindow.cpp.

858 {
860  showNotificationBalloon(tr("Torrent added"), tr("'%1' was added.", "e.g: xxx.avi was added.").arg(torrent->name()));
861 }
bool isTorrentAddedNotificationsEnabled() const
Definition: mainwindow.cpp:516

References isTorrentAddedNotificationsEnabled(), BitTorrent::Torrent::name(), and showNotificationBalloon().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transferListWidget()

TransferListWidget * MainWindow::transferListWidget ( ) const

Definition at line 1032 of file mainwindow.cpp.

1033 {
1034  return m_transferListWidget;
1035 }

References m_transferListWidget.

◆ unlockUI

bool MainWindow::unlockUI ( )
privateslot

Definition at line 1037 of file mainwindow.cpp.

1038 {
1039  if (m_unlockDlgShowing)
1040  return false;
1041 
1042  bool ok = false;
1043  const QString password = AutoExpandableDialog::getText(this, tr("UI lock password")
1044  , tr("Please type the UI lock password:"), QLineEdit::Password, {}, &ok);
1045  if (!ok) return false;
1046 
1047  Preferences *const pref = Preferences::instance();
1048 
1049  const QByteArray secret = pref->getUILockPassword();
1050  if (!Utils::Password::PBKDF2::verify(secret, password))
1051  {
1052  QMessageBox::warning(this, tr("Invalid password"), tr("The password is invalid"));
1053  return false;
1054  }
1055 
1056  m_uiLocked = false;
1057  pref->setUILocked(false);
1058  m_trayIconMenu->setEnabled(true);
1059  return true;
1060 }
bool m_unlockDlgShowing
Definition: mainwindow.h:242
bool verify(const QByteArray &secret, const QString &password)
Definition: password.cpp:95

References AutoExpandableDialog::getText(), Preferences::getUILockPassword(), Preferences::instance(), m_trayIconMenu, m_uiLocked, m_unlockDlgShowing, Preferences::setUILocked(), and Utils::Password::PBKDF2::verify().

Referenced by activate(), balloonClicked(), on_actionExit_triggered(), and toggleVisibility().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateAltSpeedsBtn

void MainWindow::updateAltSpeedsBtn ( bool  alternative)
privateslot

Definition at line 1778 of file mainwindow.cpp.

1779 {
1780  m_ui->actionUseAlternativeSpeedLimits->setChecked(alternative);
1781 }

References m_ui.

Referenced by MainWindow().

Here is the caller graph for this function:

◆ updateNbTorrents

void MainWindow::updateNbTorrents ( )
privateslot

Definition at line 756 of file mainwindow.cpp.

757 {
758  m_tabs->setTabText(0, tr("Transfers (%1)").arg(m_transferListWidget->getSourceModel()->rowCount()));
759 }
int rowCount(const QModelIndex &parent={}) const override

References TransferListWidget::getSourceModel(), m_tabs, m_transferListWidget, and TransferListModel::rowCount().

Referenced by MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePowerManagementState

void MainWindow::updatePowerManagementState ( )
privateslot

◆ writeSettings

void MainWindow::writeSettings ( )
privateslot

Definition at line 787 of file mainwindow.cpp.

788 {
789  Preferences *const pref = Preferences::instance();
790  pref->setMainGeometry(saveGeometry());
791  // Splitter size
792  pref->setMainVSplitterState(m_splitter->saveState());
794 }
void setMainGeometry(const QByteArray &geometry)
void setMainVSplitterState(const QByteArray &state)

References Preferences::instance(), m_propertiesWidget, m_splitter, PropertiesWidget::saveSettings(), Preferences::setMainGeometry(), and Preferences::setMainVSplitterState().

Referenced by cleanup(), and MainWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_aboutDlg

QPointer<AboutDialog> MainWindow::m_aboutDlg
private

Definition at line 226 of file mainwindow.h.

Referenced by on_actionAbout_triggered().

◆ m_createTorrentDlg

QPointer<TorrentCreatorDialog> MainWindow::m_createTorrentDlg
private

Definition at line 228 of file mainwindow.h.

Referenced by createTorrentTriggered().

◆ m_displaySpeedInTitle

bool MainWindow::m_displaySpeedInTitle
private

◆ m_downloadFromURLDialog

QPointer<DownloadFromURLDialog> MainWindow::m_downloadFromURLDialog
private

Definition at line 229 of file mainwindow.h.

Referenced by on_actionDownloadFromURL_triggered().

◆ m_executableWatcher

QFileSystemWatcher* MainWindow::m_executableWatcher
private

Definition at line 220 of file mainwindow.h.

Referenced by cleanup(), MainWindow(), and notifyOfUpdate().

◆ m_executionLog

◆ m_forceExit

bool MainWindow::m_forceExit = false
private

Definition at line 240 of file mainwindow.h.

Referenced by closeEvent(), and on_actionExit_triggered().

◆ m_hasPython

bool MainWindow::m_hasPython = false
private

Definition at line 255 of file mainwindow.h.

Referenced by on_actionSearchWidget_triggered().

◆ m_options

QPointer<OptionsDialog> MainWindow::m_options
private

Definition at line 225 of file mainwindow.h.

Referenced by on_actionOptions_triggered(), and showConnectionSettings().

◆ m_posInitialized

bool MainWindow::m_posInitialized = false
private

Definition at line 222 of file mainwindow.h.

Referenced by readSettings(), and showEvent().

◆ m_preventTimer

QTimer* MainWindow::m_preventTimer
private

Definition at line 254 of file mainwindow.h.

Referenced by cleanup(), loadPreferences(), and MainWindow().

◆ m_propertiesWidget

PropertiesWidget* MainWindow::m_propertiesWidget
private

◆ m_pwr

PowerManagement* MainWindow::m_pwr
private

Definition at line 253 of file mainwindow.h.

Referenced by loadPreferences(), MainWindow(), and updatePowerManagementState().

◆ m_queueSeparator

QAction* MainWindow::m_queueSeparator
private

Definition at line 246 of file mainwindow.h.

Referenced by loadPreferences(), and MainWindow().

◆ m_queueSeparatorMenu

QAction* MainWindow::m_queueSeparatorMenu
private

Definition at line 247 of file mainwindow.h.

Referenced by loadPreferences(), and MainWindow().

◆ m_rssWidget

QPointer<RSSWidget> MainWindow::m_rssWidget
private

Definition at line 250 of file mainwindow.h.

Referenced by cleanup(), displayRSSTab(), and handleRSSUnreadCountUpdated().

◆ m_searchFilter

LineEdit* MainWindow::m_searchFilter
private

◆ m_searchFilterAction

QAction* MainWindow::m_searchFilterAction
private

Definition at line 244 of file mainwindow.h.

Referenced by MainWindow(), and tabChanged().

◆ m_searchWidget

QPointer<SearchWidget> MainWindow::m_searchWidget
private

Definition at line 249 of file mainwindow.h.

Referenced by displaySearchTab(), and tabChanged().

◆ m_splitter

QSplitter* MainWindow::m_splitter
private

Definition at line 248 of file mainwindow.h.

Referenced by MainWindow(), readSettings(), tabChanged(), and writeSettings().

◆ m_statsDlg

QPointer<StatsDialog> MainWindow::m_statsDlg
private

Definition at line 227 of file mainwindow.h.

Referenced by on_actionStatistics_triggered().

◆ m_statusBar

QPointer<StatusBar> MainWindow::m_statusBar
private

Definition at line 224 of file mainwindow.h.

Referenced by notifyOfUpdate(), and showStatusBar().

◆ m_storeDownloadTrackerFavicon

SettingValue<bool> MainWindow::m_storeDownloadTrackerFavicon
private

Definition at line 259 of file mainwindow.h.

Referenced by isDownloadTrackerFavicon(), and setDownloadTrackerFavicon().

◆ m_storeExecutionLogEnabled

SettingValue<bool> MainWindow::m_storeExecutionLogEnabled
private

Definition at line 258 of file mainwindow.h.

Referenced by isExecutionLogEnabled(), and setExecutionLogEnabled().

◆ m_storeExecutionLogTypes

CachedSettingValue<Log::MsgTypes> MainWindow::m_storeExecutionLogTypes
private

Definition at line 262 of file mainwindow.h.

Referenced by executionLogMsgTypes(), and setExecutionLogMsgTypes().

◆ m_storeNotificationEnabled

SettingValue<bool> MainWindow::m_storeNotificationEnabled
private

Definition at line 260 of file mainwindow.h.

Referenced by isNotificationsEnabled(), and setNotificationsEnabled().

◆ m_storeNotificationTorrentAdded

SettingValue<bool> MainWindow::m_storeNotificationTorrentAdded
private

◆ m_systrayIcon

QPointer<QSystemTrayIcon> MainWindow::m_systrayIcon
private

◆ m_tabs

◆ m_toolbarMenu

QMenu* MainWindow::m_toolbarMenu
private

Definition at line 256 of file mainwindow.h.

Referenced by addToolbarContextMenu(), and toolbarMenuRequested().

◆ m_transferListFiltersWidget

TransferListFiltersWidget* MainWindow::m_transferListFiltersWidget
private

Definition at line 237 of file mainwindow.h.

Referenced by MainWindow(), and setDownloadTrackerFavicon().

◆ m_transferListWidget

◆ m_trayIconMenu

QPointer<QMenu> MainWindow::m_trayIconMenu
private

◆ m_ui

◆ m_uiLocked

bool MainWindow::m_uiLocked
private

◆ m_unlockDlgShowing

bool MainWindow::m_unlockDlgShowing = false
private

Definition at line 242 of file mainwindow.h.

Referenced by unlockUI().


The documentation for this class was generated from the following files: