2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Brian McGillion
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2009-11-02 18:50:06 +01:00
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
#include "revertdialog.h"
|
|
|
|
|
|
2022-10-06 13:08:30 +02:00
|
|
|
#include "mercurialtr.h"
|
|
|
|
|
|
2022-10-04 11:32:15 +02:00
|
|
|
#include <utils/layoutbuilder.h>
|
2009-09-15 13:03:13 +03:00
|
|
|
|
2022-10-04 11:32:15 +02:00
|
|
|
#include <QDialogButtonBox>
|
|
|
|
|
#include <QGroupBox>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
|
|
|
|
|
namespace Mercurial::Internal {
|
|
|
|
|
|
|
|
|
|
RevertDialog::RevertDialog(QWidget *parent)
|
|
|
|
|
: QDialog(parent)
|
2009-09-15 13:03:13 +03:00
|
|
|
{
|
2022-10-04 11:32:15 +02:00
|
|
|
resize(400, 162);
|
2022-10-06 13:08:30 +02:00
|
|
|
setWindowTitle(Tr::tr("Revert"));
|
2022-10-04 11:32:15 +02:00
|
|
|
|
2022-10-06 13:08:30 +02:00
|
|
|
auto groupBox = new QGroupBox(Tr::tr("Specify a revision other than the default?"));
|
2022-10-04 11:32:15 +02:00
|
|
|
groupBox->setCheckable(true);
|
|
|
|
|
groupBox->setChecked(false);
|
|
|
|
|
|
|
|
|
|
m_revisionLineEdit = new QLineEdit;
|
|
|
|
|
|
|
|
|
|
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
|
|
|
|
|
|
|
|
|
using namespace Layouting;
|
|
|
|
|
|
|
|
|
|
Form {
|
2022-10-06 13:08:30 +02:00
|
|
|
Tr::tr("Revision:"), m_revisionLineEdit,
|
2022-10-04 11:32:15 +02:00
|
|
|
}.attachTo(groupBox, WithMargins);
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
groupBox,
|
|
|
|
|
buttonBox
|
|
|
|
|
}.attachTo(this);
|
|
|
|
|
|
|
|
|
|
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
|
|
|
|
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
2009-09-15 13:03:13 +03:00
|
|
|
}
|
|
|
|
|
|
2022-10-04 11:32:15 +02:00
|
|
|
RevertDialog::~RevertDialog() = default;
|
|
|
|
|
|
2009-11-03 14:21:48 +01:00
|
|
|
QString RevertDialog::revision() const
|
|
|
|
|
{
|
2022-10-04 11:32:15 +02:00
|
|
|
return m_revisionLineEdit->text();
|
2009-11-03 14:21:48 +01:00
|
|
|
}
|
2014-11-04 22:12:40 +02:00
|
|
|
|
2022-10-04 11:32:15 +02:00
|
|
|
} // Mercurial::Internal
|