本文整理汇总了C++中CGUIMessage::GetStringParam方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIMessage::GetStringParam方法的具体用法?C++ CGUIMessage::GetStringParam怎么用?C++ CGUIMessage::GetStringParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIMessage
的用法示例。
在下文中一共展示了CGUIMessage::GetStringParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIDialogAddonSettings::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == CONTROL_SETTINGS_CUSTOM_BUTTON)
{
OnResetSettings();
return true;
}
break;
}
case GUI_MSG_SETTING_UPDATED:
{
std::string settingId = message.GetStringParam(0);
std::string settingValue = message.GetStringParam(1);
std::shared_ptr<CSetting> setting = GetSettingsManager()->GetSetting(settingId);
if (setting != nullptr)
{
setting->FromString(settingValue);
return true;
}
break;
}
default:
break;
}
return CGUIDialogSettingsManagerBase::OnMessage(message);
}
示例2: OnMessage
bool CGUIWindowGames::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
m_rootDir.AllowNonLocalSources(true); //! @todo
// Is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
message.SetStringParam(CMediaSourceSettings::GetInstance().GetDefaultSource("games"));
//! @todo
m_dlgProgress = dynamic_cast<CGUIDialogProgress*>(g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS));
break;
}
case GUI_MSG_CLICKED:
{
if (OnClickMsg(message.GetSenderId(), message.GetParam1()))
return true;
break;
}
default:
break;
}
return CGUIMediaWindow::OnMessage(message);
}
示例3: OnMessage
bool CGUIWindowSettingsCategory::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
m_iSection = (int)message.GetParam2() - (int)CGUIDialogSettingsManagerBase::GetID();
CGUIDialogSettingsManagerBase::OnMessage(message);
m_returningFromSkinLoad = false;
if (!message.GetStringParam(0).empty())
FocusCategory(message.GetStringParam(0));
return true;
}
case GUI_MSG_FOCUSED:
{
if (!m_returningFromSkinLoad)
CGUIDialogSettingsManagerBase::OnMessage(message);
return true;
}
case GUI_MSG_LOAD_SKIN:
{
if (IsActive())
m_returningFromSkinLoad = true;
break;
}
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1() == GUI_MSG_WINDOW_RESIZE)
{
if (IsActive() && CDisplaySettings::GetInstance().GetCurrentResolution() != g_graphicsContext.GetVideoResolution())
{
CDisplaySettings::GetInstance().SetCurrentResolution(g_graphicsContext.GetVideoResolution(), true);
CreateSettings();
}
}
break;
}
}
return CGUIDialogSettingsManagerBase::OnMessage(message);
}
示例4: OnMessage
bool CGUIDialogBoxeeBrowseMenu::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_INIT:
{
CStdString param = message.GetStringParam(0);
m_openInSearch = (param == "openinsearch");
}
break;
case GUI_MSG_LABEL2_SET:
{
CGUIDialogBoxeeSearch *pSearchDialog = (CGUIDialogBoxeeSearch*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SEARCH);
if (pSearchDialog && pSearchDialog->ClosedByMovingRightFromTextBox())
{
CAction action;
action.id = ACTION_MOVE_RIGHT;
OnAction(action);
}
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == BROWSE_MENU_BUTTON_SEARCH)
{
// Get the keystroke that was pressed
bool bResult = CGUIDialog::OnMessage(message);
SET_CONTROL_FOCUS(BROWSE_MENU_BUTTON_SEARCH,0);
CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH);
if (pSearchControl)
{
CStdString strSearchTerm = pSearchControl->GetLabel2();
//pSearchControl->SetLabel2("");
CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowseMenu::OnMessage - [term=%s] (search)", strSearchTerm.c_str());
ThreadMessage tMsg(TMSG_GUI_ACTIVATE_WINDOW , WINDOW_DIALOG_BOXEE_SEARCH , false);
std::vector<CStdString> params;
params.push_back(strSearchTerm);
tMsg.params = params;
g_application.getApplicationMessenger().SendMessage(tMsg,false);
}
return bResult;
}
OnClick(iControl);
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例5: OnMessage
bool CGUIWindowPrograms::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
}
break;
case GUI_MSG_WINDOW_INIT:
{
m_dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
// is this the first time accessing this window?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().IsEmpty())
message.SetStringParam(CMediaSourceSettings::Get().GetDefaultSource("programs"));
return CGUIMediaWindow::OnMessage(message);
}
break;
case GUI_MSG_CLICKED:
{
if (m_viewControl.HasControl(message.GetSenderId())) // list/thumb control
{
int iAction = message.GetParam1();
int iItem = m_viewControl.GetSelectedItem();
if (iAction == ACTION_PLAYER_PLAY)
{
OnPlayMedia(iItem);
return true;
}
else if (iAction == ACTION_SHOW_INFO)
{
OnInfo(iItem);
return true;
}
}
}
break;
}
return CGUIMediaWindow::OnMessage(message);
}
示例6: OnMessage
bool CGUIDialogAccessPoints::OnMessage(CGUIMessage& message)
{
bool result = CGUIDialog::OnMessage(message);
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
m_use_ipconfig = false;
m_doing_connection = false;
// fetch the param list
std::string param(message.GetStringParam());
// network apply vs network connect
if (param.find("name+") != std::string::npos)
{
m_use_ipconfig = true;
// network apply, param contains a description for connecting
// to an access point. we want to find this access point,
// disable the others, then inject a OnAction msg to select it.
DecodeAccessPointParam(param);
// change the label to show we are doing a connection.
CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), ACCESS_POINT_LABEL);
// <string id="33203">Connecting</string>
msg.SetLabel(g_localizeStrings.Get(33203));
OnMessage(msg);
}
UpdateConnectionList();
// if we are doing an 'apply', then inject a click on the "selected" item.
if (m_use_ipconfig)
CApplicationMessenger::Get().SendAction(CAction(ACTION_SELECT_ITEM), GetID());
break;
}
case GUI_MSG_WINDOW_DEINIT:
{
}
}
return result;
}
示例7: OnMessage
/*!
\brief Handle messages on window.
\param message GUI Message that can be reacted on.
\return if a message can't be processed, return \e false
On these messages this class reacts.\n
When retrieving...
- #GUI_MSG_WINDOW_DEINIT\n
...the last focused control is saved to m_iLastControl.
- #GUI_MSG_WINDOW_INIT\n
...the musicdatabase is opend and the music extensions and shares are set.
The last focused control is set.
- #GUI_MSG_CLICKED\n
... the base class reacts on the following controls:\n
Buttons:\n
- #CONTROL_BTNVIEWASICONS - switch between list, thumb and with large items
- #CONTROL_BTNTYPE - switch between music windows
- #CONTROL_BTNSEARCH - Search for items\n
Other Controls:
- The container controls\n
Have the following actions in message them clicking on them.
- #ACTION_QUEUE_ITEM - add selected item to playlist
- #ACTION_SHOW_INFO - retrieve album info from the internet
- #ACTION_SELECT_ITEM - Item has been selected. Overwrite OnClick() to react on it
*/
bool CGUIWindowMusicBase::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
m_musicdatabase.Close();
}
break;
case GUI_MSG_WINDOW_INIT:
{
m_dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
m_musicdatabase.Open();
if (!CGUIMediaWindow::OnMessage(message))
return false;
// save current window, unless the current window is the music playlist window
if (GetID() != WINDOW_MUSIC_PLAYLIST &&
CSettings::GetInstance().GetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW) != GetID())
{
CSettings::GetInstance().SetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW, GetID());
CSettings::GetInstance().Save();
}
return true;
}
break;
case GUI_MSG_DIRECTORY_SCANNED:
{
CFileItem directory(message.GetStringParam(), true);
// Only update thumb on a local drive
if (directory.IsHD())
{
std::string strParent;
URIUtils::GetParentPath(directory.GetPath(), strParent);
if (directory.GetPath() == m_vecItems->GetPath() || strParent == m_vecItems->GetPath())
Refresh();
}
}
break;
// update the display
case GUI_MSG_SCAN_FINISHED:
case GUI_MSG_REFRESH_THUMBS:
Refresh();
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_BTNTYPE)
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_BTNTYPE);
g_windowManager.SendMessage(msg);
int nWindow = WINDOW_MUSIC_FILES + msg.GetParam1();
if (nWindow == GetID())
return true;
CSettings::GetInstance().SetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW, nWindow);
CSettings::GetInstance().Save();
g_windowManager.ChangeActiveWindow(nWindow);
CGUIMessage msg2(GUI_MSG_SETFOCUS, CSettings::GetInstance().GetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW), CONTROL_BTNTYPE);
g_windowManager.SendMessage(msg2);
return true;
}
//.........这里部分代码省略.........
示例8: OnMessage
bool CGUIWindowMusicSongs::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
break;
case GUI_MSG_WINDOW_INIT:
{
// removed the start window check from files view
// the window translator does it by using a virtual window id (5)
// check for a passed destination path
CStdString strDestination = message.GetStringParam();
if (!strDestination.IsEmpty())
{
message.SetStringParam("");
CLog::Log(LOGINFO, "Attempting to quickpath to: %s", strDestination.c_str());
m_history.ClearPathHistory();
}
// is this the first time the window is opened?
if (m_vecItems->m_strPath == "?" && strDestination.IsEmpty())
{
strDestination = g_settings.m_defaultMusicSource;
m_vecItems->m_strPath=strDestination;
CLog::Log(LOGINFO, "Attempting to default to: %s", strDestination.c_str());
}
// try to open the destination path
if (!strDestination.IsEmpty())
{
// open root
if (strDestination.Equals("$ROOT"))
{
m_vecItems->m_strPath = "";
CLog::Log(LOGINFO, " Success! Opening root listing.");
}
// open playlists location
else if (strDestination.Equals("$PLAYLISTS"))
{
m_vecItems->m_strPath = "special://musicplaylists/";
CLog::Log(LOGINFO, " Success! Opening destination path: %s", m_vecItems->m_strPath.c_str());
}
else
{
// default parameters if the jump fails
m_vecItems->m_strPath.Empty();
bool bIsSourceName = false;
SetupShares();
VECSOURCES shares;
m_rootDir.GetSources(shares);
int iIndex = CUtil::GetMatchingSource(strDestination, shares, bIsSourceName);
if (iIndex > -1)
{
bool unlocked = true;
if (iIndex < (int)shares.size() && shares[iIndex].m_iHasLock == 2)
{
CFileItem item(shares[iIndex]);
if (!g_passwordManager.IsItemUnlocked(&item,"music"))
{
m_vecItems->m_strPath = ""; // no u don't
unlocked = false;
CLog::Log(LOGINFO, " Failure! Failed to unlock destination path: %s", strDestination.c_str());
}
}
// set current directory to matching share
if (unlocked)
{
if (bIsSourceName)
m_vecItems->m_strPath=shares[iIndex].strPath;
else
m_vecItems->m_strPath=strDestination;
CLog::Log(LOGINFO, " Success! Opened destination path: %s (%s)", strDestination.c_str(), m_vecItems->m_strPath.c_str());
}
}
else
{
CLog::Log(LOGERROR, " Failed! Destination parameter (%s) does not match a valid source!", strDestination.c_str());
}
}
// check for network up
if (CUtil::IsRemote(m_vecItems->m_strPath) && !WaitForNetwork())
m_vecItems->m_strPath.Empty();
// need file filters or GetDirectory in SetHistoryPath fails
SetHistoryForPath(m_vecItems->m_strPath);
}
return CGUIWindowMusicBase::OnMessage(message);
}
break;
case GUI_MSG_DIRECTORY_SCANNED:
{
CFileItem directory(message.GetStringParam(), true);
//.........这里部分代码省略.........
示例9: OnMessage
bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_RESET:
m_vecItems->m_strPath = "?";
break;
case GUI_MSG_WINDOW_DEINIT:
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
break;
case GUI_MSG_WINDOW_INIT:
{
/* We don't want to show Autosourced items (ie removable pendrives, memorycards) in Library mode */
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
if (m_vecItems->m_strPath == "?" && message.GetStringParam().IsEmpty())
message.SetStringParam(g_settings.m_defaultVideoLibSource);
DisplayEmptyDatabaseMessage(false); // reset message state
SetProperty("flattened", g_settings.m_bMyVideoNavFlatten);
if (!CGUIWindowVideoBase::OnMessage(message))
return false;
// base class has opened the database, do our check
m_database.Open();
DisplayEmptyDatabaseMessage(!m_database.HasContent());
if (m_bDisplayEmptyDatabaseMessage)
{
// no library - make sure we focus on a known control, and default to the root.
SET_CONTROL_FOCUS(CONTROL_BTNTYPE, 0);
m_vecItems->m_strPath = "";
SetHistoryForPath("");
Update("");
}
m_database.Close();
return true;
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_BTNPARTYMODE)
{
if (g_partyModeManager.IsEnabled())
g_partyModeManager.Disable();
else
{
if (!g_partyModeManager.Enable(PARTYMODECONTEXT_VIDEO))
{
SET_CONTROL_SELECTED(GetID(),CONTROL_BTNPARTYMODE,false);
return false;
}
// Playlist directory is the root of the playlist window
if (m_guiState.get()) m_guiState->SetPlaylistDirectory("playlistvideo://");
return true;
}
UpdateButtons();
}
if (iControl == CONTROL_BTNSEARCH)
{
OnSearch();
}
else if (iControl == CONTROL_BTNSHOWMODE)
{
g_settings.CycleWatchMode(m_vecItems->GetContent());
g_settings.Save();
// TODO: Can we perhaps filter this directly? Probably not for some of the more complicated views,
// but for those perhaps we can just display them all, and only filter when we get a list
// of actual videos?
Update(m_vecItems->m_strPath);
return true;
}
else if (iControl == CONTROL_BTNFLATTEN)
{
g_settings.m_bMyVideoNavFlatten = !g_settings.m_bMyVideoNavFlatten;
g_settings.Save();
SetProperty("flattened", g_settings.m_bMyVideoNavFlatten);
CUtil::DeleteVideoDatabaseDirectoryCache();
SetupShares();
Update("");
return true;
}
else if (iControl == CONTROL_BTNSHOWALL)
{
if (g_settings.GetWatchMode(m_vecItems->GetContent()) == VIDEO_SHOW_ALL)
g_settings.SetWatchMode(m_vecItems->GetContent(), VIDEO_SHOW_UNWATCHED);
else
g_settings.SetWatchMode(m_vecItems->GetContent(), VIDEO_SHOW_ALL);
g_settings.Save();
//.........这里部分代码省略.........
示例10: OnMessage
bool CGUIWindowSlideShow::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_Resolution != g_guiSettings.m_LookAndFeelResolution)
{
//FIXME: Use GUI resolution for now
//g_graphicsContext.SetVideoResolution(g_guiSettings.m_LookAndFeelResolution, TRUE);
}
// Reset();
if (message.GetParam1() != WINDOW_PICTURES)
{
m_ImageLib.Unload();
}
g_windowManager.ShowOverlay(OVERLAY_STATE_SHOWN);
FreeResources();
}
break;
case GUI_MSG_WINDOW_INIT:
{
m_Resolution = (RESOLUTION) g_guiSettings.GetInt("pictures.displayresolution");
//FIXME: Use GUI resolution for now
if (0 /*m_Resolution != g_guiSettings.m_LookAndFeelResolution && m_Resolution != INVALID && m_Resolution!=AUTORES*/)
{
g_graphicsContext.SetVideoResolution(m_Resolution);
}
else
{
m_Resolution = g_graphicsContext.GetVideoResolution();
}
CGUIWindow::OnMessage(message);
if (message.GetParam1() != WINDOW_PICTURES)
{
m_ImageLib.Load();
}
g_windowManager.ShowOverlay(OVERLAY_STATE_HIDDEN);
// turn off slideshow if we only have 1 image
if (m_slides->Size() <= 1)
m_bSlideShow = false;
return true;
}
break;
case GUI_MSG_START_SLIDESHOW:
{
CStdString strFolder = message.GetStringParam();
unsigned int iParams = message.GetParam1();
//decode params
bool bRecursive = false;
bool bRandom = false;
bool bNotRandom = false;
if (iParams > 0)
{
if ((iParams & 1) == 1)
bRecursive = true;
if ((iParams & 2) == 2)
bRandom = true;
if ((iParams & 4) == 4)
bNotRandom = true;
}
RunSlideShow(strFolder, bRecursive, bRandom, bNotRandom);
}
break;
case GUI_MSG_PLAYLISTPLAYER_STOPPED:
{
m_bPlayingVideo = false;
if (m_bSlideShow)
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
}
break;
case GUI_MSG_PLAYBACK_STARTED:
{
if(m_bSlideShow && m_bPlayingVideo)
g_windowManager.ActivateWindow(WINDOW_FULLSCREEN_VIDEO);
m_bPlayingVideo = false;
}
break;
case GUI_MSG_PLAYBACK_STOPPED:
{
m_bSlideShow = false;
g_windowManager.PreviousWindow();
}
break;
}
return CGUIWindow::OnMessage(message);
}
示例11: OnMessage
bool CGUIDialogSmartPlaylistEditor::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
int iAction = message.GetParam1();
if (iControl == CONTROL_RULE_LIST && (iAction == ACTION_SELECT_ITEM || iAction == ACTION_MOUSE_LEFT_CLICK))
OnRuleList(GetSelectedItem());
else if (iControl == CONTROL_RULE_ADD)
OnRuleAdd();
else if (iControl == CONTROL_RULE_EDIT)
OnRuleList(GetSelectedItem());
else if (iControl == CONTROL_RULE_REMOVE)
OnRuleRemove(GetSelectedItem());
else if (iControl == CONTROL_NAME)
OnEditChanged(iControl, m_playlist.m_playlistName);
else if (iControl == CONTROL_OK)
OnOK();
else if (iControl == CONTROL_CANCEL)
OnCancel();
else if (iControl == CONTROL_MATCH)
OnMatch();
else if (iControl == CONTROL_LIMIT)
OnLimit();
else if (iControl == CONTROL_ORDER_FIELD)
OnOrder();
else if (iControl == CONTROL_ORDER_DIRECTION)
OnOrderDirection();
else if (iControl == CONTROL_TYPE)
OnType();
else if (iControl == CONTROL_GROUP_BY)
OnGroupBy();
else if (iControl == CONTROL_GROUP_MIXED)
OnGroupMixed();
else
return CGUIDialog::OnMessage(message);
return true;
}
break;
case GUI_MSG_FOCUSED:
if (message.GetControlId() == CONTROL_RULE_REMOVE ||
message.GetControlId() == CONTROL_RULE_EDIT)
HighlightItem(GetSelectedItem());
else
{
if (message.GetControlId() == CONTROL_RULE_LIST)
UpdateRuleControlButtons();
HighlightItem(-1);
}
break;
case GUI_MSG_WINDOW_INIT:
{
const std::string& startupList = message.GetStringParam(0);
if (!startupList.empty())
{
int party = 0;
if (URIUtils::PathEquals(startupList, CProfilesManager::GetInstance().GetUserDataItem("PartyMode.xsp")))
party = 1;
else if (URIUtils::PathEquals(startupList, CProfilesManager::GetInstance().GetUserDataItem("PartyMode-Video.xsp")))
party = 2;
if ((party && !XFILE::CFile::Exists(startupList)) ||
m_playlist.Load(startupList))
{
m_path = startupList;
if (party == 1)
m_mode = "partymusic";
else if (party == 2)
m_mode = "partyvideo";
else
{
PLAYLIST_TYPE type = ConvertType(m_playlist.GetType());
if (type == TYPE_SONGS || type == TYPE_ALBUMS || type == TYPE_ARTISTS)
m_mode = "music";
else
m_mode = "video";
}
}
else
return false;
}
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例12: OnMessage
bool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
switch (iControl)
{
case CTL_BUTTON_DONE:
OnOK();
break;
case CTL_BUTTON_CANCEL:
Close();
break;
case CTL_BUTTON_SHIFT:
OnShift();
break;
case CTL_BUTTON_CAPS:
if (m_keyType == LOWER)
m_keyType = CAPS;
else if (m_keyType == CAPS)
m_keyType = LOWER;
UpdateButtons();
break;
case CTL_BUTTON_LAYOUT:
OnLayout();
break;
case CTL_BUTTON_SYMBOLS:
OnSymbols();
break;
case CTL_BUTTON_LEFT:
MoveCursor( -1);
break;
case CTL_BUTTON_RIGHT:
MoveCursor(1);
break;
case CTL_BUTTON_IP_ADDRESS:
OnIPAddress();
break;
case CTL_BUTTON_CLEAR:
SetEditText("");
break;
case CTL_EDIT:
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CTL_EDIT);
OnMessage(msg);
// update callback I guess?
if (m_pCharCallback)
{ // we did _something_, so make sure our search message filter is reset
m_pCharCallback(this, msg.GetLabel());
}
m_text = msg.GetLabel();
return true;
}
default:
OnClickButton(iControl);
break;
}
}
break;
case GUI_MSG_SET_TEXT:
{
// the edit control only handles these messages if it is either focused
// or its specific control ID is set in the message. As neither is the
// case here (focus is on one of the keyboard buttons) we have to force
// the control ID of the message to the control ID of the edit control
// (unfortunately we have to create a whole copy of the message object for that)
CGUIMessage messageCopy(message.GetMessage(), message.GetSenderId(), CTL_EDIT, message.GetParam1(), message.GetParam2(), message.GetItem());
messageCopy.SetLabel(message.GetLabel());
// ensure this goes to the edit control
CGUIControl *edit = GetControl(CTL_EDIT);
if (edit)
edit->OnMessage(messageCopy);
// close the dialog if requested
if (message.GetMessage() == GUI_MSG_SET_TEXT && message.GetParam1() > 0)
OnOK();
return true;
}
case GUI_MSG_CODINGTABLE_LOOKUP_COMPLETED:
{
std::string code = message.GetStringParam();
if (code == m_hzcode)
{
int response = message.GetParam1();
auto words = m_codingtable->GetResponse(response);
m_words.insert(m_words.end(), words.begin(), words.end());
ShowWordList(0);
}
}
}
return CGUIDialog::OnMessage(message);
}
示例13: OnMessage
bool CGUIControllerWindow::OnMessage(CGUIMessage& message)
{
// Set to true to block the call to the super class
bool bHandled = false;
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
//! @todo Process params here, don't just record them for later
m_param = message.GetStringParam();
break;
}
case GUI_MSG_CLICKED:
{
int controlId = message.GetSenderId();
if (controlId == CONTROL_CLOSE_BUTTON)
{
Close();
bHandled = true;
}
else if (controlId == CONTROL_GET_MORE)
{
GetMoreControllers();
bHandled = true;
}
else if (controlId == CONTROL_RESET_BUTTON)
{
ResetController();
bHandled = true;
}
else if (controlId == CONTROL_HELP_BUTTON)
{
ShowHelp();
bHandled = true;
}
else if (controlId == CONTROL_FIX_SKIPPING)
{
ShowButtonCaptureDialog();
}
else if (CONTROL_CONTROLLER_BUTTONS_START <= controlId && controlId < CONTROL_CONTROLLER_BUTTONS_END)
{
OnControllerSelected(controlId - CONTROL_CONTROLLER_BUTTONS_START);
bHandled = true;
}
else if (CONTROL_FEATURE_BUTTONS_START <= controlId && controlId < CONTROL_FEATURE_BUTTONS_END)
{
OnFeatureSelected(controlId - CONTROL_FEATURE_BUTTONS_START);
bHandled = true;
}
break;
}
case GUI_MSG_FOCUSED:
{
int controlId = message.GetControlId();
if (CONTROL_CONTROLLER_BUTTONS_START <= controlId && controlId < CONTROL_CONTROLLER_BUTTONS_END)
{
OnControllerFocused(controlId - CONTROL_CONTROLLER_BUTTONS_START);
}
else if (CONTROL_FEATURE_BUTTONS_START <= controlId && controlId < CONTROL_FEATURE_BUTTONS_END)
{
OnFeatureFocused(controlId - CONTROL_FEATURE_BUTTONS_START);
}
break;
}
case GUI_MSG_SETFOCUS:
{
int controlId = message.GetControlId();
if (CONTROL_CONTROLLER_BUTTONS_START <= controlId && controlId < CONTROL_CONTROLLER_BUTTONS_END)
{
OnControllerFocused(controlId - CONTROL_CONTROLLER_BUTTONS_START);
}
else if (CONTROL_FEATURE_BUTTONS_START <= controlId && controlId < CONTROL_FEATURE_BUTTONS_END)
{
OnFeatureFocused(controlId - CONTROL_FEATURE_BUTTONS_START);
}
break;
}
case GUI_MSG_REFRESH_LIST:
{
int controlId = message.GetControlId();
if (controlId == CONTROL_CONTROLLER_LIST)
{
if (m_controllerList && m_controllerList->Refresh())
{
CGUIDialog::OnMessage(message);
bHandled = true;
}
}
break;
}
default:
break;
}
if (!bHandled)
//.........这里部分代码省略.........
示例14: OnMessage
bool CGUIWindowMusicSongs::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
break;
case GUI_MSG_WINDOW_INIT:
{
// removed the start window check from files view
// the window translator does it by using a virtual window id (5)
// is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
message.SetStringParam(CMediaSourceSettings::Get().GetDefaultSource("music"));
return CGUIWindowMusicBase::OnMessage(message);
}
break;
case GUI_MSG_DIRECTORY_SCANNED:
{
CFileItem directory(message.GetStringParam(), true);
// Only update thumb on a local drive
if (directory.IsHD())
{
CStdString strParent;
URIUtils::GetParentPath(directory.GetPath(), strParent);
if (directory.GetPath() == m_vecItems->GetPath() || strParent == m_vecItems->GetPath())
Refresh();
}
}
break;
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1()==GUI_MSG_REMOVED_MEDIA)
DeleteRemoveableMediaDirectoryCache();
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_BTNPLAYLISTS)
{
if (!m_vecItems->GetPath().Equals("special://musicplaylists/"))
Update("special://musicplaylists/");
}
else if (iControl == CONTROL_BTNSCAN)
{
OnScan(-1);
}
else if (iControl == CONTROL_BTNREC)
{
if (g_application.m_pPlayer->IsPlayingAudio() )
{
if (g_application.m_pPlayer->CanRecord() )
{
bool bIsRecording = g_application.m_pPlayer->IsRecording();
g_application.m_pPlayer->Record(!bIsRecording);
UpdateButtons();
}
}
}
else if (iControl == CONTROL_BTNRIP)
{
OnRipCD();
}
}
break;
}
return CGUIWindowMusicBase::OnMessage(message);
}
示例15: OnMessage
bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
if (m_thumbLoader.IsLoading())
m_thumbLoader.StopThread();
}
break;
case GUI_MSG_WINDOW_INIT:
{
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
m_vecItems->SetPath("");
SetProperties();
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_AUTOUPDATE)
{
const CGUIControl *control = GetControl(CONTROL_AUTOUPDATE);
if (control && control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
CSettings::GetInstance().SetInt(CSettings::SETTING_GENERAL_ADDONUPDATES, (CSettings::GetInstance().GetInt(CSettings::SETTING_GENERAL_ADDONUPDATES)+1) % AUTO_UPDATES_MAX);
else
CSettings::GetInstance().SetInt(CSettings::SETTING_GENERAL_ADDONUPDATES, (CSettings::GetInstance().GetInt(CSettings::SETTING_GENERAL_ADDONUPDATES) == 0) ? 1 : 0);
UpdateButtons();
return true;
}
else if (iControl == CONTROL_SHUTUP)
{
CSettings::GetInstance().ToggleBool(CSettings::SETTING_GENERAL_ADDONNOTIFICATIONS);
CSettings::GetInstance().Save();
return true;
}
else if (iControl == CONTROL_FOREIGNFILTER)
{
CSettings::GetInstance().ToggleBool(CSettings::SETTING_GENERAL_ADDONFOREIGNFILTER);
CSettings::GetInstance().Save();
Refresh();
return true;
}
else if (iControl == CONTROL_BROKENFILTER)
{
CSettings::GetInstance().ToggleBool(CSettings::SETTING_GENERAL_ADDONBROKENFILTER);
CSettings::GetInstance().Save();
Refresh();
return true;
}
else if (iControl == CONTROL_CHECK_FOR_UPDATES)
{
CRepositoryUpdater::GetInstance().CheckForUpdates(true);
return true;
}
else if (m_viewControl.HasControl(iControl)) // list/thumb control
{
// get selected item
int iItem = m_viewControl.GetSelectedItem();
int iAction = message.GetParam1();
// iItem is checked for validity inside these routines
if (iAction == ACTION_SHOW_INFO)
{
if (!m_vecItems->Get(iItem)->GetProperty("Addon.ID").empty())
return CGUIDialogAddonInfo::ShowForItem((*m_vecItems)[iItem]);
return false;
}
}
}
break;
case GUI_MSG_NOTIFY_ALL:
{
if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && IsActive() && message.GetNumStringParams() == 1)
{ // update this item
for (int i = 0; i < m_vecItems->Size(); ++i)
{
CFileItemPtr item = m_vecItems->Get(i);
if (item->GetProperty("Addon.ID") == message.GetStringParam())
{
SetItemLabel2(item);
return true;
}
}
}
else if (message.GetParam1() == GUI_MSG_UPDATE && IsActive())
SetProperties();
}
break;
default:
break;
}
return CGUIMediaWindow::OnMessage(message);
}