calculator & benitlux: remove obsolete explicit observer declaration
[nit.git] / contrib / benitlux / src / client / features / debug.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Debugging features accessible from the user preference menu
16 module debug
17
18 import client
19 import push
20 import checkins
21
22 redef class UserWindow
23
24 private var layout_debug = new VerticalLayout(parent=layout)
25
26 private var lbl_debug_title = new Label(parent=layout_debug,
27 text="Debug options".t, size=1.5)
28
29 private var but_test_notif = new Button(parent=layout_debug,
30 text="Test notifications".t)
31
32 private var but_test_checkin = new Button(parent=layout_debug,
33 text="Test checkin".t)
34
35 private var but_test_checkout = new Button(parent=layout_debug,
36 text="Test checkout".t)
37
38 private var but_test_menu = new Button(parent=layout_debug,
39 text="Test menu diff".t)
40
41 redef fun on_event(event)
42 do
43 super
44
45 if event isa ButtonPressEvent then
46 var sender = event.sender
47 if sender == but_test_notif then
48 notify("Test Notification", "Some content\nmultiline", 5)
49 else if sender == but_test_checkin then
50 app.on_check_in
51 else if sender == but_test_checkout then
52 app.on_check_out
53 else if sender == but_test_menu then
54 app.request_menu
55 end
56 end
57 end
58 end