-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from benoitjadinon/master
added menu item to start simulator without selecting an app
- Loading branch information
Showing
8 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// SimulatorMenuItem.swift | ||
// OpenSim | ||
// | ||
// Created by Benoit Jadinon on 16/05/2019. | ||
// Copyright © 2019 Luo Sheng. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class SimulatorMenuItem: NSMenuItem { | ||
|
||
var runtime: Runtime! | ||
var device: Device! | ||
|
||
init(runtime: Runtime, device:Device) { | ||
self.runtime = runtime | ||
self.device = device | ||
|
||
let title = "\(UIConstants.strings.menuLaunchSimulatorButton) \(device.name) (\(runtime))" | ||
|
||
super.init(title: title, action: #selector(self.openSimulator(_:)), keyEquivalent: "") | ||
|
||
target = self | ||
|
||
// Default image | ||
//self.image = #imageLiteral(resourceName: "DefaultAppIcon").appIcon() | ||
} | ||
|
||
required init(coder decoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
@objc func openSimulator(_ sender: AnyObject) { | ||
self.device.launch() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters