Hey there guys,
Attached is a little patch that I wrote that adds an option so the
user can choose if the minitoolbar is to be displayed at the top of
the screen Its on the General -> Advanced tab).
Much of the patch is for the VBoxVMSettingsGeneral.ui. Also, this
probably isn't with the best possible alignment with the rest of the
widgets there, I'm still fighting with layouts in Qt :).
As required, I therefore release this patch by the MIT license.
Cheers Guys!
Index: debian/control
===================================================================
--- debian/control (revisão 21826)
+++ debian/control (cópia de trabalho)
@@ -5,12 +5,13 @@
Standards-Version: 3.2.1
Build-Depends: debhelper (>= 5), libz-dev, libssl-dev, libqt4-dev,
libsdl1.2-dev, uuid-dev, libxcursor-dev, libidl-dev, libpam0g-dev,
- bcc, iasl, xsltproc, linux-headers-generic, wine, java2-runtime,
+ bcc, iasl, xsltproc, linux-headers-generic | linux-headers-2.6, java2-runtime,
lsb-release, g++-multilib [amd64], libc6-dev-i386 [amd64],
ia32-libs [amd64], libasound-dev, libpulse-dev, libxml2-dev,
libxslt1-dev, python-dev, gsoap, libcap2-dev, libgl1-mesa-dev,
libglu1-mesa-dev, libxmu-dev, libxext-dev, libcurl-dev
-XS-Python-Version: >= 2.4
+#wine
+XS-Python-Version: >= 2.4
Package: virtualbox-ose
Architecture: i386 amd64
Index: src/VBox/Frontends/VirtualBox/include/VBoxDefs.h
===================================================================
--- src/VBox/Frontends/VirtualBox/include/VBoxDefs.h (revisão 21826)
+++ src/VBox/Frontends/VirtualBox/include/VBoxDefs.h (cópia de trabalho)
@@ -151,6 +151,7 @@
static const char* GUI_SaveMountedAtRuntime;
static const char* GUI_ShowMiniToolBar;
static const char* GUI_MiniToolBarAutoHide;
+ static const char* GUI_MiniToolBarAlignment;
static const char* GUI_LastCloseAction;
static const char* GUI_SuppressMessages;
static const char* GUI_PermanentSharedFoldersAtRuntime;
Index: src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp
===================================================================
--- src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp (revisão 21826)
+++ src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp (cópia de trabalho)
@@ -33,6 +33,7 @@
const char* VBoxDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime";
const char* VBoxDefs::GUI_ShowMiniToolBar = "GUI/ShowMiniToolBar";
const char* VBoxDefs::GUI_MiniToolBarAutoHide = "GUI/MiniToolBarAutoHide";
+const char* VBoxDefs::GUI_MiniToolBarAlignment = "GUI/MiniToolBarAlignment";
const char* VBoxDefs::GUI_LastCloseAction = "GUI/LastCloseAction";
const char* VBoxDefs::GUI_SuppressMessages = "GUI/SuppressMessages";
const char* VBoxDefs::GUI_PermanentSharedFoldersAtRuntime = "GUI/PermanentSharedFoldersAtRuntime";
Index: src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsGeneral.cpp
===================================================================
--- src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsGeneral.cpp (revisão 21826)
+++ src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsGeneral.cpp (cópia de trabalho)
@@ -73,6 +73,10 @@
QString showMiniToolBar = mMachine.GetExtraData (VBoxDefs::GUI_ShowMiniToolBar);
mCbShowToolBar->setChecked (showMiniToolBar != "no");
+ /* Position of Mini Toolbar */
+ QString alignMiniToolBar = mMachine.GetExtraData (VBoxDefs::GUI_MiniToolBarAlignment);
+ mCbToolAlign->setChecked (alignMiniToolBar == "top");
+
/* Snapshot folder */
mPsSnapshot->setPath (aMachine.GetSnapshotFolder());
mPsSnapshot->setHomeDir (QFileInfo (mMachine.GetSettingsFilePath()).absolutePath());
@@ -104,6 +108,10 @@
mMachine.SetExtraData (VBoxDefs::GUI_ShowMiniToolBar,
mCbShowToolBar->isChecked() ? "yes" : "no");
+ /* Show Mini ToolBar at top */
+ mMachine.SetExtraData (VBoxDefs::GUI_MiniToolBarAlignment,
+ mCbToolAlign->isChecked() ? "top" : "bottom");
+
/* Saved state folder */
if (mPsSnapshot->isModified())
{
Index: src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp (revisão 21826)
+++ src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp (cópia de trabalho)
@@ -814,8 +814,9 @@
/* Mini toolbar */
bool isActive = !(cmachine.GetExtraData (VBoxDefs::GUI_ShowMiniToolBar) == "no");
bool isAutoHide = !(cmachine.GetExtraData (VBoxDefs::GUI_MiniToolBarAutoHide) == "off");
+ bool isAtTop = (cmachine.GetExtraData (VBoxDefs::GUI_MiniToolBarAlignment) == "top");
QList <QMenu*> menus (QList <QMenu*> () << mMiniVMMenu << mDevicesMenu);
- mMiniToolBar = new VBoxMiniToolBar (centralWidget(), VBoxMiniToolBar::AlignBottom,
+ mMiniToolBar = new VBoxMiniToolBar (centralWidget(), isAtTop ? VBoxMiniToolBar::AlignTop : VBoxMiniToolBar::AlignBottom,
isActive, isAutoHide);
*mMiniToolBar << menus;
connect (mMiniToolBar, SIGNAL (exitAction()), this, SLOT (mtExitMode()));
Index: src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsGeneral.ui
===================================================================
--- src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsGeneral.ui (revisão 21826)
+++ src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsGeneral.ui (cópia de trabalho)
@@ -1,6 +1,7 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
+ VBox frontends: Qt4 GUI ("VirtualBox"):
Copyright (C) 2008 Sun Microsystems, Inc.
@@ -8,7 +9,7 @@
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License (GPL) as published by the Free Software
- Foundation, in version 2 as it comes in the "COPYING" file of the
+ Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
@@ -17,54 +18,54 @@
additional information or have any questions.
</comment>
<class>VBoxVMSettingsGeneral</class>
- <widget class="QWidget" name="VBoxVMSettingsGeneral" >
- <property name="geometry" >
+ <widget class="QWidget" name="VBoxVMSettingsGeneral">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>350</width>
- <height>250</height>
+ <width>443</width>
+ <height>257</height>
</rect>
</property>
- <layout class="QHBoxLayout" name="mLtMain" >
+ <layout class="QHBoxLayout" name="mLtMain">
<item>
- <widget class="QTabWidget" name="mTwGeneral" >
- <property name="currentIndex" >
- <number>0</number>
+ <widget class="QTabWidget" name="mTwGeneral">
+ <property name="currentIndex">
+ <number>1</number>
</property>
- <widget class="QWidget" name="mTabBasic" >
- <attribute name="title" >
+ <widget class="QWidget" name="mTabBasic">
+ <attribute name="title">
<string>&Basic</string>
</attribute>
- <layout class="QVBoxLayout" name="mLtBasic" >
- <property name="spacing" >
+ <layout class="QVBoxLayout" name="mLtBasic">
+ <property name="spacing">
<number>0</number>
</property>
<item>
- <widget class="VBoxOSTypeSelectorWidget" native="1" name="mOSTypeSelector" >
- <layout class="QGridLayout" name="mLtOSTypeSelector" >
- <property name="margin" >
+ <widget class="VBoxOSTypeSelectorWidget" name="mOSTypeSelector" native="true">
+ <layout class="QGridLayout" name="mLtOSTypeSelector">
+ <property name="margin">
<number>0</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="mLbName" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="mLbName">
+ <property name="text">
<string>&Name:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>mLeName</cstring>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
- <widget class="QLineEdit" name="mLeName" >
- <property name="whatsThis" >
+ <item row="0" column="1" colspan="2">
+ <widget class="QLineEdit" name="mLeName">
+ <property name="whatsThis">
<string>Displays the name of the virtual machine.</string>
</property>
- <property name="text" >
+ <property name="text">
<string/>
</property>
</widget>
@@ -73,11 +74,11 @@
</widget>
</item>
<item>
- <spacer name="mSpVer1" >
- <property name="orientation" >
+ <spacer name="mSpVer1">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@@ -87,75 +88,75 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="mTabAdvanced" >
- <attribute name="title" >
+ <widget class="QWidget" name="mTabAdvanced">
+ <attribute name="title">
<string>&Advanced</string>
</attribute>
- <layout class="QVBoxLayout" name="mLtAdvanced" >
- <property name="spacing" >
+ <layout class="QVBoxLayout" name="mLtAdvanced">
+ <property name="spacing">
<number>0</number>
</property>
<item>
- <widget class="QWidget" native="1" name="mWtAdvanced" >
- <layout class="QGridLayout" name="mLtAdvancedItems" >
- <property name="margin" >
+ <widget class="QWidget" name="mWtAdvanced" native="true">
+ <layout class="QGridLayout" name="mLtAdvancedItems">
+ <property name="margin">
<number>0</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="mLbSnapshot" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="mLbSnapshot">
+ <property name="text">
<string>S&napshot Folder:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>mPsSnapshot</cstring>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
- <widget class="VBoxFilePathSelectorWidget" name="mPsSnapshot" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+ <item row="0" column="1" colspan="2">
+ <widget class="VBoxFilePathSelectorWidget" name="mPsSnapshot">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="mLbClipboard" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="mLbClipboard">
+ <property name="text">
<string>&Shared Clipboard:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>mCbClipboard</cstring>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QComboBox" name="mCbClipboard" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <item row="1" column="1">
+ <widget class="QComboBox" name="mCbClipboard">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>Defines the mode of sharing the clipboard between the guest and the host OS. Note that this feature requires Guest Additions to be installed in the guest OS.</string>
</property>
</widget>
</item>
- <item row="1" column="2" >
- <spacer name="mSpHor1" >
- <property name="orientation" >
+ <item row="1" column="2">
+ <spacer name="mSpHor1">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@@ -163,73 +164,80 @@
</property>
</spacer>
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="mLbMedia" >
- <property name="text" >
+ <item row="2" column="0">
+ <widget class="QLabel" name="mLbMedia">
+ <property name="text">
<string>Removable Media:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QCheckBox" name="mCbSaveMounted" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="mCbSaveMounted">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>If checked, any change to mounted CD/DVD or Floppy media performed during machine execution will be saved in the settings file in order to preserve the configuration of mounted media between runs.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&Remember Runtime Changes</string>
</property>
- <property name="checked" >
+ <property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="mLbToolBar" >
- <property name="text" >
+ <item row="4" column="0">
+ <widget class="QLabel" name="mLbToolBar">
+ <property name="text">
<string>Mini ToolBar:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QCheckBox" name="mCbShowToolBar" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="mCbShowToolBar">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>If checked, show the Mini ToolBar in Fullscreen and Seamless modes.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Show In &Fullscreen/Seamless</string>
</property>
- <property name="checked" >
+ <property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="mCbToolAlign">
+ <property name="text">
+ <string>Show Toolbar on the Top</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<item>
- <spacer name="mSpVer2" >
- <property name="orientation" >
+ <spacer name="mSpVer2">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@@ -239,20 +247,20 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="mTabDescription" >
- <attribute name="title" >
+ <widget class="QWidget" name="mTabDescription">
+ <attribute name="title">
<string>&Description</string>
</attribute>
- <layout class="QVBoxLayout" name="mLtDescription" >
- <property name="spacing" >
+ <layout class="QVBoxLayout" name="mLtDescription">
+ <property name="spacing">
<number>0</number>
</property>
<item>
- <widget class="QTextEdit" name="mTeDescription" >
- <property name="whatsThis" >
+ <widget class="QTextEdit" name="mTeDescription">
+ <property name="whatsThis">
<string>Displays the description of the virtual machine. The description field is useful for commenting configuration details of the installed guest OS.</string>
</property>
- <property name="acceptRichText" >
+ <property name="acceptRichText">
<bool>false</bool>
</property>
</widget>
@@ -265,16 +273,16 @@
</widget>
<customwidgets>
<customwidget>
- <class>VBoxOSTypeSelectorWidget</class>
- <extends>QWidget</extends>
- <header>VBoxOSTypeSelectorWidget.h</header>
- </customwidget>
- <customwidget>
<class>VBoxFilePathSelectorWidget</class>
<extends>QComboBox</extends>
<header>VBoxFilePathSelectorWidget.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>VBoxOSTypeSelectorWidget</class>
+ <extends>QWidget</extends>
+ <header>VBoxOSTypeSelectorWidget.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev