1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2011 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(URL)
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=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 {"uk", L"Українська", L"Arestarh", "Arestarh@ukr.net" },
71 {NULL, NULL, NULL, NULL}
74 ////////////////////////////////////////////////////////////
76 ////////////////////////////////////////////////////////////
78 AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstStart)
85 m_disqueDelay(_I64_MAX)
87 QString versionStr = QString().sprintf
89 "Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s",
90 lamexp_version_major(),
91 lamexp_version_minor(),
92 lamexp_version_release(),
93 lamexp_version_build(),
94 lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
95 lamexp_version_compiler(),
96 lamexp_version_arch(),
100 for(int i = 0; i < 4; i++)
107 aboutText += QString("<h2>%1</h2>").arg(tr("LameXP − Audio Encoder Front-end"));
108 aboutText += QString("<nobr><b>Copyright (C) 2004-%1 LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.</b></nobr><br>").arg(max(lamexp_version_date().year(), QDate::currentDate().year())).replace("-", "−");
109 aboutText += QString("<nobr><b>%1</b></nobr><br><br>").arg(versionStr).replace("-", "−");
110 aboutText += QString("<nobr>%1</nobr><br>").arg(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url())));
114 int daysLeft = max(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
115 aboutText += QString("<hr><nobr><font color=\"crimson\">!!! %3 DEBUG BUILD %3 Expires at: %1 %3 Days left: %2 %3 DEBUG BUILD %3 !!!</font></nobr>").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft), "−−−");
117 else if(lamexp_version_demo())
119 int daysLeft = max(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
120 aboutText += QString("<hr><nobr><font color=\"crimson\">%1</font></nobr>").arg(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))).replace("-", "−");
123 aboutText += "<hr><br>";
124 aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
125 aboutText += "modify it under the terms of the GNU General Public License<br>";
126 aboutText += "as published by the Free Software Foundation; either version 2<br>";
127 aboutText += "of the License, or (at your option) any later version.<br><br>";
128 aboutText += "This program is distributed in the hope that it will be useful,<br>";
129 aboutText += "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
130 aboutText += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
131 aboutText += "GNU General Public License for more details.<br><br>";
132 aboutText += "You should have received a copy of the GNU General Public License<br>";
133 aboutText += "along with this program; if not, write to the Free Software<br>";
134 aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
135 aboutText += "<hr><table><tr>";
136 aboutText += "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
137 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 !!!"));
138 aboutText += "</tr></table><hr><br>";
139 aboutText += QString("%1<br>").arg(tr("Special thanks go out to \"John33\" from %1 for his continuous support.").arg(LINK("http://www.rarewares.org/")));
142 setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
143 setWindowTitle(tr("About LameXP"));
147 QPushButton *firstButton = addButton(tr("Show License Text"), QMessageBox::AcceptRole);
148 firstButton->setIcon(QIcon(":/icons/script.png"));
149 firstButton->setIconSize(QSize(16, 16));
150 firstButton->setMinimumWidth(135);
151 firstButton->disconnect();
152 connect(firstButton, SIGNAL(clicked()), this, SLOT(openLicenseText()));
154 QPushButton *secondButton = addButton(tr("Accept License"), QMessageBox::AcceptRole);
155 secondButton->setIcon(QIcon(":/icons/accept.png"));
156 secondButton->setIconSize(QSize(16, 16));
157 secondButton->setMinimumWidth(120);
159 QPushButton *thirdButton = addButton(tr("Decline License"), QMessageBox::AcceptRole);
160 thirdButton->setIcon(QIcon(":/icons/delete.png"));
161 thirdButton->setIconSize(QSize(16, 16));
162 thirdButton->setMinimumWidth(120);
163 thirdButton->setEnabled(false);
167 QPushButton *firstButton = addButton(tr("3rd Party S/W"), QMessageBox::AcceptRole);
168 firstButton->setIcon(QIcon(":/icons/page_white_cplusplus.png"));
169 firstButton->setIconSize(QSize(16, 16));
170 firstButton->setMinimumWidth(120);
171 firstButton->disconnect();
172 connect(firstButton, SIGNAL(clicked()), this, SLOT(showMoreAbout()));
174 QPushButton *secondButton = addButton(tr("Contributors"), QMessageBox::AcceptRole);
175 secondButton->setIcon(QIcon(":icons/user_suit.png"));
176 secondButton->setIconSize(QSize(16, 16));
177 secondButton->setMinimumWidth(120);
178 secondButton->disconnect();
179 connect(secondButton, SIGNAL(clicked()), this, SLOT(showAboutContributors()));
181 QPushButton *thirdButton = addButton(tr("About Qt4"), QMessageBox::AcceptRole);
182 thirdButton->setIcon(QIcon(":/images/Qt.svg"));
183 thirdButton->setIconSize(QSize(16, 16));
184 thirdButton->setMinimumWidth(120);
185 thirdButton->disconnect();
186 connect(thirdButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
188 QPushButton *fourthButton = addButton(tr("Discard"), QMessageBox::AcceptRole);
189 fourthButton->setIcon(QIcon(":/icons/cross.png"));
190 fourthButton->setIconSize(QSize(16, 16));
191 fourthButton->setMinimumWidth(90);
193 QPixmap disque(":/images/Disque.png");
194 QRect screenGeometry = QApplication::desktop()->availableGeometry();
195 m_disque = new QLabel(this, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
196 m_disque->installEventFilter(this);
197 m_disque->setStyleSheet("background:transparent;");
198 m_disque->setAttribute(Qt::WA_TranslucentBackground);
199 m_disque->setGeometry(qrand() % (screenGeometry.width() - disque.width()), qrand() % (screenGeometry.height() - disque.height()), disque.width(), disque.height());
200 m_disque->setPixmap(disque);
201 m_disque->setWindowOpacity(0.01);
203 m_disqueFlags[0] = (qrand() > (RAND_MAX/2));
204 m_disqueFlags[1] = (qrand() > (RAND_MAX/2));
205 m_disqueTimer = new QTimer;
206 connect(m_disqueTimer, SIGNAL(timeout()), this, SLOT(moveDisque()));
207 m_disqueTimer->setInterval(10);
208 m_disqueTimer->start();
211 m_firstShow = firstStart;
214 AboutDialog::~AboutDialog(void)
219 LAMEXP_DELETE(m_disque);
223 m_disqueTimer->stop();
224 LAMEXP_DELETE(m_disqueTimer);
226 for(int i = 0; i < 4; i++)
228 LAMEXP_DELETE(m_cartoon[i]);
233 ////////////////////////////////////////////////////////////
235 ////////////////////////////////////////////////////////////
237 int AboutDialog::exec()
239 if(m_settings->soundsEnabled())
243 if(!playResoureSound("imageres.dll", 5080, true))
245 PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC);
250 PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
254 switch(QMessageBox::exec())
268 ////////////////////////////////////////////////////////////
270 ////////////////////////////////////////////////////////////
272 #define TEMP_HIDE_DISQUE(CMD) \
273 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}
275 void AboutDialog::enableButtons(void)
277 const QList<QAbstractButton*> buttonList = buttons();
279 for(int i = 0; i < buttonList.count(); i++)
281 buttonList.at(i)->setEnabled(true);
284 setCursor(QCursor(Qt::ArrowCursor));
287 void AboutDialog::openLicenseText(void)
289 QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt"));
292 void AboutDialog::showAboutQt(void)
296 QMessageBox::aboutQt(this);
300 void AboutDialog::showAboutContributors(void)
304 QString contributorsAboutText;
306 contributorsAboutText += QString("<h3><nobr>%1</nobr></h3>").arg(tr("The following people have contributed to LameXP:"));
307 contributorsAboutText += QString("<b>%1</b>").arg(tr("Translators:"));
308 contributorsAboutText += "<table style=\"margin-top:5px\">";
309 for(int i = 0; g_lamexp_contributors[i].pcName; i++)
311 QString flagIcon = (strlen(g_lamexp_contributors[i].pcFlag) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_contributors[i].pcFlag) : QString();
312 contributorsAboutText += QString("<tr><td valign=\"middle\">%1</td><td> </td>").arg(flagIcon);
313 contributorsAboutText += QString("<td valign=\"middle\">%2</td><td> </td>").arg(WCHAR2QSTR(g_lamexp_contributors[i].pcLanguage));
314 contributorsAboutText += QString("<td valign=\"middle\">%3</td><td> </td><td><%4></td></tr>").arg(WCHAR2QSTR(g_lamexp_contributors[i].pcName), g_lamexp_contributors[i].pcMail);
316 contributorsAboutText += "</table>";
317 contributorsAboutText += "<br><br>";
318 contributorsAboutText += QString("<nobr><i>%1</i></nobr><br>").arg(tr("If you are willing to contribute a LameXP translation, feel free to contact us!"));
320 QMessageBox *contributorsAboutBox = new QMessageBox(this);
321 contributorsAboutBox->setText(contributorsAboutText);
322 contributorsAboutBox->setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
324 QPushButton *closeButton = contributorsAboutBox->addButton(tr("Discard"), QMessageBox::AcceptRole);
325 closeButton->setIcon(QIcon(":/icons/cross.png"));
326 closeButton->setMinimumWidth(90);
328 contributorsAboutBox->setWindowTitle(tr("About Contributors"));
329 contributorsAboutBox->setIconPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(64,74)));
330 contributorsAboutBox->setWindowIcon(QIcon(":/icons/user_suit.png"));
331 contributorsAboutBox->exec();
333 LAMEXP_DELETE(contributorsAboutBox);
337 void AboutDialog::showMoreAbout(void)
341 QString moreAboutText;
343 moreAboutText += QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
344 moreAboutText += "<div style=\"margin-left:-25px;font-size:7pt;white-space:nowrap\"><table><tr><td><ul>";
346 moreAboutText += makeToolText
348 tr("LAME − OpenSource mp3 Encoder"),
349 "lame.exe", "v?.??, Beta-?",
350 tr("Released under the terms of the GNU Lesser General Public License."),
351 "http://lame.sourceforge.net/"
353 moreAboutText += makeToolText
355 tr("OggEnc − Ogg Vorbis Encoder"),
356 "oggenc2.exe", "v?.??, aoTuV Beta-?.??",
357 tr("Completely open and patent-free audio encoding technology."),
358 "http://www.vorbis.com/"
360 moreAboutText += makeToolText
362 tr("Nero AAC Reference MPEG-4 Encoder"),
363 "neroAacEnc.exe", "v?.?.?.?",
364 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
366 tr("Available from vendor web-site as free download:")
368 moreAboutText += makeToolText
370 tr("Aften − A/52 audio encoder"),
371 "aften.exe", "v?.?.?",
372 tr("Released under the terms of the GNU Lesser General Public License."),
373 "http://aften.sourceforge.net/"
375 moreAboutText += makeToolText
377 tr("FLAC − Free Lossless Audio Codec"),
378 "flac.exe", "v?.?.?",
379 tr("Open and patent-free lossless audio compression technology."),
380 "http://flac.sourceforge.net/"
382 moreAboutText += makeToolText
384 tr("mpg123 − Fast Console MPEG Audio Player/Decoder"),
385 "mpg123.exe", "v?.??.?",
386 tr("Released under the terms of the GNU Lesser General Public License."),
387 "http://www.mpg123.de/"
389 moreAboutText += makeToolText
391 tr("FAAD − OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
393 tr("Released under the terms of the GNU General Public License."),
394 "http://www.audiocoding.com/"
396 moreAboutText += makeToolText
398 tr("AC3Filter Tools − AC3/DTS Decoder"),
399 "valdec.exe", "v?.??",
400 tr("Released under the terms of the GNU Lesser General Public License."),
401 "http://www.ac3filter.net/projects/tools"
403 moreAboutText += makeToolText
405 tr("WavPack − Hybrid Lossless Compression"),
406 "wvunpack.exe", "v?.??.?",
407 tr("Completely open audio compression format."),
408 "http://www.wavpack.com/"
410 moreAboutText += makeToolText
412 tr("Musepack − Living Audio Compression"),
413 "mpcdec.exe", "r???",
414 tr("Released under the terms of the GNU Lesser General Public License."),
415 "http://www.musepack.net/"
417 moreAboutText += makeToolText
419 tr("Monkey's Audio − Lossless Audio Compressor"),
421 tr("Freely available source code, simple SDK and non-restrictive licensing."),
422 "http://www.monkeysaudio.com/"
424 moreAboutText += QString
428 moreAboutText += makeToolText
430 tr("Shorten − Lossless Audio Compressor"),
431 "shorten.exe", "v?.?.?",
432 tr("Released under the terms of the GNU Lesser General Public License."),
433 "http://etree.org/shnutils/shorten/"
435 moreAboutText += makeToolText
437 tr("Speex − Free Codec For Free Speech"),
438 "speexdec.exe", "v?.?",
439 tr("Open Source patent-free audio format designed for speech."),
440 "http://www.speex.org/"
442 moreAboutText += makeToolText
444 tr("The True Audio − Lossless Audio Codec"),
446 tr("Released under the terms of the GNU Lesser General Public License."),
447 "http://tta.sourceforge.net/"
449 moreAboutText += makeToolText
452 "alac.exe", "v?.?.?",
453 tr("Copyright (c) 2004 David Hammerton. Contributions by Cody Brocious."),
454 "http://craz.net/programs/itunes/alac.html"
456 moreAboutText += makeToolText
458 tr("wma2wav − Dump WMA files to Wave Audio"),
459 "wma2wav.exe", "????-??-??",
460 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
461 "http://forum.doom9.org/showthread.php?t=140273"
463 moreAboutText += makeToolText
465 tr("avs2wav − Avisynth to Wave Audio converter"),
466 "avs2wav.exe", "v?.?",
467 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
468 "http://forum.doom9.org/showthread.php?t=70882"
470 moreAboutText += makeToolText
472 tr("MediaInfo − Media File Analysis Tool"),
473 "mediainfo.exe", "v?.?.??",
474 tr("Released under the terms of the GNU Lesser General Public License."),
475 "http://mediainfo.sourceforge.net/"
477 moreAboutText += makeToolText
479 tr("SoX − Sound eXchange"),
480 "sox.exe", "v??.?.?",
481 tr("Released under the terms of the GNU Lesser General Public License."),
482 "http://sox.sourceforge.net/"
484 moreAboutText += makeToolText
486 tr("GnuPG − The GNU Privacy Guard"),
487 "gpgv.exe", "v?.?.??",
488 tr("Released under the terms of the GNU Lesser General Public License."),
489 "http://www.gnupg.org/"
491 moreAboutText += makeToolText
493 tr("GNU Wget − Software for retrieving files using HTTP"),
494 "wget.exe", "v?.??.?",
495 tr("Released under the terms of the GNU Lesser General Public License."),
496 "http://www.gnu.org/software/wget/"
498 moreAboutText += makeToolText
500 tr("Silk Icons − Over 700 icons in PNG format"),
502 tr("By Mark James, released under the Creative Commons 'by' License."),
503 "http://www.famfamfam.com/lab/icons/silk/"
505 moreAboutText += QString("</ul></td><td> </td></tr></table></div><i><nobr>%1</nobr></i><br>").arg
507 tr("LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of thrird-party software used in LameXP belongs to the individual authors.").replace("-", "−")
510 QMessageBox *moreAboutBox = new QMessageBox(this);
511 moreAboutBox->setText(moreAboutText);
512 moreAboutBox->setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
514 QPushButton *closeButton = moreAboutBox->addButton(tr("Discard"), QMessageBox::AcceptRole);
515 closeButton->setIcon(QIcon(":/icons/cross.png"));
516 closeButton->setMinimumWidth(90);
518 moreAboutBox->setWindowTitle(tr("About Third-party Software"));
519 moreAboutBox->setIconPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(64,71)));
520 moreAboutBox->setWindowIcon(QIcon(":/icons/page_white_cplusplus.png"));
521 moreAboutBox->exec();
523 LAMEXP_DELETE(moreAboutBox);
527 void AboutDialog::moveDisque(void)
530 LARGE_INTEGER perfCount, perfFrequ;
532 if(QueryPerformanceFrequency(&perfFrequ) && QueryPerformanceCounter(&perfCount))
534 if(m_disqueDelay != _I64_MAX)
536 const double delay = static_cast<double>(perfCount.QuadPart) - static_cast<double>(m_disqueDelay);
537 delta = max(1, min(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
539 m_disqueDelay = perfCount.QuadPart;
544 QRect screenGeometry = QApplication::desktop()->availableGeometry();
545 const int minX = screenGeometry.left();
546 const int maxX = screenGeometry.width() - m_disque->width() + screenGeometry.left();
547 const int minY = screenGeometry.top();
548 const int maxY = screenGeometry.height() - m_disque->height() + screenGeometry.top();
550 QPoint pos = m_disque->pos();
551 pos.setX(m_disqueFlags[0] ? pos.x() + delta : pos.x() - delta);
552 pos.setY(m_disqueFlags[1] ? pos.y() + delta : pos.y() - delta);
556 m_disqueFlags[0] = true;
560 else if(pos.x() >= maxX)
562 m_disqueFlags[0] = false;
568 m_disqueFlags[1] = true;
572 else if(pos.y() >= maxY)
574 m_disqueFlags[1] = false;
583 QPixmap *cartoon = NULL;
584 if(m_disqueFlags[0] == true && m_disqueFlags[1] != true) cartoon = m_cartoon[0];
585 if(m_disqueFlags[0] == true && m_disqueFlags[1] == true) cartoon = m_cartoon[1];
586 if(m_disqueFlags[0] != true && m_disqueFlags[1] == true) cartoon = m_cartoon[2];
587 if(m_disqueFlags[0] != true && m_disqueFlags[1] != true) cartoon = m_cartoon[3];
590 m_disque->setPixmap(*cartoon);
591 m_disque->resize(cartoon->size());
593 m_rotateNext = false;
596 if(m_disque->windowOpacity() < 0.9)
598 m_disque->setWindowOpacity(m_disque->windowOpacity() + 0.01);
602 ////////////////////////////////////////////////////////////
603 // Protected Functions
604 ////////////////////////////////////////////////////////////
606 void AboutDialog::showEvent(QShowEvent *e)
608 QDialog::showEvent(e);
611 const QList<QAbstractButton*> buttonList = buttons();
613 for(int i = 1; i < buttonList.count(); i++)
615 buttonList.at(i)->setEnabled(false);
618 QTimer::singleShot(5000, this, SLOT(enableButtons()));
619 setCursor(QCursor(Qt::WaitCursor));
623 bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
625 if((obj == m_disque) && (event->type() == QEvent::MouseButtonPress))
627 QPixmap cartoon(":/images/Cartoon.png");
628 for(int i = 0; i < 4; i++)
632 m_cartoon[i] = new QPixmap(cartoon.transformed(QMatrix().rotate(static_cast<double>(i*90) + 45.0), Qt::SmoothTransformation));
636 QDesktopServices::openUrl(QUrl(disqueUrl));
642 ////////////////////////////////////////////////////////////
644 ////////////////////////////////////////////////////////////
646 QString AboutDialog::makeToolText(const QString &toolName, const QString &toolBin, const QString &toolVerFmt, const QString &toolLicense, const QString &toolWebsite, const QString &extraInfo)
648 QString toolText, verStr(toolVerFmt);
650 if(!toolBin.isEmpty())
652 verStr = lamexp_version2string(toolVerFmt, lamexp_tool_version(toolBin), tr("n/a"));
655 toolText += QString("<li><nobr><b>%1 (%2)</b></nobr><br>").arg(toolName, verStr);
656 toolText += QString("<nobr>%1</nobr><br>").arg(toolLicense);
657 if(!extraInfo.isEmpty()) toolText += QString("<nobr><i>%1</i></nobr><br>").arg(extraInfo);
658 toolText += QString("<a href=\"%1\">%1</a>").arg(toolWebsite);
659 toolText += QString("<div style=\"font-size:1pt\"><br></div>");
665 bool AboutDialog::playResoureSound(const QString &library, const unsigned long soundId, const bool async)
668 DWORD flags = SND_RESOURCE;
671 QFileInfo libraryFile(library);
672 if(!libraryFile.isAbsolute())
674 unsigned int buffSize = GetSystemDirectoryW(NULL, NULL) + 1;
675 wchar_t *buffer = (wchar_t*) _malloca(buffSize * sizeof(wchar_t));
676 unsigned int result = GetSystemDirectory(buffer, buffSize);
677 if(result > 0 && result < buffSize)
679 libraryFile.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer))), library));
693 module = LoadLibraryW(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(libraryFile.absoluteFilePath()).utf16()));
697 result = PlaySound((LPCTSTR) soundId, module, flags);