int CGUIDialogYesNo::ShowAndGetInput(const KODI::MESSAGING::HELPERS::DialogYesNoMessage& options) { //Set default yes/no labels, these might be overwritten further down if specified //by the caller SetChoice(0, 106); SetChoice(1, 107); if (!options.heading.isNull()) SetHeading(options.heading); if (!options.text.isNull()) SetText(options.text); if (!options.noLabel.isNull()) SetChoice(0, options.noLabel); if (!options.yesLabel.isNull()) SetChoice(1, options.yesLabel); if (options.autoclose > 0) SetAutoClose(options.autoclose); m_bCanceled = false; for (size_t i = 0; i < 3; ++i) { if (!options.lines[i].isNull()) SetLine(i, options.lines[i]); } Open(); if (m_bCanceled) return -1; return IsConfirmed() ? 1 : 0; }
bool CGUIDialogMusicOSD::OnAction(const CAction &action) { // keyboard or controller movement should prevent autoclosing if (action.wID != ACTION_MOUSE && m_autoClosing) SetAutoClose(3000); return CGUIDialog::OnAction(action); }
bool CGUIDialog::OnAction(const CAction &action) { // keyboard or controller movement should prevent autoclosing if (!action.IsMouse() && m_autoClosing) SetAutoClose(m_showDuration); return CGUIWindow::OnAction(action); }
CMusicLibraryImportJob::CMusicLibraryImportJob(const std::string& xmlFile, CGUIDialogProgress* progressDialog) : CMusicLibraryProgressJob(nullptr) , m_xmlFile(xmlFile) { if (progressDialog) SetProgressIndicators(nullptr, progressDialog); SetAutoClose(true); }
void CGUIDialogKaraokeSongSelector::OnBackspace() { // Clear the number m_selectedNumber /= 10; // Reset activity timer SetAutoClose( m_autoCloseTimeout ); m_updateData = true; }
bool CGUIDialogVolumeBar::OnAction(const CAction &action) { if (action.GetID() == ACTION_VOLUME_UP || action.GetID() == ACTION_VOLUME_DOWN || action.GetID() == ACTION_VOLUME_SET) { // reset the timer, as we've changed the volume level SetAutoClose(VOLUME_BAR_DISPLAY_TIME); return true; } return CGUIDialog::OnAction(action); }
void CProgressJob::SetProgressIndicators(CGUIDialogProgressBarHandle* progressBar, CGUIDialogProgress* progressDialog, bool updateProgress /* = true */, bool updateInformation /* = true */) { SetProgressBar(progressBar); SetProgressDialog(progressDialog); SetUpdateProgress(updateProgress); SetUpdateInformation(updateInformation); // disable auto-closing SetAutoClose(false); }
void CGUIDialogMusicOSD::Render() { if (m_autoClosing) { // check for movement of mouse or a submenu open if (g_Mouse.HasMoved() || m_gWindowManager.IsWindowActive(WINDOW_DIALOG_VIS_SETTINGS) || m_gWindowManager.IsWindowActive(WINDOW_DIALOG_VIS_PRESET_LIST)) SetAutoClose(3000); } CGUIDialog::Render(); }
void CGUIDialogMusicOSD::FrameMove() { if (m_autoClosing) { // check for movement of mouse or a submenu open if (g_Mouse.IsActive() || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_PRESET_LIST)) SetAutoClose(100); // enough for 10fps } CGUIDialog::FrameMove(); }
void CGUIDialogBoxeeCtx::OnInitWindow() { m_pDlgVideoQuality = NULL; if (BoxeeUtils::HasDescription(m_item)) { SET_CONTROL_VISIBLE(BTN_MORE_INFO); } else { SET_CONTROL_HIDDEN(BTN_MORE_INFO); } if ( (m_item.GetPropertyBOOL("isloaded") || m_item.IsApp() ) && (m_item.HasVideoInfoTag() || m_item.HasMusicInfoTag() || m_item.IsRSS() || m_item.IsInternetStream()) ) { SET_CONTROL_VISIBLE(BTN_RATE); SET_CONTROL_VISIBLE(BTN_SHARE); } else { SET_CONTROL_HIDDEN(BTN_RATE); SET_CONTROL_HIDDEN(BTN_SHARE); } //CONTROL_SELECT_ITEM(INFO_HIDDEN_LIST, 1); if (m_item.IsRSS() || m_item.IsLastFM() || m_item.IsShoutCast()) { VECSOURCES *shares = g_settings.GetSourcesFromType(GetItemShareType()); if (shares) { bool bFound = false; for (size_t i=0; !bFound && i < shares->size(); i++) { if ((*shares)[i].strPath == m_item.m_strPath) { m_item.SetProperty("ShareName", (*shares)[i].strName); bFound = true; } } m_item.SetProperty("IsPreset", bFound); m_item.SetProperty("CanPreset", true); } } g_settings.SetSkinString(g_settings.TranslateSkinString("totalTimeMoreThenHour"),g_application.GetTotalTime() < 3600 ? "0" : "1"); SetAutoClose(5000); CGUIDialog::OnInitWindow(); }
bool CGUIDialog::OnAction(const CAction &action) { // keyboard or controller movement should prevent autoclosing if (!action.IsMouse() && m_autoClosing) SetAutoClose(m_showDuration); if (action.GetID() == ACTION_CLOSE_DIALOG || action.GetID() == ACTION_PREVIOUS_MENU || action.GetID() == ACTION_PARENT_DIR) { Close(); return true; } return CGUIWindow::OnAction(action); }
void CGUIWindowOSD::Render() { if (m_autoClosing) { // check for movement of mouse or a submenu open if (g_Mouse.HasMoved() || g_windowManager.IsWindowActive(WINDOW_DIALOG_AUDIO_OSD_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIDEO_OSD_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_SUBTITLE_OSD_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIDEO_BOOKMARKS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_OSD_TELETEXT)) SetAutoClose(3000); } CGUIDialog::Render(); }
void CGUIDialogMusicOSD::FrameMove() { if (m_autoClosing) { // check for movement of mouse or a submenu open if (CInputManager::Get().IsMouseActive() || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_SETTINGS) || g_windowManager.IsWindowActive(WINDOW_DIALOG_VIS_PRESET_LIST) || g_windowManager.IsWindowActive(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS)) // extend show time by original value SetAutoClose(m_showDuration); } CGUIDialog::FrameMove(); }
void CGUIDialogMusicOSD::FrameMove() { if (m_autoClosing) { // check for movement of mouse or a submenu open if (CServiceBroker::GetInputManager().IsMouseActive() || CServiceBroker::GetGUI()->GetWindowManager().IsWindowActive(WINDOW_DIALOG_VIS_SETTINGS) || CServiceBroker::GetGUI()->GetWindowManager().IsWindowActive(WINDOW_DIALOG_VIS_PRESET_LIST) || CServiceBroker::GetGUI()->GetWindowManager().IsWindowActive(WINDOW_DIALOG_PVR_RADIO_RDS_INFO)) // extend show time by original value SetAutoClose(m_showDuration); } CGUIDialog::FrameMove(); }
bool CGUIWindowOSD::OnAction(const CAction &action) { // keyboard or controller movement should prevent autoclosing if (action.id != ACTION_MOUSE && m_autoClosing) SetAutoClose(3000); if (action.id == ACTION_NEXT_ITEM || action.id == ACTION_PREV_ITEM) { // these could indicate next chapter if video supports it if (g_application.m_pPlayer != NULL && g_application.m_pPlayer->OnAction(action)) return true; } return CGUIDialog::OnAction(action); }
bool CGUIDialogVolumeBar::OnAction(const CAction &action) { if (action.GetID() == ACTION_VOLUME_UP || action.GetID() == ACTION_VOLUME_DOWN || action.GetID() == ACTION_VOLUME_SET || action.GetID() == ACTION_MUTE) { if (g_application.IsMuted() || g_application.GetVolume(false) <= VOLUME_MINIMUM) { // cancel the timer, dialog needs to stay visible CancelAutoClose(); return true; } else { // reset the timer, as we've changed the volume level SetAutoClose(VOLUME_BAR_DISPLAY_TIME); return true; } } return CGUIDialog::OnAction(action); }
void CGUIDialogKaraokeSongSelector::OnButtonNumeric( unsigned int code, bool reset_autotimer ) { // Add the number m_selectedNumber = m_selectedNumber * 10 + code; CLog::Log( LOGDEBUG, "CGUIDialogKaraokeSongSelector::OnButtonNumeric %d / %d" , code, m_selectedNumber); // If overflow (a typical way to delete the old number is add zeros), handle it if ( m_selectedNumber >= MAX_SONG_ID ) m_selectedNumber %= MAX_SONG_ID; // Reset activity timer if ( reset_autotimer ) SetAutoClose( m_autoCloseTimeout ); m_updateData = true; }
void CGUIDialogKaraokeSongSelector::OnInitWindow() { CGUIDialog::OnInitWindow(); // Check if there are any karaoke songs in the database if ( !m_musicdatabase.Open() ) { Close(); return; } if ( m_musicdatabase.GetKaraokeSongsCount() == 0 ) { Close(); return; } SetAutoClose( m_autoCloseTimeout ); }
CGUIDialogVolumeBar::CGUIDialogVolumeBar(void) : CGUIDialog(WINDOW_DIALOG_VOLUME_BAR, "DialogVolumeBar.xml", DialogModalityType::MODELESS) { m_loadType = LOAD_ON_GUI_INIT; SetAutoClose(VOLUME_BAR_DISPLAY_TIME); }
void CGUIDialogNumeric::OnNumber(unsigned int num) { if (m_autoCloseTime) { SetAutoClose(m_autoCloseTime); } if (m_mode == INPUT_NUMBER || m_mode == INPUT_PASSWORD) { m_number += num + '0'; } else if (m_mode == INPUT_TIME) { if (m_block == 0) // hour { if (m_dirty) // have input the first digit { if (m_datetime.wHour < 2 || num < 4) { m_datetime.wHour *= 10; m_datetime.wHour += num; } else m_datetime.wHour = num; m_block = 1; // move to minutes m_dirty = false; } else // this is the first digit { m_datetime.wHour = num; if (num > 2) { m_block = 1; // move to minutes m_dirty = false; } else m_dirty = true; } } else // minute { if (m_dirty) // have input the first digit { m_datetime.wMinute *= 10; m_datetime.wMinute += num; m_block = 0; // move to hours m_dirty = false; } else // this is the first digit { m_datetime.wMinute = num; if (num > 5) { m_block = 0; // move to hours m_dirty = false; } else m_dirty = true; } } } else if (m_mode == INPUT_TIME_SECONDS) { if (m_block == 0) // minute { if (m_dirty) // have input the first digit { m_datetime.wMinute *= 10; m_datetime.wMinute += num; m_block = 1; // move to seconds - allows up to 99 minutes m_dirty = false; } else // this is the first digit { m_datetime.wMinute = num; m_dirty = true; } } else // seconds { if (m_dirty) // have input the first digit { m_datetime.wSecond *= 10; m_datetime.wSecond += num; m_block = 0; // move to minutes m_dirty = false; } else // this is the first digit { m_datetime.wSecond = num; if (num > 5) { m_block = 0; // move to minutes m_dirty = false; } else m_dirty = true; } } } else if (m_mode == INPUT_DATE) { if (m_block == 0) // day of month { if (m_dirty && (m_datetime.wDay < 3 || num < 2)) { m_datetime.wDay *= 10; m_datetime.wDay += num; } else m_datetime.wDay = num; if (m_datetime.wDay > 3) { m_block = 1; // move to months m_dirty = false; } else m_dirty = true; } else if (m_block == 1) // months { if (m_dirty && num < 3) { m_datetime.wMonth *= 10; m_datetime.wMonth += num; } else m_datetime.wMonth = num; if (m_datetime.wMonth > 1) { VerifyDate(false); m_block = 2; // move to year m_dirty = false; } else m_dirty = true; } else // year { if (m_dirty && m_datetime.wYear < 1000) // have taken input { m_datetime.wYear *= 10; m_datetime.wYear += num; } else m_datetime.wYear = num; if (m_datetime.wYear > 1000) { VerifyDate(true); m_block = 0; // move to day of month m_dirty = false; } else m_dirty = true; } } else if (m_mode == INPUT_IP_ADDRESS) { if (m_dirty && ((m_ip[m_block] < 25) || (m_ip[m_block] == 25 && num < 6) || !(m_block==0 && num==0))) { m_ip[m_block] *= 10; m_ip[m_block] += num; } else m_ip[m_block] = num; if (m_ip[m_block] > 25 || (m_ip[m_block] == 0 && num == 0)) { m_block++; if (m_block > 3) m_block = 0; m_dirty = false; } else m_dirty = true; } }