ruber 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/COPYING +339 -0
  2. data/INSTALL +137 -0
  3. data/LICENSE +8 -0
  4. data/bin/ruber +65 -0
  5. data/data/share/apps/ruber/core_components.yaml +31 -0
  6. data/data/share/apps/ruber/ruberui.rc +109 -0
  7. data/data/share/icons/ruber.png +0 -0
  8. data/data/share/pixmaps/ruby.png +0 -0
  9. data/icons/ruber-16.png +0 -0
  10. data/icons/ruber-32.png +0 -0
  11. data/icons/ruber-48.png +0 -0
  12. data/icons/ruber-8.png +0 -0
  13. data/lib/ruber/application/application.rb +288 -0
  14. data/lib/ruber/application/plugin.yaml +11 -0
  15. data/lib/ruber/component_manager.rb +899 -0
  16. data/lib/ruber/config/config.rb +82 -0
  17. data/lib/ruber/config/plugin.yaml +3 -0
  18. data/lib/ruber/document_project.rb +209 -0
  19. data/lib/ruber/documents/document_list.rb +416 -0
  20. data/lib/ruber/documents/plugin.yaml +4 -0
  21. data/lib/ruber/editor/document.rb +506 -0
  22. data/lib/ruber/editor/editor_view.rb +167 -0
  23. data/lib/ruber/editor/ktexteditor_wrapper.rb +202 -0
  24. data/lib/ruber/exception_widgets.rb +245 -0
  25. data/lib/ruber/external_program_plugin.rb +397 -0
  26. data/lib/ruber/filtered_output_widget.rb +342 -0
  27. data/lib/ruber/gui_states_handler.rb +231 -0
  28. data/lib/ruber/kde_config_option_backend.rb +167 -0
  29. data/lib/ruber/kde_sugar.rb +249 -0
  30. data/lib/ruber/main_window/choose_plugins_dlg.rb +353 -0
  31. data/lib/ruber/main_window/main_window.rb +524 -0
  32. data/lib/ruber/main_window/main_window_actions.rb +537 -0
  33. data/lib/ruber/main_window/main_window_internal.rb +239 -0
  34. data/lib/ruber/main_window/open_file_in_project_dlg.rb +212 -0
  35. data/lib/ruber/main_window/output_color_widget.rb +35 -0
  36. data/lib/ruber/main_window/plugin.yaml +58 -0
  37. data/lib/ruber/main_window/save_modified_files_dlg.rb +89 -0
  38. data/lib/ruber/main_window/status_bar.rb +156 -0
  39. data/lib/ruber/main_window/ui/choose_plugins_widget.rb +90 -0
  40. data/lib/ruber/main_window/ui/choose_plugins_widget.ui +77 -0
  41. data/lib/ruber/main_window/ui/main_window_settings_widget.rb +108 -0
  42. data/lib/ruber/main_window/ui/main_window_settings_widget.ui +89 -0
  43. data/lib/ruber/main_window/ui/new_project_widget.rb +119 -0
  44. data/lib/ruber/main_window/ui/new_project_widget.ui +178 -0
  45. data/lib/ruber/main_window/ui/open_file_in_project_dlg.rb +109 -0
  46. data/lib/ruber/main_window/ui/open_file_in_project_dlg.ui +168 -0
  47. data/lib/ruber/main_window/ui/output_color_widget.rb +241 -0
  48. data/lib/ruber/main_window/ui/output_color_widget.ui +204 -0
  49. data/lib/ruber/main_window/workspace.rb +442 -0
  50. data/lib/ruber/output_widget.rb +1093 -0
  51. data/lib/ruber/plugin.rb +264 -0
  52. data/lib/ruber/plugin_like.rb +589 -0
  53. data/lib/ruber/plugin_specification.rb +106 -0
  54. data/lib/ruber/plugin_specification_reader.rb +451 -0
  55. data/lib/ruber/project.rb +493 -0
  56. data/lib/ruber/project_backend.rb +105 -0
  57. data/lib/ruber/projects/plugin.yaml +11 -0
  58. data/lib/ruber/projects/project_files_list.rb +314 -0
  59. data/lib/ruber/projects/project_files_widget.rb +301 -0
  60. data/lib/ruber/projects/project_list.rb +314 -0
  61. data/lib/ruber/projects/ui/project_files_rule_chooser_widget.rb +74 -0
  62. data/lib/ruber/projects/ui/project_files_rule_chooser_widget.ui +61 -0
  63. data/lib/ruber/projects/ui/project_files_widget.rb +117 -0
  64. data/lib/ruber/projects/ui/project_files_widget.ui +123 -0
  65. data/lib/ruber/qt_sugar.rb +673 -0
  66. data/lib/ruber/settings_container.rb +515 -0
  67. data/lib/ruber/settings_dialog.rb +244 -0
  68. data/lib/ruber/settings_dialog_manager.rb +503 -0
  69. data/lib/ruber/utils.rb +414 -0
  70. data/lib/ruber/yaml_option_backend.rb +159 -0
  71. data/outsider_files +15 -0
  72. data/plugins/autosave/autosave.rb +404 -0
  73. data/plugins/autosave/plugin.yaml +16 -0
  74. data/plugins/autosave/ui/autosave_config_widget.rb +83 -0
  75. data/plugins/autosave/ui/autosave_config_widget.ui +68 -0
  76. data/plugins/command/command.png +0 -0
  77. data/plugins/command/command.rb +74 -0
  78. data/plugins/command/plugin.yaml +11 -0
  79. data/plugins/find_in_files/find_in_files.rb +337 -0
  80. data/plugins/find_in_files/find_in_files_dlg.rb +411 -0
  81. data/plugins/find_in_files/find_in_files_ui.rc +11 -0
  82. data/plugins/find_in_files/find_in_files_widgets.rb +485 -0
  83. data/plugins/find_in_files/plugin.yaml +23 -0
  84. data/plugins/find_in_files/ui/config_widget.rb +58 -0
  85. data/plugins/find_in_files/ui/config_widget.ui +41 -0
  86. data/plugins/find_in_files/ui/find_in_files_widget.rb +260 -0
  87. data/plugins/find_in_files/ui/find_in_files_widget.ui +324 -0
  88. data/plugins/project_browser/plugin.yaml +10 -0
  89. data/plugins/project_browser/project_browser.rb +245 -0
  90. data/plugins/rake/plugin.yaml +39 -0
  91. data/plugins/rake/rake.png +0 -0
  92. data/plugins/rake/rake.rb +567 -0
  93. data/plugins/rake/rake_extension.rb +153 -0
  94. data/plugins/rake/rake_widgets.rb +615 -0
  95. data/plugins/rake/rakeui.rc +27 -0
  96. data/plugins/rake/ui/add_quick_task_widget.rb +71 -0
  97. data/plugins/rake/ui/add_quick_task_widget.ui +59 -0
  98. data/plugins/rake/ui/choose_task_widget.rb +77 -0
  99. data/plugins/rake/ui/choose_task_widget.ui +72 -0
  100. data/plugins/rake/ui/config_widget.rb +127 -0
  101. data/plugins/rake/ui/config_widget.ui +123 -0
  102. data/plugins/rake/ui/project_widget.rb +217 -0
  103. data/plugins/rake/ui/project_widget.ui +246 -0
  104. data/plugins/rspec/plugin.yaml +30 -0
  105. data/plugins/rspec/rspec.png +0 -0
  106. data/plugins/rspec/rspec.rb +945 -0
  107. data/plugins/rspec/rspec.svg +90 -0
  108. data/plugins/rspec/rspecui.rc +20 -0
  109. data/plugins/rspec/ruber_rspec_formatter.rb +312 -0
  110. data/plugins/rspec/ui/rspec_project_widget.rb +170 -0
  111. data/plugins/rspec/ui/rspec_project_widget.ui +193 -0
  112. data/plugins/ruby_development/plugin.yaml +27 -0
  113. data/plugins/ruby_development/ruby_development.png +0 -0
  114. data/plugins/ruby_development/ruby_development.rb +453 -0
  115. data/plugins/ruby_development/ruby_developmentui.rc +19 -0
  116. data/plugins/ruby_development/ui/project_widget.rb +112 -0
  117. data/plugins/ruby_development/ui/project_widget.ui +108 -0
  118. data/plugins/ruby_runner/config_widget.rb +116 -0
  119. data/plugins/ruby_runner/plugin.yaml +26 -0
  120. data/plugins/ruby_runner/project_widget.rb +62 -0
  121. data/plugins/ruby_runner/ruby.png +0 -0
  122. data/plugins/ruby_runner/ruby_interpretersui.rc +26 -0
  123. data/plugins/ruby_runner/ruby_runner.rb +411 -0
  124. data/plugins/ruby_runner/ui/config_widget.rb +92 -0
  125. data/plugins/ruby_runner/ui/config_widget.ui +91 -0
  126. data/plugins/ruby_runner/ui/project_widget.rb +60 -0
  127. data/plugins/ruby_runner/ui/project_widget.ui +48 -0
  128. data/plugins/ruby_runner/ui/ruby_runnner_plugin_option_widget.rb +59 -0
  129. data/plugins/ruby_runner/ui/ruby_runnner_plugin_option_widget.ui +44 -0
  130. data/plugins/state/plugin.yaml +28 -0
  131. data/plugins/state/state.rb +520 -0
  132. data/plugins/state/ui/config_widget.rb +92 -0
  133. data/plugins/state/ui/config_widget.ui +89 -0
  134. data/plugins/syntax_checker/plugin.yaml +18 -0
  135. data/plugins/syntax_checker/syntax_checker.rb +662 -0
  136. data/ruber.desktop +10 -0
  137. data/spec/annotation_model_spec.rb +174 -0
  138. data/spec/common.rb +119 -0
  139. data/spec/component_manager_spec.rb +1259 -0
  140. data/spec/document_list_spec.rb +626 -0
  141. data/spec/document_project_spec.rb +373 -0
  142. data/spec/document_spec.rb +779 -0
  143. data/spec/editor_view_spec.rb +167 -0
  144. data/spec/external_program_plugin_spec.rb +676 -0
  145. data/spec/filtered_output_widget_spec.rb +642 -0
  146. data/spec/gui_states_handler_spec.rb +304 -0
  147. data/spec/kde_config_option_backend_spec.rb +214 -0
  148. data/spec/kde_sugar_spec.rb +101 -0
  149. data/spec/ktexteditor_wrapper_spec.rb +305 -0
  150. data/spec/output_widget_spec.rb +1703 -0
  151. data/spec/plugin_spec.rb +1393 -0
  152. data/spec/plugin_specification_reader_spec.rb +1765 -0
  153. data/spec/plugin_specification_spec.rb +401 -0
  154. data/spec/project_backend_spec.rb +172 -0
  155. data/spec/project_files_list_spec.rb +401 -0
  156. data/spec/project_list_spec.rb +511 -0
  157. data/spec/project_spec.rb +990 -0
  158. data/spec/qt_sugar_spec.rb +328 -0
  159. data/spec/settings_container_spec.rb +617 -0
  160. data/spec/settings_dialog_manager_spec.rb +773 -0
  161. data/spec/settings_dialog_spec.rb +419 -0
  162. data/spec/state_spec.rb +991 -0
  163. data/spec/utils_spec.rb +406 -0
  164. data/spec/workspace_spec.rb +869 -0
  165. data/spec/yaml_option_backend_spec.rb +246 -0
  166. metadata +284 -0
