| 721 | } |
| 722 | |
| 723 | void LibraryWindow::createConnections() |
| 724 | { |
| 725 | actions.createConnections( |
| 726 | historyController, |
| 727 | this, |
| 728 | had, |
| 729 | exportLibraryDialog, |
| 730 | contentViewsManager, |
| 731 | editShortcutsDialog, |
| 732 | foldersView, |
| 733 | optionsDialog, |
| 734 | serverConfigDialog, |
| 735 | recentVisibilityCoordinator); |
| 736 | QObject::connect(actions.focusSearchLineAction, &QAction::triggered, searchEdit, [this] { searchEdit->setFocus(Qt::ShortcutFocusReason); }); |
| 737 | |
| 738 | // libraryCreator connections |
| 739 | connect(createLibraryDialog, &CreateLibraryDialog::createLibrary, this, QOverload<QString, QString, QString>::of(&LibraryWindow::create)); |
| 740 | connect(createLibraryDialog, &CreateLibraryDialog::libraryExists, this, &LibraryWindow::libraryAlreadyExists); |
| 741 | connect(importComicsInfoDialog, &QDialog::finished, this, &LibraryWindow::reloadCurrentLibrary); |
| 742 | |
| 743 | connect(libraryCreator, &LibraryCreator::finished, this, &LibraryWindow::showRootWidget); |
| 744 | connect(libraryCreator, &LibraryCreator::updated, this, &LibraryWindow::reloadCurrentLibrary); |
| 745 | connect(libraryCreator, &LibraryCreator::created, this, &LibraryWindow::openLastCreated); |
| 746 | connect(libraryCreator, &LibraryCreator::updatedCurrentFolder, this, [this](qulonglong folderId) { |
| 747 | reloadAfterCopyMove(foldersModel->getIndexFromFolderId(folderId)); |
| 748 | }); |
| 749 | connect(libraryCreator, &LibraryCreator::comicAdded, importWidget, &ImportWidget::newComic); |
| 750 | // libraryCreator errors |
| 751 | connect(libraryCreator, &LibraryCreator::failedCreatingDB, this, &LibraryWindow::manageCreatingError); |
| 752 | // connect(libraryCreator, SIGNAL(failedUpdatingDB(QString)), this, SLOT(manageUpdatingError(QString))); // TODO: implement failedUpdatingDB |
| 753 | |
| 754 | connect(xmlInfoLibraryScanner, &QThread::finished, this, &LibraryWindow::showRootWidget); |
| 755 | connect(xmlInfoLibraryScanner, &QThread::finished, this, &LibraryWindow::reloadCurrentFolderComicsContent); |
| 756 | connect(xmlInfoLibraryScanner, &XMLInfoLibraryScanner::comicScanned, importWidget, &ImportWidget::newComic); |
| 757 | |
| 758 | // new import widget |
| 759 | connect(importWidget, &ImportWidget::stop, this, &LibraryWindow::stopLibraryCreator); |
| 760 | connect(importWidget, &ImportWidget::stop, this, &LibraryWindow::stopXMLScanning); |
| 761 | |
| 762 | // packageManager connections |
| 763 | connect(exportLibraryDialog, &ExportLibraryDialog::exportPath, this, &LibraryWindow::exportLibrary); |
| 764 | connect(exportLibraryDialog, &QDialog::rejected, packageManager, &PackageManager::cancel); |
| 765 | connect(packageManager, &PackageManager::exported, exportLibraryDialog, &ExportLibraryDialog::close); |
| 766 | connect(importLibraryDialog, &ImportLibraryDialog::unpackCLC, this, &LibraryWindow::importLibrary); |
| 767 | connect(importLibraryDialog, &QDialog::rejected, packageManager, &PackageManager::cancel); |
| 768 | connect(importLibraryDialog, &QDialog::rejected, this, &LibraryWindow::deleteCurrentLibrary); |
| 769 | connect(importLibraryDialog, &ImportLibraryDialog::libraryExists, this, &LibraryWindow::libraryAlreadyExists); |
| 770 | connect(packageManager, &PackageManager::imported, importLibraryDialog, &QWidget::hide); |
| 771 | connect(packageManager, &PackageManager::imported, this, &LibraryWindow::openLastCreated); |
| 772 | |
| 773 | // create and update dialogs |
| 774 | connect(createLibraryDialog, &CreateLibraryDialog::cancelCreate, this, &LibraryWindow::cancelCreating); |
| 775 | |
| 776 | // open existing library from dialog. |
| 777 | connect(addLibraryDialog, &AddLibraryDialog::addLibrary, this, &LibraryWindow::openLibrary); |
| 778 | |
| 779 | // load library when selected library changes |
| 780 | connect(selectedLibrary, &YACReaderLibraryListWidget::currentIndexChanged, this, &LibraryWindow::loadLibrary); |
nothing calls this directly
no test coverage detected