diff options
-rw-r--r-- | xbmc/GUIPassword.cpp | 20 | ||||
-rw-r--r-- | xbmc/GUIWindowMusicBase.cpp | 18 | ||||
-rw-r--r-- | xbmc/GUIWindowVideoBase.cpp | 24 | ||||
-rw-r--r-- | xbmc/MusicDatabase.cpp | 15 | ||||
-rw-r--r-- | xbmc/utils/TuxBoxUtil.cpp | 14 |
5 files changed, 12 insertions, 79 deletions
diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp index 571d57a3bc..0f7fca28a9 100644 --- a/xbmc/GUIPassword.cpp +++ b/xbmc/GUIPassword.cpp @@ -146,15 +146,7 @@ bool CGUIPassword::CheckStartUpLock() strLabel.Format("%i %s",iLeft,strLabel1.c_str()); // PopUp OK and Display: MasterLock mode has changed but no no Mastercode has been set! - CGUIDialogOK *dlg = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - if (!dlg) - return false; - - dlg->SetHeading( g_localizeStrings.Get(20076) ); - dlg->SetLine( 0, g_localizeStrings.Get(12367) ); - dlg->SetLine( 1, g_localizeStrings.Get(12368) ); - dlg->SetLine( 2, strLabel); - dlg->DoModal(); + CGUIDialogOK::ShowAndGetInput(20076, 12367, 12368, strLabel); } else i=g_passwordManager.iMasterLockRetriesLeft; @@ -295,15 +287,7 @@ void CGUIPassword::UpdateMasterLockRetryCount(bool bResetCount) CStdString dlgLine1 = ""; if (0 < g_passwordManager.iMasterLockRetriesLeft) dlgLine1.Format("%d %s", g_passwordManager.iMasterLockRetriesLeft, g_localizeStrings.Get(12343)); - CGUIDialogOK *dialog = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK); // Tell user they entered a bad password - if (dialog) - { - dialog->SetHeading(20075); - dialog->SetLine(0, 12345); - dialog->SetLine(1, dlgLine1); - dialog->SetLine(2, 0); - dialog->DoModal(); - } + CGUIDialogOK::ShowAndGetInput(20075, 12345, dlgLine1, 0); } else g_passwordManager.iMasterLockRetriesLeft = g_guiSettings.GetInt("masterlock.maxretries"); // user entered correct mastercode, reset retries to max allowed diff --git a/xbmc/GUIWindowMusicBase.cpp b/xbmc/GUIWindowMusicBase.cpp index bb4784369b..2b0a86250e 100644 --- a/xbmc/GUIWindowMusicBase.cpp +++ b/xbmc/GUIWindowMusicBase.cpp @@ -1037,14 +1037,7 @@ void CGUIWindowMusicBase::OnRipCD() #endif } else - { - CGUIDialogOK* pDlgOK = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - pDlgOK->SetHeading(257); // Error - pDlgOK->SetLine(0, g_localizeStrings.Get(20099)); // - pDlgOK->SetLine(1, ""); // - pDlgOK->SetLine(2, ""); - pDlgOK->DoModal(); - } + CGUIDialogOK::ShowAndGetInput(257, 20099, 0, 0); } } @@ -1061,14 +1054,7 @@ void CGUIWindowMusicBase::OnRipTrack(int iItem) #endif } else - { - CGUIDialogOK* pDlgOK = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - pDlgOK->SetHeading(257); // Error - pDlgOK->SetLine(0, g_localizeStrings.Get(20099)); // - pDlgOK->SetLine(1, ""); // - pDlgOK->SetLine(2, ""); - pDlgOK->DoModal(); - } + CGUIDialogOK::ShowAndGetInput(257, 20099, 0, 0); } } diff --git a/xbmc/GUIWindowVideoBase.cpp b/xbmc/GUIWindowVideoBase.cpp index 7d28287750..7c30e66c3e 100644 --- a/xbmc/GUIWindowVideoBase.cpp +++ b/xbmc/GUIWindowVideoBase.cpp @@ -676,18 +676,7 @@ bool CGUIWindowVideoBase::ShowIMDB(CFileItem *item, const ScraperPtr &info2) m_database.Close(); return listNeedsUpdating; // user cancelled } - OutputDebugString("failed to get details\n"); - // show dialog... - CGUIDialogOK *pDlgOK = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - if (pDlgOK) - { - pDlgOK->SetHeading(195); - pDlgOK->SetLine(0, movieName); - pDlgOK->SetLine(1, ""); - pDlgOK->SetLine(2, ""); - pDlgOK->SetLine(3, ""); - pDlgOK->DoModal(); - } + CGUIDialogOK::ShowAndGetInput(195, movieName, 0, 0); m_database.Close(); return listNeedsUpdating; } @@ -1773,16 +1762,7 @@ void CGUIWindowVideoBase::AddToDatabase(int iItem) m_database.Close(); // done... - CGUIDialogOK *pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - if (pDialog) - { - pDialog->SetHeading(20177); // Done - pDialog->SetLine(0, movie.m_strTitle); - pDialog->SetLine(1, movie.m_strGenre); - pDialog->SetLine(2, movie.m_strIMDBNumber); - pDialog->SetLine(3, ""); - pDialog->DoModal(); - } + CGUIDialogOK::ShowAndGetInput(20177, movie.m_strTitle, movie.m_strGenre, movie.m_strIMDBNumber); // library view cache needs to be cleared CUtil::DeleteVideoDatabaseDirectoryCache(); diff --git a/xbmc/MusicDatabase.cpp b/xbmc/MusicDatabase.cpp index c7f42948c9..36905355f8 100644 --- a/xbmc/MusicDatabase.cpp +++ b/xbmc/MusicDatabase.cpp @@ -2358,18 +2358,9 @@ bool CMusicDatabase::LookupCDDBInfo(bool bRequery/*=false*/) pCdInfo->SetNoCDDBInfo(); pDialogProgress->Close(); // ..no, an error occured, display it to the user - CGUIDialogOK *pDialogOK = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - if (pDialogOK) - { - CStdString strErrorText; - strErrorText.Format("[%d] %s", cddb.getLastError(), cddb.getLastErrorText()); - - pDialogOK->SetHeading(255); - pDialogOK->SetLine(0, 257); //ERROR - pDialogOK->SetLine(1, strErrorText.c_str() ); - pDialogOK->SetLine(2, ""); - pDialogOK->DoModal(); - } + CStdString strErrorText; + strErrorText.Format("[%d] %s", cddb.getLastError(), cddb.getLastErrorText()); + CGUIDialogOK::ShowAndGetInput(255, 257, strErrorText, 0); } } // if ( !cddb.queryCDinfo( pCdInfo ) ) pDialogProgress->Close(); diff --git a/xbmc/utils/TuxBoxUtil.cpp b/xbmc/utils/TuxBoxUtil.cpp index e1f9eb94db..2510a514c4 100644 --- a/xbmc/utils/TuxBoxUtil.cpp +++ b/xbmc/utils/TuxBoxUtil.cpp @@ -154,17 +154,9 @@ bool CTuxBoxUtil::CreateNewItem(const CFileItem& item, CFileItem& item_new) CLog::Log(LOGDEBUG, "%s ---------------------------------------------------------", __FUNCTION__); CLog::Log(LOGDEBUG, "%s - WARNING: Zaping Failed no Zap Point found!", __FUNCTION__); CLog::Log(LOGDEBUG, "%s ---------------------------------------------------------", __FUNCTION__); - CGUIDialogOK *dialog = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK); - if (dialog) - { - CStdString strText; - strText.Format(g_localizeStrings.Get(21334).c_str(), item.GetLabel()); - dialog->SetHeading( 21331 ); - dialog->SetLine( 0, strText); - dialog->SetLine( 1, 21333 ); - dialog->SetLine( 2, "" ); - dialog->DoModal(); - } + CStdString strText; + strText.Format(g_localizeStrings.Get(21334).c_str(), item.GetLabel()); + CGUIDialogOK::ShowAndGetInput(21331, strText, 21333, 0); } } return false; |