Line data Source code
1 : // DUNE DAQ modification notice:
2 : // This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3 : // Fork baseline commit: dbe-02-12-17 (2022-05-12).
4 : // Renamed since fork: no.
5 :
6 : /// Including DBE
7 : #include "dbe/CommitDialog.hpp"
8 :
9 0 : dbe::CommitDialog::~CommitDialog() = default;
10 :
11 0 : dbe::CommitDialog::CommitDialog(QWidget* parent)
12 : : QDialog(parent)
13 0 : , ui(new Ui::CommitDialog)
14 : {
15 : /// Setting Ui
16 0 : setupUi(this);
17 :
18 : /// Setting initial values
19 0 : setModal(true);
20 0 : setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
21 0 : setToolTip("Enter a commit message (optional) and press the ok button.");
22 0 : show();
23 :
24 : /// Setting Controller
25 0 : SetController();
26 0 : }
27 :
28 : void
29 0 : dbe::CommitDialog::SetController()
30 : {
31 0 : connect(OkButton, SIGNAL(clicked()), this, SLOT(OkCommitMessage()), Qt::UniqueConnection);
32 0 : connect(CancelButton, SIGNAL(clicked()), this, SLOT(CancelCommitMessage()), Qt::UniqueConnection);
33 0 : }
34 :
35 : QString
36 0 : dbe::CommitDialog::GetCommitMessage() const
37 : {
38 0 : return CommitMessageLine->text();
39 : }
40 :
41 : void
42 0 : dbe::CommitDialog::CommitMessageEdited()
43 : {
44 0 : if (!CommitMessageLine->text().isEmpty()) {
45 0 : OkButton->setEnabled(true);
46 : } else {
47 0 : OkButton->setEnabled(false);
48 : }
49 0 : }
50 :
51 : void
52 0 : dbe::CommitDialog::OkCommitMessage()
53 : {
54 0 : accept();
55 0 : }
56 :
57 : void
58 0 : dbe::CommitDialog::CancelCommitMessage()
59 : {
60 0 : reject();
61 0 : }
|