clevic 0.13.0.b3 → 0.13.0.b5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +21 -0
- data/Manifest.txt +91 -85
- data/README.txt +33 -18
- data/Rakefile +2 -3
- data/TODO +8 -14
- data/bin/clevic +18 -20
- data/lib/clevic.rb +7 -1
- data/lib/clevic/action_builder.rb +4 -1
- data/lib/clevic/ar_methods.rb +72 -57
- data/lib/clevic/attribute_list.rb +4 -0
- data/lib/clevic/cache_table.rb +43 -69
- data/lib/clevic/dataset_roller.rb +22 -0
- data/lib/clevic/delegate.rb +11 -5
- data/lib/clevic/delegates/combo_delegate.rb +156 -0
- data/lib/clevic/delegates/distinct_delegate.rb +48 -0
- data/lib/clevic/delegates/relational_delegate.rb +59 -0
- data/lib/clevic/delegates/set_delegate.rb +31 -0
- data/lib/clevic/field.rb +39 -55
- data/lib/clevic/field_valuer.rb +23 -10
- data/lib/clevic/filter_command.rb +22 -36
- data/lib/clevic/framework.rb +37 -0
- data/lib/clevic/generic_format.rb +5 -1
- data/lib/clevic/many_field.rb +28 -3
- data/lib/clevic/model_builder.rb +27 -32
- data/lib/clevic/ordered_dataset.rb +45 -0
- data/lib/clevic/qt.rb +4 -1
- data/lib/clevic/qt/action_builder.rb +9 -1
- data/lib/clevic/qt/browser.rb +1 -1
- data/lib/clevic/qt/clipboard.rb +3 -3
- data/lib/clevic/qt/combo_delegate.rb +25 -89
- data/lib/clevic/qt/delegate.rb +25 -0
- data/lib/clevic/qt/distinct_delegate.rb +5 -23
- data/lib/clevic/qt/extensions.rb +8 -1
- data/lib/clevic/qt/qt_combo_box.rb +58 -0
- data/lib/clevic/qt/relational_delegate.rb +18 -58
- data/lib/clevic/qt/set_delegate.rb +4 -34
- data/lib/clevic/qt/simplest_delegate.rb +19 -0
- data/lib/clevic/qt/table_model.rb +10 -10
- data/lib/clevic/qt/table_view.rb +7 -23
- data/lib/clevic/qt/text_delegate.rb +2 -2
- data/lib/clevic/qt/ui/browser_ui.rb +1 -1
- data/lib/clevic/qt/ui/search_dialog_ui.rb +1 -1
- data/lib/clevic/rails_models_loaders.rb +13 -0
- data/lib/clevic/record.rb +2 -2
- data/lib/clevic/sampler.rb +85 -39
- data/lib/clevic/sequel_ar_adapter.rb +1 -28
- data/lib/clevic/sequel_clevic.rb +68 -0
- data/lib/clevic/sequel_meta.rb +1 -13
- data/lib/clevic/subclasses.rb +18 -0
- data/lib/clevic/swing.rb +2 -1
- data/lib/clevic/swing/action.rb +27 -3
- data/lib/clevic/swing/action_builder.rb +0 -2
- data/lib/clevic/swing/browser.rb +1 -10
- data/lib/clevic/swing/combo_delegate.rb +45 -133
- data/lib/clevic/swing/delegate.rb +2 -0
- data/lib/clevic/swing/distinct_delegate.rb +2 -14
- data/lib/clevic/swing/relational_delegate.rb +2 -20
- data/lib/clevic/swing/set_delegate.rb +13 -28
- data/lib/clevic/swing/table_view.rb +1 -1
- data/lib/clevic/table_model.rb +3 -4
- data/lib/clevic/table_searcher.rb +10 -31
- data/lib/clevic/table_view.rb +97 -43
- data/lib/clevic/ui/browser_ui.rb +133 -0
- data/lib/clevic/ui/search_dialog_ui.rb +106 -0
- data/lib/clevic/version.rb +2 -2
- data/models/accounts_models.rb +24 -21
- data/models/times_models.rb +34 -28
- data/models/times_psql_models.rb +9 -3
- data/models/times_sqlite_models.rb +24 -1
- data/sql/times_sqlite.sql +3 -3
- data/tasks/clevic.rake +2 -2
- data/test/test_cache_table.rb +9 -19
- data/test/test_table_searcher.rb +2 -5
- metadata +95 -91
- data/lib/clevic/order_attribute.rb +0 -63
- data/lib/clevic/qt/boolean_delegate.rb +0 -8
- data/lib/clevic/qt/delegates.rb +0 -1
- data/lib/clevic/qt/item_delegate.rb +0 -66
- data/lib/clevic/sql_dialects.rb +0 -33
- data/tasks/website.rake +0 -25
- data/test/test_order_attribute.rb +0 -62
- data/test/test_sql_dialects.rb +0 -77
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'clevic/ordered_dataset'
|
2
|
+
|
1
3
|
module Clevic
|
2
4
|
|
3
5
|
=begin
|
@@ -6,7 +8,8 @@ criteria will be a starting record, and the search method should return
|
|
6
8
|
the matching record next after this.
|
7
9
|
=end
|
8
10
|
class TableSearcher
|
9
|
-
|
11
|
+
include OrderedDataset
|
12
|
+
attr_reader :search_criteria, :field
|
10
13
|
|
11
14
|
# dataset is a Sequel::Dataset, which has an associated Sequel::Model
|
12
15
|
# field is an instance of Clevic::Field
|
@@ -14,15 +17,8 @@ class TableSearcher
|
|
14
17
|
def initialize( dataset, search_criteria, field )
|
15
18
|
raise "field must be specified" if field.nil?
|
16
19
|
raise "unknown order #{search_criteria.direction}" unless [:forwards, :backwards].include?( search_criteria.direction )
|
17
|
-
raise "dataset has no model" unless dataset.respond_to?( :model )
|
18
20
|
|
19
|
-
|
20
|
-
@dataset =
|
21
|
-
if dataset.opts[:order].nil?
|
22
|
-
dataset.order( dataset.model.primary_key )
|
23
|
-
else
|
24
|
-
dataset
|
25
|
-
end
|
21
|
+
self.dataset = dataset
|
26
22
|
|
27
23
|
@search_criteria = search_criteria
|
28
24
|
@field = field
|
@@ -38,13 +34,13 @@ protected
|
|
38
34
|
# return a Sequel expression for the name of the field to use as a comparison
|
39
35
|
def search_field_expression
|
40
36
|
if field.association?
|
41
|
-
|
37
|
+
raise "display not specified for #{field}" if field.display.nil?
|
38
|
+
|
39
|
+
# for related table displays as procs
|
42
40
|
unless [String,Symbol].include?( field.display.class )
|
43
41
|
raise( "search field #{field.inspect} cannot search lambda display" )
|
44
42
|
end
|
45
43
|
|
46
|
-
raise "display not specified for #{field}" if field.display.nil?
|
47
|
-
|
48
44
|
# TODO this will only work with a path value with no dots
|
49
45
|
# otherwise the SQL gets complicated with joins etc
|
50
46
|
field.related_class \
|
@@ -80,10 +76,10 @@ protected
|
|
80
76
|
dataset.filter( expression => true )
|
81
77
|
end
|
82
78
|
|
83
|
-
# return a dataset based on
|
79
|
+
# return a dataset based on dataset which filters on search_criteria
|
84
80
|
def search_dataset( start_entity )
|
85
81
|
likes = Array[*search_text_expression].map{|ste| Sequel::SQL::StringExpression.like(search_field_expression, ste, {:case_insensitive=>true})}
|
86
|
-
rv =
|
82
|
+
rv = dataset.filter( Sequel::SQL::BooleanExpression.new(:OR, *likes ) )
|
87
83
|
|
88
84
|
# if we're not searching from the start, we need
|
89
85
|
# to find the next match. Which is complicated from an SQL point of view.
|
@@ -140,23 +136,6 @@ protected
|
|
140
136
|
['','>','<'][comparator_direction]
|
141
137
|
end
|
142
138
|
|
143
|
-
# returns a collection of [ attribute, (1|-1) ]
|
144
|
-
# where 1 is forward/asc (>) and -1 is backward/desc (<)
|
145
|
-
def order_attributes
|
146
|
-
if @order_attributes.nil?
|
147
|
-
@order_attributes =
|
148
|
-
@dataset.opts[:order].map do |order_expr|
|
149
|
-
case order_expr
|
150
|
-
when Symbol; [ order_expr, 1 ]
|
151
|
-
when Sequel::SQL::OrderedExpression; [ order_expr.expression, order_expr.descending ? -1 : 1 ]
|
152
|
-
else
|
153
|
-
raise "unknown order_expr: #{order_expr.inspect}"
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
157
|
-
@order_attributes
|
158
|
-
end
|
159
139
|
end
|
160
140
|
|
161
141
|
end
|
162
|
-
|
data/lib/clevic/table_view.rb
CHANGED
@@ -10,9 +10,13 @@ module Clevic
|
|
10
10
|
class TableView
|
11
11
|
include ActionBuilder
|
12
12
|
|
13
|
-
# the current filter
|
14
|
-
|
15
|
-
|
13
|
+
# the current stack of filter commands
|
14
|
+
def filters
|
15
|
+
@filtered ||= []
|
16
|
+
end
|
17
|
+
attr_writer :filters
|
18
|
+
|
19
|
+
def filtered?; !filters.empty?; end
|
16
20
|
|
17
21
|
# Called from the gui-framework adapter code in this class
|
18
22
|
# arg is:
|
@@ -70,10 +74,10 @@ class TableView
|
|
70
74
|
yield
|
71
75
|
end
|
72
76
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
+
rescue Exception => e
|
78
|
+
puts
|
79
|
+
puts "#{model.entity_view.class.name}: #{e.message}"
|
80
|
+
puts e.backtrace
|
77
81
|
end
|
78
82
|
|
79
83
|
|
@@ -104,7 +108,7 @@ class TableView
|
|
104
108
|
action :action_delete_rows, 'Delete Rows', :shortcut => 'Ctrl+Delete', :method => :delete_rows
|
105
109
|
|
106
110
|
if $options[:debug]
|
107
|
-
action :action_dump, '
|
111
|
+
action :action_dump, 'Du&mp', :shortcut => 'Ctrl+Shift+D' do
|
108
112
|
puts model.collection[current_index.row].inspect
|
109
113
|
end
|
110
114
|
end
|
@@ -116,8 +120,9 @@ class TableView
|
|
116
120
|
list( :search ) do
|
117
121
|
action :action_find, '&Find', :shortcut => 'Ctrl+F', :method => :find
|
118
122
|
action :action_find_next, 'Find &Next', :shortcut => 'Ctrl+G', :method => :find_next
|
119
|
-
action :action_filter, 'Fil&ter', :
|
120
|
-
action :
|
123
|
+
action :action_filter, 'Fil&ter', :shortcut => 'Ctrl+L', :method => :filter_by_current
|
124
|
+
action :action_unfilter, '&Un-Filter', :enabled => false, :shortcut => 'Ctrl+K', :method => :unfilter
|
125
|
+
#~ action :action_highlight, '&Highlight', :visible => false, :shortcut => 'Ctrl+H'
|
121
126
|
end
|
122
127
|
end
|
123
128
|
|
@@ -181,7 +186,7 @@ class TableView
|
|
181
186
|
# from and to are ModelIndex instances. Throws :insane if
|
182
187
|
# their fields don't have the same attribute_type.
|
183
188
|
def sanity_check_types( from, to )
|
184
|
-
unless from.field.
|
189
|
+
unless from.field.meta.type == to.field.meta.type
|
185
190
|
emit_status_text( 'Incompatible data' )
|
186
191
|
throw :insane
|
187
192
|
end
|
@@ -475,14 +480,18 @@ class TableView
|
|
475
480
|
end
|
476
481
|
|
477
482
|
# toggle the filter, based on current selection.
|
478
|
-
def filter_by_current
|
483
|
+
def filter_by_current
|
479
484
|
filter_by_indexes( selection_or_current )
|
480
485
|
end
|
481
486
|
|
487
|
+
# This is used by entity view classes.
|
488
|
+
# Keep it as a compatibility / deprecated option?
|
482
489
|
def filter_by_options( args )
|
483
|
-
|
484
|
-
|
485
|
-
|
490
|
+
puts "#{self.class.name}#filter_by_options is deprecated. Use filter_by_dataset( message, &block ) instead."
|
491
|
+
|
492
|
+
filter_by_dataset( "#{args.inspect}" ) do |dataset|
|
493
|
+
dataset.translate( args )
|
494
|
+
end
|
486
495
|
end
|
487
496
|
|
488
497
|
# Save the current entity, do something, then restore
|
@@ -502,41 +511,67 @@ class TableView
|
|
502
511
|
|
503
512
|
retval
|
504
513
|
end
|
514
|
+
|
515
|
+
def unfilter
|
516
|
+
restore_entity do
|
517
|
+
filters.pop.undo
|
518
|
+
end
|
519
|
+
update_filter_status_bar
|
520
|
+
end
|
521
|
+
|
522
|
+
def unfilter_action
|
523
|
+
search_actions.find{|a| a.object_name == 'action_unfilter' }
|
524
|
+
end
|
525
|
+
|
526
|
+
def filter_message
|
527
|
+
"Filter: " + filters.map( &:message ).join(' / ') unless filters.empty?
|
528
|
+
end
|
505
529
|
|
530
|
+
# update status bar with a message of all filters concatenated
|
531
|
+
def update_filter_status_bar
|
532
|
+
emit_status_text( filter_message )
|
533
|
+
emit_filter_status( filtered? )
|
534
|
+
unfilter_action.enabled = filtered?
|
535
|
+
end
|
536
|
+
|
537
|
+
def filter_by_dataset( message, &dataset_block )
|
538
|
+
# clean this up and make it work AND for multiple columns, OR for multiple rows
|
539
|
+
self.filters << FilterCommand.new( self, message, &dataset_block )
|
540
|
+
|
541
|
+
# try to end up on the same entity, even after the filter
|
542
|
+
restore_entity { filters.last.doit }
|
543
|
+
|
544
|
+
# make sure status bar shows status
|
545
|
+
update_filter_status_bar
|
546
|
+
end
|
547
|
+
|
506
548
|
# Filter by the value in the current index.
|
507
549
|
# indexes is a collection of TableIndex instances
|
508
550
|
def filter_by_indexes( indexes )
|
509
551
|
case
|
510
|
-
|
511
|
-
|
512
|
-
restore_entity do
|
513
|
-
filtered.undo
|
514
|
-
self.filtered = nil
|
515
|
-
# update status bar
|
516
|
-
emit_status_text( nil )
|
517
|
-
emit_filter_status( false )
|
518
|
-
end
|
519
|
-
|
520
|
-
when indexes.empty?
|
521
|
-
emit_status_text( "No field selected for filter" )
|
522
|
-
|
523
|
-
when !indexes.first.field.filterable?
|
524
|
-
emit_status_text( "Can't filter on #{indexes.first.field.label}" )
|
552
|
+
when indexes.empty?
|
553
|
+
emit_status_text( "No field selected for filter" )
|
525
554
|
|
526
|
-
|
527
|
-
|
555
|
+
when !indexes.first.field.filterable?
|
556
|
+
emit_status_text( "Can't filter on #{indexes.first.field.label}" )
|
557
|
+
|
558
|
+
when indexes.size > 1
|
559
|
+
emit_status_text( "Can't do multiple selection filters yet" )
|
560
|
+
|
561
|
+
when indexes.first.entity.new_record?
|
562
|
+
emit_status_text( "Can't filter on a new row" )
|
528
563
|
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
564
|
+
else
|
565
|
+
message = "#{indexes.first.field_name} = #{indexes.first.display_value}"
|
566
|
+
filter_by_dataset( message ) do |dataset|
|
567
|
+
indexes.first.field.with do |field|
|
568
|
+
if field.association?
|
569
|
+
dataset.filter( field.meta.keys => indexes.first.attribute_value.andand.pk )
|
570
|
+
else
|
571
|
+
dataset.filter( indexes.first.field_name.to_sym => indexes.first.attribute_value )
|
572
|
+
end
|
537
573
|
end
|
538
|
-
|
539
|
-
emit_status_text( filtered.status_message )
|
574
|
+
end
|
540
575
|
end
|
541
576
|
filtered?
|
542
577
|
end
|
@@ -558,7 +593,11 @@ class TableView
|
|
558
593
|
|
559
594
|
# create a new index and move to it
|
560
595
|
unless found_row.nil?
|
561
|
-
|
596
|
+
if column.is_a? Symbol
|
597
|
+
column = model.field_column( column )
|
598
|
+
else
|
599
|
+
raise "column #{column} does not exist" if column >= model.fields.size
|
600
|
+
end
|
562
601
|
selection_model.clear
|
563
602
|
self.current_index = model.create_index( found_row, column || 0 )
|
564
603
|
end
|
@@ -614,6 +653,21 @@ class TableView
|
|
614
653
|
# to_next_index is called.
|
615
654
|
attr_accessor :next_index
|
616
655
|
|
656
|
+
# This is to allow entity model UI handlers to tell the view
|
657
|
+
# whence to move the cursor when the current editor closes
|
658
|
+
# (see closeEditor).
|
659
|
+
# TODO not used?
|
660
|
+
def override_next_index( model_index )
|
661
|
+
self.next_index = model_index
|
662
|
+
end
|
663
|
+
|
664
|
+
# Call set_current_index with next_index ( from override_next_index )
|
665
|
+
# or model_index, in that order. Set next_index to nil afterwards.
|
666
|
+
def set_current_unless_override( model_index )
|
667
|
+
set_current_index( @next_index || model_index )
|
668
|
+
self.next_index = nil
|
669
|
+
end
|
670
|
+
|
617
671
|
protected
|
618
672
|
|
619
673
|
# show a busy cursor, do the block, back to normal cursor
|
@@ -0,0 +1,133 @@
|
|
1
|
+
=begin
|
2
|
+
** Form generated from reading ui file 'browser.ui'
|
3
|
+
**
|
4
|
+
** Created: Fri Jan 28 11:08:53 2011
|
5
|
+
** by: Qt User Interface Compiler version 4.5.1
|
6
|
+
**
|
7
|
+
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
8
|
+
=end
|
9
|
+
|
10
|
+
class Ui_Browser
|
11
|
+
attr_reader :action_open
|
12
|
+
attr_reader :action_close
|
13
|
+
attr_reader :action_recent
|
14
|
+
attr_reader :action_dump
|
15
|
+
attr_reader :action_refresh
|
16
|
+
attr_reader :action_next
|
17
|
+
attr_reader :action_previous
|
18
|
+
attr_reader :action_new_window
|
19
|
+
attr_reader :main_widget
|
20
|
+
attr_reader :vboxLayout
|
21
|
+
attr_reader :statusbar
|
22
|
+
attr_reader :menubar
|
23
|
+
attr_reader :menu_file
|
24
|
+
attr_reader :menu_edit
|
25
|
+
attr_reader :menu_search
|
26
|
+
attr_reader :menu_model
|
27
|
+
|
28
|
+
def setupUi(browser)
|
29
|
+
if browser.objectName.nil?
|
30
|
+
browser.objectName = "browser"
|
31
|
+
end
|
32
|
+
browser.resize(727, 740)
|
33
|
+
icon = Qt::Icon.new("icon.png")
|
34
|
+
browser.windowIcon = icon
|
35
|
+
@action_open = Qt::Action.new(browser)
|
36
|
+
@action_open.objectName = "action_open"
|
37
|
+
@action_open.visible = false
|
38
|
+
@action_close = Qt::Action.new(browser)
|
39
|
+
@action_close.objectName = "action_close"
|
40
|
+
@action_close.visible = false
|
41
|
+
@action_recent = Qt::Action.new(browser)
|
42
|
+
@action_recent.objectName = "action_recent"
|
43
|
+
@action_recent.visible = false
|
44
|
+
@action_dump = Qt::Action.new(browser)
|
45
|
+
@action_dump.objectName = "action_dump"
|
46
|
+
@action_refresh = Qt::Action.new(browser)
|
47
|
+
@action_refresh.objectName = "action_refresh"
|
48
|
+
@action_next = Qt::Action.new(browser)
|
49
|
+
@action_next.objectName = "action_next"
|
50
|
+
@action_previous = Qt::Action.new(browser)
|
51
|
+
@action_previous.objectName = "action_previous"
|
52
|
+
@action_new_window = Qt::Action.new(browser)
|
53
|
+
@action_new_window.objectName = "action_new_window"
|
54
|
+
@action_new_window.visible = false
|
55
|
+
@main_widget = Qt::Widget.new(browser)
|
56
|
+
@main_widget.objectName = "main_widget"
|
57
|
+
@vboxLayout = Qt::VBoxLayout.new(@main_widget)
|
58
|
+
@vboxLayout.objectName = "vboxLayout"
|
59
|
+
browser.centralWidget = @main_widget
|
60
|
+
@statusbar = Qt::StatusBar.new(browser)
|
61
|
+
@statusbar.objectName = "statusbar"
|
62
|
+
browser.statusBar = @statusbar
|
63
|
+
@menubar = Qt::MenuBar.new(browser)
|
64
|
+
@menubar.objectName = "menubar"
|
65
|
+
@menubar.geometry = Qt::Rect.new(0, 0, 727, 31)
|
66
|
+
@menu_file = Qt::Menu.new(@menubar)
|
67
|
+
@menu_file.objectName = "menu_file"
|
68
|
+
@menu_file.enabled = false
|
69
|
+
@menu_edit = Qt::Menu.new(@menubar)
|
70
|
+
@menu_edit.objectName = "menu_edit"
|
71
|
+
@menu_search = Qt::Menu.new(@menubar)
|
72
|
+
@menu_search.objectName = "menu_search"
|
73
|
+
@menu_model = Qt::Menu.new(@menubar)
|
74
|
+
@menu_model.objectName = "menu_model"
|
75
|
+
browser.setMenuBar(@menubar)
|
76
|
+
|
77
|
+
@menubar.addAction(@menu_file.menuAction())
|
78
|
+
@menubar.addAction(@menu_edit.menuAction())
|
79
|
+
@menubar.addAction(@menu_search.menuAction())
|
80
|
+
@menubar.addAction(@menu_model.menuAction())
|
81
|
+
@menu_file.addAction(@action_open)
|
82
|
+
@menu_file.addAction(@action_close)
|
83
|
+
@menu_file.addAction(@action_recent)
|
84
|
+
@menu_file.addAction(@action_new_window)
|
85
|
+
@menu_model.addAction(@action_next)
|
86
|
+
@menu_model.addAction(@action_previous)
|
87
|
+
@menu_model.addAction(@action_dump)
|
88
|
+
@menu_model.addSeparator()
|
89
|
+
|
90
|
+
retranslateUi(browser)
|
91
|
+
|
92
|
+
Qt::MetaObject.connectSlotsByName(browser)
|
93
|
+
end # setupUi
|
94
|
+
|
95
|
+
def setup_ui(browser)
|
96
|
+
setupUi(browser)
|
97
|
+
end
|
98
|
+
|
99
|
+
def retranslateUi(browser)
|
100
|
+
@action_open.text = Qt::Application.translate("Browser", "&Open", nil, Qt::Application::UnicodeUTF8)
|
101
|
+
@action_close.text = Qt::Application.translate("Browser", "&Close", nil, Qt::Application::UnicodeUTF8)
|
102
|
+
@action_recent.text = Qt::Application.translate("Browser", "&Recent", nil, Qt::Application::UnicodeUTF8)
|
103
|
+
@action_dump.text = Qt::Application.translate("Browser", "&Dump", nil, Qt::Application::UnicodeUTF8)
|
104
|
+
@action_dump.shortcut = Qt::Application.translate("Browser", "Alt+Shift+D", nil, Qt::Application::UnicodeUTF8)
|
105
|
+
@action_refresh.text = Qt::Application.translate("Browser", "&Refresh", nil, Qt::Application::UnicodeUTF8)
|
106
|
+
@action_refresh.iconText = Qt::Application.translate("Browser", "Refresh current table from database", nil, Qt::Application::UnicodeUTF8)
|
107
|
+
@action_refresh.toolTip = Qt::Application.translate("Browser", "Refresh current table from database", nil, Qt::Application::UnicodeUTF8)
|
108
|
+
@action_refresh.shortcut = Qt::Application.translate("Browser", "Ctrl+R", nil, Qt::Application::UnicodeUTF8)
|
109
|
+
@action_next.text = Qt::Application.translate("Browser", "&Next", nil, Qt::Application::UnicodeUTF8)
|
110
|
+
@action_next.iconText = Qt::Application.translate("Browser", "Next", nil, Qt::Application::UnicodeUTF8)
|
111
|
+
@action_next.toolTip = Qt::Application.translate("Browser", "Next Model", nil, Qt::Application::UnicodeUTF8)
|
112
|
+
@action_next.shortcut = Qt::Application.translate("Browser", "Ctrl+Tab", nil, Qt::Application::UnicodeUTF8)
|
113
|
+
@action_previous.text = Qt::Application.translate("Browser", "&Previous", nil, Qt::Application::UnicodeUTF8)
|
114
|
+
@action_previous.toolTip = Qt::Application.translate("Browser", "Previous Model", nil, Qt::Application::UnicodeUTF8)
|
115
|
+
@action_previous.shortcut = Qt::Application.translate("Browser", "Ctrl+Shift+Backtab", nil, Qt::Application::UnicodeUTF8)
|
116
|
+
@action_new_window.text = Qt::Application.translate("Browser", "&New Window", nil, Qt::Application::UnicodeUTF8)
|
117
|
+
@menu_file.title = Qt::Application.translate("Browser", "&File", nil, Qt::Application::UnicodeUTF8)
|
118
|
+
@menu_edit.title = Qt::Application.translate("Browser", "&Edit", nil, Qt::Application::UnicodeUTF8)
|
119
|
+
@menu_search.title = Qt::Application.translate("Browser", "&Search", nil, Qt::Application::UnicodeUTF8)
|
120
|
+
@menu_model.title = Qt::Application.translate("Browser", "&Table", nil, Qt::Application::UnicodeUTF8)
|
121
|
+
end # retranslateUi
|
122
|
+
|
123
|
+
def retranslate_ui(browser)
|
124
|
+
retranslateUi(browser)
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
module Ui
|
130
|
+
class Browser < Ui_Browser
|
131
|
+
end
|
132
|
+
end # module Ui
|
133
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
=begin
|
2
|
+
** Form generated from reading ui file 'search_dialog.ui'
|
3
|
+
**
|
4
|
+
** Created: Fri Jan 28 11:08:53 2011
|
5
|
+
** by: Qt User Interface Compiler version 4.5.1
|
6
|
+
**
|
7
|
+
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
8
|
+
=end
|
9
|
+
|
10
|
+
class Ui_SearchDialog
|
11
|
+
attr_reader :button_box
|
12
|
+
attr_reader :selected_rows
|
13
|
+
attr_reader :selected_columns
|
14
|
+
attr_reader :search_label
|
15
|
+
attr_reader :search_combo
|
16
|
+
attr_reader :from_start
|
17
|
+
attr_reader :regex
|
18
|
+
attr_reader :whole_words
|
19
|
+
attr_reader :forwards
|
20
|
+
attr_reader :backwards
|
21
|
+
|
22
|
+
def setupUi(searchDialog)
|
23
|
+
if searchDialog.objectName.nil?
|
24
|
+
searchDialog.objectName = "searchDialog"
|
25
|
+
end
|
26
|
+
searchDialog.windowModality = Qt::WindowModal
|
27
|
+
searchDialog.resize(307, 400)
|
28
|
+
icon = Qt::Icon.new("../../hilfer/bin/hilfer-icon.png")
|
29
|
+
searchDialog.windowIcon = icon
|
30
|
+
@button_box = Qt::DialogButtonBox.new(searchDialog)
|
31
|
+
@button_box.objectName = "button_box"
|
32
|
+
@button_box.geometry = Qt::Rect.new(30, 240, 261, 32)
|
33
|
+
@button_box.orientation = Qt::Horizontal
|
34
|
+
@button_box.standardButtons = Qt::DialogButtonBox::Cancel|Qt::DialogButtonBox::NoButton|Qt::DialogButtonBox::Ok
|
35
|
+
@selected_rows = Qt::CheckBox.new(searchDialog)
|
36
|
+
@selected_rows.objectName = "selected_rows"
|
37
|
+
@selected_rows.enabled = false
|
38
|
+
@selected_rows.geometry = Qt::Rect.new(30, 280, 191, 21)
|
39
|
+
@selected_columns = Qt::CheckBox.new(searchDialog)
|
40
|
+
@selected_columns.objectName = "selected_columns"
|
41
|
+
@selected_columns.enabled = false
|
42
|
+
@selected_columns.geometry = Qt::Rect.new(30, 310, 191, 21)
|
43
|
+
@search_label = Qt::Label.new(searchDialog)
|
44
|
+
@search_label.objectName = "search_label"
|
45
|
+
@search_label.geometry = Qt::Rect.new(20, 10, 51, 21)
|
46
|
+
@search_label.textFormat = Qt::PlainText
|
47
|
+
@search_combo = Qt::ComboBox.new(searchDialog)
|
48
|
+
@search_combo.objectName = "search_combo"
|
49
|
+
@search_combo.geometry = Qt::Rect.new(90, 10, 201, 25)
|
50
|
+
@search_combo.focusPolicy = Qt::StrongFocus
|
51
|
+
@search_combo.editable = true
|
52
|
+
@from_start = Qt::CheckBox.new(searchDialog)
|
53
|
+
@from_start.objectName = "from_start"
|
54
|
+
@from_start.geometry = Qt::Rect.new(90, 50, 191, 21)
|
55
|
+
@regex = Qt::CheckBox.new(searchDialog)
|
56
|
+
@regex.objectName = "regex"
|
57
|
+
@regex.geometry = Qt::Rect.new(90, 80, 191, 21)
|
58
|
+
@whole_words = Qt::CheckBox.new(searchDialog)
|
59
|
+
@whole_words.objectName = "whole_words"
|
60
|
+
@whole_words.geometry = Qt::Rect.new(90, 110, 191, 21)
|
61
|
+
@forwards = Qt::RadioButton.new(searchDialog)
|
62
|
+
@forwards.objectName = "forwards"
|
63
|
+
@forwards.geometry = Qt::Rect.new(90, 140, 171, 26)
|
64
|
+
@forwards.checked = true
|
65
|
+
@backwards = Qt::RadioButton.new(searchDialog)
|
66
|
+
@backwards.objectName = "backwards"
|
67
|
+
@backwards.geometry = Qt::Rect.new(90, 170, 176, 26)
|
68
|
+
@search_label.buddy = @search_combo
|
69
|
+
Qt::Widget.setTabOrder(@search_combo, @selected_columns)
|
70
|
+
Qt::Widget.setTabOrder(@selected_columns, @selected_rows)
|
71
|
+
Qt::Widget.setTabOrder(@selected_rows, @button_box)
|
72
|
+
|
73
|
+
retranslateUi(searchDialog)
|
74
|
+
Qt::Object.connect(@button_box, SIGNAL('accepted()'), searchDialog, SLOT('accept()'))
|
75
|
+
Qt::Object.connect(@button_box, SIGNAL('rejected()'), searchDialog, SLOT('reject()'))
|
76
|
+
|
77
|
+
Qt::MetaObject.connectSlotsByName(searchDialog)
|
78
|
+
end # setupUi
|
79
|
+
|
80
|
+
def setup_ui(searchDialog)
|
81
|
+
setupUi(searchDialog)
|
82
|
+
end
|
83
|
+
|
84
|
+
def retranslateUi(searchDialog)
|
85
|
+
searchDialog.windowTitle = Qt::Application.translate("SearchDialog", "Search", nil, Qt::Application::UnicodeUTF8)
|
86
|
+
@selected_rows.text = Qt::Application.translate("SearchDialog", "Selected Rows", nil, Qt::Application::UnicodeUTF8)
|
87
|
+
@selected_columns.text = Qt::Application.translate("SearchDialog", "Selected Columns", nil, Qt::Application::UnicodeUTF8)
|
88
|
+
@search_label.text = Qt::Application.translate("SearchDialog", "Search", nil, Qt::Application::UnicodeUTF8)
|
89
|
+
@from_start.text = Qt::Application.translate("SearchDialog", "From &Start", nil, Qt::Application::UnicodeUTF8)
|
90
|
+
@regex.text = Qt::Application.translate("SearchDialog", "&Regular Expression", nil, Qt::Application::UnicodeUTF8)
|
91
|
+
@whole_words.text = Qt::Application.translate("SearchDialog", "&Whole Words", nil, Qt::Application::UnicodeUTF8)
|
92
|
+
@forwards.text = Qt::Application.translate("SearchDialog", "&Forwards", nil, Qt::Application::UnicodeUTF8)
|
93
|
+
@backwards.text = Qt::Application.translate("SearchDialog", "&Backwards", nil, Qt::Application::UnicodeUTF8)
|
94
|
+
end # retranslateUi
|
95
|
+
|
96
|
+
def retranslate_ui(searchDialog)
|
97
|
+
retranslateUi(searchDialog)
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
module Ui
|
103
|
+
class SearchDialog < Ui_SearchDialog
|
104
|
+
end
|
105
|
+
end # module Ui
|
106
|
+
|