annotate confirmcommentdialog.h @ 125:63c2f3f61c79

* Add Incoming dialog and better layouts for dialogs generally
author Chris Cannam
date Mon, 29 Nov 2010 17:03:17 +0000
parents 1721c580c10e
children ef5feb0d648f
rev   line source
Chris@102 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@102 2
Chris@102 3 /*
Chris@102 4 EasyMercurial
Chris@102 5
Chris@102 6 Based on hgExplorer by Jari Korhonen
Chris@102 7 Copyright (c) 2010 Jari Korhonen
Chris@102 8 Copyright (c) 2010 Chris Cannam
Chris@102 9 Copyright (c) 2010 Queen Mary, University of London
Chris@102 10
Chris@102 11 This program is free software; you can redistribute it and/or
Chris@102 12 modify it under the terms of the GNU General Public License as
Chris@102 13 published by the Free Software Foundation; either version 2 of the
Chris@102 14 License, or (at your option) any later version. See the file
Chris@102 15 COPYING included with this distribution for more information.
Chris@102 16 */
Chris@102 17
Chris@102 18 #ifndef CONFIRMCOMMENTDIALOG_H
Chris@102 19 #define CONFIRMCOMMENTDIALOG_H
Chris@102 20
Chris@105 21 #include <QDialog>
Chris@102 22 #include <QWidget>
Chris@102 23 #include <QString>
Chris@102 24 #include <QStringList>
Chris@105 25 #include <QTextEdit>
Chris@105 26 #include <QPushButton>
Chris@102 27
Chris@105 28 class ConfirmCommentDialog : public QDialog
Chris@102 29 {
Chris@105 30 Q_OBJECT
Chris@105 31
Chris@102 32 public:
Chris@102 33 static bool confirmFilesAction(QWidget *parent,
Chris@102 34 QString title,
Chris@102 35 QString introText,
Chris@102 36 QString introTextWithCount,
Chris@102 37 QStringList files);
Chris@102 38
Chris@109 39 static bool confirmDangerousFilesAction(QWidget *parent,
Chris@109 40 QString title,
Chris@109 41 QString introText,
Chris@109 42 QString introTextWithCount,
Chris@109 43 QStringList files);
Chris@109 44
Chris@109 45 static bool confirmAndGetShortComment(QWidget *parent,
Chris@109 46 QString title,
Chris@109 47 QString introText,
Chris@109 48 QString introTextWithCount,
Chris@109 49 QStringList files,
Chris@109 50 QString &comment);
Chris@109 51
Chris@109 52 static bool confirmAndGetLongComment(QWidget *parent,
Chris@109 53 QString title,
Chris@109 54 QString introText,
Chris@109 55 QString introTextWithCount,
Chris@109 56 QStringList files,
Chris@109 57 QString &comment);
Chris@109 58
Chris@109 59 static bool confirmAndGetShortComment(QWidget *parent,
Chris@109 60 QString title,
Chris@109 61 QString introText,
Chris@109 62 QString &comment);
Chris@109 63
Chris@109 64 static bool confirmAndGetLongComment(QWidget *parent,
Chris@109 65 QString title,
Chris@109 66 QString introText,
Chris@109 67 QString &comment);
Chris@109 68
Chris@109 69 private slots:
Chris@109 70 void commentChanged();
Chris@109 71
Chris@109 72 private:
Chris@109 73 ConfirmCommentDialog(QWidget *parent,
Chris@109 74 QString title,
Chris@109 75 QString introText,
Chris@109 76 QString initialComment);
Chris@109 77
Chris@102 78 static bool confirmAndComment(QWidget *parent,
Chris@102 79 QString title,
Chris@102 80 QString introText,
Chris@102 81 QString introTextWithCount,
Chris@102 82 QStringList files,
Chris@104 83 QString &comment,
Chris@104 84 bool longComment);
Chris@102 85
Chris@102 86 static bool confirmAndComment(QWidget *parent,
Chris@102 87 QString title,
Chris@102 88 QString introText,
Chris@104 89 QString &comment,
Chris@104 90 bool longComment);
Chris@102 91
Chris@109 92 static QString buildFilesText(QString intro, QStringList files);
Chris@105 93
Chris@105 94 QString getComment() const;
Chris@105 95
Chris@105 96 QTextEdit *m_textEdit;
Chris@105 97 QPushButton *m_ok;
Chris@102 98 };
Chris@102 99
Chris@102 100 #endif // CONFIRMCOMMENTDIALOG_H