Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.mm
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.mm	(revision 34191)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.mm	(revision 34192)
@@ -84,4 +84,9 @@
    CGImageRelease(pCGImage);
    return pNSImage;
+}
+
+NativeNSStringRef darwinToNativeString(const char* pcszString)
+{
+    return [NSString stringWithUTF8String: pcszString];
 }
 
@@ -138,4 +143,13 @@
 }
 
+void darwinMinaturizeWindow(NativeNSWindowRef pWindow)
+{
+//    [[NSApplication sharedApplication] miniaturizeAll];
+//    printf("bla\n");
+//    [pWindow miniaturize:pWindow];
+//    [[NSApplication sharedApplication] deactivate];
+//    [pWindow performMiniaturize:nil];
+}
+
 void darwinSetDockIconMenu(QMenu* pMenu)
 {
@@ -169,5 +183,85 @@
     windowFrame.origin.y -= h1;
 
-    [pWindow setFrame:windowFrame display:YES animate:YES];
+    [pWindow setFrame:windowFrame display:YES animate: YES];
+}
+
+void darwinWindowAnimateResizeNewImpl(NativeNSWindowRef pWindow, int height, bool fAnimate)
+{
+    /* It seems that Qt doesn't return the height of the window with the
+     * toolbar height included. So add this size manually. Could easily be that
+     * the Trolls fix this in the final release. */
+    NSToolbar *toolbar = [pWindow toolbar];
+    NSRect windowFrame = [pWindow frame];
+    int toolbarHeight = 0;
+    if(toolbar && [toolbar isVisible])
+        toolbarHeight = NSHeight(windowFrame) - NSHeight([[pWindow contentView] frame]);
+    int h = height + toolbarHeight;
+    int h1 = h - NSHeight(windowFrame);
+    windowFrame.size.height = h;
+    windowFrame.origin.y -= h1;
+
+    [pWindow setFrame:windowFrame display:YES animate: fAnimate ? YES : NO];
+}
+
+void darwinTest(NativeNSViewRef pViewOld, NativeNSViewRef pViewNew, int h)
+{
+    NSMutableDictionary *pDicts[3] = { nil, nil, nil };
+    int c = 0;
+
+    /* Scaling necessary? */
+    if (h != -1)
+    {
+        NSWindow *pWindow  = [(pViewOld ? pViewOld : pViewNew) window];
+        NSToolbar *toolbar = [pWindow toolbar];
+        NSRect windowFrame = [pWindow frame];
+        /* Dictionary containing all animation parameters. */
+        pDicts[c] = [NSMutableDictionary dictionaryWithCapacity:2];
+        /* Specify the animation target. */
+        [pDicts[c] setObject:pWindow forKey:NSViewAnimationTargetKey];
+        /* Scaling effect. */
+        [pDicts[c] setObject:[NSValue valueWithRect:windowFrame] forKey:NSViewAnimationStartFrameKey];
+        int toolbarHeight = 0;
+        if(toolbar && [toolbar isVisible])
+            toolbarHeight = NSHeight(windowFrame) - NSHeight([[pWindow contentView] frame]);
+        int h1 = h + toolbarHeight;
+        int h2 = h1 - NSHeight(windowFrame);
+        windowFrame.size.height = h1;
+        windowFrame.origin.y -= h2;
+        [pDicts[c] setObject:[NSValue valueWithRect:windowFrame] forKey:NSViewAnimationEndFrameKey];
+        ++c;
+    }
+    /* Fade out effect. */
+    if (pViewOld)
+    {
+        /* Dictionary containing all animation parameters. */
+        pDicts[c] = [NSMutableDictionary dictionaryWithCapacity:2];
+        /* Specify the animation target. */
+        [pDicts[c] setObject:pViewOld forKey:NSViewAnimationTargetKey];
+        /* Fade out effect. */
+        [pDicts[c] setObject:NSViewAnimationFadeOutEffect forKey:NSViewAnimationEffectKey];
+        ++c;
+    }
+    /* Fade in effect. */
+    if (pViewNew)
+    {
+        /* Dictionary containing all animation parameters. */
+        pDicts[c] = [NSMutableDictionary dictionaryWithCapacity:2];
+        /* Specify the animation target. */
+        [pDicts[c] setObject:pViewNew forKey:NSViewAnimationTargetKey];
+        /* Fade in effect. */
+        [pDicts[c] setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
+        ++c;
+    }
+    /* Create our animation object. */
+    NSViewAnimation *pAni = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:pDicts count:c]];
+    [pAni setDuration:.15];
+    [pAni setAnimationCurve:NSAnimationEaseIn];
+    [pAni setAnimationBlockingMode:NSAnimationBlocking];
+//    [pAni setAnimationBlockingMode:NSAnimationNonblockingThreaded];
+
+    /* Run the animation. */
+    [pAni startAnimation];
+    /* Cleanup */
+    [pAni release];
 }
 
