Changeset 47136 in vbox for trunk/src/VBox
- Timestamp:
- Jul 14, 2013 5:09:35 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/global
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp
r44528 r47136 7 7 8 8 /* 9 * Copyright (C) 2006-201 2Oracle Corporation9 * Copyright (C) 2006-2013 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 */ 19 19 20 /* Global includes*/20 /* Qt includes: */ 21 21 #include <QDir> 22 22 #include <QHeaderView> … … 24 24 #include <QTranslator> 25 25 26 /* GUI includes: */ 27 #include "UIGlobalSettingsLanguage.h" 28 #include "VBoxGlobalSettings.h" 29 #include "VBoxGlobal.h" 30 31 /* Other VBox includes: */ 26 32 #include <iprt/err.h> 27 33 #include <iprt/param.h> 28 34 #include <iprt/path.h> 29 35 #include <VBox/version.h> 30 31 /* Local includes */32 #include "UIGlobalSettingsLanguage.h"33 #include "VBoxGlobalSettings.h"34 #include "VBoxGlobal.h"35 36 36 37 extern const char *gVBoxLangSubDir; … … 179 180 m_pLanguageTree->hideColumn(2); 180 181 m_pLanguageTree->hideColumn(3); 182 m_pLanguageInfo->setWordWrapMode(QTextOption::WordWrap); 181 183 182 184 /* Setup connections: */ … … 210 212 /* Fetch from cache: */ 211 213 reload(m_cache.m_strLanguageId); 212 m_pLanguageInfo->setFixedHeight(fontMetrics().height() * 4); 214 215 /* Remember current info-label width: */ 216 m_pLanguageInfo->setMinimumTextWidth(m_pLanguageInfo->width()); 213 217 } 214 218 … … 239 243 } 240 244 241 /* Navigation stuff: */242 245 void UIGlobalSettingsLanguage::setOrderAfter(QWidget *pWidget) 243 246 { 247 /* Configure navigation: */ 244 248 setTabOrder(pWidget, m_pLanguageTree); 245 249 } 246 250 247 /* Translation stuff: */248 251 void UIGlobalSettingsLanguage::retranslateUi() 249 252 { … … 255 258 } 256 259 257 /* Reload language tree: */258 260 void UIGlobalSettingsLanguage::reload(const QString &strLangId) 259 261 { … … 296 298 297 299 /* Adjust selector list: */ 298 #ifdef Q_WS_MAC299 int width = qMax(static_cast<QAbstractItemView*>(m_pLanguageTree)->sizeHintForColumn(0) +300 2 * m_pLanguageTree->frameWidth() + QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),301 220);302 m_pLanguageTree->setFixedWidth(width);303 #else /* Q_WS_MAC */304 m_pLanguageTree->setMinimumWidth(static_cast<QAbstractItemView*>(m_pLanguageTree)->sizeHintForColumn(0) +305 2 * m_pLanguageTree->frameWidth() + QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent));306 #endif /* Q_WS_MAC */307 300 m_pLanguageTree->resizeColumnToContents(0); 308 301 … … 325 318 } 326 319 327 /* Routine to paint language items: */328 320 void UIGlobalSettingsLanguage::sltLanguageItemPainted(QTreeWidgetItem *pItem, QPainter *pPainter) 329 321 { … … 341 333 } 342 334 343 /* Slot to handle currently language change fact: */344 335 void UIGlobalSettingsLanguage::sltCurrentLanguageChanged(QTreeWidgetItem *pItem) 345 336 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.h
r44528 r47136 6 6 7 7 /* 8 * Copyright (C) 2006-201 2Oracle Corporation8 * Copyright (C) 2006-2013 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIGlobalSettingsLanguage_h__ 21 21 22 /* Local includes*/22 /* GUI includes: */ 23 23 #include "UISettingsPage.h" 24 24 #include "UIGlobalSettingsLanguage.gen.h" … … 56 56 void saveFromCacheTo(QVariant &data); 57 57 58 /* Navigation stuff: */58 /* Helper: Navigation stuff: */ 59 59 void setOrderAfter(QWidget *pWidget); 60 60 61 /* Translation stuff: */61 /* Helper: Translation stuff: */ 62 62 void retranslateUi(); 63 64 /* Reload language tree: */65 void reload(const QString &strLangId);66 63 67 64 private slots: 68 65 69 /* Routine to paint language items: */66 /* Handler: List-painting stuff: */ 70 67 void sltLanguageItemPainted(QTreeWidgetItem *pItem, QPainter *pPainter); 71 68 72 /* Slot to handle current language change signal: */69 /* Handler: Current-changed stuff: */ 73 70 void sltCurrentLanguageChanged(QTreeWidgetItem *pItem); 74 71 75 72 private: 76 73 77 /* Edited flag: */ 74 /* Helper: List-loading stuff: */ 75 void reload(const QString &strLangId); 76 77 /* Variables: */ 78 78 bool m_fIsLanguageChanged; 79 79 … … 83 83 84 84 #endif // __UIGlobalSettingsLanguage_h__ 85 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.ui
r43106 r47136 15 15 <class>UIGlobalSettingsLanguage</class> 16 16 <widget class="QWidget" name="UIGlobalSettingsLanguage"> 17 <property name="geometry">18 <rect>19 <x>0</x>20 <y>0</y>21 <width>350</width>22 <height>250</height>23 </rect>24 </property>25 17 <layout class="QGridLayout"> 26 18 <property name="margin"> … … 28 20 </property> 29 21 <item row="0" column="0"> 30 <spacer> 31 <property name="orientation"> 32 <enum>Qt::Horizontal</enum> 33 </property> 34 <property name="sizeType"> 35 <enum>QSizePolicy::Fixed</enum> 36 </property> 37 <property name="sizeHint"> 38 <size> 39 <width>40</width> 40 <height>20</height> 41 </size> 42 </property> 43 </spacer> 44 </item> 45 <item row="0" column="1" colspan="2"> 46 <widget class="QLabel" name="m_pLanguageLabel"> 22 <widget class="QILabelSeparator" native="1" name="m_pLanguageLabel"> 47 23 <property name="text"> 48 <string>&Interface Language :</string>24 <string>&Interface Languages</string> 49 25 </property> 50 26 <property name="buddy"> … … 53 29 </widget> 54 30 </item> 55 <item row="1" column="1"> 56 <spacer> 57 <property name="orientation"> 58 <enum>Qt::Horizontal</enum> 59 </property> 60 <property name="sizeType"> 61 <enum>QSizePolicy::Fixed</enum> 62 </property> 63 <property name="sizeHint"> 64 <size> 65 <width>20</width> 66 <height>0</height> 67 </size> 68 </property> 69 </spacer> 70 </item> 71 <item row="1" column="2"> 31 <item row="1" column="0"> 72 32 <widget class="QITreeWidget" name="m_pLanguageTree"> 73 <property name="sizePolicy">74 <sizepolicy vsizetype="Expanding" hsizetype="Expanding">75 <horstretch>0</horstretch>76 <verstretch>0</verstretch>77 </sizepolicy>78 </property>79 <property name="minimumSize">80 <size>81 <width>0</width>82 <height>150</height>83 </size>84 </property>85 33 <property name="whatsThis"> 86 34 <string>Lists all available user interface languages. The effective language is written in <b>bold</b>. Select <i>Default</i> to reset to the system default language.</string> … … 111 59 </widget> 112 60 </item> 113 <item row="2" column="2"> 114 <widget class="QILabel" name="m_pLanguageInfo"> 115 <property name="sizePolicy"> 116 <sizepolicy vsizetype="Minimum" hsizetype="Expanding"> 117 <horstretch>0</horstretch> 118 <verstretch>0</verstretch> 119 </sizepolicy> 120 </property> 121 <property name="alignment"> 122 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 123 </property> 124 <property name="wordWrap"> 125 <bool>true</bool> 126 </property> 127 </widget> 61 <item row="2" column="0"> 62 <widget class="QIRichTextLabel" name="m_pLanguageInfo"/> 128 63 </item> 129 64 </layout> … … 136 71 </customwidget> 137 72 <customwidget> 138 <class>QILabel</class> 73 <class>QIRichTextLabel</class> 74 <extends>QTextEdit</extends> 75 <header>QIRichTextLabel.h</header> 76 </customwidget> 77 <customwidget> 78 <class>QILabelSeparator</class> 139 79 <extends>QLabel</extends> 140 <header>QILabel .h</header>80 <header>QILabelSeparator.h</header> 141 81 </customwidget> 142 82 </customwidgets>
Note:
See TracChangeset
for help on using the changeset viewer.