From d71fc587b01ca7fc18237f034235be2f7df08508 Mon Sep 17 00:00:00 2001 From: Thomas resiX Date: Sat, 15 Feb 2025 08:42:11 +0100 Subject: [PATCH] 3.6 --- mainwindow.cpp | 81 ++++++++++++++++++++++------ mainwindow.h | 12 +++-- mainwindow.ui | 143 ++++++++++++++++++++++++++++--------------------- 3 files changed, 153 insertions(+), 83 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 6e3a32c..c771265 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -328,10 +328,7 @@ if(Debug) qDebug() << "on_pushButton_abspielen_clicked"; #ifdef __WIN32__ explorer->start("explorer", {ui->pushButton_pfad->text().replace(QString("/"), QString("\\"))}); #elif __linux__ - if(QFileInfo::exists("/usr/bin/celluloid")) explorer->start("celluloid", {ui->pushButton_pfad->text()}); - else if(QFileInfo::exists("/usr/bin/mpv")) explorer->start("mpv", {ui->pushButton_pfad->text()}); - else if(QFileInfo::exists("/usr/bin/ffplay")) explorer->start("ffplay", {ui->pushButton_pfad->text()}); - else if(QFileInfo::exists("/usr/bin/vlc")) explorer->start("vlc", {ui->pushButton_pfad->text()}); + explorer->start("xdg-open", {ui->pushButton_pfad->text()}); #endif } ui->statusbar->showMessage("Video abspielen"); @@ -617,25 +614,22 @@ if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked"; \ \ \ - \ + \ \ \ \ \ \ \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ + \ + \
  
  
  
  
  
  
  
  
  
  
  
Pfad :" + ui->pushButton_pfad->text() + "
Titel :" + ui->lineEdit_titel->text() + "
Format :" + ui->comboBox_bildformat->currentText() + "
Typ :" + ui->comboBox_filmtyp->currentText() + "
Teil :" + ui->lineEdit_teil->text() + "
Genre :" + ui->comboBox_genre->currentText() + "
Länge :" + ui->lineEdit_laenge->text() + "
Jahr :" + ui->lineEdit_jahr->text() + "
FSK :" + ui->comboBox_fsk->currentText() + "
  
Titel : " + ui->lineEdit_titel->text() + "
Format : " + ui->comboBox_bildformat->currentText() + "
Typ : " + ui->comboBox_filmtyp->currentText() + "
Teil : " + ui->lineEdit_teil->text() + "
Genre : " + ui->comboBox_genre->currentText() + "
Länge : " + ui->lineEdit_laenge->text() + "
Jahr : " + ui->lineEdit_jahr->text() + "
FSK : " + ui->comboBox_fsk->currentText() + "
\

" + ui->plainTextEdit_handlung->document()->toRawText() + " \ \ @@ -652,6 +646,7 @@ if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked"; printer.setOutputFileName(".Video-Datenbank/pdf/" + Dateiname + ".pdf"); #endif printer.setOutputFormat(QPrinter::PdfFormat); + doc.setPageSize(printer.pageLayout().paintRect().size()); doc.print(&printer); printer.newPage(); @@ -720,3 +715,55 @@ if(Debug) qDebug() << "on_pushButton_Wikipedia_clicked-Ende"; if(Debug) qDebug() << "on_pushButton_Wikipedia_clicked-Ende"; } +void MainWindow::on_pushButton_google_clicked(){ +if(Debug) qDebug() << "on_pushButton_google_clicked"; + if(ui->lineEdit_titel->text()==""){ + QMessageBox msgBox; + msgBox.setText("Kein Titel zum Suchen!"); + msgBox.exec(); + return; + } + QProcess *explorer = new QProcess; + QString suchen = ui->lineEdit_titel->text().replace(" ", "+"); + QString url = "https://www.google.de/search?q=" + suchen + "&tbm=isch"; +#ifdef __WIN32__ + QDesktopServices::openUrl(QUrl(url)); +#elif __linux__ + explorer->start("xdg-open", {url}); +#endif + ui->statusbar->showMessage("Bilder suchen"); +if(Debug) qDebug() << "on_pushButton_google_clicked-Ende"; +} + +void MainWindow::on_pushButton_imdb_clicked(){ +if(Debug) qDebug() << "on_pushButton_imdb_clicked"; + if(ui->lineEdit_titel->text()==""){ + QMessageBox msgBox; + msgBox.setText("Kein Titel zum Suchen!"); + msgBox.exec(); + return; + } + QProcess *explorer = new QProcess; + QString suchen = ui->lineEdit_titel->text().replace(" ", "+"); + QString url = "https://www.imdb.com/find?q=" + suchen; +#ifdef __WIN32__ + QDesktopServices::openUrl(QUrl(url)); +#elif __linux__ + explorer->start("xdg-open", {url}); +#endif + ui->statusbar->showMessage("IMDb suchen"); +if(Debug) qDebug() << "on_pushButton_imdb_clicked-Ende"; +} + +void MainWindow::on_pushButton_ordner_clicked(){ +if(Debug) qDebug() << "on_pushButton_on_pushButton_ordner_clicked"; + QProcess *explorer = new QProcess; +#ifdef __WIN32__ + explorer->start("explorer", {"."}); +#elif __linux__ + explorer->start("xdg-open", {".Video-Datenbank"}); +#endif + ui->statusbar->showMessage("Ordner öffnen"); +if(Debug) qDebug() << "on_pushButton_on_pushButton_ordner_clicked-Ende"; +} + diff --git a/mainwindow.h b/mainwindow.h index ce863c0..67d2706 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -18,6 +18,8 @@ #include #include #include +#include +#include QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } @@ -45,17 +47,17 @@ private slots: void on_pushButton_bild_clicked(); // Suchen void on_lineEdit_suchen_textChanged(); + void on_pushButton_Wikipedia_clicked(); + void on_pushButton_google_clicked(); + void on_pushButton_imdb_clicked(); // Löschen void on_pushButton_daten_loeschen_clicked(); // Andere void on_tableWidget_Datenbank_ausgabe_cellClicked(int row, int column); - // - void on_pushButton_pfad_clicked(); - void on_pushButton_PDF_speichern_clicked(); - - void on_pushButton_Wikipedia_clicked(); + void on_pushButton_ordner_clicked(); + // private: void oeffneDatenbank(); diff --git a/mainwindow.ui b/mainwindow.ui index 6847461..b50ede8 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 956 - 616 + 646 @@ -192,41 +192,6 @@ false - - - - Abspielen - - - - - - - PDF - - - - - - - Daten löschen - - - - - - - Speichern - - - - - - - PDF speichern - - - @@ -265,25 +230,6 @@ - - - - - 42 - 23 - - - - - 70 - 16777215 - - - - - - - @@ -303,6 +249,34 @@ + + + + Wikipedia + + + + + + + Abspielen + + + + + + + Film + + + + + + + PDF + + + @@ -317,17 +291,64 @@ - - + + - Film + Google Bilder - - + + - Wikipedia + PDF speichern + + + + + + + Daten löschen + + + + + + + Speichern + + + + + + + + 42 + 23 + + + + + 70 + 16777215 + + + + + + + + + + + IMDb + + + + + + + Datenordner