@@ -203,4 +297,14 @@
 
     return fResult;
+}
+
+bool darwinShowFileInFinder(NativeNSStringRef pstrFile)
+{
+    return [[NSWorkspace sharedWorkspace] selectFile:pstrFile inFileViewerRootedAtPath:@""];
+}
+
+bool darwinOpenFile(NativeNSStringRef pstrFile)
+{
+    return [[NSWorkspace sharedWorkspace] openFile:pstrFile];
 }
 
@@ -252,4 +356,10 @@
     NSEventType  eEvtType = [pEvent type];
     bool         fGlobalHotkey = false;
+//
+//    if (   (eEvtType == NSKeyDown || eEvtType == NSKeyUp)
+//        && [[NSApp mainMenu] performKeyEquivalent:pEvent])
+//        return true;
+//    return false;
+//        && [[[NSApp mainMenu] delegate] menuHasKeyEquivalent:[NSApp mainMenu] forEvent:pEvent target:b action:a])
 
     switch (eEvtType)
@@ -266,5 +376,5 @@
                     || KeyCode == 0x04) /* CMD+H (Hide) */
                     fGlobalHotkey = true;
-            } 
+            }
             else if (   ((fEvtMask & (NX_NONCOALSESCEDMASK | NX_ALTERNATEMASK | NX_DEVICELALTKEYMASK | NX_COMMANDMASK | NX_DEVICELCMDKEYMASK)) == (NX_NONCOALSESCEDMASK | NX_ALTERNATEMASK | NX_DEVICELALTKEYMASK | NX_COMMANDMASK | NX_DEVICELCMDKEYMASK)) /* L+ALT+CMD */
                      || ((fEvtMask & (NX_NONCOALSESCEDMASK | NX_ALTERNATEMASK | NX_DEVICERCMDKEYMASK | NX_COMMANDMASK | NX_DEVICERCMDKEYMASK)) == (NX_NONCOALSESCEDMASK | NX_ALTERNATEMASK | NX_DEVICERCMDKEYMASK | NX_COMMANDMASK | NX_DEVICERCMDKEYMASK))) /* R+ALT+CMD */
@@ -280,2 +390,14 @@
 }
 
