<commit_before>//
//  Discovery view controller
//
//  Copyright © 2015 <NAME>. All rights reserved.
//  License: MIT
//

import UIKit

class DiscoverDesktopViewController : UIViewController {
    @IBOutlet var statusIndicator: UILabel!
    @IBOutlet var skipButton: UIBarButtonItem!

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        trackView("DiscoverDesktopViewController")
        setHideIntroView()

        NSNotificationCenter.defaultCenter().addObserver(self, selector: "connectionEstablished:", name: "AppConnectionEstablished", object: nil)
        Discover.sharedInstance.startSearch()
    }

    override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated)

        NSNotificationCenter.defaultCenter().removeObserver(self)
    }

    func connectionEstablished(notification : NSNotification) {
        trackEvent("Connection", action: "Established", label: nil, value: nil)

        skipButton.enabled = false
        let name = notification.userInfo!["name"]!
        statusIndicator.text = String.localizedStringWithFormat(
            NSLocalizedString("Found %@", comment: "When a desktop computer has been found, this text is displayed on screen."),
            [name])
        NSTimer.scheduledTimerWithTimeInterval(0.8, target: self, selector: "showScansView:", userInfo: nil, repeats: false)
    }

    func showScansView(sender: DiscoverDesktopViewController) {
        performSegueWithIdentifier("showScansView", sender: self)<commit_msg>Fix variadic argument for localize of found desktop app<commit_after>//
//  Discovery view controller
//
//  Copyright © 2015 <NAME>. All rights reserved.
//  License: MIT
//

import UIKit

class DiscoverDesktopViewController : UIViewController {
    @IBOutlet var statusIndicator: UILabel!
    @IBOutlet var skipButton: UIBarButtonItem!

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        trackView("DiscoverDesktopViewController")
        setHideIntroView()

        NSNotificationCenter.defaultCenter().addObserver(self, selector: "connectionEstablished:", name: "AppConnectionEstablished", object: nil)
        Discover.sharedInstance.startSearch()
    }

    override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated)

        NSNotificationCenter.defaultCenter().removeObserver(self)
    }

    func connectionEstablished(notification : NSNotification) {
        trackEvent("Connection", action: "Established", label: nil, value: nil)

        skipButton.enabled = false
        let name = String(notification.userInfo!["name"]!)
        statusIndicator.text = String(
            format: NSLocalizedString("Found %@",
                comment: "When a desktop computer has been found, this text is displayed on screen."),
            locale: NSLocale.currentLocale(),
            arguments: [name as CVarArgType]
        )
        NSTimer.scheduledTimerWithTimeInterval(0.8, target: self, selector: "showScansView:", userInfo: nil, repeats: false)
    }

    func showScansView(sender: DiscoverDesktopViewController) {
        performSegueWithIdentifier("showScansView", sender: self)
{'fraction_non_alphanumeric': 0.09586056644880174, 'fraction_numerical': 0.003734827264239029, 'mean_word_length': 3.6579710144927535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4429973', 'n_tokens_mistral': 889, 'n_tokens_neox': 843, 'n_words': 203}