Removed the menu selections and actions for the Window manu and the select direction function
This commit is contained in:
@@ -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<QMdiSubWindow *> windows = mdiArea->subWindowList();
|
||||
separatorAct->setVisible(!windows.isEmpty());
|
||||
|
||||
for (int i = 0; i < windows.size(); ++i) {
|
||||
MdiChild *child = qobject_cast<MdiChild *>(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; i<MAX_PROFILES; ++i)
|
||||
profilesMenu->addAction(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"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user