annotate confirmcommentdialog.h @ 344:ccc55539e066

If the user cancels the first startup dialog (it has no cancel button, but they could use the WM close button), go no further
author Chris Cannam
date Wed, 16 Mar 2011 10:25:06 +0000
parents fd9dc5a457d8
children
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@298 35 QString head,
Chris@193 36 QString text,
Chris@193 37 QString okButtonText);
Chris@193 38
Chris@193 39 static bool confirmDangerous(QWidget *parent,
Chris@193 40 QString title,
Chris@298 41 QString head,
Chris@193 42 QString text,
Chris@193 43 QString okButtonText);
Chris@193 44
Chris@102 45 static bool confirmFilesAction(QWidget *parent,
Chris@102 46 QString title,
Chris@102 47 QString introText,
Chris@102 48 QString introTextWithCount,
Chris@193 49 QStringList files,
Chris@193 50 QString okButtonText);
Chris@102 51
Chris@109 52 static bool confirmDangerousFilesAction(QWidget *parent,
Chris@109 53 QString title,
Chris@109 54 QString introText,
Chris@109 55 QString introTextWithCount,
Chris@193 56 QStringList files,
Chris@193 57 QString okButtonText);
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 introTextWithCount,
Chris@109 63 QStringList files,
Chris@193 64 QString &comment,
Chris@193 65 QString okButtonText);
Chris@109 66
Chris@109 67 static bool confirmAndGetLongComment(QWidget *parent,
Chris@109 68 QString title,
Chris@109 69 QString introText,
Chris@109 70 QString introTextWithCount,
Chris@109 71 QStringList files,
Chris@193 72 QString &comment,
Chris@193 73 QString okButtonText);
Chris@109 74
Chris@109 75 static bool confirmAndGetShortComment(QWidget *parent,
Chris@109 76 QString title,
Chris@109 77 QString introText,
Chris@193 78 QString &comment,
Chris@193 79 QString okButtonText);
Chris@109 80
Chris@109 81 static bool confirmAndGetLongComment(QWidget *parent,
Chris@109 82 QString title,
Chris@109 83 QString introText,
Chris@193 84 QString &comment,
Chris@193 85 QString okButtonText);
Chris@109 86
Chris@109 87 private slots:
Chris@109 88 void commentChanged();
Chris@109 89
Chris@109 90 private:
Chris@109 91 ConfirmCommentDialog(QWidget *parent,
Chris@109 92 QString title,
Chris@109 93 QString introText,
Chris@193 94 QString initialComment,
Chris@193 95 QString okButtonText);
Chris@109 96
Chris@102 97 static bool confirmAndComment(QWidget *parent,
Chris@102 98 QString title,
Chris@102 99 QString introText,
Chris@102 100 QString introTextWithCount,
Chris@102 101 QStringList files,
Chris@104 102 QString &comment,
Chris@193 103 bool longComment,
Chris@193 104 QString okButtonText);
Chris@102 105
Chris@102 106 static bool confirmAndComment(QWidget *parent,
Chris@102 107 QString title,
Chris@102 108 QString introText,
Chris@104 109 QString &comment,
Chris@193 110 bool longComment,
Chris@193 111 QString okButtonText);
Chris@102 112
Chris@109 113 static QString buildFilesText(QString intro, QStringList files);
Chris@105 114
Chris@105 115 QString getComment() const;
Chris@105 116
Chris@105 117 QTextEdit *m_textEdit;
Chris@105 118 QPushButton *m_ok;
Chris@102 119 };
Chris@102 120
Chris@102 121 #endif // CONFIRMCOMMENTDIALOG_H