Skip to content

Commit

Permalink
Show correct error message on failure, references #1614
Browse files Browse the repository at this point in the history
  • Loading branch information
Emdek committed Jan 22, 2022
1 parent ec085de commit ac06ed6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/ui/DataExchangerDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**************************************************************************
* Otter Browser: Web browser controlled by the user, not vice-versa.
* Copyright (C) 2014 - 2016 Piotr Wójcik <[email protected]>
* Copyright (C) 2015 - 2021 Michal Dutkiewicz aka Emdek <[email protected]>
* Copyright (C) 2015 - 2022 Michal Dutkiewicz aka Emdek <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -277,10 +277,18 @@ void DataExchangerDialog::setupResults(DataExchanger *exchanger)
m_ui->buttonBox->addButton(QDialogButtonBox::Abort)->setEnabled(exchanger->canCancel());
m_ui->stackedWidget->setCurrentWidget(m_ui->resultsPage);

if (exchanger->getExchangeDirection() == DataExchanger::ImportDirection)
{
connect(exchanger, &DataExchanger::exchangeFinished, this, &DataExchangerDialog::handleImportFinished);
}
else
{
connect(exchanger, &DataExchanger::exchangeFinished, this, &DataExchangerDialog::handleExportFinished);
}

connect(m_ui->buttonBox, &QDialogButtonBox::rejected, exchanger, &DataExchanger::cancel);
connect(exchanger, &DataExchanger::exchangeStarted, this, &DataExchangerDialog::handleExchangeStarted);
connect(exchanger, &DataExchanger::exchangeProgress, this, &DataExchangerDialog::handleExchangeProgress);
connect(exchanger, &DataExchanger::exchangeFinished, this, &DataExchangerDialog::handleExportFinished);
disconnect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &DataExchangerDialog::reject);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/DataExchangerDialog.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**************************************************************************
* Otter Browser: Web browser controlled by the user, not vice-versa.
* Copyright (C) 2014 - 2015 Piotr Wójcik <[email protected]>
* Copyright (C) 2015 - 2021 Michal Dutkiewicz aka Emdek <[email protected]>
* Copyright (C) 2015 - 2022 Michal Dutkiewicz aka Emdek <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down

0 comments on commit ac06ed6

Please sign in to comment.