#include "OSXUtils.h"
#import <Cocoa/Cocoa.h>

/////////////////////////////////////////////////////////////////////////////////////////
void OSXUtils::SetMenuBarVisible(bool visible)
{
  if(visible)
  {
    [[NSApplication sharedApplication]
      setPresentationOptions:   NSApplicationPresentationDefault];
  }
  else
  {
    [[NSApplication sharedApplication]
      setPresentationOptions:   NSApplicationPresentationHideMenuBar |
                                NSApplicationPresentationHideDock];
  }
}

/////////////////////////////////////////////////////////////////////////////////////////
QString OSXUtils::computerName()
{
  return QString::fromNSString([[NSHost currentHost] localizedName]);
}
