Add vibrations to Checkbox, Fileselect, Listbox and Partitionlist

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I7b0e27930857add1ac88671a71310bea56fc4e74
This commit is contained in:
Vojtech Bocek
2014-02-08 02:21:23 +01:00
parent 175cb7b25d
commit 5af8f3faca
4 changed files with 10 additions and 0 deletions

View File

@@ -166,6 +166,8 @@ int GUICheckbox::NotifyTouch(TOUCH_STATE state, int x, int y)
DataManager::GetValue(mVarName, lastState);
lastState = (lastState == 0) ? 1 : 0;
DataManager::SetValue(mVarName, lastState);
DataManager::Vibrate("tw_button_vibrate");
}
return 0;
}

View File

@@ -783,6 +783,8 @@ int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y)
if (startSelection < folderSize + fileSize)
{
DataManager::Vibrate("tw_button_vibrate");
if (startSelection < folderSize)
{
std::string oldcwd;

View File

@@ -733,6 +733,8 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y)
mList.at(actualSelection).selected = 1;
DataManager::SetValue(mVariable, str);
mUpdate = 1;
DataManager::Vibrate("tw_button_vibrate");
}
} else {
// This is for kinetic scrolling

View File

@@ -735,6 +735,8 @@ int GUIPartitionList::NotifyTouch(TOUCH_STATE state, int x, int y)
}
if (actualSelection < listSize && ListType == "mount") {
DataManager::Vibrate("tw_button_vibrate");
if (!mList.at(actualSelection).selected) {
if (PartitionManager.Mount_By_Path(mList.at(actualSelection).Mount_Point, true)) {
mList.at(actualSelection).selected = 1;
@@ -747,6 +749,8 @@ int GUIPartitionList::NotifyTouch(TOUCH_STATE state, int x, int y)
}
}
} else if (actualSelection < listSize && !mVariable.empty()) {
DataManager::Vibrate("tw_button_vibrate");
if (ListType == "storage") {
int i;
std::string str = mList.at(actualSelection).Mount_Point;