-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstarter.kv
More file actions
202 lines (178 loc) · 5.46 KB
/
starter.kv
File metadata and controls
202 lines (178 loc) · 5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#:kivy 1.8.0
# XonoticSimpleStarter
# Copyright (C) <2016> <Sebastian Schmidt>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#:import DictAdapter kivy.adapters.dictadapter.DictAdapter
#:import ListItemButton kivy.uix.listview.ListItemButton
#:import IRCChannelView irc.IRCChannelView
#:import subprocess subprocess
#:import webbrowser webbrowser
<Label>:
markup: True
<TextInput>:
write_tab: False
<IRCRulesPopup>:
title: "IRC Rules"
BoxLayout:
orientation: 'vertical'
Label:
font_size: 20
line_height: 2
markup: True
text: root.ircrules
on_ref_press: webbrowser.open("https://www.quakenet.org/help/rules/main-rules")
Button:
text: "OK"
size_hint_y: None
on_press: root.dismiss()
<AddFavouritePopup>:
title: "Add Favourite"
BoxLayout:
orientation: 'vertical'
Label:
font_size: 25
text: "Name"
TextInput:
id: txt_inpt_name
size_hint_y: None
font_size: 25
multiline: False
height: self.minimum_height
Label:
font_size: 25
text: "Address"
height: self.line_height
TextInput:
id: txt_inpt_address
size_hint_y: None
font_size: 25
multiline: False
height: self.minimum_height
Widget:
size_hint_y: 0.3
BoxLayout:
size_hint_y: 0.2
Button:
id: add_fav_btn
text: "Add Favourite"
Button:
text: "Close Popup"
on_press: root.dismiss()
<StarterWidget>:
orientation: 'vertical'
id: starter_widget
BoxLayout:
orientation: 'horizontal'
size_hint_y: 0.1
Button:
text: "Add Favourite"
on_press: starter_widget.add_favourite_popup()
Button:
text: "Refresh Serverlist"
on_press: starter_widget.request_info()
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: txt_input_filter.height
Label:
text: "Filter"
size_hint_x: 0.08
TextInput:
id: txt_input_filter
size_hint_x: 0.19
size_hint_y: None
multiline: False
height: self.minimum_height
on_text: root.update_serverlist()
Label:
text: "Sort by:"
size_hint_x: 0.1
Spinner:
id: spinner_sort
size_hint_x: 0.25
text: "Name"
values: ["Name", "Current Players", "Maximum Players", "Gametype"]
on_text: root.sort_by(self.text)
Label:
text: "Show empty"
size_hint_x: 0.13
CheckBox:
id: switch_empty
size_hint_x: 0.075
active: True
on_active: root.update_serverlist()
Label:
text: "Show full"
size_hint_x: 0.1
CheckBox:
id: switch_full
size_hint_x: 0.075
active: True
on_active: root.update_serverlist()
ScrollView:
TreeView:
id: server_list
hide_root: True
size_hint_y: None
height: self.minimum_height
BoxLayout:
orientation: 'horizontal'
size_hint_y: 0.1
Button:
text: "Start Xonotic"
on_press: app.start_xon()
Button:
text: "Add server to favourites"
on_press: starter_widget.add_server_to_favourites()
Button:
text: "Connect to server"
on_press: starter_widget.connect_to_server()
<MainGUI>:
orientation: 'vertical'
ActionBar:
ActionView:
ActionPrevious:
on_press: webbrowser.open("http://xonotic.org")
app_icon: app.icon
title: ""
with_previous: False
ActionButton:
id: btn_connectIRC
text: "Connect to IRC"
on_press: app.irccontroller.toggle_connection()
ActionButton:
text: "IRC Rules"
on_press: root.ircrules_popup()
ActionSeparator
ActionButton:
text: "Settings"
on_press: app.open_settings()
TabbedPanel:
id: tabs
tab_pos: 'top_mid'
do_default_tab: False
# Serverlist
TabbedPanelItem:
text: "Start"
StarterWidget
# Support IRC
TabbedPanelItem:
text: "Support"
IRCChannelView:
id: irc_xonotic
channel: "#xonotic"
# Pickup IRC
TabbedPanelItem:
text: "Pickup"
IRCChannelView:
id: irc_pickup
channel: "#xonotic.pickup"