annotate confirmcommentdialog.h @ 291:2e34e7ee7baf more_information_dialog

Make several operations use the new more-information dialog
author Chris Cannam
date Mon, 21 Feb 2011 15:55:39 +0000
parents 8fd71f570884
children fd9dc5a457d8
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@244 8 Copyright (c) 2011 Chris Cannam
Chris@244 9 Copyright (c) 2011 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@193 33 static bool confirm(QWidget *parent,
Chris@193 34 QString title,
Chris@193 35 QString text,
Chris@193 36 QString okButtonText);
Chris@193 37
Chris@193 38 static bool confirmDangerous(QWidget *parent,
Chris@193 39 QString title,
Chris@193 40 QString text,
Chris@193 41 QString okButtonText);
Chris@193 42
Chris@102 43 static bool confirmFilesAction(QWidget *parent,
Chris@102 44 QString title,
Chris@102 45 QString introText,
Chris@102 46 QString introTextWithCount,
Chris@193 47 QStringList files,
Chris@193 48 QString okButtonText);
Chris@102 49
Chris@109 50 static bool confirmDangerousFilesAction(QWidget *parent,
Chris@109 51 QString title,
Chris@109 52 QString introText,
Chris@109 53 QString introTextWithCount,
Chris@193 54 QStringList files,
Chris@193 55 QString okButtonText);
Chris@109 56
Chris@109 57 static bool confirmAndGetShortComment(QWidget *parent,
Chris@109 58 QString title,
Chris@109 59 QString introText,
Chris@109 60 QString introTextWithCount,
Chris@109 61 QStringList files,
Chris@193 62 QString &comment,
Chris@193 63 QString okButtonText);
Chris@109 64
Chris@109 65 static bool confirmAndGetLongComment(QWidget *parent,
Chris@109 66 QString title,
Chris@109 67 QString introText,
Chris@109 68 QString introTextWithCount,
Chris@109 69 QStringList files,
Chris@193 70 QString &comment,
Chris@193 71 QString okButtonText);
Chris@109 72
Chris@109 73 static bool confirmAndGetShortComment(QWidget *parent,
Chris@109 74 QString title,
Chris@109 75 QString introText,
Chris@193 76 QString &comment,
Chris@193 77 QString okButtonText);
Chris@109 78
Chris@109 79 static bool confirmAndGetLongComment(QWidget *parent,
Chris@109 80 QString title,
Chris@109 81 QString introText,
Chris@193 82 QString &comment,
Chris@193 83 QString okButtonText);
Chris@109 84
Chris@109 85 private slots:
Chris@109 86 void commentChanged();
Chris@109 87
Chris@109 88 private:
Chris@109 89 ConfirmCommentDialog(QWidget *parent,
Chris@109 90 QString title,
Chris@109 91 QString introText,
Chris@193 92 QString initialComment,
Chris@193 93 QString okButtonText);
Chris@109 94
Chris@102 95 static bool confirmAndComment(QWidget *parent,
Chris@102 96 QString title,
Chris@102 97 QString introText,
Chris@102 98 QString introTextWithCount,
Chris@102 99 QStringList files,
Chris@104 100 QString &comment,
Chris@193 101 bool longComment,
Chris@193 102 QString okButtonText);
Chris@102 103
Chris@102 104 static bool confirmAndComment(QWidget *parent,
Chris@102 105 QString title,
Chris@102 106 QString introText,
Chris@104 107 QString &comment,
Chris@193 108 bool longComment,
Chris@193 109 QString okButtonText);
Chris@102 110
Chris@109 111 static QString buildFilesText(QString intro, QStringList files);
Chris@105 112
Chris@105 113 QString getComment() const;
Chris@105 114
Chris@105 115 QTextEdit *m_textEdit;
Chris@105 116 QPushButton *m_ok;
Chris@102 117 };
Chris@102 118
Chris@102 119 #endif // CONFIRMCOMMENTDIALOG_H