# HG changeset patch # User Chris Cannam # Date 1300271264 0 # Node ID 98cf46fb74c1e72a7bcafacd8d0ce26873f47b07 # Parent ccc55539e0662928cba6fe9e421981cb2390bb27# Parent 5bf78b23eb1044cfb807002a8d9b7bf5ee56d73e Merge diff -r 5bf78b23eb10 -r 98cf46fb74c1 filestatuswidget.cpp --- a/filestatuswidget.cpp Wed Mar 16 10:26:56 2011 +0000 +++ b/filestatuswidget.cpp Wed Mar 16 10:27:44 2011 +0000 @@ -157,6 +157,7 @@ layout->addItem(new QSpacerItem(8, 8), ++row, 0); m_showAllFiles = new QCheckBox(tr("Show all files"), this); + m_showAllFiles->setEnabled(false); layout->addWidget(m_showAllFiles, ++row, 0, Qt::AlignLeft); connect(m_showAllFiles, SIGNAL(toggled(bool)), this, SIGNAL(showAllChanged(bool))); @@ -365,6 +366,9 @@ << endl; delete m_dateReference; m_dateReference = 0; + m_showAllFiles->setEnabled(false); + } else { + m_showAllFiles->setEnabled(true); } } diff -r 5bf78b23eb10 -r 98cf46fb74c1 hgrunner.cpp --- a/hgrunner.cpp Wed Mar 16 10:26:56 2011 +0000 +++ b/hgrunner.cpp Wed Mar 16 10:27:44 2011 +0000 @@ -381,6 +381,12 @@ bool interactive = false; QStringList params = action.params; + if (action.workingDir.isEmpty()) { + // We require a working directory, never just operate in pwd + emit commandFailed(action, "EasyMercurial: No working directory supplied, will not run Mercurial command without one"); + return; + } + QSettings settings; settings.beginGroup("General"); @@ -443,9 +449,7 @@ connect(m_proc, SIGNAL(readyReadStandardError()), this, SLOT(dataReadyStderr())); - if (!action.workingDir.isEmpty()) { - m_proc->setWorkingDirectory(action.workingDir); - } + m_proc->setWorkingDirectory(action.workingDir); if (interactive) { openTerminal(); diff -r 5bf78b23eb10 -r 98cf46fb74c1 mainwindow.cpp --- a/mainwindow.cpp Wed Mar 16 10:26:56 2011 +0000 +++ b/mainwindow.cpp Wed Mar 16 10:27:44 2011 +0000 @@ -1042,6 +1042,7 @@ { StartupDialog *dlg = new StartupDialog(this); if (dlg->exec()) m_firstStart = false; + else exit(0); } void MainWindow::open() @@ -2254,7 +2255,8 @@ DEBUG << "MainWindow::enableDisableActions" << endl; QString dirname = QDir(m_workFolderPath).dirName(); - if (dirname != "") { + + if (m_workFolderPath != "") { // dirname of "" is ".", so test path instead setWindowTitle(tr("EasyMercurial: %1").arg(dirname)); } else { setWindowTitle(tr("EasyMercurial")); @@ -2444,7 +2446,11 @@ m_settingsAct = new QAction(QIcon(":/images/settings.png"), tr("Settings..."), this); m_settingsAct -> setStatusTip(tr("View and change application settings")); +#ifdef Q_OS_WIN32 + m_exitAct = new QAction(QIcon(":/images/exit.png"), tr("Exit"), this); +#else m_exitAct = new QAction(QIcon(":/images/exit.png"), tr("Quit"), this); +#endif m_exitAct->setShortcuts(QKeySequence::Quit); m_exitAct->setStatusTip(tr("Quit EasyMercurial")); @@ -2598,7 +2604,7 @@ } QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); - QSize size = settings.value("size", QSize(400, 400)).toSize(); + QSize size = settings.value("size", QSize(550, 550)).toSize(); m_firstStart = settings.value("firststart", QVariant(true)).toBool(); resize(size); diff -r 5bf78b23eb10 -r 98cf46fb74c1 multichoicedialog.cpp --- a/multichoicedialog.cpp Wed Mar 16 10:26:56 2011 +0000 +++ b/multichoicedialog.cpp Wed Mar 16 10:27:44 2011 +0000 @@ -165,17 +165,31 @@ } } +QString +MultiChoiceDialog::getDefaultPath() const +{ + QDir home(QDir::home()); + QDir dflt; + + dflt = QDir(home.filePath(tr("My Documents"))); + DEBUG << "testing " << dflt << endl; + if (dflt.exists()) return dflt.canonicalPath(); + + dflt = QDir(home.filePath(tr("Documents"))); + DEBUG << "testing " << dflt << endl; + if (dflt.exists()) return dflt.canonicalPath(); + + DEBUG << "all failed, returning " << home << endl; + return home.canonicalPath(); +} + void MultiChoiceDialog::browse() { QString origin = getArgument(); if (origin == "") { -#ifdef Q_OS_WIN32 - origin = "c:"; -#else - origin = QDir::homePath(); -#endif + origin = getDefaultPath(); } QString path = origin; @@ -319,7 +333,7 @@ m_fileLabel->setText(tr("&Folder:")); m_fileLabel->show(); m_fileCombo->show(); - m_fileCombo->lineEdit()->setText(QDir::homePath()); + m_fileCombo->lineEdit()->setText(getDefaultPath()); m_browseButton->show(); break; } diff -r 5bf78b23eb10 -r 98cf46fb74c1 multichoicedialog.h --- a/multichoicedialog.h Wed Mar 16 10:26:56 2011 +0000 +++ b/multichoicedialog.h Wed Mar 16 10:27:44 2011 +0000 @@ -83,6 +83,8 @@ QLabel *m_urlLabel; QComboBox *m_urlCombo; QAbstractButton *m_okButton; + + QString getDefaultPath() const; }; #endif // MULTICHOICEDIALOG_H