1
0
Fork 0

ADDED System submenu, moved uptime and load in there

ADDED Memory info
master
Matthieu Lalonde 14 years ago
parent 7b495f22a9
commit c4fa5446c2

@ -0,0 +1,355 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">1306</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSCustomView</string>
<string>NSForm</string>
<string>NSFormCell</string>
<string>NSCustomObject</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1001">
<string key="NSClassName">NSObject</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="754296154">
<string key="NSClassName">WRTStatusClient</string>
</object>
<object class="NSCustomView" id="279122103">
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSForm" id="547484095">
<reference key="NSNextResponder" ref="279122103"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 20}, {300, 52}}</string>
<reference key="NSSuperview" ref="279122103"/>
<reference key="NSWindow"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSEnabled">YES</bool>
<int key="NSNumRows">2</int>
<int key="NSNumCols">1</int>
<object class="NSMutableArray" key="NSCells">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSFormCell" id="1030461595">
<int key="NSCellFlags">343014977</int>
<int key="NSCellFlags2">205521920</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport" id="787405369">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="547484095"/>
<double key="NSTitleWidth">70.93603515625</double>
<object class="NSCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">67108864</int>
<string key="NSContents">Username:</string>
<reference key="NSSupport" ref="787405369"/>
<reference key="NSControlView" ref="547484095"/>
</object>
</object>
<object class="NSFormCell" id="518703534">
<int key="NSCellFlags">343014977</int>
<int key="NSCellFlags2">205521920</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="787405369"/>
<reference key="NSControlView" ref="547484095"/>
<int key="NSTag">1</int>
<double key="NSTitleWidth">70.93603515625</double>
<object class="NSCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">67108864</int>
<string key="NSContents">Password:</string>
<reference key="NSSupport" ref="787405369"/>
<reference key="NSControlView" ref="547484095"/>
</object>
</object>
</object>
<string key="NSCellSize">{300, 22}</string>
<string key="NSIntercellSpacing">{1, 8}</string>
<int key="NSMatrixFlags">67633152</int>
<string key="NSCellClass">NSActionCell</string>
<object class="NSFormCell" key="NSProtoCell" id="584512364">
<int key="NSCellFlags">343014976</int>
<int key="NSCellFlags2">205521920</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="787405369"/>
<double key="NSTitleWidth">70.93603515625</double>
<object class="NSCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">67108864</int>
<string key="NSContents">Field:</string>
<reference key="NSSupport" ref="787405369"/>
</object>
</object>
<int key="NSSelectedRow">-1</int>
<int key="NSSelectedCol">-1</int>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSCellBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<reference key="NSFont" ref="787405369"/>
</object>
</object>
<string key="NSFrameSize">{340, 92}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="547484095"/>
<bool key="NSViewIsLayerTreeHost">YES</bool>
<int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSViewCanDrawConcurrently">YES</bool>
<string key="NSClassName">NSView</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">credentialsView</string>
<reference key="source" ref="754296154"/>
<reference key="destination" ref="279122103"/>
</object>
<int key="connectionID">30</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="754296154"/>
<reference key="parent" ref="0"/>
<string key="objectName">Status Client</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">25</int>
<reference key="object" ref="279122103"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="547484095"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">Custom View</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="547484095"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="518703534"/>
<reference ref="1030461595"/>
<reference ref="584512364"/>
</object>
<reference key="parent" ref="279122103"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="518703534"/>
<reference key="parent" ref="547484095"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">28</int>
<reference key="object" ref="1030461595"/>
<reference key="parent" ref="547484095"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">29</int>
<reference key="object" ref="584512364"/>
<reference key="parent" ref="547484095"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.IBPluginDependency</string>
<string>-2.IBPluginDependency</string>
<string>-3.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>25.IBPluginDependency</string>
<string>25.IBViewIntegration.shadowBlurRadius</string>
<string>25.IBViewIntegration.shadowColor</string>
<string>25.IBViewIntegration.shadowOffsetHeight</string>
<string>25.IBViewIntegration.shadowOffsetWidth</string>
<string>26.IBPluginDependency</string>
<string>27.CustomClassName</string>
<string>27.IBPluginDependency</string>
<string>28.IBPluginDependency</string>
<string>29.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<real value="0.0"/>
<object class="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
<real value="0.0"/>
<real value="0.0"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>NSSecureTextFormCell</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">33</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">WRTStatusClient</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>buttonLogin</string>
<string>credentialsView</string>
<string>credentialsWindow</string>
<string>fieldPassword</string>
<string>fieldUsername</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSButton</string>
<string>NSView</string>
<string>NSWindow</string>
<string>NSSecureTextFieldCell</string>
<string>NSFormCell</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>buttonLogin</string>
<string>credentialsView</string>
<string>credentialsWindow</string>
<string>fieldPassword</string>
<string>fieldUsername</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">buttonLogin</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">credentialsView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">credentialsWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">fieldPassword</string>
<string key="candidateClassName">NSSecureTextFieldCell</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">fieldUsername</string>
<string key="candidateClassName">NSFormCell</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/WRTStatusClient.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>

