1
///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2018 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 <QWindowsVistaStyle>
56 #include <QWindowsXPStyle>
62 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
63 #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)
64 #define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
67 const char *AboutDialog::neroAacUrl
= "http://www.videohelp.com/software/Nero-AAC-Codec"; //"http://www.nero.com/eng/company/about-nero/nero-aac-codec.php"
68 const char *AboutDialog::disqueUrl
= "http://muldersoft.com/?player_url=n4bply6Ibqw"; //38X-MXOB014
78 g_lamexp_translators
[] =
80 {"en", L
"Englisch", L
"LoRd_MuldeR", "MuldeR2@GMX.de" },
81 {"de", L
"Deutsch", L
"LoRd_MuldeR", "MuldeR2@GMX.de" },
82 {"", L
"", L
"Bodo Thevissen", "Bodo@thevissen.de" },
83 {"es", L
"Español", L
"Rub3nCT", "Rub3nCT@gmail.com" },
84 {"fr", L
"Française", L
"Dodich Informatique", "Dodich@live.fr" },
85 {"", L
"Française", L
"Sami Ghoul-Duclos", "samgd14@live.ca" },
86 {"hu", L
"Magyarul", L
"ZityiSoft Team", "zityisoft@gmail.com" },
87 {"it", L
"Italiano", L
"Roberto", "Gulliver_69@libero.it" },
88 {"", L
"", L
"Gianluca Papi", "johnnyb.goode68@gmail.com"},
89 {"kr", L
"한국어", L
"JaeHyung Lee", "Kolanp@gmail.com" },
90 {"pl", L
"Polski", L
"Sir Daniel K", "Sir.Daniel.K@gmail.com" },
91 {"ru", L
"Русский", L
"Neonailol", "Neonailol@gmail.com" },
92 {"", L
"", L
"Иван Митин", "bardak@inbox.ru" },
93 {"sv", L
"Svenska", L
"Åke Engelbrektson", "eson@svenskasprakfiler.se"},
94 {"tw", L
"繁体中文", L
"456Vv", "123@456vv.com" },
95 {"uk", L
"Українська", L
"Arestarh", "Arestarh@ukr.net" },
96 {"zh", L
"简体中文", L
"456Vv", "123@456vv.com" },
97 {"", L
"", L
"庄泓川", "kidneybean@pku.edu.cn" },
98 {NULL
, NULL
, NULL
, NULL
}
107 g_lamexp_specialThanks
[] =
109 { "Doom9's Forum", "http://forum.doom9.org/" },
110 { "Gleitz | German Doom9", "http://forum.gleitz.info/" },
111 { "Hydrogenaudio Forums", "http://www.hydrogenaudio.org/" },
112 { "RareWares", "http://www.rarewares.org/" },
113 { "GitHub", "http://github.com/" },
114 { "SourceForge", "http://sourceforge.net/" },
115 { "Qt Developer Network", "https://www.qt.io/developers/" },
116 { "CodePlex", "http://www.codeplex.com/" },
117 { "Marius Hudea", "http://savedonthe.net/" },
118 { "Codecs.com", "http://www.codecs.com/" },
130 { "GitHub.com", "https://github.com/lordmulder/LameXP" },
131 { "SourceForge.net", "http://sourceforge.net/p/lamexp/code/" },
132 { "Bitbucket.org", "https://bitbucket.org/muldersoft/lamexp" },
133 { "GitLab.com" , "https://gitlab.com/lamexp/lamexp" },
134 { "Codeplex.com", "https://lamexp.codeplex.com/SourceControl/latest" },
135 { "Assembla.com", "https://www.assembla.com/spaces/lamexp/" },
139 ////////////////////////////////////////////////////////////
141 ////////////////////////////////////////////////////////////
143 AboutDialog::AboutDialog(SettingsModel
*settings
, QWidget
*parent
, bool firstStart
)
146 ui(new Ui::AboutDialog
),
147 m_settings(settings
),
148 m_initFlags(new QMap
<QWidget
*,bool>),
153 m_firstStart(firstStart
)
155 //Init the dialog, from the .ui file
157 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint
));
158 setMinimumSize(this->size());
160 //Adjust size to DPI settings and re-center
161 MUtils::GUI::scale_widget(this);
166 MUtils::GUI::enable_close_button(this, false);
170 connect(ui
->tabWidget
, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
173 const type_info
&styleType
= typeid(*qApp
->style());
174 if((typeid(QWindowsVistaStyle
) == styleType
) || (typeid(QWindowsXPStyle
) == styleType
))
176 MAKE_TRANSPARENT(ui
->infoScrollArea
);
177 MAKE_TRANSPARENT(ui
->contributorsScrollArea
);
178 MAKE_TRANSPARENT(ui
->softwareScrollArea
);
179 MAKE_TRANSPARENT(ui
->licenseScrollArea
);
182 //Show about dialog for the first time?
185 ui
->acceptButton
->hide();
186 ui
->declineButton
->hide();
187 ui
->aboutQtButton
->show();
188 ui
->closeButton
->show();
190 QPixmap
disque(":/images/Disque.png");
191 m_disque
.reset(new QLabel(this, Qt::Window
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint
));
192 m_disque
->resize(disque
.size());
193 m_disque
->setStyleSheet("background:transparent;");
194 m_disque
->setAttribute(Qt::WA_TranslucentBackground
);
195 m_disque
->setPixmap(disque
);
196 m_disque
->setCursor(QCursor(Qt::PointingHandCursor
));
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_rand_u32() % static_cast<unsigned int>(m_disqueBound
.right() - disque
.width() - m_disqueBound
.left())) + m_disqueBound
.left());
204 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());
205 m_disqueFlags
[0] = (MUtils::next_rand_u32() > (UINT_MAX
/2));
206 m_disqueFlags
[1] = (MUtils::next_rand_u32() > (UINT_MAX
/2));
207 m_disque
->move(m_disquePos
);
208 m_disque
->setWindowOpacity(m_discOpacity
);
210 m_disqueTimer
.reset(new QTimer());
212 connect(m_disqueTimer
.data(), SIGNAL(timeout()), this, SLOT(moveDisque()));
213 connect(ui
->aboutQtButton
, SIGNAL(clicked()), this, SLOT(showAboutQt()));
217 ui
->acceptButton
->show();
218 ui
->declineButton
->show();
219 ui
->aboutQtButton
->hide();
220 ui
->closeButton
->hide();
223 //Activate "show license" button
224 ui
->showLicenseButton
->show();
225 connect(ui
->showLicenseButton
, SIGNAL(clicked()), this, SLOT(gotoLicenseTab()));
228 AboutDialog::~AboutDialog(void)
236 m_disqueTimer
->stop();
241 ////////////////////////////////////////////////////////////
243 ////////////////////////////////////////////////////////////
245 int AboutDialog::exec()
247 if(m_settings
->soundsEnabled())
251 if(!MUtils::Sound::play_sound_file("imageres.dll", 5080, true))
253 MUtils::Sound::play_system_sound("SystemStart", true);
258 MUtils::Sound::play_sound("ghost", true);
262 switch(QDialog::exec())
276 ////////////////////////////////////////////////////////////
278 ////////////////////////////////////////////////////////////
280 #define TEMP_HIDE_DISQUE(CMD) do \
282 bool _tmp = (m_disque) ? m_disque->isVisible() : false; \
283 if(_tmp) m_disque->hide(); \
287 m_discOpacity = 0.01; \
288 m_disque->setWindowOpacity(m_discOpacity); \
294 void AboutDialog::tabChanged(int index
, const bool silent
)
296 bool bInitialized
= m_initFlags
->value(ui
->tabWidget
->widget(index
), false);
300 qApp
->setOverrideCursor(QCursor(Qt::WaitCursor
));
302 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
306 if(tab
== ui
->infoTab
) { initInformationTab(); ok
= true; }
307 if(tab
== ui
->contributorsTab
) { initContributorsTab(); ok
= true; }
308 if(tab
== ui
->softwareTab
) { initSoftwareTab(); ok
= true; }
309 if(tab
== ui
->licenseTab
) { initLicenseTab(); ok
= true; }
313 m_initFlags
->insert(tab
, true);
317 qWarning("Unknown tab %p encountered, cannot initialize !!!", tab
);
322 ui
->tabWidget
->widget(index
)->update();
323 qApp
->processEvents();
324 qApp
->restoreOverrideCursor();
328 if(m_settings
->soundsEnabled() && (!silent
))
330 MUtils::Sound::play_sound("tick", true);
334 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
336 if(tab
== ui
->infoTab
) ui
->infoScrollArea
->verticalScrollBar()->setSliderPosition(0);
337 if(tab
== ui
->contributorsTab
) ui
->contributorsScrollArea
->verticalScrollBar()->setSliderPosition(0);
338 if(tab
== ui
->softwareTab
) ui
->softwareScrollArea
->verticalScrollBar()->setSliderPosition(0);
339 if(tab
== ui
->licenseTab
) ui
->licenseScrollArea
->verticalScrollBar()->setSliderPosition(0);
342 //Update license button
343 ui
->showLicenseButton
->setChecked(ui
->tabWidget
->widget(index
) == ui
->licenseTab
);
344 if(ui
->tabWidget
->widget(index
) != ui
->licenseTab
) m_lastTab
= index
;
347 void AboutDialog::enableButtons(void)
349 ui
->acceptButton
->setEnabled(true);
350 ui
->declineButton
->setEnabled(true);
351 setCursor(QCursor(Qt::ArrowCursor
));
354 void AboutDialog::openURL(const QString
&url
)
356 if(!QDesktopServices::openUrl(QUrl(url
)))
358 MUtils::OS::shell_open(this, url
);
362 void AboutDialog::showAboutQt(void)
366 QMessageBox::aboutQt(this);
370 void AboutDialog::gotoLicenseTab(void)
372 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->showLicenseButton
->isChecked() ? ui
->licenseTab
: ui
->tabWidget
->widget(m_lastTab
)));
375 void AboutDialog::moveDisque(void)
378 QElapsedTimer elapsedTimer
;
379 elapsedTimer
.start();
381 if((!m_disqueDelay
.isNull()) && m_disqueDelay
->isValid())
383 const qint64 delay
= m_disqueDelay
->restart();
384 delta
= qBound(1, static_cast<int>(ceil(static_cast<double>(delay
) / 5.12)), 128);
388 m_disqueDelay
.reset(new QElapsedTimer());
389 m_disqueDelay
->start();
394 if(m_disquePos
.x() <= m_disqueBound
.left()) { m_disqueFlags
[0] = true; m_rotateNext
= true; }
395 if(m_disquePos
.x() >= m_disqueBound
.right()) { m_disqueFlags
[0] = false; m_rotateNext
= true; }
396 if(m_disquePos
.y() <= m_disqueBound
.top()) { m_disqueFlags
[1] = true; m_rotateNext
= true; }
397 if(m_disquePos
.y() >= m_disqueBound
.bottom()) { m_disqueFlags
[1] = false; m_rotateNext
= true; }
399 m_disquePos
.setX(m_disqueFlags
[0] ? (m_disquePos
.x() + delta
) : (m_disquePos
.x() - delta
));
400 m_disquePos
.setY(m_disqueFlags
[1] ? (m_disquePos
.y() + delta
) : (m_disquePos
.y() - delta
));
402 m_disque
->move(m_disquePos
);
406 const QPixmap
*const cartoon
= m_cartoon
[m_disqueFlags
[0] ? (m_disqueFlags
[1] ? 1 : 0): (m_disqueFlags
[1] ? 2 : 3)].data();
409 m_disque
->setPixmap(*cartoon
);
410 if(m_disque
->size() != cartoon
->size())
412 m_disque
->resize(cartoon
->size());
416 m_rotateNext
= false;
419 if(m_discOpacity
!= 1.0)
421 m_discOpacity
= m_discOpacity
+ 0.01;
422 if(qFuzzyCompare(m_discOpacity
, 1.0) || (m_discOpacity
> 1.0))
426 m_disque
->setWindowOpacity(m_discOpacity
);
432 void AboutDialog::geometryUpdated(void)
436 QRect screenGeometry
= QApplication::desktop()->availableGeometry();
437 m_disqueBound
.setLeft(screenGeometry
.left());
438 m_disqueBound
.setRight(screenGeometry
.width() - m_disque
->width() + screenGeometry
.left());
439 m_disqueBound
.setTop(screenGeometry
.top());
440 m_disqueBound
.setBottom(screenGeometry
.height() - m_disque
->height() + screenGeometry
.top());
444 m_disqueBound
= QApplication::desktop()->availableGeometry();
448 void AboutDialog::adjustSize(void)
450 const int maxH
= QApplication::desktop()->availableGeometry().height();
451 const int maxW
= QApplication::desktop()->availableGeometry().width();
453 const int deltaH
= ui
->infoScrollArea
->widget()->height() - ui
->infoScrollArea
->viewport()->height();
454 const int deltaW
= ui
->infoScrollArea
->widget()->width() - ui
->infoScrollArea
->viewport()->width();
458 this->resize(this->width(), qMin(this->height() + deltaH
, maxH
));
459 this->move(this->x(), this->y() - (deltaH
/ 2));
460 this->setMinimumHeight(qMax(this->minimumHeight(), this->height()));
465 this->resize(qMin(this->width() + deltaW
, maxW
), this->height());
466 this->move(this->x() - (deltaW
/ 2), this->y());
467 this->setMinimumWidth(qMax(this->minimumWidth(), this->width()));
471 ////////////////////////////////////////////////////////////
472 // Protected Functions
473 ////////////////////////////////////////////////////////////
475 void AboutDialog::showEvent(QShowEvent
*e
)
477 QDialog::showEvent(e
);
479 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->infoTab
));
480 tabChanged(m_lastTab
= ui
->tabWidget
->currentIndex(), true);
484 ui
->acceptButton
->setEnabled(false);
485 ui
->declineButton
->setEnabled(false);
486 QTimer::singleShot(5000, this, SLOT(enableButtons()));
487 setCursor(QCursor(Qt::WaitCursor
));
490 if (!(m_disque
.isNull() || m_disqueTimer
.isNull()))
493 m_disqueTimer
->start(10);
496 QTimer::singleShot(0, this, SLOT(adjustSize()));
499 void AboutDialog::closeEvent(QCloseEvent
*e
)
507 bool AboutDialog::eventFilter(QObject
*obj
, QEvent
*event
)
509 if((!m_disque
.isNull()) && (obj
== m_disque
.data()) && (event
->type() == QEvent::MouseButtonPress
))
511 MUtils::Sound::play_sound("chicken", true);
514 QPixmap
cartoon(":/images/Cartoon.png");
515 for(int i
= 0; i
< 4; i
++)
517 m_cartoon
[i
].reset(new QPixmap(cartoon
.transformed(QMatrix().rotate(static_cast<double>(i
*90) + 45.0), Qt::SmoothTransformation
)));
521 QDesktopServices::openUrl(QUrl(disqueUrl
));
527 ////////////////////////////////////////////////////////////
529 ////////////////////////////////////////////////////////////
531 void AboutDialog::initInformationTab(void)
533 const QDate versionDate
= MUtils::Version::app_build_date();
535 const QString versionStr
= QString().sprintf
537 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
538 lamexp_version_major(),
539 lamexp_version_minor(),
540 lamexp_version_release(),
541 lamexp_version_build(),
542 versionDate
.toString(Qt::ISODate
).toLatin1().constData(),
543 MUtils::Version::compiler_version(),
544 MUtils::Version::compiler_arch(),
548 const QString copyrightStr
= QString().sprintf
550 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
551 qMax(versionDate
.year(), MUtils::OS::current_date().year())
556 aboutText
+= QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
557 aboutText
+= QString("<b>%1</b><br>").arg(NOBR(copyrightStr
));
558 aboutText
+= QString("<b>%1</b><br><br>").arg(NOBR(versionStr
));
559 aboutText
+= QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
561 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
562 const QDate currentDate
= MUtils::OS::current_date();
565 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
566 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
))));
568 else if(lamexp_version_demo())
570 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
571 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
))));
574 const QDate currentDate
= lamexp_current_date_safe();
577 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
578 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
))));
580 else if(lamexp_version_demo())
582 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
583 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
))));
587 aboutText
+= "<hr><br>";
589 aboutText
+= "<nobr><tt>This program is free software; you can redistribute it and/or modify<br>";
590 aboutText
+= "it under the terms of the GNU General Public License as published by<br>";
591 aboutText
+= "the Free Software Foundation; either version 2 of the License, or<br>";
592 aboutText
+= "(at your option) any later version, but always including the *additional*<br>";
593 aboutText
+= "restrictions defined in the \"License.txt\" file (see \"License\" tab).<br><br>";
594 aboutText
+= "This program is distributed in the hope that it will be useful,<br>";
595 aboutText
+= "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
596 aboutText
+= "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
597 aboutText
+= "GNU General Public License for more details.<br><br>";
598 aboutText
+= "You should have received a copy of the GNU General Public License<br>";
599 aboutText
+= "along with this program; if not, write to the Free Software<br>";
600 aboutText
+= "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
601 aboutText
+= "<hr><table style=\"margin-top:4px\"><tr>";
602 aboutText
+= "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
603 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 !!!"));
604 aboutText
+= "</tr></table>";
606 ui
->infoLabel
->setText(aboutText
);
607 ui
->infoIcon
->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
608 connect(ui
->infoLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
611 void AboutDialog::initContributorsTab(void)
613 const QString
spaces(" ");
614 const QString
extraVSpace("<font style=\"font-size:7px\"><br> </font>");
616 QString contributorsAboutText
;
617 contributorsAboutText
+= QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
618 contributorsAboutText
+= "<table style=\"margin-top:12px;white-space:nowrap\">";
620 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraVSpace
);
621 QString icon
= QString("<img src=\":/icons/%1.png\">").arg("user_gray");
622 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon
, spaces
);
623 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces
);
624 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");
625 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
627 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace
);
628 for(int i
= 0; g_lamexp_translators
[i
].pcName
; i
++)
630 QString flagIcon
= (strlen(g_lamexp_translators
[i
].pcFlag
) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators
[i
].pcFlag
) : QString();
631 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon
, spaces
);
632 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(MUTILS_QSTR(g_lamexp_translators
[i
].pcLanguage
), spaces
);
633 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
);
636 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
637 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Special thanks to:"), extraVSpace
);
639 QString webIcon
= QString("<img src=\":/icons/%1.png\">").arg("world");
640 for(int i
= 0; g_lamexp_specialThanks
[i
].pcName
; i
++)
642 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon
, spaces
);
643 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
));
646 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
647 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Official Mirrors:"), extraVSpace
);
649 QString serverIcon
= QString("<img src=\":/icons/%1.png\">").arg("server_database");
650 for(int i
= 0; g_lamexp_mirrors
[i
].pcName
; i
++)
652 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(serverIcon
, spaces
);
653 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
));
656 contributorsAboutText
+= "</table><br><br><br>";
657 contributorsAboutText
+= QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
659 ui
->contributorsLabel
->setText(contributorsAboutText
);
660 ui
->contributorsIcon
->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
661 connect(ui
->contributorsLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
664 void AboutDialog::initSoftwareTab(void)
666 QString moreAboutText
;
668 moreAboutText
+= QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
669 moreAboutText
+= "<div style=\"margin-left:-25px;white-space:nowrap\"><table><tr><td><ul>"; //;font-size:7pt
671 moreAboutText
+= makeToolText
673 tr("LAME - OpenSource mp3 Encoder"),
674 "lame.exe", "v?.???, #-?",
675 tr("Released under the terms of the GNU Lesser General Public License."),
676 "http://lame.sourceforge.net/"
678 moreAboutText
+= makeToolText
680 tr("OggEnc - Vorbis Encoder"),
681 "oggenc2.exe", "v?.??, libvorbis v?.?? + aoTuV b?.??_#",
682 tr("Completely open and patent-free audio encoding technology."),
683 "http://www.rarewares.org/ogg-oggenc.php"
685 moreAboutText
+= makeToolText
687 tr("Nero AAC Reference MPEG-4 Encoder"),
688 "neroAacEnc.exe", "v?.?.?.?",
689 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
691 tr("Available from vendor web-site as free download:")
693 moreAboutText
+= makeToolText
695 tr("Aften - A/52 audio encoder"),
696 "aften.exe", "v?.?.?",
697 tr("Released under the terms of the GNU Lesser General Public License."),
698 "http://aften.sourceforge.net/"
700 moreAboutText
+= makeToolText
702 tr("FLAC - Free Lossless Audio Codec"),
703 "flac.exe", "v?.?.?",
704 tr("Open and patent-free lossless audio compression technology."),
705 "http://flac.sourceforge.net/"
707 moreAboutText
+= makeToolText
709 tr("Opus Audio Codec"),
710 "opusenc.exe", "#, ????-??-??",
711 tr("Totally open, royalty-free, highly versatile audio codec."),
712 "http://www.opus-codec.org/"
714 moreAboutText
+= makeToolText
716 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
717 "mpg123.exe", "v?.??.??",
718 tr("Released under the terms of the GNU Lesser General Public License."),
719 "http://www.mpg123.de/"
721 moreAboutText
+= makeToolText
723 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
724 "faad.exe", "v?.?.?",
725 tr("Released under the terms of the GNU General Public License."),
726 "https://sourceforge.net/projects/faac/" //"http://www.audiocoding.com/"
728 moreAboutText
+= makeToolText
730 tr("OggDec - Vorbis Decoder"),
731 "oggdec.exe", "v?.??.?",
732 tr("Command line Ogg Vorbis decoder created by John33."),
733 "http://www.rarewares.org/ogg-oggdec.php"
735 moreAboutText
+= makeToolText
737 tr("Valdec from AC3Filter Tools - AC3/DTS Decoder"),
738 "valdec.exe", "v?.??#",
739 tr("Released under the terms of the GNU Lesser General Public License."),
740 "http://www.ac3filter.net/projects/tools"
742 moreAboutText
+= makeToolText
744 tr("WavPack - Hybrid Lossless Compression"),
745 "wvunpack.exe", "v?.??.?",
746 tr("Completely open audio compression format."),
747 "http://www.wavpack.com/"
749 moreAboutText
+= makeToolText
751 tr("Musepack - Living Audio Compression"),
752 "mpcdec.exe", "r???",
753 tr("Released under the terms of the GNU Lesser General Public License."),
754 "http://www.musepack.net/"
756 moreAboutText
+= makeToolText
758 tr("Monkey's Audio - Lossless Audio Compressor"),
760 tr("Freely available source code, simple SDK and non-restrictive licensing."),
761 "http://www.monkeysaudio.com/"
763 moreAboutText
+= makeToolText
765 tr("Shorten - Lossless Audio Compressor"),
766 "shorten.exe", "v?.?.?",
767 tr("Released under the terms of the GNU Lesser General Public License."),
768 "http://etree.org/shnutils/shorten/"
770 moreAboutText
+= makeToolText
772 tr("Speex - Free Codec For Free Speech"),
773 "speexdec.exe", "v?.?",
774 tr("Open Source patent-free audio format designed for speech."),
775 "http://www.speex.org/"
777 moreAboutText
+= makeToolText
779 tr("The True Audio - Lossless Audio Codec"),
781 tr("Released under the terms of the GNU Lesser General Public License."),
782 "http://tta.sourceforge.net/"
784 moreAboutText
+= makeToolText
786 tr("refalac - Win32 command line ALAC encoder/decoder"),
787 "refalac.exe", "v?.??",
788 tr("The ALAC reference implementation by Apple is available under the Apache license."),
789 "http://alac.macosforge.org/"
791 moreAboutText
+= makeToolText
793 tr("wma2wav - Dump WMA files to Wave Audio"),
794 "wma2wav.exe", "????-??-??",
795 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
796 "http://forum.doom9.org/showthread.php?t=140273"
798 moreAboutText
+= makeToolText
800 tr("avs2wav - Avisynth to Wave Audio converter"),
801 "avs2wav.exe", "v?.?",
802 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
803 "http://forum.doom9.org/showthread.php?t=70882"
805 moreAboutText
+= makeToolText
808 "dcaenc.exe", "????-??-??",
809 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
810 "https://gitlab.com/patrakov/dcaenc"
812 moreAboutText
+= makeToolText
814 tr("MediaInfo - Media File Analysis Tool"),
815 "mediainfo.exe", "v?.?.??",
816 tr("Released under the terms of the GNU Lesser General Public License."),
817 "http://mediainfo.sourceforge.net/"
819 moreAboutText
+= makeToolText
821 tr("SoX - Sound eXchange"),
822 "sox.exe", "v??.?.?",
823 tr("Released under the terms of the GNU Lesser General Public License."),
824 "http://sox.sourceforge.net/"
826 moreAboutText
+= makeToolText
828 tr("GnuPG - The GNU Privacy Guard"),
829 "gpgv.exe", "v?.?.??",
830 tr("Released under the terms of the GNU Lesser General Public License."),
831 "http://www.gnupg.org/"
833 moreAboutText
+= makeToolText
835 tr("GNU Wget - Software for retrieving files using HTTP"),
836 "wget.exe", "v?.??.?",
837 tr("Released under the terms of the GNU Lesser General Public License."),
838 "http://www.gnu.org/software/wget/"
840 moreAboutText
+= makeToolText
842 tr("UPX - The Ultimate Packer for eXecutables"),
844 tr("Released under the terms of the GNU Lesser General Public License."),
845 "http://upx.sourceforge.net/"
847 moreAboutText
+= makeToolText
849 tr("Silk Icons - Over 700 icons in PNG format"),
851 tr("By Mark James, released under the Creative Commons 'BY' License."),
852 "http://www.famfamfam.com/lab/icons/silk/"
854 moreAboutText
+= makeToolText
856 tr("Angry Chicken and Ghost Scream sound"),
858 tr("By Alexander, released under the Creative Commons 'BY' License."),
859 "http://www.orangefreesounds.com/"
861 moreAboutText
+= QString("</ul></td><td> </td></tr></table></div><br><i>%1</i><br>").arg
863 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.")
866 ui
->softwareLabel
->setText(moreAboutText
);
867 ui
->softwareIcon
->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65)));
868 connect(ui
->softwareLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
871 void AboutDialog::initLicenseTab(void)
873 bool bFoundHeader
= false;
874 QRegExp
header("^(\\s*)(GNU GENERAL PUBLIC LICENSE)(\\s*)$");
877 licenseText
+= ("<tt>");
879 QFile
file(":/License.txt");
880 if(file
.open(QIODevice::ReadOnly
))
882 QTextStream
stream(&file
);
883 while((!stream
.atEnd()) && (stream
.status() == QTextStream::Ok
))
885 QString line
= stream
.readLine();
886 line
.replace('<', "<").replace('>', ">");
887 if((!bFoundHeader
) && (header
.indexIn(line
) >= 0))
889 line
.replace(header
, "\\1<b>\\2</b>\\3");
893 licenseText
+= QString("<nobr>%1</nobr><br>").arg(line
.replace(' ', " "));
895 licenseText
+= QString("<br>");
896 stream
.device()->close();
900 licenseText
+= QString("<font color=\"darkred\">Oups, failed to load license text. Please refer to:</font><br>");
901 licenseText
+= LINK("http://www.gnu.org/licenses/gpl-2.0.html");
904 licenseText
+= ("</tt>");
906 ui
->licenseLabel
->setText(licenseText
);
907 ui
->licenseIcon
->setPixmap(QIcon(":/images/Logo_GNU.png").pixmap(QSize(72,65)));
908 connect(ui
->licenseLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
912 QString
AboutDialog::makeToolText(const QString
&toolName
, const QString
&toolBin
, const QString
&toolVerFmt
, const QString
&toolLicense
, const QString
&toolWebsite
, const QString
&extraInfo
)
914 QString toolText
, toolTag
, verStr(toolVerFmt
);
916 if(!toolBin
.isEmpty())
918 const unsigned int version
= lamexp_tools_version(toolBin
, &toolTag
);
919 verStr
= lamexp_version2string(toolVerFmt
, version
, tr("n/a"), toolTag
);
922 toolText
+= QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName
, verStr
)));
923 toolText
+= QString("%1<br>").arg(NOBR(toolLicense
));
924 if(!extraInfo
.isEmpty()) toolText
+= QString("<i>%1</i><br>").arg(NOBR(extraInfo
));
925 toolText
+= QString("<nobr>%1</nobr>").arg(LINK(toolWebsite
));
926 toolText
+= QString("<font style=\"font-size:9px\"><br> </font>");