summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/editor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/editor.rb')
-rw-r--r--ext/json/lib/json/editor.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/ext/json/lib/json/editor.rb b/ext/json/lib/json/editor.rb
index 9e05f44b5b7..1e13f33c8cd 100644
--- a/ext/json/lib/json/editor.rb
+++ b/ext/json/lib/json/editor.rb
@@ -48,14 +48,14 @@ module JSON
# Opens an error dialog on top of _window_ showing the error message
# _text_.
def Editor.error_dialog(window, text)
- dialog = MessageDialog.new(window, Dialog::MODAL,
- MessageDialog::ERROR,
+ dialog = MessageDialog.new(window, Dialog::MODAL,
+ MessageDialog::ERROR,
MessageDialog::BUTTONS_CLOSE, text)
dialog.show_all
dialog.run
rescue TypeError
- dialog = MessageDialog.new(Editor.window, Dialog::MODAL,
- MessageDialog::ERROR,
+ dialog = MessageDialog.new(Editor.window, Dialog::MODAL,
+ MessageDialog::ERROR,
MessageDialog::BUTTONS_CLOSE, text)
dialog.show_all
dialog.run
@@ -67,8 +67,8 @@ module JSON
# message _text_. If yes was answered _true_ is returned, otherwise
# _false_.
def Editor.question_dialog(window, text)
- dialog = MessageDialog.new(window, Dialog::MODAL,
- MessageDialog::QUESTION,
+ dialog = MessageDialog.new(window, Dialog::MODAL,
+ MessageDialog::QUESTION,
MessageDialog::BUTTONS_YES_NO, text)
dialog.show_all
dialog.run do |response|
@@ -465,7 +465,7 @@ module JSON
add_separator
add_item("Append new node", ?a, &method(:append_new_node))
add_item("Insert new node before", ?i, &method(:insert_new_node))
- add_separator
+ add_separator
add_item("Collapse/Expand node (recursively)", ?e,
&method(:collapse_expand))
@@ -504,7 +504,7 @@ module JSON
# Revert the current JSON document in the editor to the saved version.
def revert(item)
window.instance_eval do
- @filename and file_open(@filename)
+ @filename and file_open(@filename)
end
end
@@ -666,7 +666,7 @@ module JSON
collapse_all
else
self.expanded = true
- expand_all
+ expand_all
end
end
@@ -885,7 +885,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
@key = key_input.text
type = ALL_TYPES[@type = type_input.active]
@@ -937,7 +937,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
type = types[type_input.active]
@content = case type
@@ -982,7 +982,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
return @order = order_input.text, reverse_checkbox.active?
end
@@ -1017,7 +1017,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
self.focus = dialog
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
begin
return Regexp.new(regex_input.text, icase_checkbox.active? ? Regexp::IGNORECASE : 0)
@@ -1216,7 +1216,7 @@ module JSON
end
end
- # Save the current file as the filename
+ # Save the current file as the filename
def file_save_as
filename = select_file('Save as a JSON file')
store_file(filename)
@@ -1242,7 +1242,7 @@ module JSON
rescue SystemCallError => e
Editor.error_dialog(self, "Failed to store JSON file: #{e}!")
end
-
+
# Load the file named _filename_ into the editor as a JSON document.
def load_file(filename)
if filename
@@ -1335,7 +1335,7 @@ module JSON
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
- dialog.run do |response|
+ dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
return @location = location_input.text
end