From 3785fa8c6c6c1ff7a51a13cf44caa9128977b8d4 Mon Sep 17 00:00:00 2001 From: Thomas resiX Date: Sat, 15 Feb 2025 08:37:35 +0100 Subject: [PATCH] 3.1 --- mainwindow.cpp | 40 +++- mainwindow.ui | 533 +++++++++++++++++++++++++------------------------ 2 files changed, 310 insertions(+), 263 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index a38eadb..eecf00f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -38,13 +38,21 @@ if(Debug) qDebug() << "oeffneDatenbank"; ui->tableWidget_Datenbank_ausgabe->clear(); QDateTime now = QDateTime::currentDateTime(); +#ifdef __WIN32__ QString newName = "Video-Datenbank-Backup-" + now.toString("yyyy.MM.dd-hh.mm.ss") + ".db"; +#elif __linux__ + QString newName = "./Video-Datenbank/Video-Datenbank-Backup.db"; +#endif QFile file(fileName); file.copy(newName); db = QSqlDatabase::addDatabase("QSQLITE"); //db.setConnectOptions("QSQLITE_ENABLE_REGEXP"); +#ifdef __WIN32__ db.setDatabaseName("Video-Datenbank.db"); +#elif __linux__ + db.setDatabaseName("./Video-Datenbank/Video-Datenbank.db"); +#endif if(db.open()){ ui->statusbar->showMessage("Datenbank Video-Datenbank.db geöffnet!"); @@ -385,6 +393,28 @@ if(Debug) qDebug() << "on_tableWidget_Datenbank_ausgabe_cellClicked"; } else{ ui->pushButton_status->setStyleSheet("background-color: #ff8888; border-radius: 3px;"); } + + QStringList Datei_tmp = ui->pushButton_pfad->text().split("/"); + QString Datei = Datei_tmp.at(Datei_tmp.length()-1); + QStringList Dateiname_tmp = Datei.split("."); + QString Dateiname; + for(int i=0; i Dateiname +#ifdef __WIN32__ + if(QFileInfo::exists(QString(Dateiname + ".pdf"))){ +#elif __linux__ + if(QFileInfo::exists(QString(".Video-Datenbak/" + Dateiname + ".pdf"))){ +#endif + + ui->pushButton_PDF_Status->setStyleSheet("background-color: #88ff88; border-radius: 3px;"); + } else{ + ui->pushButton_PDF_Status->setStyleSheet("background-color: #ff8888; border-radius: 3px;"); + } } if(Debug) qDebug() << "on_tableWidget_Datenbank_ausgabe_cellClicked-Ende"; } @@ -572,11 +602,19 @@ if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked"; QTextDocument doc; doc.setHtml(html); QPrinter printer; - printer.setOutputFileName(Dateiname + "-Text.pdf"); +#ifdef __WIN32__ + printer.setOutputFileName(Dateiname + ".pdf"); +#elif __linux__ + printer.setOutputFileName("./Video-Datenbank/" + Dateiname + ".pdf"); +#endif printer.setOutputFormat(QPrinter::PdfFormat); doc.print(&printer); printer.newPage(); + ui->statusbar->showMessage("Daten gespeichert"); + int row = ui->tableWidget_Datenbank_ausgabe->currentRow(); + on_lineEdit_suchen_textChanged(); + on_tableWidget_Datenbank_ausgabe_cellClicked(row, 0); if(Debug) qDebug() << "on_pushButton_PDF_speichern_clicked-Ende"; } diff --git a/mainwindow.ui b/mainwindow.ui index ed5c937..cf27be9 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 947 - 707 + 1156 + 716 @@ -15,76 +15,174 @@ - - - - Ausgabe - - - - - - - - - Videodaten + - - - - - - - - - - - - - Status - - - - - - - Daten löschen - - - - - - - + Länge - - + + + + + + - + + + + Genre + + + + + + + Jahr + + + + + + + + + + Typ + + + + + + + + + + Pfad + + + + + + + FSK - - + + + + Teil + + - + + + + Format + + + + + + + Titel + + + + + + + + + + + + + + + + + + + + + + + + + Suchen + + + + + + + + + + + + + + + + + + + + Status + + + + + + + PDF speichern + + + + + + + + + + + + + + + + Abspielen + + + + + + + Speichern + + + + + + @@ -92,6 +190,111 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + / + + + + + + + + 42 + 23 + + + + + 70 + 16777215 + + + + + + + + + + + + 42 + 0 + + + + + 42 + 16777215 + + + + > + + + + + + + + 42 + 0 + + + + + 42 + 16777215 + + + + < + + + + + + + + 42 + 0 + + + + + 70 + 16777215 + + + + + + + + + + @@ -117,226 +320,32 @@ - - - - - - - Format - - - - - - - - - - - - - - - - Teil - - - - - - - Jahr - - - - - - - - - - Titel - - - - - - - Genre - - - - - - - Typ - - - - - - - - - - - - - Pfad - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - 23 - - - - - 75 - 23 - - - + + + - - - - - - > - - - - - - - < - - - - - - - Speichern - - - - - - - - 75 - 23 - - - - - 75 - 23 - - - - - - - - - - - / - - - - - - - Abspielen - + + + + + Status + + + + + + + Daten löschen + + + + - - - - - - - - - - Status - - - - - - - PDF speichern - - - - - - - - - - - - - Suchen - - - - - @@ -347,7 +356,7 @@ 0 0 - 947 + 1156 21