Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mystro256 committed May 17, 2012
1 parent c99aa6c commit c2851a7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/* -*- mode: js2 - indent-tabs-mode: nil - js2-basic-offset: 4 -*- */
const DBus = imports.dbus;
const Lang = imports.lang;
const St = imports.gi.St;
const Gio = imports.gi.Gio;

const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const GnomeSession = imports.misc.gnomeSession;
const UserMenu = imports.ui.userMenu;

const Gettext = imports.gettext.domain('gnome-shell-extension-inhibitapplet');
const _ = Gettext.gettext;
Expand Down Expand Up @@ -49,11 +46,13 @@ InhibitMenu.prototype = {
var powerManagementFlag = InhibitMenu._powerSettings.get_boolean(POWER_KEY);
///ScreenSaver Setting
InhibitMenu._screenSettings = new Gio.Settings({ schema: SCREEN_SCHEMA });
//Make sure the screensaver enable is synchronized
InhibitMenu._screenSettings.set_boolean(SCREEN_KEY, powerManagementFlag);

//Add the Inhibit Option
this._inhibitswitch = new PopupMenu.PopupSwitchMenuItem(_("Inhibit Suspend"), !powerManagementFlag);
this.menu.addMenuItem(this._inhibitswitch);
//Make sure the screensaver enable is synchronized
InhibitMenu._screenSettings.set_boolean(SCREEN_KEY, powerManagementFlag);

//Change Icon if necessary
if(!powerManagementFlag) {
this.setIcon(EnabledIcon);
Expand Down

0 comments on commit c2851a7

Please sign in to comment.