Skip to content

Commit

Permalink
Fix missing pdf dialog not disappearing
Browse files Browse the repository at this point in the history
  • Loading branch information
bhennion committed May 7, 2024
1 parent b645168 commit 6be4442
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/core/control/Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,18 +1623,20 @@ void Control::promptMissingPdf(LoadHandler& loadHandler, const fs::path& filepat
std::bind(&Control::missingPdfDialogResponseHandler, this, proposedPdfFilepath, std::placeholders::_1));
}

void Control::missingPdfDialogResponseHandler(const fs::path& proposedPdfFilepath, int responseId) {
void Control::missingPdfDialogResponseHandler(fs::path proposedPdfFilepath, int responseId) {
switch (static_cast<MissingPdfDialogOptions>(responseId)) {
case MissingPdfDialogOptions::USE_PROPOSED:
if (!proposedPdfFilepath.empty()) {
this->pageBackgroundChangeController->changePdfPagesBackground(proposedPdfFilepath, false);
}
break;
case MissingPdfDialogOptions::SELECT_OTHER:
XojOpenDlg::showAnnotatePdfDialog(getGtkWindow(), settings, [this](fs::path path, bool attachPdf) {
if (!path.empty()) {
this->pageBackgroundChangeController->changePdfPagesBackground(path, attachPdf);
}
Util::execInUiThread([this]() {
XojOpenDlg::showAnnotatePdfDialog(getGtkWindow(), settings, [this](fs::path path, bool attachPdf) {
if (!path.empty()) {
this->pageBackgroundChangeController->changePdfPagesBackground(path, attachPdf);
}
});
});
break;
case MissingPdfDialogOptions::REMOVE:
Expand Down
2 changes: 1 addition & 1 deletion src/core/control/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class Control:
/**
* Handle the response from the missing PDF dialog
*/
void missingPdfDialogResponseHandler(const fs::path& proposedPdfFilepath, int responseId);
void missingPdfDialogResponseHandler(fs::path proposedPdfFilepath, int responseId);

/**
* "Closes" the document, preparing the editor for a new document.
Expand Down

0 comments on commit 6be4442

Please sign in to comment.