1
///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2015 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.nero.com/eng/company/about-nero/nero-aac-codec.php"; //"http://www.videohelp.com/tools/Nero-AAC-Codec";
68 const char *AboutDialog::disqueUrl
= "http://muldersoft.com/?player_url=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 {"hu", L
"Magyarul", L
"ZityiSoft Team", "zityisoft@gmail.com" },
86 {"it", L
"Italiano", L
"Roberto", "Gulliver_69@libero.it" },
87 {"", L
"", L
"Gianluca Papi", "johnnyb.goode68@gmail.com"},
88 {"kr", L
"한국어", L
"JaeHyung Lee", "Kolanp@gmail.com" },
89 {"pl", L
"Polski", L
"Sir Daniel K", "Sir.Daniel.K@gmail.com" },
90 {"ru", L
"Русский", L
"Neonailol", "Neonailol@gmail.com" },
91 {"", L
"", L
"Иван Митин", "bardak@inbox.ru" },
92 {"sv", L
"Svenska", L
"Åke Engelbrektson", "eson@svenskasprakfiler.se"},
93 {"tw", L
"繁体中文", L
"456Vv", "123@456vv.com" },
94 {"uk", L
"Українська", L
"Arestarh", "Arestarh@ukr.net" },
95 {"zh", L
"简体中文", L
"456Vv", "123@456vv.com" },
96 {"", L
"", L
"庄泓川", "kidneybean@sohu.com" },
97 {NULL
, NULL
, NULL
, NULL
}
106 g_lamexp_specialThanks
[] =
108 { "Doom9's Forum", "http://forum.doom9.org/" },
109 { "Gleitz | German Doom9", "http://forum.gleitz.info/" },
110 { "Hydrogenaudio Forums", "http://www.hydrogenaudio.org/" },
111 { "RareWares", "http://www.rarewares.org/" },
112 { "GitHub", "http://github.com/" },
113 { "SourceForge", "http://sourceforge.net/" },
114 { "Qt Developer Network", "http://qt-project.org/" },
115 { "CodePlex", "http://www.codeplex.com/" },
116 { "Marius Hudea", "http://savedonthe.net/" },
117 { "Codecs.com", "http://www.codecs.com/" },
129 { "GitHub.com", "https://github.com/lordmulder/LameXP" },
130 { "SourceForge.net", "http://sourceforge.net/p/lamexp/code/" },
131 { "Bitbucket.org", "https://bitbucket.org/lord_mulder/lamexp" },
132 { "GitLab.com" , "https://gitlab.com/lamexp/lamexp" },
133 { "Codeplex.com", "https://lamexp.codeplex.com/SourceControl/latest" },
134 { "Assembla.com", "https://www.assembla.com/spaces/lamexp/" },
138 ////////////////////////////////////////////////////////////
140 ////////////////////////////////////////////////////////////
142 AboutDialog::AboutDialog(SettingsModel
*settings
, QWidget
*parent
, bool firstStart
)
145 ui(new Ui::AboutDialog
),
146 m_settings(settings
),
147 m_initFlags(new QMap
<QWidget
*,bool>),
153 //Init the dialog, from the .ui file
155 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint
));
156 resize(this->minimumSize());
161 MUtils::GUI::enable_close_button(this, false);
165 for(int i
= 0; i
< 4; i
++)
171 connect(ui
->tabWidget
, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
174 const type_info
&styleType
= typeid(*qApp
->style());
175 if((typeid(QWindowsVistaStyle
) == styleType
) || (typeid(QWindowsXPStyle
) == styleType
))
177 MAKE_TRANSPARENT(ui
->infoScrollArea
);
178 MAKE_TRANSPARENT(ui
->contributorsScrollArea
);
179 MAKE_TRANSPARENT(ui
->softwareScrollArea
);
180 MAKE_TRANSPARENT(ui
->licenseScrollArea
);
183 //Show about dialog for the first time?
188 ui
->acceptButton
->hide();
189 ui
->declineButton
->hide();
190 ui
->aboutQtButton
->show();
191 ui
->closeButton
->show();
193 QPixmap
disque(":/images/Disque.png");
194 m_disque
= new QLabel(this, Qt::Window
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint
);
195 m_disque
->resize(disque
.size());
196 m_disque
->setStyleSheet("background:transparent;");
197 m_disque
->setAttribute(Qt::WA_TranslucentBackground
);
198 m_disque
->setPixmap(disque
);
199 m_disque
->installEventFilter(this);
201 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(geometryUpdated()));
204 m_discOpacity
= 0.01;
205 m_disquePos
.setX(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound
.right() - disque
.width() - m_disqueBound
.left())) + m_disqueBound
.left());
206 m_disquePos
.setY(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound
.bottom() - disque
.height() - m_disqueBound
.top())) + m_disqueBound
.top());
207 m_disqueFlags
[0] = (MUtils::next_rand32() > (UINT_MAX
/2));
208 m_disqueFlags
[1] = (MUtils::next_rand32() > (UINT_MAX
/2));
209 m_disque
->move(m_disquePos
);
210 m_disque
->setWindowOpacity(m_discOpacity
);
213 m_disqueTimer
= new QTimer
;
214 connect(m_disqueTimer
, SIGNAL(timeout()), this, SLOT(moveDisque()));
215 m_disqueTimer
->start(10);
217 connect(ui
->aboutQtButton
, SIGNAL(clicked()), this, SLOT(showAboutQt()));
221 ui
->acceptButton
->show();
222 ui
->declineButton
->show();
223 ui
->aboutQtButton
->hide();
224 ui
->closeButton
->hide();
227 //Activate "show license" button
228 ui
->showLicenseButton
->show();
229 connect(ui
->showLicenseButton
, SIGNAL(clicked()), this, SLOT(gotoLicenseTab()));
231 m_firstShow
= firstStart
;
234 AboutDialog::~AboutDialog(void)
239 MUTILS_DELETE(m_disque
);
243 m_disqueTimer
->stop();
244 MUTILS_DELETE(m_disqueTimer
);
246 for(int i
= 0; i
< 4; i
++)
248 MUTILS_DELETE(m_cartoon
[i
]);
250 MUTILS_DELETE(m_initFlags
);
254 ////////////////////////////////////////////////////////////
256 ////////////////////////////////////////////////////////////
258 int AboutDialog::exec()
260 if(m_settings
->soundsEnabled())
264 if(!MUtils::Sound::play_sound_file("imageres.dll", 5080, true))
266 MUtils::Sound::play_system_sound("SystemStart", true);
271 MUtils::Sound::play_sound("uuaarrgh", true);
275 switch(QDialog::exec())
289 ////////////////////////////////////////////////////////////
291 ////////////////////////////////////////////////////////////
293 #define TEMP_HIDE_DISQUE(CMD) do \
295 bool _tmp = (m_disque) ? m_disque->isVisible() : false; \
296 if(_tmp) m_disque->hide(); \
300 m_discOpacity = 0.01; \
301 m_disque->setWindowOpacity(m_discOpacity); \
307 void AboutDialog::tabChanged(int index
, const bool silent
)
309 bool bInitialized
= m_initFlags
->value(ui
->tabWidget
->widget(index
), false);
313 qApp
->setOverrideCursor(QCursor(Qt::WaitCursor
));
315 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
319 if(tab
== ui
->infoTab
) { initInformationTab(); ok
= true; }
320 if(tab
== ui
->contributorsTab
) { initContributorsTab(); ok
= true; }
321 if(tab
== ui
->softwareTab
) { initSoftwareTab(); ok
= true; }
322 if(tab
== ui
->licenseTab
) { initLicenseTab(); ok
= true; }
326 m_initFlags
->insert(tab
, true);
330 qWarning("Unknown tab %p encountered, cannot initialize !!!", tab
);
335 ui
->tabWidget
->widget(index
)->update();
336 qApp
->processEvents();
337 qApp
->restoreOverrideCursor();
341 if(m_settings
->soundsEnabled() && (!silent
))
343 MUtils::Sound::play_sound("tick", true);
347 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
349 if(tab
== ui
->infoTab
) ui
->infoScrollArea
->verticalScrollBar()->setSliderPosition(0);
350 if(tab
== ui
->contributorsTab
) ui
->contributorsScrollArea
->verticalScrollBar()->setSliderPosition(0);
351 if(tab
== ui
->softwareTab
) ui
->softwareScrollArea
->verticalScrollBar()->setSliderPosition(0);
352 if(tab
== ui
->licenseTab
) ui
->licenseScrollArea
->verticalScrollBar()->setSliderPosition(0);
355 //Update license button
356 ui
->showLicenseButton
->setChecked(ui
->tabWidget
->widget(index
) == ui
->licenseTab
);
357 if(ui
->tabWidget
->widget(index
) != ui
->licenseTab
) m_lastTab
= index
;
360 void AboutDialog::enableButtons(void)
362 ui
->acceptButton
->setEnabled(true);
363 ui
->declineButton
->setEnabled(true);
364 setCursor(QCursor(Qt::ArrowCursor
));
367 void AboutDialog::openURL(const QString
&url
)
369 if(!QDesktopServices::openUrl(QUrl(url
)))
371 MUtils::OS::shell_open(this, url
);
375 void AboutDialog::showAboutQt(void)
379 QMessageBox::aboutQt(this);
383 void AboutDialog::gotoLicenseTab(void)
385 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->showLicenseButton
->isChecked() ? ui
->licenseTab
: ui
->tabWidget
->widget(m_lastTab
)));
388 void AboutDialog::moveDisque(void)
391 QElapsedTimer elapsedTimer
;
392 elapsedTimer
.start();
394 if((!m_disqueDelay
.isNull()) && m_disqueDelay
->isValid())
396 const qint64 delay
= m_disqueDelay
->restart();
397 delta
= qBound(1, static_cast<int>(ceil(static_cast<double>(delay
) / 5.12)), 128);
401 m_disqueDelay
.reset(new QElapsedTimer());
402 m_disqueDelay
->start();
407 if(m_disquePos
.x() <= m_disqueBound
.left()) { m_disqueFlags
[0] = true; m_rotateNext
= true; }
408 if(m_disquePos
.x() >= m_disqueBound
.right()) { m_disqueFlags
[0] = false; m_rotateNext
= true; }
409 if(m_disquePos
.y() <= m_disqueBound
.top()) { m_disqueFlags
[1] = true; m_rotateNext
= true; }
410 if(m_disquePos
.y() >= m_disqueBound
.bottom()) { m_disqueFlags
[1] = false; m_rotateNext
= true; }
412 m_disquePos
.setX(m_disqueFlags
[0] ? (m_disquePos
.x() + delta
) : (m_disquePos
.x() - delta
));
413 m_disquePos
.setY(m_disqueFlags
[1] ? (m_disquePos
.y() + delta
) : (m_disquePos
.y() - delta
));
415 m_disque
->move(m_disquePos
);
419 QPixmap
*cartoon
= NULL
;
420 if(m_disqueFlags
[0] == true && m_disqueFlags
[1] != true) cartoon
= m_cartoon
[0];
421 if(m_disqueFlags
[0] == true && m_disqueFlags
[1] == true) cartoon
= m_cartoon
[1];
422 if(m_disqueFlags
[0] != true && m_disqueFlags
[1] == true) cartoon
= m_cartoon
[2];
423 if(m_disqueFlags
[0] != true && m_disqueFlags
[1] != true) cartoon
= m_cartoon
[3];
426 m_disque
->setPixmap(*cartoon
);
427 if(m_disque
->size() != cartoon
->size())
429 m_disque
->resize(cartoon
->size());
433 m_rotateNext
= false;
436 if(m_discOpacity
!= 1.0)
438 m_discOpacity
= m_discOpacity
+ 0.01;
439 if(qFuzzyCompare(m_discOpacity
, 1.0) || (m_discOpacity
> 1.0))
443 m_disque
->setWindowOpacity(m_discOpacity
);
449 void AboutDialog::geometryUpdated(void)
453 QRect screenGeometry
= QApplication::desktop()->availableGeometry();
454 m_disqueBound
.setLeft(screenGeometry
.left());
455 m_disqueBound
.setRight(screenGeometry
.width() - m_disque
->width() + screenGeometry
.left());
456 m_disqueBound
.setTop(screenGeometry
.top());
457 m_disqueBound
.setBottom(screenGeometry
.height() - m_disque
->height() + screenGeometry
.top());
461 m_disqueBound
= QApplication::desktop()->availableGeometry();
465 void AboutDialog::adjustSize(void)
467 const int maxH
= QApplication::desktop()->availableGeometry().height();
468 const int maxW
= QApplication::desktop()->availableGeometry().width();
470 const int deltaH
= ui
->infoScrollArea
->widget()->height() - ui
->infoScrollArea
->viewport()->height();
471 const int deltaW
= ui
->infoScrollArea
->widget()->width() - ui
->infoScrollArea
->viewport()->width();
475 this->resize(this->width(), qMin(this->height() + deltaH
, maxH
));
476 this->move(this->x(), this->y() - (deltaH
/ 2));
477 this->setMinimumHeight(qMax(this->minimumHeight(), this->height()));
482 this->resize(qMin(this->width() + deltaW
, maxW
), this->height());
483 this->move(this->x() - (deltaW
/ 2), this->y());
484 this->setMinimumWidth(qMax(this->minimumWidth(), this->width()));
488 ////////////////////////////////////////////////////////////
489 // Protected Functions
490 ////////////////////////////////////////////////////////////
492 void AboutDialog::showEvent(QShowEvent
*e
)
494 QDialog::showEvent(e
);
496 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->infoTab
));
497 tabChanged(m_lastTab
= ui
->tabWidget
->currentIndex(), true);
501 ui
->acceptButton
->setEnabled(false);
502 ui
->declineButton
->setEnabled(false);
503 QTimer::singleShot(5000, this, SLOT(enableButtons()));
504 setCursor(QCursor(Qt::WaitCursor
));
507 QTimer::singleShot(0, this, SLOT(adjustSize()));
510 void AboutDialog::closeEvent(QCloseEvent
*e
)
512 if(m_firstShow
) e
->ignore();
515 bool AboutDialog::eventFilter(QObject
*obj
, QEvent
*event
)
517 if((obj
== m_disque
) && (event
->type() == QEvent::MouseButtonPress
))
519 QPixmap
cartoon(":/images/Cartoon.png");
520 for(int i
= 0; i
< 4; i
++)
524 m_cartoon
[i
] = new QPixmap(cartoon
.transformed(QMatrix().rotate(static_cast<double>(i
*90) + 45.0), Qt::SmoothTransformation
));
528 QDesktopServices::openUrl(QUrl(disqueUrl
));
534 ////////////////////////////////////////////////////////////
536 ////////////////////////////////////////////////////////////
538 void AboutDialog::initInformationTab(void)
540 const QDate versionDate
= MUtils::Version::app_build_date();
542 const QString versionStr
= QString().sprintf
544 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
545 lamexp_version_major(),
546 lamexp_version_minor(),
547 lamexp_version_release(),
548 lamexp_version_build(),
549 versionDate
.toString(Qt::ISODate
).toLatin1().constData(),
550 MUtils::Version::compiler_version(),
551 MUtils::Version::compiler_arch(),
555 const QString copyrightStr
= QString().sprintf
557 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
558 qMax(versionDate
.year(), MUtils::OS::current_date().year())
563 aboutText
+= QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
564 aboutText
+= QString("<b>%1</b><br>").arg(NOBR(copyrightStr
));
565 aboutText
+= QString("<b>%1</b><br><br>").arg(NOBR(versionStr
));
566 aboutText
+= QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
568 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
569 const QDate currentDate
= MUtils::OS::current_date();
572 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
573 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
))));
575 else if(lamexp_version_demo())
577 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
578 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
))));
581 const QDate currentDate
= lamexp_current_date_safe();
584 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
585 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
))));
587 else if(lamexp_version_demo())
589 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
590 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
))));
594 aboutText
+= "<hr><br>";
596 aboutText
+= "<nobr><tt>This program is free software; you can redistribute it and/or modify<br>";
597 aboutText
+= "it under the terms of the GNU General Public License as published by<br>";
598 aboutText
+= "the Free Software Foundation; either version 2 of the License, or<br>";
599 aboutText
+= "(at your option) any later version, but always including the *additional*<br>";
600 aboutText
+= "restrictions defined in the \"License.txt\" file (see \"License\" tab).<br><br>";
601 aboutText
+= "This program is distributed in the hope that it will be useful,<br>";
602 aboutText
+= "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
603 aboutText
+= "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
604 aboutText
+= "GNU General Public License for more details.<br><br>";
605 aboutText
+= "You should have received a copy of the GNU General Public License<br>";
606 aboutText
+= "along with this program; if not, write to the Free Software<br>";
607 aboutText
+= "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
608 aboutText
+= "<hr><table style=\"margin-top:4px\"><tr>";
609 aboutText
+= "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
610 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 !!!"));
611 aboutText
+= "</tr></table>";
613 ui
->infoLabel
->setText(aboutText
);
614 ui
->infoIcon
->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
615 connect(ui
->infoLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
618 void AboutDialog::initContributorsTab(void)
620 const QString
spaces(" ");
621 const QString
extraVSpace("<font style=\"font-size:7px\"><br> </font>");
623 QString contributorsAboutText
;
624 contributorsAboutText
+= QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
625 contributorsAboutText
+= "<table style=\"margin-top:12px;white-space:nowrap\">";
627 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraVSpace
);
628 QString icon
= QString("<img src=\":/icons/%1.png\">").arg("user_gray");
629 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon
, spaces
);
630 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces
);
631 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");
632 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
634 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace
);
635 for(int i
= 0; g_lamexp_translators
[i
].pcName
; i
++)
637 QString flagIcon
= (strlen(g_lamexp_translators
[i
].pcFlag
) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators
[i
].pcFlag
) : QString();
638 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon
, spaces
);
639 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(MUTILS_QSTR(g_lamexp_translators
[i
].pcLanguage
), spaces
);
640 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
);
643 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
644 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Special thanks to:"), extraVSpace
);
646 QString webIcon
= QString("<img src=\":/icons/%1.png\">").arg("world");
647 for(int i
= 0; g_lamexp_specialThanks
[i
].pcName
; i
++)
649 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon
, spaces
);
650 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
));
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("Official Mirrors:"), extraVSpace
);
656 QString serverIcon
= QString("<img src=\":/icons/%1.png\">").arg("server_database");
657 for(int i
= 0; g_lamexp_mirrors
[i
].pcName
; i
++)
659 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(serverIcon
, 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_mirrors
[i
].pcName
), spaces
, QString::fromLatin1(g_lamexp_mirrors
[i
].pcAddress
));
663 contributorsAboutText
+= "</table><br><br><br>";
664 contributorsAboutText
+= QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
666 ui
->contributorsLabel
->setText(contributorsAboutText
);
667 ui
->contributorsIcon
->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
668 connect(ui
->contributorsLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
671 void AboutDialog::initSoftwareTab(void)
673 QString moreAboutText
;
675 moreAboutText
+= QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
676 moreAboutText
+= "<div style=\"margin-left:-25px;white-space:nowrap\"><table><tr><td><ul>"; //;font-size:7pt
678 moreAboutText
+= makeToolText
680 tr("LAME - OpenSource mp3 Encoder"),
681 "lame.exe", "v?.??, #-?",
682 tr("Released under the terms of the GNU Lesser General Public License."),
683 "http://lame.sourceforge.net/"
685 moreAboutText
+= makeToolText
687 tr("OggEnc - Vorbis Encoder"),
688 "oggenc2.exe", "v?.??, libvorbis v?.?? + aoTuV b?.??_#",
689 tr("Completely open and patent-free audio encoding technology."),
690 "http://www.rarewares.org/ogg-oggenc.php"
692 moreAboutText
+= makeToolText
694 tr("Nero AAC Reference MPEG-4 Encoder"),
695 "neroAacEnc.exe", "v?.?.?.?",
696 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
698 tr("Available from vendor web-site as free download:")
700 moreAboutText
+= makeToolText
702 tr("Aften - A/52 audio encoder"),
703 "aften.exe", "v?.?.?",
704 tr("Released under the terms of the GNU Lesser General Public License."),
705 "http://aften.sourceforge.net/"
707 moreAboutText
+= makeToolText
709 tr("FLAC - Free Lossless Audio Codec"),
710 "flac.exe", "v?.?.?",
711 tr("Open and patent-free lossless audio compression technology."),
712 "http://flac.sourceforge.net/"
714 moreAboutText
+= makeToolText
716 tr("Opus Audio Codec"),
717 "opusenc.exe", "#, ????-??-??",
718 tr("Totally open, royalty-free, highly versatile audio codec."),
719 "http://www.opus-codec.org/"
721 moreAboutText
+= makeToolText
723 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
724 "mpg123.exe", "v?.??.?",
725 tr("Released under the terms of the GNU Lesser General Public License."),
726 "http://www.mpg123.de/"
728 moreAboutText
+= makeToolText
730 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
732 tr("Released under the terms of the GNU General Public License."),
733 "http://www.audiocoding.com/"
735 moreAboutText
+= makeToolText
737 tr("OggDec - Vorbis Decoder"),
738 "oggdec.exe", "v?.??.?",
739 tr("Command line Ogg Vorbis decoder created by John33."),
740 "http://www.rarewares.org/ogg-oggdec.php"
742 moreAboutText
+= makeToolText
744 tr("Valdec from AC3Filter Tools - AC3/DTS Decoder"),
745 "valdec.exe", "v?.??#",
746 tr("Released under the terms of the GNU Lesser General Public License."),
747 "http://www.ac3filter.net/projects/tools"
749 moreAboutText
+= makeToolText
751 tr("WavPack - Hybrid Lossless Compression"),
752 "wvunpack.exe", "v?.??.?",
753 tr("Completely open audio compression format."),
754 "http://www.wavpack.com/"
756 moreAboutText
+= makeToolText
758 tr("Musepack - Living Audio Compression"),
759 "mpcdec.exe", "r???",
760 tr("Released under the terms of the GNU Lesser General Public License."),
761 "http://www.musepack.net/"
763 moreAboutText
+= makeToolText
765 tr("Monkey's Audio - Lossless Audio Compressor"),
767 tr("Freely available source code, simple SDK and non-restrictive licensing."),
768 "http://www.monkeysaudio.com/"
770 moreAboutText
+= makeToolText
772 tr("Shorten - Lossless Audio Compressor"),
773 "shorten.exe", "v?.?.?",
774 tr("Released under the terms of the GNU Lesser General Public License."),
775 "http://etree.org/shnutils/shorten/"
777 moreAboutText
+= makeToolText
779 tr("Speex - Free Codec For Free Speech"),
780 "speexdec.exe", "v?.?",
781 tr("Open Source patent-free audio format designed for speech."),
782 "http://www.speex.org/"
784 moreAboutText
+= makeToolText
786 tr("The True Audio - Lossless Audio Codec"),
788 tr("Released under the terms of the GNU Lesser General Public License."),
789 "http://tta.sourceforge.net/"
791 moreAboutText
+= makeToolText
793 tr("refalac - Win32 command line ALAC encoder/decoder"),
794 "refalac.exe", "v?.??",
795 tr("The ALAC reference implementation by Apple is available under the Apache license."),
796 "http://alac.macosforge.org/"
798 moreAboutText
+= makeToolText
800 tr("wma2wav - Dump WMA files to Wave Audio"),
801 "wma2wav.exe", "????-??-??",
802 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
803 "http://forum.doom9.org/showthread.php?t=140273"
805 moreAboutText
+= makeToolText
807 tr("avs2wav - Avisynth to Wave Audio converter"),
808 "avs2wav.exe", "v?.?",
809 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
810 "http://forum.doom9.org/showthread.php?t=70882"
812 moreAboutText
+= makeToolText
815 "dcaenc.exe", "????-??-??",
816 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
817 "https://gitlab.com/patrakov/dcaenc"
819 moreAboutText
+= makeToolText
821 tr("MediaInfo - Media File Analysis Tool"),
822 "mediainfo.exe", "v?.?.??",
823 tr("Released under the terms of the GNU Lesser General Public License."),
824 "http://mediainfo.sourceforge.net/"
826 moreAboutText
+= makeToolText
828 tr("SoX - Sound eXchange"),
829 "sox.exe", "v??.?.?",
830 tr("Released under the terms of the GNU Lesser General Public License."),
831 "http://sox.sourceforge.net/"
833 moreAboutText
+= makeToolText
835 tr("GnuPG - The GNU Privacy Guard"),
836 "gpgv.exe", "v?.?.??",
837 tr("Released under the terms of the GNU Lesser General Public License."),
838 "http://www.gnupg.org/"
840 moreAboutText
+= makeToolText
842 tr("GNU Wget - Software for retrieving files using HTTP"),
843 "wget.exe", "v?.??.?",
844 tr("Released under the terms of the GNU Lesser General Public License."),
845 "http://www.gnu.org/software/wget/"
847 moreAboutText
+= makeToolText
849 tr("UPX - The Ultimate Packer for eXecutables"),
851 tr("Released under the terms of the GNU Lesser General Public License."),
852 "http://upx.sourceforge.net/"
854 moreAboutText
+= makeToolText
856 tr("Silk Icons - Over 700 icons in PNG format"),
858 tr("By Mark James, released under the Creative Commons 'by' License."),
859 "http://www.famfamfam.com/lab/icons/silk/"
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>");