Changeset 34275 in vbox
- Timestamp:
- Nov 23, 2010 11:08:52 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68023
- Location:
- trunk/src/VBox
- Files:
-
- 66 added
- 13 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r34063 r34275 855 855 src/darwin/PkgInfo \ 856 856 $(PATH_VirtualBox.app)/Info.plist \ 857 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns 857 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns \ 858 $(PATH_ROOT)/src/VBox/Resources/darwin/virtualbox-vbox.icns=>Resources/virtualbox-vbox.icns \ 859 $(PATH_ROOT)/src/VBox/Resources/darwin/virtualbox-vbox-extpack.icns=>Resources/virtualbox-vbox-extpack.icns \ 860 $(PATH_ROOT)/src/VBox/Resources/darwin/virtualbox-ovf.icns=>Resources/virtualbox-ovf.icns \ 861 $(PATH_ROOT)/src/VBox/Resources/darwin/virtualbox-ova.icns=>Resources/virtualbox-ova.icns 858 862 859 863 $$(PATH_VirtualBox.app)/Info.plist: $(PATH_SUB_CURRENT)/src/darwin/Info.plist $(VBOX_VERSION_MK) | $$(@D)/ … … 882 886 $$(PATH_VirtualBoxVM.app)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(@D)/ 883 887 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@) 888 $(QUIET)$(RM) -f $@ 889 $(QUIET)$(SED) \ 890 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ 891 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ 892 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ 893 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ 894 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ 895 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ 896 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ 897 --output $@ $< 898 899 PROGRAMS += vmstarter 900 vmstarter_TEMPLATE = VBOXR3EXE 901 vmstarter_SOURCES = src/darwin/vmstarter.mm 902 vmstarter_LDFLAGS += -framework AppKit 903 vmstarter_INST = $(INST_BIN)vmstarter 904 905 INSTALLS += vmstarter.app 906 vmstarter.app_INST = $(VirtualBox.app_INST)Resources/vmstarter.app/Contents 907 vmstarter.app_MODE = 644 908 vmstarter.app_SOURCES = \ 909 src/darwin/vmstarter-PkgInfo=>PkgInfo \ 910 $(PATH_vmstarter.app)/vmstarter-Info.plist=>Info.plist 911 vmstarter.app_SYMLINKS = \ 912 MacOS=>../../../MacOS \ 913 Resources=>../../../Resources 914 915 $$(PATH_vmstarter.app)/vmstarter-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/vmstarter-Info.plist $(VBOX_VERSION_MK) | $$(@D)/ 916 $(call MSG_GENERATE,vmstarter.app,$<,$@) 884 917 $(QUIET)$(RM) -f $@ 885 918 $(QUIET)$(SED) \ -
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r34189 r34275 7 7 <file alias="vm_discard_32px.png">images/vm_discard_32px.png</file> 8 8 <file alias="vm_discard_disabled_32px.png">images/vm_discard_disabled_32px.png</file> 9 <file alias="vm_add_ 32px.png">images/vm_add_32px.png</file>9 <file alias="vm_add_16px.png">images/vm_add_16px.png</file> 10 10 <file alias="vm_new_32px.png">images/vm_new_32px.png</file> 11 11 <file alias="vm_new_disabled_32px.png">images/vm_new_disabled_32px.png</file> -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/Info.plist
r33969 r34275 14 14 <key>CFBundleIconFile</key> <string>virtualbox</string> 15 15 <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> 16 <key>LSCanProvideIMVideoDataSource</key> <true/> 16 <key>LSCanProvideIMVideoDataSource</key> <false/> 17 <key>CFBundleDocumentTypes</key> 18 <array> 19 <dict> 20 <key>CFBundleTypeName</key> <string>VirtualBox Extension Pack</string> 21 <key>CFBundleTypeExtensions</key> <array><string>vbox-extpack</string></array> 22 <key>CFBundleTypeRole</key> <string>None</string> 23 <key>CFBundleTypeIconFile</key> <string>virtualbox-vbox-extpack</string> 24 </dict> 25 <dict> 26 <key>CFBundleTypeName</key> <string>Open Virtualization Format</string> 27 <key>CFBundleTypeExtensions</key> <array><string>ovf</string></array> 28 <key>CFBundleTypeRole</key> <string>Viewer</string> 29 <key>CFBundleTypeIconFile</key> <string>virtualbox-ovf</string> 30 </dict> 31 <dict> 32 <key>CFBundleTypeName</key> <string>Open Virtualization Format Archive</string> 33 <key>CFBundleTypeExtensions</key> <array><string>ova</string></array> 34 <key>CFBundleTypeRole</key> <string>Viewer</string> 35 <key>CFBundleTypeIconFile</key> <string>virtualbox-ova</string> 36 </dict> 37 </array> 17 38 </dict> 18 39 </plist> -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r34192 r34275 348 348 QPoint local = pWin->mapFromGlobal(global); 349 349 qApp->postEvent(pWin, new QContextMenuEvent(QContextMenuEvent::Mouse, local, global)); 350 } 351 352 QString darwinResolveAlias(const QString &strFile) 353 { 354 OSErr err = noErr; 355 FSRef fileRef; 356 QString strTarget; 357 do 358 { 359 Boolean fDir; 360 if ((err = FSPathMakeRef((const UInt8*)strFile.toUtf8().constData(), &fileRef, &fDir)) != noErr) 361 break; 362 Boolean fAlias = FALSE; 363 if ((err = FSIsAliasFile(&fileRef, &fAlias, &fDir)) != noErr) 364 break; 365 if (fAlias == TRUE) 366 { 367 if ((err = FSResolveAliasFile(&fileRef, TRUE, &fAlias, &fDir)) != noErr) 368 break; 369 char pszPath[1024]; 370 if ((err = FSRefMakePath(&fileRef, (UInt8*)pszPath, 1024)) != noErr) 371 break; 372 strTarget = QString::fromUtf8(pszPath); 373 }else 374 strTarget = strFile; 375 }while(0); 376 377 return strTarget; 350 378 } 351 379 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h
r34192 r34275 92 92 void darwinRetranslateAppMenu(); 93 93 94 QString darwinResolveAlias(const QString &strFile); 95 94 96 RT_C_DECLS_END 95 97 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/vmstarter-Info.plist
r34188 r34275 4 4 <dict> 5 5 <key>CFBundlePackageType</key> <string>APPL</string> 6 <key>CFBundleSignature</key> <string>V BOX</string>6 <key>CFBundleSignature</key> <string>VMST</string> 7 7 <key>CFBundleDevelopmentRegion</key> <string>English</string> 8 <key>CFBundleIdentifier</key> <string>org.virtualbox.app. VirtualBox</string>9 <key>CFBundleName</key> <string> VirtualBox</string>10 <key>CFBundleExecutable</key> <string> VirtualBox</string>8 <key>CFBundleIdentifier</key> <string>org.virtualbox.app.vmstarter</string> 9 <key>CFBundleName</key> <string>vmstarter</string> 10 <key>CFBundleExecutable</key> <string>vmstarter</string> 11 11 <key>CFBundleVersion</key> <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string> 12 12 <key>CFBundleShortVersionString</key> <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string> 13 <key>CFBundleGetInfoString</key> <string>@VBOX_PRODUCT@ Manager @VBOX_VERSION_STRING@, © 2007-@VBOX_C_YEAR@ @VBOX_VENDOR@</string>13 <key>CFBundleGetInfoString</key> <string>@VBOX_PRODUCT@ vmstarter @VBOX_VERSION_STRING@, © 2007-@VBOX_C_YEAR@ @VBOX_VENDOR@</string> 14 14 <key>CFBundleIconFile</key> <string>virtualbox</string> 15 15 <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> 16 <key>LSCanProvideIMVideoDataSource</key> <true/> 16 <key>LSUIElement</key> <true/> 17 <key>CFBundleDocumentTypes</key> 18 <array> 19 <dict> 20 <key>CFBundleTypeName</key> <string>VirtualBox Machine Description</string> 21 <key>CFBundleTypeExtensions</key> <array><string>vbox</string></array> 22 <key>CFBundleTypeRole</key> <string>Editor</string> 23 <key>LSHandlerRank</key> <string>Owner</string> 24 <key>CFBundleTypeIconFile</key> <string>virtualbox-vbox</string> 25 </dict> 26 </array> 17 27 </dict> 18 28 </plist> -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/vmstarter-PkgInfo
r34188 r34275 1 APPLVB VM1 APPLVBST -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r34193 r34275 4609 4609 // Private members 4610 4610 //////////////////////////////////////////////////////////////////////////////// 4611 4612 bool VBoxGlobal::processArgs() 4613 { 4614 bool fResult = false; 4615 QStringList args = qApp->arguments(); 4616 QList<QUrl> list; 4617 for (int i = 1; i < args.size(); ++i) 4618 { 4619 #ifdef Q_WS_MAC 4620 QString strArg = ::darwinResolveAlias(args.at(i)); 4621 #else /* Q_WS_MAC */ 4622 QString strArg = args.at(i); 4623 #endif /* !Q_WS_MAC */ 4624 if ( !strArg.isEmpty() 4625 && !strArg.startsWith("-") 4626 && QFile::exists(strArg)) 4627 list << QUrl(strArg); 4628 } 4629 if (!list.isEmpty()) 4630 { 4631 for (int i = 0; i < list.size(); ++i) 4632 { 4633 const QString& strFile = list.at(i).toLocalFile(); 4634 if (VBoxGlobal::hasAllowedExtension(strFile, VBoxDefs::VBoxFileExts)) 4635 { 4636 CVirtualBox vbox = vboxGlobal().virtualBox(); 4637 CMachine machine = vbox.FindMachine(strFile); 4638 if (!machine.isNull()) 4639 { 4640 fResult = true; 4641 launchMachine(machine); 4642 /* Remove from the arg list. */ 4643 list.removeAll(strFile); 4644 } 4645 } 4646 } 4647 } 4648 if (!list.isEmpty()) 4649 { 4650 m_ArgUrlList = list; 4651 QTimer::singleShot(0, &vboxGlobal().selectorWnd(), SLOT(sltOpenUrls())); 4652 } 4653 return fResult; 4654 } 4611 4655 4612 4656 void VBoxGlobal::init() … … 5367 5411 } 5368 5412 5413 bool VBoxGlobal::switchToMachine(CMachine &machine) 5414 { 5415 #ifdef Q_WS_MAC 5416 ULONG64 id = machine.ShowConsoleWindow(); 5417 #else 5418 WId id = (WId) machine.ShowConsoleWindow(); 5419 #endif 5420 AssertWrapperOk(machine); 5421 if (!machine.isOk()) 5422 return false; 5423 5424 /* winId = 0 it means the console window has already done everything 5425 * necessary to implement the "show window" semantics. */ 5426 if (id == 0) 5427 return true; 5428 5429 #if defined (Q_WS_WIN32) || defined (Q_WS_X11) 5430 5431 return vboxGlobal().activateWindow(id, true); 5432 5433 #elif defined (Q_WS_MAC) 5434 /* 5435 * This is just for the case were the other process cannot steal 5436 * the focus from us. It will send us a PSN so we can try. 5437 */ 5438 ProcessSerialNumber psn; 5439 psn.highLongOfPSN = id >> 32; 5440 psn.lowLongOfPSN = (UInt32)id; 5441 OSErr rc = ::SetFrontProcess(&psn); 5442 if (!rc) 5443 Log(("GUI: %#RX64 couldn't do SetFrontProcess on itself, the selector (we) had to do it...\n", id)); 5444 else 5445 Log(("GUI: Failed to bring %#RX64 to front. rc=%#x\n", id, rc)); 5446 return !rc; 5447 5448 #endif 5449 5450 return false; 5451 5452 /// @todo Below is the old method of switching to the console window 5453 // based on the process ID of the console process. It should go away 5454 // after the new (callback-based) method is fully tested. 5455 #if 0 5456 5457 if (!canSwitchTo()) 5458 return false; 5459 5460 #if defined (Q_WS_WIN32) 5461 5462 HWND hwnd = mWinId; 5463 5464 /* if there are blockers (modal and modeless dialogs, etc), find the 5465 * topmost one */ 5466 HWND hwndAbove = NULL; 5467 do 5468 { 5469 hwndAbove = GetNextWindow(hwnd, GW_HWNDPREV); 5470 HWND hwndOwner; 5471 if (hwndAbove != NULL && 5472 ((hwndOwner = GetWindow(hwndAbove, GW_OWNER)) == hwnd || 5473 hwndOwner == hwndAbove)) 5474 hwnd = hwndAbove; 5475 else 5476 break; 5477 } 5478 while (1); 5479 5480 /* first, check that the primary window is visible */ 5481 if (IsIconic(mWinId)) 5482 ShowWindow(mWinId, SW_RESTORE); 5483 else if (!IsWindowVisible(mWinId)) 5484 ShowWindow(mWinId, SW_SHOW); 5485 5486 #if 0 5487 LogFlowFunc(("mWinId=%08X hwnd=%08X\n", mWinId, hwnd)); 5488 #endif 5489 5490 /* then, activate the topmost in the group */ 5491 AllowSetForegroundWindow(m_pid); 5492 SetForegroundWindow(hwnd); 5493 5494 return true; 5495 5496 #elif defined (Q_WS_X11) 5497 5498 return false; 5499 5500 #elif defined (Q_WS_MAC) 5501 5502 ProcessSerialNumber psn; 5503 OSStatus rc = ::GetProcessForPID(m_pid, &psn); 5504 if (!rc) 5505 { 5506 rc = ::SetFrontProcess(&psn); 5507 5508 if (!rc) 5509 { 5510 ShowHideProcess(&psn, true); 5511 return true; 5512 } 5513 } 5514 return false; 5515 5516 #else 5517 5518 return false; 5519 5520 #endif 5521 5522 #endif 5523 } 5524 5525 bool VBoxGlobal::launchMachine(CMachine &machine) 5526 { 5527 if (machine.CanShowConsoleWindow()) 5528 return VBoxGlobal::switchToMachine(machine); 5529 5530 KMachineState state = machine.GetState(); 5531 AssertMsg( state == KMachineState_PoweredOff 5532 || state == KMachineState_Saved 5533 || state == KMachineState_Teleported 5534 || state == KMachineState_Aborted 5535 , ("Machine must be PoweredOff/Saved/Aborted (%d)", state)); 5536 5537 CVirtualBox vbox = vboxGlobal().virtualBox(); 5538 CSession session; 5539 session.createInstance(CLSID_Session); 5540 if (session.isNull()) 5541 { 5542 vboxProblem().cannotOpenSession(session); 5543 return false; 5544 } 5545 5546 #if defined(Q_OS_WIN32) 5547 /* allow the started VM process to make itself the foreground window */ 5548 AllowSetForegroundWindow(ASFW_ANY); 5549 #endif 5550 5551 QString env; 5552 #if defined(Q_WS_X11) 5553 /* make sure the VM process will start on the same display as the Selector */ 5554 const char *display = RTEnvGet("DISPLAY"); 5555 if (display) 5556 env.append(QString("DISPLAY=%1\n").arg(display)); 5557 const char *xauth = RTEnvGet("XAUTHORITY"); 5558 if (xauth) 5559 env.append(QString("XAUTHORITY=%1\n").arg(xauth)); 5560 #endif 5561 5562 CProgress progress = machine.LaunchVMProcess(session, "GUI/Qt", env); 5563 if ( !vbox.isOk() 5564 || progress.isNull()) 5565 { 5566 vboxProblem().cannotOpenSession(vbox, machine); 5567 return false; 5568 } 5569 5570 /* Hide the "VM spawning" progress dialog */ 5571 /* I hope 1 minute will be enough to spawn any running VM silently, isn't it? */ 5572 int iSpawningDuration = 60000; 5573 vboxProblem().showModalProgressDialog(progress, machine.GetName(), 0, iSpawningDuration); 5574 if (progress.GetResultCode() != 0) 5575 vboxProblem().cannotOpenSession(vbox, machine, progress); 5576 5577 session.UnlockMachine(); 5578 5579 return true; 5580 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r34065 r34275 150 150 QString brandingGetKey (QString aKey); 151 151 152 bool processArgs(); 153 154 bool switchToMachine(CMachine &machine); 155 bool launchMachine(CMachine &machine); 156 152 157 bool isVMConsoleProcess() const { return !vmUuid.isNull(); } 153 158 bool showStartVMErrors() const { return mShowStartVMErrors; } … … 159 164 #endif 160 165 QString managedVMUuid() const { return vmUuid; } 166 QList<QUrl> &argUrlList() { return m_ArgUrlList; } 161 167 162 168 VBoxDefs::RenderMode vmRenderMode() const { return vm_render_mode; } … … 765 771 766 772 QString vmUuid; 773 QList<QUrl> m_ArgUrlList; 767 774 768 775 #ifdef VBOX_GUI_WITH_SYSTRAY -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r33969 r34275 473 473 break; 474 474 475 476 if (vboxGlobal().processArgs()) 477 return 0; 478 475 479 #ifndef VBOX_OSE 476 480 #ifdef Q_WS_X11 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r34189 r34275 96 96 this, SLOT(showViewContextMenu(const QPoint&))); 97 97 98 #if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)98 #ifdef Q_WS_MAC 99 99 qApp->installEventFilter(this); 100 #endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402)*/100 #endif /* Q_WS_MAC */ 101 101 102 102 #if !(defined (Q_WS_WIN) || defined (Q_WS_MAC)) … … 130 130 mVmAddAction = new QAction(this); 131 131 mVmAddAction->setIcon(UIIconPool::iconSet( 132 ":/vm_add_ 32px.png"));132 ":/vm_add_16px.png")); 133 133 mVmConfigAction = new QAction(this); 134 134 mVmConfigAction->setIcon(UIIconPool::iconSetFull( … … 187 187 mVMListView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 188 188 connect(mVMListView, SIGNAL(sigUrlsDropped(QList<QUrl>)), 189 this, SLOT(slt UrlsDropped(QList<QUrl>)), Qt::QueuedConnection);189 this, SLOT(sltOpenUrls(QList<QUrl>)), Qt::QueuedConnection); 190 190 191 191 /* Make non-possible to activate list elements by single click, … … 540 540 void VBoxSelectorWnd::fileImportAppliance(const QString &strFile /* = "" */) 541 541 { 542 UIImportApplianceWzd wzd(strFile, this); 542 #ifdef Q_WS_MAC 543 QString strTmpFile = ::darwinResolveAlias(strFile); 544 #else /* Q_WS_MAC */ 545 QString strTmpFile = strFile; 546 #endif /* !Q_WS_MAC */ 547 UIImportApplianceWzd wzd(strTmpFile, this); 543 548 544 549 wzd.exec(); … … 608 613 void VBoxSelectorWnd::vmAdd(const QString &strFile /* = "" */) 609 614 { 615 #ifdef Q_WS_MAC 616 QString strTmpFile = ::darwinResolveAlias(strFile); 617 #else /* Q_WS_MAC */ 610 618 QString strTmpFile = strFile; 619 #endif /* !Q_WS_MAC */ 611 620 /* Initialize variables: */ 612 621 CVirtualBox vbox = vboxGlobal().virtualBox(); … … 779 788 ("Must NOT be a VM console process")); 780 789 781 /* just switch to the VM window if it already exists */ 782 if (item->canSwitchTo()) 783 { 784 item->switchTo(); 785 return; 786 } 787 788 AssertMsg( item->machineState() == KMachineState_PoweredOff 789 || item->machineState() == KMachineState_Saved 790 || item->machineState() == KMachineState_Teleported 791 || item->machineState() == KMachineState_Aborted 792 , ("Machine must be PoweredOff/Saved/Aborted (%d)", item->machineState())); 793 794 QString id = item->id(); 795 CVirtualBox vbox = vboxGlobal().virtualBox(); 796 CSession session; 797 798 session.createInstance(CLSID_Session); 799 if (session.isNull()) 800 { 801 vboxProblem().cannotOpenSession(session); 802 return; 803 } 804 805 #if defined(Q_OS_WIN32) 806 /* allow the started VM process to make itself the foreground window */ 807 AllowSetForegroundWindow(ASFW_ANY); 808 #endif 809 810 QString env; 811 #if defined(Q_WS_X11) 812 /* make sure the VM process will start on the same display as the Selector */ 813 const char *display = RTEnvGet("DISPLAY"); 814 if (display) 815 env.append(QString("DISPLAY=%1\n").arg(display)); 816 const char *xauth = RTEnvGet("XAUTHORITY"); 817 if (xauth) 818 env.append(QString("XAUTHORITY=%1\n").arg(xauth)); 819 #endif 820 821 CProgress progress = item->machine().LaunchVMProcess(session, "GUI/Qt", env); 822 if (!vbox.isOk()) 823 { 824 vboxProblem().cannotOpenSession(vbox, item->machine()); 825 return; 826 } 827 828 /* Hide the "VM spawning" progress dialog */ 829 /* I hope 1 minute will be enough to spawn any running VM silently, isn't it? */ 830 int iSpawningDuration = 60000; 831 vboxProblem().showModalProgressDialog(progress, item->name(), this, iSpawningDuration); 832 if (progress.GetResultCode() != 0) 833 vboxProblem().cannotOpenSession(vbox, item->machine(), progress); 834 835 session.UnlockMachine(); 790 CMachine machine = item->machine(); 791 vboxGlobal().launchMachine(machine); 836 792 } 837 793 … … 972 928 } 973 929 974 void VBoxSelectorWnd::sltUrlsDropped(QList<QUrl> list) 930 931 void VBoxSelectorWnd::sltOpenUrls(QList<QUrl> list /* = QList<QUrl>() */) 975 932 { 976 933 /* Make sure any pending D&D events are consumed. */ 977 934 qApp->processEvents(); 935 if (list.isEmpty()) 936 { 937 list = vboxGlobal().argUrlList(); 938 vboxGlobal().argUrlList().clear(); 939 } 978 940 /* Check if we are can handle the dropped urls. */ 979 941 for (int i = 0; i < list.size(); ++i) 980 942 { 981 QString file = list.at(i).toLocalFile(); 982 if (!file.isEmpty()) 983 { 984 if (VBoxGlobal::hasAllowedExtension(file, VBoxDefs::VBoxFileExts)) 943 #ifdef Q_WS_MAC 944 QString strFile = ::darwinResolveAlias(list.at(i).toLocalFile()); 945 #else /* Q_WS_MAC */ 946 QString strFile = list.at(i).toLocalFile(); 947 #endif /* !Q_WS_MAC */ 948 if ( !strFile.isEmpty() 949 && QFile::exists(strFile)) 950 { 951 if (VBoxGlobal::hasAllowedExtension(strFile, VBoxDefs::VBoxFileExts)) 985 952 { 986 /* VBox config files. Only one file at the time. */ 987 vmAdd(file); 988 break; 953 /* VBox config files. */ 954 CVirtualBox vbox = vboxGlobal().virtualBox(); 955 CMachine machine = vbox.FindMachine(strFile); 956 if (!machine.isNull()) 957 { 958 CVirtualBox vbox = vboxGlobal().virtualBox(); 959 CMachine machine = vbox.FindMachine(strFile); 960 if (!machine.isNull()) 961 vboxGlobal().launchMachine(machine); 962 }else 963 vmAdd(strFile); 989 964 } 990 else if (VBoxGlobal::hasAllowedExtension( file, VBoxDefs::OVFFileExts))965 else if (VBoxGlobal::hasAllowedExtension(strFile, VBoxDefs::OVFFileExts)) 991 966 { 992 967 /* OVF/OVA. Only one file at the time. */ 993 fileImportAppliance( file);968 fileImportAppliance(strFile); 994 969 break; 995 970 } … … 1108 1083 } 1109 1084 1110 #if defined (Q_WS_MAC) && (QT_VERSION < 0x040402)1111 bool VBoxSelectorWnd::eventFilter(QObject * aObject, QEvent *aEvent)1085 #ifdef Q_WS_MAC 1086 bool VBoxSelectorWnd::eventFilter(QObject *pObject, QEvent *pEvent) 1112 1087 { 1113 1088 if (!isActiveWindow()) 1114 return QIWithRetranslateUI2<QMainWindow>::eventFilter(aObject, aEvent); 1115 1116 if (qobject_cast<QWidget*>(aObject) && 1117 qobject_cast<QWidget*>(aObject)->window() != this) 1118 return QIWithRetranslateUI2<QMainWindow>::eventFilter(aObject, aEvent); 1119 1120 switch (aEvent->type()) 1121 { 1089 return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent); 1090 1091 if (qobject_cast<QWidget*>(pObject) && 1092 qobject_cast<QWidget*>(pObject)->window() != this) 1093 return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent); 1094 1095 switch (pEvent->type()) 1096 { 1097 case QEvent::FileOpen: 1098 { 1099 sltOpenUrls(QList<QUrl>() << static_cast<QFileOpenEvent*>(pEvent)->file()); 1100 break; 1101 } 1102 # if (QT_VERSION < 0x040402) 1122 1103 case QEvent::KeyPress: 1123 { 1124 /* Bug in Qt below 4.4.2. The key events are send to the current 1125 * window even if a menu is shown & has the focus. See 1126 * http://trolltech.com/developer/task-tracker/index_html?method=entry&id=214681. */ 1127 if (::darwinIsMenuOpen()) 1128 return true; 1129 } 1104 { 1105 /* Bug in Qt below 4.4.2. The key events are send to the current 1106 * window even if a menu is shown & has the focus. See 1107 * http://trolltech.com/developer/task-tracker/index_html?method=entry&id=214681. */ 1108 if (::darwinIsMenuOpen()) 1109 return true; 1110 break; 1111 } 1112 # endif 1130 1113 default: 1131 1114 break; 1132 1115 } 1133 return QIWithRetranslateUI2<QMainWindow>::eventFilter( aObject, aEvent);1134 } 1135 #endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402)*/1116 return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent); 1117 } 1118 #endif /* Q_WS_MAC */ 1136 1119 1137 1120 /** -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.h
r34096 r34275 83 83 void showContextMenu(const QPoint &aPoint); 84 84 85 void slt UrlsDropped(QList<QUrl> list);85 void sltOpenUrls(QList<QUrl> list = QList<QUrl>()); 86 86 87 87 #ifdef VBOX_GUI_WITH_SYSTRAY … … 105 105 bool event(QEvent *aEvent); 106 106 void closeEvent(QCloseEvent *aEvent); 107 //#if defined (Q_WS_MAC) && (QT_VERSION < 0x040402) 108 // bool eventFilter(QObject *aObject, QEvent *aEvent);109 //#endif /* defined (Q_WS_MAC) && (QT_VERSION < 0x040402)*/107 #ifdef Q_WS_MAC 108 bool eventFilter(QObject *pObject, QEvent *pEvent); 109 #endif /* Q_WS_MAC */ 110 110 111 111 void retranslateUi(); -
trunk/src/VBox/Installer/darwin/DiskImage/VirtualBox_Uninstall.tool
r33540 r34275 164 164 165 165 # 166 # Unregister has to be done before the files are removed. 167 # 168 LSREGISTER=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister 169 if [ -e ${LSREGISTER} ]; then 170 ${LSREGISTER} -u /Applications/VirtualBox.app > /dev/null 171 ${LSREGISTER} -u /Applications/VirtualBox.app/Contents/Resources/vmstarter.app > /dev/null 172 fi 173 174 # 166 175 # Display the sudo usage instructions and execute the command. 167 176 # -
trunk/src/VBox/Installer/darwin/Makefile.kmk
r33185 r34275 647 647 MacOS/VMMR0.r0 \ 648 648 MacOS/VBoxDDR0.r0 \ 649 MacOS/VBoxDD2R0.r0 649 MacOS/VBoxDD2R0.r0 \ 650 MacOS/vmstarter 650 651 651 652 VBOX_DI_VBAPP_OTHER_BINS = \ … … 657 658 Resources/VirtualBoxVM.app/Contents/Info.plist \ 658 659 Resources/VirtualBoxVM.app/Contents/PkgInfo \ 660 Resources/vmstarter.app/Contents/Info.plist \ 661 Resources/vmstarter.app/Contents/PkgInfo \ 659 662 Info.plist \ 660 663 PkgInfo \ 661 664 Resources/virtualbox.icns \ 665 Resources/virtualbox-vbox.icns \ 666 Resources/virtualbox-vbox-extpack.icns \ 667 Resources/virtualbox-ovf.icns \ 668 Resources/virtualbox-ova.icns \ 662 669 MacOS/components/VBoxXPCOMBase.xpt \ 663 670 MacOS/components/VirtualBox_XPCOM.xpt … … 687 694 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \ 688 695 Resources/VirtualBoxVM.app/Contents/Resources=>../../../Resources/ \ 696 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \ 697 Resources/vmstarter.app/Contents/Resources=>../../../Resources/ \ 689 698 $(foreach qtmod, $(VBOX_QT4_MOD_NAMES), Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod)) 690 699 ifdef VBOX_WITH_COCOA_QT … … 733 742 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \ 734 743 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \ 744 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \ 745 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \ 746 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \ 735 747 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \ 736 748 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \ … … 766 778 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app \ 767 779 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents \ 780 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app \ 781 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/Resources/vmstarter.app/Contents \ 768 782 $(if-expr defined(VBOX_WITH_PYTHON), \ 769 783 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app/Contents/MacOS/sdk \ -
trunk/src/VBox/Installer/darwin/VirtualBox/postflight
r31940 r34275 67 67 VBOXWEBSRV_TRG="${HOME}/Library/LaunchAgents" 68 68 if [[ -e "${VBOXWEBSRV}" && -e "${VBOXWEBSRV_TRG}" ]]; then 69 echo "Installing vboxwebsrv launchd file to ${VBOXWEBSRV_TRG}"70 ${CP} "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/"71 /usr/sbin/chown `/usr/bin/stat -f"%u" "${HOME}"`"${VBOXWEBSRV_TRG}/org.virtualbox.vboxwebsrv.plist"69 echo "Installing vboxwebsrv launchd file to ${VBOXWEBSRV_TRG}" 70 ${CP} "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/" 71 /usr/sbin/chown "${USER}" "${VBOXWEBSRV_TRG}/org.virtualbox.vboxwebsrv.plist" 72 72 fi 73 73 … … 77 77 DATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.." 78 78 if [ -d "${DATAPATH}/.custom" ]; then 79 echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}..."; 80 ${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom" 79 echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}..."; 80 ${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom" 81 fi 82 83 # 84 # Register our file extensions 85 # 86 LSREGISTER=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister 87 if [ -e ${LSREGISTER} ]; then 88 echo "Register file extensions for $USER" 89 /usr/bin/sudo -u "${USER}" ${LSREGISTER} -f /Applications/VirtualBox.app 90 /usr/bin/sudo -u "${USER}" ${LSREGISTER} -f /Applications/VirtualBox.app/Contents/Resources/vmstarter.app 81 91 fi 82 92
Note:
See TracChangeset
for help on using the changeset viewer.