Implemented the DropBox widget.

This commit is contained in:
LoRd_MuldeR 2010-12-22 01:01:01 +01:00
parent 09691eb254
commit 8e38c1d3e2
18 changed files with 428 additions and 15 deletions

View File

@ -110,6 +110,7 @@ IDR_WAVE_SUCCESS WAVE "res\\sounds\\success.wav"
IDR_WAVE_ERROR WAVE "res\\sounds\\error.wav" IDR_WAVE_ERROR WAVE "res\\sounds\\error.wav"
IDR_WAVE_ABORTED WAVE "res\\sounds\\aborted.wav" IDR_WAVE_ABORTED WAVE "res\\sounds\\aborted.wav"
IDR_WAVE_WHAMMY WAVE "res\\sounds\\whammy.wav" IDR_WAVE_WHAMMY WAVE "res\\sounds\\whammy.wav"
IDR_WAVE_WOOHOO WAVE "res\\sounds\\woohoo.wav"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //

View File

@ -326,6 +326,10 @@
RelativePath=".\src\Dialog_About.cpp" RelativePath=".\src\Dialog_About.cpp"
> >
</File> </File>
<File
RelativePath=".\src\Dialog_DropBox.cpp"
>
</File>
<File <File
RelativePath=".\src\Dialog_LogView.cpp" RelativePath=".\src\Dialog_LogView.cpp"
> >
@ -564,6 +568,40 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath=".\src\Dialog_DropBox.h"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Static|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
</File>
<File <File
RelativePath=".\src\Dialog_LogView.h" RelativePath=".\src\Dialog_LogView.h"
> >
@ -1404,6 +1442,10 @@
RelativePath=".\tmp\MOC_Dialog_About.cpp" RelativePath=".\tmp\MOC_Dialog_About.cpp"
> >
</File> </File>
<File
RelativePath=".\tmp\MOC_Dialog_DropBox.cpp"
>
</File>
<File <File
RelativePath=".\tmp\MOC_Dialog_LogView.cpp" RelativePath=".\tmp\MOC_Dialog_LogView.cpp"
> >
@ -1664,6 +1706,40 @@
<Filter <Filter
Name="Dialogs" Name="Dialogs"
> >
<File
RelativePath=".\gui\DropBox.ui"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="UIC &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="UIC &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Static|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="UIC &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\UIC_$(SafeInputName).h&quot;"
/>
</FileConfiguration>
</File>
<File <File
RelativePath=".\gui\LogViewDialog.ui" RelativePath=".\gui\LogViewDialog.ui"
> >

53
gui/DropBox.ui Normal file
View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DropBox</class>
<widget class="QDialog" name="DropBox">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>102</width>
<height>102</height>
</rect>
</property>
<property name="windowTitle">
<string>LameXP - DropBox</string>
</property>
<property name="windowIcon">
<iconset resource="../res/Icons.qrc">
<normaloff>:/icons/package.png</normaloff>:/icons/package.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLabel" name="dropBoxLabel">
<property name="lineWidth">
<number>0</number>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../res/Images.qrc">:/images/DropBox.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1201,6 +1201,7 @@
</widget> </widget>
<addaction name="menuConfiguration"/> <addaction name="menuConfiguration"/>
<addaction name="actionInstallWMADecoder"/> <addaction name="actionInstallWMADecoder"/>
<addaction name="actionShowDropBoxWidget"/>
</widget> </widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
<addaction name="menuView"/> <addaction name="menuView"/>
@ -1397,6 +1398,15 @@
<string>Disable WMA Decoder Notifications</string> <string>Disable WMA Decoder Notifications</string>
</property> </property>
</action> </action>
<action name="actionShowDropBoxWidget">
<property name="icon">
<iconset resource="../res/Icons.qrc">
<normaloff>:/icons/package.png</normaloff>:/icons/package.png</iconset>
</property>
<property name="text">
<string>Show DropBox</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="../res/Icons.qrc"/> <include location="../res/Icons.qrc"/>
@ -1500,6 +1510,8 @@
<include location="../res/Images.qrc"/> <include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/> <include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/> <include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>

View File

