Skip to content

Commit

Permalink
Fix the issue of the window can‘t be recovered after clicking the sta…
Browse files Browse the repository at this point in the history
…tus bar icon.
  • Loading branch information
Zhou-Haowei committed May 2, 2017
1 parent 9e04197 commit 895abd5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 33 deletions.
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ SGUDrcomGUI 开发的初衷是为了提供另一种途径,使大家能更加

- Mac OS 版 SGUDrcomGUI-MacOS使用 XCode 8.2.1 开发,语言为 C++(包括C++ 11的部分特性)和 Objective-C。

- 可以通过Clone或者Download Zip获取本项目,生成的程序在Production文件夹当中。

- 经过短暂的测试,借助于[**SguDrcomClient**](https://github.com/laijingwu/sgu_drcom_client)核心,解决了拨号协议的心跳问题,能保持在线,最长达到5小时,但由于测试时间较短,部分系统兼容性和软件健壮性不一定符合预期,希望在使用之后有问题的可以进行反映,有兴趣的同学也可以前来交流。

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,21 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SGUDrcomGUI/AppDelegate.mm"
timestampString = "515397538.692218"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
landmarkName = "-applicationDidFinishLaunching:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
17 changes: 1 addition & 16 deletions SGUDrcomGUI/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/**
* Reconstructed:
*
* Copyright (C) 2017 Steven
*
Expand All @@ -14,21 +13,6 @@
* Everyone is permitted to copy and distribute verbatim copies of this license document.
* Changing it is not allowed.
*
*
*
* Copyright (C) 2015 Shindo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
Expand Down Expand Up @@ -82,6 +66,7 @@ typedef NSInteger ConnectionMode;

- (void) alertFetchNICListFailed:(NSAlert*)alert returnCode:(NSInteger)returnCode contextInfo:(void*)contextInfo;
- (void) alertQuitApplication:(NSAlert*)alert returnCode:(NSInteger)returnCode contextInfo:(void*)contextInfo;
- (void) openWindow:(id)sender;

- (void) updateOnlineTime;

Expand Down
24 changes: 7 additions & 17 deletions SGUDrcomGUI/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/**
* Reconstructed:
*
* Copyright (C) 2017 Steven
*
Expand All @@ -14,21 +13,6 @@
* Everyone is permitted to copy and distribute verbatim copies of this license document.
* Changing it is not allowed.
*
*
*
* Copyright (C) 2015 Shindo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


Expand Down Expand Up @@ -69,7 +53,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
statusIcon = [[NSStatusBar systemStatusBar]statusItemWithLength:NSVariableStatusItemLength];
[statusIcon setImage:[NSImage imageNamed:@"offline"]];
[statusIcon setHighlightMode:YES];
statusIcon.target = self;
statusIcon.button.target = self;
statusIcon.button.action = @selector(openWindow:);


// load nics
Expand Down Expand Up @@ -176,6 +161,11 @@ - (BOOL) windowShouldClose:(id)sender
return NO;
}

- (void)openWindow:(id)sender {
NSWindow *window = [self window]; // Get the window to open
[window makeKeyAndOrderFront:nil];
}

- (IBAction) connectClicked:(id)sender
{
NSString *btnValue = [self.btnConnect title];
Expand Down

0 comments on commit 895abd5

Please sign in to comment.