Skip to content

Commit

Permalink
Import screenplays from PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
iljukhaput authored and dimkanovikov committed Sep 6, 2024
1 parent 62cf4ea commit dadf81d
Show file tree
Hide file tree
Showing 9 changed files with 575 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
[submodule "src/3rd_party/pdfhummus"]
path = src/3rd_party/pdfhummus
url = https://github.com/story-apps/PDF-Writer.git
branch = qmake-build
[submodule "src/3rd_party/pdftextextraction"]
path = src/3rd_party/pdftextextraction
url = https://github.com/story-apps/pdf-text-extraction.git
branch = qmake-build
[submodule "src/cloud"]
path = src/cloud
url = [email protected]:story-apps/starcloud
Expand Down
2 changes: 1 addition & 1 deletion src/3rd_party/pdfhummus
3 changes: 3 additions & 0 deletions src/core/management_layer/content/import/import_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <business_layer/import/screenplay/screenplay_fountain_importer.h>
#include <business_layer/import/screenplay/screenplay_import_options.h>
#include <business_layer/import/screenplay/screenplay_kit_scenarist_importer.h>
#include <business_layer/import/screenplay/screenplay_pdf_importer.h>
#include <business_layer/import/screenplay/screenplay_trelby_importer.h>
#include <business_layer/import/stageplay/stageplay_fountain_importer.h>
#include <data_layer/storage/settings_storage.h>
Expand Down Expand Up @@ -231,6 +232,8 @@ void ImportManager::Implementation::importScreenplay(
} else if (importFilePath.endsWith(ExtensionHelper::fountain())
|| importFilePath.endsWith(ExtensionHelper::plainText())) {
importer.reset(new BusinessLayer::ScreenplayFountainImporter);
} else if (importFilePath.endsWith(ExtensionHelper::pdf())) {
importer.reset(new BusinessLayer::ScreenplayPdfImporter);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/core/ui/import/import_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ void ImportDialog::updateTranslations()
//
if (fileIs(ExtensionHelper::msOfficeOpenXml()) || fileIs(ExtensionHelper::openDocumentXml())) {
d->setImportDocumentTypes({ screenplay });
} else if (fileIs(ExtensionHelper::pdf())) {
d->setImportDocumentTypes({ screenplay });
}
//
// Текстовые форматы
Expand Down
Loading

0 comments on commit dadf81d

Please sign in to comment.