@@ -4,6 +4,7 @@ const Main = imports.ui.main;
4
4
// const Tweener = imports.ui.tweener;
5
5
const Gio = imports . gi . Gio ;
6
6
const GLib = imports . gi . GLib ;
7
+ const ByteArray = imports . byteArray ;
7
8
8
9
const ExtensionUtils = imports . misc . extensionUtils ;
9
10
const Me = ExtensionUtils . getCurrentExtension ( ) ;
@@ -23,7 +24,6 @@ let resetNextCount = false, resetCount = 0;
23
24
24
25
function init ( ) {
25
26
26
- settings = Convenience . getSettings ( PREFS_SCHEMA ) ;
27
27
}
28
28
29
29
function changeMode ( widget , event ) {
@@ -136,22 +136,6 @@ function parseStat() {
136
136
ioSpeed . set_text ( e . message ) ;
137
137
}
138
138
139
- /*
140
- let curDiskstats = GLib.file_get_contents('/proc/diskstats');
141
-
142
- if (diskstats == curDiskstats) {
143
- if (cur !== 0) {
144
- button.set_child(iconDark);
145
- cur = 0;
146
- }
147
- } else {
148
- if (cur != 1) {
149
- button.set_child(icon);
150
- cur = 1;
151
- }
152
- diskstats = curDiskstats;
153
- }*/
154
-
155
139
return GLib . SOURCE_CONTINUE ;
156
140
}
157
141
@@ -189,6 +173,8 @@ function speedToString(amount) {
189
173
}
190
174
191
175
function enable ( ) {
176
+ settings = Convenience . getSettings ( PREFS_SCHEMA ) ;
177
+
192
178
mode = settings . get_int ( 'mode' ) ; // default mode using bit (bps, kbps)
193
179
fontmode = settings . get_int ( 'fontmode' ) ;
194
180
@@ -201,25 +187,12 @@ function enable() {
201
187
track_hover : true
202
188
} ) ;
203
189
204
- /*
205
- icon = new St.Icon({
206
- gicon: Gio.icon_new_for_string(Me.path + "/icons/harddisk.svg")
207
- });
208
- iconDark = new St.Icon({
209
- gicon: Gio.icon_new_for_string(Me.path + "/icons/harddisk-dark.svg")
210
- });*/
211
-
212
190
ioSpeed = new St . Label ( {
213
191
text : '---' ,
214
192
y_align : Clutter . ActorAlign . CENTER ,
215
193
style_class : 'simplenetspeed-label'
216
194
} ) ;
217
195
218
- // ioSpeedStaticIcon = new St.Label({
219
- // text: '💾',
220
- // style_class: 'simplenetspeed-static-icon'
221
- // });
222
-
223
196
button . set_child ( chooseLabel ( ) ) ;
224
197
button . connect ( 'button-press-event' , changeMode ) ;
225
198
@@ -234,5 +207,6 @@ function disable() {
234
207
GLib . source_remove ( timeout ) ;
235
208
timeout = null ;
236
209
Main . panel . _rightBox . remove_child ( button ) ;
210
+ button . destroy ( ) ;
237
211
}
238
212
}
0 commit comments