1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2014 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/Version.h>
38 #include <QApplication>
40 #include <QPushButton>
41 #include <QDesktopServices>
46 #include <QDesktopWidget>
48 #include <QMessageBox>
49 #include <QTextStream>
51 #include <QCloseEvent>
52 #include <QWindowsVistaStyle>
53 #include <QWindowsXPStyle>
59 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
60 #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)
61 #define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
64 const char *AboutDialog::neroAacUrl = "http://www.videohelp.com/tools/Nero-AAC-Codec"; //"http://www.nero.com/eng/company/about-nero/nero-aac-codec.php";
65 const char *AboutDialog::disqueUrl = "http://muldersoft.com/?player_url=38X-MXOB014";
75 g_lamexp_translators[] =
77 {"en", L"Englisch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
78 {"de", L"Deutsch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
79 {"", L"", L"Bodo Thevissen", "Bodo@thevissen.de" },
80 {"es", L"Español", L"Rub3nCT", "Rub3nCT@gmail.com" },
81 {"fr", L"Française", L"Dodich Informatique", "Dodich@live.fr" },
82 {"it", L"Italiano", L"Roberto", "Gulliver_69@libero.it" },
83 {"kr", L"한국어", L"JaeHyung Lee", "Kolanp@gmail.com" },
84 {"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
85 {"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
86 {"", L"", L"Иван Митин", "bardak@inbox.ru" },
87 {"sv", L"Svenska", L"Åke Engelbrektson", "eson57@gmail.com" },
88 {"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
89 {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
90 {"zh", L"简体中文", L"456Vv", "123@456vv.com" },
91 {"", L"", L"庄泓川", "kidneybean@sohu.com" },
92 {NULL, NULL, NULL, NULL}
101 g_lamexp_specialThanks[] =
103 { "Doom9's Forum", "http://forum.doom9.org/" },
104 { "Gleitz | German Doom9", "http://forum.gleitz.info/" },
105 { "Hydrogenaudio Forums", "http://www.hydrogenaudio.org/" },
106 { "RareWares", "http://www.rarewares.org/" },
107 { "GitHub", "http://github.com/" },
108 { "SourceForge", "http://sourceforge.net/" },
109 { "Qt Developer Network", "http://qt-project.org/" },
110 { "BerliOS Developer", "http://developer.berlios.de/" },
111 { "CodePlex", "http://www.codeplex.com/" },
112 { "Marius Hudea", "http://savedonthe.net/" },
113 { "Codecs.com", "http://www.codecs.com/" },
125 { "GitHub.com", "https://github.com/lordmulder/LameXP" },
126 { "SourceForge.net", "http://sourceforge.net/p/lamexp/code/" },
127 { "Bitbucket.org", "https://bitbucket.org/lord_mulder/lamexp" },
128 { "Gitorious.org", "https://gitorious.org/lamexp" },
129 { "Codeplex.com", "https://lamexp.codeplex.com/SourceControl/latest" },
130 { "Berlios.de", "http://git.berlios.de/cgi-bin/gitweb.cgi?p=lamexp" },
131 { "Assembla.com", "https://www.assembla.com/spaces/lamexp/" },
135 ////////////////////////////////////////////////////////////
137 ////////////////////////////////////////////////////////////
139 AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstStart)
142 ui(new Ui::AboutDialog),
143 m_settings(settings),
144 m_initFlags(new QMap<QWidget*,bool>),
148 m_disqueDelay(_I64_MAX),
151 //Init the dialog, from the .ui file
153 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
154 resize(this->minimumSize());
159 lamexp_enable_close_button(this, false);
163 for(int i = 0; i < 4; i++)
169 connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
172 const type_info &styleType = typeid(*qApp->style());
173 if((typeid(QWindowsVistaStyle) == styleType) || (typeid(QWindowsXPStyle) == styleType))
175 MAKE_TRANSPARENT(ui->infoScrollArea);
176 MAKE_TRANSPARENT(ui->contributorsScrollArea);
177 MAKE_TRANSPARENT(ui->softwareScrollArea);
178 MAKE_TRANSPARENT(ui->licenseScrollArea);
181 //Show about dialog for the first time?
186 ui->acceptButton->hide();
187 ui->declineButton->hide();
188 ui->aboutQtButton->show();
189 ui->closeButton->show();
191 QPixmap disque(":/images/Disque.png");
192 m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
193 m_disque->resize(disque.size());
194 m_disque->setStyleSheet("background:transparent;");
195 m_disque->setAttribute(Qt::WA_TranslucentBackground);
196 m_disque->setPixmap(disque);
197 m_disque->installEventFilter(this);
199 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(geometryUpdated()));
202 m_discOpacity = 0.01;
203 m_disquePos.setX(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound.right() - disque.width() - m_disqueBound.left())) + m_disqueBound.left());
204 m_disquePos.setY(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound.bottom() - disque.height() - m_disqueBound.top())) + m_disqueBound.top());
205 m_disqueFlags[0] = (MUtils::next_rand32() > (UINT_MAX/2));
206 m_disqueFlags[1] = (MUtils::next_rand32() > (UINT_MAX/2));
207 m_disque->move(m_disquePos);
208 m_disque->setWindowOpacity(m_discOpacity);
211 m_disqueTimer = new QTimer;
212 connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
213 m_disqueTimer->start(10);
215 connect(ui->aboutQtButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
219 ui->acceptButton->show();
220 ui->declineButton->show();
221 ui->aboutQtButton->hide();
222 ui->closeButton->hide();
225 //Activate "show license" button
226 ui->showLicenseButton->show();
227 connect(ui->showLicenseButton, SIGNAL(clicked()), this, SLOT(gotoLicenseTab()));
229 m_firstShow = firstStart;
232 AboutDialog::~AboutDialog(void)
237 MUTILS_DELETE(m_disque);
241 m_disqueTimer->stop();
242 MUTILS_DELETE(m_disqueTimer);
244 for(int i = 0; i < 4; i++)
246 MUTILS_DELETE(m_cartoon[i]);
248 MUTILS_DELETE(m_initFlags);
252 ////////////////////////////////////////////////////////////
254 ////////////////////////////////////////////////////////////
256 int AboutDialog::exec()
258 if(m_settings->soundsEnabled())
262 if(!lamexp_play_sound_file("imageres.dll", 5080, true))
264 lamexp_play_sound_alias("SystemStart", true);
269 lamexp_play_sound("uuaarrgh", true);
273 switch(QDialog::exec())
287 ////////////////////////////////////////////////////////////
289 ////////////////////////////////////////////////////////////
291 #define TEMP_HIDE_DISQUE(CMD) do \
293 bool _tmp = (m_disque) ? m_disque->isVisible() : false; \
294 if(_tmp) m_disque->hide(); \
298 m_discOpacity = 0.01; \
299 m_disque->setWindowOpacity(m_discOpacity); \
305 void AboutDialog::tabChanged(int index, const bool silent)
307 bool bInitialized = m_initFlags->value(ui->tabWidget->widget(index), false);
311 qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
313 if(QWidget *tab = ui->tabWidget->widget(index))
317 if(tab == ui->infoTab) { initInformationTab(); ok = true; }
318 if(tab == ui->contributorsTab) { initContributorsTab(); ok = true; }
319 if(tab == ui->softwareTab) { initSoftwareTab(); ok = true; }
320 if(tab == ui->licenseTab) { initLicenseTab(); ok = true; }
324 m_initFlags->insert(tab, true);
328 qWarning("Unknown tab %p encountered, cannot initialize !!!", tab);
333 ui->tabWidget->widget(index)->update();
334 qApp->processEvents();
335 qApp->restoreOverrideCursor();
339 if(m_settings->soundsEnabled() && (!silent))
341 lamexp_play_sound("tick", true);
345 if(QWidget *tab = ui->tabWidget->widget(index))
347 if(tab == ui->infoTab) ui->infoScrollArea->verticalScrollBar()->setSliderPosition(0);
348 if(tab == ui->contributorsTab) ui->contributorsScrollArea->verticalScrollBar()->setSliderPosition(0);
349 if(tab == ui->softwareTab) ui->softwareScrollArea->verticalScrollBar()->setSliderPosition(0);
350 if(tab == ui->licenseTab) ui->licenseScrollArea->verticalScrollBar()->setSliderPosition(0);
353 //Update license button
354 ui->showLicenseButton->setChecked(ui->tabWidget->widget(index) == ui->licenseTab);
355 if(ui->tabWidget->widget(index) != ui->licenseTab) m_lastTab = index;
358 void AboutDialog::enableButtons(void)
360 ui->acceptButton->setEnabled(true);
361 ui->declineButton->setEnabled(true);
362 setCursor(QCursor(Qt::ArrowCursor));
365 void AboutDialog::openURL(const QString &url)
367 if(!QDesktopServices::openUrl(QUrl(url)))
369 lamexp_exec_shell(this, url);
373 void AboutDialog::showAboutQt(void)
377 QMessageBox::aboutQt(this);
381 void AboutDialog::gotoLicenseTab(void)
383 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->showLicenseButton->isChecked() ? ui->licenseTab : ui->tabWidget->widget(m_lastTab)));
386 void AboutDialog::moveDisque(void)
389 const __int64 perfFrequ = lamexp_perfcounter_frequ();
390 const __int64 perfCount = lamexp_perfcounter_value();
392 if((perfFrequ >= 0) && (perfCount >= 0))
394 if(m_disqueDelay != _I64_MAX)
396 const double delay = static_cast<double>(perfCount) - static_cast<double>(m_disqueDelay);
397 delta = qMax(1, qMin(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ) / 0.00512))));
399 m_disqueDelay = perfCount;
404 if(m_disquePos.x() <= m_disqueBound.left()) { m_disqueFlags[0] = true; m_rotateNext = true; }
405 if(m_disquePos.x() >= m_disqueBound.right()) { m_disqueFlags[0] = false; m_rotateNext = true; }
406 if(m_disquePos.y() <= m_disqueBound.top()) { m_disqueFlags[1] = true; m_rotateNext = true; }
407 if(m_disquePos.y() >= m_disqueBound.bottom()) { m_disqueFlags[1] = false; m_rotateNext = true; }
409 m_disquePos.setX(m_disqueFlags[0] ? (m_disquePos.x() + delta) : (m_disquePos.x() - delta));
410 m_disquePos.setY(m_disqueFlags[1] ? (m_disquePos.y() + delta) : (m_disquePos.y() - delta));
412 m_disque->move(m_disquePos);
416 QPixmap *cartoon = NULL;
417 if(m_disqueFlags[0] == true && m_disqueFlags[1] != true) cartoon = m_cartoon[0];
418 if(m_disqueFlags[0] == true && m_disqueFlags[1] == true) cartoon = m_cartoon[1];
419 if(m_disqueFlags[0] != true && m_disqueFlags[1] == true) cartoon = m_cartoon[2];
420 if(m_disqueFlags[0] != true && m_disqueFlags[1] != true) cartoon = m_cartoon[3];
423 m_disque->setPixmap(*cartoon);
424 if(m_disque->size() != cartoon->size())
426 m_disque->resize(cartoon->size());
430 m_rotateNext = false;
433 if(m_discOpacity != 1.0)
435 m_discOpacity = m_discOpacity + 0.01;
436 if(qFuzzyCompare(m_discOpacity, 1.0) || (m_discOpacity > 1.0))
440 m_disque->setWindowOpacity(m_discOpacity);
446 void AboutDialog::geometryUpdated(void)
450 QRect screenGeometry = QApplication::desktop()->availableGeometry();
451 m_disqueBound.setLeft(screenGeometry.left());
452 m_disqueBound.setRight(screenGeometry.width() - m_disque->width() + screenGeometry.left());
453 m_disqueBound.setTop(screenGeometry.top());
454 m_disqueBound.setBottom(screenGeometry.height() - m_disque->height() + screenGeometry.top());
458 m_disqueBound = QApplication::desktop()->availableGeometry();
462 void AboutDialog::adjustSize(void)
464 const int maxH = QApplication::desktop()->availableGeometry().height();
465 const int maxW = QApplication::desktop()->availableGeometry().width();
467 const int deltaH = ui->infoScrollArea->widget()->height() - ui->infoScrollArea->viewport()->height();
468 const int deltaW = ui->infoScrollArea->widget()->width() - ui->infoScrollArea->viewport()->width();
472 this->resize(this->width(), qMin(this->height() + deltaH, maxH));
473 this->move(this->x(), this->y() - (deltaH / 2));
474 this->setMinimumHeight(qMax(this->minimumHeight(), this->height()));
479 this->resize(qMin(this->width() + deltaW, maxW), this->height());
480 this->move(this->x() - (deltaW / 2), this->y());
481 this->setMinimumWidth(qMax(this->minimumWidth(), this->width()));
485 ////////////////////////////////////////////////////////////
486 // Protected Functions
487 ////////////////////////////////////////////////////////////
489 void AboutDialog::showEvent(QShowEvent *e)
491 QDialog::showEvent(e);
493 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->infoTab));
494 tabChanged(m_lastTab = ui->tabWidget->currentIndex(), true);
498 ui->acceptButton->setEnabled(false);
499 ui->declineButton->setEnabled(false);
500 QTimer::singleShot(5000, this, SLOT(enableButtons()));
501 setCursor(QCursor(Qt::WaitCursor));
504 QTimer::singleShot(0, this, SLOT(adjustSize()));
507 void AboutDialog::closeEvent(QCloseEvent *e)
509 if(m_firstShow) e->ignore();
512 bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
514 if((obj == m_disque) && (event->type() == QEvent::MouseButtonPress))
516 QPixmap cartoon(":/images/Cartoon.png");
517 for(int i = 0; i < 4; i++)
521 m_cartoon[i] = new QPixmap(cartoon.transformed(QMatrix().rotate(static_cast<double>(i*90) + 45.0), Qt::SmoothTransformation));
525 QDesktopServices::openUrl(QUrl(disqueUrl));
531 ////////////////////////////////////////////////////////////
533 ////////////////////////////////////////////////////////////
535 void AboutDialog::initInformationTab(void)
537 const QDate versionDate = MUtils::Version::app_build_date();
539 const QString versionStr = QString().sprintf
541 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
542 lamexp_version_major(),
543 lamexp_version_minor(),
544 lamexp_version_release(),
545 lamexp_version_build(),
546 versionDate.toString(Qt::ISODate).toLatin1().constData(),
547 MUtils::Version::compiler_version(),
548 MUtils::Version::compiler_arch(),
552 const QString copyrightStr = QString().sprintf
554 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
555 qMax(versionDate.year(), MUtils::OS::current_date().year())
560 aboutText += QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
561 aboutText += QString("<b>%1</b><br>").arg(NOBR(copyrightStr));
562 aboutText += QString("<b>%1</b><br><br>").arg(NOBR(versionStr));
563 aboutText += QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
565 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
566 const QDate currentDate = MUtils::OS::current_date();
569 int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0);
570 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
572 else if(lamexp_version_demo())
574 int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0);
575 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(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))));
578 const QDate currentDate = lamexp_current_date_safe();
581 int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0i64);
582 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
584 else if(lamexp_version_demo())
586 int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0i64);
587 aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(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))));
591 aboutText += "<hr><br>";
593 aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or modify<br>";
594 aboutText += "it under the terms of the GNU General Public License as published by<br>";
595 aboutText += "the Free Software Foundation; either version 2 of the License, or<br>";
596 aboutText += "(at your option) any later version, but always including the *additional*<br>";
597 aboutText += "restrictions defined in the \"License.txt\" file (see \"License\" tab).<br><br>";
598 aboutText += "This program is distributed in the hope that it will be useful,<br>";
599 aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
600 aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
601 aboutText += "GNU General Public License for more details.<br><br>";
602 aboutText += "You should have received a copy of the GNU General Public License<br>";
603 aboutText += "along with this program; if not, write to the Free Software<br>";
604 aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
605 aboutText += "<hr><table style=\"margin-top:4px\"><tr>";
606 aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
607 aboutText += QString("<td><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 !!!"));
608 aboutText += "</tr></table>";
610 ui->infoLabel->setText(aboutText);
611 ui->infoIcon->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
612 connect(ui->infoLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
615 void AboutDialog::initContributorsTab(void)
617 const QString spaces(" ");
618 const QString extraVSpace("<font style=\"font-size:7px\"><br> </font>");
620 QString contributorsAboutText;
621 contributorsAboutText += QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
622 contributorsAboutText += "<table style=\"margin-top:12px;white-space:nowrap\">";
624 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraVSpace);
625 QString icon = QString("<img src=\":/icons/%1.png\">").arg("user_gray");
626 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon, spaces);
627 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces);
628 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%3\"><%3></a></td></tr>").arg("LoRd_MuldeR", spaces, "MuldeR2@GMX.de");
629 contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
631 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace);
632 for(int i = 0; g_lamexp_translators[i].pcName; i++)
634 QString flagIcon = (strlen(g_lamexp_translators[i].pcFlag) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators[i].pcFlag) : QString();
635 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon, spaces);
636 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(MUTILS_QSTR(g_lamexp_translators[i].pcLanguage), spaces);
637 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%3\"><%3></a></td></tr>").arg(MUTILS_QSTR(g_lamexp_translators[i].pcName), spaces, g_lamexp_translators[i].pcMail);
640 contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
641 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Special thanks to:"), extraVSpace);
643 QString webIcon = QString("<img src=\":/icons/%1.png\">").arg("world");
644 for(int i = 0; g_lamexp_specialThanks[i].pcName; i++)
646 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
647 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));
650 contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
651 contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Official Mirrors:"), extraVSpace);
653 QString serverIcon = QString("<img src=\":/icons/%1.png\">").arg("server_database");
654 for(int i = 0; g_lamexp_mirrors[i].pcName; i++)
656 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(serverIcon, spaces);
657 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));
660 contributorsAboutText += "</table><br><br><br>";
661 contributorsAboutText += QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
663 ui->contributorsLabel->setText(contributorsAboutText);
664 ui->contributorsIcon->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
665 connect(ui->contributorsLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
668 void AboutDialog::initSoftwareTab(void)
670 QString moreAboutText;
672 moreAboutText += QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
673 moreAboutText += "<div style=\"margin-left:-25px;white-space:nowrap\"><table><tr><td><ul>"; //;font-size:7pt
675 moreAboutText += makeToolText
677 tr("LAME - OpenSource mp3 Encoder"),
678 "lame.exe", "v?.??, #-?",
679 tr("Released under the terms of the GNU Lesser General Public License."),
680 "http://lame.sourceforge.net/"
682 moreAboutText += makeToolText
684 tr("OggEnc - Vorbis Encoder"),
685 "oggenc2.exe", "v?.??, libvorbis v?.?? + aoTuV b?.??_#",
686 tr("Completely open and patent-free audio encoding technology."),
687 "http://www.rarewares.org/ogg-oggenc.php"
689 moreAboutText += makeToolText
691 tr("Nero AAC Reference MPEG-4 Encoder"),
692 "neroAacEnc.exe", "v?.?.?.?",
693 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
695 tr("Available from vendor web-site as free download:")
697 moreAboutText += makeToolText
699 tr("Aften - A/52 audio encoder"),
700 "aften.exe", "v?.?.?",
701 tr("Released under the terms of the GNU Lesser General Public License."),
702 "http://aften.sourceforge.net/"
704 moreAboutText += makeToolText
706 tr("FLAC - Free Lossless Audio Codec"),
707 "flac.exe", "v?.?.?",
708 tr("Open and patent-free lossless audio compression technology."),
709 "http://flac.sourceforge.net/"
711 moreAboutText += makeToolText
713 tr("Opus Audio Codec"),
714 "opusenc.exe", "#, ????-??-??",
715 tr("Totally open, royalty-free, highly versatile audio codec."),
716 "http://www.opus-codec.org/"
718 moreAboutText += makeToolText
720 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
721 "mpg123.exe", "v?.??.?",
722 tr("Released under the terms of the GNU Lesser General Public License."),
723 "http://www.mpg123.de/"
725 moreAboutText += makeToolText
727 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
729 tr("Released under the terms of the GNU General Public License."),
730 "http://www.audiocoding.com/"
732 moreAboutText += makeToolText
734 tr("OggDec - Vorbis Decoder"),
735 "oggdec.exe", "v?.??.?",
736 tr("Command line Ogg Vorbis decoder created by John33."),
737 "http://www.rarewares.org/ogg-oggdec.php"
739 moreAboutText += makeToolText
741 tr("Valdec from AC3Filter Tools - AC3/DTS Decoder"),
742 "valdec.exe", "v?.??#",
743 tr("Released under the terms of the GNU Lesser General Public License."),
744 "http://www.ac3filter.net/projects/tools"
746 moreAboutText += makeToolText
748 tr("WavPack - Hybrid Lossless Compression"),
749 "wvunpack.exe", "v?.??.?",
750 tr("Completely open audio compression format."),
751 "http://www.wavpack.com/"
753 moreAboutText += makeToolText
755 tr("Musepack - Living Audio Compression"),
756 "mpcdec.exe", "r???",
757 tr("Released under the terms of the GNU Lesser General Public License."),
758 "http://www.musepack.net/"
760 moreAboutText += makeToolText
762 tr("Monkey's Audio - Lossless Audio Compressor"),
764 tr("Freely available source code, simple SDK and non-restrictive licensing."),
765 "http://www.monkeysaudio.com/"
767 moreAboutText += makeToolText
769 tr("Shorten - Lossless Audio Compressor"),
770 "shorten.exe", "v?.?.?",
771 tr("Released under the terms of the GNU Lesser General Public License."),
772 "http://etree.org/shnutils/shorten/"
774 moreAboutText += makeToolText
776 tr("Speex - Free Codec For Free Speech"),
777 "speexdec.exe", "v?.?",
778 tr("Open Source patent-free audio format designed for speech."),
779 "http://www.speex.org/"
781 moreAboutText += makeToolText
783 tr("The True Audio - Lossless Audio Codec"),
785 tr("Released under the terms of the GNU Lesser General Public License."),
786 "http://tta.sourceforge.net/"
788 moreAboutText += makeToolText
790 tr("refalac - Win32 command line ALAC encoder/decoder"),
791 "refalac.exe", "v?.??",
792 tr("The ALAC reference implementation by Apple is available under the Apache license."),
793 "http://alac.macosforge.org/"
795 moreAboutText += makeToolText
797 tr("wma2wav - Dump WMA files to Wave Audio"),
798 "wma2wav.exe", "????-??-??",
799 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
800 "http://forum.doom9.org/showthread.php?t=140273"
802 moreAboutText += makeToolText
804 tr("avs2wav - Avisynth to Wave Audio converter"),
805 "avs2wav.exe", "v?.?",
806 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
807 "http://forum.doom9.org/showthread.php?t=70882"
809 moreAboutText += makeToolText
812 "dcaenc.exe", "????-??-??",
813 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
814 "http://gitorious.org/dtsenc/dtsenc/trees/master"
816 moreAboutText += makeToolText
818 tr("MediaInfo - Media File Analysis Tool"),
819 "mediainfo.exe", "v?.?.??",
820 tr("Released under the terms of the GNU Lesser General Public License."),
821 "http://mediainfo.sourceforge.net/"
823 moreAboutText += makeToolText
825 tr("SoX - Sound eXchange"),
826 "sox.exe", "v??.?.?",
827 tr("Released under the terms of the GNU Lesser General Public License."),
828 "http://sox.sourceforge.net/"
830 moreAboutText += makeToolText
832 tr("GnuPG - The GNU Privacy Guard"),
833 "gpgv.exe", "v?.?.??",
834 tr("Released under the terms of the GNU Lesser General Public License."),
835 "http://www.gnupg.org/"
837 moreAboutText += makeToolText
839 tr("GNU Wget - Software for retrieving files using HTTP"),
840 "wget.exe", "v?.??.?",
841 tr("Released under the terms of the GNU Lesser General Public License."),
842 "http://www.gnu.org/software/wget/"
844 moreAboutText += makeToolText
846 tr("UPX - The Ultimate Packer for eXecutables"),
848 tr("Released under the terms of the GNU Lesser General Public License."),
849 "http://upx.sourceforge.net/"
851 moreAboutText += makeToolText
853 tr("Silk Icons - Over 700 icons in PNG format"),
855 tr("By Mark James, released under the Creative Commons 'by' License."),
856 "http://www.famfamfam.com/lab/icons/silk/"
858 moreAboutText += QString("</ul></td><td> </td></tr></table></div><br><i>%1</i><br>").arg
860 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.")
863 ui->softwareLabel->setText(moreAboutText);
864 ui->softwareIcon->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65)));
865 connect(ui->softwareLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
868 void AboutDialog::initLicenseTab(void)
870 bool bFoundHeader = false;
871 QRegExp header("^(\\s*)(GNU GENERAL PUBLIC LICENSE)(\\s*)$");
874 licenseText += ("<tt>");
876 QFile file(":/License.txt");
877 if(file.open(QIODevice::ReadOnly))
879 QTextStream stream(&file);
880 while((!stream.atEnd()) && (stream.status() == QTextStream::Ok))
882 QString line = stream.readLine();
883 line.replace('<', "<").replace('>', ">");
884 if((!bFoundHeader) && (header.indexIn(line) >= 0))
886 line.replace(header, "\\1<b>\\2</b>\\3");
890 licenseText += QString("<nobr>%1</nobr><br>").arg(line.replace(' ', " "));
892 licenseText += QString("<br>");
893 stream.device()->close();
897 licenseText += QString("<font color=\"darkred\">Oups, failed to load license text. Please refer to:</font><br>");
898 licenseText += LINK("http://www.gnu.org/licenses/gpl-2.0.html");
901 licenseText += ("</tt>");
903 ui->licenseLabel->setText(licenseText);
904 ui->licenseIcon->setPixmap(QIcon(":/images/Logo_GNU.png").pixmap(QSize(72,65)));
905 connect(ui->licenseLabel, SIGNAL(linkActivated(QString)), this, SLOT(openURL(QString)));
909 QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo)
911 QString toolText, toolTag, verStr(toolVerFmt);
913 if(!toolBin.isEmpty())
915 const unsigned int version = lamexp_tool_version(toolBin, &toolTag);
916 verStr = lamexp_version2string(toolVerFmt, version, tr("n/a"), &toolTag);
919 toolText += QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName, verStr)));
920 toolText += QString("%1<br>").arg(NOBR(toolLicense));
921 if(!extraInfo.isEmpty()) toolText += QString("<i>%1</i><br>").arg(NOBR(extraInfo));
922 toolText += QString("<nobr>%1</nobr>").arg(LINK(toolWebsite));
923 toolText += QString("<font style=\"font-size:9px\"><br> </font>");