#textdomain wesnoth-lib
###
### Definition of the window to connect to the addon server or manage locally
### installed addons.
###

[window]
	id = "addon_connect"
	description = "Addon server connection dialog."

	[resolution]
		definition = "default"

		automatic_placement = "true"
		vertical_placement = "center"
		horizontal_placement = "center"

		[grid]
			
			[row]
				grow_factor = 0

				[column]
					grow_factor = 1

					border = "all"
					border_size = 5
					horizontal_alignment = "left"
					[label]
						definition = "title"

						label = _ "Connect to Server"
					[/label]

				[/column]

			[/row]

			[row]
				grow_factor = 0

				[column]
					grow_factor = 1

					border = "all"
					border_size = 5
					horizontal_alignment = "left"
					[label]
						definition = "default"

						label = _ "You will now connect to a server to download add-ons."
					[/label]

				[/column]

			[/row]
			
			[row]
				grow_factor = 1

				[column]
					grow_factor = 1

					horizontal_grow = "true"

					[grid]

						[row]
							grow_factor = 1

							[column]
								grow_factor = 0

								border = "all"
								border_size = 5
								horizontal_alignment = "left"

								[label]
									definition = "default"

									label = _ "Server:"
								[/label]

							[/column]

							[column]
								grow_factor = 1

								border = "all"
								border_size = 5
								horizontal_grow = "true"

								[text_box]
									id = "host_name"
									definition = "default"
									history = "addon_connect_history"

									size_text = "very long text which might need to fit"
									label = ""
								[/text_box]

							[/column]

						[/row]

					[/grid]

				[/column]

			[/row]

			[row]
				grow_factor = 0

				[column]
					grow_factor = 1
					horizontal_grow = "true" 

					[grid]

						[row]
							grow_factor = 0

							[column]
								border = "all"
								border_size = 5
								horizontal_alignment = "left"

								[button]
									# just show how the default looks.
									definition = "default"

#									tooltip = "Update locally installed addons."

									size_text = _ "Update add-ons"
									label = _ "Update add-ons"

									# we define the return value manually instead of being
									# linked to the id. Not sure whether that's the best
									# solution, but it's nice as proof-of-concept.
									return_value = 3
								[/button]

							[/column]

							[column]
								grow_factor = 1

								[spacer]
									definition = "default"
								[/spacer]

							[/column]

							[column]
								border = "all"
								border_size = 5
								horizontal_alignment = "right"

								[button]
									# just show how the default looks.
									definition = "default"

#									tooltip = "Manage locally installed addons."

									help = "With this feature you can remove locally installed addons, after doing so you need to restart Wesnoth."

									size_text = _ "Remove Add-ons"
									label = _ "Remove Add-ons"

									# we define the return value manually instead of being
									# linked to the id. Not sure whether that's the best
									# solution, but it's nice as proof-of-concept.
									return_value = 2
								[/button]

							[/column]

						[/row]

						[row]
							grow_factor = 0
							
							[column]

								[spacer]
									definition = "default"
								[/spacer]

							[/column]

							[column]
								border = "all"
								border_size = 5
								horizontal_alignment = "right"

								[button]
									id = "ok"
									definition = "default"

									size_text = _ "Connect"
									label = _ "Connect"
								[/button]

							[/column]

							[column]
								border = "all"
								border_size = 5
								horizontal_alignment = "right"

								[button]
									id = "cancel"
									definition = "default"

									label = _ "Cancel"
								[/button]

							[/column]

						[/row]

					[/grid]

				[/column]

			[/row]

		[/grid]

	[/resolution]

[/window]
