@@ -256,6 +256,16 @@ void MainWindow::init()
256256 statusEncodingLabel->setToolTip (tr (" Database encoding" ));
257257 ui->statusbar ->addPermanentWidget (statusEncodingLabel);
258258
259+ // When changing the text of the toolbar actions, also automatically change their icon text and their tooltip text
260+ connect (ui->editModifyObjectAction , &QAction::changed, [=]() {
261+ ui->editModifyObjectAction ->setIconText (ui->editModifyObjectAction ->text ());
262+ ui->editModifyObjectAction ->setToolTip (ui->editModifyObjectAction ->text ());
263+ });
264+ connect (ui->editDeleteObjectAction , &QAction::changed, [=]() {
265+ ui->editDeleteObjectAction ->setIconText (ui->editDeleteObjectAction ->text ());
266+ ui->editDeleteObjectAction ->setToolTip (ui->editDeleteObjectAction ->text ());
267+ });
268+
259269 // Connect some more signals and slots
260270 connect (ui->dataTable ->filterHeader (), SIGNAL (sectionClicked (int )), this , SLOT (browseTableHeaderClicked (int )));
261271 connect (ui->dataTable ->verticalScrollBar (), SIGNAL (valueChanged (int )), this , SLOT (setRecordsetLabel ()));
@@ -1411,7 +1421,7 @@ void MainWindow::createTreeContextMenu(const QPoint &qPoint)
14111421 if (type == " table" || type == " view" || type == " trigger" || type == " index" )
14121422 popupTableMenu->exec (ui->dbTreeWidget ->mapToGlobal (qPoint));
14131423}
1414- // ** Tree selection changed
1424+
14151425void MainWindow::changeTreeSelection ()
14161426{
14171427 // Just assume first that something's selected that can not be edited at all
@@ -1436,24 +1446,16 @@ void MainWindow::changeTreeSelection()
14361446
14371447 if (type == " view" ) {
14381448 ui->editDeleteObjectAction ->setText (tr (" Delete View" ));
1439- ui->editDeleteObjectAction ->setToolTip (tr (" Delete View" ));
14401449 ui->editModifyObjectAction ->setText (tr (" Modify View" ));
1441- ui->editModifyObjectAction ->setToolTip (tr (" Modify View" ));
14421450 } else if (type == " trigger" ) {
14431451 ui->editDeleteObjectAction ->setText (tr (" Delete Trigger" ));
1444- ui->editDeleteObjectAction ->setToolTip (tr (" Delete Trigger" ));
14451452 ui->editModifyObjectAction ->setText (tr (" Modify Trigger" ));
1446- ui->editModifyObjectAction ->setToolTip (tr (" Modify Trigger" ));
14471453 } else if (type == " index" ) {
14481454 ui->editDeleteObjectAction ->setText (tr (" Delete Index" ));
1449- ui->editDeleteObjectAction ->setToolTip (tr (" Delete Index" ));
14501455 ui->editModifyObjectAction ->setText (tr (" Modify Index" ));
1451- ui->editModifyObjectAction ->setToolTip (tr (" Modify Index" ));
14521456 } else {
14531457 ui->editDeleteObjectAction ->setText (tr (" Delete Table" ));
1454- ui->editDeleteObjectAction ->setToolTip (tr (" Delete Table" ));
14551458 ui->editModifyObjectAction ->setText (tr (" Modify Table" ));
1456- ui->editModifyObjectAction ->setToolTip (tr (" Modify Table" ));
14571459 }
14581460
14591461 // Activate actions
0 commit comments