Changeset 14022 in vbox
- Timestamp:
- Nov 10, 2008 4:50:18 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r14019 r14022 90 90 91 91 #ifdef VBOX_GUI_WITH_SYSTRAY 92 void refreshSysTray( );92 void refreshSysTray(bool a_bRetranslate = false); 93 93 #endif 94 94 void refreshVMList(); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMListView.h
r14019 r14022 88 88 bool switchTo(); 89 89 90 /* Updates all internal actions depending on the VM's state. */ 90 91 void updateActions(); 92 void retranslateUi(); 91 93 92 94 private: -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r14019 r14022 1123 1123 1124 1124 #ifdef VBOX_GUI_WITH_SYSTRAY 1125 void VBoxSelectorWnd::refreshSysTray( )1125 void VBoxSelectorWnd::refreshSysTray(bool a_bRetranslate) 1126 1126 { 1127 1127 if (false == QSystemTrayIcon::isSystemTrayAvailable()) … … 1131 1131 Assert(trayIconMenu); 1132 1132 1133 trayIcon->setVisible (true); 1134 trayIconMenu->clear(); 1135 trayIconMenu->addAction (trayExitAction); 1136 trayIconMenu->addSeparator(); 1133 if (!a_bRetranslate) 1134 { 1135 trayIcon->setVisible (true); 1136 trayIconMenu->clear(); 1137 trayIconMenu->addAction (trayExitAction); 1138 trayIconMenu->addSeparator(); 1139 } 1137 1140 1138 1141 VBoxVMItem* pItem = NULL; … … 1145 1148 for (int i = 0; i < mVMModel->rowCount(); i++, iCurItemCount++) 1146 1149 { 1147 if (iCurItemCount > 14) /* 15 machines per sub menu. */1148 {1149 pSubMenu = new QMenu (tr("Next 15 machines ..."));1150 Assert(pSubMenu);1151 pCurMenu->addMenu (pSubMenu);1152 pCurMenu = pSubMenu;1153 iCurItemCount = 0;1154 }1155 1156 1150 pItem = mVMModel->itemByRow(i); 1157 1151 Assert(pItem); 1158 1152 1159 pSubMenu = new QMenu (pItem->name()); 1160 Assert(pSubMenu); 1161 pSubMenu->setIcon (pItem->osIcon()); 1162 if(pItem->accessible()) 1163 { 1164 pSubMenu->addAction (pItem->vmActionConfig()); 1165 pSubMenu->addAction (pItem->vmActionDelete()); 1166 pSubMenu->addSeparator(); 1167 pSubMenu->addAction (pItem->vmActionStart()); 1168 pSubMenu->addAction (pItem->vmActionDiscard()); 1169 if (pItem->running()) 1153 if (a_bRetranslate) 1154 { 1155 pItem->retranslateUi(); 1156 continue; 1157 } 1158 else 1159 { 1160 if (iCurItemCount > 14) /* 15 machines per sub menu. */ 1170 1161 { 1162 pSubMenu = new QMenu (tr("Next 15 machines ...")); 1163 Assert(pSubMenu); 1164 pCurMenu->addMenu (pSubMenu); 1165 pCurMenu = pSubMenu; 1166 iCurItemCount = 0; 1167 } 1168 1169 pSubMenu = new QMenu (pItem->name()); 1170 Assert(pSubMenu); 1171 pSubMenu->setIcon (pItem->osIcon()); 1172 if(pItem->accessible()) 1173 { 1174 pSubMenu->addAction (pItem->vmActionConfig()); 1175 pSubMenu->addAction (pItem->vmActionDelete()); 1171 1176 pSubMenu->addSeparator(); 1172 pSubMenu->addAction (pItem->vmActionPause()); 1177 pSubMenu->addAction (pItem->vmActionStart()); 1178 pSubMenu->addAction (pItem->vmActionDiscard()); 1179 if (pItem->running()) 1180 { 1181 pSubMenu->addSeparator(); 1182 pSubMenu->addAction (pItem->vmActionPause()); 1183 } 1184 pSubMenu->addSeparator(); 1185 pSubMenu->addAction (pItem->vmActionShowLogs()); 1173 1186 } 1174 pSubMenu->addSeparator();1175 pSubMenu->addAction (pItem->vmActionShowLogs());1176 }1177 else1178 {1179 pSubMenu->addAction (pItem->vmActionDelete()); 1180 p SubMenu->addAction (pItem->vmActionRefresh());1181 } 1182 1183 pCurMenu->addMenu (pSubMenu); 1184 }1185 1186 trayIconMenu->addSeparator();1187 trayIconMenu->addAction (fileExitAction);1188 1189 trayIconMenu->setVisible (true); 1187 else 1188 { 1189 pSubMenu->addAction (pItem->vmActionDelete()); 1190 pSubMenu->addAction (pItem->vmActionRefresh()); 1191 } 1192 1193 pCurMenu->addMenu (pSubMenu); 1194 } 1195 } 1196 1197 if (!a_bRetranslate) 1198 { 1199 trayIconMenu->addSeparator(); 1200 trayIconMenu->addAction (fileExitAction); 1201 } 1202 1190 1203 } 1191 1204 #endif … … 1395 1408 mVMMenu->setTitle (tr ("&Machine")); 1396 1409 mHelpMenu->setTitle (tr ("&Help")); 1410 1411 #ifdef VBOX_GUI_WITH_SYSTRAY 1412 refreshSysTray (true); /* true = re-translate the UI. */ 1413 #endif 1397 1414 } 1398 1415 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMListView.cpp
r14019 r14022 186 186 187 187 updateActions(); 188 retranslateUi(); 188 189 } 189 190 … … 490 491 if (s >= KMachineState_Running) 491 492 { 492 vmStartAction->setText ( tr ("S&how"));493 vmStartAction->setText (VBoxVMListView::tr ("S&how")); 493 494 vmStartAction->setStatusTip ( 494 tr ("Switch to the window of the selected virtual machine"));495 VBoxVMListView::tr ("Switch to the window of the selected virtual machine")); 495 496 496 497 vmStartAction->setEnabled (canSwitchTo()); … … 498 499 else 499 500 { 500 vmStartAction->setText ( tr ("S&tart"));501 vmStartAction->setText (VBoxVMListView::tr ("S&tart")); 501 502 vmStartAction->setStatusTip ( 502 tr ("Start the selected virtual machine"));503 VBoxVMListView::tr ("Start the selected virtual machine")); 503 504 504 505 vmStartAction->setEnabled (!run); … … 508 509 if (s == KMachineState_Paused) 509 510 { 510 vmPauseAction->setText ( tr ("R&esume"));511 vmPauseAction->setText (VBoxVMListView::tr ("R&esume")); 511 512 vmPauseAction->setStatusTip ( 512 tr ("Resume the execution of the virtual machine"));513 VBoxVMListView::tr ("Resume the execution of the virtual machine")); 513 514 vmPauseAction->blockSignals (true); 514 515 vmPauseAction->setChecked (true); … … 517 518 else 518 519 { 519 vmPauseAction->setText ( tr ("&Pause"));520 vmPauseAction->setText (VBoxVMListView::tr ("&Pause")); 520 521 vmPauseAction->setStatusTip ( 521 tr ("Suspend the execution of the virtual machine"));522 VBoxVMListView::tr ("Suspend the execution of the virtual machine")); 522 523 vmPauseAction->blockSignals (true); 523 524 vmPauseAction->setChecked (false); … … 542 543 543 544 /* change the Start button text accordingly */ 544 vmStartAction->setText ( tr ("S&tart"));545 vmStartAction->setText (VBoxVMListView::tr ("S&tart")); 545 546 vmStartAction->setStatusTip ( 546 tr ("Start the selected virtual machine"));547 VBoxVMListView::tr ("Start the selected virtual machine")); 547 548 vmStartAction->setEnabled (false); 548 549 … … 550 551 vmShowLogsAction->setEnabled (false); 551 552 } 552 553 vmConfigAction->setText (tr ("&Settings...")); 554 vmConfigAction->setStatusTip (tr ("Configure the selected virtual machine")); 555 556 vmDeleteAction->setText (tr ("&Delete")); 557 vmDeleteAction->setStatusTip (tr ("Delete the selected virtual machine")); 558 559 vmDiscardAction->setText (tr ("D&iscard")); 553 } 554 555 void VBoxVMItem::retranslateUi () 556 { 557 vmConfigAction->setText (VBoxVMListView::tr ("&Settings...")); 558 vmConfigAction->setStatusTip (VBoxVMListView::tr ("Configure the selected virtual machine")); 559 560 vmDeleteAction->setText (VBoxVMListView::tr ("&Delete")); 561 vmDeleteAction->setStatusTip (VBoxVMListView::tr ("Delete the selected virtual machine")); 562 563 vmDiscardAction->setText (VBoxVMListView::tr ("D&iscard")); 560 564 vmDiscardAction->setStatusTip ( 561 tr ("Discard the saved state of the selected virtual machine"));562 563 vmRefreshAction->setText ( tr ("&Refresh"));565 VBoxVMListView::tr ("Discard the saved state of the selected virtual machine")); 566 567 vmRefreshAction->setText (VBoxVMListView::tr ("&Refresh")); 564 568 vmRefreshAction->setStatusTip ( 565 tr ("Refresh the accessibility state of the selected virtual machine"));566 567 vmShowLogsAction->setText ( tr ("Show &Log..."));568 vmShowLogsAction->setIconText ( tr ("Log", "icon text"));569 VBoxVMListView::tr ("Refresh the accessibility state of the selected virtual machine")); 570 571 vmShowLogsAction->setText (VBoxVMListView::tr ("Show &Log...")); 572 vmShowLogsAction->setIconText (VBoxVMListView::tr ("Log", "icon text")); 569 573 vmShowLogsAction->setStatusTip ( 570 tr ("Show the log files of the selected virtual machine")); 574 VBoxVMListView::tr ("Show the log files of the selected virtual machine")); 575 576 /* Update other actions which changes behavior depending the machine's state. */ 577 updateActions(); 571 578 } 572 579
Note:
See TracChangeset
for help on using the changeset viewer.