Changeset 537
- Timestamp:
- 03/31/06 21:33:15 (3 years ago)
- Location:
- trunk/src/gui
- Files:
-
- 3 added
- 4 modified
-
config/appearancepage.cpp (modified) (4 diffs)
-
config/appearancepage.h (modified) (1 diff)
-
config/appearancepage.ui (modified) (9 diffs)
-
res/flags (added)
-
res/flags/cn.png (added)
-
res/flags/en.png (added)
-
res/vidalia.qrc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/config/appearancepage.cpp
r533 r537 27 27 #include "appearancepage.h" 28 28 29 #define FLAG_CN ":/images/flags/cn.png" 30 #define FLAG_EN ":/images/flags/en.png" 31 29 32 /** Default Constructor */ 30 33 AppearancePage::AppearancePage(QWidget *parent) … … 36 39 /* Create VidaliaSettings object */ 37 40 _settings = new VidaliaSettings(); 41 42 /* Populate combo boxes */ 43 ui.cmboLanguage->addItem(QIcon(FLAG_EN), LanguageSupport::languages()["en"]); 44 ui.cmboLanguage->addItem(QIcon(FLAG_CN), LanguageSupport::languages()["zh-cn"]); 45 46 ui.cmboStyle->addItems(QStyleFactory::keys()); 38 47 } 39 48 … … 49 58 { 50 59 Q_UNUSED(errmsg); 60 QString languageName = ui.cmboLanguage-> currentText(); 61 QString languageCode = LanguageSupport::languages().key(languageName); 62 63 _settings->setLanguageCode(languageCode); 64 _settings->setInterfaceStyle(ui.cmboStyle->currentText()); 65 51 66 return true; 52 67 } … … 56 71 AppearancePage::load() 57 72 { 58 73 QString languageCode = _settings->getLanguageCode(); 74 QString languageName = LanguageSupport::languages()[languageCode]; 75 int index = ui.cmboLanguage->findText(languageName, Qt::MatchExactly); 76 ui.cmboLanguage->setCurrentIndex(index); 77 78 QString style = _settings->getInterfaceStyle(); 79 index = ui.cmboStyle->findText(style, Qt::MatchExactly); 80 ui.cmboStyle->setCurrentIndex(index); 59 81 } 60 82 -
trunk/src/gui/config/appearancepage.h
r533 r537 28 28 #define _APPEARANCEPAGE_H 29 29 30 #include <QStyleFactory> 31 #include <QLineEdit> 32 30 33 #include <config/vidaliasettings.h> 34 #include <lang/languagesupport.h> 31 35 32 36 #include "configpage.h" -
trunk/src/gui/config/appearancepage.ui
r531 r537 292 292 <enum>Qt::NoContextMenu</enum> 293 293 </property> 294 <layout class="Q VBoxLayout" >294 <layout class="QGridLayout" > 295 295 <property name="margin" > 296 296 <number>9</number> … … 299 299 <number>6</number> 300 300 </property> 301 <item> 302 <widget class="QGroupBox" name="grpLanguage" > 301 <item row="2" column="0" > 302 <layout class="QHBoxLayout" > 303 <property name="margin" > 304 <number>0</number> 305 </property> 306 <property name="spacing" > 307 <number>6</number> 308 </property> 309 <item> 310 <spacer> 311 <property name="orientation" > 312 <enum>Qt::Horizontal</enum> 313 </property> 314 <property name="sizeHint" > 315 <size> 316 <width>40</width> 317 <height>20</height> 318 </size> 319 </property> 320 </spacer> 321 </item> 322 <item> 323 <widget class="QLabel" name="label" > 324 <property name="contextMenuPolicy" > 325 <enum>Qt::NoContextMenu</enum> 326 </property> 327 <property name="text" > 328 <string>These changes will only take effect after restarting Vidalia!</string> 329 </property> 330 </widget> 331 </item> 332 <item> 333 <spacer> 334 <property name="orientation" > 335 <enum>Qt::Horizontal</enum> 336 </property> 337 <property name="sizeHint" > 338 <size> 339 <width>40</width> 340 <height>20</height> 341 </size> 342 </property> 343 </spacer> 344 </item> 345 </layout> 346 </item> 347 <item row="1" column="0" > 348 <widget class="QGroupBox" name="grpStyle" > 303 349 <property name="contextMenuPolicy" > 304 350 <enum>Qt::NoContextMenu</enum> 305 351 </property> 352 <property name="toolTip" > 353 <string/> 354 </property> 306 355 <property name="title" > 307 <string>Interface Language</string>356 <string>Interface Style</string> 308 357 </property> 309 358 <layout class="QGridLayout" > … … 328 377 </item> 329 378 <item row="0" column="0" > 330 <widget class="QComboBox" name="cmbo Language" >379 <widget class="QComboBox" name="cmboStyle" > 331 380 <property name="minimumSize" > 332 381 <size> … … 339 388 </property> 340 389 <property name="toolTip" > 341 <string>Choose the language used in Vidalia</string> 390 <string>Choose Vidalia's interface style</string> 391 </property> 392 <property name="editable" > 393 <bool>false</bool> 342 394 </property> 343 395 </widget> … … 346 398 </widget> 347 399 </item> 348 <item >349 <widget class="QGroupBox" name="grp Style" >400 <item row="0" column="0" > 401 <widget class="QGroupBox" name="grpLanguage" > 350 402 <property name="contextMenuPolicy" > 351 403 <enum>Qt::NoContextMenu</enum> 352 404 </property> 353 <property name="toolTip" >354 <string/>355 </property>356 405 <property name="title" > 357 <string>Interface Style</string>406 <string>Interface Language</string> 358 407 </property> 359 408 <layout class="QGridLayout" > … … 378 427 </item> 379 428 <item row="0" column="0" > 380 <widget class="QComboBox" name="cmbo Style" >429 <widget class="QComboBox" name="cmboLanguage" > 381 430 <property name="minimumSize" > 382 431 <size> … … 389 438 </property> 390 439 <property name="toolTip" > 391 <string>Choose Vidalia's interface style</string> 440 <string>Choose the language used in Vidalia</string> 441 </property> 442 <property name="editable" > 443 <bool>false</bool> 444 </property> 445 <property name="iconSize" > 446 <size> 447 <width>24</width> 448 <height>16</height> 449 </size> 392 450 </property> 393 451 </widget> … … 396 454 </widget> 397 455 </item> 398 <item >456 <item row="3" column="0" > 399 457 <spacer> 400 458 <property name="orientation" > … … 403 461 <property name="sizeHint" > 404 462 <size> 405 <width> 20</width>406 <height> 40</height>463 <width>476</width> 464 <height>161</height> 407 465 </size> 408 466 </property> -
trunk/src/gui/res/vidalia.qrc
r531 r537 64 64 <file>128x128/tor-on.png</file> 65 65 </qresource> 66 <qresource prefix="/images"> 67 <file>flags/cn.png</file> 68 <file>flags/en.png</file> 69 </qresource> 66 70 </RCC>