@ -2,19 +2,20 @@
<RCC version="1.0"> <RCC version="1.0">
<qresource> <qresource>
<file>images/Busy.gif</file> <file>images/Busy.gif</file>
<file>images/HeaderIcon_MetaInfo.png</file> <file>images/Cogwheels.png</file>
<file>images/Construction.gif</file>
<file>images/DropBox.png</file>
<file>images/HeaderIcon_LogFile.png</file> <file>images/HeaderIcon_LogFile.png</file>
<file>images/HeaderIcon_MetaInfo.png</file>
<file>images/Label.png</file> <file>images/Label.png</file>
<file>images/Loading.gif</file> <file>images/Loading.gif</file>
<file>images/Logo.png</file> <file>images/Logo.png</file>
<file>images/Logo_Contributors.png</file> <file>images/Logo_Contributors.png</file>
<file>images/Logo_Software.png</file> <file>images/Logo_Software.png</file>
<file>images/Qt.svg</file>
<file>images/Splash.png</file> <file>images/Splash.png</file>
<file>images/Thumb.png</file> <file>images/Thumb.png</file>
<file>images/Construction.gif</file>
<file>images/Cogwheels.png</file>
<file>images/Qt.svg</file>
<file>images/Working.gif</file>
<file>images/Wizard.png</file> <file>images/Wizard.png</file>
<file>images/Working.gif</file>
</qresource> </qresource>
</RCC> </RCC>

BIN
res/images/DropBox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
res/sounds/woohoo.wav Normal file

