summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp27
-rw-r--r--platform/javascript/export/export.cpp16
2 files changed, 27 insertions, 16 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;
}
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 4de98f7039..e49b1a7bb9 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -61,11 +61,11 @@ public:
virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
- virtual bool poll_devices();
- virtual int get_device_count() const;
- virtual String get_device_name(int p_device) const { return TTR("Run in Browser"); }
- virtual String get_device_info(int p_device) const { return TTR("Run exported HTML in the system's default browser."); }
- virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags);
+ virtual bool poll_export();
+ virtual int get_options_count() const;
+ virtual String get_options_name(int p_index) const { return p_index ? TTR("Stop HTTP Server") : TTR("Run in Browser"); }
+ virtual String get_option_tooltip(int p_index) const { return p_index ? TTR("Stop HTTP Server") : TTR("Run exported HTML in the system's default browser."); }
+ virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_option, int p_debug_flags);
virtual Ref<Texture> get_run_icon() const;
virtual void get_platform_features(List<String> *r_features) {
@@ -337,7 +337,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
return OK;
}
-bool EditorExportPlatformJavaScript::poll_devices() {
+bool EditorExportPlatformJavaScript::poll_export() {
Ref<EditorExportPreset> preset;
@@ -355,12 +355,12 @@ bool EditorExportPlatformJavaScript::poll_devices() {
return runnable_when_last_polled != prev;
}
-int EditorExportPlatformJavaScript::get_device_count() const {
+int EditorExportPlatformJavaScript::get_options_count() const {
return runnable_when_last_polled;
}
-Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
+Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_option, int p_debug_flags) {
String basepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export");
String path = basepath + ".html";