From 8e222b280065c00152e16c22b0995e26d4f9fd83 Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Thu, 23 Jan 2014 16:36:03 +0100 Subject: [PATCH] Removed the menu selections and actions for the Window manu and the select direction function --- companion/src/mainwindow.cpp | 78 ------------------------------------ companion/src/mainwindow.h | 9 ----- 2 files changed, 87 deletions(-) diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 72a7d0c11..720a003a5 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -1556,12 +1556,6 @@ void MainWindow::updateMenus() saveAct->setEnabled(hasMdiChild); saveAsAct->setEnabled(hasMdiChild); pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false); - closeAct->setEnabled(hasMdiChild); - closeAllAct->setEnabled(hasMdiChild); - tileAct->setEnabled(hasMdiChild); - cascadeAct->setEnabled(hasMdiChild); - nextAct->setEnabled(hasMdiChild); - previousAct->setEnabled(hasMdiChild); burnToAct->setEnabled(hasMdiChild); separatorAct->setVisible(hasMdiChild); @@ -1590,39 +1584,6 @@ void MainWindow::updateMenus() profileButton->setDisabled(notfound); } -void MainWindow::updateWindowMenu() -{ - windowMenu->clear(); - windowMenu->addAction(closeAct); - windowMenu->addAction(closeAllAct); - windowMenu->addSeparator(); - windowMenu->addAction(tileAct); - windowMenu->addAction(cascadeAct); - windowMenu->addSeparator(); - windowMenu->addAction(nextAct); - windowMenu->addAction(previousAct); - windowMenu->addAction(separatorAct); - - QList windows = mdiArea->subWindowList(); - separatorAct->setVisible(!windows.isEmpty()); - - for (int i = 0; i < windows.size(); ++i) { - MdiChild *child = qobject_cast(windows.at(i)->widget()); - - QString text; - if (i < 9) { - text = tr("&%1 %2").arg(i + 1).arg(child->userFriendlyCurrentFile()); - } else { - text = tr("%1 %2").arg(i + 1).arg(child->userFriendlyCurrentFile()); - } - QAction *action = windowMenu->addAction(text); - action->setCheckable(true); - action ->setChecked(child == activeMdiChild()); - connect(action, SIGNAL(triggered()), windowMapper, SLOT(map())); - windowMapper->setMapping(action, windows.at(i)); - } -} - MdiChild *MainWindow::createMdiChild() { MdiChild *child = new MdiChild; @@ -1773,37 +1734,6 @@ void MainWindow::createActions() printAct->setEnabled(false); connect(printAct,SIGNAL(triggered()),this,SLOT(print())); - closeAct = new QAction(tr("Cl&ose"), this); - closeAct->setStatusTip(tr("Close the active window")); - connect(closeAct, SIGNAL(triggered()), - mdiArea, SLOT(closeActiveSubWindow())); - - closeAllAct = new QAction(tr("Close &All"), this); - closeAllAct->setStatusTip(tr("Close all the windows")); - connect(closeAllAct, SIGNAL(triggered()), - mdiArea, SLOT(closeAllSubWindows())); - - tileAct = new QAction(tr("&Tile"), this); - tileAct->setStatusTip(tr("Tile the windows")); - connect(tileAct, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); - - cascadeAct = new QAction(tr("&Cascade"), this); - cascadeAct->setStatusTip(tr("Cascade the windows")); - connect(cascadeAct, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); - - nextAct = new QAction(tr("Ne&xt"), this); - nextAct->setShortcuts(QKeySequence::NextChild); - nextAct->setStatusTip(tr("Move the focus to the next window")); - connect(nextAct, SIGNAL(triggered()), - mdiArea, SLOT(activateNextSubWindow())); - - previousAct = new QAction(tr("Pre&vious"), this); - previousAct->setShortcuts(QKeySequence::PreviousChild); - previousAct->setStatusTip(tr("Move the focus to the previous " - "window")); - connect(previousAct, SIGNAL(triggered()), - mdiArea, SLOT(activatePreviousSubWindow())); - separatorAct = new QAction(this); separatorAct->setSeparator(true); @@ -1811,9 +1741,6 @@ void MainWindow::createActions() aboutAct->setStatusTip(tr("Show the application's About box")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); - switchLayoutDirectionAct = new QAction(CompanionIcon("switch_dir.png"), tr("Switch layout direction"), this); - switchLayoutDirectionAct->setStatusTip(tr("Switch layout Left/Right")); - connect(switchLayoutDirectionAct, SIGNAL(triggered()), this, SLOT(switchLayoutDirection())); for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); @@ -1857,7 +1784,6 @@ void MainWindow::createMenus() profilesMenu->setIcon(CompanionIcon("profiles.png")); for (int i=0; iaddAction(profileActs[i]); - fileMenu->addAction(switchLayoutDirectionAct); fileMenu->addAction(exitAct); editMenu = menuBar()->addMenu(tr("&Edit")); @@ -1883,10 +1809,6 @@ void MainWindow::createMenus() burnMenu->addAction(burnFusesAct); burnMenu->addAction(burnListAct); } - windowMenu = menuBar()->addMenu(tr("&Window")); - updateWindowMenu(); - connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu())); - menuBar()->addSeparator(); helpMenu = menuBar()->addMenu(tr("&Help")); diff --git a/companion/src/mainwindow.h b/companion/src/mainwindow.h index de5b1083f..bdcdcd018 100644 --- a/companion/src/mainwindow.h +++ b/companion/src/mainwindow.h @@ -120,7 +120,6 @@ private slots: void loadBackup(); void preferences(); void updateMenus(); - void updateWindowMenu(); MdiChild *createMdiChild(); void switchLayoutDirection(); void setActiveSubWindow(QWidget *window); @@ -185,7 +184,6 @@ private: QMenu *fileMenu; QMenu *editMenu; QMenu *burnMenu; - QMenu *windowMenu; QMenu *helpMenu; QToolBar *fileToolBar; QToolBar *editToolBar; @@ -217,18 +215,11 @@ private: QAction *burnExtenalToEEPROMAct; QAction *burnExtenalFromEEPROMAct; QAction *simulateAct; - QAction *closeAct; - QAction *closeAllAct; - QAction *tileAct; - QAction *cascadeAct; - QAction *nextAct; - QAction *previousAct; QAction *separatorAct; QAction *aboutAct; QAction *printAct; QAction *loadbackupAct; QAction *logsAct; - QAction *switchLayoutDirectionAct; QAction *recentFileActs[MAX_RECENT]; QAction *profileActs[MAX_PROFILES]; QString fwToUpdate;