Skip to content

Instantly share code, notes, and snippets.

@MilhouseVH
Last active July 12, 2016 17:25
Show Gist options
  • Save MilhouseVH/e799b1289e855248b6c4221ebf10c84e to your computer and use it in GitHub Desktop.
Save MilhouseVH/e799b1289e855248b6c4221ebf10c84e to your computer and use it in GitHub Desktop.
diff --git a/xbmc/dbwrappers/Database.cpp b/xbmc/dbwrappers/Database.cpp
index 4dc71c5..6b0a0e1 100644
--- a/xbmc/dbwrappers/Database.cpp
+++ b/xbmc/dbwrappers/Database.cpp
@@ -29,6 +29,7 @@
#include "sqlitedataset.h"
#include "DatabaseManager.h"
#include "DbUrl.h"
+#include "utils/Splash.h"
#ifdef HAS_MYSQL
#include "mysqldataset.h"
@@ -378,6 +379,8 @@ bool CDatabase::Update(const DatabaseSettings &settings)
{
CLog::Log(LOGNOTICE, "Old database found - updating from version %i to %i", version, GetSchemaVersion());
+ CSplash::GetInstance().Show("special://xbmc/media/DBUpgrade.png");
+
bool copy_fail = false;
try
diff --git a/xbmc/utils/Splash.cpp b/xbmc/utils/Splash.cpp
index 7e1d885..9030a28 100644
--- a/xbmc/utils/Splash.cpp
+++ b/xbmc/utils/Splash.cpp
@@ -45,6 +45,17 @@ CSplash& CSplash::GetInstance()
return instance;
}
+void CSplash::Show(const std::string& strFileNameAndPath)
+{
+ if (XFILE::CFile::Exists(strFileNameAndPath))
+ {
+ delete m_image;
+ m_image = new CGUIImage(0, 0, 0, 0, g_graphicsContext.GetWidth(), g_graphicsContext.GetHeight(), CTextureInfo(strFileNameAndPath));
+ m_image->SetAspectRatio(CAspectRatio::AR_SCALE);
+ Show();
+ }
+}
+
void CSplash::Show()
{
if (!m_image)
diff --git a/xbmc/utils/Splash.h b/xbmc/utils/Splash.h
index d8c81c2..2782ca3 100644
--- a/xbmc/utils/Splash.h
+++ b/xbmc/utils/Splash.h
@@ -30,6 +30,7 @@ public:
static CSplash& GetInstance();
void Show();
+ void Show(const std::string& strFileNameAndPath);
protected:
CSplash();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment