Skip to content

Commit

Permalink
Improve about dialog + nicer method write version info to resource se…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
lordmulder committed Nov 7, 2010
1 parent 8fa0757 commit ce41761
Show file tree
Hide file tree
Showing 17 changed files with 311 additions and 70 deletions.
26 changes: 13 additions & 13 deletions LameXP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ END
#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "res\\MainIcon.ico"

/////////////////////////////////////////////////////////////////////////////
//
// WAVE
Expand All @@ -69,8 +60,8 @@ IDR_WAVE_ABOUT WAVE "res\\sounds\\uuaarrgh.wav"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,0,0,0
PRODUCTVERSION 4,0,0,0
FILEVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD
PRODUCTVERSION VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x3L
Expand All @@ -88,13 +79,13 @@ BEGIN
VALUE "Comments", "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY"
VALUE "CompanyName", "Free Software Foundation"
VALUE "FileDescription", "LameXP - Audio Encoder Front-End"
VALUE "FileVersion", "4.0.0.0"
VALUE "FileVersion", VER_LAMEXP_STR
VALUE "InternalName", "LameXP Qt"
VALUE "LegalCopyright", "Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>"
VALUE "LegalTrademarks", "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License <http://www.gnu.org/>"
VALUE "OriginalFilename", "LameXP.exe"
VALUE "ProductName", "LameXP - Audio Encoder Front-End"
VALUE "ProductVersion", "v4.00 Pre-Alpha"
VALUE "ProductVersion", VER_LAMEXP_STR
END
END
BLOCK "VarFileInfo"
Expand All @@ -103,6 +94,15 @@ BEGIN
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "res\\MainIcon.ico"
#endif // German (Germany) resources
/////////////////////////////////////////////////////////////////////////////

