Преглед изворни кода

tools: disable selection of external tools under Windows

Daniele Bartolini пре 4 година
родитељ
комит
c284cb144f
2 измењених фајлова са 9 додато и 3 уклоњено
  1. 1 1
      docs/changelog.rst
  2. 8 2
      tools/level_editor/preferences_dialog.vala

+ 1 - 1
docs/changelog.rst

@@ -14,7 +14,7 @@ Changelog
 * Fixed Engine View not redrawing when a command was sent from the Console.
 * Various fixes and improvements to the Console.
 * The Editor will now check whether the file being edited is deleted from the Project Browser to ask user for confirmation.
-* Added the ability to set in the Preferences the external editors to use when opening Lua and image files.
+* Added the ability to set in the Preferences the external editors to use when opening Lua and image files. (Currently only available on Linux.)
 * Custom theme improvements.
 * Fixed duplicated entries in the Resource Chooser.
 * Changing the sprite in the Sprite Renderer component is now reflected to the Runtime.

+ 8 - 2
tools/level_editor/preferences_dialog.vala

@@ -136,10 +136,11 @@ public class PreferencesDialog : Gtk.Dialog
 
 		// External tools page.
 		_lua_external_tool_button = new AppChooserButton("text/plain");
-		_lua_external_tool_button.show_dialog_item = true;
 		_image_external_tool_button = new AppChooserButton("image/*");
+#if CROWN_PLATFORM_LINUX
+		_lua_external_tool_button.show_dialog_item = true;
 		_image_external_tool_button.show_dialog_item = true;
-
+#endif // CROWN_PLATFORM_LINUX
 		cv = new PropertyGrid();
 		cv.column_homogeneous = true;
 		cv.add_row("External Lua editor", _lua_external_tool_button);
@@ -202,6 +203,7 @@ public class PreferencesDialog : Gtk.Dialog
 		if (preferences.has_key("theme"))
 			_theme_combo.value = (string)preferences["theme"];
 
+#if CROWN_PLATFORM_LINUX
 		// External tools.
 		Hashtable external_tools = preferences.has_key("external_tools")
 			? (Hashtable)preferences["external_tools"]
@@ -241,6 +243,10 @@ public class PreferencesDialog : Gtk.Dialog
 		else
 			app_id = null;
 		_image_external_tool_button.set_app(app, app_id);
+#else
+		_lua_external_tool_button.set_app(AppChooserButton.APP_DEFAULT, null);
+		_image_external_tool_button.set_app(AppChooserButton.APP_DEFAULT, null);
+#endif // CROWN_PLATFORM_LINUX
 	}
 
 	public void encode(Hashtable settings)