Permalink
Browse files

More changes

  • Loading branch information...
1 parent 1d25c11 commit 8a165a60d97e616d7c9a4bdddf2bb96d220dcc89 @excid3 committed Nov 21, 2011
@@ -7,6 +7,9 @@
objects = {
/* Begin PBXBuildFile section */
+ 83363127144E8B9E00DC1306 /* light-green.png in Resources */ = {isa = PBXBuildFile; fileRef = 83363126144E8B9E00DC1306 /* light-green.png */; };
+ 8336312A144E8C1B00DC1306 /* light-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 83363129144E8C1B00DC1306 /* light-orange.png */; };
+ 8336312C144E8C3D00DC1306 /* light-red.png in Resources */ = {isa = PBXBuildFile; fileRef = 8336312B144E8C3D00DC1306 /* light-red.png */; };
839E56DF1447C23D00562CB9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 839E56DE1447C23D00562CB9 /* Cocoa.framework */; };
839E56E11447C23D00562CB9 /* MacRuby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 839E56E01447C23D00562CB9 /* MacRuby.framework */; };
839E56E81447C23D00562CB9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 839E56E61447C23D00562CB9 /* InfoPlist.strings */; };
@@ -17,6 +20,9 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 83363126144E8B9E00DC1306 /* light-green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "light-green.png"; sourceTree = "<group>"; };
+ 83363129144E8C1B00DC1306 /* light-orange.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "light-orange.png"; sourceTree = "<group>"; };
+ 8336312B144E8C3D00DC1306 /* light-red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "light-red.png"; sourceTree = "<group>"; };
839E56DA1447C23D00562CB9 /* Critical Mass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Critical Mass.app"; sourceTree = BUILT_PRODUCTS_DIR; };
839E56DE1447C23D00562CB9 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
839E56E01447C23D00562CB9 /* MacRuby.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MacRuby.framework; path = Library/Frameworks/MacRuby.framework; sourceTree = DEVELOPER_DIR; };
@@ -93,6 +99,9 @@
839E56EC1447C23D00562CB9 /* Resources */ = {
isa = PBXGroup;
children = (
+ 8336312B144E8C3D00DC1306 /* light-red.png */,
+ 83363129144E8C1B00DC1306 /* light-orange.png */,
+ 83363126144E8B9E00DC1306 /* light-green.png */,
839E56ED1447C23D00562CB9 /* MainMenu.xib */,
);
name = Resources;
@@ -177,6 +186,9 @@
839E56EF1447C23D00562CB9 /* MainMenu.xib in Resources */,
839E56F21447C23D00562CB9 /* rb_main.rb in Resources */,
839E56F41447C23D00562CB9 /* AppDelegate.rb in Resources */,
+ 83363127144E8B9E00DC1306 /* light-green.png in Resources */,
+ 8336312A144E8C1B00DC1306 /* light-orange.png in Resources */,
+ 8336312C144E8C3D00DC1306 /* light-red.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -323,6 +335,7 @@
839E56F91447C23D00562CB9 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
839E56FA1447C23D00562CB9 /* Build configuration list for PBXLegacyTarget "Deployment" */ = {
isa = XCConfigurationList;
@@ -331,6 +344,7 @@
839E56FC1447C23D00562CB9 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IDEWorkspaceUserSettings_BuildLocationStyle</key>
+ <integer>0</integer>
+ <key>IDEWorkspaceUserSettings_BuildSubfolderNameStyle</key>
+ <integer>0</integer>
+ <key>IDEWorkspaceUserSettings_DerivedDataLocationStyle</key>
+ <integer>0</integer>
+ <key>IDEWorkspaceUserSettings_IssueFilterStyle</key>
+ <integer>0</integer>
+ <key>IDEWorkspaceUserSettings_LiveSourceIssuesEnabled</key>
+ <true/>
+ <key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
+ <true/>
+ <key>IDEWorkspaceUserSettings_SnapshotLocationStyle</key>
+ <integer>0</integer>
+</dict>
+</plist>
@@ -7,15 +7,15 @@
#
class AppDelegate
- attr_accessor :window, :power_source_label, :status_label, :status_detail_label, :battery_percent_label, :battery_level
+ attr_accessor :window, :power_source_label, :status_image
+ attr_accessor :status_label, :status_detail_label, :battery_percent_label, :battery_level
def applicationDidFinishLaunching(a_notification)
window.level = NSFloatingWindowLevel
- @hide = 4
-
+ @hide = 1000
+
tick
@timer = NSTimer.scheduledTimerWithTimeInterval 1, target:self, selector: :tick, userInfo:nil, repeats:true
-
end
def tick
@@ -34,10 +34,12 @@ def tick
if status[:status] == "discharging" and percent.to_i <= 5
status_label.stringValue = "Low battery"
+ status_image.setImage NSImage.imageNamed("light-red")
status_detail_label.stringValue = "Quick! Hurry up and plug in!"
window.orderFront self
elsif status[:source] == "AC Power" and @hide < 0 # no longer starting up
status_label.stringValue = "Charging"
+ status_image.setImage NSImage.imageNamed("light-green")
status_detail_label.stringValue = "Phew, you're safe for now."
@hide = 3
end
Oops, something went wrong.

0 comments on commit 8a165a6

Please sign in to comment.