Skip to content

Commit

Permalink
Show all windows when torrent add dialog is created
Browse files Browse the repository at this point in the history
  • Loading branch information
equeim committed Dec 1, 2023
1 parent 906a609 commit ed71738
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/ui/screens/mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,13 @@ namespace tremotesf {
mConnectionDependentActions.push_back(&mAddTorrentFileAction);

QObject::connect(&mAddTorrentLinkAction, &QAction::triggered, this, [this] {
mWindow->setWindowState(mWindow->windowState() & ~Qt::WindowMinimized);
auto showDialog = [this] {
auto dialog =
new AddTorrentDialog(mViewModel.rpc(), QString(), AddTorrentDialog::Mode::Url, mWindow);
auto dialog = new AddTorrentDialog(mViewModel.rpc(), QString(), AddTorrentDialog::Mode::Url);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
};
if (mWindow->isHidden()) {
mWindow->show();
showWindowsAndActivateMainOrDialog();
runAfterDelay(showDialog);
} else {
showDialog();
Expand Down Expand Up @@ -707,8 +705,6 @@ namespace tremotesf {
}

void addTorrentsFiles() {
mWindow->setWindowState(mWindow->windowState() & ~Qt::WindowMinimized);

auto showDialog = [this] {
auto settings = Settings::instance();
auto directory = settings->rememberOpenTorrentDir() ? settings->lastOpenTorrentDirectory() : QString{};
Expand Down Expand Up @@ -738,7 +734,7 @@ namespace tremotesf {
};

if (mWindow->isHidden()) {
mWindow->show();
showWindowsAndActivateMainOrDialog();
runAfterDelay(showDialog);
} else {
showDialog();
Expand Down

0 comments on commit ed71738

Please sign in to comment.