Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 60768)
@@ -430,4 +430,5 @@
 	src/widgets/UIBar.h \
 	src/widgets/UIBootTable.h \
+	src/widgets/UIFilePathSelector.h \
 	src/widgets/UIHostComboEditor.h \
 	src/widgets/UIHotKeyEditor.h \
@@ -445,5 +446,4 @@
 	src/widgets/UISpecialControls.h \
 	src/widgets/UIToolBar.h \
-	src/widgets/VBoxFilePathSelectorWidget.h \
 	src/widgets/VBoxMediaComboBox.h \
 	src/widgets/UIMiniToolBar.h \
@@ -720,4 +720,5 @@
 	src/widgets/UIBar.cpp \
 	src/widgets/UIBootTable.cpp \
+	src/widgets/UIFilePathSelector.cpp \
 	src/widgets/UIHostComboEditor.cpp \
 	src/widgets/UIHotKeyEditor.cpp \
@@ -734,5 +735,4 @@
 	src/widgets/UISpecialControls.cpp \
 	src/widgets/UIToolBar.cpp \
-	src/widgets/VBoxFilePathSelectorWidget.cpp \
 	src/widgets/VBoxGuestRAMSlider.cpp \
 	src/widgets/VBoxMediaComboBox.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_bg.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_bg.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_bg.ts	(revision 60768)
@@ -13235,5 +13235,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ca.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ca.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ca.ts	(revision 60768)
@@ -14057,5 +14057,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ca_VA.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ca_VA.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ca_VA.ts	(revision 60768)
@@ -14062,5 +14062,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_cs.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_cs.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_cs.ts	(revision 60768)
@@ -14034,5 +14034,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_da.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_da.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_da.ts	(revision 60768)
@@ -12747,5 +12747,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts	(revision 60768)
@@ -6620,5 +6620,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_el.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_el.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_el.ts	(revision 60768)
@@ -5993,5 +5993,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_es.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_es.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_es.ts	(revision 60768)
@@ -14461,5 +14461,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts	(revision 60768)
@@ -10529,5 +10529,5 @@
     </message>
     <message>
-        <location filename="../src/widgets/VBoxFilePathSelectorWidget.cpp" line="+730"/>
+        <location filename="../src/widgets/UIFilePathSelector.cpp" line="+730"/>
         <source>Choose...</source>
         <translation>Hautatu...</translation>
@@ -10535,5 +10535,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <location line="-442"/>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fa_IR.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fa_IR.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fa_IR.ts	(revision 60768)
@@ -9080,5 +9080,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fi.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fi.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fi.ts	(revision 60768)
@@ -11088,5 +11088,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fr.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fr.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_fr.ts	(revision 60768)
@@ -11287,5 +11287,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_gl_ES.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_gl_ES.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_gl_ES.ts	(revision 60768)
@@ -10437,5 +10437,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts	(revision 60768)
@@ -13869,5 +13869,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_id.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_id.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_id.ts	(revision 60768)
@@ -12540,5 +12540,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_it.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_it.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_it.ts	(revision 60768)
@@ -14840,5 +14840,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ja.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ja.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ja.ts	(revision 60768)
@@ -14031,5 +14031,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_km_KH.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_km_KH.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_km_KH.ts	(revision 60768)
@@ -10530,5 +10530,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ko.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ko.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ko.ts	(revision 60768)
@@ -13313,5 +13313,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_lt.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_lt.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_lt.ts	(revision 60768)
@@ -11071,5 +11071,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts	(revision 60768)
@@ -10756,5 +10756,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pl.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pl.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pl.ts	(revision 60768)
@@ -12439,5 +12439,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt.ts	(revision 60768)
@@ -11770,5 +11770,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt_BR.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt_BR.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_pt_BR.ts	(revision 60768)
@@ -14958,5 +14958,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ro.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ro.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ro.ts	(revision 60768)
@@ -11836,5 +11836,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ru.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ru.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ru.ts	(revision 60768)
@@ -13202,5 +13202,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sk.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sk.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sk.ts	(revision 60768)
@@ -11525,5 +11525,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sr.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sr.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sr.ts	(revision 60768)
@@ -12166,5 +12166,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sv.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sv.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_sv.ts	(revision 60768)
@@ -13792,5 +13792,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_tr.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_tr.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_tr.ts	(revision 60768)
@@ -12465,5 +12465,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_uk.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_uk.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_uk.ts	(revision 60768)
@@ -12549,5 +12549,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_xx_YY.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_xx_YY.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_xx_YY.ts	(revision 60768)
@@ -6609,5 +6609,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_CN.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_CN.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_CN.ts	(revision 60768)
@@ -10727,5 +10727,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_TW.ts
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_TW.ts	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_TW.ts	(revision 60768)
@@ -6609,5 +6609,5 @@
 </context>
 <context>
-    <name>VBoxFilePathSelectorWidget</name>
+    <name>UIFilePathSelector</name>
     <message>
         <source>&lt;reset to default&gt;</source>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/precomp.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/precomp.h	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/precomp.h	(revision 60768)
@@ -646,5 +646,5 @@
 #include "VBoxFBOverlay.h"
 #include "VBoxFBOverlayCommon.h"
-#include "VBoxFilePathSelectorWidget.h"
+#include "UIFilePathSelector.h"
 #include "VBoxGlobal.h"
 #include "VBoxGlobalSettings.h"
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp	(revision 60768)
@@ -42,5 +42,5 @@
     m_pSelectorMachineFolder->setHomeDir(vboxGlobal().homeFolder());
     m_pSelectorVRDPLibName->setHomeDir(vboxGlobal().homeFolder());
-    m_pSelectorVRDPLibName->setMode(VBoxFilePathSelectorWidget::Mode_File_Open);
+    m_pSelectorVRDPLibName->setMode(UIFilePathSelector::Mode_File_Open);
 
     /* Apply language settings: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui	(revision 60768)
@@ -33,5 +33,5 @@
    </item>
    <item row="0" column="1" colspan="2">
-    <widget class="VBoxFilePathSelectorWidget" name="m_pSelectorMachineFolder">
+    <widget class="UIFilePathSelector" name="m_pSelectorMachineFolder">
      <property name="sizePolicy">
       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -59,5 +59,5 @@
    </item>
    <item row="1" column="1" colspan="2">
-    <widget class="VBoxFilePathSelectorWidget" name="m_pSelectorVRDPLibName">
+    <widget class="UIFilePathSelector" name="m_pSelectorVRDPLibName">
      <property name="sizePolicy">
       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -111,7 +111,7 @@
  <customwidgets>
   <customwidget>
-   <class>VBoxFilePathSelectorWidget</class>
+   <class>UIFilePathSelector</class>
    <extends>QComboBox</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
+   <header>UIFilePathSelector.h</header>
    <container>1</container>
   </customwidget>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp	(revision 60768)
@@ -838,5 +838,5 @@
     /* Prepare filepath selector: */
     m_pEditorVideoCapturePath->setEditable(false);
-    m_pEditorVideoCapturePath->setMode(VBoxFilePathSelectorWidget::Mode_File_Save);
+    m_pEditorVideoCapturePath->setMode(UIFilePathSelector::Mode_File_Save);
 
     /* Prepare frame-size combo-box: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui	(revision 60768)
@@ -492,5 +492,5 @@
              </item>
              <item row="0" column="1" colspan="3">
-              <widget class="VBoxFilePathSelectorWidget" name="m_pEditorVideoCapturePath">
+              <widget class="UIFilePathSelector" name="m_pEditorVideoCapturePath">
                <property name="whatsThis">
                 <string>Holds the filename VirtualBox uses to save the recorded content.</string>
@@ -730,7 +730,7 @@
   </customwidget>
   <customwidget>
-   <class>VBoxFilePathSelectorWidget</class>
+   <class>UIFilePathSelector</class>
    <extends>QComboBox</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
+   <header>UIFilePathSelector.h</header>
    <container>1</container>
   </customwidget>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui	(revision 60768)
@@ -83,5 +83,5 @@
           </item>
           <item row="0" column="1" colspan="2" >
-           <widget class="VBoxFilePathSelectorWidget" name="mPsSnapshot" >
+           <widget class="UIFilePathSelector" name="mPsSnapshot" >
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
@@ -352,7 +352,7 @@
   </customwidget>
   <customwidget>
-   <class>VBoxFilePathSelectorWidget</class>
+   <class>UIFilePathSelector</class>
    <extends>QComboBox</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
+   <header>UIFilePathSelector.h</header>
    <container>1</container>
   </customwidget>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp	(revision 60768)
@@ -159,5 +159,5 @@
     if (strFolderName[0].isLetter() && strFolderName[1] == ':' && strFolderName[2] == 0)
     {
-        /* VBoxFilePathSelectorWidget returns root path as 'X:', which is invalid path.
+        /* UIFilePathSelector returns root path as 'X:', which is invalid path.
          * Append the trailing backslash to get a valid root path 'X:\': */
         strFolderName += "\\";
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.ui	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.ui	(revision 60768)
@@ -35,5 +35,5 @@
    </item>
    <item row="0" column="1" >
