# HG changeset patch
# User Chris Cannam
# Date 1308231155 -3600
# Node ID 6d7dad48b13c3c200bf88aa582da1c729c3e23c7
# Parent 939701b848e50feffffbc29adc773b7de4e67443
Make HgIgnoreDialog _look_ plausible (still doesn't do anything though!)
diff -r 939701b848e5 -r 6d7dad48b13c src/hgignoredialog.cpp
--- a/src/hgignoredialog.cpp Wed Jun 15 16:32:21 2011 +0100
+++ b/src/hgignoredialog.cpp Thu Jun 16 14:32:35 2011 +0100
@@ -19,34 +19,112 @@
#include "common.h"
#include "debug.h"
+#include ";
if (files.size() < 10) {
- text += tr("You have asked to ignore the following files:");
- text += " ");
+ intro += " ";
- text += tr("You have asked to ignore %1 file(s).", "", files.size());
- text += "";
+ intro += tr("Ignore files");
+ intro += "
";
- foreach (QString f, files) {
- text += " " + xmlEncode(f) + "
";
+ intro += tr("You have asked to ignore the following files:
";
- }
- text += " "
+ + files.join("
";
} else {
- text += "
") + "
"; - text += tr("Would you like to:"); - text += "
Please choose whether to:
"), + options, tr("Ignore")); + + if (d.exec() == QDialog::Accepted) { + + //... + + } - } + } else { + + QStringList options; + options << tr("Ignore these files only"); + options << tr("Ignore files with these names in any subdirectory"); + + HgIgnoreDialog d(parent, tr("Ignore files"), + intro, tr("Please choose whether to:
"), + options, tr("Ignore")); + + if (d.exec() == QDialog::Accepted) { + + //... + + } + } return IgnoreNothing; diff -r 939701b848e5 -r 6d7dad48b13c src/hgignoredialog.h --- a/src/hgignoredialog.h Wed Jun 15 16:32:21 2011 +0100 +++ b/src/hgignoredialog.h Thu Jun 16 14:32:35 2011 +0100 @@ -32,8 +32,18 @@ IgnoreAllFilesOfGivenSuffixes }; - static IgnoreType confirmIgnore(QStringList files, QStringList suffixes); + static IgnoreType confirmIgnore(QWidget *parent, + QStringList files, QStringList suffixes); +private: + HgIgnoreDialog(QWidget *parent, + QString title, + QString introText, + QString question, + QStringList options, + QString okButtonText); + + }; #endif diff -r 939701b848e5 -r 6d7dad48b13c src/mainwindow.cpp --- a/src/mainwindow.cpp Wed Jun 15 16:32:21 2011 +0100 +++ b/src/mainwindow.cpp Thu Jun 16 14:32:35 2011 +0100 @@ -614,7 +614,8 @@ } HgIgnoreDialog::IgnoreType itype = - HgIgnoreDialog::confirmIgnore(files, QStringList::fromSet(suffixes)); + HgIgnoreDialog::confirmIgnore + (this, files, QStringList::fromSet(suffixes));