diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-10-11 13:47:28 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-10-23 10:59:03 +0200 |
commit | 53637e4b1c94ec69987d0c45e4472d464df8f022 (patch) | |
tree | 8eac8243e155c4a89587437ca672c9a06474349f /platform/android | |
parent | 2ae3631318522f12a8f6fb85834b56874a01efed (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.cpp | 27 |
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; } |