-    <widget class="VBoxFilePathSelectorWidget" name="mPsPath" />
+    <widget class="UIFilePathSelector" name="mPsPath" />
    </item>
    <item row="1" column="0" >
@@ -108,7 +108,7 @@
  <customwidgets>
   <customwidget>
-   <class>VBoxFilePathSelectorWidget</class>
+   <class>UIFilePathSelector</class>
    <extends>QComboBox</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
+   <header>UIFilePathSelector.h</header>
    <container>1</container>
   </customwidget>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp	(revision 60768)
@@ -479,6 +479,6 @@
             {
                 /* disabled for now
-                   VBoxFilePathSelectorWidget *e = new VBoxFilePathSelectorWidget(pParent);
-                   e->setMode(VBoxFilePathSelectorWidget::Mode_File);
+                   UIFilePathSelector *e = new UIFilePathSelector(pParent);
+                   e->setMode(UIFilePathSelector::Mode_File);
                    e->setResetEnabled(false);
                    */
@@ -567,5 +567,5 @@
         {
             /* disabled for now
-               if (VBoxFilePathSelectorWidget *e = qobject_cast<VBoxFilePathSelectorWidget*>(pEditor))
+               if (UIFilePathSelector *e = qobject_cast<UIFilePathSelector*>(pEditor))
                {
                e->setPath(m_strConfigValue);
@@ -700,5 +700,5 @@
         {
             /* disabled for now
-               if (VBoxFilePathSelectorWidget *e = qobject_cast<VBoxFilePathSelectorWidget*>(pEditor))
+               if (UIFilePathSelector *e = qobject_cast<UIFilePathSelector*>(pEditor))
                {
                m_strConfigValue = e->path();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp	(revision 60768)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp	(revision 60768)
@@ -0,0 +1,774 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - VirtualBox Qt extensions: UIFilePathSelector class implementation.
+ */
+
+/*
+ * Copyright (C) 2008-2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * 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
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifdef VBOX_WITH_PRECOMPILED_HEADERS
+# include <precomp.h>
+#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+/* Local includes */
+# include "QIFileDialog.h"
+# include "QIToolButton.h"
+# include "QILabel.h"
+# include "QILineEdit.h"
+# include "UIIconPool.h"
+# include "UIFilePathSelector.h"
+# include "VBoxGlobal.h"
+
+/* Global includes */
+# include <iprt/assert.h>
+# include <QAction>
+# include <QApplication>
+# include <QClipboard>
+# include <QDir>
+# include <QFocusEvent>
+# include <QHBoxLayout>
+# include <QLineEdit>
+# include <QTimer>
+
+#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+
+////////////////////////////////////////////////////////////////////////////////
+// UIFilePathSelector
+
+enum
+{
+    PathId = 0,
+    SelectId,
+    ResetId
+};
+
+/**
+ * Returns first position of difference between passed strings.
+ */
+static int differFrom (const QString &aS1, const QString &aS2)
+{
+    if (aS1 == aS2)
+        return -1;
+
+    int minLength = qMin (aS1.size(), aS2.size());
+    int index = 0;
+    for (index = 0; index < minLength ; ++ index)
+        if (aS1 [index] != aS2 [index])
+            break;
+    return index;
+}
+
+UIFilePathSelector::UIFilePathSelector (QWidget *aParent)
+    : QIWithRetranslateUI<QComboBox> (aParent)
+    , mCopyAction (new QAction (this))
+    , mMode (Mode_Folder)
+    , mHomeDir (QDir::current().absolutePath())
+    , mIsEditable (true)
+    , mIsEditableMode (false)
+    , mIsMouseAwaited (false)
+    , mModified (false)
+{
+    /* Populate items */
+    insertItem (PathId, "");
+    insertItem (SelectId, "");
+    insertItem (ResetId, "");
+
+    /* Attaching known icons */
+    setItemIcon(SelectId, UIIconPool::iconSet(":/select_file_16px.png"));
+    setItemIcon(ResetId, UIIconPool::iconSet(":/eraser_16px.png"));
+
+    /* Setup context menu */
+    addAction (mCopyAction);
+    mCopyAction->setShortcut (QKeySequence (QKeySequence::Copy));
+    mCopyAction->setShortcutContext (Qt::WidgetShortcut);
+
+    /* Initial Setup */
+    setInsertPolicy (QComboBox::NoInsert);
+    setContextMenuPolicy (Qt::ActionsContextMenu);
+    setMinimumWidth (200);
+
+    /* Setup connections */
+    connect (this, SIGNAL (activated (int)), this, SLOT (onActivated (int)));
+    connect (mCopyAction, SIGNAL (triggered (bool)), this, SLOT (copyToClipboard()));
+
+    /* Editable by default */
+    setEditable (true);
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+UIFilePathSelector::~UIFilePathSelector()
+{
+}
+
+void UIFilePathSelector::setMode (Mode aMode)
+{
+    mMode = aMode;
+}
+
+UIFilePathSelector::Mode UIFilePathSelector::mode() const
+{
+    return mMode;
+}
+
+void UIFilePathSelector::setEditable (bool aOn)
+{
+    mIsEditable = aOn;
+
+    if (mIsEditable)
+    {
+        QComboBox::setEditable (true);
+        Assert (lineEdit());
+        connect (lineEdit(), SIGNAL (textEdited (const QString &)),
+                 this, SLOT (onTextEdited (const QString &)));
+
+        /* Installing necessary event filters */
+        lineEdit()->installEventFilter (this);
+    }
+    else
+    {
+        if (lineEdit())
+        {
+            /* Installing necessary event filters */
+            lineEdit()->installEventFilter (this);
+            disconnect (lineEdit(), SIGNAL (textEdited (const QString &)),
+                        this, SLOT (onTextEdited (const QString &)));
+        }
+        QComboBox::setEditable (false);
+    }
+}
+
+bool UIFilePathSelector::isEditable() const
+{
+    return mIsEditable;
+}
+
+void UIFilePathSelector::setResetEnabled (bool aEnabled)
+{
+    if (!aEnabled && count() - 1 == ResetId)
+        removeItem (ResetId);
+    else if (aEnabled && count() - 1 == ResetId - 1)
+    {
+        insertItem (ResetId, "");
+        setItemIcon(ResetId, UIIconPool::iconSet(":/eraser_16px.png"));
+    }
+    retranslateUi();
+}
+
+bool UIFilePathSelector::isResetEnabled() const
+{
+    return (count() - 1  == ResetId);
+}
+
+void UIFilePathSelector::resetModified()
+{
+    mModified = false;
+}
+
+bool UIFilePathSelector::isModified() const
+{
+    return mModified;
+}
+
+void UIFilePathSelector::setFileDialogTitle (const QString& aTitle)
+{
+    mFileDialogTitle = aTitle;
+}
+
+QString UIFilePathSelector::fileDialogTitle() const
+{
+    return mFileDialogTitle;
+}
+
+void UIFilePathSelector::setFileFilters (const QString& aFilters)
+{
+    mFileFilters = aFilters;
+}
+
+QString UIFilePathSelector::fileFilters() const
+{
+    return mFileFilters;
+}
+
+void UIFilePathSelector::setDefaultSaveExt (const QString &aExt)
+{
+    mDefaultSaveExt = aExt;
+}
+
+QString UIFilePathSelector::defaultSaveExt() const
+{
+    return mDefaultSaveExt;
+}
+
+/**
+ * Returns @c true if the selected (active) combobox item is a path item.
+ *
+ * May be used in @c activated() signal handlers to distinguish between
+ * non-path items like "Other..." or "Reset" that get temporarily activated
+ * when performing the corresponding action and the item that contains a
+ * real selected file/folder path.
+ */
+bool UIFilePathSelector::isPathSelected() const
+{
+    return (currentIndex() == PathId);
+}
+
+QString UIFilePathSelector::path() const
+{
+    return mPath;
+}
+
+void UIFilePathSelector::setPath (const QString &aPath, bool aRefreshText /* = true */)
+{
+    mPath = aPath.isEmpty() ? QString::null :
+            QDir::toNativeSeparators (aPath);
+    if (aRefreshText)
+        refreshText();
+}
+
+void UIFilePathSelector::setHomeDir (const QString &aHomeDir)
+{
+    mHomeDir = aHomeDir;
+}
+
+void UIFilePathSelector::resizeEvent (QResizeEvent *aEvent)
+{
+    QIWithRetranslateUI<QComboBox>::resizeEvent (aEvent);
+    refreshText();
+}
+
+void UIFilePathSelector::focusInEvent (QFocusEvent *aEvent)
+{
+    if (isPathSelected())
+    {
+        if (mIsEditable)
+            mIsEditableMode = true;
+        if (aEvent->reason() == Qt::MouseFocusReason)
+            mIsMouseAwaited = true;
+        else
+            refreshText();
+    }
+    QIWithRetranslateUI<QComboBox>::focusInEvent (aEvent);
+}
+
+void UIFilePathSelector::focusOutEvent (QFocusEvent *aEvent)
+{
+    if (isPathSelected())
+    {
+        mIsEditableMode = false;
+        refreshText();
+    }
+    QIWithRetranslateUI<QComboBox>::focusOutEvent (aEvent);
+}
+
+bool UIFilePathSelector::eventFilter (QObject *aObj, QEvent *aEv)
+{
+    if (mIsMouseAwaited && (aEv->type() == QEvent::MouseButtonPress))
+        QTimer::singleShot (0, this, SLOT (refreshText()));
+
+    return QIWithRetranslateUI<QComboBox>::eventFilter (aObj, aEv);
+}
+
+void UIFilePathSelector::retranslateUi()
+{
+    /* How do we interpret the "nothing selected" item? */
+    if (isResetEnabled())
+    {
+        mNoneStr = tr ("<reset to default>");
+        mNoneTip = tr ("The actual default path value will be displayed after "
+                       "accepting the changes and opening this window again.");
+    }
+    else
+    {
+        mNoneStr = tr ("<not selected>");
+        mNoneTip = tr ("Please use the <b>Other...</b> item from the drop-down "
+                       "list to select a path.");
+    }
+
+    /* Retranslate 'path' item */
+    if (mPath.isNull())
+    {
+        setItemText (PathId, mNoneStr);
+        setItemData (PathId, mNoneTip, Qt::ToolTipRole);
+        setToolTip (mNoneTip);
+    }
+
+    /* Retranslate 'select' item */
+    setItemText (SelectId, tr ("Other..."));
+
+    /* Retranslate 'reset' item */
+    if (count() - 1 == ResetId)
+        setItemText (ResetId, tr ("Reset"));
+
+    /* Set tooltips of the above two items based on the mode */
+    switch (mMode)
+    {
+        case Mode_Folder:
+            setItemData (SelectId,
+                         tr ("Displays a window to select a different folder."),
+                         Qt::ToolTipRole);
+            setItemData (ResetId,
+                         tr ("Resets the folder path to the default value."),
+                         Qt::ToolTipRole);
+            break;
+        case Mode_File_Open:
+        case Mode_File_Save:
+            setItemData (SelectId,
+                         tr ("Displays a window to select a different file."),
+                         Qt::ToolTipRole);
+            setItemData (ResetId,
+                         tr ("Resets the file path to the default value."),
+                         Qt::ToolTipRole);
+            break;
+        default:
+            AssertFailedBreak();
+    }
+
+    /* Retranslate copy action */
+    mCopyAction->setText (tr ("&Copy"));
+}
+
+void UIFilePathSelector::onActivated (int aIndex)
+{
+    switch (aIndex)
+    {
+        case SelectId:
+        {
+            selectPath();
+            break;
+        }
+        case ResetId:
+        {
+            changePath (QString::null);
+            break;
+        }
+        default:
+            break;
+    }
+    setCurrentIndex (PathId);
+    setFocus();
+}
+
+void UIFilePathSelector::onTextEdited (const QString &aPath)
+{
+    changePath (aPath, false /* refresh text? */);
+}
+
+void UIFilePathSelector::copyToClipboard()
+{
+    QString text (fullPath());
+    /* Copy the current text to the selection and global clipboard. */
+    if (QApplication::clipboard()->supportsSelection())
+        QApplication::clipboard()->setText (text, QClipboard::Selection);
+    QApplication::clipboard()->setText (text, QClipboard::Clipboard);
+}
+
+void UIFilePathSelector::changePath (const QString &aPath,
+                                             bool aRefreshText /* = true */)
+{
+    QString oldPath = mPath;
+    setPath (aPath, aRefreshText);
+    if (!mModified && mPath != oldPath)
+        mModified = true;
+    emit pathChanged (aPath);
+}
+
+void UIFilePathSelector::selectPath()
+{
+    /* Preparing initial directory. */
+    QString initDir = mPath.isNull() ? mHomeDir :
+        QIFileDialog::getFirstExistingDir (mPath);
+    if (initDir.isNull())
+        initDir = mHomeDir;
+
+    QString selPath;
+    switch (mMode)
+    {
+        case Mode_File_Open:
+            selPath = QIFileDialog::getOpenFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break;
+        case Mode_File_Save:
+            {
+                selPath = QIFileDialog::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle);
+                if (!selPath.isEmpty() && QFileInfo (selPath).suffix().isEmpty())
+                    selPath = QString ("%1.%2").arg (selPath).arg (mDefaultSaveExt);
+                break;
+            }
+        case Mode_Folder:
+            selPath = QIFileDialog::getExistingDirectory (initDir, parentWidget(), mFileDialogTitle); break;
+    }
+
+    if (selPath.isNull())
+        return;
+
+    selPath.remove (QRegExp ("[\\\\/]$"));
+    changePath (selPath);
+}
+
+QIcon UIFilePathSelector::defaultIcon() const
+{
+    if (mMode == Mode_Folder)
+        return vboxGlobal().icon(QFileIconProvider::Folder);
+    else
+        return vboxGlobal().icon(QFileIconProvider::File);
+}
+
+QString UIFilePathSelector::fullPath (bool aAbsolute /* = true */) const
+{
+    if (mPath.isNull())
+        return mPath;
+
+    QString result;
+    switch (mMode)
+    {
+        case Mode_Folder:
+            result = aAbsolute ? QDir (mPath).absolutePath() :
+                                 QDir (mPath).path();
+            break;
+        case Mode_File_Open:
+        case Mode_File_Save:
+            result = aAbsolute ? QFileInfo (mPath).absoluteFilePath() :
+                                 QFileInfo (mPath).filePath();
+            break;
+        default:
+            AssertFailedBreak();
+    }
+    return QDir::toNativeSeparators (result);
+}
+
+QString UIFilePathSelector::shrinkText (int aWidth) const
+{
+    QString fullText (fullPath (false));
+    if (fullText.isEmpty())
+        return fullText;
+
+    int oldSize = fontMetrics().width (fullText);
+    int indentSize = fontMetrics().width ("x...x");
+
+    /* Compress text */
+    int start = 0;
+    int finish = 0;
+    int position = 0;
+    int textWidth = 0;
+    do {
+        textWidth = fontMetrics().width (fullText);
+        if (textWidth + indentSize > aWidth)
+        {
+            start = 0;
+            finish = fullText.length();
+
+            /* Selecting remove position */
+            QRegExp regExp ("([\\\\/][^\\\\^/]+[\\\\/]?$)");
+            int newFinish = regExp.indexIn (fullText);
+            if (newFinish != -1)
+                finish = newFinish;
+            position = (finish - start) / 2;
+
+            if (position == finish)
+               break;
+
+            fullText.remove (position, 1);
+        }
+    } while (textWidth + indentSize > aWidth);
+
+    fullText.insert (position, "...");
+    int newSize = fontMetrics().width (fullText);
+
+    return newSize < oldSize ? fullText : fullPath (false);
+}
+
+void UIFilePathSelector::refreshText()
+{
+    if (mIsEditable && mIsEditableMode)
+    {
+        /* Cursor positioning variables */
+        int curPos = -1;
+        int diffPos = -1;
+        int fromRight = -1;
+
+        if (mIsMouseAwaited)
+        {
+            /* Store the cursor position */
+            curPos = lineEdit()->cursorPosition();
+            diffPos = differFrom (lineEdit()->text(), mPath);
+            fromRight = lineEdit()->text().size() - curPos;
+        }
+
+        /* In editable mode there should be no any icon
+         * and text have be corresponding real stored path
+         * which can be absolute or relative. */
+        if (lineEdit()->text() != mPath)
+            setItemText (PathId, mPath);
+        setItemIcon (PathId, QIcon());
+        setToolTip (mMode == Mode_Folder ?
+            tr ("Holds the folder path.") :
+            tr ("Holds the file path."));
+
+        if (mIsMouseAwaited)
+        {
+            mIsMouseAwaited = false;
+
+            /* Restore the position to the right of dots */
+            if (diffPos != -1 && curPos >= diffPos + 3)
+                lineEdit()->setCursorPosition (lineEdit()->text().size() -
+                                               fromRight);
+            /* Restore the position to the center of text */
+            else if (diffPos != -1 && curPos > diffPos)
+                lineEdit()->setCursorPosition (lineEdit()->text().size() / 2);
+            /* Restore the position to the left of dots */
+            else
+                lineEdit()->setCursorPosition (curPos);
+        }
+    }
+    else if (mPath.isNull())
+    {
+        /* If we are not in editable mode and no path is
+         * stored here - show the translated 'none' string. */
+        if (itemText (PathId) != mNoneStr)
+        {
+            setItemText (PathId, mNoneStr);
+            setItemIcon (PathId, QIcon());
+            setItemData (PathId, mNoneTip, Qt::ToolTipRole);
+            setToolTip (mNoneTip);
+        }
+    }
+    else
+    {
+        /* Compress text in combobox */
+        QStyleOptionComboBox options;
+        options.initFrom (this);
+        QRect rect = QApplication::style()->subControlRect (
+            QStyle::CC_ComboBox, &options, QStyle::SC_ComboBoxEditField);
+        setItemText (PathId, shrinkText (rect.width() - iconSize().width()));
+
+        /* Attach corresponding icon */
+        setItemIcon (PathId, QFileInfo (mPath).exists() ?
+                             vboxGlobal().icon(QFileInfo (mPath)) :
+                             defaultIcon());
+
+        /* Set the tooltip */
+        setToolTip (fullPath());
+        setItemData (PathId, toolTip(), Qt::ToolTipRole);
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VBoxEmptyFileSelector
+
+VBoxEmptyFileSelector::VBoxEmptyFileSelector (QWidget *aParent /* = NULL */)
+    : QIWithRetranslateUI<QWidget> (aParent)
+    , mPathWgt (NULL)
+    , mLabel (NULL)
+    , mMode (UIFilePathSelector::Mode_File_Open)
+    , mLineEdit (NULL)
+    , m_fButtonToolTipSet(false)
+    , mHomeDir (QDir::current().absolutePath())
+    , mIsModified (false)
+{
+    mMainLayout = new QHBoxLayout (this);
+    mMainLayout->setMargin (0);
+
+    mSelectButton = new QIToolButton(this);
+    mSelectButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));
+    connect(mSelectButton, SIGNAL(clicked()), this, SLOT(choose()));
+    mMainLayout->addWidget(mSelectButton);
+
+    setEditable (false);
+
+    retranslateUi();
+}
+
+void VBoxEmptyFileSelector::setMode (UIFilePathSelector::Mode aMode)
+{
+    mMode = aMode;
+}
+
+UIFilePathSelector::Mode VBoxEmptyFileSelector::mode() const
+{
+    return mMode;
+}
+
+void VBoxEmptyFileSelector::setButtonPosition (ButtonPosition aPos)
+{
+    if (aPos == LeftPosition)
+    {
+        mMainLayout->setDirection (QBoxLayout::LeftToRight);
+        setTabOrder (mSelectButton, mPathWgt);
+    }
+    else
+    {
+        mMainLayout->setDirection (QBoxLayout::RightToLeft);
+        setTabOrder (mPathWgt, mSelectButton);
+    }
+}
+
+VBoxEmptyFileSelector::ButtonPosition VBoxEmptyFileSelector::buttonPosition() const
+{
+    return mMainLayout->direction() == QBoxLayout::LeftToRight ? LeftPosition : RightPosition;
+}
+
+void VBoxEmptyFileSelector::setEditable (bool aOn)
+{
+    if (mPathWgt)
+    {
+        delete mPathWgt;
+        mLabel = NULL;
+        mLineEdit = NULL;
+    }
+
+    if (aOn)
+    {
+        mPathWgt = mLineEdit = new QILineEdit (this);
+        connect (mLineEdit, SIGNAL (textChanged (const QString&)),
+                 this, SLOT (textChanged (const QString&)));
+    }
+    else
+    {
+        mPathWgt = mLabel = new QILabel (this);
+        mLabel->setWordWrap (true);
+    }
+    mMainLayout->addWidget (mPathWgt, 2);
+    setButtonPosition (buttonPosition());
+
+    setPath (mPath);
+}
+
+bool VBoxEmptyFileSelector::isEditable() const
+{
+    return mLabel ? false : true;
+}
+
+void VBoxEmptyFileSelector::setChooserVisible (bool aOn)
+{
+    mSelectButton->setVisible (aOn);
+}
+
+bool VBoxEmptyFileSelector::isChooserVisible() const
+{
+    return mSelectButton->isVisible();
+}
+
+void VBoxEmptyFileSelector::setPath (const QString& aPath)
+{
+    QString tmpPath = QDir::toNativeSeparators (aPath);
+    if (mLabel)
+        mLabel->setText (QString ("<compact elipsis=\"start\">%1</compact>").arg (tmpPath));
+    else if (mLineEdit)
+        mLineEdit->setText (tmpPath);
+    textChanged(tmpPath);
+}
+
+QString VBoxEmptyFileSelector::path() const
+{
+    return mPath;
+}
+
+void VBoxEmptyFileSelector::setDefaultSaveExt (const QString &aExt)
+{
+    mDefaultSaveExt = aExt;
+}
+
+QString VBoxEmptyFileSelector::defaultSaveExt() const
+{
+    return mDefaultSaveExt;
+}
+
+void VBoxEmptyFileSelector::setChooseButtonToolTip(const QString &strToolTip)
+{
+    m_fButtonToolTipSet = !strToolTip.isEmpty();
+    mSelectButton->setToolTip(strToolTip);
+}
+
+QString VBoxEmptyFileSelector::chooseButtonToolTip() const
+{
+    return mSelectButton->toolTip();
+}
+
+void VBoxEmptyFileSelector::setFileDialogTitle (const QString& aTitle)
+{
+    mFileDialogTitle = aTitle;
+}
+
+QString VBoxEmptyFileSelector::fileDialogTitle() const
+{
+    return mFileDialogTitle;
+}
+
+void VBoxEmptyFileSelector::setFileFilters (const QString& aFilters)
+{
+    mFileFilters = aFilters;
+}
+
+QString VBoxEmptyFileSelector::fileFilters() const
+{
+    return mFileFilters;
+}
+
+void VBoxEmptyFileSelector::setHomeDir (const QString& aDir)
+{
+    mHomeDir = aDir;
+}
+
+QString VBoxEmptyFileSelector::homeDir() const
+{
+    return mHomeDir;
+}
+
+void VBoxEmptyFileSelector::retranslateUi()
+{
+    if (!m_fButtonToolTipSet)
+        mSelectButton->setToolTip(tr("Choose..."));
+}
+
+void VBoxEmptyFileSelector::choose()
+{
+    QString path = mPath;
+
+    /* Preparing initial directory. */
+    QString initDir = path.isNull() ? mHomeDir :
+        QIFileDialog::getFirstExistingDir (path);
+    if (initDir.isNull())
+        initDir = mHomeDir;
+
+    switch (mMode)
+    {
+        case UIFilePathSelector::Mode_File_Open:
+            path = QIFileDialog::getOpenFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break;
+        case UIFilePathSelector::Mode_File_Save:
+        {
+            path = QIFileDialog::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle);
+            if (!path.isEmpty() && QFileInfo (path).suffix().isEmpty())
+                path = QString ("%1.%2").arg (path).arg (mDefaultSaveExt);
+            break;
+        }
+        case UIFilePathSelector::Mode_Folder:
+            path = QIFileDialog::getExistingDirectory (initDir, parentWidget(), mFileDialogTitle); break;
+    }
+    if (path.isEmpty())
+        return;
+
+    path.remove (QRegExp ("[\\\\/]$"));
+    setPath (path);
+}
+
+void VBoxEmptyFileSelector::textChanged (const QString& aPath)
+{
+    const QString oldPath = mPath;
+    mPath = aPath;
+    if (oldPath != mPath)
+    {
+        mIsModified = true;
+        emit pathChanged (mPath);
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h	(revision 60768)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h	(revision 60768)
@@ -0,0 +1,206 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - VirtualBox Qt extensions: UIFilePathSelector class declaration.
+ */
+
+/*
+ * Copyright (C) 2008-2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * 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
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __VBoxFilePathSelectorWidget_h__
+#define __VBoxFilePathSelectorWidget_h__
+
+/* VBox includes */
+#include "QIWithRetranslateUI.h"
+
+/* Qt includes */
+#include <QComboBox>
+
+/* VBox forward declarations */
+class QILabel;
+class QILineEdit;
+
+/* Qt forward declarations */
+class QHBoxLayout;
+class QAction;
+class QIToolButton;
+
+////////////////////////////////////////////////////////////////////////////////
+// UIFilePathSelector
+
+class UIFilePathSelector: public QIWithRetranslateUI<QComboBox>
+{
+    Q_OBJECT;
+
+public:
+
+    enum Mode
+    {
+        Mode_Folder = 0,
+        Mode_File_Open,
+        Mode_File_Save
+    };
+
+    UIFilePathSelector (QWidget *aParent);
+   ~UIFilePathSelector();
+
+    void setMode (Mode aMode);
+    Mode mode() const;
+
+    void setEditable (bool aOn);
+    bool isEditable() const;
+
+    void setResetEnabled (bool aEnabled);
+    bool isResetEnabled () const;
+
+    void setFileDialogTitle (const QString& aTitle);
+    QString fileDialogTitle() const;
+
+    void setFileFilters (const QString& aFilters);
+    QString fileFilters() const;
+
+    void setDefaultSaveExt (const QString &aExt);
+    QString defaultSaveExt() const;
+
+    void resetModified();
+    bool isModified() const;
+    bool isPathSelected() const;
+
+    QString path() const;
+
+signals:
+    void pathChanged (const QString &);
+
+public slots:
+
+    void setPath (const QString &aPath, bool aRefreshText = true);
+    void setHomeDir (const QString &aHomeDir);
+
+protected:
+
+    void resizeEvent (QResizeEvent *aEvent);
+    void focusInEvent (QFocusEvent *aEvent);
+    void focusOutEvent (QFocusEvent *aEvent);
+    bool eventFilter (QObject *aObj, QEvent *aEv);
+    void retranslateUi();
+
+private slots:
+
+    void onActivated (int aIndex);
+    void onTextEdited (const QString &aPath);
+    void copyToClipboard();
+    void refreshText();
+
+private:
+
+    void changePath (const QString &aPath, bool aRefreshText = true);
+    void selectPath();
+    QIcon defaultIcon() const;
+    QString fullPath (bool aAbsolute = true) const;
+    QString shrinkText (int aWidth) const;
+
+    /* Private member vars */
+    QAction *mCopyAction;
+    Mode mMode;
+    QString mPath;
+    QString mHomeDir;
+    QString mFileFilters;
+    QString mDefaultSaveExt;
+    QString mFileDialogTitle;
+    QString mNoneStr;
+    QString mNoneTip;
+    bool mIsEditable;
+    bool mIsEditableMode;
+    bool mIsMouseAwaited;
+
+    bool mModified;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// VBoxEmptyFileSelector
+
+class VBoxEmptyFileSelector: public QIWithRetranslateUI<QWidget>
+{
+    Q_OBJECT;
+
+public:
+    enum ButtonPosition
+    {
+        LeftPosition,
+        RightPosition
+    };
+
+    VBoxEmptyFileSelector (QWidget *aParent = NULL);
+
+    void setMode (UIFilePathSelector::Mode aMode);
+    UIFilePathSelector::Mode mode() const;
+
+    void setButtonPosition (ButtonPosition aPos);
+    ButtonPosition buttonPosition() const;
+
+    void setEditable (bool aOn);
+    bool isEditable() const;
+
+    void setChooserVisible (bool aOn);
+    bool isChooserVisible() const;
+
+    QString path() const;
+
+    void setDefaultSaveExt (const QString &aExt);
+    QString defaultSaveExt() const;
+
+    bool isModified () const { return mIsModified; }
+    void resetModified () { mIsModified = false; }
+
+    void setChooseButtonToolTip(const QString &strToolTip);
+    QString chooseButtonToolTip() const;
+
+    void setFileDialogTitle (const QString& aTitle);
+    QString fileDialogTitle() const;
+
+    void setFileFilters (const QString& aFilters);
+    QString fileFilters() const;
+
+    void setHomeDir (const QString& aDir);
+    QString homeDir() const;
+
+signals:
+    void pathChanged (QString);
+
+public slots:
+    void setPath (const QString& aPath);
+
+protected:
+    void retranslateUi();
+
+private slots:
+    void choose();
+    void textChanged (const QString& aPath);
+
+private:
+    /* Private member vars */
+    QHBoxLayout *mMainLayout;
+    QWidget *mPathWgt;
+    QILabel *mLabel;
+    UIFilePathSelector::Mode mMode;
+    QILineEdit *mLineEdit;
+    QIToolButton *mSelectButton;
+    bool m_fButtonToolTipSet;
+    QString mFileDialogTitle;
+    QString mFileFilters;
+    QString mDefaultSaveExt;
+    QString mHomeDir;
+    bool mIsModified;
+    QString mPath;
+};
+
+#endif /* __VBoxFilePathSelectorWidget_h__ */
+
Index: unk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxFilePathSelectorWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxFilePathSelectorWidget.cpp	(revision 60767)
+++ 	(revision )
@@ -1,774 +1,0 @@
-/* $Id$ */
-/** @file
- * VBox Qt GUI - VirtualBox Qt extensions: VBoxFilePathSelectorWidget class implementation.
- */
-
-/*
- * Copyright (C) 2008-2013 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * 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
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifdef VBOX_WITH_PRECOMPILED_HEADERS
-# include <precomp.h>
-#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
-/* Local includes */
-# include "QIFileDialog.h"
-# include "QIToolButton.h"
-# include "QILabel.h"
-# include "QILineEdit.h"
-# include "UIIconPool.h"
-# include "VBoxFilePathSelectorWidget.h"
-# include "VBoxGlobal.h"
-
-/* Global includes */
-# include <iprt/assert.h>
-# include <QAction>
-# include <QApplication>
-# include <QClipboard>
-# include <QDir>
-# include <QFocusEvent>
-# include <QHBoxLayout>
-# include <QLineEdit>
-# include <QTimer>
-
-#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxFilePathSelectorWidget
-
-enum
-{
-    PathId = 0,
-    SelectId,
-    ResetId
-};
-
-/**
- * Returns first position of difference between passed strings.
- */
-static int differFrom (const QString &aS1, const QString &aS2)
-{
-    if (aS1 == aS2)
-        return -1;
-
-    int minLength = qMin (aS1.size(), aS2.size());
-    int index = 0;
-    for (index = 0; index < minLength ; ++ index)
-        if (aS1 [index] != aS2 [index])
-            break;
-    return index;
-}
-
-VBoxFilePathSelectorWidget::VBoxFilePathSelectorWidget (QWidget *aParent)
-    : QIWithRetranslateUI<QComboBox> (aParent)
-    , mCopyAction (new QAction (this))
-    , mMode (Mode_Folder)
-    , mHomeDir (QDir::current().absolutePath())
-    , mIsEditable (true)
-    , mIsEditableMode (false)
-    , mIsMouseAwaited (false)
-    , mModified (false)
-{
-    /* Populate items */
-    insertItem (PathId, "");
-    insertItem (SelectId, "");
-    insertItem (ResetId, "");
-
-    /* Attaching known icons */
-    setItemIcon(SelectId, UIIconPool::iconSet(":/select_file_16px.png"));
-    setItemIcon(ResetId, UIIconPool::iconSet(":/eraser_16px.png"));
-
-    /* Setup context menu */
-    addAction (mCopyAction);
-    mCopyAction->setShortcut (QKeySequence (QKeySequence::Copy));
-    mCopyAction->setShortcutContext (Qt::WidgetShortcut);
-
-    /* Initial Setup */
-    setInsertPolicy (QComboBox::NoInsert);
-    setContextMenuPolicy (Qt::ActionsContextMenu);
-    setMinimumWidth (200);
-
-    /* Setup connections */
-    connect (this, SIGNAL (activated (int)), this, SLOT (onActivated (int)));
-    connect (mCopyAction, SIGNAL (triggered (bool)), this, SLOT (copyToClipboard()));
-
-    /* Editable by default */
-    setEditable (true);
-
-    /* Applying language settings */
-    retranslateUi();
-}
-
-VBoxFilePathSelectorWidget::~VBoxFilePathSelectorWidget()
-{
-}
-
-void VBoxFilePathSelectorWidget::setMode (Mode aMode)
-{
-    mMode = aMode;
-}
-
-VBoxFilePathSelectorWidget::Mode VBoxFilePathSelectorWidget::mode() const
-{
-    return mMode;
-}
-
-void VBoxFilePathSelectorWidget::setEditable (bool aOn)
-{
-    mIsEditable = aOn;
-
-    if (mIsEditable)
-    {
-        QComboBox::setEditable (true);
-        Assert (lineEdit());
-        connect (lineEdit(), SIGNAL (textEdited (const QString &)),
-                 this, SLOT (onTextEdited (const QString &)));
-
-        /* Installing necessary event filters */
-        lineEdit()->installEventFilter (this);
-    }
-    else
-    {
-        if (lineEdit())
-        {
-            /* Installing necessary event filters */
-            lineEdit()->installEventFilter (this);
-            disconnect (lineEdit(), SIGNAL (textEdited (const QString &)),
-                        this, SLOT (onTextEdited (const QString &)));
-        }
-        QComboBox::setEditable (false);
-    }
-}
-
-bool VBoxFilePathSelectorWidget::isEditable() const
-{
-    return mIsEditable;
-}
-
-void VBoxFilePathSelectorWidget::setResetEnabled (bool aEnabled)
-{
-    if (!aEnabled && count() - 1 == ResetId)
-        removeItem (ResetId);
-    else if (aEnabled && count() - 1 == ResetId - 1)
-    {
-        insertItem (ResetId, "");
-        setItemIcon(ResetId, UIIconPool::iconSet(":/eraser_16px.png"));
-    }
-    retranslateUi();
-}
-
-bool VBoxFilePathSelectorWidget::isResetEnabled() const
-{
-    return (count() - 1  == ResetId);
-}
-
-void VBoxFilePathSelectorWidget::resetModified()
-{
-    mModified = false;
-}
-
-bool VBoxFilePathSelectorWidget::isModified() const
-{
-    return mModified;
-}
-
-void VBoxFilePathSelectorWidget::setFileDialogTitle (const QString& aTitle)
-{
-    mFileDialogTitle = aTitle;
-}
-
-QString VBoxFilePathSelectorWidget::fileDialogTitle() const
-{
-    return mFileDialogTitle;
-}
-
-void VBoxFilePathSelectorWidget::setFileFilters (const QString& aFilters)
-{
-    mFileFilters = aFilters;
-}
-
-QString VBoxFilePathSelectorWidget::fileFilters() const
-{
-    return mFileFilters;
-}
-
-void VBoxFilePathSelectorWidget::setDefaultSaveExt (const QString &aExt)
-{
-    mDefaultSaveExt = aExt;
-}
-
-QString VBoxFilePathSelectorWidget::defaultSaveExt() const
-{
-    return mDefaultSaveExt;
-}
-
-/**
- * Returns @c true if the selected (active) combobox item is a path item.
- *
- * May be used in @c activated() signal handlers to distinguish between
- * non-path items like "Other..." or "Reset" that get temporarily activated
- * when performing the corresponding action and the item that contains a
- * real selected file/folder path.
- */
-bool VBoxFilePathSelectorWidget::isPathSelected() const
-{
-    return (currentIndex() == PathId);
-}
-
-QString VBoxFilePathSelectorWidget::path() const
-{
-    return mPath;
-}
-
-void VBoxFilePathSelectorWidget::setPath (const QString &aPath, bool aRefreshText /* = true */)
-{
-    mPath = aPath.isEmpty() ? QString::null :
-            QDir::toNativeSeparators (aPath);
-    if (aRefreshText)
-        refreshText();
-}
-
-void VBoxFilePathSelectorWidget::setHomeDir (const QString &aHomeDir)
-{
-    mHomeDir = aHomeDir;
-}
-
-void VBoxFilePathSelectorWidget::resizeEvent (QResizeEvent *aEvent)
-{
-    QIWithRetranslateUI<QComboBox>::resizeEvent (aEvent);
-    refreshText();
-}
-
-void VBoxFilePathSelectorWidget::focusInEvent (QFocusEvent *aEvent)
-{
-    if (isPathSelected())
-    {
-        if (mIsEditable)
-            mIsEditableMode = true;
-        if (aEvent->reason() == Qt::MouseFocusReason)
-            mIsMouseAwaited = true;
-        else
-            refreshText();
-    }
-    QIWithRetranslateUI<QComboBox>::focusInEvent (aEvent);
-}
-
-void VBoxFilePathSelectorWidget::focusOutEvent (QFocusEvent *aEvent)
-{
-    if (isPathSelected())
-    {
-        mIsEditableMode = false;
-        refreshText();
-    }
-    QIWithRetranslateUI<QComboBox>::focusOutEvent (aEvent);
-}
-
-bool VBoxFilePathSelectorWidget::eventFilter (QObject *aObj, QEvent *aEv)
-{
-    if (mIsMouseAwaited && (aEv->type() == QEvent::MouseButtonPress))
-        QTimer::singleShot (0, this, SLOT (refreshText()));
-
-    return QIWithRetranslateUI<QComboBox>::eventFilter (aObj, aEv);
-}
-
-void VBoxFilePathSelectorWidget::retranslateUi()
-{
-    /* How do we interpret the "nothing selected" item? */
-    if (isResetEnabled())
-    {
-        mNoneStr = tr ("<reset to default>");
-        mNoneTip = tr ("The actual default path value will be displayed after "
-                       "accepting the changes and opening this window again.");
-    }
-    else
-    {
-        mNoneStr = tr ("<not selected>");
-        mNoneTip = tr ("Please use the <b>Other...</b> item from the drop-down "
-                       "list to select a path.");
-    }
-
-    /* Retranslate 'path' item */
-    if (mPath.isNull())
-    {
-        setItemText (PathId, mNoneStr);
-        setItemData (PathId, mNoneTip, Qt::ToolTipRole);
-        setToolTip (mNoneTip);
-    }
-
-    /* Retranslate 'select' item */
-    setItemText (SelectId, tr ("Other..."));
-
-    /* Retranslate 'reset' item */
-    if (count() - 1 == ResetId)
-        setItemText (ResetId, tr ("Reset"));
-
-    /* Set tooltips of the above two items based on the mode */
-    switch (mMode)
-    {
-        case Mode_Folder:
-            setItemData (SelectId,
-                         tr ("Displays a window to select a different folder."),
-                         Qt::ToolTipRole);
-            setItemData (ResetId,
-                         tr ("Resets the folder path to the default value."),
-                         Qt::ToolTipRole);
-            break;
-        case Mode_File_Open:
-        case Mode_File_Save:
-            setItemData (SelectId,
-                         tr ("Displays a window to select a different file."),
-                         Qt::ToolTipRole);
-            setItemData (ResetId,
-                         tr ("Resets the file path to the default value."),
-                         Qt::ToolTipRole);
-            break;
-        default:
-            AssertFailedBreak();
-    }
-
-    /* Retranslate copy action */
-    mCopyAction->setText (tr ("&Copy"));
-}
-
-void VBoxFilePathSelectorWidget::onActivated (int aIndex)
-{
-    switch (aIndex)
-    {
-        case SelectId:
-        {
-            selectPath();
-            break;
-        }
-        case ResetId:
-        {
-            changePath (QString::null);
-            break;
-        }
-        default:
-            break;
-    }
-    setCurrentIndex (PathId);
-    setFocus();
-}
-
-void VBoxFilePathSelectorWidget::onTextEdited (const QString &aPath)
-{
-    changePath (aPath, false /* refresh text? */);
-}
-
-void VBoxFilePathSelectorWidget::copyToClipboard()
-{
-    QString text (fullPath());
-    /* Copy the current text to the selection and global clipboard. */
-    if (QApplication::clipboard()->supportsSelection())
-        QApplication::clipboard()->setText (text, QClipboard::Selection);
-    QApplication::clipboard()->setText (text, QClipboard::Clipboard);
-}
-
-void VBoxFilePathSelectorWidget::changePath (const QString &aPath,
-                                             bool aRefreshText /* = true */)
-{
-    QString oldPath = mPath;
-    setPath (aPath, aRefreshText);
-    if (!mModified && mPath != oldPath)
-        mModified = true;
-    emit pathChanged (aPath);
-}
-
-void VBoxFilePathSelectorWidget::selectPath()
-{
-    /* Preparing initial directory. */
-    QString initDir = mPath.isNull() ? mHomeDir :
-        QIFileDialog::getFirstExistingDir (mPath);
-    if (initDir.isNull())
-        initDir = mHomeDir;
-
-    QString selPath;
-    switch (mMode)
-    {
-        case Mode_File_Open:
-            selPath = QIFileDialog::getOpenFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break;
-        case Mode_File_Save:
-            {
-                selPath = QIFileDialog::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle);
-                if (!selPath.isEmpty() && QFileInfo (selPath).suffix().isEmpty())
-                    selPath = QString ("%1.%2").arg (selPath).arg (mDefaultSaveExt);
-                break;
-            }
-        case Mode_Folder:
-            selPath = QIFileDialog::getExistingDirectory (initDir, parentWidget(), mFileDialogTitle); break;
-    }
-
-    if (selPath.isNull())
-        return;
-
-    selPath.remove (QRegExp ("[\\\\/]$"));
-    changePath (selPath);
-}
-
-QIcon VBoxFilePathSelectorWidget::defaultIcon() const
-{
-    if (mMode == Mode_Folder)
-        return vboxGlobal().icon(QFileIconProvider::Folder);
-    else
-        return vboxGlobal().icon(QFileIconProvider::File);
-}
-
-QString VBoxFilePathSelectorWidget::fullPath (bool aAbsolute /* = true */) const
-{
-    if (mPath.isNull())
-        return mPath;
-
-    QString result;
-    switch (mMode)
-    {
-        case Mode_Folder:
-            result = aAbsolute ? QDir (mPath).absolutePath() :
-                                 QDir (mPath).path();
-            break;
-        case Mode_File_Open:
-        case Mode_File_Save:
-            result = aAbsolute ? QFileInfo (mPath).absoluteFilePath() :
-                                 QFileInfo (mPath).filePath();
-            break;
-        default:
-            AssertFailedBreak();
-    }
-    return QDir::toNativeSeparators (result);
-}
-
-QString VBoxFilePathSelectorWidget::shrinkText (int aWidth) const
-{
-    QString fullText (fullPath (false));
-    if (fullText.isEmpty())
-        return fullText;
-
-    int oldSize = fontMetrics().width (fullText);
-    int indentSize = fontMetrics().width ("x...x");
-
-    /* Compress text */
-    int start = 0;
-    int finish = 0;
-    int position = 0;
-    int textWidth = 0;
-    do {
-        textWidth = fontMetrics().width (fullText);
-        if (textWidth + indentSize > aWidth)
-        {
-            start = 0;
-            finish = fullText.length();
-
-            /* Selecting remove position */
-            QRegExp regExp ("([\\\\/][^\\\\^/]+[\\\\/]?$)");
-            int newFinish = regExp.indexIn (fullText);
-            if (newFinish != -1)
-                finish = newFinish;
-            position = (finish - start) / 2;
-
-            if (position == finish)
-               break;
-
-            fullText.remove (position, 1);
-        }
-    } while (textWidth + indentSize > aWidth);
-
-    fullText.insert (position, "...");
-    int newSize = fontMetrics().width (fullText);
-
-    return newSize < oldSize ? fullText : fullPath (false);
-}
-
-void VBoxFilePathSelectorWidget::refreshText()
-{
-    if (mIsEditable && mIsEditableMode)
-    {
-        /* Cursor positioning variables */
-        int curPos = -1;
-        int diffPos = -1;
-        int fromRight = -1;
-
-        if (mIsMouseAwaited)
-        {
-            /* Store the cursor position */
-            curPos = lineEdit()->cursorPosition();
-            diffPos = differFrom (lineEdit()->text(), mPath);
-            fromRight = lineEdit()->text().size() - curPos;
-        }
-
-        /* In editable mode there should be no any icon
-         * and text have be corresponding real stored path
-         * which can be absolute or relative. */
-        if (lineEdit()->text() != mPath)
-            setItemText (PathId, mPath);
-        setItemIcon (PathId, QIcon());
-        setToolTip (mMode == Mode_Folder ?
-            tr ("Holds the folder path.") :
-            tr ("Holds the file path."));
-
-        if (mIsMouseAwaited)
-        {
-            mIsMouseAwaited = false;
-
-            /* Restore the position to the right of dots */
-            if (diffPos != -1 && curPos >= diffPos + 3)
-                lineEdit()->setCursorPosition (lineEdit()->text().size() -
-                                               fromRight);
-            /* Restore the position to the center of text */
-            else if (diffPos != -1 && curPos > diffPos)
-                lineEdit()->setCursorPosition (lineEdit()->text().size() / 2);
-            /* Restore the position to the left of dots */
-            else
-                lineEdit()->setCursorPosition (curPos);
-        }
-    }
-    else if (mPath.isNull())
-    {
-        /* If we are not in editable mode and no path is
-         * stored here - show the translated 'none' string. */
-        if (itemText (PathId) != mNoneStr)
-        {
-            setItemText (PathId, mNoneStr);
-            setItemIcon (PathId, QIcon());
-            setItemData (PathId, mNoneTip, Qt::ToolTipRole);
-            setToolTip (mNoneTip);
-        }
-    }
-    else
-    {
-        /* Compress text in combobox */
-        QStyleOptionComboBox options;
-        options.initFrom (this);
-        QRect rect = QApplication::style()->subControlRect (
-            QStyle::CC_ComboBox, &options, QStyle::SC_ComboBoxEditField);
-        setItemText (PathId, shrinkText (rect.width() - iconSize().width()));
-
-        /* Attach corresponding icon */
-        setItemIcon (PathId, QFileInfo (mPath).exists() ?
-                             vboxGlobal().icon(QFileInfo (mPath)) :
-                             defaultIcon());
-
-        /* Set the tooltip */
-        setToolTip (fullPath());
-        setItemData (PathId, toolTip(), Qt::ToolTipRole);
-    }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxEmptyFileSelector
-
-VBoxEmptyFileSelector::VBoxEmptyFileSelector (QWidget *aParent /* = NULL */)
-    : QIWithRetranslateUI<QWidget> (aParent)
-    , mPathWgt (NULL)
-    , mLabel (NULL)
-    , mMode (VBoxFilePathSelectorWidget::Mode_File_Open)
-    , mLineEdit (NULL)
-    , m_fButtonToolTipSet(false)
-    , mHomeDir (QDir::current().absolutePath())
-    , mIsModified (false)
-{
-    mMainLayout = new QHBoxLayout (this);
-    mMainLayout->setMargin (0);
-
-    mSelectButton = new QIToolButton(this);
-    mSelectButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));
-    connect(mSelectButton, SIGNAL(clicked()), this, SLOT(choose()));
-    mMainLayout->addWidget(mSelectButton);
-
-    setEditable (false);
-
-    retranslateUi();
-}
-
-void VBoxEmptyFileSelector::setMode (VBoxFilePathSelectorWidget::Mode aMode)
-{
-    mMode = aMode;
-}
-
-VBoxFilePathSelectorWidget::Mode VBoxEmptyFileSelector::mode() const
-{
-    return mMode;
-}
-
-void VBoxEmptyFileSelector::setButtonPosition (ButtonPosition aPos)
-{
-    if (aPos == LeftPosition)
-    {
-        mMainLayout->setDirection (QBoxLayout::LeftToRight);
-        setTabOrder (mSelectButton, mPathWgt);
-    }
-    else
-    {
-        mMainLayout->setDirection (QBoxLayout::RightToLeft);
-        setTabOrder (mPathWgt, mSelectButton);
-    }
-}
-
-VBoxEmptyFileSelector::ButtonPosition VBoxEmptyFileSelector::buttonPosition() const
-{
-    return mMainLayout->direction() == QBoxLayout::LeftToRight ? LeftPosition : RightPosition;
-}
-
-void VBoxEmptyFileSelector::setEditable (bool aOn)
-{
-    if (mPathWgt)
-    {
-        delete mPathWgt;
-        mLabel = NULL;
-        mLineEdit = NULL;
-    }
-
-    if (aOn)
-    {
-        mPathWgt = mLineEdit = new QILineEdit (this);
-        connect (mLineEdit, SIGNAL (textChanged (const QString&)),
-                 this, SLOT (textChanged (const QString&)));
-    }
-    else
-    {
-        mPathWgt = mLabel = new QILabel (this);
-        mLabel->setWordWrap (true);
-    }
-    mMainLayout->addWidget (mPathWgt, 2);
-    setButtonPosition (buttonPosition());
-
-    setPath (mPath);
-}
-
-bool VBoxEmptyFileSelector::isEditable() const
-{
-    return mLabel ? false : true;
-}
-
-void VBoxEmptyFileSelector::setChooserVisible (bool aOn)
-{
-    mSelectButton->setVisible (aOn);
-}
-
-bool VBoxEmptyFileSelector::isChooserVisible() const
-{
-    return mSelectButton->isVisible();
-}
-
-void VBoxEmptyFileSelector::setPath (const QString& aPath)
-{
-    QString tmpPath = QDir::toNativeSeparators (aPath);
-    if (mLabel)
-        mLabel->setText (QString ("<compact elipsis=\"start\">%1</compact>").arg (tmpPath));
-    else if (mLineEdit)
-        mLineEdit->setText (tmpPath);
-    textChanged(tmpPath);
-}
-
-QString VBoxEmptyFileSelector::path() const
-{
-    return mPath;
-}
-
-void VBoxEmptyFileSelector::setDefaultSaveExt (const QString &aExt)
-{
-    mDefaultSaveExt = aExt;
-}
-
-QString VBoxEmptyFileSelector::defaultSaveExt() const
-{
-    return mDefaultSaveExt;
-}
-
-void VBoxEmptyFileSelector::setChooseButtonToolTip(const QString &strToolTip)
-{
-    m_fButtonToolTipSet = !strToolTip.isEmpty();
-    mSelectButton->setToolTip(strToolTip);
-}
-
-QString VBoxEmptyFileSelector::chooseButtonToolTip() const
-{
-    return mSelectButton->toolTip();
-}
-
-void VBoxEmptyFileSelector::setFileDialogTitle (const QString& aTitle)
-{
-    mFileDialogTitle = aTitle;
-}
-
-QString VBoxEmptyFileSelector::fileDialogTitle() const
-{
-    return mFileDialogTitle;
-}
-
-void VBoxEmptyFileSelector::setFileFilters (const QString& aFilters)
-{
-    mFileFilters = aFilters;
-}
-
-QString VBoxEmptyFileSelector::fileFilters() const
-{
-    return mFileFilters;
-}
-
-void VBoxEmptyFileSelector::setHomeDir (const QString& aDir)
-{
-    mHomeDir = aDir;
-}
-
-QString VBoxEmptyFileSelector::homeDir() const
-{
-    return mHomeDir;
-}
-
-void VBoxEmptyFileSelector::retranslateUi()
-{
-    if (!m_fButtonToolTipSet)
-        mSelectButton->setToolTip(tr("Choose..."));
-}
-
-void VBoxEmptyFileSelector::choose()
-{
-    QString path = mPath;
-
-    /* Preparing initial directory. */
-    QString initDir = path.isNull() ? mHomeDir :
-        QIFileDialog::getFirstExistingDir (path);
-    if (initDir.isNull())
-        initDir = mHomeDir;
-
-    switch (mMode)
-    {
-        case VBoxFilePathSelectorWidget::Mode_File_Open:
-            path = QIFileDialog::getOpenFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break;
-        case VBoxFilePathSelectorWidget::Mode_File_Save:
-        {
-            path = QIFileDialog::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle);
-            if (!path.isEmpty() && QFileInfo (path).suffix().isEmpty())
-                path = QString ("%1.%2").arg (path).arg (mDefaultSaveExt);
-            break;
-        }
-        case VBoxFilePathSelectorWidget::Mode_Folder:
-            path = QIFileDialog::getExistingDirectory (initDir, parentWidget(), mFileDialogTitle); break;
-    }
-    if (path.isEmpty())
-        return;
-
-    path.remove (QRegExp ("[\\\\/]$"));
-    setPath (path);
-}
-
-void VBoxEmptyFileSelector::textChanged (const QString& aPath)
-{
-    const QString oldPath = mPath;
-    mPath = aPath;
-    if (oldPath != mPath)
-    {
-        mIsModified = true;
-        emit pathChanged (mPath);
-    }
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxFilePathSelectorWidget.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxFilePathSelectorWidget.h	(revision 60767)
+++ 	(revision )
@@ -1,206 +1,0 @@
-/* $Id$ */
-/** @file
- * VBox Qt GUI - VirtualBox Qt extensions: VBoxFilePathSelectorWidget class declaration.
- */
-
-/*
- * Copyright (C) 2008-2013 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * 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
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxFilePathSelectorWidget_h__
-#define __VBoxFilePathSelectorWidget_h__
-
-/* VBox includes */
-#include "QIWithRetranslateUI.h"
-
-/* Qt includes */
-#include <QComboBox>
-
-/* VBox forward declarations */
-class QILabel;
-class QILineEdit;
-
-/* Qt forward declarations */
-class QHBoxLayout;
-class QAction;
-class QIToolButton;
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxFilePathSelectorWidget
-
-class VBoxFilePathSelectorWidget: public QIWithRetranslateUI<QComboBox>
-{
-    Q_OBJECT;
-
-public:
-
-    enum Mode
-    {
-        Mode_Folder = 0,
-        Mode_File_Open,
-        Mode_File_Save
-    };
-
-    VBoxFilePathSelectorWidget (QWidget *aParent);
-   ~VBoxFilePathSelectorWidget();
-
-    void setMode (Mode aMode);
-    Mode mode() const;
-
-    void setEditable (bool aOn);
-    bool isEditable() const;
-
-    void setResetEnabled (bool aEnabled);
-    bool isResetEnabled () const;
-
-    void setFileDialogTitle (const QString& aTitle);
-    QString fileDialogTitle() const;
-
-    void setFileFilters (const QString& aFilters);
-    QString fileFilters() const;
-
-    void setDefaultSaveExt (const QString &aExt);
-    QString defaultSaveExt() const;
-
-    void resetModified();
-    bool isModified() const;
-    bool isPathSelected() const;
-
-    QString path() const;
-
-signals:
-    void pathChanged (const QString &);
-
-public slots:
-
-    void setPath (const QString &aPath, bool aRefreshText = true);
-    void setHomeDir (const QString &aHomeDir);
-
-protected:
-
-    void resizeEvent (QResizeEvent *aEvent);
-    void focusInEvent (QFocusEvent *aEvent);
-    void focusOutEvent (QFocusEvent *aEvent);
-    bool eventFilter (QObject *aObj, QEvent *aEv);
-    void retranslateUi();
-
-private slots:
-
-    void onActivated (int aIndex);
-    void onTextEdited (const QString &aPath);
-    void copyToClipboard();
-    void refreshText();
-
-private:
-
-    void changePath (const QString &aPath, bool aRefreshText = true);
-    void selectPath();
-    QIcon defaultIcon() const;
-    QString fullPath (bool aAbsolute = true) const;
-    QString shrinkText (int aWidth) const;
-
-    /* Private member vars */
-    QAction *mCopyAction;
-    Mode mMode;
-    QString mPath;
-    QString mHomeDir;
-    QString mFileFilters;
-    QString mDefaultSaveExt;
-    QString mFileDialogTitle;
-    QString mNoneStr;
-    QString mNoneTip;
-    bool mIsEditable;
-    bool mIsEditableMode;
-    bool mIsMouseAwaited;
-
-    bool mModified;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxEmptyFileSelector
-
-class VBoxEmptyFileSelector: public QIWithRetranslateUI<QWidget>
-{
-    Q_OBJECT;
-
-public:
-    enum ButtonPosition
-    {
-        LeftPosition,
-        RightPosition
-    };
-
-    VBoxEmptyFileSelector (QWidget *aParent = NULL);
-
-    void setMode (VBoxFilePathSelectorWidget::Mode aMode);
-    VBoxFilePathSelectorWidget::Mode mode() const;
-
-    void setButtonPosition (ButtonPosition aPos);
-    ButtonPosition buttonPosition() const;
-
-    void setEditable (bool aOn);
-    bool isEditable() const;
-
-    void setChooserVisible (bool aOn);
-    bool isChooserVisible() const;
-
-    QString path() const;
-
-    void setDefaultSaveExt (const QString &aExt);
-    QString defaultSaveExt() const;
-
-    bool isModified () const { return mIsModified; }
-    void resetModified () { mIsModified = false; }
-
-    void setChooseButtonToolTip(const QString &strToolTip);
-    QString chooseButtonToolTip() const;
-
-    void setFileDialogTitle (const QString& aTitle);
-    QString fileDialogTitle() const;
-
-    void setFileFilters (const QString& aFilters);
-    QString fileFilters() const;
-
-    void setHomeDir (const QString& aDir);
-    QString homeDir() const;
-
-signals:
-    void pathChanged (QString);
-
-public slots:
-    void setPath (const QString& aPath);
-
-protected:
-    void retranslateUi();
-
-private slots:
-    void choose();
-    void textChanged (const QString& aPath);
-
-private:
-    /* Private member vars */
-    QHBoxLayout *mMainLayout;
-    QWidget *mPathWgt;
-    QILabel *mLabel;
-    VBoxFilePathSelectorWidget::Mode mMode;
-    QILineEdit *mLineEdit;
-    QIToolButton *mSelectButton;
-    bool m_fButtonToolTipSet;
-    QString mFileDialogTitle;
-    QString mFileFilters;
-    QString mDefaultSaveExt;
-    QString mHomeDir;
-    bool mIsModified;
-    QString mPath;
-};
-
-#endif /* __VBoxFilePathSelectorWidget_h__ */
-
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp	(revision 60768)
@@ -34,5 +34,5 @@
 # include "UIWizardExportAppDefs.h"
 # include "VBoxGlobal.h"
-# include "VBoxFilePathSelectorWidget.h"
+# include "UIFilePathSelector.h"
 # include "QIRichTextLabel.h"
 
@@ -228,5 +228,5 @@
             m_pFileSelector = new VBoxEmptyFileSelector(this);
             {
-                m_pFileSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Save);
+                m_pFileSelector->setMode(UIFilePathSelector::Mode_File_Save);
                 m_pFileSelector->setEditable(true);
                 m_pFileSelector->setButtonPosition(VBoxEmptyFileSelector::RightPosition);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp	(revision 60768)
@@ -36,5 +36,5 @@
 # include "UIWizardExportAppDefs.h"
 # include "VBoxGlobal.h"
-# include "VBoxFilePathSelectorWidget.h"
+# include "UIFilePathSelector.h"
 # include "UIApplianceExportEditorWidget.h"
 
@@ -119,5 +119,5 @@
                 m_pFileSelector = new VBoxEmptyFileSelector(m_pSettingsCnt);
                 {
-                    m_pFileSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Save);
+                    m_pFileSelector->setMode(UIFilePathSelector::Mode_File_Save);
                     m_pFileSelector->setEditable(true);
                     m_pFileSelector->setButtonPosition(VBoxEmptyFileSelector::RightPosition);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp	(revision 60768)
@@ -29,5 +29,5 @@
 # include "UIWizardImportApp.h"
 # include "VBoxGlobal.h"
-# include "VBoxFilePathSelectorWidget.h"
+# include "UIFilePathSelector.h"
 # include "QIRichTextLabel.h"
 
@@ -48,5 +48,5 @@
         {
             m_pFileSelector->setHomeDir(vboxGlobal().documentsPath());
-            m_pFileSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Open);
+            m_pFileSelector->setMode(UIFilePathSelector::Mode_File_Open);
             m_pFileSelector->setButtonPosition(VBoxEmptyFileSelector::RightPosition);
             m_pFileSelector->setEditable(true);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp	(revision 60767)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp	(revision 60768)
@@ -29,5 +29,5 @@
 # include "UIWizardImportApp.h"
 # include "VBoxGlobal.h"
-# include "VBoxFilePathSelectorWidget.h"
+# include "UIFilePathSelector.h"
 # include "UIApplianceImportEditorWidget.h"
 
@@ -49,5 +49,5 @@
                 {
                     m_pFileSelector->setHomeDir(vboxGlobal().documentsPath());
-                    m_pFileSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Open);
+                    m_pFileSelector->setMode(UIFilePathSelector::Mode_File_Open);
                     m_pFileSelector->setButtonPosition(VBoxEmptyFileSelector::RightPosition);
                     m_pFileSelector->setEditable(true);
