More improvements to the working banner. Now using QWindowsVistaSytle when "sheet of glass" effect is enabled, for more consistent look. Also fixes some drawing glitches.
This commit is contained in:
parent
ff30f71c13
commit
dd39addb39
File diff suppressed because it is too large
Load Diff
@ -31,7 +31,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>MainWindow</name>
|
<name>MainWindow</name>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="719"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="742"/>
|
||||||
<source>%n file(s) have been rejected, because read access was not granted!</source>
|
<source>%n file(s) have been rejected, because read access was not granted!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because read access was not granted!</numerusform>
|
<numerusform>%n file have been rejected, because read access was not granted!</numerusform>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="723"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="746"/>
|
||||||
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
|
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
|
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="727"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="750"/>
|
||||||
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
|
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
|
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="731"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="754"/>
|
||||||
<source>%n file(s) have been rejected, because the file format could not be recognized!</source>
|
<source>%n file(s) have been rejected, because the file format could not be recognized!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
|
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="3764"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="3788"/>
|
||||||
<source>%n Instance(s)</source>
|
<source>%n Instance(s)</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n Instance</numerusform>
|
<numerusform>%n Instance</numerusform>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>ProcessingDialog</name>
|
<name>ProcessingDialog</name>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="659"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="668"/>
|
||||||
<source>Encoding: %n file(s) of %1 completed so far, please wait...</source>
|
<source>Encoding: %n file(s) of %1 completed so far, please wait...</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>Encoding: %n file of %1 completed so far, please wait...</numerusform>
|
<numerusform>Encoding: %n file of %1 completed so far, please wait...</numerusform>
|
||||||
@ -82,7 +82,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="691"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="700"/>
|
||||||
<source>Process was aborted by the user after %n file(s)!</source>
|
<source>Process was aborted by the user after %n file(s)!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>Process was aborted by the user after %n file!</numerusform>
|
<numerusform>Process was aborted by the user after %n file!</numerusform>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="720"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="729"/>
|
||||||
<source>Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information!</source>
|
<source>Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>Error: %1 of %n file failed (%2). Double-click failed items for detailed information!</numerusform>
|
<numerusform>Error: %1 of %n file failed (%2). Double-click failed items for detailed information!</numerusform>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="720"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="729"/>
|
||||||
<source>%n file(s) skipped</source>
|
<source>%n file(s) skipped</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file skipped</numerusform>
|
<numerusform>%n file skipped</numerusform>
|
||||||
@ -106,7 +106,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="724"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="733"/>
|
||||||
<source>Error: %1 of %n file(s) failed. Double-click failed items for detailed information!</source>
|
<source>Error: %1 of %n file(s) failed. Double-click failed items for detailed information!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>Error: %1 of %n file failed. Double-click failed items for detailed information!</numerusform>
|
<numerusform>Error: %1 of %n file failed. Double-click failed items for detailed information!</numerusform>
|
||||||
@ -114,7 +114,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="738"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="747"/>
|
||||||
<source>All files completed successfully. Skipped %n file(s).</source>
|
<source>All files completed successfully. Skipped %n file(s).</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>All files completed successfully. Skipped %n file.</numerusform>
|
<numerusform>All files completed successfully. Skipped %n file.</numerusform>
|
||||||
@ -122,7 +122,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="1162"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="1171"/>
|
||||||
<source>%n hour(s)</source>
|
<source>%n hour(s)</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n hour</numerusform>
|
<numerusform>%n hour</numerusform>
|
||||||
@ -130,8 +130,8 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="1163"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="1172"/>
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="1167"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="1176"/>
|
||||||
<source>%n minute(s)</source>
|
<source>%n minute(s)</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n minute</numerusform>
|
<numerusform>%n minute</numerusform>
|
||||||
@ -139,8 +139,8 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="1168"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="1177"/>
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="1172"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="1181"/>
|
||||||
<source>%n second(s)</source>
|
<source>%n second(s)</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n second</numerusform>
|
<numerusform>%n second</numerusform>
|
||||||
@ -148,7 +148,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_Processing.cpp" line="1173"/>
|
<location filename="../../src/Dialog_Processing.cpp" line="1182"/>
|
||||||
<source>%n millisecond(s)</source>
|
<source>%n millisecond(s)</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n millisecond</numerusform>
|
<numerusform>%n millisecond</numerusform>
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -261,7 +261,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>9</width>
|
<width>12</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -138,10 +138,7 @@
|
|||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">$(Status)</string>
|
<string notr="true">$(Status)</string>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#define VER_LAMEXP_MINOR_LO 9
|
#define VER_LAMEXP_MINOR_LO 9
|
||||||
#define VER_LAMEXP_TYPE Alpha
|
#define VER_LAMEXP_TYPE Alpha
|
||||||
#define VER_LAMEXP_PATCH 8
|
#define VER_LAMEXP_PATCH 8
|
||||||
#define VER_LAMEXP_BUILD 1477
|
#define VER_LAMEXP_BUILD 1481
|
||||||
#define VER_LAMEXP_CONFG 1348
|
#define VER_LAMEXP_CONFG 1348
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -77,9 +77,20 @@
|
|||||||
// Helper macros
|
// Helper macros
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#define BANNER_VISIBLE ((m_banner != NULL) && m_banner->isVisible())
|
||||||
|
|
||||||
|
#define INIT_BANNER() do \
|
||||||
|
{ \
|
||||||
|
if(m_banner == NULL) \
|
||||||
|
{ \
|
||||||
|
m_banner = new WorkingBanner(this); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
while(0)
|
||||||
|
|
||||||
#define ABORT_IF_BUSY do \
|
#define ABORT_IF_BUSY do \
|
||||||
{ \
|
{ \
|
||||||
if(m_banner->isVisible() || m_delayedFileTimer->isActive()) \
|
if(BANNER_VISIBLE || m_delayedFileTimer->isActive()) \
|
||||||
{ \
|
{ \
|
||||||
lamexp_beep(lamexp_beep_warning); \
|
lamexp_beep(lamexp_beep_warning); \
|
||||||
return; \
|
return; \
|
||||||
@ -158,9 +169,10 @@ while(0)
|
|||||||
|
|
||||||
#define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
|
#define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "−"))
|
||||||
#define FSLINK(PATH) QString("<a href=\"file:///%1\">%2</a>").arg(PATH).arg(QString(PATH).replace("-", "−"))
|
#define FSLINK(PATH) QString("<a href=\"file:///%1\">%2</a>").arg(PATH).arg(QString(PATH).replace("-", "−"))
|
||||||
//#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP))
|
|
||||||
#define CENTER_CURRENT_OUTPUT_FOLDER_DELAYED QTimer::singleShot(125, this, SLOT(centerOutputFolderModel()))
|
#define CENTER_CURRENT_OUTPUT_FOLDER_DELAYED QTimer::singleShot(125, this, SLOT(centerOutputFolderModel()))
|
||||||
|
|
||||||
|
//#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP))
|
||||||
|
|
||||||
static const unsigned int IDM_ABOUTBOX = 0xEFF0;
|
static const unsigned int IDM_ABOUTBOX = 0xEFF0;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@ -174,7 +186,9 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel_MetaInfo *me
|
|||||||
m_fileListModel(fileListModel),
|
m_fileListModel(fileListModel),
|
||||||
m_metaData(metaInfo),
|
m_metaData(metaInfo),
|
||||||
m_settings(settingsModel),
|
m_settings(settingsModel),
|
||||||
|
m_windowIcon(NULL),
|
||||||
m_fileSystemModel(NULL),
|
m_fileSystemModel(NULL),
|
||||||
|
m_banner(NULL),
|
||||||
m_accepted(false),
|
m_accepted(false),
|
||||||
m_firstTimeShown(true),
|
m_firstTimeShown(true),
|
||||||
m_outputFolderViewCentering(false),
|
m_outputFolderViewCentering(false),
|
||||||
@ -184,6 +198,9 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel_MetaInfo *me
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
|
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
|
||||||
|
|
||||||
|
//Create window icon
|
||||||
|
m_windowIcon = lamexp_set_window_icon(this, lamexp_app_icon(), true);
|
||||||
|
|
||||||
//Register meta types
|
//Register meta types
|
||||||
qRegisterMetaType<AudioFileModel>("AudioFileModel");
|
qRegisterMetaType<AudioFileModel>("AudioFileModel");
|
||||||
|
|
||||||
@ -591,9 +608,6 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel_MetaInfo *me
|
|||||||
move((desktopRect.width() - thisRect.width()) / 2, (desktopRect.height() - thisRect.height()) / 2);
|
move((desktopRect.width() - thisRect.width()) / 2, (desktopRect.height() - thisRect.height()) / 2);
|
||||||
setMinimumSize(thisRect.width(), thisRect.height());
|
setMinimumSize(thisRect.width(), thisRect.height());
|
||||||
|
|
||||||
//Create banner
|
|
||||||
m_banner = new WorkingBanner(this);
|
|
||||||
|
|
||||||
//Create DropBox widget
|
//Create DropBox widget
|
||||||
m_dropBox = new DropBox(this, m_fileListModel, m_settings);
|
m_dropBox = new DropBox(this, m_fileListModel, m_settings);
|
||||||
connect(m_fileListModel, SIGNAL(modelReset()), m_dropBox, SLOT(modelChanged()));
|
connect(m_fileListModel, SIGNAL(modelReset()), m_dropBox, SLOT(modelChanged()));
|
||||||
@ -669,6 +683,13 @@ MainWindow::~MainWindow(void)
|
|||||||
LAMEXP_DELETE(m_evenFilterOutputFolderView);
|
LAMEXP_DELETE(m_evenFilterOutputFolderView);
|
||||||
LAMEXP_DELETE(m_evenFilterCompressionTab);
|
LAMEXP_DELETE(m_evenFilterCompressionTab);
|
||||||
|
|
||||||
|
//Free window icon
|
||||||
|
if(m_windowIcon)
|
||||||
|
{
|
||||||
|
lamexp_free_window_icon(m_windowIcon);
|
||||||
|
m_windowIcon = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
//Un-initialize the dialog
|
//Un-initialize the dialog
|
||||||
LAMEXP_DELETE(ui);
|
LAMEXP_DELETE(ui);
|
||||||
}
|
}
|
||||||
@ -689,7 +710,9 @@ void MainWindow::addFiles(const QStringList &files)
|
|||||||
|
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
|
|
||||||
|
INIT_BANNER();
|
||||||
FileAnalyzer *analyzer = new FileAnalyzer(files);
|
FileAnalyzer *analyzer = new FileAnalyzer(files);
|
||||||
|
|
||||||
connect(analyzer, SIGNAL(fileSelected(QString)), m_banner, SLOT(setText(QString)), Qt::QueuedConnection);
|
connect(analyzer, SIGNAL(fileSelected(QString)), m_banner, SLOT(setText(QString)), Qt::QueuedConnection);
|
||||||
connect(analyzer, SIGNAL(progressValChanged(unsigned int)), m_banner, SLOT(setProgressVal(unsigned int)), Qt::QueuedConnection);
|
connect(analyzer, SIGNAL(progressValChanged(unsigned int)), m_banner, SLOT(setProgressVal(unsigned int)), Qt::QueuedConnection);
|
||||||
connect(analyzer, SIGNAL(progressMaxChanged(unsigned int)), m_banner, SLOT(setProgressMax(unsigned int)), Qt::QueuedConnection);
|
connect(analyzer, SIGNAL(progressMaxChanged(unsigned int)), m_banner, SLOT(setProgressMax(unsigned int)), Qt::QueuedConnection);
|
||||||
@ -740,6 +763,8 @@ void MainWindow::addFiles(const QStringList &files)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::addFolder(const QString &path, bool recursive, bool delayed)
|
void MainWindow::addFolder(const QString &path, bool recursive, bool delayed)
|
||||||
{
|
{
|
||||||
|
INIT_BANNER();
|
||||||
|
|
||||||
QFileInfoList folderInfoList;
|
QFileInfoList folderInfoList;
|
||||||
folderInfoList << QFileInfo(path);
|
folderInfoList << QFileInfo(path);
|
||||||
QStringList fileList;
|
QStringList fileList;
|
||||||
@ -928,7 +953,6 @@ void MainWindow::showEvent(QShowEvent *event)
|
|||||||
if(m_firstTimeShown)
|
if(m_firstTimeShown)
|
||||||
{
|
{
|
||||||
m_firstTimeShown = false;
|
m_firstTimeShown = false;
|
||||||
lamexp_set_window_icon(this, lamexp_app_icon(), true);
|
|
||||||
QTimer::singleShot(0, this, SLOT(windowShown()));
|
QTimer::singleShot(0, this, SLOT(windowShown()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1092,7 +1116,7 @@ void MainWindow::dropEvent(QDropEvent *event)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::closeEvent(QCloseEvent *event)
|
void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
if(m_banner->isVisible() || m_delayedFileTimer->isActive())
|
if(BANNER_VISIBLE || m_delayedFileTimer->isActive())
|
||||||
{
|
{
|
||||||
lamexp_beep(lamexp_beep_warning);
|
lamexp_beep(lamexp_beep_warning);
|
||||||
event->ignore();
|
event->ignore();
|
||||||
@ -1178,7 +1202,7 @@ bool MainWindow::event(QEvent *e)
|
|||||||
{
|
{
|
||||||
case lamexp_event_queryendsession:
|
case lamexp_event_queryendsession:
|
||||||
qWarning("System is shutting down, main window prepares to close...");
|
qWarning("System is shutting down, main window prepares to close...");
|
||||||
if(m_banner->isVisible()) m_banner->close();
|
if(BANNER_VISIBLE) m_banner->close();
|
||||||
if(m_delayedFileTimer->isActive()) m_delayedFileTimer->stop();
|
if(m_delayedFileTimer->isActive()) m_delayedFileTimer->stop();
|
||||||
return true;
|
return true;
|
||||||
case lamexp_event_endsession:
|
case lamexp_event_endsession:
|
||||||
@ -1327,7 +1351,7 @@ void MainWindow::windowShown(void)
|
|||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
QEventLoop loop; QTimer::singleShot(7000, &loop, SLOT(quit()));
|
QEventLoop loop; QTimer::singleShot(7000, &loop, SLOT(quit()));
|
||||||
lamexp_play_sound(IDR_WAVE_WAITING, true);
|
INIT_BANNER(); lamexp_play_sound(IDR_WAVE_WAITING, true);
|
||||||
m_banner->show(tr("Skipping update check this time, please be patient..."), &loop);
|
m_banner->show(tr("Skipping update check this time, please be patient..."), &loop);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2432,7 +2456,7 @@ void MainWindow::handleDelayedFiles(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_banner->isVisible())
|
if(BANNER_VISIBLE)
|
||||||
{
|
{
|
||||||
m_delayedFileTimer->start(5000);
|
m_delayedFileTimer->start(5000);
|
||||||
return;
|
return;
|
||||||
@ -3999,7 +4023,7 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::notifyOtherInstance(void)
|
void MainWindow::notifyOtherInstance(void)
|
||||||
{
|
{
|
||||||
if(!m_banner->isVisible())
|
if(!(BANNER_VISIBLE))
|
||||||
{
|
{
|
||||||
QMessageBox msgBox(QMessageBox::Warning, tr("Already Running"), tr("LameXP is already running, please use the running instance!"), QMessageBox::NoButton, this, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint);
|
QMessageBox msgBox(QMessageBox::Warning, tr("Already Running"), tr("LameXP is already running, please use the running instance!"), QMessageBox::NoButton, this, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint);
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
@ -4049,7 +4073,7 @@ void MainWindow::addFilesDelayed(const QStringList &filePaths, bool tryASAP)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::addFolderDelayed(const QString &folderPath, bool recursive)
|
void MainWindow::addFolderDelayed(const QString &folderPath, bool recursive)
|
||||||
{
|
{
|
||||||
if(!m_banner->isVisible())
|
if(!(BANNER_VISIBLE))
|
||||||
{
|
{
|
||||||
addFolder(folderPath, recursive, true);
|
addFolder(folderPath, recursive, true);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ class QMenu;
|
|||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class SettingsModel;
|
class SettingsModel;
|
||||||
class WorkingBanner;
|
class WorkingBanner;
|
||||||
|
class lamexp_icon_t;
|
||||||
|
|
||||||
//UIC forward declartion
|
//UIC forward declartion
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@ -193,6 +194,7 @@ private:
|
|||||||
bool m_firstTimeShown;
|
bool m_firstTimeShown;
|
||||||
uint m_outputFolderViewInitCounter;
|
uint m_outputFolderViewInitCounter;
|
||||||
bool m_outputFolderViewCentering;
|
bool m_outputFolderViewCentering;
|
||||||
|
lamexp_icon_t *m_windowIcon;
|
||||||
|
|
||||||
WorkingBanner *m_banner;
|
WorkingBanner *m_banner;
|
||||||
QStringList *m_delayedFileList;
|
QStringList *m_delayedFileList;
|
||||||
|
@ -136,6 +136,7 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, const AudioFile
|
|||||||
:
|
:
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::ProcessingDialog),
|
ui(new Ui::ProcessingDialog),
|
||||||
|
m_windowIcon(NULL),
|
||||||
m_systemTray(new QSystemTrayIcon(QIcon(":/icons/cd_go.png"), this)),
|
m_systemTray(new QSystemTrayIcon(QIcon(":/icons/cd_go.png"), this)),
|
||||||
m_settings(settings),
|
m_settings(settings),
|
||||||
m_metaInfo(metaInfo),
|
m_metaInfo(metaInfo),
|
||||||
@ -152,6 +153,9 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, const AudioFile
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
//Update the window icon
|
||||||
|
m_windowIcon = lamexp_set_window_icon(this, lamexp_app_icon(), true);
|
||||||
|
|
||||||
//Update header icon
|
//Update header icon
|
||||||
ui->label_headerIcon->setPixmap(lamexp_app_icon().pixmap(ui->label_headerIcon->size()));
|
ui->label_headerIcon->setPixmap(lamexp_app_icon().pixmap(ui->label_headerIcon->size()));
|
||||||
|
|
||||||
@ -298,6 +302,7 @@ ProcessingDialog::~ProcessingDialog(void)
|
|||||||
m_diskObserver->wait();
|
m_diskObserver->wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_cpuObserver)
|
if(m_cpuObserver)
|
||||||
{
|
{
|
||||||
m_cpuObserver->stop();
|
m_cpuObserver->stop();
|
||||||
@ -307,6 +312,7 @@ ProcessingDialog::~ProcessingDialog(void)
|
|||||||
m_cpuObserver->wait();
|
m_cpuObserver->wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_ramObserver)
|
if(m_ramObserver)
|
||||||
{
|
{
|
||||||
m_ramObserver->stop();
|
m_ramObserver->stop();
|
||||||
@ -341,6 +347,12 @@ ProcessingDialog::~ProcessingDialog(void)
|
|||||||
WinSevenTaskbar::setOverlayIcon(this, NULL);
|
WinSevenTaskbar::setOverlayIcon(this, NULL);
|
||||||
WinSevenTaskbar::setTaskbarState(this, WinSevenTaskbar::WinSevenTaskbarNoState);
|
WinSevenTaskbar::setTaskbarState(this, WinSevenTaskbar::WinSevenTaskbarNoState);
|
||||||
|
|
||||||
|
if(m_windowIcon)
|
||||||
|
{
|
||||||
|
lamexp_free_window_icon(m_windowIcon);
|
||||||
|
m_windowIcon = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
LAMEXP_DELETE(ui);
|
LAMEXP_DELETE(ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,9 +368,6 @@ void ProcessingDialog::showEvent(QShowEvent *event)
|
|||||||
{
|
{
|
||||||
static const char *NA = " N/A";
|
static const char *NA = " N/A";
|
||||||
|
|
||||||
//Update the window icon
|
|
||||||
lamexp_set_window_icon(this, lamexp_app_icon(), true);
|
|
||||||
|
|
||||||
lamexp_enable_close_button(this, false);
|
lamexp_enable_close_button(this, false);
|
||||||
ui->button_closeDialog->setEnabled(false);
|
ui->button_closeDialog->setEnabled(false);
|
||||||
ui->button_AbortProcess->setEnabled(false);
|
ui->button_AbortProcess->setEnabled(false);
|
||||||
|
@ -43,6 +43,7 @@ class QMovie;
|
|||||||
class RAMObserverThread;
|
class RAMObserverThread;
|
||||||
class SettingsModel;
|
class SettingsModel;
|
||||||
class QThreadPool;
|
class QThreadPool;
|
||||||
|
class lamexp_icon_t;
|
||||||
|
|
||||||
enum shutdownFlag_t
|
enum shutdownFlag_t
|
||||||
{
|
{
|
||||||
@ -106,6 +107,7 @@ private:
|
|||||||
bool shutdownComputer(void);
|
bool shutdownComputer(void);
|
||||||
QString time2text(const double timeVal) const;
|
QString time2text(const double timeVal) const;
|
||||||
|
|
||||||
|
lamexp_icon_t *m_windowIcon;
|
||||||
QThreadPool *m_threadPool;
|
QThreadPool *m_threadPool;
|
||||||
QList<AudioFileModel> m_pendingJobs;
|
QList<AudioFileModel> m_pendingJobs;
|
||||||
SettingsModel *m_settings;
|
SettingsModel *m_settings;
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QWindowsVistaStyle>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#define EPS (1.0E-5)
|
#define EPS (1.0E-5)
|
||||||
|
|
||||||
@ -76,7 +78,7 @@ static inline void UPDATE_MARGINS(QWidget *control, int l = 0, int r = 0, int t
|
|||||||
WorkingBanner::WorkingBanner(QWidget *parent)
|
WorkingBanner::WorkingBanner(QWidget *parent)
|
||||||
:
|
:
|
||||||
QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint),
|
QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint),
|
||||||
ui(new Ui::WorkingBanner()), m_metrics(NULL), m_working(NULL)
|
ui(new Ui::WorkingBanner()), m_metrics(NULL), m_working(NULL), m_style(NULL)
|
||||||
{
|
{
|
||||||
//Init the dialog, from the .ui file
|
//Init the dialog, from the .ui file
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -85,13 +87,15 @@ WorkingBanner::WorkingBanner(QWidget *parent)
|
|||||||
//Enable the "sheet of glass" effect
|
//Enable the "sheet of glass" effect
|
||||||
if(lamexp_sheet_of_glass(this))
|
if(lamexp_sheet_of_glass(this))
|
||||||
{
|
{
|
||||||
SET_TEXT_COLOR(ui->labelStatus, lamexp_system_color(lamexp_syscolor_caption));
|
m_style = new QWindowsVistaStyle();
|
||||||
|
ui->labelStatus->setStyle(m_style);
|
||||||
|
ui->progressBar->setStyle(m_style);
|
||||||
|
ui->labelStatus->setStyleSheet("background-color: rgb(255, 255, 255);");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UPDATE_MARGINS(this, 5);
|
UPDATE_MARGINS(this, 5);
|
||||||
m_working = new QMovie(":/images/Busy.gif");
|
m_working = new QMovie(":/images/Busy.gif");
|
||||||
m_working->setSpeed(75);
|
|
||||||
m_working->setCacheMode(QMovie::CacheAll);
|
m_working->setCacheMode(QMovie::CacheAll);
|
||||||
ui->labelWorking->setMovie(m_working);
|
ui->labelWorking->setMovie(m_working);
|
||||||
m_working->start();
|
m_working->start();
|
||||||
@ -119,6 +123,7 @@ WorkingBanner::~WorkingBanner(void)
|
|||||||
LAMEXP_DELETE(m_working);
|
LAMEXP_DELETE(m_working);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LAMEXP_DELETE(m_style);
|
||||||
LAMEXP_DELETE(m_metrics);
|
LAMEXP_DELETE(m_metrics);
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
@ -244,10 +249,20 @@ bool WorkingBanner::winEvent(MSG *message, long *result)
|
|||||||
return WinSevenTaskbar::handleWinEvent(message, result);
|
return WinSevenTaskbar::handleWinEvent(message, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorkingBanner::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
QTimer::singleShot(125, this, SLOT(windowShown()));
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// SLOTS
|
// SLOTS
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void WorkingBanner::windowShown(void)
|
||||||
|
{
|
||||||
|
lamexp_bring_to_front(this);
|
||||||
|
}
|
||||||
|
|
||||||
void WorkingBanner::setText(const QString &text)
|
void WorkingBanner::setText(const QString &text)
|
||||||
{
|
{
|
||||||
if(!m_metrics)
|
if(!m_metrics)
|
||||||
@ -255,14 +270,14 @@ void WorkingBanner::setText(const QString &text)
|
|||||||
m_metrics = new QFontMetrics(ui->labelStatus->font());
|
m_metrics = new QFontMetrics(ui->labelStatus->font());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_metrics->width(text) <= ui->labelStatus->width() - 8)
|
if(m_metrics->width(text) <= ui->labelStatus->width() - 16)
|
||||||
{
|
{
|
||||||
ui->labelStatus->setText(text);
|
ui->labelStatus->setText(text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString choppedText = text.simplified().append("...");
|
QString choppedText = text.simplified().append("...");
|
||||||
while((m_metrics->width(choppedText) > ui->labelStatus->width() - 8) && (choppedText.length() > 8))
|
while((m_metrics->width(choppedText) > ui->labelStatus->width() - 16) && (choppedText.length() > 8))
|
||||||
{
|
{
|
||||||
choppedText.chop(4);
|
choppedText.chop(4);
|
||||||
choppedText = choppedText.trimmed();
|
choppedText = choppedText.trimmed();
|
||||||
|
@ -54,6 +54,7 @@ private:
|
|||||||
bool m_canClose;
|
bool m_canClose;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void windowShown(void);
|
||||||
void setText(const QString &text);
|
void setText(const QString &text);
|
||||||
void setProgressMax(unsigned int max);
|
void setProgressMax(unsigned int max);
|
||||||
void setProgressVal(unsigned int val);
|
void setProgressVal(unsigned int val);
|
||||||
@ -63,10 +64,12 @@ signals:
|
|||||||
void userAbort(void);
|
void userAbort(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent(QKeyEvent *event);
|
virtual void keyPressEvent(QKeyEvent *event);
|
||||||
void keyReleaseEvent(QKeyEvent *event);
|
virtual void keyReleaseEvent(QKeyEvent *event);
|
||||||
void closeEvent(QCloseEvent *event);
|
virtual void closeEvent(QCloseEvent *event);
|
||||||
bool winEvent(MSG *message, long *result);
|
virtual bool winEvent(MSG *message, long *result);
|
||||||
|
virtual void showEvent(QShowEvent *event);
|
||||||
|
|
||||||
QFontMetrics *m_metrics;
|
QFontMetrics *m_metrics;
|
||||||
|
QStyle *m_style;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user