diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index 9ca7adf7..5cd002ec 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -294,11 +294,11 @@ BerliOS Developer - Розробник BerliOS + CodePlex - CodePlex + @@ -2751,7 +2751,7 @@ Initializing, please wait... - Ініціалізація, будь ласка, зачекайте... + Ініціалізація, будь ласка, зачекайте... diff --git a/gui/SplashScreen.ui b/gui/SplashScreen.ui index 2de3a726..476d5598 100644 --- a/gui/SplashScreen.ui +++ b/gui/SplashScreen.ui @@ -2,6 +2,9 @@ SplashScreen + + Qt::ApplicationModal + 0 @@ -34,9 +37,9 @@ - 0 - 0 - 0 + 41 + 58 + 86 @@ -63,9 +66,9 @@ - 0 - 0 - 0 + 41 + 58 + 86 @@ -83,18 +86,18 @@ - 0 - 0 - 0 + 41 + 58 + 86 - 0 - 0 - 0 + 41 + 58 + 86 @@ -104,10 +107,6 @@ LameXP is launching... - - - :/images/Loading2.gif:/images/Loading2.gif - true diff --git a/res/Images.qrc b/res/Images.qrc index cba56566..fe9e9739 100644 --- a/res/Images.qrc +++ b/res/Images.qrc @@ -1,31 +1,32 @@ - - images/Announcement.png - images/Busy.gif - images/Cartoon.png - images/CD.png - images/Disque.png - images/DropBox.png + + images/Announcement.png + images/Background.jpg + images/Busy.gif + images/Cartoon.png + images/CD.png + images/Disque.png + images/DropBox.png images/DropZone.png images/HeaderIcon_CueImport.png - images/HeaderIcon_LogFile.png - images/HeaderIcon_MetaInfo.png - images/Label.png - images/Loading.gif - images/Loading2.gif - images/Loading3.gif + images/HeaderIcon_LogFile.png + images/HeaderIcon_MetaInfo.png + images/Label.png + images/Loading.gif + images/Loading2.gif + images/Loading3.gif images/Loading4.gif images/Logo.png - images/Logo_Contributors.png - images/Logo_GNU.png - images/Logo_Software.png - images/Qt.svg - images/Splash.png + images/Logo_Contributors.png + images/Logo_GNU.png + images/Logo_Software.png + images/Qt.svg + images/Splash.png images/Sound.png images/Starting.png images/Thumb.png - images/Wizard.png - images/Working.gif - + images/Wizard.png + images/Working.gif + diff --git a/res/images/Background.jpg b/res/images/Background.jpg new file mode 100644 index 00000000..3aec0e2e Binary files /dev/null and b/res/images/Background.jpg differ diff --git a/src/Config.h b/src/Config.h index a5e4232f..2b4edc06 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 8 -#define VER_LAMEXP_BUILD 1462 +#define VER_LAMEXP_BUILD 1464 #define VER_LAMEXP_CONFG 1348 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_SplashScreen.cpp b/src/Dialog_SplashScreen.cpp index afb9b8ee..2584641a 100644 --- a/src/Dialog_SplashScreen.cpp +++ b/src/Dialog_SplashScreen.cpp @@ -61,8 +61,8 @@ SplashScreen::SplashScreen(QWidget *parent) setupUi(this); //Make size fixed - setFixedSize(this->maximumSize()); - + setFixedSize(this->size()); + //Create event loop m_loop = new QEventLoop(this); @@ -75,7 +75,10 @@ SplashScreen::SplashScreen(QWidget *parent) connect(m_timer, SIGNAL(timeout()), this, SLOT(updateHandler())); //Enable "sheet of glass" effect on splash screen - lamexp_sheet_of_glass(this); + if(!lamexp_sheet_of_glass(this)) + { + setStyleSheet("background-image: url(:/images/Background.jpg)"); + } //Start animation m_working = new QMovie(":/images/Loading4.gif"); @@ -83,9 +86,6 @@ SplashScreen::SplashScreen(QWidget *parent) labelLoading->setMovie(m_working); m_working->start(); - //Set wait cursor - setCursor(Qt::WaitCursor); - //Init status m_canClose = false; m_status = STATUS_FADE_IN; @@ -116,11 +116,14 @@ SplashScreen::~SplashScreen(void) void SplashScreen::showSplash(QThread *thread) { SplashScreen *splashScreen = new SplashScreen(); - + //Show splash splashScreen->setWindowOpacity(OPACITY_DELTA); splashScreen->show(); + //Set wait cursor + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + //Wait for window to show QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); splashScreen->repaint(); @@ -136,7 +139,7 @@ void SplashScreen::showSplash(QThread *thread) //Start the thread splashScreen->m_timer->start(FADE_DELAY); QTimer::singleShot(8*60*1000, splashScreen->m_loop, SLOT(quit())); - QTimer::singleShot(0, thread, SLOT(start())); + QTimer::singleShot(333, thread, SLOT(start())); //Start event handling! const int ret = splashScreen->m_loop->exec(QEventLoop::ExcludeUserInputEvents); @@ -151,6 +154,9 @@ void SplashScreen::showSplash(QThread *thread) //Restore taskbar SET_TASKBAR_STATE(splashScreen, splashScreen->m_taskBarInit, false); + //Restore cursor + QApplication::restoreOverrideCursor(); + //Hide splash splashScreen->m_canClose = true; splashScreen->close(); diff --git a/src/Global_Win32.cpp b/src/Global_Win32.cpp index 19cf3beb..8bbb91cc 100644 --- a/src/Global_Win32.cpp +++ b/src/Global_Win32.cpp @@ -169,6 +169,17 @@ static struct } g_lamexp_themes_enabled; +//Win32 DWM API functions +static struct +{ + bool bInitialized; + QLibrary *dwmapi_dll; + HRESULT (__stdcall *dwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS* pMarInset); + HRESULT (__stdcall *dwmEnableBlurBehindWindow)(HWND hWnd, const DWM_BLURBEHIND* pBlurBehind); + QReadWriteLock lock; +} +g_lamexp_dwmapi; + //Image formats static const char *g_lamexp_imageformats[] = {"bmp", "png", "jpg", "gif", "ico", "xpm", NULL}; //"svg" @@ -1846,39 +1857,61 @@ bool lamexp_open_media_file(const QString &mediaFilePath) return false; } -bool lamexp_sheet_of_glass(QWidget *window) +static void lamexp_init_dwmapi(void) { - typedef HRESULT (__stdcall *dwmExtendFrameIntoClientArea_t)(HWND hWnd, const MARGINS* pMarInset); - typedef HRESULT (__stdcall *dwmEnableBlurBehindWindow_t)(HWND hWnd, const DWM_BLURBEHIND* pBlurBehind); + QReadLocker writeLock(&g_lamexp_dwmapi.lock); + + //Not initialized yet? + if(g_lamexp_dwmapi.bInitialized) + { + return; + } //Does OS support DWM? - if(lamexp_get_os_version() < lamexp_winver_vista) + if(lamexp_get_os_version() >= lamexp_winver_vista) { - return false; + //Load DWMAPI.DLL + g_lamexp_dwmapi.dwmapi_dll = new QLibrary("dwmapi.dll"); + if(g_lamexp_dwmapi.dwmapi_dll->load()) + { + //Lookup required functions + g_lamexp_dwmapi.dwmExtendFrameIntoClientArea = (HRESULT (__stdcall*)(HWND, const MARGINS*)) g_lamexp_dwmapi.dwmapi_dll->resolve("DwmExtendFrameIntoClientArea"); + g_lamexp_dwmapi.dwmEnableBlurBehindWindow = (HRESULT (__stdcall*)(HWND, const DWM_BLURBEHIND*)) g_lamexp_dwmapi.dwmapi_dll->resolve("DwmEnableBlurBehindWindow"); + } + else + { + LAMEXP_DELETE(g_lamexp_dwmapi.dwmapi_dll); + qWarning("Failed to load DWMAPI.DLL on a DWM-enabled system!"); + } } - //Load DWMAPI.DLL - QLibrary libDwm("dwmapi.dll"); - if(!libDwm.load()) - { - qWarning("Failed to load DWMAPI.DLL on a DWM-enabled system!"); - return false; - } + g_lamexp_dwmapi.bInitialized = true; +} - //Lookup required functions - dwmExtendFrameIntoClientArea_t dwmExtendFrameIntoClientArea = (dwmExtendFrameIntoClientArea_t) libDwm.resolve("DwmExtendFrameIntoClientArea"); - dwmEnableBlurBehindWindow_t dwmEnableBlurBehindWindow = (dwmEnableBlurBehindWindow_t) libDwm.resolve("DwmEnableBlurBehindWindow"); +/* + * Enable "sheet of glass" effect on the given Window + */ +bool lamexp_sheet_of_glass(QWidget *window) +{ + QReadLocker readLock(&g_lamexp_dwmapi.lock); + + //Initialize the DWM API + while(!g_lamexp_dwmapi.bInitialized) + { + readLock.unlock(); + lamexp_init_dwmapi(); + readLock.relock(); + } - //Check function pointers - if((dwmExtendFrameIntoClientArea == NULL) || (dwmEnableBlurBehindWindow == NULL)) + //Required functions available? + if((g_lamexp_dwmapi.dwmExtendFrameIntoClientArea == NULL) || (g_lamexp_dwmapi.dwmEnableBlurBehindWindow == NULL)) { - qWarning("Required functions are missing from DWMAPI.DLL on a DWM-enabled system!"); return false; } //Enable the "sheet of glass" effect on this window MARGINS margins = {-1, -1, -1, -1}; - if(HRESULT hr = dwmExtendFrameIntoClientArea(window->winId(), &margins)) + if(HRESULT hr = g_lamexp_dwmapi.dwmExtendFrameIntoClientArea(window->winId(), &margins)) { qWarning("DwmExtendFrameIntoClientArea function has failed! (error %d)", hr); return false; @@ -1889,7 +1922,7 @@ bool lamexp_sheet_of_glass(QWidget *window) memset(&bb, 0, sizeof(DWM_BLURBEHIND)); bb.fEnable = TRUE; bb.dwFlags = DWM_BB_ENABLE; - if(HRESULT hr = dwmEnableBlurBehindWindow(window->winId(), &bb)) + if(HRESULT hr = g_lamexp_dwmapi.dwmEnableBlurBehindWindow(window->winId(), &bb)) { qWarning("DwmEnableBlurBehindWindow function has failed! (error %d)", hr); return false; @@ -1975,6 +2008,11 @@ void lamexp_finalization(void) QApplication *application = dynamic_cast(QApplication::instance()); LAMEXP_DELETE(application); + //Release DWM API + g_lamexp_dwmapi.dwmEnableBlurBehindWindow = NULL; + g_lamexp_dwmapi.dwmExtendFrameIntoClientArea = NULL; + LAMEXP_DELETE(g_lamexp_dwmapi.dwmapi_dll); + //Detach from shared memory lamexp_ipc_exit(); @@ -2062,4 +2100,5 @@ extern "C" void _lamexp_global_init_win32(void) LAMEXP_ZERO_MEMORY(g_lamexp_os_version); LAMEXP_ZERO_MEMORY(g_lamexp_wine); LAMEXP_ZERO_MEMORY(g_lamexp_themes_enabled); + LAMEXP_ZERO_MEMORY(g_lamexp_dwmapi); }