Started work to open book file from search in Reader

This commit is contained in:
Nicolas Mailloux 2021-09-05 10:29:52 -04:00
parent 8e53fab157
commit 1e6e6ede6b
4 changed files with 10 additions and 1 deletions

View file

@ -253,7 +253,7 @@ void generalDialog::on_okBtn_clicked()
}
if(keyboardDialog == true) {
if(global::keyboard::searchDialog == true) {
if(global::keyboard::keyboardText != "") {
if(!global::keyboard::keyboardText.isEmpty()) {
if(ui->searchComboBox->currentText() == "Dictionary") {
string_writeconfig("/inkbox/searchComboBoxFunction", "Dictionary");
for(int i = ui->mainStackedWidget->count(); i >= 0; i--) {

View file

@ -1856,6 +1856,8 @@ void reader::setupSearchDialog() {
generalDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
connect(generalDialogWindow, SIGNAL(refreshScreen()), SLOT(searchRefreshScreen()));
connect(generalDialogWindow, SIGNAL(destroyed(QObject*)), SLOT(setupSearchDialog()));
connect(generalDialogWindow, SIGNAL(openBookFile(QString, bool)), SLOT(openBookFile(QString, bool)));
connect(generalDialogWindow, SIGNAL(showToast(QString)), SLOT(showToast(QString)));
generalDialogWindow->show();
}
else {
@ -2059,3 +2061,7 @@ void reader::on_increaseScaleBtn_clicked()
ui->pdfScaleSlider->setValue(sliderWantedValue);
}
}
void reader::openBookFile(QString book, bool relativePath) {
qDebug() << "Open book:" << book;
}

View file

@ -156,6 +156,7 @@ private slots:
void on_pdfScaleSlider_valueChanged(int value);
void on_decreaseScaleBtn_clicked();
void on_increaseScaleBtn_clicked();
void openBookFile(QString book, bool relativePath);
private:
Ui::reader * ui;

View file

@ -33,6 +33,8 @@ void searchResultsWidget::on_openBtn_clicked()
itemText = index.data(Qt::DisplayRole).toString();
if(!itemText.isEmpty()) {
emit openBookFile(itemText, true);
global::keyboard::searchDialog = false;
global::keyboard::keyboardDialog = false;
searchResultsWidget::close();
}
else {