// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Procedure Name: // nodePresetConfirmDeleteDialog // // jdc (September 13, 2000) // cdt (March 2005) // // Description: // This procedure is called when the user has asked to delete a // preset. A dialog is displayed prompting the user to confirm that // they want to delete the settings. If the user chooses "Yes", the // preset is deleted. If the user chooses "No", this dialog closes // and the preset is not deleted. // // Input Arguments: // $argv - a variable list of node names followed by the preset name. // // Return Value: // None // global proc nodePresetConfirmDeleteDialog( string $argv[] ) { string $presetName = $argv[size($argv)-1]; string $message = (uiRes("m_nodePresetConfirmDeleteDialog.kDeletePresetMsg")); string $dispMsg = `format -s $presetName $message`; string $delete = (uiRes("m_nodePresetConfirmDeleteDialog.kDelete")); string $cancel = (uiRes("m_nodePresetConfirmDeleteDialog.kCancel")); $confirmResponse = `confirmDialog -title (uiRes("m_nodePresetConfirmDeleteDialog.kDeletePreset")) -button $delete -button $cancel -cancelButton $cancel -defaultButton $delete -message $dispMsg`; int $isOverwritten = false; if ($delete == $confirmResponse) { int $i; for ($i = 0; $i < size($argv)-1; $i++) { if (`nodePreset -exists $argv[$i] $presetName`) { evalEcho(("nodePreset -delete " + $argv[$i] + " " + $presetName)); } } } }