Permalink
Browse files

Merge remote-tracking branch 'remotes/Fyfe/splash-screen' into Experi…

…mental
  • Loading branch information...
2 parents a57f03e + a68d4b1 commit 4bb69208b93ed64f66dde460b3dcc248ef1cc06b @bodrick committed Apr 3, 2012
View
11 Addons/scraper.EmberCore/Scraper/dlgImgSelect.vb
@@ -601,15 +601,8 @@ Public Class dlgImgSelect
Private Function CleanTMDBURL(ByVal sURL As String) As String
If IsTMDBURL(sURL) Then
- Dim tURL As String = String.Empty
- Dim i As Integer = sURL.IndexOf("/posters/")
- If i >= 0 Then tURL = sURL.Substring(i + 9)
- i = sURL.IndexOf("/backdrops/")
- If i >= 0 Then tURL = sURL.Substring(i + 11)
- 'tURL = sURL.Replace("http://images.themoviedb.org/posters/", String.Empty)
- 'tURL = tURL.Replace("http://images.themoviedb.org/backdrops/", String.Empty)
- '$$ to sort first
- sURL = String.Concat("$$[themoviedb.org]", tURL)
+ Dim _sURL As New Uri(sURL)
+ sURL = String.Concat("$$[themoviedb.org]", _sURL.GetComponents(UriComponents.Path, UriFormat.UriEscaped))
Else
sURL = StringUtils.TruncateURL(sURL, 40, True)
End If
View
45 Ember Media Manager/frmMain.vb 100644 → 100755
@@ -4220,7 +4220,7 @@ doCancel:
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click, cmnuTrayIconExit.Click
If isCL Then
- fLoading.SetStage("Canceling ...")
+ fLoading.SetLoadingMesg("Canceling ...")
If Me.bwMovieScraper.IsBusy Then Me.bwMovieScraper.CancelAsync()
If Me.bwRefreshMovies.IsBusy Then Me.bwRefreshMovies.CancelAsync()
While Me.bwMovieScraper.IsBusy OrElse Me.bwRefreshMovies.IsBusy OrElse Me.bwMovieScraper.IsBusy
@@ -5288,7 +5288,7 @@ doCancel:
If Args.Count > 1 Then
isCL = True
- fLoading.pbLoading.Maximum = 10
+ fLoading.SetProgressBarSize(10)
End If
fLoading.Show(Me)
Application.DoEvents()
@@ -5299,7 +5299,7 @@ doCancel:
InstallNewFiles("InstallTasks.xml")
End If
- fLoading.SetStage("Basic setup...")
+ fLoading.SetLoadingMesg("Basic setup...")
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
ModulesManager.AssemblyList.Add(New ModulesManager.AssemblyListItem With {.AssemblyName = "EmberAPI", _
@@ -5322,14 +5322,14 @@ doCancel:
If Not Directory.Exists(sPath) Then
Directory.CreateDirectory(sPath)
End If
- fLoading.SetStage("Loading settings...")
+ fLoading.SetLoadingMesg("Loading settings...")
Master.eSettings.Load()
- fLoading.SetStage("Creating default options...")
+ fLoading.SetLoadingMesg("Creating default options...")
Functions.CreateDefaultOptions()
'//
' Add our handlers, load settings, set form colors, and try to load movies at startup
'\\
- fLoading.SetStage("Loading modules...")
+ fLoading.SetLoadingMesg("Loading modules...")
'Setup/Load Modules Manager and set runtime objects (ember application) so they can be exposed to modules
'ExternalModulesManager = New ModulesManager
ModulesManager.Instance.RuntimeObjects.MenuMediaList = Me.mnuMediaList
@@ -5342,7 +5342,7 @@ doCancel:
ModulesManager.Instance.RuntimeObjects.DelegateOpenImageViewer(AddressOf OpenImageViewer)
ModulesManager.Instance.LoadAllModules()
- If Not isCL Then fLoading.SetStage("Creating GUI...")
+ If Not isCL Then fLoading.SetLoadingMesg("Creating GUI...")
'setup some dummies so we don't get exceptions when resizing form/info panel
ReDim Preserve Me.pnlGenre(0)
ReDim Preserve Me.pbGenre(0)
@@ -5479,17 +5479,17 @@ doCancel:
'End If
End Select
Next
- If nowindow Then fLoading.Visible = False
+ If nowindow Then fLoading.Hide()
APIXML.CacheXMLs()
- fLoading.SetStage("Loading database...")
+ fLoading.SetLoadingMesg("Loading database...")
If Master.DB.CheckEssentials() Then
Me.LoadMedia(New Structures.Scans With {.Movies = True, .TV = True})
End If
Master.DB.LoadMovieSourcesFromDB()
Master.DB.LoadTVSourcesFromDB()
If RunModule Then
- fLoading.pbLoading.Style = ProgressBarStyle.Marquee
- fLoading.SetStage("Running Module...")
+ fLoading.SetProgressBarStyle(ProgressBarStyle.Marquee)
+ fLoading.SetLoadingMesg("Running Module...")
Dim gModule As ModulesManager._externalGenericModuleClass = ModulesManager.Instance.externalProcessorModules.FirstOrDefault(Function(y) y.ProcessorModule.ModuleName = ModuleName)
If Not IsNothing(gModule) Then
gModule.ProcessorModule.RunGeneric(Enums.ModuleEventType.CommandLine, Nothing, Nothing)
@@ -5505,14 +5505,14 @@ doCancel:
Me.cmnuTrayIcon.Enabled = True
If Functions.HasModifier AndAlso Not clScrapeType = Enums.ScrapeType.SingleScrape Then
Try
- fLoading.pbLoading.Style = ProgressBarStyle.Marquee
- fLoading.SetStage("Loading Media...")
+ fLoading.SetProgressBarStyle(ProgressBarStyle.Marquee)
+ fLoading.SetLoadingMesg("Loading Media...")
LoadMedia(New Structures.Scans With {.Movies = True})
While Not Me.LoadingDone
Application.DoEvents()
End While
- fLoading.pbLoading.Style = ProgressBarStyle.Marquee
- fLoading.SetStage("Command Line Scraping...")
+ fLoading.SetProgressBarStyle(ProgressBarStyle.Marquee)
+ fLoading.SetLoadingMesg("Command Line Scraping...")
MovieScrapeData(False, clScrapeType, Master.DefaultOptions)
Catch ex As Exception
Master.eLog.WriteToErrorLog(ex.Message, ex.StackTrace, "Error")
@@ -5581,8 +5581,8 @@ doCancel:
End If
Master.tmpMovie = Master.currMovie.Movie
End If
- fLoading.pbLoading.Style = ProgressBarStyle.Marquee
- fLoading.SetStage("Command Line Scraping...")
+ fLoading.SetProgressBarStyle(ProgressBarStyle.Marquee)
+ fLoading.SetLoadingMesg("Command Line Scraping...")
MovieScrapeData(False, Enums.ScrapeType.SingleScrape, Master.DefaultOptions)
Else
Me.ScraperDone = True
@@ -5598,7 +5598,7 @@ doCancel:
End While
End If
- frmSplash.CloseForm()
+ frmSplash.Close()
Me.Close()
Catch ex As Exception
End Try
@@ -5618,13 +5618,13 @@ doCancel:
'End If
If Not CloseApp Then
- fLoading.SetStage("Loading translations...")
+ fLoading.SetLoadingMesg("Loading translations...")
APIXML.CacheXMLs()
Me.SetUp(True)
Me.cbSearch.SelectedIndex = 0
- fLoading.SetStage("Positioning controls...")
+ fLoading.SetLoadingMesg("Positioning controls...")
Me.Location = Master.eSettings.WindowLoc
Me.Size = Master.eSettings.WindowSize
Me.WindowState = Master.eSettings.WindowState
@@ -5671,7 +5671,7 @@ doCancel:
Me.ClearInfo()
Application.DoEvents()
- fLoading.SetStage("Loading database...")
+ fLoading.SetLoadingMesg("Loading database...")
If Master.eSettings.Version = String.Format("r{0}", My.Application.Info.Version.Revision) Then
If Master.DB.CheckEssentials() Then
Me.LoadMedia(New Structures.Scans With {.Movies = True, .TV = True})
@@ -5705,7 +5705,7 @@ doCancel:
Master.DB.LoadMovieSourcesFromDB()
Master.DB.LoadTVSourcesFromDB()
- fLoading.SetStage("Setting menus...")
+ fLoading.SetLoadingMesg("Setting menus...")
Me.SetMenus(True)
Functions.GetListOfSources()
Me.cmnuTrayIconExit.Enabled = True
@@ -5720,7 +5720,6 @@ doCancel:
End If
fLoading.Close()
- fLoading.Dispose()
Catch ex As Exception
Master.eLog.WriteToErrorLog(ex.Message, ex.StackTrace, "Error")
End Try
View
89 Ember Media Manager/frmSplash.Designer.vb
@@ -22,80 +22,59 @@ Partial Class frmSplash
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
- Me.Version = New System.Windows.Forms.Label()
- Me.PictureBox1 = New System.Windows.Forms.PictureBox()
- Me.pbLoading = New System.Windows.Forms.ProgressBar()
- Me.txtStage = New System.Windows.Forms.Label()
- CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
+ Me.LoadingBar = New System.Windows.Forms.ProgressBar()
+ Me.VersionNumber = New System.Windows.Forms.Label()
+ Me.LoadingMesg = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
- 'Version
+ 'LoadingBar
'
- Me.Version.BackColor = System.Drawing.Color.Gainsboro
- Me.Version.Font = New System.Drawing.Font("Segoe UI", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Version.ForeColor = System.Drawing.Color.Black
- Me.Version.Location = New System.Drawing.Point(193, 278)
- Me.Version.Name = "Version"
- Me.Version.Size = New System.Drawing.Size(100, 14)
- Me.Version.TabIndex = 2
- Me.Version.Text = "Version X.X.XXXX"
- Me.Version.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
+ Me.LoadingBar.Location = New System.Drawing.Point(1, 357)
+ Me.LoadingBar.Maximum = 9
+ Me.LoadingBar.Name = "LoadingBar"
+ Me.LoadingBar.Size = New System.Drawing.Size(371, 15)
+ Me.LoadingBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous
'
- 'PictureBox1
+ 'VersionNumber
'
- Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.PictureBox1.Image = Global.Ember_Media_Manager.My.Resources.Resources.EmberSplashScreen
- Me.PictureBox1.Location = New System.Drawing.Point(4, 4)
- Me.PictureBox1.Name = "PictureBox1"
- Me.PictureBox1.Size = New System.Drawing.Size(302, 304)
- Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
- Me.PictureBox1.TabIndex = 2
- Me.PictureBox1.TabStop = False
+ Me.VersionNumber.AutoSize = True
+ Me.VersionNumber.BackColor = System.Drawing.Color.Transparent
+ Me.VersionNumber.Location = New System.Drawing.Point(262, 341)
+ Me.VersionNumber.Name = "VersionNumber"
+ Me.VersionNumber.Size = New System.Drawing.Size(110, 13)
+ Me.VersionNumber.Text = "Version {0}.{1}.{2}.{3}"
+ Me.VersionNumber.TextAlign = System.Drawing.ContentAlignment.TopRight
'
- 'pbLoading
+ 'LoadingMesg
'
- Me.pbLoading.Location = New System.Drawing.Point(5, 295)
- Me.pbLoading.Maximum = 9
- Me.pbLoading.Name = "pbLoading"
- Me.pbLoading.Size = New System.Drawing.Size(300, 12)
- Me.pbLoading.Style = System.Windows.Forms.ProgressBarStyle.Continuous
- Me.pbLoading.TabIndex = 4
- '
- 'txtStage
- '
- Me.txtStage.BackColor = System.Drawing.Color.Gainsboro
- Me.txtStage.Font = New System.Drawing.Font("Segoe UI", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.txtStage.ForeColor = System.Drawing.Color.Black
- Me.txtStage.Location = New System.Drawing.Point(8, 278)
- Me.txtStage.Name = "txtStage"
- Me.txtStage.Size = New System.Drawing.Size(175, 14)
- Me.txtStage.TabIndex = 3
- Me.txtStage.Text = "Loading settings..."
- Me.txtStage.TextAlign = System.Drawing.ContentAlignment.BottomLeft
+ Me.LoadingMesg.BackColor = System.Drawing.Color.Transparent
+ Me.LoadingMesg.Location = New System.Drawing.Point(4, 341)
+ Me.LoadingMesg.Name = "LoadingMesg"
+ Me.LoadingMesg.Size = New System.Drawing.Size(252, 13)
+ Me.LoadingMesg.Text = "Loading..."
'
'frmSplash
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi
- Me.ClientSize = New System.Drawing.Size(310, 312)
+ Me.BackgroundImage = Global.Ember_Media_Manager.My.Resources.Resources.EmberSplashScreen
+ Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
+ Me.ClientSize = New System.Drawing.Size(373, 373)
Me.ControlBox = False
- Me.Controls.Add(Me.pbLoading)
- Me.Controls.Add(Me.txtStage)
- Me.Controls.Add(Me.Version)
- Me.Controls.Add(Me.PictureBox1)
- Me.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.Controls.Add(Me.LoadingMesg)
+ Me.Controls.Add(Me.VersionNumber)
+ Me.Controls.Add(Me.LoadingBar)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmSplash"
+ Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
- CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
+ Me.PerformLayout()
End Sub
- Friend WithEvents Version As System.Windows.Forms.Label
- Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
- Friend WithEvents pbLoading As System.Windows.Forms.ProgressBar
- Friend WithEvents txtStage As System.Windows.Forms.Label
-
+ Friend WithEvents LoadingBar As System.Windows.Forms.ProgressBar
+ Friend WithEvents VersionNumber As System.Windows.Forms.Label
+ Friend WithEvents LoadingMesg As System.Windows.Forms.Label
End Class
View
81 Ember Media Manager/frmSplash.vb
@@ -18,38 +18,85 @@
' # along with Ember Media Manager. If not, see <http://www.gnu.org/licenses/>. #
' ################################################################################
-Public NotInheritable Class frmSplash
+Public Class frmSplash
#Region "Delegates"
- Delegate Sub DelegateToCloseForm()
+ Delegate Sub DelegateTo_SetLoadingMesg(message As String)
+ Delegate Sub DelegateTo_SetProgressBarStyle(style As ProgressBarStyle)
+ Delegate Sub DelegateTo_SetProgressBarSize(size As Integer)
+ Delegate Sub DelegateTo_Close()
+ Delegate Sub DelegateTo_Show(owner As IWin32Window)
+ Delegate Sub DelegateTo_Hide()
#End Region 'Delegates
#Region "Methods"
- ' if the splash form, is closed by the main form, it is cross-thread
- ' operation. so we need to use the Invoke method to deal with it.
- Public Sub CloseForm()
+ Public Sub SetLoadingMesg(message As String)
If (Me.InvokeRequired) Then
- Me.Invoke(New DelegateToCloseForm(AddressOf CloseForm))
- Else
- Me.Close()
+ Me.Invoke(New DelegateTo_SetLoadingMesg(AddressOf SetLoadingMesg))
+ Exit Sub
End If
+
+ LoadingMesg.Text = message
+ End Sub
+
+ Public Sub SetProgressBarStyle(style As ProgressBarStyle)
+ If (Me.InvokeRequired) Then
+ Me.Invoke(New DelegateTo_SetProgressBarStyle(AddressOf setProgressBarStyle))
+ Exit Sub
+ End If
+
+ LoadingBar.Style = style
+ End Sub
+
+ Public Sub SetProgressBarSize(size As Integer)
+ If (Me.InvokeRequired) Then
+ Me.Invoke(New DelegateTo_SetProgressBarSize(AddressOf SetProgressBarSize))
+ Exit Sub
+ End If
+
+ LoadingBar.Maximum = size
+ End Sub
+
+ Public Overloads Sub Close()
+ If (Me.InvokeRequired) Then
+ Me.Invoke(New DelegateTo_Close(AddressOf Close))
+ Exit Sub
+ End If
+
+ MyBase.Close()
+ Me.Dispose()
End Sub
- Public Sub SetStage(ByVal txt As String)
- Me.txtStage.Text = txt
- Me.pbLoading.Value += 1
- Application.DoEvents()
+ Public Overloads Sub Show(owner As IWin32Window)
+ If (Me.InvokeRequired) Then
+ Me.Invoke(New DelegateTo_Show(AddressOf Show))
+ Exit Sub
+ End If
+
+ MyBase.Show(owner)
End Sub
- Private Sub frmSplash_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- Me.PictureBox1.Location = New Point(4, 4)
- Me.PictureBox1.Size = New Size(Me.Width - 10, Me.Height - 10)
- Version.Text = String.Format("Version {0}", My.Application.Info.Version.ToString())
+ Public Overloads Sub Hide()
+ If (Me.InvokeRequired) Then
+ Me.Invoke(New DelegateTo_Hide(AddressOf Hide))
+ Exit Sub
+ End If
+
+ MyBase.Hide()
End Sub
#End Region 'Methods
-End Class
+ Private Sub frmSplash_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
+ VersionNumber.Text = System.String.Format(
+ VersionNumber.Text,
+ My.Application.Info.Version.Major,
+ My.Application.Info.Version.Minor,
+ My.Application.Info.Version.Build,
+ My.Application.Info.Version.Revision)
+ End Sub
+
+End Class

0 comments on commit 4bb6920

Please sign in to comment.