1
///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "Dialog_About.h"
25 #include "UIC_AboutDialog.h"
29 #include "Model_Settings.h"
32 #include <MUtils/Global.h>
33 #include <MUtils/OSSupport.h>
34 #include <MUtils/Sound.h>
35 #include <MUtils/GUI.h>
36 #include <MUtils/Version.h>
40 #include <QApplication>
42 #include <QPushButton>
43 #include <QDesktopServices>
48 #include <QDesktopWidget>
50 #include <QMessageBox>
51 #include <QTextStream>
53 #include <QCloseEvent>
54 #include <QElapsedTimer>
55 #include <QLibraryInfo>
56 #include <QWindowsVistaStyle>
57 #include <QWindowsXPStyle>
63 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
64 #define TRIM_RIGHT(STR) do { while(STR.endsWith(QChar(' ')) || STR.endsWith(QChar('\t')) || STR.endsWith(QChar('\r')) || STR.endsWith(QChar('\n'))) STR.chop(1); } while(0)
65 #define PLAY_SOUND_OPTIONAL(NAME, ASYNC) do { if(m_settings->soundsEnabled()) MUtils::Sound::play_sound((NAME), (ASYNC)); } while(0)
66 #define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
69 const char *AboutDialog::neroAacUrl
= "http://www.videohelp.com/software/Nero-AAC-Codec"; //"http://www.nero.com/eng/company/about-nero/nero-aac-codec.php"
70 const char *AboutDialog::disqueUrl
= "http://muldersoft.com/?player_url=n4bply6Ibqw"; //38X-MXOB014
80 g_lamexp_translators
[] =
82 {"en", L
"Englisch", L
"LoRd_MuldeR", "MuldeR2@GMX.de" },
83 {"de", L
"Deutsch", L
"LoRd_MuldeR", "MuldeR2@GMX.de" },
84 {"", L
"", L
"Bodo Thevissen", "Bodo@thevissen.de" },
85 {"es", L
"Español", L
"Rub3nCT", "Rub3nCT@gmail.com" },
86 {"fr", L
"Française", L
"Dodich Informatique", "Dodich@live.fr" },
87 {"", L
"Française", L
"Sami Ghoul-Duclos", "samgd14@live.ca" },
88 {"hu", L
"Magyarul", L
"ZityiSoft Team", "zityisoft@gmail.com" },
89 {"it", L
"Italiano", L
"Roberto", "Gulliver_69@libero.it" },
90 {"", L
"", L
"Gianluca Papi", "johnnyb.goode68@gmail.com"},
91 {"ja", L
"日本語", L
"Maboroshin", "pc.genkaku.in" },
92 {"kr", L
"한국어", L
"JaeHyung Lee", "Kolanp@gmail.com" },
93 {"pl", L
"Polski", L
"Sir Daniel K", "Sir.Daniel.K@gmail.com" },
94 {"ru", L
"Русский", L
"Neonailol", "Neonailol@gmail.com" },
95 {"", L
"", L
"Иван Митин", "bardak@inbox.ru" },
96 {"sv", L
"Svenska", L
"Åke Engelbrektson", "eson@svenskasprakfiler.se"},
97 {"tw", L
"繁体中文", L
"456Vv", "123@456vv.com" },
98 {"uk", L
"Українська", L
"Arestarh", "Arestarh@ukr.net" },
99 {"zh", L
"简体中文", L
"456Vv", "123@456vv.com" },
100 {"", L
"", L
"庄泓川", "kidneybean@pku.edu.cn" },
101 {NULL
, NULL
, NULL
, NULL
}
110 g_lamexp_specialThanks
[] =
112 { "Doom9's Forum", "http://forum.doom9.org/" },
113 { "Gleitz | German Doom9", "http://forum.gleitz.info/" },
114 { "Portable Freeware", "http://www.portablefreeware.com/" },
115 { "Hydrogenaudio Forums", "http://www.hydrogenaudio.org/" },
116 { "RareWares", "http://www.rarewares.org/" },
117 { "GitHub", "http://github.com/" },
118 { "SourceForge", "http://sourceforge.net/" },
119 { "OSDN.net", "http://osdn.net/" },
120 { "Marius Hudea", "http://savedonthe.net/" },
121 { "Qt Developer Network", "http://www.qt.io/developers/" },
122 { "Codecs.com", "http://www.codecs.com/" },
123 { "VideoHelp", "http://www.videohelp.com/" },
135 { "GitHub.com", "https://github.com/lordmulder/LameXP" },
136 { "SourceForge.net", "http://sourceforge.net/p/lamexp/code/" },
137 { "OSDN.net", "https://osdn.net/projects/lamexp/scm/git/LameXP/" },
138 { "Bitbucket.org", "https://bitbucket.org/muldersoft/lamexp" },
139 { "GitLab.com" , "https://gitlab.com/lamexp/lamexp" },
140 { "Assembla.com", "https://www.assembla.com/spaces/lamexp/" },
141 { "repo.or.cz", "https://repo.or.cz/w/LameXP.git" },
145 ////////////////////////////////////////////////////////////
147 ////////////////////////////////////////////////////////////
149 AboutDialog::AboutDialog(SettingsModel
*settings
, QWidget
*parent
, bool firstStart
)
152 ui(new Ui::AboutDialog
),
153 m_settings(settings
),
154 m_initFlags(new QMap
<QWidget
*,bool>),
159 m_firstStart(firstStart
)
161 //Init the dialog, from the .ui file
163 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint
));
164 setMinimumSize(this->size());
166 //Adjust size to DPI settings and re-center
167 MUtils::GUI::scale_widget(this);
172 MUtils::GUI::enable_close_button(this, false);
176 connect(ui
->tabWidget
, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
179 const type_info
&styleType
= typeid(*qApp
->style());
180 if((typeid(QWindowsVistaStyle
) == styleType
) || (typeid(QWindowsXPStyle
) == styleType
))
182 MAKE_TRANSPARENT(ui
->infoScrollArea
);
183 MAKE_TRANSPARENT(ui
->contributorsScrollArea
);
184 MAKE_TRANSPARENT(ui
->softwareScrollArea
);
185 MAKE_TRANSPARENT(ui
->licenseScrollArea
);
188 //Show about dialog for the first time?
191 ui
->acceptButton
->hide();
192 ui
->declineButton
->hide();
193 ui
->aboutQtButton
->show();
194 ui
->closeButton
->show();
196 QPixmap
disque(":/images/Disque.png");
197 m_disque
.reset(new QLabel(this, Qt::Window
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint
));
198 m_disque
->resize(disque
.size());
199 m_disque
->setStyleSheet("background:transparent;");
200 m_disque
->setAttribute(Qt::WA_TranslucentBackground
);
201 m_disque
->setPixmap(disque
);
202 m_disque
->setCursor(QCursor(Qt::PointingHandCursor
));
203 m_disque
->installEventFilter(this);
205 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(geometryUpdated()));
208 m_discOpacity
= 0.01;
209 m_disquePos
.setX(static_cast<int>(MUtils::next_rand_u32() % static_cast<unsigned int>(m_disqueBound
.right() - disque
.width() - m_disqueBound
.left())) + m_disqueBound
.left());
210 m_disquePos
.setY(static_cast<int>(MUtils::next_rand_u32() % static_cast<unsigned int>(m_disqueBound
.bottom() - disque
.height() - m_disqueBound
.top())) + m_disqueBound
.top());
211 m_disqueFlags
[0] = (MUtils::next_rand_u32() > (UINT_MAX
/2));
212 m_disqueFlags
[1] = (MUtils::next_rand_u32() > (UINT_MAX
/2));
213 m_disque
->move(m_disquePos
);
214 m_disque
->setWindowOpacity(m_discOpacity
);
216 m_disqueTimer
.reset(new QTimer());
218 connect(m_disqueTimer
.data(), SIGNAL(timeout()), this, SLOT(moveDisque()));
219 connect(ui
->aboutQtButton
, SIGNAL(clicked()), this, SLOT(showAboutQt()));
223 ui
->acceptButton
->show();
224 ui
->declineButton
->show();
225 ui
->aboutQtButton
->hide();
226 ui
->closeButton
->hide();
229 //Activate "show license" button
230 ui
->showLicenseButton
->show();
231 connect(ui
->showLicenseButton
, SIGNAL(clicked()), this, SLOT(gotoLicenseTab()));
234 AboutDialog::~AboutDialog(void)
242 m_disqueTimer
->stop();
247 ////////////////////////////////////////////////////////////
249 ////////////////////////////////////////////////////////////
251 int AboutDialog::exec()
253 if(m_settings
->soundsEnabled())
257 if(!MUtils::Sound::play_sound_file("imageres.dll", 5080, true))
259 MUtils::Sound::play_system_sound("SystemStart", true);
264 PLAY_SOUND_OPTIONAL("ghost", true);
268 switch(QDialog::exec())
282 ////////////////////////////////////////////////////////////
284 ////////////////////////////////////////////////////////////
286 #define TEMP_HIDE_DISQUE(CMD) do \
288 bool _tmp = (m_disque) ? m_disque->isVisible() : false; \
289 if(_tmp) m_disque->hide(); \
293 m_discOpacity = 0.01; \
294 m_disque->setWindowOpacity(m_discOpacity); \
300 void AboutDialog::tabChanged(int index
, const bool silent
)
302 bool bInitialized
= m_initFlags
->value(ui
->tabWidget
->widget(index
), false);
306 qApp
->setOverrideCursor(QCursor(Qt::WaitCursor
));
308 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
312 if(tab
== ui
->infoTab
) { initInformationTab(); ok
= true; }
313 if(tab
== ui
->contributorsTab
) { initContributorsTab(); ok
= true; }
314 if(tab
== ui
->softwareTab
) { initSoftwareTab(); ok
= true; }
315 if(tab
== ui
->licenseTab
) { initLicenseTab(); ok
= true; }
319 m_initFlags
->insert(tab
, true);
323 qWarning("Unknown tab %p encountered, cannot initialize !!!", tab
);
328 ui
->tabWidget
->widget(index
)->update();
329 qApp
->processEvents();
330 qApp
->restoreOverrideCursor();
334 if(m_settings
->soundsEnabled() && (!silent
))
336 PLAY_SOUND_OPTIONAL("tick", true);
340 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
342 if(tab
== ui
->infoTab
) ui
->infoScrollArea
->verticalScrollBar()->setSliderPosition(0);
343 if(tab
== ui
->contributorsTab
) ui
->contributorsScrollArea
->verticalScrollBar()->setSliderPosition(0);
344 if(tab
== ui
->softwareTab
) ui
->softwareScrollArea
->verticalScrollBar()->setSliderPosition(0);
345 if(tab
== ui
->licenseTab
) ui
->licenseScrollArea
->verticalScrollBar()->setSliderPosition(0);
348 //Update license button
349 ui
->showLicenseButton
->setChecked(ui
->tabWidget
->widget(index
) == ui
->licenseTab
);
350 if(ui
->tabWidget
->widget(index
) != ui
->licenseTab
) m_lastTab
= index
;
353 void AboutDialog::enableButtons(void)
355 ui
->acceptButton
->setEnabled(true);
356 ui
->declineButton
->setEnabled(true);
357 setCursor(QCursor(Qt::ArrowCursor
));
360 void AboutDialog::openURL(const QString
&url
)
362 if(!QDesktopServices::openUrl(QUrl(url
)))
364 MUtils::OS::shell_open(this, url
);
368 void AboutDialog::showAboutQt(void)
372 QMessageBox::aboutQt(this);
376 void AboutDialog::gotoLicenseTab(void)
378 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->showLicenseButton
->isChecked() ? ui
->licenseTab
: ui
->tabWidget
->widget(m_lastTab
)));
381 void AboutDialog::moveDisque(void)
384 QElapsedTimer elapsedTimer
;
385 elapsedTimer
.start();
387 if((!m_disqueDelay
.isNull()) && m_disqueDelay
->isValid())
389 const qint64 delay
= m_disqueDelay
->restart();
390 delta
= qBound(1, static_cast<int>(ceil(static_cast<double>(delay
) / 5.12)), 128);
394 m_disqueDelay
.reset(new QElapsedTimer());
395 m_disqueDelay
->start();
400 if(m_disquePos
.x() <= m_disqueBound
.left()) { m_disqueFlags
[0] = true; m_rotateNext
= true; }
401 if(m_disquePos
.x() >= m_disqueBound
.right()) { m_disqueFlags
[0] = false; m_rotateNext
= true; }
402 if(m_disquePos
.y() <= m_disqueBound
.top()) { m_disqueFlags
[1] = true; m_rotateNext
= true; }
403 if(m_disquePos
.y() >= m_disqueBound
.bottom()) { m_disqueFlags
[1] = false; m_rotateNext
= true; }
405 m_disquePos
.setX(m_disqueFlags
[0] ? (m_disquePos
.x() + delta
) : (m_disquePos
.x() - delta
));
406 m_disquePos
.setY(m_disqueFlags
[1] ? (m_disquePos
.y() + delta
) : (m_disquePos
.y() - delta
));
408 m_disque
->move(m_disquePos
);
412 const QPixmap
*const cartoon
= m_cartoon
[m_disqueFlags
[0] ? (m_disqueFlags
[1] ? 1 : 0): (m_disqueFlags
[1] ? 2 : 3)].data();
415 m_disque
->setPixmap(*cartoon
);
416 if(m_disque
->size() != cartoon
->size())
418 m_disque
->resize(cartoon
->size());
422 m_rotateNext
= false;
425 if(m_discOpacity
!= 1.0)
427 m_discOpacity
= m_discOpacity
+ 0.01;
428 if(qFuzzyCompare(m_discOpacity
, 1.0) || (m_discOpacity
> 1.0))
432 m_disque
->setWindowOpacity(m_discOpacity
);
438 void AboutDialog::geometryUpdated(void)
442 QRect screenGeometry
= QApplication::desktop()->availableGeometry();
443 m_disqueBound
.setLeft(screenGeometry
.left());
444 m_disqueBound
.setRight(screenGeometry
.width() - m_disque
->width() + screenGeometry
.left());
445 m_disqueBound
.setTop(screenGeometry
.top());
446 m_disqueBound
.setBottom(screenGeometry
.height() - m_disque
->height() + screenGeometry
.top());
450 m_disqueBound
= QApplication::desktop()->availableGeometry();
454 void AboutDialog::adjustSize(void)
456 const int maxH
= QApplication::desktop()->availableGeometry().height();
457 const int maxW
= QApplication::desktop()->availableGeometry().width();
459 const int deltaH
= ui
->infoScrollArea
->widget()->height() - ui
->infoScrollArea
->viewport()->height();
460 const int deltaW
= ui
->infoScrollArea
->widget()->width() - ui
->infoScrollArea
->viewport()->width();
464 this->resize(this->width(), qMin(this->height() + deltaH
, maxH
));
465 this->move(this->x(), this->y() - (deltaH
/ 2));
466 this->setMinimumHeight(qMax(this->minimumHeight(), this->height()));
471 this->resize(qMin(this->width() + deltaW
, maxW
), this->height());
472 this->move(this->x() - (deltaW
/ 2), this->y());
473 this->setMinimumWidth(qMax(this->minimumWidth(), this->width()));
477 ////////////////////////////////////////////////////////////
478 // Protected Functions
479 ////////////////////////////////////////////////////////////
481 void AboutDialog::showEvent(QShowEvent
*e
)
483 QDialog::showEvent(e
);
485 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->infoTab
));
486 tabChanged(m_lastTab
= ui
->tabWidget
->currentIndex(), true);
490 ui
->acceptButton
->setEnabled(false);
491 ui
->declineButton
->setEnabled(false);
492 QTimer::singleShot(5000, this, SLOT(enableButtons()));
493 setCursor(QCursor(Qt::WaitCursor
));
496 if (!(m_disque
.isNull() || m_disqueTimer
.isNull()))
499 m_disqueTimer
->start(10);
502 QTimer::singleShot(0, this, SLOT(adjustSize()));
505 void AboutDialog::closeEvent(QCloseEvent
*e
)
513 bool AboutDialog::eventFilter(QObject
*obj
, QEvent
*event
)
515 if((!m_disque
.isNull()) && (obj
== m_disque
.data()) && (event
->type() == QEvent::MouseButtonPress
))
517 PLAY_SOUND_OPTIONAL("chicken", true);
520 QPixmap
cartoon(":/images/Cartoon.png");
521 for(int i
= 0; i
< 4; i
++)
523 m_cartoon
[i
].reset(new QPixmap(cartoon
.transformed(QMatrix().rotate(static_cast<double>(i
*90) + 45.0), Qt::SmoothTransformation
)));
527 QDesktopServices::openUrl(QUrl(disqueUrl
));
533 ////////////////////////////////////////////////////////////
535 ////////////////////////////////////////////////////////////
537 void AboutDialog::initInformationTab(void)
539 const QDate versionDate
= MUtils::Version::app_build_date();
540 const QTime versionTime
= MUtils::Version::app_build_time();
542 const QString versionStr
= QString("Version %1 %2, Build %3 [%4] [%5]").arg
544 QString().sprintf("%u.%02u", lamexp_version_major(), lamexp_version_minor()),
545 QString::fromLatin1(lamexp_version_release()),
546 QString::number(lamexp_version_build()),
547 versionDate
.toString(Qt::ISODate
),
548 versionTime
.toString(Qt::ISODate
)
551 const QString platformStr
= QString("%1 [%2], MUtilities %3 [%4] [%5], Qt Framework v%6 [%7]").arg
553 QString::fromLatin1(MUtils::Version::compiler_version()),
554 QString::fromLatin1(MUtils::Version::compiler_arch()),
555 QString().sprintf("%u.%02u", MUtils::Version::lib_version_major(), MUtils::Version::lib_version_minor()),
556 MUtils::Version::lib_build_date().toString(Qt::ISODate
).toLatin1().constData(),
557 MUtils::Version::lib_build_time().toString(Qt::ISODate
).toLatin1().constData(),
558 QString::fromLatin1(qVersion()),
559 QLibraryInfo::buildDate().toString(Qt::ISODate
)
562 const QString copyrightStr
= QString().sprintf
564 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
565 qMax(versionDate
.year(), MUtils::OS::current_date().year())
570 aboutText
+= QString("<h2>%1</h2>").arg(tr("LameXP - Audio Encoder Front-end"));
571 aboutText
+= QString("<b>%1</b><br>").arg(copyrightStr
);
572 aboutText
+= QString("<b>%1</b><br>").arg(versionStr
);
573 aboutText
+= QString("<b>%1</b><br><br>").arg(platformStr
);
574 aboutText
+= QString("%1<br>").arg(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url())));
576 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
577 const QDate currentDate
= MUtils::OS::current_date();
580 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
581 aboutText
+= QString("<hr><font color=\"crimson\">%1</font>").arg(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate
), QString::number(daysLeft
)));
583 else if(lamexp_version_demo())
585 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
586 aboutText
+= QString("<hr><font color=\"crimson\">%1</font>").arg(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate
), QString::number(daysLeft
)));
589 const QDate currentDate
= lamexp_current_date_safe();
592 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
593 aboutText
+= QString("<hr><font color=\"crimson\">%1</font>").arg(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate
), QString::number(daysLeft
)));
595 else if(lamexp_version_demo())
597 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
598 aboutText
+= QString("<hr><font color=\"crimson\">%1</font>").arg(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate
), QString::number(daysLeft
)));
602 aboutText
+= "<hr><br>";
604 aboutText
+= "<tt>This program is free software; you can redistribute it and/or modify<br>";
605 aboutText
+= "it under the terms of the GNU General Public License as published by<br>";
606 aboutText
+= "the Free Software Foundation; either version 2 of the License, or<br>";
607 aboutText
+= "(at your option) any later version, but always including the *additional*<br>";
608 aboutText
+= "restrictions defined in the \"License.txt\" file (see \"License\" tab).<br><br>";
609 aboutText
+= "This program is distributed in the hope that it will be useful,<br>";
610 aboutText
+= "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
611 aboutText
+= "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
612 aboutText
+= "GNU General Public License for more details.<br><br>";
613 aboutText
+= "You should have received a copy of the GNU General Public License<br>";
614 aboutText
+= "along with this program; if not, write to the Free Software<br>";
615 aboutText
+= "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt><br>";
616 aboutText
+= "<hr><table style=\"margin-top:4px\"><tr>";
617 aboutText
+= "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
618 aboutText
+= QString("<td style='white-space:normal'><font color=\"darkred\">%1</font></td>").arg(tr("Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!!"));
619 aboutText
+= "</tr></table>";
621 ui
->infoLabel
->setText(NOBREAK(aboutText
));
622 ui
->infoIcon
->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
623 connect(ui
->infoLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
626 void AboutDialog::initContributorsTab(void)
628 const QString
spaces(" ");
629 const QString
extraVSpace("<font style=\"font-size:7px\"><br> </font>");
631 QString contributorsAboutText
;
632 contributorsAboutText
+= QString("<h3>%1</h3>").arg(tr("The following people have contributed to LameXP:"));
633 contributorsAboutText
+= "<table style=\"margin-top:12px;white-space:nowrap\">";
635 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraVSpace
);
636 QString icon
= QString("<img src=\":/icons/%1.png\">").arg("user_gray");
637 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon
, spaces
);
638 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces
);
639 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%3?subject=LameXP\"><%3></a></td></tr>").arg(L1S("LoRd_MuldeR"), spaces
, L1S("MuldeR2@GMX.de"));
640 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
642 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace
);
643 for(int i
= 0; g_lamexp_translators
[i
].pcName
; i
++)
645 const QString flagIcon
= (strlen(g_lamexp_translators
[i
].pcFlag
) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(QString::fromLatin1(g_lamexp_translators
[i
].pcFlag
)) : QString();
646 const QString contactAddr
= QString::fromLatin1(g_lamexp_translators
[i
].pcContactAddr
);
647 const QString linkUrl
= QString(contactAddr
.contains('@') ? "mailto:%1?subject=LameXP" : "http://%1").arg(contactAddr
);
648 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon
, spaces
);
649 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(MUTILS_QSTR(g_lamexp_translators
[i
].pcLanguage
), spaces
);
650 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"%3\"><%4></a></td></tr>").arg(MUTILS_QSTR(g_lamexp_translators
[i
].pcName
), spaces
, linkUrl
, contactAddr
);
653 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
654 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Special thanks to:"), extraVSpace
);
656 QString webIcon
= QString("<img src=\":/icons/%1.png\">").arg("world");
657 for(int i
= 0; g_lamexp_specialThanks
[i
].pcName
; i
++)
659 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon
, spaces
);
660 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(QString::fromLatin1(g_lamexp_specialThanks
[i
].pcName
), spaces
, QString::fromLatin1(g_lamexp_specialThanks
[i
].pcAddress
));
663 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
664 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Official Mirrors:"), extraVSpace
);
666 QString serverIcon
= QString("<img src=\":/icons/%1.png\">").arg("server_database");
667 for(int i
= 0; g_lamexp_mirrors
[i
].pcName
; i
++)
669 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(serverIcon
, spaces
);
670 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(QString::fromLatin1(g_lamexp_mirrors
[i
].pcName
), spaces
, QString::fromLatin1(g_lamexp_mirrors
[i
].pcAddress
));
673 contributorsAboutText
+= "</table><br><br><br>";
674 contributorsAboutText
+= QString("<i>%1</i><br>").arg(tr("If you are willing to contribute a LameXP translation, feel free to contact us!"));
676 ui
->contributorsLabel
->setText(NOBREAK(contributorsAboutText
));
677 ui
->contributorsIcon
->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
678 connect(ui
->contributorsLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
681 void AboutDialog::initSoftwareTab(void)
683 QString moreAboutText
;
685 moreAboutText
+= QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
686 moreAboutText
+= "<ul style='margin-left:-25px'>"; //;font-size:7pt
688 moreAboutText
+= makeToolText
690 tr("LAME - OpenSource mp3 Encoder"),
691 "lame.exe", "v?.???, #-?",
692 tr("Released under the terms of the GNU Lesser General Public License."),
693 "http://lame.sourceforge.net/"
695 moreAboutText
+= makeToolText
697 tr("OggEnc - Vorbis Encoder"),
698 "oggenc2.exe", "v?.??, libvorbis v?.?? + aoTuV b?.??_#",
699 tr("Completely open and patent-free audio encoding technology."),
700 "http://www.rarewares.org/ogg-oggenc.php"
702 moreAboutText
+= makeToolText
704 tr("Nero AAC Reference MPEG-4 Encoder"),
705 "neroAacEnc.exe", "v?.?.?.?",
706 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
708 tr("Available from vendor web-site as free download:")
710 moreAboutText
+= makeToolText
712 tr("Aften - A/52 audio encoder"),
713 "aften.exe", "v?.?.?",
714 tr("Released under the terms of the GNU Lesser General Public License."),
715 "http://aften.sourceforge.net/"
717 moreAboutText
+= makeToolText
719 tr("FLAC - Free Lossless Audio Codec"),
720 "flac.exe", "v?.?.?",
721 tr("Open and patent-free lossless audio compression technology."),
722 "http://flac.sourceforge.net/"
724 moreAboutText
+= makeToolText
726 tr("Opus Audio Codec"),
727 "opusenc.exe", "#, ????-??-??",
728 tr("Totally open, royalty-free, highly versatile audio codec."),
729 "http://www.opus-codec.org/"
731 moreAboutText
+= makeToolText
733 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
734 "mpg123.exe", "v?.??.??",
735 tr("Released under the terms of the GNU Lesser General Public License."),
736 "http://www.mpg123.de/"
738 moreAboutText
+= makeToolText
740 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
741 "faad.exe", "v?.?.?",
742 tr("Released under the terms of the GNU General Public License."),
743 "https://sourceforge.net/projects/faac/" //"http://www.audiocoding.com/"
745 moreAboutText
+= makeToolText
747 tr("OggDec - Vorbis Decoder"),
748 "oggdec.exe", "v?.??.?",
749 tr("Command line Ogg Vorbis decoder created by John33."),
750 "http://www.rarewares.org/ogg-oggdec.php"
752 moreAboutText
+= makeToolText
754 tr("Valdec from AC3Filter Tools - AC3/DTS Decoder"),
755 "valdec.exe", "v?.??#",
756 tr("Released under the terms of the GNU Lesser General Public License."),
757 "http://www.ac3filter.net/projects/tools"
759 moreAboutText
+= makeToolText
761 tr("WavPack - Hybrid Lossless Compression"),
762 "wvunpack.exe", "v?.??.?",
763 tr("Completely open audio compression format."),
764 "http://www.wavpack.com/"
766 moreAboutText
+= makeToolText
768 tr("Musepack - Living Audio Compression"),
769 "mpcdec.exe", "r???",
770 tr("Released under the terms of the GNU Lesser General Public License."),
771 "http://www.musepack.net/"
773 moreAboutText
+= makeToolText
775 tr("Monkey's Audio - Lossless Audio Compressor"),
777 tr("Freely available source code, simple SDK and non-restrictive licensing."),
778 "http://www.monkeysaudio.com/"
780 moreAboutText
+= makeToolText
782 tr("Shorten - Lossless Audio Compressor"),
783 "shorten.exe", "v?.?.?",
784 tr("Released under the terms of the GNU Lesser General Public License."),
785 "http://etree.org/shnutils/shorten/"
787 moreAboutText
+= makeToolText
789 tr("Speex - Free Codec For Free Speech"),
790 "speexdec.exe", "v?.?",
791 tr("Open Source patent-free audio format designed for speech."),
792 "http://www.speex.org/"
794 moreAboutText
+= makeToolText
796 tr("The True Audio - Lossless Audio Codec"),
798 tr("Released under the terms of the GNU Lesser General Public License."),
799 "http://tta.sourceforge.net/"
801 moreAboutText
+= makeToolText
803 tr("refalac - Win32 command line ALAC encoder/decoder"),
804 "refalac.exe", "v?.??",
805 tr("The ALAC reference implementation by Apple is available under the Apache license."),
806 "http://alac.macosforge.org/"
808 moreAboutText
+= makeToolText
810 tr("wma2wav - Dump WMA files to Wave Audio"),
811 "wma2wav.exe", "????-??-??",
812 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
813 "http://forum.doom9.org/showthread.php?t=140273"
815 moreAboutText
+= makeToolText
817 tr("avs2wav - Avisynth to Wave Audio converter"),
818 "avs2wav.exe", "v?.?",
819 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
820 "http://forum.doom9.org/showthread.php?t=70882"
822 moreAboutText
+= makeToolText
825 "dcaenc.exe", "????-??-??",
826 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
827 "https://gitlab.com/patrakov/dcaenc"
829 moreAboutText
+= makeToolText
831 tr("MediaInfo - Media File Analysis Tool"),
832 "mediainfo.exe", "v??.??.?",
833 tr("Released under the terms of the GNU Lesser General Public License."),
834 "http://mediainfo.sourceforge.net/"
836 moreAboutText
+= makeToolText
838 tr("SoX - Sound eXchange"),
839 "sox.exe", "v??.?.?",
840 tr("Released under the terms of the GNU Lesser General Public License."),
841 "http://sox.sourceforge.net/"
843 moreAboutText
+= makeToolText
845 tr("GnuPG - The GNU Privacy Guard"),
846 "gpgv.exe", "v?.?.??",
847 tr("Released under the terms of the GNU Lesser General Public License."),
848 "http://www.gnupg.org/"
850 moreAboutText
+= makeToolText
852 tr("cURL - Curl URL Request Library"),
853 "curl.exe", "v?.??.?",
854 tr("By Daniel Stenberg, released under the terms of the MIT/X Derivate License."),
855 "https://curl.haxx.se/"
857 moreAboutText
+= makeToolText
859 tr("UPX - The Ultimate Packer for eXecutables"),
861 tr("Released under the terms of the GNU Lesser General Public License."),
862 "http://upx.sourceforge.net/"
864 moreAboutText
+= makeToolText
866 tr("Silk Icons - Over 700 icons in PNG format"),
868 tr("By Mark James, released under the Creative Commons 'BY' License."),
869 "http://www.famfamfam.com/lab/icons/silk/"
871 moreAboutText
+= makeToolText
873 tr("Angry Chicken and Ghost Scream sound"),
875 tr("By Alexander, released under the Creative Commons 'BY' License."),
876 "http://www.orangefreesounds.com/"
878 moreAboutText
+= QString("</ul><br><i>%1</i><br>").arg
880 tr("The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors.")
883 ui
->softwareLabel
->setText(NOBREAK(moreAboutText
));
884 ui
->softwareIcon
->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65)));
885 connect(ui
->softwareLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
888 void AboutDialog::initLicenseTab(void)
890 bool bFoundHeader
= false;
891 QRegExp
header("^(\\s*)(GNU GENERAL PUBLIC LICENSE)(\\s*)$");
894 licenseText
+= ("<tt>");
896 QFile
file(":/License.txt");
897 if(file
.open(QIODevice::ReadOnly
))
899 QTextStream
stream(&file
);
900 while((!stream
.atEnd()) && (stream
.status() == QTextStream::Ok
))
902 QString line
= stream
.readLine();
903 line
.replace('<', "<").replace('>', ">");
904 if((!bFoundHeader
) && (header
.indexIn(line
) >= 0))
906 line
.replace(header
, "\\1<b>\\2</b>\\3");
910 licenseText
+= QString("<nobr>%1</nobr><br>").arg(line
.replace(' ', " "));
912 licenseText
+= QString("<br>");
913 stream
.device()->close();
917 licenseText
+= QString("<font color=\"darkred\">Oups, failed to load license text. Please refer to:</font><br>");
918 licenseText
+= LINK("http://www.gnu.org/licenses/gpl-2.0.html");
921 licenseText
+= ("</tt>");
923 ui
->licenseLabel
->setText(licenseText
);
924 ui
->licenseIcon
->setPixmap(QIcon(":/images/Logo_GNU.png").pixmap(QSize(72,65)));
925 connect(ui
->licenseLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
928 QString
AboutDialog::makeToolText(const QString
&toolName
, const QString
&toolBin
, const QString
&toolVerFmt
, const QString
&toolLicense
, const QString
&toolWebsite
, const QString
&extraInfo
)
930 QString toolText
, toolTag
, verStr(toolVerFmt
);
932 if(!toolBin
.isEmpty())
934 const unsigned int version
= lamexp_tools_version(toolBin
, &toolTag
);
935 verStr
= lamexp_version2string(toolVerFmt
, version
, tr("n/a"), toolTag
);
938 toolText
+= QString("<li>%1<br>").arg(QString("<b>%1 (%2)</b>").arg(toolName
, verStr
));
939 toolText
+= QString("%1<br>").arg(toolLicense
);
940 if(!extraInfo
.isEmpty()) toolText
+= QString("<i>%1</i><br>").arg(extraInfo
);
941 toolText
+= LINK(toolWebsite
);
942 toolText
+= QString("<font style=\"font-size:9px\"><br> </font>");