+void darwinRetranslateAppMenu()
+{
+    /* This is purely Qt internal. If the Trolls change something here, it will
+       not work anymore, but at least it will not be a burning man. */
+    if ([NSApp respondsToSelector:@selector(qt_qcocoamenuLoader)])
+    {
+        id loader = [NSApp performSelector:@selector(qt_qcocoamenuLoader)];
+        if ([loader respondsToSelector:@selector(qtTranslateApplicationMenu)])
+            [loader performSelector:@selector(qtTranslateApplicationMenu)];
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp	(revision 34191)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp	(revision 34192)
@@ -38,10 +38,14 @@
 NativeNSViewRef darwinToNativeView(QWidget *pWidget)
 {
-    return reinterpret_cast<NativeNSViewRef>(pWidget->winId());
+    if (pWidget)
+        return reinterpret_cast<NativeNSViewRef>(pWidget->winId());
+    return nil;
 }
 
 NativeNSWindowRef darwinToNativeWindow(QWidget *pWidget)
 {
-    return ::darwinToNativeWindowImpl(::darwinToNativeView(pWidget));
+    if (pWidget)
+        return ::darwinToNativeWindowImpl(::darwinToNativeView(pWidget));
+    return nil;
 }
 
@@ -81,4 +85,14 @@
 {
     ::darwinWindowAnimateResizeImpl(::darwinToNativeWindow(pWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
+}
+
+void darwinWindowAnimateResizeNew(QWidget *pWidget, int h, bool fAnimate)
+{
+    ::darwinWindowAnimateResizeNewImpl(::darwinToNativeWindow(pWidget), h, fAnimate);
+}
+
+void darwinTest(QWidget *pWidget1, QWidget *pWidget2, int h)
+{
+    ::darwinTest(::darwinToNativeView(pWidget1), ::darwinToNativeView(pWidget2), h);
 }
 
@@ -116,4 +130,19 @@
     return false;
 #endif /* !QT_MAC_USE_COCOA */
+}
+
+void darwinMinaturizeWindow(QWidget *pWidget)
+{
+    return ::darwinMinaturizeWindow(::darwinToNativeWindow(pWidget));
+}
+
+bool darwinShowFileInFinder(const QString& strFile)
+{
+    return ::darwinShowFileInFinder(darwinToNativeString(strFile.toUtf8().constData()));
+}
+
+bool darwinOpenFile(const QString& strFile)
+{
+    return ::darwinOpenFile(darwinToNativeString(strFile.toUtf8().constData()));
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h	(revision 34191)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h	(revision 34192)
@@ -31,4 +31,5 @@
 ADD_COCOA_NATIVE_REF(NSView);
 ADD_COCOA_NATIVE_REF(NSWindow);
+ADD_COCOA_NATIVE_REF(NSString);
 
 class QImage;
@@ -48,4 +49,5 @@
 NativeNSWindowRef darwinToNativeWindowImpl(NativeNSViewRef pView);
 NativeNSViewRef darwinToNativeViewImpl(NativeNSWindowRef pWindow);
+NativeNSStringRef darwinToNativeString(const char* pcszString);
 
 /********************************************************************************
@@ -60,4 +62,5 @@
 void darwinSetMouseCoalescingEnabled(bool fEnabled);
 
+void darwintest(NativeNSWindowRef pWindow);
 /********************************************************************************
  *
@@ -66,4 +69,6 @@
  ********************************************************************************/
 void darwinWindowAnimateResizeImpl(NativeNSWindowRef pWindow, int x, int y, int width, int height);
+void darwinWindowAnimateResizeNewImpl(NativeNSWindowRef pWindow, int height, bool fAnimate);
+void darwinTest(NativeNSViewRef pView, NativeNSViewRef pView1, int h);
 void darwinWindowInvalidateShapeImpl(NativeNSWindowRef pWindow);
 void darwinWindowInvalidateShadowImpl(NativeNSWindowRef pWindow);
@@ -71,4 +76,8 @@
 bool darwinIsToolbarVisible(NativeNSWindowRef pWindow);
 bool darwinIsWindowMaximized(NativeNSWindowRef pWindow);
+void darwinMinaturizeWindow(NativeNSWindowRef pWindow);
+
+bool darwinShowFileInFinder(NativeNSStringRef pstrFile);
+bool darwinOpenFile(NativeNSStringRef pstrFile);
 
 float darwinSmallFontSize();
@@ -80,4 +89,6 @@
 
 bool darwinIsApplicationCommand(ConstNativeNSEventRef pEvent);
+
+void darwinRetranslateAppMenu();
 
 RT_C_DECLS_END
@@ -168,4 +179,6 @@
 void darwinDisableIconsInMenus(void);
 
+void darwinTest(QWidget *pWidget1, QWidget *pWidget2, int h);
+
 /********************************************************************************
  *
@@ -174,4 +187,5 @@
  ********************************************************************************/
 void darwinWindowAnimateResize(QWidget *pWidget, const QRect &aTarget);
+void darwinWindowAnimateResizeNew(QWidget *pWidget, int h, bool fAnimate);
 void darwinWindowInvalidateShape(QWidget *pWidget);
 void darwinWindowInvalidateShadow(QWidget *pWidget);
@@ -179,4 +193,9 @@
 bool darwinIsToolbarVisible(QToolBar *pToolBar);
 bool darwinIsWindowMaximized(QWidget *pWidget);
+void darwinMinaturizeWindow(QWidget *pWidget);
+
+bool darwinShowFileInFinder(const QString &strFile);
+bool darwinOpenFile(const QString &strFile);
+
 QString darwinSystemLanguage(void);
 QPixmap darwinCreateDragPixmap(const QPixmap& aPixmap, const QString &aText);
