comparison confirmcommentdialog.cpp @ 103:0bd32aedc6f6

* Start to use the confirm-comment dialog for commits; much work still needed
author Chris Cannam
date Wed, 24 Nov 2010 22:44:40 +0000
parents f70ccc15c9d0
children af314dd436d5
comparison
equal deleted inserted replaced
102:f70ccc15c9d0 103:0bd32aedc6f6
53 QString &comment) 53 QString &comment)
54 { 54 {
55 QString text; 55 QString text;
56 if (files.size() <= 10) { 56 if (files.size() <= 10) {
57 text = "<qt>" + introText; 57 text = "<qt>" + introText;
58 text += "<code>"; 58 text += "<p><ul>";
59 foreach (QString file, files) { 59 foreach (QString file, files) {
60 text += file + "<br>"; 60 text += "<li>" + file + "</li>";
61 } 61 }
62 text += "</code></qt>"; 62 text += "</ul><p>Please enter your comment:</qt>";
63 } else { 63 } else {
64 text = "<qt>" + introText.arg(files.size()); 64 text = "<qt>" + introText.arg(files.size());
65 } 65 }
66 return confirmAndComment(parent, title, text, comment); 66 return confirmAndComment(parent, title, text, comment);
67 } 67 }
70 QString title, 70 QString title,
71 QString introText, 71 QString introText,
72 QString &comment) 72 QString &comment)
73 { 73 {
74 bool ok = false; 74 bool ok = false;
75 //!!! ok, for comments need more than one line
75 comment = QInputDialog::getText(parent, title, introText, 76 comment = QInputDialog::getText(parent, title, introText,
76 QLineEdit::Normal, comment, &ok); 77 QLineEdit::Normal, comment, &ok);
77 return ok; 78 return ok;
78 } 79 }