<commit_before>import Cocoa
import SafariServices.SFSafariApplication

class ViewController: NSViewController {

    @IBOutlet var appNameLabel: NSTextField!
    @IBOutlet var extensionStatus: NSTextField!
    @IBOutlet var spinner: NSProgressIndicator!
    
    func refreshExtensionStatus () {
        self.spinner.startAnimation(self)
        self.extensionStatus.stringValue = "Checking extension status"
        
        if SFSafariServicesAvailable() {
            SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: "net.televator.Vimari.Extension") {
                (state, error) in
//                print(state as Any, error as Any, state?.isEnabled as Any)
                
                DispatchQueue.main.async {
                    // TODO: handle this getting updated in the Safari preferences too.
                    if let state = state {
                        if state.isEnabled {
                            self.extensionStatus.stringValue = "enabled"
                        } else {
                            self.extensionStatus.stringValue = "disabled"
                        }
                    }
                    self.spinner.stopAnimation(self)
                }
            }
        } else {
            self.extensionStatus.stringValue = "Unavailable, Vimari requires Safari 10 or greater."
            self.spinner.stopAnimation(self)
        }
    }
    
    @IBAction func refreshButton(_ sender: NSButton) {
        refreshExtensionStatus()
    }
    
    override func viewDidLoad() {
        super.viewDidLoad();
        self.appNameLabel.stringValue = "Vimari";
        
        
        refreshExtensionStatus();
    }
    
    @IBAction func openSafariExtensionPreferences(_ sender: AnyObject?) {
        SFSafariApplication.showPreferencesForExtension(withIdentifier: "net.televator.Vimari.Extension") { error in
            if let _ = error {
                // Insert code to inform the user that something went wrong.

            }
        }
    }<commit_msg>Fix view controller correct bundle ID after rename<commit_after>import Cocoa
import SafariServices.SFSafariApplication

class ViewController: NSViewController {

    @IBOutlet var appNameLabel: NSTextField!
    @IBOutlet var extensionStatus: NSTextField!
    @IBOutlet var spinner: NSProgressIndicator!
    
    func refreshExtensionStatus () {
        NSLog("Refreshing extension status")
        self.spinner.startAnimation(self)
        self.extensionStatus.stringValue = "Checking extension status"
        
        if SFSafariServicesAvailable() {
            SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: "net.televator.Vimari.SafariExtension") {
                (state, error) in
                print("State", state as Any, "Error", error as Any, state?.isEnabled as Any)
                
                DispatchQueue.main.async {
                    // TODO: handle this getting updated in the Safari preferences too.
                    if let state = state {
                        if state.isEnabled {
                            self.extensionStatus.stringValue = "Enabled"
                        } else {
                            self.extensionStatus.stringValue = "Disabled"
                        }
                    }
                    if let error = error {
                        NSLog("Error", error.localizedDescription)
                        self.extensionStatus.stringValue = error.localizedDescription
                    }
                    self.spinner.stopAnimation(self)
                }
            }
        } else {
            NSLog("SFSafariServices not available")
            self.extensionStatus.stringValue = "Unavailable, Vimari requires Safari 10 or greater."
            self.spinner.stopAnimation(self)
        }
    }
    
    @IBAction func refreshButton(_ sender: NSButton) {
        refreshExtensionStatus()
    }
    
    override func viewDidLoad() {
        super.viewDidLoad();
        self.appNameLabel.stringValue = "Vimari";
        
        
        refreshExtensionStatus();
    }
    
    @IBAction func openSafariExtensionPreferences(_ sender: AnyObject?) {
        SFSafariApplication.showPreferencesForExtension(withIdentifier: "net.televator.Vimari.SafariExtension") { error in
            if let _ = error {
                // Insert code to inform the user that something went wrong.

            }
        }
    }
{'fraction_non_alphanumeric': 0.07130004498425552, 'fraction_numerical': 0.000899685110211426, 'mean_word_length': 1.7315724815724816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4862811', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1063, 'n_words': 243}