manabu-desktop 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/layouts/img/black_circle.png +0 -0
- data/layouts/img/black_heart.png +0 -0
- data/layouts/img/blue_circle.png +0 -0
- data/layouts/img/heart.png +0 -0
- data/layouts/img/red_circle.png +0 -0
- data/layouts/img/titlebar.png +0 -0
- data/layouts/img/titlebar_2.png +0 -0
- data/layouts/img/transfer_down.png +0 -0
- data/layouts/img/transfer_none.png +0 -0
- data/layouts/img/transfer_up.png +0 -0
- data/layouts/img/transfer_updown.png +0 -0
- data/layouts/img/white_circle.png +0 -0
- data/layouts/main_menu.glade +130 -44
- data/layouts/server_listbox.glade +55 -0
- data/lib/screens/base.rb +12 -1
- data/lib/screens/components/server_list_item.rb +28 -0
- data/lib/screens/main_menu.rb +103 -0
- data/manabu-desktop.gemspec +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 769d096edcef6a59bda505a842e183402b9c2c293048da8eda04c5732b112670
|
|
4
|
+
data.tar.gz: e8740cf1064645f0001de4df34dd84865ccf16a3afa2ca145687213ae3c9a459
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 416c3a129944f64e858315be673cff9cc884dea292ec28e20dc14add5b179ad68a696c9a11274aa40bc3c22d4f9cacb00276841cdc7554b949e63748951967b0
|
|
7
|
+
data.tar.gz: 6f85f71b36fb7effee7b1a6015c9a0beeae8a2b149dcf9fecbdc52be8df03f574d7a9f8dbf35399ffbcfb10e5ea9f3e774952cd874382266c42b053788c06fd8
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/layouts/main_menu.glade
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!-- Generated with glade 3.
|
|
2
|
+
<!-- Generated with glade 3.22.1 -->
|
|
3
3
|
<interface>
|
|
4
4
|
<requires lib="gtk+" version="3.20"/>
|
|
5
5
|
<object class="GtkImage" id="connect_button.Image">
|
|
@@ -20,22 +20,25 @@
|
|
|
20
20
|
<object class="GtkWindow" id="main_menu.Window">
|
|
21
21
|
<property name="can_focus">False</property>
|
|
22
22
|
<property name="resizable">False</property>
|
|
23
|
-
<property name="default_width">
|
|
24
|
-
<property name="default_height">
|
|
25
|
-
<property name="
|
|
23
|
+
<property name="default_width">200</property>
|
|
24
|
+
<property name="default_height">500</property>
|
|
25
|
+
<property name="icon">img/manabu-kun-128.png</property>
|
|
26
|
+
<property name="gravity">north-east</property>
|
|
27
|
+
<child>
|
|
28
|
+
<placeholder/>
|
|
29
|
+
</child>
|
|
26
30
|
<child>
|
|
27
31
|
<object class="GtkBox" id="menu.Box">
|
|
28
32
|
<property name="visible">True</property>
|
|
29
33
|
<property name="can_focus">False</property>
|
|
30
34
|
<property name="orientation">vertical</property>
|
|
31
|
-
<property name="spacing">6</property>
|
|
32
35
|
<property name="baseline_position">bottom</property>
|
|
33
36
|
<child>
|
|
34
37
|
<object class="GtkImage" id="logo.Image">
|
|
35
38
|
<property name="visible">True</property>
|
|
36
39
|
<property name="can_focus">False</property>
|
|
37
40
|
<property name="has_tooltip">True</property>
|
|
38
|
-
<property name="pixbuf">img/
|
|
41
|
+
<property name="pixbuf">img/titlebar.png</property>
|
|
39
42
|
</object>
|
|
40
43
|
<packing>
|
|
41
44
|
<property name="expand">False</property>
|
|
@@ -44,13 +47,55 @@
|
|
|
44
47
|
</packing>
|
|
45
48
|
</child>
|
|
46
49
|
<child>
|
|
47
|
-
<object class="
|
|
48
|
-
<property name="label" translatable="yes">connect</property>
|
|
50
|
+
<object class="GtkBox" id="controls.Box">
|
|
49
51
|
<property name="visible">True</property>
|
|
50
|
-
<property name="can_focus">
|
|
51
|
-
<property name="
|
|
52
|
-
<
|
|
53
|
-
|
|
52
|
+
<property name="can_focus">False</property>
|
|
53
|
+
<property name="homogeneous">True</property>
|
|
54
|
+
<child>
|
|
55
|
+
<object class="GtkButton" id="connect.Button">
|
|
56
|
+
<property name="label" translatable="yes">connect</property>
|
|
57
|
+
<property name="visible">True</property>
|
|
58
|
+
<property name="can_focus">True</property>
|
|
59
|
+
<property name="receives_default">True</property>
|
|
60
|
+
<property name="image">connect_button.Image</property>
|
|
61
|
+
<property name="always_show_image">True</property>
|
|
62
|
+
</object>
|
|
63
|
+
<packing>
|
|
64
|
+
<property name="expand">False</property>
|
|
65
|
+
<property name="fill">True</property>
|
|
66
|
+
<property name="position">0</property>
|
|
67
|
+
</packing>
|
|
68
|
+
</child>
|
|
69
|
+
<child>
|
|
70
|
+
<object class="GtkButton" id="settings.Button">
|
|
71
|
+
<property name="label" translatable="yes">settings</property>
|
|
72
|
+
<property name="visible">True</property>
|
|
73
|
+
<property name="can_focus">True</property>
|
|
74
|
+
<property name="receives_default">True</property>
|
|
75
|
+
<property name="image">settings_button.Image</property>
|
|
76
|
+
<property name="always_show_image">True</property>
|
|
77
|
+
</object>
|
|
78
|
+
<packing>
|
|
79
|
+
<property name="expand">False</property>
|
|
80
|
+
<property name="fill">True</property>
|
|
81
|
+
<property name="position">1</property>
|
|
82
|
+
</packing>
|
|
83
|
+
</child>
|
|
84
|
+
<child>
|
|
85
|
+
<object class="GtkButton" id="exit.Button">
|
|
86
|
+
<property name="label" translatable="yes">exit</property>
|
|
87
|
+
<property name="visible">True</property>
|
|
88
|
+
<property name="can_focus">True</property>
|
|
89
|
+
<property name="receives_default">True</property>
|
|
90
|
+
<property name="image">exit_button.Image</property>
|
|
91
|
+
<property name="always_show_image">True</property>
|
|
92
|
+
</object>
|
|
93
|
+
<packing>
|
|
94
|
+
<property name="expand">False</property>
|
|
95
|
+
<property name="fill">True</property>
|
|
96
|
+
<property name="position">2</property>
|
|
97
|
+
</packing>
|
|
98
|
+
</child>
|
|
54
99
|
</object>
|
|
55
100
|
<packing>
|
|
56
101
|
<property name="expand">False</property>
|
|
@@ -59,13 +104,76 @@
|
|
|
59
104
|
</packing>
|
|
60
105
|
</child>
|
|
61
106
|
<child>
|
|
62
|
-
<object class="
|
|
63
|
-
<property name="label" translatable="yes">settings</property>
|
|
107
|
+
<object class="GtkBox">
|
|
64
108
|
<property name="visible">True</property>
|
|
65
|
-
<property name="can_focus">
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
<property name="can_focus">False</property>
|
|
110
|
+
<child>
|
|
111
|
+
<object class="GtkImage" id="transfer_status.Image">
|
|
112
|
+
<property name="visible">True</property>
|
|
113
|
+
<property name="can_focus">False</property>
|
|
114
|
+
<property name="stock">gtk-missing-image</property>
|
|
115
|
+
</object>
|
|
116
|
+
<packing>
|
|
117
|
+
<property name="expand">False</property>
|
|
118
|
+
<property name="fill">True</property>
|
|
119
|
+
<property name="position">0</property>
|
|
120
|
+
</packing>
|
|
121
|
+
</child>
|
|
122
|
+
<child>
|
|
123
|
+
<object class="GtkSeparator">
|
|
124
|
+
<property name="visible">True</property>
|
|
125
|
+
<property name="can_focus">False</property>
|
|
126
|
+
</object>
|
|
127
|
+
<packing>
|
|
128
|
+
<property name="expand">False</property>
|
|
129
|
+
<property name="fill">True</property>
|
|
130
|
+
<property name="position">2</property>
|
|
131
|
+
</packing>
|
|
132
|
+
</child>
|
|
133
|
+
<child>
|
|
134
|
+
<object class="GtkImage" id="status.Image">
|
|
135
|
+
<property name="visible">True</property>
|
|
136
|
+
<property name="can_focus">False</property>
|
|
137
|
+
<property name="stock">gtk-missing-image</property>
|
|
138
|
+
</object>
|
|
139
|
+
<packing>
|
|
140
|
+
<property name="expand">False</property>
|
|
141
|
+
<property name="fill">True</property>
|
|
142
|
+
<property name="position">3</property>
|
|
143
|
+
</packing>
|
|
144
|
+
</child>
|
|
145
|
+
<child>
|
|
146
|
+
<object class="GtkStatusbar" id="status.Statusbar">
|
|
147
|
+
<property name="visible">True</property>
|
|
148
|
+
<property name="can_focus">False</property>
|
|
149
|
+
<property name="margin_left">10</property>
|
|
150
|
+
<property name="margin_right">10</property>
|
|
151
|
+
<property name="margin_start">10</property>
|
|
152
|
+
<property name="margin_end">10</property>
|
|
153
|
+
<property name="margin_top">6</property>
|
|
154
|
+
<property name="margin_bottom">6</property>
|
|
155
|
+
<property name="orientation">vertical</property>
|
|
156
|
+
<property name="homogeneous">True</property>
|
|
157
|
+
</object>
|
|
158
|
+
<packing>
|
|
159
|
+
<property name="expand">False</property>
|
|
160
|
+
<property name="fill">True</property>
|
|
161
|
+
<property name="position">4</property>
|
|
162
|
+
</packing>
|
|
163
|
+
</child>
|
|
164
|
+
<child>
|
|
165
|
+
<object class="GtkImage" id="heartbeat.Image">
|
|
166
|
+
<property name="visible">True</property>
|
|
167
|
+
<property name="can_focus">False</property>
|
|
168
|
+
<property name="stock">gtk-missing-image</property>
|
|
169
|
+
</object>
|
|
170
|
+
<packing>
|
|
171
|
+
<property name="expand">False</property>
|
|
172
|
+
<property name="fill">True</property>
|
|
173
|
+
<property name="pack_type">end</property>
|
|
174
|
+
<property name="position">5</property>
|
|
175
|
+
</packing>
|
|
176
|
+
</child>
|
|
69
177
|
</object>
|
|
70
178
|
<packing>
|
|
71
179
|
<property name="expand">False</property>
|
|
@@ -74,13 +182,9 @@
|
|
|
74
182
|
</packing>
|
|
75
183
|
</child>
|
|
76
184
|
<child>
|
|
77
|
-
<object class="
|
|
78
|
-
<property name="label" translatable="yes">exit</property>
|
|
185
|
+
<object class="GtkProgressBar" id="buffer_status.ProgressBar">
|
|
79
186
|
<property name="visible">True</property>
|
|
80
|
-
<property name="can_focus">
|
|
81
|
-
<property name="receives_default">True</property>
|
|
82
|
-
<property name="image">exit_button.Image</property>
|
|
83
|
-
<property name="always_show_image">True</property>
|
|
187
|
+
<property name="can_focus">False</property>
|
|
84
188
|
</object>
|
|
85
189
|
<packing>
|
|
86
190
|
<property name="expand">False</property>
|
|
@@ -97,6 +201,7 @@
|
|
|
97
201
|
<object class="GtkViewport" id="connections.Viewport">
|
|
98
202
|
<property name="visible">True</property>
|
|
99
203
|
<property name="can_focus">False</property>
|
|
204
|
+
<property name="shadow_type">none</property>
|
|
100
205
|
<child>
|
|
101
206
|
<object class="GtkListBox" id="connections.ListBox">
|
|
102
207
|
<property name="visible">True</property>
|
|
@@ -107,26 +212,7 @@
|
|
|
107
212
|
</child>
|
|
108
213
|
</object>
|
|
109
214
|
<packing>
|
|
110
|
-
<property name="expand">
|
|
111
|
-
<property name="fill">True</property>
|
|
112
|
-
<property name="position">4</property>
|
|
113
|
-
</packing>
|
|
114
|
-
</child>
|
|
115
|
-
<child>
|
|
116
|
-
<object class="GtkStatusbar" id="status.Statusbar">
|
|
117
|
-
<property name="visible">True</property>
|
|
118
|
-
<property name="can_focus">False</property>
|
|
119
|
-
<property name="margin_left">10</property>
|
|
120
|
-
<property name="margin_right">10</property>
|
|
121
|
-
<property name="margin_start">10</property>
|
|
122
|
-
<property name="margin_end">10</property>
|
|
123
|
-
<property name="margin_top">6</property>
|
|
124
|
-
<property name="margin_bottom">6</property>
|
|
125
|
-
<property name="orientation">vertical</property>
|
|
126
|
-
<property name="spacing">2</property>
|
|
127
|
-
</object>
|
|
128
|
-
<packing>
|
|
129
|
-
<property name="expand">False</property>
|
|
215
|
+
<property name="expand">True</property>
|
|
130
216
|
<property name="fill">True</property>
|
|
131
217
|
<property name="position">5</property>
|
|
132
218
|
</packing>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- Generated with glade 3.22.1 -->
|
|
3
|
+
<interface>
|
|
4
|
+
<requires lib="gtk+" version="3.20"/>
|
|
5
|
+
<object class="GtkListBoxRow" id="server_instance.ListBoxRow">
|
|
6
|
+
<property name="visible">True</property>
|
|
7
|
+
<property name="can_focus">True</property>
|
|
8
|
+
<child>
|
|
9
|
+
<object class="GtkBox" id="server_infopack.Box">
|
|
10
|
+
<property name="visible">True</property>
|
|
11
|
+
<property name="can_focus">False</property>
|
|
12
|
+
<child>
|
|
13
|
+
<object class="GtkMenuButton" id="server_menu.MenuButton">
|
|
14
|
+
<property name="visible">True</property>
|
|
15
|
+
<property name="can_focus">True</property>
|
|
16
|
+
<property name="receives_default">True</property>
|
|
17
|
+
<child>
|
|
18
|
+
<placeholder/>
|
|
19
|
+
</child>
|
|
20
|
+
</object>
|
|
21
|
+
<packing>
|
|
22
|
+
<property name="expand">False</property>
|
|
23
|
+
<property name="fill">True</property>
|
|
24
|
+
<property name="position">0</property>
|
|
25
|
+
</packing>
|
|
26
|
+
</child>
|
|
27
|
+
<child>
|
|
28
|
+
<object class="GtkLabel" id="server_id.Label">
|
|
29
|
+
<property name="visible">True</property>
|
|
30
|
+
<property name="can_focus">False</property>
|
|
31
|
+
<property name="label" translatable="yes">user@server:port</property>
|
|
32
|
+
</object>
|
|
33
|
+
<packing>
|
|
34
|
+
<property name="expand">True</property>
|
|
35
|
+
<property name="fill">True</property>
|
|
36
|
+
<property name="position">1</property>
|
|
37
|
+
</packing>
|
|
38
|
+
</child>
|
|
39
|
+
<child>
|
|
40
|
+
<object class="GtkImage" id="server_heartbeat.Image">
|
|
41
|
+
<property name="visible">True</property>
|
|
42
|
+
<property name="can_focus">False</property>
|
|
43
|
+
<property name="stock">gtk-missing-image</property>
|
|
44
|
+
</object>
|
|
45
|
+
<packing>
|
|
46
|
+
<property name="expand">False</property>
|
|
47
|
+
<property name="fill">True</property>
|
|
48
|
+
<property name="pack_type">end</property>
|
|
49
|
+
<property name="position">2</property>
|
|
50
|
+
</packing>
|
|
51
|
+
</child>
|
|
52
|
+
</object>
|
|
53
|
+
</child>
|
|
54
|
+
</object>
|
|
55
|
+
</interface>
|
data/lib/screens/base.rb
CHANGED
|
@@ -10,7 +10,9 @@ module ManabuDesktop
|
|
|
10
10
|
@@gtk_initialized = false
|
|
11
11
|
@@gtk_main_quit_set = false
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
# opts:
|
|
14
|
+
# icon_path: path to an icon image for the window icon
|
|
15
|
+
def initialize(layout, locale = :c, opts = {})
|
|
14
16
|
@builder = Gtk::Builder.new()
|
|
15
17
|
@builder.add_from_file("#{__dir__}/../../layouts/#{layout}.glade")
|
|
16
18
|
|
|
@@ -25,6 +27,15 @@ module ManabuDesktop
|
|
|
25
27
|
|
|
26
28
|
@window = builder.get_object("#{layout}.Window")
|
|
27
29
|
@window.set_title(I18n.t("#{layout}.title"))
|
|
30
|
+
if opts.include? :icon_path
|
|
31
|
+
begin
|
|
32
|
+
@window.set_icon(opts[:icon_path])
|
|
33
|
+
rescue
|
|
34
|
+
@window.set_icon("#{__dir__}/../../layouts/img/gaku-logo-128.png")
|
|
35
|
+
end
|
|
36
|
+
else
|
|
37
|
+
@window.set_icon("#{__dir__}/../../layouts/img/gaku-logo-128.png")
|
|
38
|
+
end
|
|
28
39
|
unless @@gtk_main_quit_set
|
|
29
40
|
@window.signal_connect('delete-event') do |_widget|
|
|
30
41
|
#@window.destroy()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'gtk3'
|
|
2
|
+
|
|
3
|
+
module ManabuDesktop
|
|
4
|
+
module Screens
|
|
5
|
+
module Components
|
|
6
|
+
class ServerListItem
|
|
7
|
+
attr_reader :user, :server, :port, :list_box_row, :label
|
|
8
|
+
|
|
9
|
+
def initialize(user, server, port = 80)
|
|
10
|
+
@user = user
|
|
11
|
+
@server = server
|
|
12
|
+
@port = port
|
|
13
|
+
super()
|
|
14
|
+
_generate()
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def _generate()
|
|
18
|
+
sib_builder = Gtk::Builder.new()
|
|
19
|
+
sib_builder.add_from_file("#{__dir__}/../../../layouts/server_listbox.glade")
|
|
20
|
+
@list_box_row = sib_builder.get_object('server_instance.ListBoxRow')
|
|
21
|
+
@label = sib_builder.get_object('server_id.Label')
|
|
22
|
+
@label.set_label("#{@user}@#{@server}:#{@port}")
|
|
23
|
+
@list_box_row.show_all()
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/screens/main_menu.rb
CHANGED
|
@@ -2,10 +2,24 @@ require_relative 'base'
|
|
|
2
2
|
require_relative 'login'
|
|
3
3
|
require_relative '../sessions'
|
|
4
4
|
require_relative '../windows'
|
|
5
|
+
require_relative './components/server_list_item'
|
|
6
|
+
|
|
7
|
+
STATUS_ICON_SIZE = 16
|
|
5
8
|
|
|
6
9
|
module ManabuDesktop
|
|
7
10
|
module Screens
|
|
8
11
|
class MainMenu < ManabuDesktop::Screens::Base
|
|
12
|
+
|
|
13
|
+
def _generate_server_list_item(user, server, port = 80)
|
|
14
|
+
sib_builder = Gtk::Builder.new()
|
|
15
|
+
sib_builder.add_from_file("#{__dir__}/../../layouts/server_listbox.glade")
|
|
16
|
+
lbr = sib_builder.get_object('server_instance.ListBoxRow')
|
|
17
|
+
label = sib_builder.get_object('server_id.Label')
|
|
18
|
+
label.set_label("#{user}@#{server}:#{port}")
|
|
19
|
+
lbr.show_all()
|
|
20
|
+
lbr
|
|
21
|
+
end
|
|
22
|
+
|
|
9
23
|
def initialize()
|
|
10
24
|
if ManabuDesktop::Windows.set_main_menu(self) == false
|
|
11
25
|
# TODO: handle multiple main menus..
|
|
@@ -13,15 +27,21 @@ module ManabuDesktop
|
|
|
13
27
|
end
|
|
14
28
|
|
|
15
29
|
super('main_menu', :c)
|
|
30
|
+
@window.set_resizable(false) # Main menu is a fixed size
|
|
31
|
+
@window.gravity = Gdk::Gravity::NORTH_EAST # Float to top right
|
|
32
|
+
@window.move((Gdk::Screen.width - @window.width_request), 0) # Try to position manually
|
|
16
33
|
|
|
34
|
+
# Connection button
|
|
17
35
|
connect_button = @builder.get_object('connect.Button')
|
|
18
36
|
connect_button.set_label(I18n.t('main_menu.connect'))
|
|
19
37
|
connect_button.signal_connect('clicked') { ManabuDesktop::Screens::Login.new() }
|
|
20
38
|
|
|
39
|
+
# Settings button
|
|
21
40
|
settings_button = @builder.get_object('settings.Button')
|
|
22
41
|
settings_button.set_label(I18n.t('main_menu.settings'))
|
|
23
42
|
settings_button.signal_connect('clicked') { puts 'Settings coming soon' }
|
|
24
43
|
|
|
44
|
+
# Exit button (closes all other windows)
|
|
25
45
|
exit_button = @builder.get_object('exit.Button')
|
|
26
46
|
exit_button.set_label(I18n.t('main_menu.exit'))
|
|
27
47
|
exit_button.signal_connect('clicked') do |_widget|
|
|
@@ -29,13 +49,43 @@ module ManabuDesktop
|
|
|
29
49
|
Gtk.main_quit()
|
|
30
50
|
end
|
|
31
51
|
|
|
52
|
+
# Connection list
|
|
32
53
|
@connections_list = @builder.get_object('connections.ListBox')
|
|
54
|
+
# TODO: delete lines here after implementation [reference]
|
|
55
|
+
#sli = ManabuDesktop::Screens::Components::ServerListItem.new("a", "b")
|
|
56
|
+
#@connections_list.add(sli.list_box_row)
|
|
57
|
+
#sli = ManabuDesktop::Screens::Components::ServerListItem.new("c", "d")
|
|
58
|
+
#@connections_list.add(sli.list_box_row)
|
|
59
|
+
#@connections_list.add(ServerInstanceBox.new("c", "d"))
|
|
60
|
+
#lbr = Gtk::ListBoxRow.new()
|
|
61
|
+
#box = Gtk::Box.new(Gtk::Orientation::HORIZONTAL)
|
|
62
|
+
#lbr.add box
|
|
63
|
+
#label = Gtk::Label.new("test")
|
|
64
|
+
#box.pack_start(label, expand: false, fill: false, padding: 0)
|
|
65
|
+
#@connections_list.add(lbr)
|
|
66
|
+
@connections_list.show_all
|
|
33
67
|
|
|
34
68
|
@status_bar = @builder.get_object('status.Statusbar')
|
|
35
69
|
@status_bar_context_id = @status_bar.get_context_id('Connection Status')
|
|
36
70
|
|
|
37
71
|
set_connections_status(ManabuDesktop::Sessions.session_count)
|
|
38
72
|
|
|
73
|
+
# Status icon
|
|
74
|
+
@status_image = @builder.get_object('status.Image')
|
|
75
|
+
_load_status_icons()
|
|
76
|
+
_set_status_icon(:clear)
|
|
77
|
+
|
|
78
|
+
# Heartbeat icon
|
|
79
|
+
@heartbeat_image = @builder.get_object('heartbeat.Image')
|
|
80
|
+
_load_heartbeat_icons()
|
|
81
|
+
@heartbeat_image.set_pixbuf(@heart_icons[:black])
|
|
82
|
+
|
|
83
|
+
# Transmission and buffer status
|
|
84
|
+
@transfer_status_image = @builder.get_object('transfer_status.Image')
|
|
85
|
+
_load_transfer_icons()
|
|
86
|
+
@transfer_status_image.set_pixbuf(@transfer_icons[:none])
|
|
87
|
+
@buffer_status_progress_bar = @builder.get_object('buffer_status.ProgressBar')
|
|
88
|
+
|
|
39
89
|
_show()
|
|
40
90
|
end
|
|
41
91
|
|
|
@@ -46,6 +96,59 @@ module ManabuDesktop
|
|
|
46
96
|
def set_connections_status(num)
|
|
47
97
|
set_status("#{I18n.t('main_menu.num_connections')}: #{num}")
|
|
48
98
|
end
|
|
99
|
+
|
|
100
|
+
def _load_status_icons()
|
|
101
|
+
@status_icons = {}
|
|
102
|
+
@status_icons[:none] = GdkPixbuf::Pixbuf.new(
|
|
103
|
+
{file: "#{__dir__}/../../layouts/img/black_circle.png",
|
|
104
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
105
|
+
@status_icons[:clear] = GdkPixbuf::Pixbuf.new(
|
|
106
|
+
{file: "#{__dir__}/../../layouts/img/white_circle.png",
|
|
107
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
108
|
+
@status_icons[:ok] = GdkPixbuf::Pixbuf.new(
|
|
109
|
+
{file: "#{__dir__}/../../layouts/img/blue_circle.png",
|
|
110
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
111
|
+
@status_icons[:ng] = GdkPixbuf::Pixbuf.new(
|
|
112
|
+
{file: "#{__dir__}/../../layouts/img/red_circle.png",
|
|
113
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def _set_status_icon(status_code)
|
|
117
|
+
if @status_icons.include? status_code
|
|
118
|
+
@status_image.set_pixbuf(@status_icons[status_code])
|
|
119
|
+
else
|
|
120
|
+
@status_image.set_pixbuf(@status_icons[:none])
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def _load_heartbeat_icons()
|
|
125
|
+
@heart_icons = {}
|
|
126
|
+
@heart_icons[:black] = GdkPixbuf::Pixbuf.new(
|
|
127
|
+
{file: "#{__dir__}/../../layouts/img/black_heart.png",
|
|
128
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
129
|
+
@heart_icons[:red] = GdkPixbuf::Pixbuf.new(
|
|
130
|
+
{file: "#{__dir__}/../../layouts/img/heart.png",
|
|
131
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def heartbeat()
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def _load_transfer_icons()
|
|
138
|
+
@transfer_icons = {}
|
|
139
|
+
@transfer_icons[:none] = GdkPixbuf::Pixbuf.new(
|
|
140
|
+
{file: "#{__dir__}/../../layouts/img/transfer_none.png",
|
|
141
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
142
|
+
@transfer_icons[:up] = GdkPixbuf::Pixbuf.new(
|
|
143
|
+
{file: "#{__dir__}/../../layouts/img/transfer_up.png",
|
|
144
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
145
|
+
@transfer_icons[:down] = GdkPixbuf::Pixbuf.new(
|
|
146
|
+
{file: "#{__dir__}/../../layouts/img/transfer_down.png",
|
|
147
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
148
|
+
@transfer_icons[:updown] = GdkPixbuf::Pixbuf.new(
|
|
149
|
+
{file: "#{__dir__}/../../layouts/img/transfer_updown.png",
|
|
150
|
+
width: STATUS_ICON_SIZE, height: STATUS_ICON_SIZE})
|
|
151
|
+
end
|
|
49
152
|
end
|
|
50
153
|
end
|
|
51
154
|
end
|
data/manabu-desktop.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: manabu-desktop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rei Kagetsuki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: manabu
|
|
@@ -88,16 +88,30 @@ extensions: []
|
|
|
88
88
|
extra_rdoc_files: []
|
|
89
89
|
files:
|
|
90
90
|
- bin/manabu-desktop
|
|
91
|
+
- layouts/img/black_circle.png
|
|
92
|
+
- layouts/img/black_heart.png
|
|
93
|
+
- layouts/img/blue_circle.png
|
|
91
94
|
- layouts/img/gaku-logo-128.png
|
|
92
95
|
- layouts/img/gaku-logo.png
|
|
96
|
+
- layouts/img/heart.png
|
|
93
97
|
- layouts/img/manabu-kun-128.png
|
|
94
98
|
- layouts/img/manabu-kun.png
|
|
99
|
+
- layouts/img/red_circle.png
|
|
100
|
+
- layouts/img/titlebar.png
|
|
101
|
+
- layouts/img/titlebar_2.png
|
|
102
|
+
- layouts/img/transfer_down.png
|
|
103
|
+
- layouts/img/transfer_none.png
|
|
104
|
+
- layouts/img/transfer_up.png
|
|
105
|
+
- layouts/img/transfer_updown.png
|
|
106
|
+
- layouts/img/white_circle.png
|
|
95
107
|
- layouts/login.glade
|
|
96
108
|
- layouts/main_menu.glade
|
|
97
109
|
- layouts/roster.glade
|
|
110
|
+
- layouts/server_listbox.glade
|
|
98
111
|
- layouts/student_registration.glade
|
|
99
112
|
- layouts/toolbox.glade
|
|
100
113
|
- lib/screens/base.rb
|
|
114
|
+
- lib/screens/components/server_list_item.rb
|
|
101
115
|
- lib/screens/login.rb
|
|
102
116
|
- lib/screens/main_menu.rb
|
|
103
117
|
- lib/screens/roster.rb
|
|
@@ -130,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
130
144
|
version: '0'
|
|
131
145
|
requirements: []
|
|
132
146
|
rubyforge_project:
|
|
133
|
-
rubygems_version: 2.7.
|
|
147
|
+
rubygems_version: 2.7.6
|
|
134
148
|
signing_key:
|
|
135
149
|
specification_version: 4
|
|
136
150
|
summary: GTK based GUI client for Manabu/GAKU Engine
|