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(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 {"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 const 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(),
99 const QString copyrightStr
= QString().sprintf
101 "Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved.",
102 max(lamexp_version_date().year(), QDate::currentDate().year())
105 for(int i
= 0; i
< 4; i
++)
112 aboutText
+= QString("<h2>%1</h2>").arg(NOBR(tr("LameXP - Audio Encoder Front-end")));
113 aboutText
+= QString("<b>%1</b><br>").arg(NOBR(copyrightStr
));
114 aboutText
+= QString("<b>%1</b><br><br>").arg(NOBR(versionStr
));
115 aboutText
+= QString("%1<br>").arg(NOBR(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))));
119 int daysLeft
= max(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
120 aboutText
+= QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD %3 Expires at: %1 %3 Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate
), QString::number(daysLeft
))));
122 else if(lamexp_version_demo())
124 int daysLeft
= max(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
125 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
))));
128 aboutText
+= "<hr><br>";
129 aboutText
+= "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
130 aboutText
+= "modify it under the terms of the GNU General Public License<br>";
131 aboutText
+= "as published by the Free Software Foundation; either version 2<br>";
132 aboutText
+= "of the License, or (at your option) any later version.<br><br>";
133 aboutText
+= "This program is distributed in the hope that it will be useful,<br>";
134 aboutText
+= "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>";
135 aboutText
+= "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>";
136 aboutText
+= "GNU General Public License for more details.<br><br>";
137 aboutText
+= "You should have received a copy of the GNU General Public License<br>";
138 aboutText
+= "along with this program; if not, write to the Free Software<br>";
139 aboutText
+= "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br>";
140 aboutText
+= "<hr><table><tr>";
141 aboutText
+= "<td valign=\"middle\"><img src=\":/icons/error_big.png\"</td><td> </td>";
142 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 !!!"));
143 aboutText
+= "</tr></table><hr><br>";
144 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/")));
147 setIconPixmap(dynamic_cast<QApplication
*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
148 setWindowTitle(tr("About LameXP"));
152 QPushButton
*firstButton
= addButton(tr("Show License Text"), QMessageBox::AcceptRole
);
153 firstButton
->setIcon(QIcon(":/icons/script.png"));
154 firstButton
->setIconSize(QSize(16, 16));
155 firstButton
->setMinimumWidth(135);
156 firstButton
->disconnect();
157 connect(firstButton
, SIGNAL(clicked()), this, SLOT(openLicenseText()));
159 QPushButton
*secondButton
= addButton(tr("Accept License"), QMessageBox::AcceptRole
);
160 secondButton
->setIcon(QIcon(":/icons/accept.png"));
161 secondButton
->setIconSize(QSize(16, 16));
162 secondButton
->setMinimumWidth(120);
164 QPushButton
*thirdButton
= addButton(tr("Decline License"), QMessageBox::AcceptRole
);
165 thirdButton
->setIcon(QIcon(":/icons/delete.png"));
166 thirdButton
->setIconSize(QSize(16, 16));
167 thirdButton
->setMinimumWidth(120);
168 thirdButton
->setEnabled(false);
172 QPushButton
*firstButton
= addButton(tr("3rd Party S/W"), QMessageBox::AcceptRole
);
173 firstButton
->setIcon(QIcon(":/icons/page_white_cplusplus.png"));
174 firstButton
->setIconSize(QSize(16, 16));
175 firstButton
->setMinimumWidth(120);
176 firstButton
->disconnect();
177 connect(firstButton
, SIGNAL(clicked()), this, SLOT(showMoreAbout()));
179 QPushButton
*secondButton
= addButton(tr("Contributors"), QMessageBox::AcceptRole
);
180 secondButton
->setIcon(QIcon(":icons/user_suit.png"));
181 secondButton
->setIconSize(QSize(16, 16));
182 secondButton
->setMinimumWidth(120);
183 secondButton
->disconnect();
184 connect(secondButton
, SIGNAL(clicked()), this, SLOT(showAboutContributors()));
186 QPushButton
*thirdButton
= addButton(tr("About Qt4"), QMessageBox::AcceptRole
);
187 thirdButton
->setIcon(QIcon(":/images/Qt.svg"));
188 thirdButton
->setIconSize(QSize(16, 16));
189 thirdButton
->setMinimumWidth(120);
190 thirdButton
->disconnect();
191 connect(thirdButton
, SIGNAL(clicked()), this, SLOT(showAboutQt()));
193 QPushButton
*fourthButton
= addButton(tr("Discard"), QMessageBox::AcceptRole
);
194 fourthButton
->setIcon(QIcon(":/icons/cross.png"));
195 fourthButton
->setIconSize(QSize(16, 16));
196 fourthButton
->setMinimumWidth(90);
198 QPixmap
disque(":/images/Disque.png");
199 QRect screenGeometry
= QApplication::desktop()->availableGeometry();
200 m_disque
= new QLabel(this, Qt::Window
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint
);
201 m_disque
->installEventFilter(this);
202 m_disque
->setStyleSheet("background:transparent;");
203 m_disque
->setAttribute(Qt::WA_TranslucentBackground
);
204 m_disque
->setGeometry(qrand() % (screenGeometry
.width() - disque
.width()), qrand() % (screenGeometry
.height() - disque
.height()), disque
.width(), disque
.height());
205 m_disque
->setPixmap(disque
);
206 m_disque
->setWindowOpacity(0.01);
208 m_disqueFlags
[0] = (qrand() > (RAND_MAX
/2));
209 m_disqueFlags
[1] = (qrand() > (RAND_MAX
/2));
210 m_disqueTimer
= new QTimer
;
211 connect(m_disqueTimer
, SIGNAL(timeout()), this, SLOT(moveDisque()));
212 m_disqueTimer
->setInterval(10);
213 m_disqueTimer
->start();
216 m_firstShow
= firstStart
;
219 AboutDialog::~AboutDialog(void)
224 LAMEXP_DELETE(m_disque
);
228 m_disqueTimer
->stop();
229 LAMEXP_DELETE(m_disqueTimer
);
231 for(int i
= 0; i
< 4; i
++)
233 LAMEXP_DELETE(m_cartoon
[i
]);
238 ////////////////////////////////////////////////////////////
240 ////////////////////////////////////////////////////////////
242 int AboutDialog::exec()
244 if(m_settings
->soundsEnabled())
248 if(!playResoureSound("imageres.dll", 5080, true))
250 PlaySound(TEXT("SystemStart"), NULL
, SND_ALIAS
| SND_ASYNC
);
255 PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT
), GetModuleHandle(NULL
), SND_RESOURCE
| SND_ASYNC
);
259 switch(QMessageBox::exec())
273 ////////////////////////////////////////////////////////////
275 ////////////////////////////////////////////////////////////
277 #define TEMP_HIDE_DISQUE(CMD) \
278 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}
280 void AboutDialog::enableButtons(void)
282 const QList
<QAbstractButton
*> buttonList
= buttons();
284 for(int i
= 0; i
< buttonList
.count(); i
++)
286 buttonList
.at(i
)->setEnabled(true);
289 setCursor(QCursor(Qt::ArrowCursor
));
292 void AboutDialog::openLicenseText(void)
294 QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt"));
297 void AboutDialog::showAboutQt(void)
301 QMessageBox::aboutQt(this);
305 void AboutDialog::showAboutContributors(void)
309 QString contributorsAboutText
;
311 contributorsAboutText
+= QString("<h3>%1</h3>").arg(NOBR(tr("The following people have contributed to LameXP:")));
312 contributorsAboutText
+= QString("<b>%1</b>").arg(tr("Translators:"));
313 contributorsAboutText
+= "<table style=\"margin-top:5px\">";
314 for(int i
= 0; g_lamexp_contributors
[i
].pcName
; i
++)
316 QString flagIcon
= (strlen(g_lamexp_contributors
[i
].pcFlag
) > 0) ? QString("<img src=\":/flags/%1.png\">").arg(g_lamexp_contributors
[i
].pcFlag
) : QString();
317 contributorsAboutText
+= QString("<tr><td valign=\"middle\">%1</td><td> </td>").arg(flagIcon
);
318 contributorsAboutText
+= QString("<td valign=\"middle\">%1</td><td> </td>").arg(WCHAR2QSTR(g_lamexp_contributors
[i
].pcLanguage
));
319 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
);
321 contributorsAboutText
+= "</table>";
322 contributorsAboutText
+= "<br><br>";
323 contributorsAboutText
+= QString("<i>%1</i><br>").arg(NOBR(tr("If you are willing to contribute a LameXP translation, feel free to contact us!")));
325 QMessageBox
*contributorsAboutBox
= new QMessageBox(this);
326 contributorsAboutBox
->setText(contributorsAboutText
);
327 contributorsAboutBox
->setIconPixmap(dynamic_cast<QApplication
*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
329 QPushButton
*closeButton
= contributorsAboutBox
->addButton(tr("Discard"), QMessageBox::AcceptRole
);
330 closeButton
->setIcon(QIcon(":/icons/cross.png"));
331 closeButton
->setMinimumWidth(90);
333 contributorsAboutBox
->setWindowTitle(tr("About Contributors"));
334 contributorsAboutBox
->setIconPixmap(QIcon(":/images/Logo_Contributors.png").pixmap(QSize(64,74)));
335 contributorsAboutBox
->setWindowIcon(QIcon(":/icons/user_suit.png"));
336 contributorsAboutBox
->exec();
338 LAMEXP_DELETE(contributorsAboutBox
);
342 void AboutDialog::showMoreAbout(void)
346 QString moreAboutText
;
348 moreAboutText
+= QString("<h3>%1</h3>").arg(tr("The following third-party software is used in LameXP:"));
349 moreAboutText
+= "<div style=\"margin-left:-25px;font-size:7pt;white-space:nowrap\"><table><tr><td><ul>";
351 moreAboutText
+= makeToolText
353 tr("LAME - OpenSource mp3 Encoder"),
354 "lame.exe", "v?.??, Beta-?",
355 tr("Released under the terms of the GNU Lesser General Public License."),
356 "http://lame.sourceforge.net/"
358 moreAboutText
+= makeToolText
360 tr("OggEnc - Ogg Vorbis Encoder"),
361 "oggenc2.exe", "v?.??, aoTuV Beta-?.??",
362 tr("Completely open and patent-free audio encoding technology."),
363 "http://www.vorbis.com/"
365 moreAboutText
+= makeToolText
367 tr("Nero AAC Reference MPEG-4 Encoder"),
368 "neroAacEnc.exe", "v?.?.?.?",
369 tr("Freeware state-of-the-art HE-AAC encoder with 2-Pass support."),
371 tr("Available from vendor web-site as free download:")
373 moreAboutText
+= makeToolText
375 tr("Aften - A/52 audio encoder"),
376 "aften.exe", "v?.?.?",
377 tr("Released under the terms of the GNU Lesser General Public License."),
378 "http://aften.sourceforge.net/"
380 moreAboutText
+= makeToolText
382 tr("FLAC - Free Lossless Audio Codec"),
383 "flac.exe", "v?.?.?",
384 tr("Open and patent-free lossless audio compression technology."),
385 "http://flac.sourceforge.net/"
387 moreAboutText
+= makeToolText
389 tr("mpg123 - Fast Console MPEG Audio Player/Decoder"),
390 "mpg123.exe", "v?.??.?",
391 tr("Released under the terms of the GNU Lesser General Public License."),
392 "http://www.mpg123.de/"
394 moreAboutText
+= makeToolText
396 tr("FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder"),
398 tr("Released under the terms of the GNU General Public License."),
399 "http://www.audiocoding.com/"
401 moreAboutText
+= makeToolText
403 tr("AC3Filter Tools - AC3/DTS Decoder"),
404 "valdec.exe", "v?.??",
405 tr("Released under the terms of the GNU Lesser General Public License."),
406 "http://www.ac3filter.net/projects/tools"
408 moreAboutText
+= makeToolText
410 tr("WavPack - Hybrid Lossless Compression"),
411 "wvunpack.exe", "v?.??.?",
412 tr("Completely open audio compression format."),
413 "http://www.wavpack.com/"
415 moreAboutText
+= makeToolText
417 tr("Musepack - Living Audio Compression"),
418 "mpcdec.exe", "r???",
419 tr("Released under the terms of the GNU Lesser General Public License."),
420 "http://www.musepack.net/"
422 moreAboutText
+= makeToolText
424 tr("Monkey's Audio - Lossless Audio Compressor"),
426 tr("Freely available source code, simple SDK and non-restrictive licensing."),
427 "http://www.monkeysaudio.com/"
429 moreAboutText
+= QString
433 moreAboutText
+= makeToolText
435 tr("Shorten - Lossless Audio Compressor"),
436 "shorten.exe", "v?.?.?",
437 tr("Released under the terms of the GNU Lesser General Public License."),
438 "http://etree.org/shnutils/shorten/"
440 moreAboutText
+= makeToolText
442 tr("Speex - Free Codec For Free Speech"),
443 "speexdec.exe", "v?.?",
444 tr("Open Source patent-free audio format designed for speech."),
445 "http://www.speex.org/"
447 moreAboutText
+= makeToolText
449 tr("The True Audio - Lossless Audio Codec"),
451 tr("Released under the terms of the GNU Lesser General Public License."),
452 "http://tta.sourceforge.net/"
454 moreAboutText
+= makeToolText
457 "alac.exe", "v?.?.?",
458 tr("Copyright (c) 2004 David Hammerton. Contributions by Cody Brocious."),
459 "http://craz.net/programs/itunes/alac.html"
461 moreAboutText
+= makeToolText
463 tr("wma2wav - Dump WMA files to Wave Audio"),
464 "wma2wav.exe", "????-??-??",
465 tr("Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved."),
466 "http://forum.doom9.org/showthread.php?t=140273"
468 moreAboutText
+= makeToolText
470 tr("avs2wav - Avisynth to Wave Audio converter"),
471 "avs2wav.exe", "v?.?",
472 tr("By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>."),
473 "http://forum.doom9.org/showthread.php?t=70882"
475 moreAboutText
+= makeToolText
477 tr("MediaInfo - Media File Analysis Tool"),
478 "mediainfo.exe", "v?.?.??",
479 tr("Released under the terms of the GNU Lesser General Public License."),
480 "http://mediainfo.sourceforge.net/"
482 moreAboutText
+= makeToolText
484 tr("SoX - Sound eXchange"),
485 "sox.exe", "v??.?.?",
486 tr("Released under the terms of the GNU Lesser General Public License."),
487 "http://sox.sourceforge.net/"
489 moreAboutText
+= makeToolText
491 tr("GnuPG - The GNU Privacy Guard"),
492 "gpgv.exe", "v?.?.??",
493 tr("Released under the terms of the GNU Lesser General Public License."),
494 "http://www.gnupg.org/"
496 moreAboutText
+= makeToolText
498 tr("GNU Wget - Software for retrieving files using HTTP"),
499 "wget.exe", "v?.??.?",
500 tr("Released under the terms of the GNU Lesser General Public License."),
501 "http://www.gnu.org/software/wget/"
503 moreAboutText
+= makeToolText
505 tr("Silk Icons - Over 700 icons in PNG format"),
507 tr("By Mark James, released under the Creative Commons 'by' License."),
508 "http://www.famfamfam.com/lab/icons/silk/"
510 moreAboutText
+= QString("</ul></td><td> </td></tr></table></div><i>%1</i><br>").arg
512 NOBR(tr("LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of thrird-party software used in LameXP belongs to the individual authors."))
515 QMessageBox
*moreAboutBox
= new QMessageBox(this);
516 moreAboutBox
->setText(moreAboutText
);
517 moreAboutBox
->setIconPixmap(dynamic_cast<QApplication
*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
519 QPushButton
*closeButton
= moreAboutBox
->addButton(tr("Discard"), QMessageBox::AcceptRole
);
520 closeButton
->setIcon(QIcon(":/icons/cross.png"));
521 closeButton
->setMinimumWidth(90);
523 moreAboutBox
->setWindowTitle(tr("About Third-party Software"));
524 moreAboutBox
->setIconPixmap(QIcon(":/images/Logo_Software.png").pixmap(QSize(64,71)));
525 moreAboutBox
->setWindowIcon(QIcon(":/icons/page_white_cplusplus.png"));
526 moreAboutBox
->exec();
528 LAMEXP_DELETE(moreAboutBox
);
532 void AboutDialog::moveDisque(void)
535 LARGE_INTEGER perfCount
, perfFrequ
;
537 if(QueryPerformanceFrequency(&perfFrequ
) && QueryPerformanceCounter(&perfCount
))
539 if(m_disqueDelay
!= _I64_MAX
)
541 const double delay
= static_cast<double>(perfCount
.QuadPart
) - static_cast<double>(m_disqueDelay
);
542 delta
= max(1, min(128, static_cast<int>(ceil(delay
/ static_cast<double>(perfFrequ
.QuadPart
) / 0.00512))));
544 m_disqueDelay
= perfCount
.QuadPart
;
549 QRect screenGeometry
= QApplication::desktop()->availableGeometry();
550 const int minX
= screenGeometry
.left();
551 const int maxX
= screenGeometry
.width() - m_disque
->width() + screenGeometry
.left();
552 const int minY
= screenGeometry
.top();
553 const int maxY
= screenGeometry
.height() - m_disque
->height() + screenGeometry
.top();
555 QPoint pos
= m_disque
->pos();
556 pos
.setX(m_disqueFlags
[0] ? pos
.x() + delta
: pos
.x() - delta
);
557 pos
.setY(m_disqueFlags
[1] ? pos
.y() + delta
: pos
.y() - delta
);
561 m_disqueFlags
[0] = true;
565 else if(pos
.x() >= maxX
)
567 m_disqueFlags
[0] = false;
573 m_disqueFlags
[1] = true;
577 else if(pos
.y() >= maxY
)
579 m_disqueFlags
[1] = false;
588 QPixmap
*cartoon
= NULL
;
589 if(m_disqueFlags
[0] == true && m_disqueFlags
[1] != true) cartoon
= m_cartoon
[0];
590 if(m_disqueFlags
[0] == true && m_disqueFlags
[1] == true) cartoon
= m_cartoon
[1];
591 if(m_disqueFlags
[0] != true && m_disqueFlags
[1] == true) cartoon
= m_cartoon
[2];
592 if(m_disqueFlags
[0] != true && m_disqueFlags
[1] != true) cartoon
= m_cartoon
[3];
595 m_disque
->setPixmap(*cartoon
);
596 m_disque
->resize(cartoon
->size());
598 m_rotateNext
= false;
601 if(m_disque
->windowOpacity() < 0.9)
603 m_disque
->setWindowOpacity(m_disque
->windowOpacity() + 0.01);
607 ////////////////////////////////////////////////////////////
608 // Protected Functions
609 ////////////////////////////////////////////////////////////
611 void AboutDialog::showEvent(QShowEvent
*e
)
613 QDialog::showEvent(e
);
616 const QList
<QAbstractButton
*> buttonList
= buttons();
618 for(int i
= 1; i
< buttonList
.count(); i
++)
620 buttonList
.at(i
)->setEnabled(false);
623 QTimer::singleShot(5000, this, SLOT(enableButtons()));
624 setCursor(QCursor(Qt::WaitCursor
));
628 bool AboutDialog::eventFilter(QObject
*obj
, QEvent
*event
)
630 if((obj
== m_disque
) && (event
->type() == QEvent::MouseButtonPress
))
632 QPixmap
cartoon(":/images/Cartoon.png");
633 for(int i
= 0; i
< 4; i
++)
637 m_cartoon
[i
] = new QPixmap(cartoon
.transformed(QMatrix().rotate(static_cast<double>(i
*90) + 45.0), Qt::SmoothTransformation
));
641 QDesktopServices::openUrl(QUrl(disqueUrl
));
647 ////////////////////////////////////////////////////////////
649 ////////////////////////////////////////////////////////////
651 QString
AboutDialog::makeToolText(const QString
&toolName
, const QString
&toolBin
, const QString
&toolVerFmt
, const QString
&toolLicense
, const QString
&toolWebsite
, const QString
&extraInfo
)
653 QString toolText
, verStr(toolVerFmt
);
655 if(!toolBin
.isEmpty())
657 verStr
= lamexp_version2string(toolVerFmt
, lamexp_tool_version(toolBin
), tr("n/a"));
660 toolText
+= QString("<li>%1<br>").arg(NOBR(QString("<b>%1 (%2)</b>").arg(toolName
, verStr
)));
661 toolText
+= QString("%1<br>").arg(NOBR(toolLicense
));
662 if(!extraInfo
.isEmpty()) toolText
+= QString("<i>%1</i><br>").arg(NOBR(extraInfo
));
663 toolText
+= QString("<nobr>%1</nobr>").arg(LINK(toolWebsite
));
664 toolText
+= QString("<div style=\"font-size:1pt\"><br></div>");
670 bool AboutDialog::playResoureSound(const QString
&library
, const unsigned long soundId
, const bool async
)
673 DWORD flags
= SND_RESOURCE
;
676 QFileInfo
libraryFile(library
);
677 if(!libraryFile
.isAbsolute())
679 unsigned int buffSize
= GetSystemDirectoryW(NULL
, NULL
) + 1;
680 wchar_t *buffer
= (wchar_t*) _malloca(buffSize
* sizeof(wchar_t));
681 unsigned int result
= GetSystemDirectory(buffer
, buffSize
);
682 if(result
> 0 && result
< buffSize
)
684 libraryFile
.setFile(QString("%1/%2").arg(QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer
))), library
));
698 module
= LoadLibraryW(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(libraryFile
.absoluteFilePath()).utf16()));
702 result
= PlaySound((LPCTSTR
) soundId
, module
, flags
);