@@ -0,0 +1,35 @@
1
+ =begin
2
+ Copyright (C) 2010 by Stefano Crocco
3
+ stefano.crocco@alice.it
4
+
5
+ This program is free software; you can redistribute it andor modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the
17
+ Free Software Foundation, Inc.,
18
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ =end
20
+
21
+ require_relative 'ui/output_color_widget'
22
+
23
+ module Ruber
24
+
25
+ class OutputColorWidget < Qt::Widget
26
+
27
+ def initialize parent = nil
28
+ super
29
+ @ui = Ui::OutputColorWidget.new
30
+ @ui.setup_ui self
31
+ end
32
+
33
+ end
34
+
35
+ end
@@ -0,0 +1,58 @@
1
+ name: main_window
2
+ require: [main_window, output_color_widget]
3
+ class: Ruber::MainWindow
4
+ config_options:
5
+ general:
6
+ default_script_directory: {type: path, default: 'KDE::GlobalSettings.document_path'}
7
+ default_project_directory: {type: path, default: 'KDE::GlobalSettings.document_path'}
8
+ output_font: {default: 'Qt::Font.new("Courier",10)'}
9
+ auto_annotations: {type: bool, default: 'true'}
10
+ wrap_output: {type: bool, default: 'true'}
11
+ output_colors:
12
+ message: {default: 'Qt::Color.new(Qt.black)'}
13
+ message_good: {default: 'Qt::Color.new(Qt.blue)'}
14
+ message_bad: {default: 'Qt::Color.new(Qt.dark_magenta)'}
15
+ error: {default: 'Qt::Color.new(Qt.red)'}
16
+ error1: {default: 'Qt::Color.new(Qt.dark_red)'}
17
+ error2: {default: 'Qt::Color.new(Qt.magenta)'}
18
+ output: {default: 'Qt::Color.new(Qt.dark_green)'}
19
+ output1: {default: 'Qt::Color.new(Qt.dark_cyan)'}
20
+ output2: {default: 'Qt::Color.new(Qt.dark_yellow)'}
21
+ warning: {default: 'Qt::Color.new(Qt.gray)'}
22
+ warning1: {default: 'Qt::Color.new(Qt.dark_gray)'}
23
+ warning2: {default: 'Qt::Color.new(Qt.light_gray)'}
24
+ main_window:
25
+ widget_size: {key: Central widget size, default: "Qt::Size.new"}
26
+ window_size: {key: Size, default: 'Qt::Size.new(400,500)'}
27
+ h_splitter: {key: Horizontal splitter, type: string list, default: "['20', '60', '20']"}
28
+ v_splitter: {key: Vertical splitter, type: string list, default: "['80', '20']"}
29
+ workspace:
30
+ tools_sizes: {default: {}}
31
+ config_widgets:
32
+ - {caption: General, pixmap: configure, class: Ruber::MainWindowSettingsWidget}
33
+ - {caption: Colors, pixmap: fill-color, class: Ruber::OutputColorWidget}
34
+ actions:
35
+ file_new: {standard_action: open_new, slot: new_file()}
36
+ file_open: {standard_action: open, slot: open_file()}
37
+ file_open_recent: {standard_action: open_recent, signal: urlSelected(KUrl), slot: open_recent_file(KUrl)}
38
+ file-save_all: {text: Save &All, icon: document-save-all, slot: save_all()}
39
+ file_close: {standard_action: close, slot: close_current_editor()}
40
+ file-close_all: {text: Clos&e All, slot: close_all_views()}
41
+ file-close_other: {text: Close All O&ther, slot: close_other_views()}
42
+ file_quit: {standard_action: quit, receiver: 'Ruber[:app]', slot: closeAllWindows()}
43
+ go_back: {standard_action: back, slot: previous_document(), shortcut: Alt+Left}
44
+ go_forward: {standard_action: forward, slot: next_document(), shortcut: Alt+Right}
45
+ view-activate_editor: {text: Activate &Editor, shortcut: F2, slot: focus_on_editor()}
46
+ view-toggle_left_tool_widget: {text: Toggle &Left Tool Widgets, slot: toggle_tool_widget()}
47
+ view-toggle_right_tool_widget: {text: Toggle &Right Tool Widgets, slot: toggle_tool_widget()}
48
+ view-toggle_bottom_tool_widget: {text: Toggle &Bottom Tool Widgets, slot: toggle_tool_widget()}
49
+ project-new: {text: '&New Project...', icon: document-new, slot: new_project()}
50
+ project-open: {text: '&Open Project...', icon: project-open, shortcut: Ctrl+Shift+O, slot: open_project()}
51
+ project-open_recent: {text: Open &Recent Project, icon: project-open, class: KDE::RecentFilesAction, signal: urlSelected(KUrl), slot: open_recent_project(KUrl)}
52
+ project-close: {text: '&Close Project', slot: close_current_project(), state: active_project_exists}
53
+ project-quick_open_file: {text: '&Quick Open File', icon: document-open, shortcut: Alt+Ctrl+O, slot: open_file_in_project(), state: active_project_exists}
54
+ project-configure: {text: Co&nfigure Project..., icon: configure, slot: configure_project(), state: active_project_exists}
55
+ options-choose_plugins: {text: C&hoose Plugins..., icon: preferences-plugin, slot: choose_plugins()}
56
+ options_configure: {standard_action: preferences, slot: preferences()}
57
+ configure_document: {text: Configure &Document, icon: configure, slot: configure_document(), state: current_document}
58
+ help_user_manual: {text: Ruber User &Manual, icon: help-contents, slot: show_user_manual()}
@@ -0,0 +1,89 @@
1
+ =begin
2
+ Copyright (C) 2010 by Stefano Crocco
3
+ stefano.crocco@alice.it
4
+
5
+ This program is free software; you can redistribute it andor modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the
17
+ Free Software Foundation, Inc.,
18
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ =end
20
+
21
+ module Ruber
22
+
23
+ class SaveModifiedFilesDlg < KDE::Dialog
24
+
25
+ attr_reader :save
26
+ def initialize docs, parent = nil
27
+ super parent
28
+ @save = true
29
+ @docs = docs
30
+ self.caption = "Save documents"
31
+ self.modal = true
32
+ create_buttons
33
+ self.main_widget = KDE::VBox.new self
34
+ Qt::Label.new KDE.i18n("The following documents have been modified. Do you want to save them before closing?"), main_widget
35
+ @document_list = Qt::TreeView.new main_widget
36
+ m = Qt::StandardItemModel.new @document_list
37
+ def m.flags idx
38
+ Qt::ItemIsSelectable|Qt::ItemIsEnabled|Qt::ItemIsUserCheckable
39
+ end
40
+ @document_list.model = m
41
+ @document_list.root_is_decorated = false
42
+ fill_list
43
+ end
44
+
45
+ def to_save
46
+ res = []
47
+ m = @document_list.model
48
+ @docs.each_with_index do |d, i|
49
+ res << d if m.item(i, 0).checked?
50
+ end
51
+ res
52
+ end
53
+
54
+ private
55
+
56
+ def create_buttons
57
+ self.buttons = Yes|No|Cancel
58
+
59
+ save = KDE::StandardGuiItem.save
60
+ save.text = KDE::i18n "&Save selected"
61
+ set_button_gui_item Yes, save
62
+ self.connect(SIGNAL('yesClicked()')) do
63
+ @save = true
64
+ done KDE::Dialog::Yes
65
+ end
66
+
67
+ set_button_gui_item No, KDE::StandardGuiItem.dont_save
68
+ self.connect(SIGNAL('noClicked()')) do
69
+ @save = false
70
+ done KDE::Dialog::No
71
+ end
72
+
73
+ cancel = KDE::StandardGuiItem.cancel
74
+ cancel.text = KDE::i18n "&Abort saving"
75
+ set_button_gui_item Cancel, cancel
76
+ end
77
+
78
+ def fill_list
79
+ @document_list.model.horizontal_header_labels = %w[Title Location]
80
+ @docs.each do | d |
81
+ row = [Qt::StandardItem.new(d.document_name), Qt::StandardItem.new(d.path)|| '']
82
+ row[0].checked = true
83
+ @document_list.model.append_row row
84
+ end
85
+ end
86
+
87
+ end
88
+
89
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ Copyright (C) 2010 by Stefano Crocco
3
+ stefano.crocco@alice.it
4
+
5
+ This program is free software; you can redistribute it andor modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the
17
+ Free Software Foundation, Inc.,
18
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ =end
20
+
21
+ module Ruber
22
+
23
+ =begin rdoc
24
+ The Ruber status bar
25
+ =end
26
+ class StatusBar < KDE::StatusBar
27
+
28
+ slots 'display_information(const QString &)', 'update_cursor_position(KTextEditor::Cursor)',
29
+ 'update_view_mode(const QString &)', 'update()', 'update_selection_mode(bool)',
30
+ 'update_state()'
31
+
32
+ =begin rdoc
33
+ Creates a new StatusBar. _parent_ is the status bar's parent widget
34
+ =end
35
+ def initialize parent
36
+ super parent
37
+ @view = nil
38
+ @cursor_position_label = Qt::Label.new(self){self.margin = 3}
39
+ @status_label = Qt::Label.new self
40
+ @mode_label = Qt::Label.new(self){self.margin = 3}
41
+ @selection_mode_label = Qt::Label.new(self){self.margin = 3}
42
+ # @cursor_position_label.margin = 3
43
+ # @status_label.margin = 3
44
+ # @mode_label.margin = 3
45
+ # @selection_mode_label.margin = 3
46
+ # @status_label.margin = 3
47
+ add_widget @cursor_position_label
48
+ add_widget @status_label
49
+ add_widget @mode_label
50
+ add_widget @selection_mode_label
51
+ update
52
+ end
53
+
54
+ =begin rdoc
55
+ Associates an editor view with the status bar. This means that the status bar will
56
+ display information about that view.
57
+
58
+ _v_ can be the view to associate with the status bar or *nil*. If it's *nil*, the
59
+ status bar won't show anything
60
+ =end
61
+ def view= v
62
+ return if @view == v
63
+ if @view
64
+ disconnect @view, nil, self, nil
65
+ disconnect @view.document, nil, self, nil
66
+ clear_widgets
67
+ end
68
+ @view = v
69
+ if v
70
+ connect @view, SIGNAL('information_message(QString, QWidget*)'), self, SLOT('display_information(const QString &)')
71
+ connect @view, SIGNAL('cursor_position_changed(KTextEditor::Cursor, QWidget*)'), self, SLOT('update_cursor_position(KTextEditor::Cursor)')
72
+ connect @view, SIGNAL('view_mode_changed(QString, QWidget*)'), self, SLOT('update_view_mode(const QString &)')
73
+ connect @view, SIGNAL('selection_mode_changed(bool, QWidget*)'), self, SLOT('update_selection_mode(bool)')
74
+ connect @view.document, SIGNAL('modified_changed(bool, QObject*)'), self, SLOT('update_state()')
75
+ connect @view.document, SIGNAL('modified_on_disk(QObject*, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)'), self, SLOT('update_state()')
76
+ update
77
+ end
78
+ end
79
+
80
+ =begin rdoc
81
+ Empties all the widgets in the status bar (it doesn't hide messages, though)
82
+ =end
83
+ def clear_widgets
84
+ @cursor_position_label.text = ''
85
+ @status_label.pixmap = Qt::Pixmap.new
86
+ @mode_label.text = ''
87
+ @selection_mode_label.text= ''
88
+ end
89
+
90
+ private
91
+
92
+ =begin rdoc
93
+ Update the various widget so they respect the view's status
94
+ =end
95
+ def update
96
+ if @view
97
+ pos = @view.cursor_position
98
+ update_cursor_position pos
99
+ update_view_mode @view.view_mode
100
+ update_selection_mode @view.block_selection?
101
+ else
102
+ update_cursor_position nil
103
+ update_view_mode nil
104
+ update_selection_mode nil
105
+ end
106
+ update_state
107
+ end
108
+
109
+ =begin rdoc
110
+ Displays the information emitted by the document associated with the view
111
+ =end
112
+ def display_information msg
113
+ show_message msg, 4000
114
+ end
115
+
116
+ =begin rdoc
117
+ Updates the cursor position
118
+ =end
119
+ def update_cursor_position pos
120
+ if pos
121
+ @cursor_position_label.text = "Line: #{pos.line+1} Col: #{pos.column+1}"
122
+ else @cursor_position_label.text = ''
123
+ end
124
+ end
125
+
126
+ =begin rdoc
127
+ Updates the view mode
128
+ =end
129
+ def update_view_mode mode
130
+ @mode_label.text = mode ? mode : ''
131
+ end
132
+
133
+ =begin rdoc
134
+ Updates the selection mode
135
+ =end
136
+ def update_selection_mode mode
137
+ @selection_mode_label.text = if mode.nil? then ''
138
+ elsif mode then 'BLOCK'
139
+ else 'LINE'
140
+ end
141
+ end
142
+
143
+ =begin rdoc
144
+ Updates the status icon
145
+ =end
146
+ def update_state
147
+ pix = if @view and ((d = @view.document).modified? or d.modified_on_disk?)
148
+ d.icon.pixmap(16)
149
+ else Qt::Pixmap.new(16, 16){|px| px.fill Qt::Color.new(Qt.transparent)}
150
+ end
151
+ @status_label.pixmap = pix
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -0,0 +1,90 @@
1
+ =begin
2
+ ** Form generated from reading ui file 'choose_plugins_widget.ui'
3
+ **
4
+ ** Created: ven ott 29 17:39:04 2010
5
+ ** by: Qt User Interface Compiler version 4.7.0
6
+ **
7
+ ** WARNING! All changes made in this file will be lost when recompiling ui file!
8
+ =end
9
+
10
+ class Ui_ChoosePluginsWidget
11
+ attr_reader :verticalLayout_2
12
+ attr_reader :groupBox_2
13
+ attr_reader :verticalLayout
14
+ attr_reader :plugins
15
+ attr_reader :groupBox
16
+ attr_reader :horizontalLayout
17
+ attr_reader :directories
18
+
19
+ def setupUi(choosePluginsWidget)
20
+ if choosePluginsWidget.objectName.nil?
21
+ choosePluginsWidget.objectName = "choosePluginsWidget"
22
+ end
23
+ choosePluginsWidget.resize(600, 546)
24
+ @verticalLayout_2 = Qt::VBoxLayout.new(choosePluginsWidget)
25
+ @verticalLayout_2.objectName = "verticalLayout_2"
26
+ @groupBox_2 = Qt::GroupBox.new(choosePluginsWidget)
27
+ @groupBox_2.objectName = "groupBox_2"
28
+ @sizePolicy = Qt::SizePolicy.new(Qt::SizePolicy::Preferred, Qt::SizePolicy::Preferred)
29
+ @sizePolicy.setHorizontalStretch(0)
30
+ @sizePolicy.setVerticalStretch(3)
31
+ @sizePolicy.heightForWidth = @groupBox_2.sizePolicy.hasHeightForWidth
32
+ @groupBox_2.sizePolicy = @sizePolicy
33
+ @verticalLayout = Qt::VBoxLayout.new(@groupBox_2)
34
+ @verticalLayout.objectName = "verticalLayout"
35
+ @plugins = Qt::TreeView.new(@groupBox_2)
36
+ @plugins.objectName = "plugins"
37
+ @plugins.alternatingRowColors = true
38
+ @plugins.rootIsDecorated = false
39
+ @plugins.allColumnsShowFocus = true
40
+ @plugins.wordWrap = true
41
+
42
+ @verticalLayout.addWidget(@plugins)
43
+
44
+
45
+ @verticalLayout_2.addWidget(@groupBox_2)
46
+
47
+ @groupBox = Qt::GroupBox.new(choosePluginsWidget)
48
+ @groupBox.objectName = "groupBox"
49
+ @sizePolicy1 = Qt::SizePolicy.new(Qt::SizePolicy::Preferred, Qt::SizePolicy::Preferred)
50
+ @sizePolicy1.setHorizontalStretch(0)
51
+ @sizePolicy1.setVerticalStretch(2)
52
+ @sizePolicy1.heightForWidth = @groupBox.sizePolicy.hasHeightForWidth
53
+ @groupBox.sizePolicy = @sizePolicy1
54
+ @horizontalLayout = Qt::HBoxLayout.new(@groupBox)
55
+ @horizontalLayout.objectName = "horizontalLayout"
56
+ @directories = KDE::EditListBox.new(@groupBox)
57
+ @directories.objectName = "directories"
58
+
59
+ @horizontalLayout.addWidget(@directories)
60
+
61
+
62
+ @verticalLayout_2.addWidget(@groupBox)
63
+
64
+
65
+ retranslateUi(choosePluginsWidget)
66
+
67
+ Qt::MetaObject.connectSlotsByName(choosePluginsWidget)
68
+ end # setupUi
69
+
70
+ def setup_ui(choosePluginsWidget)
71
+ setupUi(choosePluginsWidget)
72
+ end
73
+
74
+ def retranslateUi(choosePluginsWidget)
75
+ choosePluginsWidget.windowTitle = Qt::Application.translate("ChoosePluginsWidget", "Form", nil, Qt::Application::UnicodeUTF8)
76
+ @groupBox_2.title = Qt::Application.translate("ChoosePluginsWidget", "Plugins", nil, Qt::Application::UnicodeUTF8)
77
+ @groupBox.title = Qt::Application.translate("ChoosePluginsWidget", "Plugin directories", nil, Qt::Application::UnicodeUTF8)
78
+ end # retranslateUi
79
+
80
+ def retranslate_ui(choosePluginsWidget)
81
+ retranslateUi(choosePluginsWidget)
82
+ end
83
+
84
+ end
85
+
86
+ module Ui
87
+ class ChoosePluginsWidget < Ui_ChoosePluginsWidget
88
+ end
89
+ end # module Ui
90
+
@@ -0,0 +1,77 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ui version="4.0">
3
+ <class>ChoosePluginsWidget</class>
4
+ <widget class="QWidget" name="ChoosePluginsWidget">
5
+ <property name="geometry">
6
+ <rect>
7
+ <x>0</x>
8
+ <y>0</y>
9
+ <width>600</width>
10
+ <height>546</height>
11
+ </rect>
12
+ </property>
13
+ <property name="windowTitle">
14
+ <string>Form</string>
15
+ </property>
16
+ <layout class="QVBoxLayout" name="verticalLayout_2">
17
+ <item>
18
+ <widget class="QGroupBox" name="groupBox_2">
19
+ <property name="sizePolicy">
20
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
21
+ <horstretch>0</horstretch>
22
+ <verstretch>3</verstretch>
23
+ </sizepolicy>
24
+ </property>
25
+ <property name="title">
26
+ <string>Plugins</string>
27
+ </property>
28
+ <layout class="QVBoxLayout" name="verticalLayout">
29
+ <item>
30
+ <widget class="QTreeView" name="plugins">
31
+ <property name="alternatingRowColors">
32
+ <bool>true</bool>
33
+ </property>
34
+ <property name="rootIsDecorated">
35
+ <bool>false</bool>
36
+ </property>
37
+ <property name="allColumnsShowFocus">
38
+ <bool>true</bool>
39
+ </property>
40
+ <property name="wordWrap">
41
+ <bool>true</bool>
42
+ </property>
43
+ </widget>
44
+ </item>
45
+ </layout>
46
+ </widget>
47
+ </item>
48
+ <item>
49
+ <widget class="QGroupBox" name="groupBox">
50
+ <property name="sizePolicy">
51
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
52
+ <horstretch>0</horstretch>
53
+ <verstretch>2</verstretch>
54
+ </sizepolicy>
55
+ </property>
56
+ <property name="title">
57
+ <string>Plugin directories</string>
58
+ </property>
59
+ <layout class="QHBoxLayout" name="horizontalLayout">
60
+ <item>
61
+ <widget class="KEditListBox" name="directories"/>
62
+ </item>
63
+ </layout>
64
+ </widget>
65
+ </item>
66
+ </layout>
67
+ </widget>
68
+ <customwidgets>
69
+ <customwidget>
70
+ <class>KEditListBox</class>
71
+ <extends>QGroupBox</extends>
72
+ <header>keditlistbox.h</header>
73
+ </customwidget>
74
+ </customwidgets>
75
+ <resources/>
76
+ <connections/>
77
+ </ui>