1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2012 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.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
22 #include "Dialog_About.h"
26 #include "Model_Settings.h"
29 #include <QApplication>
31 #include <QPushButton>
32 #include <QDesktopServices>
37 #include <QDesktopWidget>
44 #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
47 const char *AboutDialog::neroAacUrl = "http://www.nero.com/eng/technologies-aac-codec.html";
48 const char *AboutDialog::disqueUrl = "http://mulder.brhack.net/?player_url=38X-MXOB014"; //http://mulder.brhack.net/?player_url=yF6W-w0iAMM; http://www.youtube.com/watch_popup?v=yF6W-w0iAMM&vq=large
58 g_lamexp_contributors[] =
60 {"en", L"Englisch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
61 {"de", L"Deutsch", L"LoRd_MuldeR", "MuldeR2@GMX.de" },
62 {"", L"", L"Bodo Thevissen", "Bodo@thevissen.de" },
63 {"es", L"Español", L"Rub3nCT", "Rub3nCT@gmail.com" },
64 {"fr", L"Française", L"Dodich Informatique", "Dodich@live.fr" },
65 {"it", L"Italiano", L"Roberto", "Gulliver_69@libero.it" },
66 {"kr", L"한국어", L"JaeHyung Lee", "Kolanp@gmail.com" },
67 {"pl", L"Polski", L"Sir Daniel K", "Sir.Daniel.K@gmail.com"},
68 {"ru", L"Русский", L"Neonailol", "Neonailol@gmail.com" },
69 {"", L"", L"Иван Митин", "bardak@inbox.ru" },
70 {"tw", L"繁体中文", L"456Vv", "123@456vv.com" },
71 {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
72 {"zh", L"简体中文", L"456Vv", "123@456vv.com" },
73 {NULL, NULL, NULL, NULL}
76 ////////////////////////////////////////////////////////////
78 ////////////////////////////////////////////////////////////
80 AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstStart)
87 m_disqueDelay(_I64_MAX)
89 const QString versionStr = QString().sprintf
91 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
92 lamexp_version_major(),
93 lamexp_version_minor(),
94 lamexp_version_release(),
95 lamexp_version_build(),
96 lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
97 lamexp_version_compiler(),
98 lamexp_version_arch(),
101 const QString copyrightStr = QString().sprintf
103 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
104 qMax(lamexp_version_date().year(), QDate::currentDate().year())
107 for(int i = 0; i < 4; i++)
114 aboutText += QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
115 aboutText += QString("<b>%1</b><br>").arg(NOBR(copyrightStr));
116 aboutText += QString("<b>%1</b><br><br>").arg(NOBR(versionStr));
117 aboutText += QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
119 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
122 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
123 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))));
125 else if(lamexp_version_demo())
127 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
128 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))));
133 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0i64);
134 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))));
136 else if(lamexp_version_demo())
138 int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0i64);
139 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))));
143 aboutText += "<hr><br>";
144 aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
145 aboutText += "modify it under the terms of the GNU General Public License<br>";
146 aboutText += "as published by the Free Software Foundation; either version 2<br>";
147 aboutText += "of the License, or (at your option) any later version.<br><br>";
148 aboutText += "This program is distributed in the hope that it will be useful,<br>";
149 aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
150 aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
151 aboutText += "GNU General Public License for more details.<br><br>";
152 aboutText += "You should have received a copy of the GNU General Public License<br>";
153 aboutText += "along with this program; if not, write to the Free Software<br>";
154 aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
155 aboutText += "<hr><table><tr>";
156 aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
157 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 !!!"));
158 aboutText += "</tr></table><hr><br>";
159 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/")));
162 setIconPixmap(lamexp_app_icon().pixmap(QSize(72,72)));
163 setWindowTitle(tr("About LameXP"));
167 QPushButton *firstButton = addButton(tr("Show License Text"), QMessageBox::AcceptRole);
168 firstButton->setIcon(QIcon(":/icons/script.png"));
169 firstButton->setIconSize(QSize(16, 16));
170 firstButton->setMinimumWidth(135);
171 firstButton->disconnect();
172 connect(firstButton, SIGNAL(clicked()), this, SLOT(openLicenseText()));
174 QPushButton *secondButton = addButton(tr("Accept License"), QMessageBox::AcceptRole);
175 secondButton->setIcon(QIcon(":/icons/accept.png"));
176 secondButton->setIconSize(QSize(16, 16));
177 secondButton->setMinimumWidth(120);
179 QPushButton *thirdButton = addButton(tr("Decline License"), QMessageBox::AcceptRole);
180 thirdButton->setIcon(QIcon(":/icons/delete.png"));
181 thirdButton->setIconSize(QSize(16, 16));
182 thirdButton->setMinimumWidth(120);
183 thirdButton->setEnabled(false);
187 QPushButton *firstButton = addButton(tr("3rd Party S/W"), QMessageBox::AcceptRole);
188 firstButton->setIcon(QIcon(":/icons/page_white_cplusplus.png"));
189 firstButton->setIconSize(QSize(16, 16));
190 firstButton->setMinimumWidth(120);
191 firstButton->disconnect();
192 connect(firstButton, SIGNAL(clicked()), this, SLOT(showMoreAbout()));
194 QPushButton *secondButton = addButton(tr("Contributors"), QMessageBox::AcceptRole);
195 secondButton->setIcon(QIcon(":icons/user_suit.png"));
196 secondButton->setIconSize(QSize(16, 16));
197 secondButton->setMinimumWidth(120);
198 secondButton->disconnect();
199 connect(secondButton, SIGNAL(clicked()), this, SLOT(showAboutContributors()));
201 QPushButton *thirdButton = addButton(tr("About Qt4"), QMessageBox::AcceptRole);
202 thirdButton->setIcon(QIcon(":/images/Qt.svg"));
203 thirdButton->setIconSize(QSize(16, 16));
204 thirdButton->setMinimumWidth(120);
205 thirdButton->disconnect();
206 connect(thirdButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
208 QPushButton *fourthButton = addButton(tr("Discard"), QMessageBox::AcceptRole);
209 fourthButton->setIcon(QIcon(":/icons/cross.png"));
210 fourthButton->setIconSize(QSize(16, 16));
211 fourthButton->setMinimumWidth(90);
213 QPixmap disque(":/images/Disque.png");
214 QRect screenGeometry = QApplication::desktop()->availableGeometry();
215 m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
216 m_disque->installEventFilter(this);
217 m_disque->setStyleSheet("background:transparent;");
218 m_disque->setAttribute(Qt::WA_TranslucentBackground);
219 m_disque->setGeometry(qrand() % (screenGeometry.width() - disque.width()), qrand() % (screenGeometry.height() - disque.height()), disque.width(), disque.height());
220 m_disque->setPixmap(disque);
221 m_disque->setWindowOpacity(0.01);
223 m_disqueFlags[0] = (qrand() > (RAND_MAX/2));
224 m_disqueFlags[1] = (qrand() > (RAND_MAX/2));
225 m_disqueTimer = new QTimer;
226 connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
227 m_disqueTimer->setInterval(10);
228 m_disqueTimer->start();
231 m_firstShow = firstStart;
234 AboutDialog::~AboutDialog(void)
239 LAMEXP_DELETE(m_disque);
243 m_disqueTimer->stop();
244 LAMEXP_DELETE(m_disqueTimer);
246 for(int i = 0; i < 4; i++)
248 LAMEXP_DELETE(m_cartoon[i]);
253 ////////////////////////////////////////////////////////////
255 ////////////////////////////////////////////////////////////
257 int AboutDialog::exec()
259 if(m_settings->soundsEnabled())
263 if(!playResoureSound("imageres.dll", 5080, true))
265 PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC);
270 PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
274 switch(QMessageBox::exec())
288 ////////////////////////////////////////////////////////////
290 ////////////////////////////////////////////////////////////
292 #define TEMP_HIDE_DISQUE(CMD) \
293 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}
295 void AboutDialog::enableButtons(void)
297 const QList<QAbstractButton*> buttonList = buttons();
299 for(int i = 0; i < buttonList.count(); i++)
301 buttonList.at(i)->setEnabled(true);
304 setCursor(QCursor(Qt::ArrowCursor));
307 void AboutDialog::openLicenseText(void)
309 QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt"));
312 void AboutDialog::showAboutQt(void)
316 QMessageBox::aboutQt(this);
320 void AboutDialog::showAboutContributors(void)
324 QString contributorsAboutText;
326 contributorsAboutText += QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
327 contributorsAboutText += QString("<b>%1</b>").arg(tr("Translators:"));
328 contributorsAboutText += "<table style=\"margin-top:5px\">";
329 for(int i = 0; g_lamexp_contributors[i].pcName; i++)
331 QString flagIcon = (strlen(g_lamexp_contributors[i].pcFlag) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_contributors[i].pcFlag) : QString();
332 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td> </td>").arg(flagIcon);
333 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td> </td>").arg(WCHAR2QSTR(g_lamexp_contributors[i].pcLanguage));
334 contributorsAboutText += QString("<td valign=\"middle\">%1</td><td> </td><td><a href=\"mailto:%2\"><%2></a></td></tr>").arg(WCHAR2QSTR(g_lamexp_contributors[i].pcName), g_lamexp_contributors[i].pcMail);
336 contributorsAboutText += "</table>";
337 contributorsAboutText += "<br><br>";
338 contributorsAboutText += QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
340 QMessageBox *contributorsAboutBox = new QMessageBox(this);
341 contributorsAboutBox->setText(contributorsAboutText);
342 contributorsAboutBox->setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
344 QPushButton *closeButton = contributorsAboutBox->addButton(tr("Discard"), QMessageBox::AcceptRole);
345 closeButton->setIcon(QIcon(":/icons/cross.png"));
346 closeButton->setMinimumWidth(90);
348 contributorsAboutBox->setWindowTitle(tr("About Contributors"));
349 contributorsAboutBox->setIconPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(64,74)));
350 contributorsAboutBox->setWindowIcon(QIcon(":/icons/user_suit.png"));
351 contributorsAboutBox->exec();
353 LAMEXP_DELETE(contributorsAboutBox);
357 void AboutDialog::showMoreAbout(void)
361 QString moreAboutText;
363 moreAboutText += QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
364 moreAboutText += "<div style=\"margin-left:-25px;font-size:7pt;white-space:nowrap\"><table><tr><td><ul>";
366 moreAboutText += makeToolText
368 tr("LAME - OpenSource mp3 Encoder"),
369 "lame.exe", "v?.??, Final-?",
370 tr("Released under the terms of the GNU Lesser General Public License."),
371 "http://lame.sourceforge.net/"
373 moreAboutText += makeToolText
375 tr("OggEnc - Ogg Vorbis Encoder"),
376 "oggenc2.exe", "v?.??, aoTuV Beta-?.??",
377 tr("Completely open and patent-free audio encoding technology."),
378 "http://www.vorbis.com/"
380 moreAboutText += makeToolText
382 tr("Nero AAC Reference MPEG-4 Encoder"),
383 "neroAacEnc.exe", "v?.?.?.?",
384 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
386 tr("Available from vendor web-site as free download:")
388 moreAboutText += makeToolText
390 tr("Aften - A/52 audio encoder"),
391 "aften.exe", "v?.?.?",
392 tr("Released under the terms of the GNU Lesser General Public License."),
393 "http://aften.sourceforge.net/"
395 moreAboutText += makeToolText
397 tr("FLAC - Free Lossless Audio Codec"),
398 "flac.exe", "v?.?.?",
399 tr("Open and patent-free lossless audio compression technology."),
400 "http://flac.sourceforge.net/"
402 moreAboutText += makeToolText
404 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
405 "mpg123.exe", "v?.??.?",
406 tr("Released under the terms of the GNU Lesser General Public License."),
407 "http://www.mpg123.de/"
409 moreAboutText += makeToolText
411 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
413 tr("Released under the terms of the GNU General Public License."),
414 "http://www.audiocoding.com/"
416 moreAboutText += makeToolText
418 tr("AC3Filter Tools - AC3/DTS Decoder"),
419 "valdec.exe", "v?.??",
420 tr("Released under the terms of the GNU Lesser General Public License."),
421 "http://www.ac3filter.net/projects/tools"
423 moreAboutText += makeToolText
425 tr("WavPack - Hybrid Lossless Compression"),
426 "wvunpack.exe", "v?.??.?",
427 tr("Completely open audio compression format."),
428 "http://www.wavpack.com/"
430 moreAboutText += makeToolText
432 tr("Musepack - Living Audio Compression"),
433 "mpcdec.exe", "r???",
434 tr("Released under the terms of the GNU Lesser General Public License."),
435 "http://www.musepack.net/"
437 moreAboutText += makeToolText
439 tr("Monkey's Audio - Lossless Audio Compressor"),
441 tr("Freely available source code, simple SDK and non-restrictive licensing."),
442 "http://www.monkeysaudio.com/"
444 moreAboutText += QString
446 "</ul></td><td><ul>" /* ----------------------------------------- */
448 moreAboutText += makeToolText
450 tr("Shorten - Lossless Audio Compressor"),
451 "shorten.exe", "v?.?.?",
452 tr("Released under the terms of the GNU Lesser General Public License."),
453 "http://etree.org/shnutils/shorten/"
455 moreAboutText += makeToolText
457 tr("Speex - Free Codec For Free Speech"),
458 "speexdec.exe", "v?.?",
459 tr("Open Source patent-free audio format designed for speech."),
460 "http://www.speex.org/"
462 moreAboutText += makeToolText
464 tr("The True Audio - Lossless Audio Codec"),
466 tr("Released under the terms of the GNU Lesser General Public License."),
467 "http://tta.sourceforge.net/"
469 moreAboutText += makeToolText
472 "alac.exe", "v?.?.?",
473 tr("Copyright (c) 2004 David Hammerton. Contributions by Cody Brocious."),
474 "http://craz.net/programs/itunes/alac.html"
476 moreAboutText += makeToolText
478 tr("wma2wav - Dump WMA files to Wave Audio"),
479 "wma2wav.exe", "????-??-??",
480 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
481 "http://forum.doom9.org/showthread.php?t=140273"
483 moreAboutText += makeToolText
485 tr("avs2wav - Avisynth to Wave Audio converter"),
486 "avs2wav.exe", "v?.?",
487 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
488 "http://forum.doom9.org/showthread.php?t=70882"
490 moreAboutText += makeToolText
493 "dcaenc.exe", "????-??-??",
494 tr("Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL."),
495 "http://gitorious.org/dtsenc/dtsenc/trees/master"
497 moreAboutText += makeToolText
499 tr("MediaInfo - Media File Analysis Tool"),
500 "mediainfo.exe", "v?.?.??",
501 tr("Released under the terms of the GNU Lesser General Public License."),
502 "http://mediainfo.sourceforge.net/"
504 moreAboutText += makeToolText
506 tr("SoX - Sound eXchange"),
507 "sox.exe", "v??.?.?",
508 tr("Released under the terms of the GNU Lesser General Public License."),
509 "http://sox.sourceforge.net/"
511 moreAboutText += makeToolText
513 tr("GnuPG - The GNU Privacy Guard"),
514 "gpgv.exe", "v?.?.??",
515 tr("Released under the terms of the GNU Lesser General Public License."),
516 "http://www.gnupg.org/"
518 moreAboutText += makeToolText
520 tr("GNU Wget - Software for retrieving files using HTTP"),
521 "wget.exe", "v?.??.?",
522 tr("Released under the terms of the GNU Lesser General Public License."),
523 "http://www.gnu.org/software/wget/"
525 //moreAboutText += makeToolText
527 // tr("Silk Icons - Over 700 icons in PNG format"),
528 // QString(), "v1.3",
529 // tr("By Mark James, released under the Creative Commons 'by' License."),
530 // "http://www.famfamfam.com/lab/icons/silk/"
532 moreAboutText += QString("</ul></td><td> </td></tr></table></div><i>%1</i><br>").arg
534 NOBR(tr("LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors."))
537 QMessageBox *moreAboutBox = new QMessageBox(this);
538 moreAboutBox->setText(moreAboutText);
539 moreAboutBox->setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
541 QPushButton *closeButton = moreAboutBox->addButton(tr("Discard"), QMessageBox::AcceptRole);
542 closeButton->setIcon(QIcon(":/icons/cross.png"));
543 closeButton->setMinimumWidth(90);
545 moreAboutBox->setWindowTitle(tr("About Third-party Software"));
546 moreAboutBox->setIconPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(64,71)));
547 moreAboutBox->setWindowIcon(QIcon(":/icons/page_white_cplusplus.png"));
548 moreAboutBox->exec();
550 LAMEXP_DELETE(moreAboutBox);
554 void AboutDialog::moveDisque(void)
557 LARGE_INTEGER perfCount, perfFrequ;
559 if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount))
561 if(m_disqueDelay != _I64_MAX)
563 const double delay = static_cast<double>(perfCount.QuadPart) - static_cast<double>(m_disqueDelay);
564 delta = qMax(1, qMin(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
566 m_disqueDelay = perfCount.QuadPart;
571 QRect screenGeometry = QApplication::desktop()->availableGeometry();
572 const int minX = screenGeometry.left();
573 const int maxX = screenGeometry.width() - m_disque->width() + screenGeometry.left();
574 const int minY = screenGeometry.top();
575 const int maxY = screenGeometry.height() - m_disque->height() + screenGeometry.top();
577 QPoint pos = m_disque->pos();
578 pos.setX(m_disqueFlags[0] ? pos.x() + delta : pos.x() - delta);
579 pos.setY(m_disqueFlags[1] ? pos.y() + delta : pos.y() - delta);
583 m_disqueFlags[0] = true;
587 else if(pos.x() >= maxX)
589 m_disqueFlags[0] = false;
595 m_disqueFlags[1] = true;
599 else if(pos.y() >= maxY)
601 m_disqueFlags[1] = false;
610 QPixmap *cartoon = NULL;
611 if(m_disqueFlags[0] == true && m_disqueFlags[1] != true) cartoon = m_cartoon[0];
612 if(m_disqueFlags[0] == true && m_disqueFlags[1] == true) cartoon = m_cartoon[1];
613 if(m_disqueFlags[0] != true && m_disqueFlags[1] == true) cartoon = m_cartoon[2];
614 if(m_disqueFlags[0] != true && m_disqueFlags[1] != true) cartoon = m_cartoon[3];
617 m_disque->setPixmap(*cartoon);
618 m_disque->resize(cartoon->size());
620 m_rotateNext = false;
623 if(m_disque->windowOpacity() < 0.9)
625 m_disque->setWindowOpacity(m_disque->windowOpacity() + 0.01);
629 ////////////////////////////////////////////////////////////
630 // Protected Functions
631 ////////////////////////////////////////////////////////////
633 void AboutDialog::showEvent(QShowEvent *e)
635 QDialog::showEvent(e);
638 const QList<QAbstractButton*> buttonList = buttons();
640 for(int i = 1; i < buttonList.count(); i++)
642 buttonList.at(i)->setEnabled(false);
645 QTimer::singleShot(5000, this, SLOT(enableButtons()));
646 setCursor(QCursor(Qt::WaitCursor));
650 bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
652 if((obj == m_disque) && (event->type() == QEvent::MouseButtonPress))
654 QPixmap cartoon(":/images/Cartoon.png");
655 for(int i = 0; i < 4; i++)
659 m_cartoon[i] = new QPixmap(cartoon.transformed(QMatrix().rotate(static_cast<double>(i*90) + 45.0), Qt::SmoothTransformation));
663 QDesktopServices::openUrl(QUrl(disqueUrl));
669 ////////////////////////////////////////////////////////////
671 ////////////////////////////////////////////////////////////
673 QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo)
675 QString toolText, verStr(toolVerFmt);
677 if(!toolBin.isEmpty())
679 verStr = lamexp_version2string(toolVerFmt, lamexp_tool_version(toolBin), tr("n/a"));
682 toolText += QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName, verStr)));
683 toolText += QString("%1<br>").arg(NOBR(toolLicense));
684 if(!extraInfo.isEmpty()) toolText += QString("<i>%1</i><br>").arg(NOBR(extraInfo));
685 toolText += QString("<nobr>%1</nobr>").arg(LINK(toolWebsite));
686 toolText += QString("<div style=\"font-size:1pt\"><br></div>");
692 bool AboutDialog::playResoureSound(const QString &library, const unsigned long soundId, const bool async)
695 DWORD flags = SND_RESOURCE;
698 QFileInfo libraryFile(library);
699 if(!libraryFile.isAbsolute())
701 unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1;
702 wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t));
703 unsigned int result = GetSystemDirectory(buffer, buffSize);
704 if(result > 0 && result < buffSize)
706 libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer))), library));
720 module = LoadLibraryW(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(libraryFile.absoluteFilePath()).utf16()));
724 result = PlaySound((LPCTSTR) soundId, module, flags);