Ignore:
Timestamp:
Oct 11, 2018 5:02:42 PM (20 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
8e988c39
Parents:
96d31995
Message:

OSX Launcher: Swift GUI code updates, most related to the new launch method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/I2PLauncher/userinterface/StatusBarController.swift

    r96d31995 re3ab9f8e  
    1616  let storyboard = NSStoryboard(name: "Storyboard", bundle: Bundle.main)
    1717 
    18   var updateObjectRef : SUUpdater?
     18  var ctrl : PopoverViewController?
     19
     20  @IBOutlet var routerStatusTabView: RouterStatusView?
     21 
     22  //var updateObjectRef : SUUpdater?
    1923 
    2024  @objc func handleOpenConsole(_ sender: Any?) {
     
    2529    let menu = NSMenu()
    2630   
    27     let updateMenuItem = NSMenuItem(title: "Check for updates", action: #selector(self.updateObjectRef?.checkForUpdates(_:)), keyEquivalent: "U")
     31    /*let updateMenuItem = NSMenuItem(title: "Check for updates", action: #selector(self.updateObjectRef?.checkForUpdates(_:)), keyEquivalent: "U")
    2832    updateMenuItem.isEnabled = true
    29    
     33    */
    3034    menu.addItem(NSMenuItem(title: "Open I2P Console", action: #selector(self.handleOpenConsole(_:)), keyEquivalent: "O"))
    3135    menu.addItem(NSMenuItem.separator())
    32     menu.addItem(updateMenuItem)
     36    //menu.addItem(updateMenuItem)
    3337    menu.addItem(NSMenuItem.separator())
    3438    menu.addItem(NSMenuItem(title: "Quit I2P Launcher", action: #selector(SwiftMainDelegate.terminate(_:)), keyEquivalent: "q"))
     
    3640    return menu
    3741  }
     42 
     43  func pidReaction(information:Any?){
     44    let pidStr = information as! String
     45    NSLog("PID! %@", pidStr)
     46    showPopover(sender: nil)
     47    //self.ctrl?.getRouterStatusView()?.handlerRouterStart(information: pidStr)
     48    self.ctrl?.getRouterStatusView()?.needsDisplay = true
     49  }
    3850
    3951 
    4052  override init() {
    4153    super.init()
    42     popover.contentViewController = PopoverViewController.freshController()
    43     updateObjectRef = SUUpdater.shared()
    44     updateObjectRef?.checkForUpdatesInBackground()
     54    self.ctrl = PopoverViewController.freshController()
     55    popover.contentViewController = self.ctrl
     56    //updateObjectRef = SUUpdater.shared()
     57    //updateObjectRef?.checkForUpdatesInBackground()
     58   RouterManager.shared().eventManager.listenTo(eventName: "router_pid", action: pidReaction)
    4559   
    4660   
     
    101115      closePopover(sender: sender)
    102116    } else {
    103       RouterManager.shared().updateState()
    104117      showPopover(sender: sender)
    105118    }
Note: See TracChangeset for help on using the changeset viewer.