Binary file not shown.

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 0 #define VER_LAMEXP_MINOR_LO 0
#define VER_LAMEXP_BUILD 175 #define VER_LAMEXP_BUILD 179
#define VER_LAMEXP_SUFFIX TechPreview #define VER_LAMEXP_SUFFIX TechPreview
/* /*

154
src/Dialog_DropBox.cpp Normal file
View File

@ -0,0 +1,154 @@
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
#include "Dialog_DropBox.h"
#include "Global.h"
#include "Model_Settings.h"
#include <QThread>
#include <QMovie>
#include <QKeyEvent>
#include <QDesktopWidget>
#include <Windows.h>
#define EPS (1.0E-5)
#define SET_FONT_BOLD(WIDGET,BOLD) { QFont _font = WIDGET.font(); _font.setBold(BOLD); WIDGET.setFont(_font); }
////////////////////////////////////////////////////////////
// Constructor
////////////////////////////////////////////////////////////
DropBox::DropBox(QWidget *parent, QAbstractItemModel *model, SettingsModel *settings)
:
QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint),
m_counterLabel(this),
m_model(model),
m_settings(settings),
m_firstShow(true)
{
//Init the dialog, from the .ui file
setupUi(this);
//Init counter
m_counterLabel.setParent(dropBoxLabel);
m_counterLabel.setText("0");
m_counterLabel.setAlignment(Qt::AlignHCenter | Qt::AlignTop);
SET_FONT_BOLD(m_counterLabel, true);
//Prevent close
m_canClose = false;
//Make transparent
setWindowOpacity(0.8);
}
////////////////////////////////////////////////////////////
// Destructor
////////////////////////////////////////////////////////////
DropBox::~DropBox(void)
{
}
////////////////////////////////////////////////////////////
// PUBLIC SLOTS
////////////////////////////////////////////////////////////
void DropBox::modelChanged(void)
{
if(m_model)
{
m_counterLabel.setText(QString::number(m_model->rowCount()));
}
}
////////////////////////////////////////////////////////////
// EVENTS
////////////////////////////////////////////////////////////
void DropBox::showEvent(QShowEvent *event)
{
QRect screenGeometry = QApplication::desktop()->availableGeometry();
resize(dropBoxLabel->pixmap()->size());
setMaximumSize(dropBoxLabel->pixmap()->size());
m_counterLabel.setGeometry(0, dropBoxLabel->height() - 30, dropBoxLabel->width(), 25);
if(m_firstShow)
{
m_firstShow = false;
int max_x = screenGeometry.width() - frameGeometry().width();
int max_y = screenGeometry.height() - frameGeometry().height();
move(max_x, max_y);
}
}
void DropBox::keyPressEvent(QKeyEvent *event)
{
event->ignore();
}
void DropBox::keyReleaseEvent(QKeyEvent *event)
{
event->ignore();
}
void DropBox::closeEvent(QCloseEvent *event)
{
if(!m_canClose) event->ignore();
}
void DropBox::mousePressEvent(QMouseEvent *event)
{
if(event->button() == Qt::RightButton)
{
hide();
if(m_settings) m_settings->dropBoxWidgetEnabled(false);
return;
}
QApplication::setOverrideCursor(Qt::SizeAllCursor);
m_windowReferencePoint = this->pos();
m_mouseReferencePoint = event->globalPos();
}
void DropBox::mouseReleaseEvent(QMouseEvent *event)
{
QApplication::restoreOverrideCursor();
}
void DropBox::mouseMoveEvent(QMouseEvent *event)
{
QRect screenGeometry = QApplication::desktop()->availableGeometry();
int delta_x = m_mouseReferencePoint.x() - event->globalX();
int delta_y = m_mouseReferencePoint.y() - event->globalY();
int max_x = screenGeometry.width() - frameGeometry().width();
int max_y = screenGeometry.height() - frameGeometry().height();
int new_x = min(max_x, max(0, m_windowReferencePoint.x() - delta_x));
int new_y = min(max_y, max(0, m_windowReferencePoint.y() - delta_y));
move(new_x, new_y);
}

65
src/Dialog_DropBox.h Normal file
View File

@ -0,0 +1,65 @@
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../tmp/UIC_DropBox.h"
#include <QPoint>
class QDragEnterEvent;
class QMouseEvent;
class QAbstractItemModel;
class SettingsModel;
////////////////////////////////////////////////////////////
// Splash Frame
////////////////////////////////////////////////////////////
class DropBox: public QDialog, private Ui::DropBox
{
Q_OBJECT
public:
DropBox(QWidget *parent = 0, QAbstractItemModel *model = 0, SettingsModel *settings = 0);
~DropBox(void);
private:
bool m_canClose;
QPoint m_mouseReferencePoint;
QPoint m_windowReferencePoint;
QLabel m_counterLabel;
QAbstractItemModel *m_model;
SettingsModel *m_settings;
bool m_firstShow;
protected:
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *event);
void showEvent(QShowEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
public slots:
void modelChanged(void);
};

View File

@ -28,6 +28,7 @@
#include "Dialog_MetaInfo.h" #include "Dialog_MetaInfo.h"
#include "Dialog_About.h" #include "Dialog_About.h"
#include "Dialog_Update.h" #include "Dialog_Update.h"
#include "Dialog_DropBox.h"
#include "Thread_FileAnalyzer.h" #include "Thread_FileAnalyzer.h"
#include "Thread_MessageHandler.h" #include "Thread_MessageHandler.h"
#include "Model_MetaInfo.h" #include "Model_MetaInfo.h"
@ -259,6 +260,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(actionInstallWMADecoder, SIGNAL(triggered(bool)), this, SLOT(installWMADecoderActionTriggered(bool))); connect(actionInstallWMADecoder, SIGNAL(triggered(bool)), this, SLOT(installWMADecoderActionTriggered(bool)));
connect(actionDisableNeroAacNotifications, SIGNAL(triggered(bool)), this, SLOT(disableNeroAacNotificationsActionTriggered(bool))); connect(actionDisableNeroAacNotifications, SIGNAL(triggered(bool)), this, SLOT(disableNeroAacNotificationsActionTriggered(bool)));
connect(actionDisableWmaDecoderNotifications, SIGNAL(triggered(bool)), this, SLOT(disableWmaDecoderNotificationsActionTriggered(bool))); connect(actionDisableWmaDecoderNotifications, SIGNAL(triggered(bool)), this, SLOT(disableWmaDecoderNotificationsActionTriggered(bool)));
connect(actionShowDropBoxWidget, SIGNAL(triggered(bool)), this, SLOT(showDropBoxWidgetActionTriggered(bool)));
//Activate help menu actions //Activate help menu actions
connect(actionCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdatesActionActivated())); connect(actionCheckUpdates, SIGNAL(triggered()), this, SLOT(checkUpdatesActionActivated()));
@ -273,6 +275,12 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
//Create banner //Create banner
m_banner = new WorkingBanner(this); m_banner = new WorkingBanner(this);
//Create DropBox widget
m_dropBox = new DropBox(this, m_fileListModel, m_settings);
connect(m_fileListModel, SIGNAL(modelReset()), m_dropBox, SLOT(modelChanged()));
connect(m_fileListModel, SIGNAL(rowsInserted(QModelIndex,int,int)), m_dropBox, SLOT(modelChanged()));
connect(m_fileListModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), m_dropBox, SLOT(modelChanged()));
//Create message handler thread //Create message handler thread
m_messageHandler = new MessageHandlerThread(); m_messageHandler = new MessageHandlerThread();
m_delayedFileList = new QStringList(); m_delayedFileList = new QStringList();
@ -320,6 +328,7 @@ MainWindow::~MainWindow(void)
LAMEXP_DELETE(m_encoderButtonGroup); LAMEXP_DELETE(m_encoderButtonGroup);
LAMEXP_DELETE(m_encoderButtonGroup); LAMEXP_DELETE(m_encoderButtonGroup);
LAMEXP_DELETE(m_sourceFilesContextMenu); LAMEXP_DELETE(m_sourceFilesContextMenu);
LAMEXP_DELETE(m_dropBox);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -371,6 +380,11 @@ void MainWindow::showEvent(QShowEvent *event)
m_firstTimeShown = false; m_firstTimeShown = false;
QTimer::singleShot(0, this, SLOT(windowShown())); QTimer::singleShot(0, this, SLOT(windowShown()));
} }
if(m_settings->dropBoxWidgetEnabled())
{
m_dropBox->setVisible(true);
}
} }
void MainWindow::dragEnterEvent(QDragEnterEvent *event) void MainWindow::dragEnterEvent(QDragEnterEvent *event)
@ -422,6 +436,11 @@ void MainWindow::closeEvent(QCloseEvent *event)
MessageBeep(MB_ICONEXCLAMATION); MessageBeep(MB_ICONEXCLAMATION);
event->ignore(); event->ignore();
} }
if(m_dropBox)
{
m_dropBox->hide();
}
} }
void MainWindow::resizeEvent(QResizeEvent *event) void MainWindow::resizeEvent(QResizeEvent *event)
@ -470,12 +489,14 @@ void MainWindow::windowShown(void)
if(iAccepted <= 0) if(iAccepted <= 0)
{ {
m_settings->licenseAccepted(-1); m_settings->licenseAccepted(-1);
QApplication::processEvents();
PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC); PlaySound(MAKEINTRESOURCE(IDR_WAVE_WHAMMY), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
QMessageBox::critical(this, "License Declined", "You have declined the license. Consequently the application will exit now!"); QMessageBox::critical(this, "License Declined", "You have declined the license. Consequently the application will exit now!");
QApplication::quit(); QApplication::quit();
return; return;
} }
PlaySound(MAKEINTRESOURCE(IDR_WAVE_WOOHOO), GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);
m_settings->licenseAccepted(1); m_settings->licenseAccepted(1);
} }
@ -575,6 +596,7 @@ void MainWindow::windowShown(void)
} }
} }
//Start delayed files timer
if(!m_delayedFileList->isEmpty() && !m_delayedFileTimer->isActive()) if(!m_delayedFileList->isEmpty() && !m_delayedFileTimer->isActive())
{ {
m_delayedFileTimer->start(5000); m_delayedFileTimer->start(5000);
@ -587,9 +609,11 @@ void MainWindow::windowShown(void)
void MainWindow::aboutButtonClicked(void) void MainWindow::aboutButtonClicked(void)
{ {
ABORT_IF_BUSY; ABORT_IF_BUSY;
if(m_dropBox->isVisible()) m_dropBox->hide();
AboutDialog *aboutBox = new AboutDialog(m_settings, this); AboutDialog *aboutBox = new AboutDialog(m_settings, this);
aboutBox->exec(); aboutBox->exec();
LAMEXP_DELETE(aboutBox); LAMEXP_DELETE(aboutBox);
if(m_settings->dropBoxWidgetEnabled()) m_dropBox->show();
} }
/* /*
@ -1022,6 +1046,7 @@ void MainWindow::checkUpdatesActionActivated(void)
{ {
ABORT_IF_BUSY; ABORT_IF_BUSY;
if(m_dropBox->isVisible()) m_dropBox->hide();
UpdateDialog *updateDialog = new UpdateDialog(m_settings, this); UpdateDialog *updateDialog = new UpdateDialog(m_settings, this);
updateDialog->exec(); updateDialog->exec();
@ -1031,6 +1056,7 @@ void MainWindow::checkUpdatesActionActivated(void)
} }
LAMEXP_DELETE(updateDialog); LAMEXP_DELETE(updateDialog);
if(m_settings->dropBoxWidgetEnabled()) m_dropBox->show();
} }
/* /*
@ -1610,3 +1636,21 @@ void MainWindow::installWMADecoderActionTriggered(bool checked)
} }
} }
void MainWindow::showDropBoxWidgetActionTriggered(bool checked)
{
m_settings->dropBoxWidgetEnabled(true);
if(!m_dropBox->isVisible())
{
m_dropBox->show();
}
FLASHWINFO flashInfo;
memset(&flashInfo, 0, sizeof(FLASHWINFO));
flashInfo.cbSize = sizeof(FLASHWINFO);
flashInfo.dwFlags = FLASHW_ALL;
flashInfo.uCount = 12;
flashInfo.dwTimeout = 125;
flashInfo.hwnd = m_dropBox->winId();
FlashWindowEx(&flashInfo);
}

View File

@ -34,6 +34,7 @@ class QButtonGroup;
class FileListModel; class FileListModel;
class AbstractEncoder; class AbstractEncoder;
class QMenu; class QMenu;
class DropBox;
class MainWindow: public QMainWindow, private Ui::MainWindow class MainWindow: public QMainWindow, private Ui::MainWindow
{ {
@ -91,6 +92,7 @@ private slots:
void installWMADecoderActionTriggered(bool checked); void installWMADecoderActionTriggered(bool checked);
void disableNeroAacNotificationsActionTriggered(bool checked); void disableNeroAacNotificationsActionTriggered(bool checked);
void disableWmaDecoderNotificationsActionTriggered(bool checked); void disableWmaDecoderNotificationsActionTriggered(bool checked);
void showDropBoxWidgetActionTriggered(bool checked);
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
@ -121,4 +123,5 @@ private:
QLabel *m_dropNoteLabel; QLabel *m_dropNoteLabel;
QMenu *m_sourceFilesContextMenu; QMenu *m_sourceFilesContextMenu;
QMenu *m_outputFolderContextMenu; QMenu *m_outputFolderContextMenu;
DropBox *m_dropBox;
}; };

View File

@ -223,12 +223,12 @@ void lamexp_message_handler(QtMsgType type, const char *msg)
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_INTENSITY); SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_INTENSITY);
fwprintf(stderr, L"\nCRITICAL ERROR !!!\n%S\n\n", msg); fwprintf(stderr, L"\nGURU MEDITATION !!!\n%S\n\n", msg);
MessageBoxW(NULL, (wchar_t*) QString::fromUtf8(msg).utf16(), L"LameXP - CRITICAL ERROR", MB_ICONERROR | MB_TOPMOST | MB_TASKMODAL); MessageBoxW(NULL, (wchar_t*) QString::fromUtf8(msg).utf16(), L"LameXP - GURU MEDITATION", MB_ICONERROR | MB_TOPMOST | MB_TASKMODAL);
break; break;
case QtWarningMsg: case QtWarningMsg:
SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY); SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY);
//MessageBoxW(NULL, (wchar_t*) QString::fromUtf8(msg).utf16(), L"LameXP - CRITICAL ERROR", MB_ICONWARNING | MB_TOPMOST | MB_TASKMODAL); //MessageBoxW(NULL, (wchar_t*) QString::fromUtf8(msg).utf16(), L"LameXP - GURU MEDITATION", MB_ICONWARNING | MB_TOPMOST | MB_TASKMODAL);
fwprintf(stderr, L"%S\n", msg); fwprintf(stderr, L"%S\n", msg);
fflush(stderr); fflush(stderr);
break; break;

View File

@ -186,7 +186,7 @@ int main(int argc, char* argv[])
{ {
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
fprintf(stderr, "\nEXCEPTION ERROR: %s\n", error); fprintf(stderr, "\nGURU MEDITATION: %s\n", error);
FatalAppExit(0, L"Unhandeled exception error, application will exit!"); FatalAppExit(0, L"Unhandeled exception error, application will exit!");
TerminateProcess(GetCurrentProcess(), -1); TerminateProcess(GetCurrentProcess(), -1);
} }
@ -194,7 +194,7 @@ int main(int argc, char* argv[])
{ {
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
fprintf(stderr, "\nEXCEPTION ERROR: Error code 0x%X\n", error); fprintf(stderr, "\nGURU MEDITATION: Error code 0x%X\n", error);
FatalAppExit(0, L"Unhandeled exception error, application will exit!"); FatalAppExit(0, L"Unhandeled exception error, application will exit!");
TerminateProcess(GetCurrentProcess(), -1); TerminateProcess(GetCurrentProcess(), -1);
} }
@ -202,7 +202,7 @@ int main(int argc, char* argv[])
{ {
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
fprintf(stderr, "\nEXCEPTION ERROR !!!\n"); fprintf(stderr, "\nGURU MEDITATION !!!\n");
FatalAppExit(0, L"Unhandeled exception error, application will exit!"); FatalAppExit(0, L"Unhandeled exception error, application will exit!");
TerminateProcess(GetCurrentProcess(), -1); TerminateProcess(GetCurrentProcess(), -1);
} }

View File

@ -46,6 +46,7 @@ static const char *g_settingsId_autoUpdateEnabled = "AutoUpdate/Enabled";
static const char *g_settingsId_soundsEnabled = "Flags/EnableSounds"; static const char *g_settingsId_soundsEnabled = "Flags/EnableSounds";
static const char *g_settingsId_neroAacNotificationsEnabled = "Flags/EnableNeroAacNotifications"; static const char *g_settingsId_neroAacNotificationsEnabled = "Flags/EnableNeroAacNotifications";
static const char *g_settingsId_wmaDecoderNotificationsEnabled = "Flags/EnableWmaDecoderNotifications"; static const char *g_settingsId_wmaDecoderNotificationsEnabled = "Flags/EnableWmaDecoderNotifications";
static const char *g_settingsId_dropBoxWidgetEnabled = "Flags/EnableDropBoxWidget";
//Macros //Macros
#define MAKE_OPTION1(OPT,DEF) \ #define MAKE_OPTION1(OPT,DEF) \
@ -132,3 +133,4 @@ MAKE_OPTION3(autoUpdateEnabled, true)
MAKE_OPTION3(soundsEnabled, true) MAKE_OPTION3(soundsEnabled, true)
MAKE_OPTION3(neroAacNotificationsEnabled, true) MAKE_OPTION3(neroAacNotificationsEnabled, true)
MAKE_OPTION3(wmaDecoderNotificationsEnabled, true) MAKE_OPTION3(wmaDecoderNotificationsEnabled, true)
MAKE_OPTION3(dropBoxWidgetEnabled, true)

View File

@ -77,6 +77,7 @@ public:
MAKE_OPTION_DEC3(soundsEnabled); MAKE_OPTION_DEC3(soundsEnabled);
MAKE_OPTION_DEC3(neroAacNotificationsEnabled) MAKE_OPTION_DEC3(neroAacNotificationsEnabled)
MAKE_OPTION_DEC3(wmaDecoderNotificationsEnabled) MAKE_OPTION_DEC3(wmaDecoderNotificationsEnabled)
MAKE_OPTION_DEC3(dropBoxWidgetEnabled)
//Misc //Misc
void validate(void); void validate(void);

View File

@ -30,6 +30,7 @@
#define IDR_WAVE_ERROR 668 #define IDR_WAVE_ERROR 668
#define IDR_WAVE_ABORTED 669 #define IDR_WAVE_ABORTED 669
#define IDR_WAVE_WHAMMY 670 #define IDR_WAVE_WHAMMY 670
#define IDR_WAVE_WOOHOO 671
/* /*
* Next default values for new objects * Next default values for new objects

View File

@ -86,7 +86,7 @@ void ProcessThread::run()
{ {
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
fprintf(stderr, "\nEXCEPTION ERROR !!!\n"); fprintf(stderr, "\nGURU MEDITATION !!!\n");
FatalAppExit(0, L"Unhandeled exception error, application will exit!"); FatalAppExit(0, L"Unhandeled exception error, application will exit!");
TerminateProcess(GetCurrentProcess(), -1); TerminateProcess(GetCurrentProcess(), -1);
} }