Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Serghei Moret committed Nov 9, 2017
2 parents c86658a + fa403ab commit 7dd51e5
Show file tree
Hide file tree
Showing 30 changed files with 262 additions and 47 deletions.
4 changes: 4 additions & 0 deletions Calabash Launcher.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
D7DDE9AC1FA92DBA0083D00E /* CommandsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7DDE9AB1FA92DBA0083D00E /* CommandsController.swift */; };
D7E21B4A1F969FDD0044169A /* Localization.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7E21B491F969FDD0044169A /* Localization.swift */; };
D7E21B4C1F96B0470044169A /* RegexHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7E21B4B1F96B0470044169A /* RegexHandler.swift */; };
D7E995B81FAFB1D600318741 /* check_sim_type.command in Resources */ = {isa = PBXBuildFile; fileRef = D7E995B71FAFB1D600318741 /* check_sim_type.command */; };
ED06A0E21E850CA70092C96E /* BashOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED06A0E11E850CA70092C96E /* BashOutput.swift */; };
ED1762E01F975B7000C84290 /* CommandsCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1762DC1F975B4500C84290 /* CommandsCore.framework */; };
ED1762E11F975B7000C84290 /* CommandsCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ED1762DC1F975B4500C84290 /* CommandsCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -88,6 +89,7 @@
D7DDE9AB1FA92DBA0083D00E /* CommandsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandsController.swift; sourceTree = "<group>"; };
D7E21B491F969FDD0044169A /* Localization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localization.swift; sourceTree = "<group>"; };
D7E21B4B1F96B0470044169A /* RegexHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegexHandler.swift; sourceTree = "<group>"; };
D7E995B71FAFB1D600318741 /* check_sim_type.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = check_sim_type.command; sourceTree = "<group>"; };
ED06A0E11E850CA70092C96E /* BashOutput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BashOutput.swift; sourceTree = "<group>"; };
ED1762DC1F975B4500C84290 /* CommandsCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CommandsCore.framework; sourceTree = "<group>"; };
ED2183DA1F8D0B5800E59DCC /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -221,6 +223,7 @@
EDD303941F8F86B00042E27F /* bash */ = {
isa = PBXGroup;
children = (
D7E995B71FAFB1D600318741 /* check_sim_type.command */,
ED7278951FA78E050022505E /* app_download.command */,
ED85D2EC1F94D8A000E5E2D8 /* change_sim_language.command */,
ED9472951E37BD3E00FE2982 /* get_uniq_elements.command */,
Expand Down Expand Up @@ -377,6 +380,7 @@
EDEBE3861E0BD2D60069B9BC /* clicked_2.png in Resources */,
EDC06B7C1DB40E7800379878 /* get_tags.command in Resources */,
ED4C14E81DB29FB700A1190E /* Main.storyboard in Resources */,
D7E995B81FAFB1D600318741 /* check_sim_type.command in Resources */,
ED4C14F01DB2A10E00A1190E /* BuildScript.command in Resources */,
EDBC88071DFEE8A6004CB840 /* kill_process.command in Resources */,
D74D80851F97F7BA0049A84F /* click_image.png in Resources */,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2017 Serghei Moret
Copyright (c) 2017 XING SE

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 10 additions & 10 deletions Launcher/Assets/Asset.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,61 @@
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "16.png",
"filename" : "LauncherIcon16_1.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "32 copy.png",
"filename" : "LauncherIcon16_2.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "32.png",
"filename" : "LauncherIcon32_1.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "rsz_128.png",
"filename" : "LauncherIcon32_2.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "128.png",
"filename" : "LauncherIcon128_1.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "256 copy.png",
"filename" : "LauncherIcon128_2.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "256.png",
"filename" : "LauncherIcon256_1.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "512 copy.png",
"filename" : "LauncherIcon256_2.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "512.png",
"filename" : "LauncherIcon512_1.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "Prerelease-Icon-1024.png",
"filename" : "LauncherIcon512_2.png",
"scale" : "2x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions Launcher/Classes/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum Constants {
static let killProcess = main.path(forResource: "kill_process", ofType: .bash)
static let flash = main.path(forResource: "flash", ofType: .bash)
static let appDownload = main.path(forResource: "app_download", ofType: .bash)
static let checkSimulatorType = main.path(forResource: "check_sim_type", ofType: .bash)

// Interactive Ruby Shell
static let createIRBSession = main.path(forResource: "create_irb_session", ofType: .bash)
Expand Down
20 changes: 20 additions & 0 deletions Launcher/Classes/Controllers/CommandsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,24 @@ class CommandsController {
CommandExecutor(launchPath: launchPath,arguments: [url.absoluteString, filePath], outputStream: outputStream).execute()
}
}

var isSimulatorCorrect: Bool {
guard let launchPath = Constants.FilePaths.Bash.checkSimulatorType else { return false }
let outputStream = CommandTextOutputStream()

var result = false
outputStream.textHandler = { text in
guard !text.isEmpty else { return }

if text == "Wrong device\n" {
result = false
} else {
result = true
}
}

CommandExecutor(launchPath: launchPath,arguments: [], outputStream: outputStream).execute()

return result
}
}
15 changes: 14 additions & 1 deletion Launcher/Classes/ViewControllers/InspectorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CommandsCore
class InspectorViewController: NSViewController, NSTableViewDataSource {
let applicationStateHandler = ApplicationStateHandler()
var textViewPrinter: TextViewPrinter!
let commandsController = CommandsController()
@objc dynamic var isRunning = false
let fileManager = FileManager.default
var uiElements: [String] = []
Expand Down Expand Up @@ -64,6 +65,7 @@ class InspectorViewController: NSViewController, NSTableViewDataSource {

override func viewDidLoad() {
super.viewDidLoad()
outputText.alignment = NSTextAlignment.left
gestureRecognizableView.addGestureRecognizer(gestureRecognizer)
coordinatesMarker.isHidden = true
self.getElementsButton.isEnabled = true
Expand All @@ -80,6 +82,15 @@ class InspectorViewController: NSViewController, NSTableViewDataSource {
}

@IBAction func gestureRecognizer(_ sender: Any) {
// Show dialog window if booted Simulator is incorrect (should be iPhone 6,7 or 8).
DispatchQueue.global(qos: .background).async {
guard let controller = self.storyboard?.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "wrongSimulatorWindow")) as? NSViewController,
!self.commandsController.isSimulatorCorrect else { return }
DispatchQueue.main.async {
self.presentViewControllerAsModalWindow(controller)
}
}

if gestureRecognizableView.accessibilityLabel() == "defaultImage" {
timer.invalidate()
coordinatesMarker.isHidden = true
Expand Down Expand Up @@ -292,7 +303,9 @@ class InspectorViewController: NSViewController, NSTableViewDataSource {
}

func stopImageRefresh() {
self.gestureRecognizableView.image = NSImage(named: NSImage.Name(rawValue: "click_image.png"))
DispatchQueue.main.async {
self.gestureRecognizableView.image = #imageLiteral(resourceName: "click_image.png")
}
self.gestureRecognizableView.setAccessibilityLabel("defaultImage")
timer.invalidate()
}
Expand Down
2 changes: 1 addition & 1 deletion Launcher/Classes/ViewControllers/TasksViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TasksViewController: NSViewController {

override func viewDidAppear() {
super.viewDidAppear()
textField.backgroundColor = .darkAquamarine
textField.backgroundColor = .darkGray
textField.textColor = .white
let placeholderText = NSMutableAttributedString(string: "Console Input (Beta)")
placeholderText.setAttributes([.foregroundColor: NSColor.lightGray], range: NSRange(location: 0, length: "Console Input (Beta)".count))
Expand Down
Loading

0 comments on commit 7dd51e5

Please sign in to comment.