Skip to content

Commit

Permalink
follow suggestion from extension.gnome.org review
Browse files Browse the repository at this point in the history
  • Loading branch information
biji committed Jun 11, 2021
1 parent 8b488a0 commit 1025e6a
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Main = imports.ui.main;
// const Tweener = imports.ui.tweener;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const ByteArray = imports.byteArray;

const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
Expand All @@ -23,7 +24,6 @@ let resetNextCount = false, resetCount = 0;

function init() {

settings = Convenience.getSettings(PREFS_SCHEMA);
}

function changeMode(widget, event) {
Expand Down Expand Up @@ -136,22 +136,6 @@ function parseStat() {
ioSpeed.set_text(e.message);
}

/*
let curDiskstats = GLib.file_get_contents('/proc/diskstats');
if (diskstats == curDiskstats) {
if (cur !== 0) {
button.set_child(iconDark);
cur = 0;
}
} else {
if (cur != 1) {
button.set_child(icon);
cur = 1;
}
diskstats = curDiskstats;
}*/

return GLib.SOURCE_CONTINUE;
}

Expand Down Expand Up @@ -189,6 +173,8 @@ function speedToString(amount) {
}

function enable() {
settings = Convenience.getSettings(PREFS_SCHEMA);

mode = settings.get_int('mode'); // default mode using bit (bps, kbps)
fontmode = settings.get_int('fontmode');

Expand All @@ -201,25 +187,12 @@ function enable() {
track_hover: true
});

/*
icon = new St.Icon({
gicon: Gio.icon_new_for_string(Me.path + "/icons/harddisk.svg")
});
iconDark = new St.Icon({
gicon: Gio.icon_new_for_string(Me.path + "/icons/harddisk-dark.svg")
});*/

ioSpeed = new St.Label({
text: '---',
y_align: Clutter.ActorAlign.CENTER,
style_class: 'simplenetspeed-label'
});

// ioSpeedStaticIcon = new St.Label({
// text: '💾',
// style_class: 'simplenetspeed-static-icon'
// });

button.set_child(chooseLabel());
button.connect('button-press-event', changeMode);

Expand All @@ -234,5 +207,6 @@ function disable() {
GLib.source_remove(timeout);
timeout = null;
Main.panel._rightBox.remove_child(button);
button.destroy();
}
}

0 comments on commit 1025e6a

Please sign in to comment.