mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Tweaks to simulator robot, made start up animation skippable, made NamePromptDialog able to detect duplicate names, enabled cloning of groups and actions
This commit is contained in:
@@ -7,15 +7,24 @@ module TAC
|
||||
label "Name", width: 0.25, text_size: 18
|
||||
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", width: 0.70, text_size: 18
|
||||
end
|
||||
@name_error = label "", text_size: 18, color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@name_error.hide
|
||||
|
||||
flow width: 1.0 do
|
||||
button "Cancel", width: 0.475, text_size: 18 do
|
||||
close
|
||||
end
|
||||
|
||||
button @options[:renaming] ? "Update" : "Add", width: 0.475, text_size: 18 do
|
||||
accept_label = @options[:renaming] ? "Update" : "Add"
|
||||
accept_label = @options[:accept_label] if @options[:accept_label]
|
||||
|
||||
button accept_label, width: 0.475, text_size: 18 do
|
||||
if @name.value.strip.empty?
|
||||
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Name cannot be blank.\nName cannot only be whitespace.")
|
||||
@name_error.value = "Name cannot be blank.\nName cannot only be whitespace."
|
||||
@name_error.show
|
||||
elsif @options[:list] && @options[:list].find { |i| i.name == @name.value.strip }
|
||||
@name_error.value = "Name is not unique!"
|
||||
@name_error.show
|
||||
else
|
||||
if @options[:renaming]
|
||||
@options[:callback_method].call(@options[:renaming], @name.value.strip)
|
||||
|
||||
Reference in New Issue
Block a user