///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
+// (at your option) any later version, but always including the *additional*
+// restrictions defined in the "License.txt" file.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "Dialog_About.h"
-#include "../tmp/UIC_AboutDialog.h"
+#include "UIC_AboutDialog.h"
+//Internal
#include "Global.h"
-#include "Resource.h"
#include "Model_Settings.h"
+//MUtils
+#include <MUtils/Global.h>
+#include <MUtils/OSSupport.h>
+#include <MUtils/Sound.h>
+#include <MUtils/GUI.h>
+#include <MUtils/Version.h>
+
+//Qt
#include <QDate>
#include <QApplication>
#include <QIcon>
#include <QTextStream>
#include <QScrollBar>
#include <QCloseEvent>
+#include <QElapsedTimer>
#include <QWindowsVistaStyle>
#include <QWindowsXPStyle>
-#include <ShellAPI.h>
-#include <MMSystem.h>
+//CRT
#include <math.h>
//Helper macros
#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)
#define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
-
//Constants
-const char *AboutDialog::neroAacUrl = "http://www.nero.com/eng/technologies-aac-codec.html";
-const char *AboutDialog::disqueUrl = "http://muldersoft.com/?player_url=38X-MXOB014"; //http://mulder.brhack.net/?player_url=yF6W-w0iAMM; http://www.youtube.com/watch_popup?v=yF6W-w0iAMM&vq=large
+const char *AboutDialog::neroAacUrl = "http://www.nero.com/eng/company/about-nero/nero-aac-codec.php"; //"http://www.videohelp.com/tools/Nero-AAC-Codec";
+const char *AboutDialog::disqueUrl = "http://muldersoft.com/?player_url=38X-MXOB014";
//Contributors
static const struct
}
g_lamexp_translators[] =
{
- {"en", L"Englisch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
- {"de", L"Deutsch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
- {"", L"", L"Bodo Thevissen", "Bodo@thevissen.de" },
- {"es", L"Español", L"Rub3nCT", "Rub3nCT@gmail.com" },
- {"fr", L"Française", L"Dodich Informatique", "Dodich@live.fr" },
- {"it", L"Italiano", L"Roberto", "Gulliver_69@libero.it" },
- {"kr", L"한국어", L"JaeHyung Lee", "Kolanp@gmail.com" },
- {"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
- {"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
- {"", L"", L"Иван Митин", "bardak@inbox.ru" },
- {"sv", L"Svenska", L"Åke Engelbrektson", "eson57@gmail.com" },
- {"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
- {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
- {"zh", L"简体中文", L"456Vv", "123@456vv.com" },
+ {"en", L"Englisch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
+ {"de", L"Deutsch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
+ {"", L"", L"Bodo Thevissen", "Bodo@thevissen.de" },
+ {"es", L"Español", L"Rub3nCT", "Rub3nCT@gmail.com" },
+ {"fr", L"Française", L"Dodich Informatique", "Dodich@live.fr" },
+ {"hu", L"Magyarul", L"ZityiSoft Team", "zityisoft@gmail.com" },
+ {"it", L"Italiano", L"Roberto", "Gulliver_69@libero.it" },
+ {"kr", L"한국어", L"JaeHyung Lee", "Kolanp@gmail.com" },
+ {"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com" },
+ {"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
+ {"", L"", L"Иван Митин", "bardak@inbox.ru" },
+ {"sv", L"Svenska", L"Åke Engelbrektson", "eson@svenskasprakfiler.se"},
+ {"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
+ {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
+ {"zh", L"简体中文", L"456Vv", "123@456vv.com" },
+ {"", L"", L"庄泓川", "kidneybean@sohu.com" },
{NULL, NULL, NULL, NULL}
};
+//Special Thanks
+static const struct
+{
+ char* pcName;
+ char *pcAddress;
+}
+g_lamexp_specialThanks[] =
+{
+ { "Doom9's Forum", "http://forum.doom9.org/" },
+ { "Gleitz | German Doom9", "http://forum.gleitz.info/" },
+ { "Hydrogenaudio Forums", "http://www.hydrogenaudio.org/" },
+ { "RareWares", "http://www.rarewares.org/" },
+ { "GitHub", "http://github.com/" },
+ { "SourceForge", "http://sourceforge.net/" },
+ { "Qt Developer Network", "http://qt-project.org/" },
+ { "CodePlex", "http://www.codeplex.com/" },
+ { "Marius Hudea", "http://savedonthe.net/" },
+ { "Codecs.com", "http://www.codecs.com/" },
+ { NULL, NULL }
+};
+
+//Mirrors
+static const struct
+{
+ char* pcName;
+ char *pcAddress;
+}
+g_lamexp_mirrors[] =
+{
+ { "GitHub.com", "https://github.com/lordmulder/LameXP" },
+ { "SourceForge.net", "http://sourceforge.net/p/lamexp/code/" },
+ { "Bitbucket.org", "https://bitbucket.org/lord_mulder/lamexp" },
+ { "GitLab.com" , "https://gitlab.com/lamexp/lamexp" },
+ { "Codeplex.com", "https://lamexp.codeplex.com/SourceControl/latest" },
+ { "Assembla.com", "https://www.assembla.com/spaces/lamexp/" },
+ { NULL, NULL }
+};
+
////////////////////////////////////////////////////////////
// Constructor
////////////////////////////////////////////////////////////
m_disque(NULL),
m_disqueTimer(NULL),
m_rotateNext(false),
- m_disqueDelay(_I64_MAX),
m_lastTab(0)
{
//Init the dialog, from the .ui file
//Disable "X" button
if(firstStart)
{
- if(HMENU hMenu = GetSystemMenu((HWND) winId(), FALSE))
- {
- EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);
- }
+ MUtils::GUI::enable_close_button(this, false);
}
//Init images
//Show about dialog for the first time?
if(!firstStart)
{
- lamexp_seed_rand();
+ MUtils::seed_rand();
ui->acceptButton->hide();
ui->declineButton->hide();
ui->closeButton->show();
QPixmap disque(":/images/Disque.png");
- QRect screenGeometry = QApplication::desktop()->availableGeometry();
m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
- m_disque->installEventFilter(this);
+ m_disque->resize(disque.size());
m_disque->setStyleSheet("background:transparent;");
m_disque->setAttribute(Qt::WA_TranslucentBackground);
- m_disque->setGeometry(static_cast<int>(lamexp_rand() % static_cast<unsigned int>(screenGeometry.width() - disque.width())), static_cast<int>(lamexp_rand() % static_cast<unsigned int>(screenGeometry.height() - disque.height())), disque.width(), disque.height());
m_disque->setPixmap(disque);
- m_disque->setWindowOpacity(0.01);
+ m_disque->installEventFilter(this);
+
+ connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(geometryUpdated()));
+ geometryUpdated();
+
+ m_discOpacity = 0.01;
+ m_disquePos.setX(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound.right() - disque.width() - m_disqueBound.left())) + m_disqueBound.left());
+ m_disquePos.setY(static_cast<int>(MUtils::next_rand32() % static_cast<unsigned int>(m_disqueBound.bottom() - disque.height() - m_disqueBound.top())) + m_disqueBound.top());
+ m_disqueFlags[0] = (MUtils::next_rand32() > (UINT_MAX/2));
+ m_disqueFlags[1] = (MUtils::next_rand32() > (UINT_MAX/2));
+ m_disque->move(m_disquePos);
+ m_disque->setWindowOpacity(m_discOpacity);
m_disque->show();
- m_disqueFlags[0] = (lamexp_rand() > (UINT_MAX/2));
- m_disqueFlags[1] = (lamexp_rand() > (UINT_MAX/2));
+
m_disqueTimer = new QTimer;
connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
- m_disqueTimer->setInterval(10);
- m_disqueTimer->start();
+ m_disqueTimer->start(10);
connect(ui->aboutQtButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
}
if(m_disque)
{
m_disque->close();
- LAMEXP_DELETE(m_disque);
+ MUTILS_DELETE(m_disque);
}
if(m_disqueTimer)
{
m_disqueTimer->stop();
- LAMEXP_DELETE(m_disqueTimer);
+ MUTILS_DELETE(m_disqueTimer);
}
for(int i = 0; i < 4; i++)
{
- LAMEXP_DELETE(m_cartoon[i]);
+ MUTILS_DELETE(m_cartoon[i]);
}
- LAMEXP_DELETE(m_initFlags);
- LAMEXP_DELETE(ui);
+ MUTILS_DELETE(m_initFlags);
+ MUTILS_DELETE(ui);
}
////////////////////////////////////////////////////////////
{
if(m_firstShow)
{
- if(!playResoureSound("imageres.dll", 5080, true))
+ if(!MUtils::Sound::play_sound_file("imageres.dll", 5080, true))
{
- PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC);
+ MUtils::Sound::play_system_sound("SystemStart", true);
}
}
else
{
- PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
+ MUtils::Sound::play_sound("uuaarrgh", true);
}
}
// Slots
////////////////////////////////////////////////////////////
-#define TEMP_HIDE_DISQUE(CMD) \
-if(m_disque) { bool _tmp = m_disque->isVisible(); if(_tmp) m_disque->hide(); {CMD}; if(_tmp) { m_disque->show(); m_disque->setWindowOpacity(0.01); } } else {CMD}
-
-void AboutDialog::tabChanged(int index)
+#define TEMP_HIDE_DISQUE(CMD) do \
+{ \
+ bool _tmp = (m_disque) ? m_disque->isVisible() : false; \
+ if(_tmp) m_disque->hide(); \
+ { CMD } \
+ if(_tmp) \
+ { \
+ m_discOpacity = 0.01; \
+ m_disque->setWindowOpacity(m_discOpacity); \
+ m_disque->show(); \
+ } \
+} \
+while(0)
+
+void AboutDialog::tabChanged(int index, const bool silent)
{
bool bInitialized = m_initFlags->value(ui->tabWidget->widget(index), false);
qApp->restoreOverrideCursor();
}
+ //Play tick sound
+ if(m_settings->soundsEnabled() && (!silent))
+ {
+ MUtils::Sound::play_sound("tick", true);
+ }
+
//Scroll to the top
if(QWidget *tab = ui->tabWidget->widget(index))
{
{
if(!QDesktopServices::openUrl(QUrl(url)))
{
- ShellExecuteW(this->winId(), L"open", QWCHAR(url), NULL, NULL, SW_SHOW);
+ MUtils::OS::shell_open(this, url);
}
}
void AboutDialog::moveDisque(void)
{
int delta = 2;
- LARGE_INTEGER perfCount, perfFrequ;
+ QElapsedTimer elapsedTimer;
+ elapsedTimer.start();
- if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount))
+ if((!m_disqueDelay.isNull()) && m_disqueDelay->isValid())
{
- if(m_disqueDelay != _I64_MAX)
- {
- const double delay = static_cast<double>(perfCount.QuadPart) - static_cast<double>(m_disqueDelay);
- delta = qMax(1, qMin(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
- }
- m_disqueDelay = perfCount.QuadPart;
+ const qint64 delay = m_disqueDelay->restart();
+ delta = qBound(1, static_cast<int>(ceil(static_cast<double>(delay) / 5.12)), 128);
+ }
+ else
+ {
+ m_disqueDelay.reset(new QElapsedTimer());
+ m_disqueDelay->start();
}
if(m_disque)
{
- QRect screenGeometry = QApplication::desktop()->availableGeometry();
- const int minX = screenGeometry.left();
- const int maxX = screenGeometry.width() - m_disque->width() + screenGeometry.left();
- const int minY = screenGeometry.top();
- const int maxY = screenGeometry.height() - m_disque->height() + screenGeometry.top();
+ if(m_disquePos.x() <= m_disqueBound.left()) { m_disqueFlags[0] = true; m_rotateNext = true; }
+ if(m_disquePos.x() >= m_disqueBound.right()) { m_disqueFlags[0] = false; m_rotateNext = true; }
+ if(m_disquePos.y() <= m_disqueBound.top()) { m_disqueFlags[1] = true; m_rotateNext = true; }
+ if(m_disquePos.y() >= m_disqueBound.bottom()) { m_disqueFlags[1] = false; m_rotateNext = true; }
- QPoint pos = m_disque->pos();
- pos.setX(m_disqueFlags[0] ? pos.x() + delta : pos.x() - delta);
- pos.setY(m_disqueFlags[1] ? pos.y() + delta : pos.y() - delta);
-
- if(pos.x() <= minX)
- {
- m_disqueFlags[0] = true;
- pos.setX(minX);
- m_rotateNext = true;
- }
- else if(pos.x() >= maxX)
- {
- m_disqueFlags[0] = false;
- pos.setX(maxX);
- m_rotateNext = true;
- }
- if(pos.y() <= minY)
- {
- m_disqueFlags[1] = true;
- pos.setY(minY);
- m_rotateNext = true;
- }
- else if(pos.y() >= maxY)
- {
- m_disqueFlags[1] = false;
- pos.setY(maxY);
- m_rotateNext = true;
- }
-
- m_disque->move(pos);
+ m_disquePos.setX(m_disqueFlags[0] ? (m_disquePos.x() + delta) : (m_disquePos.x() - delta));
+ m_disquePos.setY(m_disqueFlags[1] ? (m_disquePos.y() + delta) : (m_disquePos.y() - delta));
+ m_disque->move(m_disquePos);
+
if(m_rotateNext)
{
QPixmap *cartoon = NULL;
if(cartoon)
{
m_disque->setPixmap(*cartoon);
- m_disque->resize(cartoon->size());
+ if(m_disque->size() != cartoon->size())
+ {
+ m_disque->resize(cartoon->size());
+ geometryUpdated();
+ }
}
m_rotateNext = false;
}
- if(m_disque->windowOpacity() < 0.9)
+ if(m_discOpacity != 1.0)
{
- m_disque->setWindowOpacity(m_disque->windowOpacity() + 0.01);
+ m_discOpacity = m_discOpacity + 0.01;
+ if(qFuzzyCompare(m_discOpacity, 1.0) || (m_discOpacity > 1.0))
+ {
+ m_discOpacity = 1.0;
+ }
+ m_disque->setWindowOpacity(m_discOpacity);
+ m_disque->update();
}
}
}
+void AboutDialog::geometryUpdated(void)
+{
+ if(m_disque)
+ {
+ QRect screenGeometry = QApplication::desktop()->availableGeometry();
+ m_disqueBound.setLeft(screenGeometry.left());
+ m_disqueBound.setRight(screenGeometry.width() - m_disque->width() + screenGeometry.left());
+ m_disqueBound.setTop(screenGeometry.top());
+ m_disqueBound.setBottom(screenGeometry.height() - m_disque->height() + screenGeometry.top());
+ }
+ else
+ {
+ m_disqueBound = QApplication::desktop()->availableGeometry();
+ }
+}
+
void AboutDialog::adjustSize(void)
{
- int maximumHeight = QApplication::desktop()->availableGeometry().height();
+ const int maxH = QApplication::desktop()->availableGeometry().height();
+ const int maxW = QApplication::desktop()->availableGeometry().width();
- int delta = ui->infoScrollArea->widget()->height() - ui->infoScrollArea->viewport()->height();
- if(delta > 0)
+ const int deltaH = ui->infoScrollArea->widget()->height() - ui->infoScrollArea->viewport()->height();
+ const int deltaW = ui->infoScrollArea->widget()->width() - ui->infoScrollArea->viewport()->width();
+
+ if(deltaH > 0)
{
- this->resize(this->width(), qMin(this->height() + delta, maximumHeight));
- this->move(this->x(), this->y() - (delta/2));
+ this->resize(this->width(), qMin(this->height() + deltaH, maxH));
+ this->move(this->x(), this->y() - (deltaH / 2));
this->setMinimumHeight(qMax(this->minimumHeight(), this->height()));
}
+
+ if(deltaW > 0)
+ {
+ this->resize(qMin(this->width() + deltaW, maxW), this->height());
+ this->move(this->x() - (deltaW / 2), this->y());
+ this->setMinimumWidth(qMax(this->minimumWidth(), this->width()));
+ }
}
////////////////////////////////////////////////////////////
QDialog::showEvent(e);
ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->infoTab));
- tabChanged(m_lastTab = ui->tabWidget->currentIndex());
+ tabChanged(m_lastTab = ui->tabWidget->currentIndex(), true);
if(m_firstShow)
{
void AboutDialog::initInformationTab(void)
{
+ const QDate versionDate = MUtils::Version::app_build_date();
+
const QString versionStr = QString().sprintf
(
"Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
lamexp_version_minor(),
lamexp_version_release(),
lamexp_version_build(),
- lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
- lamexp_version_compiler(),
- lamexp_version_arch(),
+ versionDate.toString(Qt::ISODate).toLatin1().constData(),
+ MUtils::Version::compiler_version(),
+ MUtils::Version::compiler_arch(),
qVersion()
);
const QString copyrightStr = QString().sprintf
(
"Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
- qMax(lamexp_version_date().year(), lamexp_current_date_safe().year())
+ qMax(versionDate.year(), MUtils::OS::current_date().year())
);
QString aboutText;
aboutText += QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
- const QDate currentDate = lamexp_current_date_safe();
- if(LAMEXP_DEBUG)
+ const QDate currentDate = MUtils::OS::current_date();
+ if(MUTILS_DEBUG)
{
int daysLeft = qMax(currentDate.daysTo(lamexp_version_expires()), 0);
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))));
#endif
aboutText += "<hr><br>";
- aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
- aboutText += "modify it under the terms of the GNU General Public License<br>";
- aboutText += "as published by the Free Software Foundation; either version 2<br>";
- aboutText += "of the License, or (at your option) any later version.<br><br>";
+
+ aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or modify<br>";
+ aboutText += "it under the terms of the GNU General Public License as published by<br>";
+ aboutText += "the Free Software Foundation; either version 2 of the License, or<br>";
+ aboutText += "(at your option) any later version, but always including the *additional*<br>";
+ aboutText += "restrictions defined in the \"License.txt\" file (see \"License\" tab).<br><br>";
aboutText += "This program is distributed in the hope that it will be useful,<br>";
aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
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 !!!"));
aboutText += "</tr></table>";
- //aboutText += QString("%1<br>").arg(NOBR(tr("Special thanks go out to \"John33\" from %1 for his continuous support.")).arg(LINK("http://www.rarewares.org/")));
ui->infoLabel->setText(aboutText);
ui->infoIcon->setPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
QString icon = QString("<img src=\":/icons/%1.png\">").arg("user_gray");
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(icon, spaces);
contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(tr("Project Leader"), spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%2\"><%3></a></td></tr>").arg("LoRd_MuldeR", spaces, "MuldeR2@GMX.de");
+ 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");
contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Translators:"), extraVSpace);
{
QString flagIcon = (strlen(g_lamexp_translators[i].pcFlag) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_translators[i].pcFlag) : QString();
contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(flagIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(WCHAR2QSTR(g_lamexp_translators[i].pcLanguage), spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td><a href=\"mailto:%2\"><%3></a></td></tr>").arg(WCHAR2QSTR(g_lamexp_translators[i].pcName), spaces, g_lamexp_translators[i].pcMail);
+ contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td>").arg(MUTILS_QSTR(g_lamexp_translators[i].pcLanguage), spaces);
+ 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);
}
contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Special thanks to:"), extraVSpace);
QString webIcon = QString("<img src=\":/icons/%1.png\">").arg("world");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Doom9's Forum"), spaces, "http://forum.doom9.org/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Gleitz | German Doom9"), spaces, "http://forum.gleitz.info/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Hydrogenaudio Forums"), spaces, "http://www.hydrogenaudio.org/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("RareWares"), spaces, "http://www.rarewares.org/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("GitHub"), spaces, "http://github.com/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("SourceForge"), spaces, "http://sourceforge.net/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Qt Developer Network"), spaces, "http://qt-project.org/");
- contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
- contributorsAboutText += QString("<td valign=\"middle\">%1</td><td>%2</td><td valign=\"middle\" colspan=\"3\"><a href=\"%3\">%3</td></tr>").arg(tr("Marius Hudea"), spaces, "http://savedonthe.net/");
+ for(int i = 0; g_lamexp_specialThanks[i].pcName; i++)
+ {
+ contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(webIcon, spaces);
+ 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));
+ }
+
+ contributorsAboutText += QString("<tr><td colspan=\"7\"><b> </b></td></tr>");
+ contributorsAboutText += QString("<tr><td colspan=\"7\"><b>%1</b>%2</td></tr>").arg(tr("Official Mirrors:"), extraVSpace);
+
+ QString serverIcon = QString("<img src=\":/icons/%1.png\">").arg("server_database");
+ for(int i = 0; g_lamexp_mirrors[i].pcName; i++)
+ {
+ contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td>%2</td>").arg(serverIcon, spaces);
+ 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));
+ }
contributorsAboutText += "</table><br><br><br>";
contributorsAboutText += QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
);
moreAboutText += makeToolText
(
- tr("OggEnc - Ogg Vorbis Encoder"),
- "oggenc2.exe", "v?.??, aoTuV #-?.??",
+ tr("OggEnc - Vorbis Encoder"),
+ "oggenc2.exe", "v?.??, libvorbis v?.?? + aoTuV b?.??_#",
tr("Completely open and patent-free audio encoding technology."),
- "http://www.vorbis.com/"
+ "http://www.rarewares.org/ogg-oggenc.php"
);
moreAboutText += makeToolText
(
moreAboutText += makeToolText
(
tr("Opus Audio Codec"),
- "opusenc.exe", "????-??-??",
+ "opusenc.exe", "#, ????-??-??",
tr("Totally open, royalty-free, highly versatile audio codec."),
"http://www.opus-codec.org/"
);
);
moreAboutText += makeToolText
(
+ tr("OggDec - Vorbis Decoder"),
+ "oggdec.exe", "v?.??.?",
+ tr("Command line Ogg Vorbis decoder created by John33."),
+ "http://www.rarewares.org/ogg-oggdec.php"
+ );
+ moreAboutText += makeToolText
+ (
tr("Valdec from AC3Filter Tools - AC3/DTS Decoder"),
- "valdec.exe", "v?.?.?#",
+ "valdec.exe", "v?.??#",
tr("Released under the terms of the GNU Lesser General Public License."),
"http://www.ac3filter.net/projects/tools"
);
tr("Released under the terms of the GNU Lesser General Public License."),
"http://tta.sourceforge.net/"
);
- //moreAboutText += makeToolText
- //(
- // tr("ALAC Decoder"),
- // "alac.exe", "v?.?.?",
- // tr("Copyright (c) 2004 David Hammerton. Contributions by Cody Brocious."),
- // "http://craz.net/programs/itunes/alac.html"
- //);
moreAboutText += makeToolText
(
tr("refalac - Win32 command line ALAC encoder/decoder"),
tr("dcaenc"),
"dcaenc.exe", "????-??-??",
tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
- "http://gitorious.org/dtsenc/dtsenc/trees/master"
+ "https://gitlab.com/patrakov/dcaenc"
);
moreAboutText += makeToolText
(
moreAboutText += makeToolText
(
tr("UPX - The Ultimate Packer for eXecutables"),
- QString(), "v3.08",
+ QString(), "v3.09",
tr("Released under the terms of the GNU Lesser General Public License."),
"http://upx.sourceforge.net/"
);
void AboutDialog::initLicenseTab(void)
{
+ bool bFoundHeader = false;
+ QRegExp header("^(\\s*)(GNU GENERAL PUBLIC LICENSE)(\\s*)$");
+
QString licenseText;
licenseText += ("<tt>");
if(file.open(QIODevice::ReadOnly))
{
QTextStream stream(&file);
- unsigned int counter = 0;
while((!stream.atEnd()) && (stream.status() == QTextStream::Ok))
{
QString line = stream.readLine();
- const bool bIsBlank = line.trimmed().isEmpty();
line.replace('<', "<").replace('>', ">");
-
- switch(counter)
+ if((!bFoundHeader) && (header.indexIn(line) >= 0))
{
- case 0:
- if(!bIsBlank) licenseText += QString("<font size=\"+2\">%1</font><br>").arg(line.simplified());
- break;
- case 1:
- if(!bIsBlank) licenseText += QString("<font size=\"+1\">%1 − %2</font><br>").arg(line.simplified(), LINK("http://www.gnu.org/licenses/gpl-2.0.html"));
- break;
- default:
- TRIM_RIGHT(line);
- licenseText += QString("<nobr>%1</nobr><br>").arg(line.replace(' ', " "));
- break;
+ line.replace(header, "\\1<b>\\2</b>\\3");
+ bFoundHeader = true;
}
-
- if(!bIsBlank) counter++;
+ TRIM_RIGHT(line);
+ licenseText += QString("<nobr>%1</nobr><br>").arg(line.replace(' ', " "));
}
licenseText += QString("<br>");
stream.device()->close();
if(!toolBin.isEmpty())
{
- const unsigned int version = lamexp_tool_version(toolBin, &toolTag);
- verStr = lamexp_version2string(toolVerFmt, version, tr("n/a"), &toolTag);
+ const unsigned int version = lamexp_tools_version(toolBin, &toolTag);
+ verStr = lamexp_version2string(toolVerFmt, version, tr("n/a"), toolTag);
}
toolText += QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName, verStr)));
return toolText;
}
-
-
-bool AboutDialog::playResoureSound(const QString &library, const unsigned long soundId, const bool async)
-{
- HMODULE module = 0;
- DWORD flags = SND_RESOURCE;
- bool result = false;
-
- QFileInfo libraryFile(library);
- if(!libraryFile.isAbsolute())
- {
- unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1;
- wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t));
- unsigned int result = GetSystemDirectory(buffer, buffSize);
- if(result > 0 && result < buffSize)
- {
- libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer))), library));
- }
- _freea(buffer);
- }
-
- if(async)
- {
- flags |= SND_ASYNC;
- }
- else
- {
- flags |= SND_SYNC;
- }
-
- module = LoadLibraryW(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(libraryFile.absoluteFilePath()).utf16()));
-
- if(module)
- {
- result = PlaySound((LPCTSTR) soundId, module, flags);
- FreeLibrary(module);
- }
-
- return result;
-}
\ No newline at end of file