gIndentWidth = 1 * max_char_width();
gPopupWidth = min(13 * max_char_width(), 170);
gWarningTextWidth = zstring_width(zstring: '$$$/Dialogs/DigSigSigVerPrefs/WindowsRevoke');
gLTVTextWidth = zstring_width(zstring: '$$$/Dialogs/DigSigSigVerPrefs/AskAutoEmbedLTV') + 5 * max_char_width();

dialog(name: '$$$/Dialogs/DigSigSigVerPrefs/DialogTitle')
{
	view(alignment: align_fill, align_children: align_left)
	{
		check_box(name: '$$$/Dialogs/DigSigSigVerPrefs/ValidateOnOpen', item_id: 'vdoo', alignment: align_left );
		check_box(name: '$$$/Dialogs/DigSigSigVerPrefs/NotifyValidButUntrusted', item_id: 'vbut', alignment: align_left );
		cluster(name: '$$$/Dialogs/DigSigSigVerPrefs/VerificationBehavior', alignment: align_fill, align_children: align_left, margin_height: 10)
		{
			static_text(name: '$$$/Dialogs/DigSigSigVerPrefs/AltHandlerTitle');
			view(align_children: align_top, alignment: align_fill)
			{
				gap( width: gIndentWidth );
				view(align_children: align_left)
				{
					radio(item_id: 'ahr0', group_id: 'rgrp', name: '$$$/Dialogs/DigSigSigVerPrefs/AltHandlerRadio0');
					radio(item_id: 'ahr1', group_id: 'rgrp', name: '$$$/Dialogs/DigSigSigVerPrefs/AltHandlerRadio1');
					view (align_children: align_row)
					{
						radio(item_id: 'ahr2', group_id: 'rgrp', name: '$$$/Dialogs/DigSigSigVerPrefs/AltHandlerRadio2');
						popup(item_id: 'smpu', width: gPopupWidth);
					}
				}
			}
			check_box(item_id:'rccs', name: '$$$/Dialogs/DigSigSigVerPrefs/WindowsRevoke');
			check_box(item_id:'uext', name: '$$$/Dialogs/DigSigSigVerPrefs/UseExpiredTimestamps');
			check_box(item_id:'idvi', name: '$$$/Dialogs/DigSigSigVerPrefs/IgnoreValidationInfo');
		}

		view (align_children: align_top)
		{
		    cluster(name: '$$$/Dialogs/DigSigSigVerPrefs/VerifyTime', alignment: align_column, align_children: align_left, margin_height: 10)
			{
				static_text(name: '$$$/Dialogs/DigSigSigVerPrefs/VerifyTimeUsing', item_id:'t104'); 
				view(align_children: align_top, alignment: align_fill)
				{
					gap( width: gIndentWidth );
					view( align_children: align_left)
					{
						radio(item_id:'sign', group_id: 'time', name: '$$$/Dialogs/DigSigSigVerPrefs/UseSigningTime');
						radio(item_id:'secr', group_id: 'time', name: '$$$/Dialogs/DigSigSigVerPrefs/UseSigningTimeIfSecure', height: gStaticTextHeight * 2);
        				radio(item_id:'curr', group_id: 'time', name: '$$$/Dialogs/DigSigSigVerPrefs/UseCurrentTime');
					}
				}
			}
            cluster(name: '$$$/Dialogs/DigSigSigVerPrefs/LTV', item_id:'t202', align_children: align_left, alignment: align_column, margin_height: 10 )
			{
                static_text(name: '$$$/Dialogs/DigSigSigVerPrefs/AutoEmbedLTV', item_id:'aelh', width: gLTVTextWidth, wrap_name: true);
				view(align_children: align_top, alignment: align_fill)
				{
					gap( width: gIndentWidth );
					view( align_children: align_left)
					{
    					radio(item_id:'askb', group_id: 'altv', name: '$$$/Dialogs/DigSigSigVerPrefs/AskAutoEmbedLTV');
						radio(item_id:'alws', group_id: 'altv', name: '$$$/Dialogs/DigSigSigVerPrefs/AlwayAutoEmbedLTV');
						radio(item_id:'nver', group_id: 'altv', name: '$$$/Dialogs/DigSigSigVerPrefs/NeverAutoEmbedLTV');
					}
				}
			}
		}

		cluster(name: '$$$/Dialogs/DigSigSigVerPrefs/WindowsIntegration', item_id: 'wigr', alignment: align_fill, align_children: align_left, margin_height: 10)
		{
			static_text(name: '$$$/Dialogs/DigSigSigVerPrefs/WindowsTrustAll');
			view(align_children: align_row, alignment: align_fill)
			{
				gap( width: gIndentWidth );
				view( align_children: align_left)
				{
					check_box(item_id: 'wsig', name: '$$$/Dialogs/DigSigSigVerPrefs/WindowsValidateSignatures');
					check_box(item_id: 'wdoc', name: '$$$/Dialogs/DigSigSigVerPrefs/WindowsValidateDocs');
					static_text(name: '$$$/Dialogs/DigSigSigVerPrefs/WindowsTrustWarning', width: gWarningTextWidth, wrap_name: true, height: gStaticTextHeight * 2);
				}
			}
		}

		ok_cancel_help();
	}
}
