#textdomain wesnoth-lib

#define _GUI_ADDON_TYPE_OPTION ID LABEL
	[column]
		grow_factor = 1
		border = "all"
		border_size = 5
		horizontal_alignment = "left"

		[toggle_button]
			id = "show_"+{ID}
			definition = "default"
			label = {LABEL}
		[/toggle_button]
	[/column]
#enddef

#define _GUI_ADDON_SORT_OPTION ID LABEL
	[column]
		grow_factor = 1
		border = "all"
		border_size = 5
		horizontal_alignment = "left"

		[toggle_button]
			id = "sort_"+{ID}
			definition = "radio"
			label = {LABEL}
		[/toggle_button]
	[/column]
#enddef

#define _GUI_SPACER
	[column]
		grow_factor = 1
		border = "all"
		border_size = 5
		horizontal_alignment = "left"

		[spacer]
		[/spacer]
	[/column]
#enddef

#define _GUI_ADDON_TYPE_OPTIONS
	[grid]

		[row]
			{_GUI_ADDON_TYPE_OPTION sp_campaigns _"addons_of_type^Campaigns"}
			{_GUI_ADDON_TYPE_OPTION mp_eras _"addons_of_type^MP eras"}
		[/row]
		[row]
			{_GUI_ADDON_TYPE_OPTION sp_scenarios _"addons_of_type^Scenarios"}
			{_GUI_ADDON_TYPE_OPTION mp_factions _"addons_of_type^MP factions"}
		[/row]
		[row]
			{_GUI_ADDON_TYPE_OPTION sp_mp_campaigns _"addons_of_type^SP/MP campaigns"}
			{_GUI_ADDON_TYPE_OPTION mp_campaigns _"addons_of_type^MP campaigns"}
		[/row]
		[row]
			{_GUI_ADDON_TYPE_OPTION media _"addons_of_type^Resources"}
			{_GUI_ADDON_TYPE_OPTION mp_scenarios _"addons_of_type^MP scenarios"}
		[/row]
		[row]
			# FIXME: (also in C++) should this and Unknown be a single option in the UI?
			{_GUI_ADDON_TYPE_OPTION other _"addons_of_type^Other"}
			{_GUI_ADDON_TYPE_OPTION mp_maps _"addons_of_type^MP map-packs"}
		[/row]
		[row]
			{_GUI_ADDON_TYPE_OPTION unknown _"addons_of_type^Unknown"}
			{_GUI_ADDON_TYPE_OPTION mp_mods _"addons_of_type^MP modifications"}
		[/row]

	[/grid]
#enddef

#define _GUI_ADDON_STATUS_OPTIONS
	border = "all"
	border_size = 5

	horizontal_grow = "true"
	vertical_grow = "true"

	[listbox]
		id = "statuses_list"
		definition = "default"

		[list_definition]

			[row]

				[column]
					horizontal_grow = "true"
					vertical_grow = "true"

					[toggle_panel]
						definition = "default"
						return_value_id = "ok"

						[grid]

							[row]

								[column]
									horizontal_grow = "true"
									vertical_grow = "true"
									border = "all"
									border_size = 5

									[label]
										id = "status"
										linked_group = "status"
										definition = "default"
									[/label]

								[/column]

							[/row]

						[/grid]

					[/toggle_panel]

				[/column]

			[/row]

		[/list_definition]

	[/listbox]
#enddef

[window]
	id = "addon_filter_options"
	description = "Advanced filtering options for the legacy (GUI1) Add-ons Manager dialog."

	[resolution]
		definition = "default"

		#click_dismiss = "true"
		maximum_width = 800

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

		[linked_group]
			id = "status"
			fixed_width = "true"
		[/linked_group]

		[tooltip]
			id = "tooltip_large"
		[/tooltip]

		[helptip]
			id = "tooltip_large"
		[/helptip]

		[grid]

			[row]

				[column]
					border = "all"
					border_size = 5
					horizontal_alignment = "left"
					[label]
						definition = "title"
						label = _ "Options"
					[/label]
				[/column]

			[/row]

			[row]

				[column]
					border = "all"
					border_size = 5
					horizontal_alignment = "left"
					[label]
						definition = "default"
						label = _ "Add-ons matching the following criteria will be displayed."
						wrap = "true"
					[/label]
				[/column]

			[/row]

			[row]

				[column]

					horizontal_grow = "true"
					vertical_grow = "true"

					border = "top"
					border_size = 5

					[grid]

						[row]

							[column]

								horizontal_grow = "true"
								vertical_alignment = "top"

								[grid]

									[row]

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

											[label]
												definition = "default"
												label = _ "Installation status:"
											[/label]

										[/column]

									[/row]

									[row]

										[column]
											{_GUI_ADDON_STATUS_OPTIONS}
										[/column]

									[/row]

								[/grid]

							[/column]

							[column]

								horizontal_grow = "true"

								[grid]

									[row]

										[column]

											horizontal_grow = "true"

											[grid]

												[row]

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

														[label]
															definition = "default"
															label = _ "Add-on types:"
														[/label]

													[/column]

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

														[button]
															id = "toggle_all_displayed_types"
															definition = "default"
															label = _ "Toggle All"
														[/button]

													[/column]

												[/row]

											[/grid]

										[/column]

									[/row]

									[row]

										[column]
											horizontal_alignment = "left"
											{_GUI_ADDON_TYPE_OPTIONS}
										[/column]

									[/row]

								[/grid]

							[/column]

						[/row]

					[/grid]

				[/column]

			[/row]

			[row]
				grow_factor = 0

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

					[label]
						definition = "default"
						label = _ "Add-ons will be sorted as follows when no column is selected:"
						wrap = "true"
					[/label]
				[/column]

			[/row]

			[row]
				grow_factor = 0

				[column]
					horizontal_grow = "true"
					vertical_grow = "true"

					border = "top"
					border_size = 5

					[grid]

						[row]

							[column]

								horizontal_alignment = "left"
								vertical_alignment = "top"

								[grid]

									[row]
										grow_factor = 0
										{_GUI_ADDON_SORT_OPTION by_name ( _ "sort^By name")}
									[/row]

									[row]
										grow_factor = 0
										{_GUI_ADDON_SORT_OPTION by_last_updated ( _ "sort^By last updated")}
									[/row]

									[row]
										grow_factor = 0
										{_GUI_ADDON_SORT_OPTION by_first_upload ( _ "sort^By first upload")}
									[/row]

								[/grid]

							[/column]

							[column]

								horizontal_alignment = "left"
								vertical_alignment = "top"

								[grid]

									[row]
										grow_factor = 0
										{_GUI_ADDON_SORT_OPTION ascending ( _ "sort^Ascending")}
									[/row]

									[row]
										grow_factor = 0
										{_GUI_ADDON_SORT_OPTION descending ( _ "sort^Descending")}
									[/row]

								[/grid]

							[/column]

						[/row]

					[/grid]

				[/column]

			[/row]

			[row]
				grow_factor = 0

				[column]
					horizontal_alignment = "right"

					[grid]

						[row]
							grow_factor = 0

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

								[button]
									id = "ok"
									definition = "default"
									label = _ "Close"
								[/button]

							[/column]

						[/row]

					[/grid]

				[/column]

			[/row]

		[/grid]

	[/resolution]

[/window]

#undef _GUI_ADDON_STATUS_OPTIONS
#undef _GUI_ADDON_TYPE_OPTIONS
#undef _GUI_ADDON_TYPE_OPTION
#undef _GUI_ADDON_SORT_OPTION
#undef _GUI_SPACER
