mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Allow edited action to keep its name when editing it (fixes: #1), made dialogs respond to enter and escape, Confirm dialog now shows dark red color for dangerous operations and prevents enter for accepting it
This commit is contained in:
@@ -48,21 +48,25 @@ module TAC
|
||||
end
|
||||
|
||||
button @options[:variable] ? "Update" : "Add", width: 0.475 do |b|
|
||||
if valid?
|
||||
value = @type == :boolean ? @value_boolean.value.to_s : @value.value.strip
|
||||
|
||||
if @options[:variable]
|
||||
@options[:callback_method].call(@options[:variable], @name.value.strip, @type, value)
|
||||
else
|
||||
@options[:callback_method].call(@name.value.strip, @type, value)
|
||||
end
|
||||
|
||||
close
|
||||
end
|
||||
try_commit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def try_commit
|
||||
if valid?
|
||||
value = @type == :boolean ? @value_boolean.value.to_s : @value.value.strip
|
||||
|
||||
if @options[:variable]
|
||||
@options[:callback_method].call(@options[:variable], @name.value.strip, @type, value)
|
||||
else
|
||||
@options[:callback_method].call(@name.value.strip, @type, value)
|
||||
end
|
||||
|
||||
close
|
||||
end
|
||||
end
|
||||
|
||||
def valid?
|
||||
valid = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user