diff --git a/sources/ui/aboutqetdialog.cpp b/sources/ui/aboutqetdialog.cpp index 803db33ee..ccddf29d2 100644 --- a/sources/ui/aboutqetdialog.cpp +++ b/sources/ui/aboutqetdialog.cpp @@ -18,6 +18,7 @@ #include "aboutqetdialog.h" #include "ui_aboutqetdialog.h" #include "qet.h" +#include "qetapp.h" #include "machine_info.h" #include @@ -37,6 +38,7 @@ AboutQETDialog::AboutQETDialog(QWidget *parent) : setVersion(); setLibraries(); setLicence(); + setLoginfo(); } /** @@ -170,6 +172,24 @@ void AboutQETDialog::setLicence() ui->m_license_text_edit->setPlainText(QET::license()); } +/** + @brief AboutQETDialog::setLoginfo + fills the m_log_comboBox with log files +*/ +void AboutQETDialog::setLoginfo() +{ + const QString path = QETApp::configDir() + "/"; + QString filter("%1%1%1%1%1%1%1%1.log"); // pattern + filter = filter.arg("[0123456789]"); // valid characters + Q_FOREACH (auto fileInfo, + QDir(path).entryInfoList( + QStringList(filter), + QDir::Files)) + { + ui->m_log_comboBox->addItem(fileInfo.absoluteFilePath()); + } +} + /** @brief AboutQETDialog::addAuthor Adds a person to the list of authors @@ -205,3 +225,12 @@ void AboutQETDialog::addLibrary(QLabel *label, const QString &name, const QStrin new_text += Library_template.arg(name).arg(link); label->setText(new_text); } + +void AboutQETDialog::on_m_log_comboBox_currentTextChanged(const QString &arg1) +{ + QFile log_File(arg1); + if(log_File.open(QIODevice::ReadOnly)){ + ui->m_log_textEdit->setPlainText(log_File.readAll()); + } + log_File.close(); +} diff --git a/sources/ui/aboutqetdialog.h b/sources/ui/aboutqetdialog.h index bd0311d91..efefb9759 100644 --- a/sources/ui/aboutqetdialog.h +++ b/sources/ui/aboutqetdialog.h @@ -38,6 +38,7 @@ class AboutQETDialog : public QDialog ~AboutQETDialog(); private: + Ui::AboutQETDialog *ui; void setAbout(); void setAuthors(); void setTranslators(); @@ -45,6 +46,7 @@ class AboutQETDialog : public QDialog void setVersion(); void setLibraries(); void setLicence(); + void setLoginfo(); void addAuthor(QLabel *label, const QString &name, const QString &email, @@ -53,8 +55,8 @@ class AboutQETDialog : public QDialog const QString &name, const QString &link); - private: - Ui::AboutQETDialog *ui; +private slots: + void on_m_log_comboBox_currentTextChanged(const QString &arg1); }; #endif // ABOUTQETDIALOG_H diff --git a/sources/ui/aboutqetdialog.ui b/sources/ui/aboutqetdialog.ui index ebb38d198..c893e477a 100644 --- a/sources/ui/aboutqetdialog.ui +++ b/sources/ui/aboutqetdialog.ui @@ -79,7 +79,7 @@ 0 0 676 - 409 + 423 @@ -159,7 +159,7 @@ 0 0 676 - 409 + 423 @@ -242,7 +242,7 @@ 0 0 676 - 409 + 423 @@ -374,7 +374,7 @@ 0 0 676 - 409 + 423 @@ -444,6 +444,19 @@ + + + log + + + + + + + + + +