comparison src/mainwindow.cpp @ 484:896b7903e8f2

Make "Show all files" persistent (fixing #203), and rationalise some config group names (noting that "General" is actually the default group "" as it appears in the config file, not the name of a group called "General": that appears as "%General")
author Chris Cannam
date Wed, 17 Aug 2011 16:09:04 +0100
parents a582c6417004
children 86cdaa346e59
comparison
equal deleted inserted replaced
483:a582c6417004 484:896b7903e8f2
109 109
110 cl->addWidget(m_hgTabs, row++, 0); 110 cl->addWidget(m_hgTabs, row++, 0);
111 111
112 connect(m_hgTabs, SIGNAL(selectionChanged()), 112 connect(m_hgTabs, SIGNAL(selectionChanged()),
113 this, SLOT(enableDisableActions())); 113 this, SLOT(enableDisableActions()));
114 connect(m_hgTabs, SIGNAL(showAllChanged(bool)), 114 connect(m_hgTabs, SIGNAL(showAllChanged()),
115 this, SLOT(showAllChanged(bool))); 115 this, SLOT(showAllChanged()));
116 116
117 setUnifiedTitleAndToolBarOnMac(true); 117 setUnifiedTitleAndToolBarOnMac(true);
118 connectActions(); 118 connectActions();
119 clearState(); 119 clearState();
120 enableDisableActions(); 120 enableDisableActions();
204 void MainWindow::clearSelections() 204 void MainWindow::clearSelections()
205 { 205 {
206 m_hgTabs->clearSelections(); 206 m_hgTabs->clearSelections();
207 } 207 }
208 208
209 void MainWindow::showAllChanged(bool s) 209 void MainWindow::showAllChanged()
210 { 210 {
211 m_showAllFiles = s;
212 hgQueryPaths(); 211 hgQueryPaths();
213 } 212 }
214 213
215 void MainWindow::hgRefresh() 214 void MainWindow::hgRefresh()
216 { 215 {
255 m_runner->requestAction(HgAction(ACT_STAT, m_workFolderPath, params)); 254 m_runner->requestAction(HgAction(ACT_STAT, m_workFolderPath, params));
256 } 255 }
257 256
258 void MainWindow::hgQueryPaths() 257 void MainWindow::hgQueryPaths()
259 { 258 {
259 m_showAllFiles = m_hgTabs->shouldShowAll();
260
260 // Quickest is to just read the file 261 // Quickest is to just read the file
261 262
262 QFileInfo hgrc(m_workFolderPath + "/.hg/hgrc"); 263 QFileInfo hgrc(m_workFolderPath + "/.hg/hgrc");
263 264
264 QString path; 265 QString path;
1332 tr("<qt><center><img src=\":images/hdd_unmount-64.png\"><br>File folder</center></qt>"), 1333 tr("<qt><center><img src=\":images/hdd_unmount-64.png\"><br>File folder</center></qt>"),
1333 tr("Open a local folder, by creating a Mercurial repository in it."), 1334 tr("Open a local folder, by creating a Mercurial repository in it."),
1334 MultiChoiceDialog::DirectoryArg); 1335 MultiChoiceDialog::DirectoryArg);
1335 1336
1336 QSettings settings; 1337 QSettings settings;
1337 settings.beginGroup("General"); 1338 settings.beginGroup("");
1338 QString lastChoice = settings.value("lastopentype", "remote").toString(); 1339 QString lastChoice = settings.value("lastopentype", "remote").toString();
1339 if (lastChoice != "local" && 1340 if (lastChoice != "local" &&
1340 lastChoice != "remote" && 1341 lastChoice != "remote" &&
1341 lastChoice != "init") { 1342 lastChoice != "init") {
1342 lastChoice = "remote"; 1343 lastChoice = "remote";
2443 switch (action) { 2444 switch (action) {
2444 2445
2445 case ACT_TEST_HG: 2446 case ACT_TEST_HG:
2446 { 2447 {
2447 QSettings settings; 2448 QSettings settings;
2448 settings.beginGroup("General");
2449 if (settings.value("useextension", true).toBool()) { 2449 if (settings.value("useextension", true).toBool()) {
2450 hgTestExtension(); 2450 hgTestExtension();
2451 } else if (m_workFolderPath == "") { 2451 } else if (m_workFolderPath == "") {
2452 open(); 2452 open();
2453 } else { 2453 } else {