Expand Down
12 changes: 6 additions & 6 deletions LameXP.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)out\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)out\$(ConfigurationName)"
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)obj\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
Expand Down Expand Up @@ -69,7 +69,7 @@
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;&quot;$(QTDIR)\plugins\imageformats&quot;"
GenerateDebugInformation="true"
SubSystem="1"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Expand All @@ -96,8 +96,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)out\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)out\$(ConfigurationName)"
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)obj\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
Expand Down Expand Up @@ -156,7 +156,7 @@
GenerateDebugInformation="false"
AssemblyDebug="0"
MapExports="false"
SubSystem="1"
SubSystem="2"
LinkTimeCodeGeneration="1"
TargetMachine="1"
/>
Expand Down
8 changes: 5 additions & 3 deletions etc/Deployment/release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
call _paths.bat
REM ------------------------------------------
set "TEMP_DIR=%TEMP%\~LameXP.%DATE%.tmp"
set "OUT_PATH=..\..\out\Release"
set "OUT_PATH=..\..\bin\Release"
set "OUT_FILE=%OUT_PATH%\..\LameXP.%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%.Release.zip"
REM ------------------------------------------
del "%OUT_FILE%"
Expand All @@ -29,8 +29,10 @@ mkdir "%TEMP_DIR%"
mkdir "%TEMP_DIR%\imageformats"
REM ------------------------------------------
copy "%OUT_PATH%\*.exe" "%TEMP_DIR%"
copy "%QTDIR%\bin\qtcore4.dll" "%TEMP_DIR%"
copy "%QTDIR%\bin\qtgui4.dll" "%TEMP_DIR%"
copy "%QTDIR%\bin\QtCore4.dll" "%TEMP_DIR%"
copy "%QTDIR%\bin\QtGui4.dll" "%TEMP_DIR%"
copy "%QTDIR%\bin\QtXml4.dll" "%TEMP_DIR%"
copy "%QTDIR%\bin\QtSvg4.dll" "%TEMP_DIR%"
copy "%QTDIR%\plugins\imageformats\q???4.dll" "%TEMP_DIR%\imageformats"
REM ------------------------------------------
for %%f in ("%TEMP_DIR%\*.exe") do (
Expand Down
10 changes: 5 additions & 5 deletions gui/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
<property name="windowTitle">
<string>LameXP - Audio Encoder Front-end</string>
</property>
<property name="windowIcon">
<iconset resource="../res/Icons.qrc">
<normaloff>:/MainIcon.ico</normaloff>:/MainIcon.ico</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
Expand Down Expand Up @@ -848,11 +844,14 @@
<property name="text">
<string>Visit Official Homepage</string>
</property>
<property name="toolTip">
<string>Visit Official Web-Site</string>
</property>
</action>
<action name="actionCheckUpdates">
<property name="icon">
<iconset resource="../res/Icons.qrc">
<normaloff>:/icons/transmit.png</normaloff>:/icons/transmit.png</iconset>
<normaloff>:/icons/transmit_blue.png</normaloff>:/icons/transmit_blue.png</iconset>
</property>
<property name="text">
<string>Check for Updates</string>
Expand Down Expand Up @@ -898,6 +897,7 @@
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
</resources>
<connections>
<connection>
Expand Down
3 changes: 2 additions & 1 deletion res/Icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<RCC version="1.0">
<qresource>
<file>MainIcon.ico</file>
<file>MainIcon.png</file>
<file>icons/add.png</file>
<file>icons/application_view_list.png</file>
<file>icons/arrow_down.png</file>
Expand Down Expand Up @@ -42,7 +43,7 @@
<file>icons/star.png</file>
<file>icons/table_edit.png</file>
<file>icons/timeline_marker.png</file>
<file>icons/transmit.png</file>
<file>icons/transmit_blue.png</file>
<file>icons/user.png</file>
<file>icons/world.png</file>
</qresource>
Expand Down
3 changes: 2 additions & 1 deletion res/Images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<file>images/Splash.png</file>
<file>images/Thumb.png</file>
<file>images/Construction.gif</file>
</qresource>
<file>images/Qt.svg</file>
</qresource>
</RCC>
Binary file modified res/MainIcon.ico
Binary file not shown.
Binary file added res/MainIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/images/Qt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions res/images/Qt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 60 additions & 16 deletions src/Dialog_MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
//Win32 includes
#include <Windows.h>

#define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(URL)

////////////////////////////////////////////////////////////
// Constructor
////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -156,11 +158,13 @@ void MainWindow::aboutButtonClicked(void)
{
QString aboutText;

aboutText += "<b><font size=\"+1\">LameXP - Audio Encoder Front-end</font></b><br>";
aboutText += "Copyright (C) 2004-2010 LoRd_MuldeR <a href=\"mailto:mulder2@gmx.de\">&lt;MuldeR2@GMX.de&gt;</a><br>";
aboutText += QString().sprintf("Version %d.%02d %s, Build %d [%s]<br><br>", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData());
aboutText += "Please visit <a href=\"http://mulder.dummwiedeutsch.de/\">http://mulder.dummwiedeutsch.de/</a> for news and updates!<br><hr><br>";
aboutText += "This program is free software; you can redistribute it and/or<br>";
aboutText += "<h2>LameXP - Audio Encoder Front-end</h2>";
aboutText += QString("<b>Copyright (C) 2004-%1 LoRd_MuldeR &lt;MuldeR2@GMX.de&gt;. Some rights reserved.</b><br>").arg(max(lamexp_version_date().year(),QDate::currentDate().year()));
aboutText += QString().sprintf("<b>Version %d.%02d %s, Build %d [%s]</b><br><br>", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData());
aboutText += "<nobr>Please visit the official web-site at ";
aboutText += LINK("http://mulder.dummwiedeutsch.de/") += " for news and updates!</nobr><br>";
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>";
Expand All @@ -170,26 +174,64 @@ void MainWindow::aboutButtonClicked(void)
aboutText += "GNU General Public License for more details.<br><br>";
aboutText += "You should have received a copy of the GNU General Public License<br>";
aboutText += "along with this program; if not, write to the Free Software<br>";
aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.<br><hr><br>";
aboutText += "This software uses the 'slick' icon set by <a href=\"http://www.famfamfam.com/lab/icons/silk/\">http://www.famfamfam.com/</a>.<br>";
aboutText += "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</tt></nobr><br>";
aboutText += "<hr><br>";
aboutText += "This software uses the 'slick' icon set by Mark James &ndash; <a href=\"http://www.famfamfam.com/lab/icons/silk/\">http://www.famfamfam.com/</a>.<br>";
aboutText += "Released under the Creative Commons Attribution 2.5 License.<br>";

QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
QApplication::restoreOverrideCursor();
QMessageBox *aboutBox = new QMessageBox(this);
aboutBox->setText(aboutText);
aboutBox->setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
aboutBox->setWindowTitle("About LameXP");

QPushButton *firstButton = aboutBox->addButton("More About...", QMessageBox::AcceptRole);
firstButton->setIcon(QIcon(":/icons/information.png"));
firstButton->setMinimumWidth(120);

QPushButton *secondButton = aboutBox->addButton("About Qt...", QMessageBox::AcceptRole);
secondButton->setIcon(QIcon(":/images/Qt.svg"));
secondButton->setMinimumWidth(120);

QPushButton *thirdButton = aboutBox->addButton("Discard", QMessageBox::AcceptRole);
thirdButton->setIcon(QIcon(":/icons/cross.png"));
thirdButton->setMinimumWidth(90);

PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);

while(1)
{
switch(QMessageBox::information(this, "About LameXP", aboutText, " More about... ", " About Qt... ", " Discard "))
switch(aboutBox->exec())
{
case 0:
{
const QString li("<li style=\"margin-left:-25px\">");
QString moreAboutText;
moreAboutText += "The following third-party software is used in LameXP:<br><br>";
moreAboutText += "<b>LAME - OpenSource mp3 Encoder</b><br>Released under the terms of the GNU Leser General Public License.<br><a href=\"http://lame.sourceforge.net/\">http://lame.sourceforge.net/</a><br><br>";
moreAboutText += "<b>OggEnc - Ogg Vorbis Encoder</b><br>Completely open and patent-free audio encoding technology.<br><a href=\"http://www.vorbis.com/\">http://www.vorbis.com/</a><br><br>";
moreAboutText += "<b>Nero AAC reference MPEG-4 Encoder</b><br>Freeware state-of-the-art HE-AAC encoder with 2-Pass support.<br><a href=\"http://www.nero.com/eng/technologies-aac-codec.html\">http://www.nero.com/eng/technologies-aac-codec.html</a><br>";
QMessageBox::information(this, "About third-party tools", moreAboutText, "Discard");
moreAboutText += "<h3>The following third-party software is used in LameXP:</h3>";
moreAboutText += "<ul>";
moreAboutText += li + "<b>LAME - OpenSource mp3 Encoder</b><br>";
moreAboutText += "Released under the terms of the GNU Leser General Public License.<br>";
moreAboutText += LINK("http://lame.sourceforge.net/");
moreAboutText += "<br>";
moreAboutText += li + "<b>OggEnc - Ogg Vorbis Encoder</b>";
moreAboutText += "<br>Completely open and patent-free audio encoding technology.<br>";
moreAboutText += LINK("http://www.vorbis.com/");
moreAboutText += "<br>";
moreAboutText += li + "<b>Nero AAC reference MPEG-4 Encoder</b><br>";
moreAboutText += "Freeware state-of-the-art HE-AAC encoder with 2-Pass support.<br>";
moreAboutText += LINK("http://www.nero.com/eng/technologies-aac-codec.html/");
moreAboutText += "<br>";
moreAboutText += li + "<b>MediaInfo - Media File Analysis Tool</b><br>";
moreAboutText += "Released under the terms of the GNU Leser General Public License.<br>";
moreAboutText += LINK("http://mediainfo.sourceforge.net/");
moreAboutText += "<br></ul>";

QMessageBox *moreAboutBox = new QMessageBox(this);
moreAboutBox->setText(moreAboutText);
moreAboutBox->setIconPixmap(dynamic_cast<QApplication*>(QApplication::instance())->windowIcon().pixmap(QSize(64,64)));
moreAboutBox->setWindowTitle("About Third-party Software");
moreAboutBox->exec();

LAMEXP_DELETE(moreAboutBox);
break;
}
case 1:
Expand All @@ -199,6 +241,8 @@ void MainWindow::aboutButtonClicked(void)
return;
}
}

LAMEXP_DELETE(aboutBox);
}

/*
Expand Down
Loading

0 comments on commit ce41761

Please sign in to comment.