summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-10-11 13:47:28 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-10-23 10:59:03 +0200
commit53637e4b1c94ec69987d0c45e4472d464df8f022 (patch)
tree8eac8243e155c4a89587437ca672c9a06474349f /platform/android
parent2ae3631318522f12a8f6fb85834b56874a01efed (diff)
Improve EditorExportPlatform interface.
Convert all get_device* methods to get_option* and normalize their usage as icon, label, tooltip.
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/export/export.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index a43f195b84..6d021ad33a 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1345,7 +1345,7 @@ public:
return logo;
}
- virtual bool poll_devices() {
+ virtual bool poll_export() {
bool dc = devices_changed;
if (dc) {
@@ -1355,7 +1355,7 @@ public:
return dc;
}
- virtual int get_device_count() const {
+ virtual int get_options_count() const {
device_lock->lock();
int dc = devices.size();
@@ -1364,20 +1364,31 @@ public:
return dc;
}
- virtual String get_device_name(int p_device) const {
+ virtual String get_options_tooltip() const {
- ERR_FAIL_INDEX_V(p_device, devices.size(), "");
+ return TTR("Select device from the list");
+ }
+
+ virtual String get_option_label(int p_index) const {
+
+ ERR_FAIL_INDEX_V(p_index, devices.size(), "");
device_lock->lock();
- String s = devices[p_device].name;
+ String s = devices[p_index].name;
device_lock->unlock();
return s;
}
- virtual String get_device_info(int p_device) const {
+ virtual String get_option_tooltip(int p_index) const {
- ERR_FAIL_INDEX_V(p_device, devices.size(), "");
+ ERR_FAIL_INDEX_V(p_index, devices.size(), "");
device_lock->lock();
- String s = devices[p_device].description;
+ String s = devices[p_index].description;
+ if (devices.size() == 1) {
+ // Tooltip will be:
+ // Name
+ // Description
+ s = devices[p_index].name + "\n\n" + s;
+ }
device_lock->unlock();
return s;
}