@ -17,7 +17,7 @@
F2511F5C13914A120053990C /* MenuIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = F2511F5B13914A120053990C /* MenuIcon.png */; };
F2511FFB1391543E0053990C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2511FFA1391543E0053990C /* WebKit.framework */; };
F25120A213918CD10053990C /* AppIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = F25120A113918CD10053990C /* AppIcon.icns */; };
F2736BD0139BDAC20019957B /* CredenialsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F2736BCF139BDAC20019957B /* CredenialsView.xib */; };
F2F1CF54139D35D60020B5A3 /* CredentialsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F2F1CF53139D35D60020B5A3 /* CredentialsView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -39,7 +39,7 @@
F2511F5B13914A120053990C /* MenuIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MenuIcon.png; sourceTree = "<group>"; };
F2511FFA1391543E0053990C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
F25120A113918CD10053990C /* AppIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon.icns; sourceTree = "<group>"; };
F2736BCF139BDAC20019957B /* CredenialsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CredenialsView.xib; sourceTree = "<group>"; };
F2F1CF53139D35D60020B5A3 /* CredentialsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CredentialsView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -116,13 +116,13 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
F2F1CF53139D35D60020B5A3 /* CredentialsView.xib */,
F215851113931CF000853C55 /* MenuIconDisabled.png */,
F25120A113918CD10053990C /* AppIcon.icns */,
F2511F5B13914A120053990C /* MenuIcon.png */,
8D1107310486CEB800E47090 /* DDWRT_Monitor-Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
F2736BCF139BDAC20019957B /* CredenialsView.xib */,
);
name = Resources;
sourceTree = "<group>";
@ -193,7 +193,7 @@
F2511F5C13914A120053990C /* MenuIcon.png in Resources */,
F25120A213918CD10053990C /* AppIcon.icns in Resources */,
F215851213931CF000853C55 /* MenuIconDisabled.png in Resources */,
F2736BD0139BDAC20019957B /* CredenialsView.xib in Resources */,
F2F1CF54139D35D60020B5A3 /* CredentialsView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

@ -31,29 +31,34 @@
IBOutlet NSProgressIndicator *configStateStatus;
IBOutlet id configButtonSave;
IBOutlet id menuUptime;
IBOutlet id menuLoad;
IBOutlet id menuWanIP;
// System Menu Outlets
IBOutlet NSMenuItem *menuSystem;
IBOutlet NSMenuItem *menuSystemUptime;
IBOutlet NSMenuItem *menuSystemLoad;
IBOutlet NSMenuItem *menuSystemName;
IBOutlet NSMenuItem *menuSystemDomain;
IBOutlet NSMenuItem *menuSystemMemory;
IBOutlet id menuWanStatus;
IBOutlet id menuWanUptime;
// Wan Menu Outlets
IBOutlet NSMenuItem *menuWan;
IBOutlet NSMenuItem *menuWanIP;
IBOutlet NSMenuItem *menuWanStatus;
IBOutlet NSMenuItem *menuWanUptime;
IBOutlet NSMenuItem *menuWanTrafficIn;
IBOutlet NSMenuItem *menuWanTrafficOut;
IBOutlet NSMenuItem *menuWanSeparator;
IBOutlet NSMenuItem *menuWanDNS;
IBOutlet NSMenuItem *menuWanDNSItem0;
IBOutlet NSMenuItem *menuWanDNSItem1;
IBOutlet NSMenuItem *menuWanDNSItem2;
IBOutlet NSMenuItem *menuWanBandwidthGraph;
IBOutlet id menuWanTrafficIn;
IBOutlet id menuWanTrafficOut;
IBOutlet id menuWanSeparator;
IBOutlet id menuWanDNS;
IBOutlet id menuWanDNSItem0;
IBOutlet id menuWanDNSItem1;
IBOutlet id menuWanDNSItem2;
IBOutlet id menuWanBandwidthGraph;
IBOutlet id menuClients;
IBOutlet id menuClientsCount;
IBOutlet id menuClientsConnections;
IBOutlet id menuClientsSeparator;
// Clients Menu Outlets
IBOutlet NSMenu *menuClients;
IBOutlet NSMenuItem *menuClientsItem;
IBOutlet NSMenuItem *menuClientsCount;
IBOutlet NSMenuItem *menuClientsConnections;
IBOutlet NSMenuItem *menuClientsSeparator;
NSUserDefaults *defaults;
@ -99,6 +104,8 @@
- (void) showMenubarIcon:(BOOL)enabled;
- (void) hideMenubarIcon;
- (void) setMenubarText:(NSString *)menubarText;
- (void) disableDynamicMenus;
- (void) enableDynamicMenus;
# pragma mark Configs Methods:
- (void) initDefaults;
@ -118,7 +125,7 @@
# pragma mark Menu Handlers:
- (IBAction) refreshMenu:(id)sender;
- (void) populateMenuMain;
- (void) populateMenuSystem;
- (void) populateMenuWan;
- (void) populateMenuClients;
- (NSMenu *) createCopyMenuItem;
@ -126,6 +133,7 @@
# pragma mark Utilities:
- (IBAction) copyParentMenuTitle:(id)sender;
- (NSString *) stringFromSize:(uint64_t)theBytes;
- (NSString *) stringFromSize:(uint64_t)theBytes withUnits:(BOOL)withUnits;
- (NSString *) stringFromSpeed:(uint64_t)theBytes;
@end

@ -156,6 +156,21 @@
[menuTitle release];
}
- (void) disableDynamicMenus
{
[menuSystem setEnabled:false];
[menuWan setEnabled:false];
[menuClientsItem setEnabled:false];
}
- (void) enableDynamicMenus
{
[menuSystem setEnabled:true];
[menuWan setEnabled:true];
[menuClientsItem setEnabled:true];
}
# pragma mark -
# pragma mark Configs Methods:
- (void) initDefaults
@ -317,6 +332,8 @@
[self hideMenubarIcon];
}
[self enableDynamicMenus];
if (_updateTimer != nil) {
[_updateTimer invalidate];
_updateTimer = nil;
@ -328,6 +345,8 @@
[self showMenubarIcon:false];
[self setMenubarText:@""];
[self disableDynamicMenus];
if (_updateTimer != nil) {
[_updateTimer invalidate];
_updateTimer = nil;
@ -390,6 +409,7 @@
NSString *newStringData = [_statusStringData stringByAppendingString:stringData];
_statusStringData = [newStringData retain];
[stringData release];
} else {
_statusStringData = @"";
_statusDataRequestNumber = 0;
@ -406,14 +426,22 @@
[wrt_request_client getStatusUpdate:@"Status_Lan.live.asp" delegate:self callback:@selector(getRouterData:)];
break;
case 3:
default:
[wrt_request_client getStatusUpdate:@"Status_Wireless.live.asp" delegate:self callback:@selector(getRouterData:)];
break;
case 4:/*
// All the information here is redundant anyway... except possibly GPS data if some routers have that populated
[wrt_request_client getStatusUpdate:@"Info.live.htm" delegate:self callback:@selector(getRouterData:)];
break;
case 5:*/
default:
//NSLog(@"%@", _statusStringData);
// Populate the menu items
[self populateMenuMain];
[self populateMenuSystem];
[self populateMenuWan];
[self populateMenuClients];
// Show the menu
[_appMenu popUpStatusItemMenu:AppMenu];
[_appMenu popUpStatusItemMenu:AppMenu];
break;
}
}
@ -428,10 +456,9 @@
} else {
[_appMenu popUpStatusItemMenu:AppMenu];
}
}
- (void) populateMenuMain
- (void) populateMenuSystem
{
NSString *uptime = [wrt_request_client getKey:_statusStringData key:@"uptime"];
NSString *loadSplit = @", load average: ";
@ -440,36 +467,35 @@
uptime = [uptime substringToIndex:[uptime rangeOfString:@", load"].location]; // Cut the load
uptime = [uptime substringFromIndex:[uptime rangeOfString:@" "].location+1]; // Trim
uptime = [uptime stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[uptime substringToIndex:1] uppercaseString]]; // UCFirst
[menuUptime setTitle:uptime];
//[menuUptime setHidden:false];
[menuLoad setTitle:load];
[menuLoad setHidden:false];
//[[AppMenu itemAtIndex:2] setHidden:false];
[menuSystemUptime setTitle:uptime];
[menuSystemLoad setTitle:[NSString stringWithFormat:@"Load %@", load]];
[menuSystemLoad setHidden:false];
} else {
[menuUptime setTitle:@"Connected"];
//[menuUptime setHidden:true];
[menuLoad setHidden:true];
//[[AppMenu itemAtIndex:2] setHidden:true];
[menuSystemUptime setTitle:@"Connected"];
[menuSystemLoad setHidden:true];
}
// NSString *memInfo = [wrt_client getKey:stringData key:@"mem_info"];
NSString *memInfo = [wrt_request_client getKey:_statusStringData key:@"mem_info"];
// Remove any white spaces
// NSArray *parts = [memInfo componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
// NSArray *filteredArray = [parts filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF != ''"]];
// memInfo = [filteredArray componentsJoinedByString:@" "];
// parts = nil;
// filteredArray = nil;
NSArray *parts = [memInfo componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSArray *filteredArray = [parts filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF != ''"]];
memInfo = [filteredArray componentsJoinedByString:@" "];
parts = nil;
filteredArray = nil;
// Remove any quotes
// parts = [memInfo componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\'"]];
// filteredArray = [parts filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF != ''"]];
// memInfo = [filteredArray componentsJoinedByString:@""];
parts = [memInfo componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\'"]];
filteredArray = [parts filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF != ''"]];
memInfo = [filteredArray componentsJoinedByString:@""];
NSArray *memData = [memInfo componentsSeparatedByString:@","];
uint32_t memTotal = strtoull([[memData objectAtIndex:8] UTF8String], NULL, 0);
uint32_t memFree = strtoull([[memData objectAtIndex:9] UTF8String], NULL, 0);
// NSArray *memData = [memInfo componentsSeparatedByString:@","];
// unint32_t memTotal = strtoull([[memData objectAtIndex:17] UTF8String], NULL, 0);
// unint32_t memFree = strtoull([[memData objectAtIndex:21] UTF8String], NULL, 0);
NSString *memTitle = [NSString stringWithFormat:@"Memory %@/%@", [self stringFromSize:memFree withUnits:false], [self stringFromSize:memTotal]];
[menuSystemMemory setTitle:memTitle];
}
- (void) populateMenuWan
@ -637,25 +663,36 @@
[pasteBoard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner: nil];
[pasteBoard setString:[[sender parentItem] title] forType:NSStringPboardType];
}
- (NSString *) stringFromSize:(uint64_t)theBytes
{
return [self stringFromSize:theBytes withUnits:true];
}
- (NSString *) stringFromSize:(uint64_t)theBytes withUnits:(BOOL)withUnits
{
NSString *units = @"";
double floatSize = theBytes;
if (withUnits == true) units = @"B";
if (theBytes<1023)
return([NSString stringWithFormat:@"%lluB", theBytes]);
return([NSString stringWithFormat:@"%llu%@", theBytes, units]);
floatSize = floatSize / 1024;
if (withUnits == true) units = @"KiB";
if (floatSize<1023)
return([NSString stringWithFormat:@"%1.1fKiB", floatSize]);
return([NSString stringWithFormat:@"%1.1f%@", floatSize, units]);
floatSize = floatSize / 1024;
if (withUnits == true) units = @"MiB";
if (floatSize<1023)
return([NSString stringWithFormat:@"%1.2fMiB", floatSize]);
return([NSString stringWithFormat:@"%1.2f%@", floatSize, units]);
floatSize = floatSize / 1024;
if (withUnits == true) units = @"GiB";
if (floatSize<1023)
return([NSString stringWithFormat:@"%1.2fGiB", floatSize]);
return([NSString stringWithFormat:@"%1.2f%@", floatSize, units]);
floatSize = floatSize / 1024;
if (withUnits == true) units = @"TiB";
return([NSString stringWithFormat:@"%1.2fTiB", floatSize]);
return([NSString stringWithFormat:@"%1.2f%@", floatSize, units]);
}
- (NSString *) stringFromSpeed:(uint64_t)theBytes

@ -62,49 +62,20 @@
<string key="NSTitle"/>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="827802449">
<object class="NSMenuItem" id="148702963">
<reference key="NSMenu" ref="1033903501"/>
<bool key="NSIsDisabled">YES</bool>
<string key="NSTitle">Disconnected</string>
<string key="NSTitle">System Status</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<object class="NSCustomResource" key="NSOnImage" id="826397193">
<object class="NSCustomResource" key="NSOnImage" id="574209375">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuCheckmark</string>
</object>
<object class="NSCustomResource" key="NSMixedImage" id="188880500">
<object class="NSCustomResource" key="NSMixedImage" id="684621955">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuMixedState</string>
</object>
</object>
<object class="NSMenuItem" id="360144128">
<reference key="NSMenu" ref="1033903501"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsHidden">YES</bool>
<string key="NSTitle">load-average</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
</object>
<object class="NSMenuItem" id="126948742">
<reference key="NSMenu" ref="1033903501"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
</object>
<object class="NSMenuItem" id="148702963">
<reference key="NSMenu" ref="1033903501"/>
<bool key="NSIsHidden">YES</bool>
<string key="NSTitle">System Status</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="283170046">
<string key="NSTitle">System Status</string>
@ -117,8 +88,8 @@
<string key="NSTitle">router-name</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="619491201">
<reference key="NSMenu" ref="283170046"/>
@ -127,29 +98,47 @@
<string key="NSTitle">domain</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="859544727">
<reference key="NSMenu" ref="283170046"/>
<bool key="NSIsDisabled">YES</bool>
<string key="NSTitle">uptime</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="950159084">
<reference key="NSMenu" ref="283170046"/>
<bool key="NSIsDisabled">YES</bool>
<string key="NSTitle">load-average</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="716346780">
<reference key="NSMenu" ref="283170046"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsHidden">YES</bool>
<string key="NSTitle">memory</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
</object>
<object class="NSMenuItem" id="1061072709">
<reference key="NSMenu" ref="1033903501"/>
<bool key="NSIsDisabled">YES</bool>
<string key="NSTitle">WAN Status</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="744971508">
<string key="NSTitle">WAN Status</string>
@ -161,8 +150,8 @@
<string key="NSTitle">Disconnected</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="1037495304">
<reference key="NSMenu" ref="744971508"/>
@ -171,8 +160,8 @@
<string key="NSTitle">wan-uptime</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="409315605">
<reference key="NSMenu" ref="744971508"/>
@ -182,8 +171,8 @@
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="901173717">
<reference key="NSMenu" ref="744971508"/>
@ -192,8 +181,8 @@
<string key="NSTitle">incoming-bandwidth</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="1013238910">
<reference key="NSMenu" ref="744971508"/>
@ -202,8 +191,8 @@
<string key="NSTitle">outgoing-bandwidth</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="574203895">
<reference key="NSMenu" ref="744971508"/>
@ -212,16 +201,16 @@
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="501550435">
<reference key="NSMenu" ref="744971508"/>
<string key="NSTitle">WAN IP</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="974512259">
<string key="NSTitle">WAN IP</string>
@ -232,8 +221,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -244,8 +233,8 @@
<string key="NSTitle">DNS</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="282367862">
<string key="NSTitle">DNS</string>
@ -257,8 +246,8 @@
<string key="NSTitle">dns0</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="461587580">
<string key="NSTitle">dns0</string>
@ -269,8 +258,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -281,8 +270,8 @@
<string key="NSTitle">dns1</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="444998812">
<string key="NSTitle">dns1</string>
@ -293,8 +282,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -305,8 +294,8 @@
<string key="NSTitle">dns2</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="584623476">
<string key="NSTitle">dns2</string>
@ -317,8 +306,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -332,19 +321,20 @@
<string key="NSTitle">View Bandwidth Graph</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
</object>
<object class="NSMenuItem" id="406982965">
<reference key="NSMenu" ref="1033903501"/>
<bool key="NSIsDisabled">YES</bool>
<string key="NSTitle">Clients</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="242724865">
<string key="NSTitle">Clients</string>
@ -356,8 +346,8 @@
<string key="NSTitle">clients-count</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="745173154">
<reference key="NSMenu" ref="242724865"/>
@ -365,8 +355,8 @@
<string key="NSTitle">connections</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="876337058">
<reference key="NSMenu" ref="242724865"/>
@ -375,8 +365,8 @@
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="857276619">
<reference key="NSMenu" ref="242724865"/>
@ -384,8 +374,8 @@
<string key="NSTitle">host-list-item</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="161159245">
<string key="NSTitle">host-list-item</string>
@ -396,8 +386,8 @@
<string key="NSTitle">Hostname</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="718017639">
<string key="NSTitle">Hostname</string>
@ -408,8 +398,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -419,8 +409,8 @@
<string key="NSTitle">IP</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="48933424">
<string key="NSTitle">IP</string>
@ -431,8 +421,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -442,8 +432,8 @@
<string key="NSTitle">MAC</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="663393009">
<string key="NSTitle">MAC</string>
@ -454,8 +444,8 @@
<string key="NSTitle">Copy</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -465,24 +455,24 @@
<string key="NSTitle">Connections</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="505978498">
<reference key="NSMenu" ref="161159245"/>
<string key="NSTitle">Interface</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="933909401">
<reference key="NSMenu" ref="161159245"/>
<string key="NSTitle">Lease</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -497,8 +487,8 @@
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="277776424">
<reference key="NSMenu" ref="1033903501"/>
@ -507,8 +497,8 @@
<string key="NSTitle">About</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="203471460">
<reference key="NSMenu" ref="1033903501"/>
@ -516,8 +506,8 @@
<string key="NSKeyEquiv">,</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
<object class="NSMenuItem" id="637415609">
<reference key="NSMenu" ref="1033903501"/>
@ -525,8 +515,8 @@
<string key="NSKeyEquiv">q</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="826397193"/>
<reference key="NSMixedImage" ref="188880500"/>
<reference key="NSOnImage" ref="574209375"/>
<reference key="NSMixedImage" ref="684621955"/>
</object>
</object>
</object>
@ -1276,22 +1266,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">760</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuUptime</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="827802449"/>
</object>
<int key="connectionID">770</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuLoad</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="360144128"/>
</object>
<int key="connectionID">771</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuWanIP</string>
@ -1476,14 +1450,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">817</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuClients</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="242724865"/>
</object>
<int key="connectionID">818</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuClientsConnections</string>
@ -1540,6 +1506,78 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">841</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuSystemUptime</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="859544727"/>
</object>
<int key="connectionID">844</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuSystemLoad</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="950159084"/>
</object>
<int key="connectionID">845</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuSystem</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="148702963"/>
</object>
<int key="connectionID">846</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuWan</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="1061072709"/>
</object>
<int key="connectionID">847</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuClientsItem</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="406982965"/>
</object>
<int key="connectionID">849</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuClients</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="242724865"/>
</object>
<int key="connectionID">850</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuSystemMemory</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="716346780"/>
</object>
<int key="connectionID">853</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuSystemName</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="229847922"/>
</object>
<int key="connectionID">854</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">menuSystemDomain</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="619491201"/>
</object>
<int key="connectionID">855</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -1591,10 +1629,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference ref="406982965"/>
<reference ref="1061072709"/>
<reference ref="148702963"/>
<reference ref="827802449"/>
<reference ref="126948742"/>
<reference ref="637415609"/>
<reference ref="360144128"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">MainMenu</string>
@ -1688,6 +1723,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="229847922"/>
<reference ref="716346780"/>
<reference ref="859544727"/>
<reference ref="950159084"/>
<reference ref="619491201"/>
</object>
<reference key="parent" ref="148702963"/>
@ -1697,11 +1734,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="229847922"/>
<reference key="parent" ref="283170046"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">548</int>
<reference key="object" ref="827802449"/>
<reference key="parent" ref="1033903501"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">549</int>
<reference key="object" ref="206781734"/>
@ -2126,11 +2158,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<reference key="parent" ref="492386921"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">684</int>
<reference key="object" ref="126948742"/>
<reference key="parent" ref="1033903501"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">536</int>
<reference key="object" ref="637415609"/>
@ -2160,11 +2187,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="7094024"/>
<reference key="parent" ref="284387334"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">709</int>
<reference key="object" ref="360144128"/>
<reference key="parent" ref="1033903501"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">710</int>
<reference key="object" ref="170030078"/>
@ -2273,6 +2295,16 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="986964814"/>
<reference key="parent" ref="584623476"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">842</int>
<reference key="object" ref="950159084"/>
<reference key="parent" ref="283170046"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">843</int>
<reference key="object" ref="859544727"/>
<reference key="parent" ref="283170046"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@ -2298,7 +2330,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>545.IBEditorWindowLastContentRect</string>
<string>545.IBPluginDependency</string>
<string>546.IBPluginDependency</string>
<string>548.IBPluginDependency</string>
<string>549.IBEditorWindowLastContentRect</string>
<string>549.IBPluginDependency</string>
<string>549.IBWindowTemplateEditedContentRect</string>
@ -2379,7 +2410,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>681.IBWindowTemplateEditedContentRect</string>
<string>681.NSWindowTemplate.visibleAtLaunch</string>
<string>682.IBPluginDependency</string>
<string>684.IBPluginDependency</string>
<string>703.IBPluginDependency</string>
<string>703.IBViewBoundsToFrameTransform</string>
<string>704.IBPluginDependency</string>
@ -2388,7 +2418,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>705.IBViewBoundsToFrameTransform</string>
<string>708.IBPluginDependency</string>
<string>708.IBViewBoundsToFrameTransform</string>
<string>709.IBPluginDependency</string>
<string>710.IBPluginDependency</string>
<string>710.IBViewBoundsToFrameTransform</string>
<string>711.IBPluginDependency</string>
@ -2408,6 +2437,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>793.IBEditorWindowLastContentRect</string>
<string>793.IBPluginDependency</string>
<string>794.IBPluginDependency</string>
<string>842.IBPluginDependency</string>
<string>843.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -2430,7 +2461,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>{{636, 378}, {140, 83}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{602, 826}, {308, 254}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{602, 826}, {308, 254}}</string>
@ -2538,7 +2568,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABBcAAAwsAAAA</bytes>
</object>
@ -2557,7 +2586,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwggAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwrYAAA</bytes>
</object>
@ -2578,6 +2606,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>{{841, 378}, {103, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@ -2592,7 +2622,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">841</int>
<int key="maxID">855</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -2697,9 +2727,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>menuClients</string>
<string>menuClientsConnections</string>
<string>menuClientsCount</string>
<string>menuClientsItem</string>
<string>menuClientsSeparator</string>
<string>menuLoad</string>
<string>menuUptime</string>
<string>menuSystem</string>
<string>menuSystemDomain</string>
<string>menuSystemLoad</string>
<string>menuSystemMemory</string>
<string>menuSystemName</string>
<string>menuSystemUptime</string>
<string>menuWan</string>
<string>menuWanBandwidthGraph</string>
<string>menuWanDNS</string>
<string>menuWanDNSItem0</string>
@ -2730,23 +2766,29 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>id</string>
<string>id</string>
<string>NSProgressIndicator</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>NSMenu</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
@ -2772,9 +2814,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>menuClients</string>
<string>menuClientsConnections</string>
<string>menuClientsCount</string>
<string>menuClientsItem</string>
<string>menuClientsSeparator</string>
<string>menuLoad</string>
<string>menuUptime</string>
<string>menuSystem</string>
<string>menuSystemDomain</string>
<string>menuSystemLoad</string>
<string>menuSystemMemory</string>
<string>menuSystemName</string>
<string>menuSystemUptime</string>
<string>menuWan</string>
<string>menuWanBandwidthGraph</string>
<string>menuWanDNS</string>
<string>menuWanDNSItem0</string>
@ -2855,71 +2903,95 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuClients</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenu</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuClientsConnections</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuClientsCount</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuClientsItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuClientsSeparator</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuLoad</string>
<string key="candidateClassName">id</string>
<string key="name">menuSystem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuUptime</string>
<string key="candidateClassName">id</string>
<string key="name">menuSystemDomain</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuSystemLoad</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuSystemMemory</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuSystemName</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuSystemUptime</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWan</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanBandwidthGraph</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanDNS</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanDNSItem0</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanDNSItem1</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanDNSItem2</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanIP</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanSeparator</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanStatus</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanTrafficIn</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanTrafficOut</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">menuWanUptime</string>
<string key="candidateClassName">id</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
</object>
</object>

@ -32,7 +32,7 @@
id statusDelegate;
SEL statusCallbac;
IBOutlet NSWindow *credentialsWindow;
IBOutlet NSView *credentialsView;
IBOutlet NSFormCell *fieldUsername;
IBOutlet NSSecureTextFieldCell *fieldPassword;
IBOutlet NSButton *buttonLogin;
@ -77,8 +77,8 @@
- (NSString*) getPassword;
- (void) setPassword:(NSString*)new_password;
/*
- (void) showCredentialsWindow;
- (IBAction) hideCredentialsWindow;
*/
@end

@ -254,6 +254,7 @@
#pragma mark -
#pragma mark Credential Window Methods:
/*
- (void) showCredentialsWindow
{
[credentialsWindow makeKeyAndOrderFront:nil];
@ -264,14 +265,22 @@
[self setUsername:[fieldUsername stringValue]];
[self setPassword:[fieldPassword stringValue]];
}
*/
#pragma mark -
#pragma mark NSURLConnection Delegate Methods:
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
//NSLog(@"1.0.1");
/* NSAlert *alert = [[NSAlert alloc] init];
[alert setAlertStyle:NSCriticalAlertStyle];
[alert setMessageText:@"LOGIN MOFO"];
[alert setAccessoryView:credentialsView];
[alert layout];
*/
/*NSInteger button = *///[alert runModal];
return NO; // FIXME this need to return YES if an entry doesn't already exist in the keychain and the user will need to be prompted for credentials
}

Loading…
Cancel
Save