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 "../tmp/UIC_AboutDialog.h"
28 #include "Model_Settings.h"
33 #include <QApplication>
35 #include <QPushButton>
36 #include <QDesktopServices>
41 #include <QDesktopWidget>
43 #include <QMessageBox>
44 #include <QTextStream>
46 #include <QCloseEvent>
47 #include <QWindowsVistaStyle>
48 #include <QWindowsXPStyle>
51 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
52 #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)
53 #define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
56 const char *AboutDialog::neroAacUrl
= "http://www.videohelp.com/tools/Nero-AAC-Codec"; //"http://www.nero.com/eng/company/about-nero/nero-aac-codec.php";
57 const char *AboutDialog::disqueUrl
= "http://muldersoft.com/?player_url=38X-MXOB014";
67 g_lamexp_translators
[] =
69 {"en", L
"Englisch", L
"LoRd_MuldeR", "MuldeR2@GMX.de" },
70 {"de", L
"Deutsch", L
"LoRd_MuldeR", "MuldeR2@GMX.de" },
71 {"", L
"", L
"Bodo Thevissen", "Bodo@thevissen.de" },
72 {"es", L
"Español", L
"Rub3nCT", "Rub3nCT@gmail.com" },
73 {"fr", L
"Française", L
"Dodich Informatique", "Dodich@live.fr" },
74 {"it", L
"Italiano", L
"Roberto", "Gulliver_69@libero.it" },
75 {"kr", L
"한국어", L
"JaeHyung Lee", "Kolanp@gmail.com" },
76 {"pl", L
"Polski", L
"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
77 {"ru", L
"Русский", L
"Neonailol", "Neonailol@gmail.com" },
78 {"", L
"", L
"Иван Митин", "bardak@inbox.ru" },
79 {"sv", L
"Svenska", L
"Åke Engelbrektson", "eson57@gmail.com" },
80 {"tw", L
"繁体中文", L
"456Vv", "123@456vv.com" },
81 {"uk", L
"Українська", L
"Arestarh", "Arestarh@ukr.net" },
82 {"zh", L
"简体中文", L
"456Vv", "123@456vv.com" },
83 {"", L
"", L
"庄泓川", "kidneybean@sohu.com" },
84 {NULL
, NULL
, NULL
, NULL
}
93 g_lamexp_specialThanks
[] =
95 { "Doom9's Forum", "http://forum.doom9.org/" },
96 { "Gleitz | German Doom9", "http://forum.gleitz.info/" },
97 { "Hydrogenaudio Forums", "http://www.hydrogenaudio.org/" },
98 { "RareWares", "http://www.rarewares.org/" },
99 { "GitHub", "http://github.com/" },
100 { "SourceForge", "http://sourceforge.net/" },
101 { "Qt Developer Network", "http://qt-project.org/" },
102 { "BerliOS Developer", "http://developer.berlios.de/" },
103 { "CodePlex", "http://www.codeplex.com/" },
104 { "Marius Hudea", "http://savedonthe.net/" },
105 { "Codecs.com", "http://www.codecs.com/" },
117 { "GitHub.com", "https://github.com/lordmulder/LameXP" },
118 { "SourceForge.net", "http://sourceforge.net/p/lamexp/code/" },
119 { "Bitbucket.org", "https://bitbucket.org/lord_mulder/lamexp" },
120 { "Gitorious.org", "https://gitorious.org/lamexp" },
121 { "Codeplex.com", "https://lamexp.codeplex.com/SourceControl/latest" },
122 { "Berlios.de", "http://git.berlios.de/cgi-bin/gitweb.cgi?p=lamexp" },
123 { "Assembla.com", "https://www.assembla.com/spaces/lamexp/" },
127 ////////////////////////////////////////////////////////////
129 ////////////////////////////////////////////////////////////
131 AboutDialog::AboutDialog(SettingsModel
*settings
, QWidget
*parent
, bool firstStart
)
134 ui(new Ui::AboutDialog
),
135 m_settings(settings
),
136 m_initFlags(new QMap
<QWidget
*,bool>),
140 m_disqueDelay(_I64_MAX
),
143 //Init the dialog, from the .ui file
145 setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint
));
146 resize(this->minimumSize());
151 lamexp_enable_close_button(this, false);
155 for(int i
= 0; i
< 4; i
++)
161 connect(ui
->tabWidget
, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
164 const type_info
&styleType
= typeid(*qApp
->style());
165 if((typeid(QWindowsVistaStyle
) == styleType
) || (typeid(QWindowsXPStyle
) == styleType
))
167 MAKE_TRANSPARENT(ui
->infoScrollArea
);
168 MAKE_TRANSPARENT(ui
->contributorsScrollArea
);
169 MAKE_TRANSPARENT(ui
->softwareScrollArea
);
170 MAKE_TRANSPARENT(ui
->licenseScrollArea
);
173 //Show about dialog for the first time?
178 ui
->acceptButton
->hide();
179 ui
->declineButton
->hide();
180 ui
->aboutQtButton
->show();
181 ui
->closeButton
->show();
183 QPixmap
disque(":/images/Disque.png");
184 m_disque
= new QLabel(this, Qt::Window
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint
);
185 m_disque
->resize(disque
.size());
186 m_disque
->setStyleSheet("background:transparent;");
187 m_disque
->setAttribute(Qt::WA_TranslucentBackground
);
188 m_disque
->setPixmap(disque
);
189 m_disque
->installEventFilter(this);
191 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(geometryUpdated()));
194 m_discOpacity
= 0.01;
195 m_disquePos
.setX(static_cast<int>(lamexp_rand() % static_cast<unsigned int>(m_disqueBound
.right() - disque
.width() - m_disqueBound
.left())) + m_disqueBound
.left());
196 m_disquePos
.setY(static_cast<int>(lamexp_rand() % static_cast<unsigned int>(m_disqueBound
.bottom() - disque
.height() - m_disqueBound
.top())) + m_disqueBound
.top());
197 m_disqueFlags
[0] = (lamexp_rand() > (UINT_MAX
/2));
198 m_disqueFlags
[1] = (lamexp_rand() > (UINT_MAX
/2));
199 m_disque
->move(m_disquePos
);
200 m_disque
->setWindowOpacity(m_discOpacity
);
203 m_disqueTimer
= new QTimer
;
204 connect(m_disqueTimer
, SIGNAL(timeout()), this, SLOT(moveDisque()));
205 m_disqueTimer
->start(10);
207 connect(ui
->aboutQtButton
, SIGNAL(clicked()), this, SLOT(showAboutQt()));
211 ui
->acceptButton
->show();
212 ui
->declineButton
->show();
213 ui
->aboutQtButton
->hide();
214 ui
->closeButton
->hide();
217 //Activate "show license" button
218 ui
->showLicenseButton
->show();
219 connect(ui
->showLicenseButton
, SIGNAL(clicked()), this, SLOT(gotoLicenseTab()));
221 m_firstShow
= firstStart
;
224 AboutDialog::~AboutDialog(void)
229 LAMEXP_DELETE(m_disque
);
233 m_disqueTimer
->stop();
234 LAMEXP_DELETE(m_disqueTimer
);
236 for(int i
= 0; i
< 4; i
++)
238 LAMEXP_DELETE(m_cartoon
[i
]);
240 LAMEXP_DELETE(m_initFlags
);
244 ////////////////////////////////////////////////////////////
246 ////////////////////////////////////////////////////////////
248 int AboutDialog::exec()
250 if(m_settings
->soundsEnabled())
254 if(!lamexp_play_sound_file("imageres.dll", 5080, true))
256 lamexp_play_sound_alias("SystemStart", true);
261 lamexp_play_sound("uuaarrgh", true);
265 switch(QDialog::exec())
279 ////////////////////////////////////////////////////////////
281 ////////////////////////////////////////////////////////////
283 #define TEMP_HIDE_DISQUE(CMD) do \
285 bool _tmp = (m_disque) ? m_disque->isVisible() : false; \
286 if(_tmp) m_disque->hide(); \
290 m_discOpacity = 0.01; \
291 m_disque->setWindowOpacity(m_discOpacity); \
297 void AboutDialog::tabChanged(int index
, const bool silent
)
299 bool bInitialized
= m_initFlags
->value(ui
->tabWidget
->widget(index
), false);
303 qApp
->setOverrideCursor(QCursor(Qt::WaitCursor
));
305 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
309 if(tab
== ui
->infoTab
) { initInformationTab(); ok
= true; }
310 if(tab
== ui
->contributorsTab
) { initContributorsTab(); ok
= true; }
311 if(tab
== ui
->softwareTab
) { initSoftwareTab(); ok
= true; }
312 if(tab
== ui
->licenseTab
) { initLicenseTab(); ok
= true; }
316 m_initFlags
->insert(tab
, true);
320 qWarning("Unknown tab %p encountered, cannot initialize !!!", tab
);
325 ui
->tabWidget
->widget(index
)->update();
326 qApp
->processEvents();
327 qApp
->restoreOverrideCursor();
331 if(m_settings
->soundsEnabled() && (!silent
))
333 lamexp_play_sound("tick", true);
337 if(QWidget
*tab
= ui
->tabWidget
->widget(index
))
339 if(tab
== ui
->infoTab
) ui
->infoScrollArea
->verticalScrollBar()->setSliderPosition(0);
340 if(tab
== ui
->contributorsTab
) ui
->contributorsScrollArea
->verticalScrollBar()->setSliderPosition(0);
341 if(tab
== ui
->softwareTab
) ui
->softwareScrollArea
->verticalScrollBar()->setSliderPosition(0);
342 if(tab
== ui
->licenseTab
) ui
->licenseScrollArea
->verticalScrollBar()->setSliderPosition(0);
345 //Update license button
346 ui
->showLicenseButton
->setChecked(ui
->tabWidget
->widget(index
) == ui
->licenseTab
);
347 if(ui
->tabWidget
->widget(index
) != ui
->licenseTab
) m_lastTab
= index
;
350 void AboutDialog::enableButtons(void)
352 ui
->acceptButton
->setEnabled(true);
353 ui
->declineButton
->setEnabled(true);
354 setCursor(QCursor(Qt::ArrowCursor
));
357 void AboutDialog::openURL(const QString
&url
)
359 if(!QDesktopServices::openUrl(QUrl(url
)))
361 lamexp_exec_shell(this, url
);
365 void AboutDialog::showAboutQt(void)
369 QMessageBox::aboutQt(this);
373 void AboutDialog::gotoLicenseTab(void)
375 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->showLicenseButton
->isChecked() ? ui
->licenseTab
: ui
->tabWidget
->widget(m_lastTab
)));
378 void AboutDialog::moveDisque(void)
381 const __int64 perfFrequ
= lamexp_perfcounter_frequ();
382 const __int64 perfCount
= lamexp_perfcounter_value();
384 if((perfFrequ
>= 0) && (perfCount
>= 0))
386 if(m_disqueDelay
!= _I64_MAX
)
388 const double delay
= static_cast<double>(perfCount
) - static_cast<double>(m_disqueDelay
);
389 delta
= qMax(1, qMin(128, static_cast<int>(ceil(delay
/ static_cast<double>(perfFrequ
) / 0.00512))));
391 m_disqueDelay
= perfCount
;
396 if(m_disquePos
.x() <= m_disqueBound
.left()) { m_disqueFlags
[0] = true; m_rotateNext
= true; }
397 if(m_disquePos
.x() >= m_disqueBound
.right()) { m_disqueFlags
[0] = false; m_rotateNext
= true; }
398 if(m_disquePos
.y() <= m_disqueBound
.top()) { m_disqueFlags
[1] = true; m_rotateNext
= true; }
399 if(m_disquePos
.y() >= m_disqueBound
.bottom()) { m_disqueFlags
[1] = false; m_rotateNext
= true; }
401 m_disquePos
.setX(m_disqueFlags
[0] ? (m_disquePos
.x() + delta
) : (m_disquePos
.x() - delta
));
402 m_disquePos
.setY(m_disqueFlags
[1] ? (m_disquePos
.y() + delta
) : (m_disquePos
.y() - delta
));
404 m_disque
->move(m_disquePos
);
408 QPixmap
*cartoon
= NULL
;
409 if(m_disqueFlags
[0] == true && m_disqueFlags
[1] != true) cartoon
= m_cartoon
[0];
410 if(m_disqueFlags
[0] == true && m_disqueFlags
[1] == true) cartoon
= m_cartoon
[1];
411 if(m_disqueFlags
[0] != true && m_disqueFlags
[1] == true) cartoon
= m_cartoon
[2];
412 if(m_disqueFlags
[0] != true && m_disqueFlags
[1] != true) cartoon
= m_cartoon
[3];
415 m_disque
->setPixmap(*cartoon
);
416 if(m_disque
->size() != cartoon
->size())
418 m_disque
->resize(cartoon
->size());
422 m_rotateNext
= false;
425 if(m_discOpacity
!= 1.0)
427 m_discOpacity
= m_discOpacity
+ 0.01;
428 if(qFuzzyCompare(m_discOpacity
, 1.0) || (m_discOpacity
> 1.0))
432 m_disque
->setWindowOpacity(m_discOpacity
);
438 void AboutDialog::geometryUpdated(void)
442 QRect screenGeometry
= QApplication::desktop()->availableGeometry();
443 m_disqueBound
.setLeft(screenGeometry
.left());
444 m_disqueBound
.setRight(screenGeometry
.width() - m_disque
->width() + screenGeometry
.left());
445 m_disqueBound
.setTop(screenGeometry
.top());
446 m_disqueBound
.setBottom(screenGeometry
.height() - m_disque
->height() + screenGeometry
.top());
450 m_disqueBound
= QApplication::desktop()->availableGeometry();
454 void AboutDialog::adjustSize(void)
456 const int maxH
= QApplication::desktop()->availableGeometry().height();
457 const int maxW
= QApplication::desktop()->availableGeometry().width();
459 const int deltaH
= ui
->infoScrollArea
->widget()->height() - ui
->infoScrollArea
->viewport()->height();
460 const int deltaW
= ui
->infoScrollArea
->widget()->width() - ui
->infoScrollArea
->viewport()->width();
464 this->resize(this->width(), qMin(this->height() + deltaH
, maxH
));
465 this->move(this->x(), this->y() - (deltaH
/ 2));
466 this->setMinimumHeight(qMax(this->minimumHeight(), this->height()));
471 this->resize(qMin(this->width() + deltaW
, maxW
), this->height());
472 this->move(this->x() - (deltaW
/ 2), this->y());
473 this->setMinimumWidth(qMax(this->minimumWidth(), this->width()));
477 ////////////////////////////////////////////////////////////
478 // Protected Functions
479 ////////////////////////////////////////////////////////////
481 void AboutDialog::showEvent(QShowEvent
*e
)
483 QDialog::showEvent(e
);
485 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->infoTab
));
486 tabChanged(m_lastTab
= ui
->tabWidget
->currentIndex(), true);
490 ui
->acceptButton
->setEnabled(false);
491 ui
->declineButton
->setEnabled(false);
492 QTimer::singleShot(5000, this, SLOT(enableButtons()));
493 setCursor(QCursor(Qt::WaitCursor
));
496 QTimer::singleShot(0, this, SLOT(adjustSize()));
499 void AboutDialog::closeEvent(QCloseEvent
*e
)
501 if(m_firstShow
) e
->ignore();
504 bool AboutDialog::eventFilter(QObject
*obj
, QEvent
*event
)
506 if((obj
== m_disque
) && (event
->type() == QEvent::MouseButtonPress
))
508 QPixmap
cartoon(":/images/Cartoon.png");
509 for(int i
= 0; i
< 4; i
++)
513 m_cartoon
[i
] = new QPixmap(cartoon
.transformed(QMatrix().rotate(static_cast<double>(i
*90) + 45.0), Qt::SmoothTransformation
));
517 QDesktopServices::openUrl(QUrl(disqueUrl
));
523 ////////////////////////////////////////////////////////////
525 ////////////////////////////////////////////////////////////
527 void AboutDialog::initInformationTab(void)
529 const QString versionStr
= QString().sprintf
531 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
532 lamexp_version_major(),
533 lamexp_version_minor(),
534 lamexp_version_release(),
535 lamexp_version_build(),
536 lamexp_version_date().toString(Qt::ISODate
).toLatin1().constData(),
537 lamexp_version_compiler(),
538 lamexp_version_arch(),
542 const QString copyrightStr
= QString().sprintf
544 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
545 qMax(lamexp_version_date().year(), lamexp_current_date_safe().year())
550 aboutText
+= QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
551 aboutText
+= QString("<b>%1</b><br>").arg(NOBR(copyrightStr
));
552 aboutText
+= QString("<b>%1</b><br><br>").arg(NOBR(versionStr
));
553 aboutText
+= QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
555 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
556 const QDate currentDate
= lamexp_current_date_safe();
559 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
560 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
))));
562 else if(lamexp_version_demo())
564 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0);
565 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
))));
568 const QDate currentDate
= lamexp_current_date_safe();
571 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
572 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
))));
574 else if(lamexp_version_demo())
576 int daysLeft
= qMax(currentDate
.daysTo(lamexp_version_expires()), 0i64
);
577 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 aboutText
+= "<hr><br>";
583 aboutText
+= "<nobr><tt>This program is free software; you can redistribute it and/or modify<br>";
584 aboutText
+= "it under the terms of the GNU General Public License as published by<br>";
585 aboutText
+= "the Free Software Foundation; either version 2 of the License, or<br>";
586 aboutText
+= "(at your option) any later version, but always including the *additional*<br>";
587 aboutText
+= "restrictions defined in the \"License.txt\" file (see \"License\" tab).<br><br>";
588 aboutText
+= "This program is distributed in the hope that it will be useful,<br>";
589 aboutText
+= "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
590 aboutText
+= "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
591 aboutText
+= "GNU General Public License for more details.<br><br>";
592 aboutText
+= "You should have received a copy of the GNU General Public License<br>";
593 aboutText
+= "along with this program; if not, write to the Free Software<br>";
594 aboutText
+= "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
595 aboutText
+= "<hr><table style=\"margin-top:4px\"><tr>";
596 aboutText
+= "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
597 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 !!!"));
598 aboutText
+= "</tr></table>";
600 ui
->infoLabel
->setText(aboutText
);
601 ui
->infoIcon
->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
602 connect(ui
->infoLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
605 void AboutDialog::initContributorsTab(void)
607 const QString
spaces(" ");
608 const QString
extraVSpace("<font style=\"font-size:7px\"><br> </font>");
610 QString contributorsAboutText
;
611 contributorsAboutText
+= QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
612 contributorsAboutText
+= "<table style=\"margin-top:12px;white-space:nowrap\">";
614 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Programmers:"), extraVSpace
);
615 QString icon
= QString("<img src=\":/icons/%1.png\">").arg("user_gray");
616 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon
, spaces
);
617 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces
);
618 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");
619 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
621 contributorsAboutText
+= QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace
);
622 for(int i
= 0; g_lamexp_translators
[i
].pcName
; i
++)
624 QString flagIcon
= (strlen(g_lamexp_translators
[i
].pcFlag
) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators
[i
].pcFlag
) : QString();
625 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon
, spaces
);
626 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(WCHAR2QSTR(g_lamexp_translators
[i
].pcLanguage
), spaces
);
627 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%3\"><%3></a></td></tr>").arg(WCHAR2QSTR(g_lamexp_translators
[i
].pcName
), spaces
, g_lamexp_translators
[i
].pcMail
);
630 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("Special thanks to:"), extraVSpace
);
633 QString webIcon
= QString("<img src=\":/icons/%1.png\">").arg("world");
634 for(int i
= 0; g_lamexp_specialThanks
[i
].pcName
; i
++)
636 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon
, spaces
);
637 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
));
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("Official Mirrors:"), extraVSpace
);
643 QString serverIcon
= QString("<img src=\":/icons/%1.png\">").arg("server_database");
644 for(int i
= 0; g_lamexp_mirrors
[i
].pcName
; i
++)
646 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(serverIcon
, 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_mirrors
[i
].pcName
), spaces
, QString::fromLatin1(g_lamexp_mirrors
[i
].pcAddress
));
650 contributorsAboutText
+= "</table><br><br><br>";
651 contributorsAboutText
+= QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
653 ui
->contributorsLabel
->setText(contributorsAboutText
);
654 ui
->contributorsIcon
->setPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(72,84)));
655 connect(ui
->contributorsLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
658 void AboutDialog::initSoftwareTab(void)
660 QString moreAboutText
;
662 moreAboutText
+= QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
663 moreAboutText
+= "<div style=\"margin-left:-25px;white-space:nowrap\"><table><tr><td><ul>"; //;font-size:7pt
665 moreAboutText
+= makeToolText
667 tr("LAME - OpenSource mp3 Encoder"),
668 "lame.exe", "v?.??, #-?",
669 tr("Released under the terms of the GNU Lesser General Public License."),
670 "http://lame.sourceforge.net/"
672 moreAboutText
+= makeToolText
674 tr("OggEnc - Vorbis Encoder"),
675 "oggenc2.exe", "v?.??, libvorbis v?.?? + aoTuV b?.??_#",
676 tr("Completely open and patent-free audio encoding technology."),
677 "http://www.rarewares.org/ogg-oggenc.php"
679 moreAboutText
+= makeToolText
681 tr("Nero AAC Reference MPEG-4 Encoder"),
682 "neroAacEnc.exe", "v?.?.?.?",
683 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
685 tr("Available from vendor web-site as free download:")
687 moreAboutText
+= makeToolText
689 tr("Aften - A/52 audio encoder"),
690 "aften.exe", "v?.?.?",
691 tr("Released under the terms of the GNU Lesser General Public License."),
692 "http://aften.sourceforge.net/"
694 moreAboutText
+= makeToolText
696 tr("FLAC - Free Lossless Audio Codec"),
697 "flac.exe", "v?.?.?",
698 tr("Open and patent-free lossless audio compression technology."),
699 "http://flac.sourceforge.net/"
701 moreAboutText
+= makeToolText
703 tr("Opus Audio Codec"),
704 "opusenc.exe", "#, ????-??-??",
705 tr("Totally open, royalty-free, highly versatile audio codec."),
706 "http://www.opus-codec.org/"
708 moreAboutText
+= makeToolText
710 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
711 "mpg123.exe", "v?.??.?",
712 tr("Released under the terms of the GNU Lesser General Public License."),
713 "http://www.mpg123.de/"
715 moreAboutText
+= makeToolText
717 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
719 tr("Released under the terms of the GNU General Public License."),
720 "http://www.audiocoding.com/"
722 moreAboutText
+= makeToolText
724 tr("OggDec - Vorbis Decoder"),
725 "oggdec.exe", "v?.??.?",
726 tr("Command line Ogg Vorbis decoder created by John33."),
727 "http://www.rarewares.org/ogg-oggdec.php"
729 moreAboutText
+= makeToolText
731 tr("Valdec from AC3Filter Tools - AC3/DTS Decoder"),
732 "valdec.exe", "v?.??#",
733 tr("Released under the terms of the GNU Lesser General Public License."),
734 "http://www.ac3filter.net/projects/tools"
736 moreAboutText
+= makeToolText
738 tr("WavPack - Hybrid Lossless Compression"),
739 "wvunpack.exe", "v?.??.?",
740 tr("Completely open audio compression format."),
741 "http://www.wavpack.com/"
743 moreAboutText
+= makeToolText
745 tr("Musepack - Living Audio Compression"),
746 "mpcdec.exe", "r???",
747 tr("Released under the terms of the GNU Lesser General Public License."),
748 "http://www.musepack.net/"
750 moreAboutText
+= makeToolText
752 tr("Monkey's Audio - Lossless Audio Compressor"),
754 tr("Freely available source code, simple SDK and non-restrictive licensing."),
755 "http://www.monkeysaudio.com/"
757 moreAboutText
+= makeToolText
759 tr("Shorten - Lossless Audio Compressor"),
760 "shorten.exe", "v?.?.?",
761 tr("Released under the terms of the GNU Lesser General Public License."),
762 "http://etree.org/shnutils/shorten/"
764 moreAboutText
+= makeToolText
766 tr("Speex - Free Codec For Free Speech"),
767 "speexdec.exe", "v?.?",
768 tr("Open Source patent-free audio format designed for speech."),
769 "http://www.speex.org/"
771 moreAboutText
+= makeToolText
773 tr("The True Audio - Lossless Audio Codec"),
775 tr("Released under the terms of the GNU Lesser General Public License."),
776 "http://tta.sourceforge.net/"
778 moreAboutText
+= makeToolText
780 tr("refalac - Win32 command line ALAC encoder/decoder"),
781 "refalac.exe", "v?.??",
782 tr("The ALAC reference implementation by Apple is available under the Apache license."),
783 "http://alac.macosforge.org/"
785 moreAboutText
+= makeToolText
787 tr("wma2wav - Dump WMA files to Wave Audio"),
788 "wma2wav.exe", "????-??-??",
789 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
790 "http://forum.doom9.org/showthread.php?t=140273"
792 moreAboutText
+= makeToolText
794 tr("avs2wav - Avisynth to Wave Audio converter"),
795 "avs2wav.exe", "v?.?",
796 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
797 "http://forum.doom9.org/showthread.php?t=70882"
799 moreAboutText
+= makeToolText
802 "dcaenc.exe", "????-??-??",
803 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
804 "http://gitorious.org/dtsenc/dtsenc/trees/master"
806 moreAboutText
+= makeToolText
808 tr("MediaInfo - Media File Analysis Tool"),
809 "mediainfo.exe", "v?.?.??",
810 tr("Released under the terms of the GNU Lesser General Public License."),
811 "http://mediainfo.sourceforge.net/"
813 moreAboutText
+= makeToolText
815 tr("SoX - Sound eXchange"),
816 "sox.exe", "v??.?.?",
817 tr("Released under the terms of the GNU Lesser General Public License."),
818 "http://sox.sourceforge.net/"
820 moreAboutText
+= makeToolText
822 tr("GnuPG - The GNU Privacy Guard"),
823 "gpgv.exe", "v?.?.??",
824 tr("Released under the terms of the GNU Lesser General Public License."),
825 "http://www.gnupg.org/"
827 moreAboutText
+= makeToolText
829 tr("GNU Wget - Software for retrieving files using HTTP"),
830 "wget.exe", "v?.??.?",
831 tr("Released under the terms of the GNU Lesser General Public License."),
832 "http://www.gnu.org/software/wget/"
834 moreAboutText
+= makeToolText
836 tr("UPX - The Ultimate Packer for eXecutables"),
838 tr("Released under the terms of the GNU Lesser General Public License."),
839 "http://upx.sourceforge.net/"
841 moreAboutText
+= makeToolText
843 tr("Silk Icons - Over 700 icons in PNG format"),
845 tr("By Mark James, released under the Creative Commons 'by' License."),
846 "http://www.famfamfam.com/lab/icons/silk/"
848 moreAboutText
+= QString("</ul></td><td> </td></tr></table></div><br><i>%1</i><br>").arg
850 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.")
853 ui
->softwareLabel
->setText(moreAboutText
);
854 ui
->softwareIcon
->setPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(72,65)));
855 connect(ui
->softwareLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
858 void AboutDialog::initLicenseTab(void)
860 bool bFoundHeader
= false;
861 QRegExp
header("^(\\s*)(GNU GENERAL PUBLIC LICENSE)(\\s*)$");
864 licenseText
+= ("<tt>");
866 QFile
file(":/License.txt");
867 if(file
.open(QIODevice::ReadOnly
))
869 QTextStream
stream(&file
);
870 while((!stream
.atEnd()) && (stream
.status() == QTextStream::Ok
))
872 QString line
= stream
.readLine();
873 line
.replace('<', "<").replace('>', ">");
874 if((!bFoundHeader
) && (header
.indexIn(line
) >= 0))
876 line
.replace(header
, "\\1<b>\\2</b>\\3");
880 licenseText
+= QString("<nobr>%1</nobr><br>").arg(line
.replace(' ', " "));
882 licenseText
+= QString("<br>");
883 stream
.device()->close();
887 licenseText
+= QString("<font color=\"darkred\">Oups, failed to load license text. Please refer to:</font><br>");
888 licenseText
+= LINK("http://www.gnu.org/licenses/gpl-2.0.html");
891 licenseText
+= ("</tt>");
893 ui
->licenseLabel
->setText(licenseText
);
894 ui
->licenseIcon
->setPixmap(QIcon(":/images/Logo_GNU.png").pixmap(QSize(72,65)));
895 connect(ui
->licenseLabel
, SIGNAL(linkActivated(QString
)), this, SLOT(openURL(QString
)));
899 QString
AboutDialog::makeToolText(const QString
&toolName
, const QString
&toolBin
, const QString
&toolVerFmt
, const QString
&toolLicense
, const QString
&toolWebsite
, const QString
&extraInfo
)
901 QString toolText
, toolTag
, verStr(toolVerFmt
);
903 if(!toolBin
.isEmpty())
905 const unsigned int version
= lamexp_tool_version(toolBin
, &toolTag
);
906 verStr
= lamexp_version2string(toolVerFmt
, version
, tr("n/a"), &toolTag
);
909 toolText
+= QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName
, verStr
)));
910 toolText
+= QString("%1<br>").arg(NOBR(toolLicense
));
911 if(!extraInfo
.isEmpty()) toolText
+= QString("<i>%1</i><br>").arg(NOBR(extraInfo
));
912 toolText
+= QString("<nobr>%1</nobr>").arg(LINK(toolWebsite
));
913 toolText
+= QString("<font style=\"font-size:9px\"><br> </font>");