Skip to content

Commit

Permalink
Automatically show correct year in about box
Browse files Browse the repository at this point in the history
Automatically show copyright year of build in the about box
  • Loading branch information
albert-github committed Feb 6, 2022
1 parent 26acf9d commit a6c76f5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions addon/doxywizard/doxywizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "version.h"
#include "expert.h"
#include "wizard.h"
#include <ctime>

#include <QMenu>
#include <QMenuBar>
Expand Down Expand Up @@ -263,6 +264,12 @@ void MainWindow::manual()

void MainWindow::about()
{
auto now = std::chrono::system_clock::now();
std::time_t time = std::chrono::system_clock::to_time_t(now);
auto current = *localtime(&time);
char tmp[10];
sprintf(tmp,"%d",current.tm_year+1900);

QString msg;
QTextStream t(&msg,QIODevice::WriteOnly);
t << QString::fromLatin1("<qt><center>A tool to configure and run doxygen version ")+
Expand All @@ -276,8 +283,9 @@ void MainWindow::about()
QString::fromLatin1(qVersion());
}
t << QString::fromLatin1(")</center><p><br>"
"<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-2021</center><p>"
"</qt>");
"<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-");
t << QString::fromLatin1(tmp);
t << QString::fromLatin1("</center><p></qt>");
QMessageBox::about(this,tr("Doxygen GUI"),msg);
}

Expand Down

0 comments on commit a6c76f5

Please sign in to comment.