comparison mainwindow.cpp @ 94:44ed7766d55a

* Clear selections when Esc pressed; some refactoring
author Chris Cannam
date Wed, 24 Nov 2010 14:41:52 +0000
parents 879af4608c5e
children d1be9712818a
comparison
equal deleted inserted replaced
93:dfb7a274b90f 94:44ed7766d55a
128 "-Needs Qt4, mingw (in windows), python, kdiff3 (Thanks to all of you !)<br>" 128 "-Needs Qt4, mingw (in windows), python, kdiff3 (Thanks to all of you !)<br>"
129 "-Windows standalone install uses hg / python / kdiff3 from TortoiseHg (BIG Thanks !)<br>" 129 "-Windows standalone install uses hg / python / kdiff3 from TortoiseHg (BIG Thanks !)<br>"
130 "-Windows standalone install uses InstallJammer setup tool (Thanks, great tool !)<br>")); 130 "-Windows standalone install uses InstallJammer setup tool (Thanks, great tool !)<br>"));
131 } 131 }
132 132
133 void MainWindow::clearSelections()
134 {
135 hgExp->clearSelections();
136 }
133 137
134 void MainWindow::hgStat() 138 void MainWindow::hgStat()
135 { 139 {
136 if (runningAction == ACT_NONE) 140 if (runningAction == ACT_NONE)
137 { 141 {
347 */ 351 */
348 } 352 }
349 353
350 void MainWindow::hgCommit() 354 void MainWindow::hgCommit()
351 { 355 {
356 //!!! Now that hg actions can be fired asynchronously (e.g. from
357 // the filesystem modified callback) we _really_ need to be able to
358 // queue important actions rather than just ignore them if busy!
359
352 if (runningAction == ACT_NONE) 360 if (runningAction == ACT_NONE)
353 { 361 {
354 QStringList params; 362 QStringList params;
355 QString comment; 363 QString comment;
356 364
1496 connect(hgUpdateToRevAct, SIGNAL(triggered()), this, SLOT(hgUpdateToRev())); 1504 connect(hgUpdateToRevAct, SIGNAL(triggered()), this, SLOT(hgUpdateToRev()));
1497 connect(hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate())); 1505 connect(hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate()));
1498 connect(hgResolveListAct, SIGNAL(triggered()), this, SLOT(hgResolveList())); 1506 connect(hgResolveListAct, SIGNAL(triggered()), this, SLOT(hgResolveList()));
1499 connect(hgResolveMarkAct, SIGNAL(triggered()), this, SLOT(hgResolveMark())); 1507 connect(hgResolveMarkAct, SIGNAL(triggered()), this, SLOT(hgResolveMark()));
1500 connect(hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe())); 1508 connect(hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe()));
1509 connect(clearSelectionsAct, SIGNAL(triggered()), this, SLOT(clearSelections()));
1501 } 1510 }
1502 1511
1503 void MainWindow::tabChanged(int currTab) 1512 void MainWindow::tabChanged(int currTab)
1504 { 1513 {
1505 tabPage = currTab; 1514 tabPage = currTab;
1774 aboutAct = new QAction(tr("About"), this); 1783 aboutAct = new QAction(tr("About"), this);
1775 aboutAct->setStatusTip(tr("Show the application's About box")); 1784 aboutAct->setStatusTip(tr("Show the application's About box"));
1776 1785
1777 aboutQtAct = new QAction(tr("About Qt"), this); 1786 aboutQtAct = new QAction(tr("About Qt"), this);
1778 aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); 1787 aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
1788
1789 // Miscellaneous
1790 clearSelectionsAct = new QAction(tr("Clear selections"), this);
1791 clearSelectionsAct->setShortcut(Qt::Key_Escape);
1779 } 1792 }
1780 1793
1781 void MainWindow::createMenus() 1794 void MainWindow::createMenus()
1782 { 1795 {
1783 fileMenu = menuBar()->addMenu(tr("File")); 1796 fileMenu = menuBar()->addMenu(tr("File"));
1784 fileMenu -> addAction(hgInitAct); 1797 fileMenu -> addAction(hgInitAct);
1785 fileMenu -> addAction(hgCloneFromRemoteAct); 1798 fileMenu -> addAction(hgCloneFromRemoteAct);
1799 fileMenu->addAction(clearSelectionsAct); //!!! can't live here!
1786 fileMenu -> addSeparator(); 1800 fileMenu -> addSeparator();
1787 fileMenu -> addAction(openAct); 1801 fileMenu -> addAction(openAct);
1788 fileMenu -> addAction(settingsAct); 1802 fileMenu -> addAction(settingsAct);
1789 fileMenu -> addSeparator(); 1803 fileMenu -> addSeparator();
1790 fileMenu -> addAction(exitAct); 1804 fileMenu -> addAction(exitAct);