forked from qt-creator/qt-creator
Mercurial: Inline revertdialog.ui
Change-Id: I1da46c20c1c504d482ef580520f239c789f05dcc Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -10,6 +10,6 @@ add_qtc_plugin(Mercurial
|
||||
mercurialeditor.cpp mercurialeditor.h
|
||||
mercurialplugin.cpp mercurialplugin.h
|
||||
mercurialsettings.cpp mercurialsettings.h
|
||||
revertdialog.cpp revertdialog.h revertdialog.ui
|
||||
revertdialog.cpp revertdialog.h
|
||||
srcdestdialog.cpp srcdestdialog.h srcdestdialog.ui
|
||||
)
|
||||
|
||||
@@ -31,7 +31,6 @@ QtcPlugin {
|
||||
"mercurialsettings.h",
|
||||
"revertdialog.cpp",
|
||||
"revertdialog.h",
|
||||
"revertdialog.ui",
|
||||
"srcdestdialog.cpp",
|
||||
"srcdestdialog.h",
|
||||
"srcdestdialog.ui",
|
||||
|
||||
@@ -3,25 +3,50 @@
|
||||
|
||||
#include "revertdialog.h"
|
||||
|
||||
namespace Mercurial {
|
||||
namespace Internal {
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
RevertDialog::RevertDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
m_ui(new Ui::RevertDialog)
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGroupBox>
|
||||
#include <QLineEdit>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Mercurial::Internal {
|
||||
|
||||
RevertDialog::RevertDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
resize(400, 162);
|
||||
setWindowTitle(tr("Revert"));
|
||||
|
||||
auto groupBox = new QGroupBox(tr("Specify a revision other than the default?"));
|
||||
groupBox->setCheckable(true);
|
||||
groupBox->setChecked(false);
|
||||
|
||||
m_revisionLineEdit = new QLineEdit;
|
||||
|
||||
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||
|
||||
using namespace Layouting;
|
||||
|
||||
Form {
|
||||
tr("Revision:"), m_revisionLineEdit,
|
||||
}.attachTo(groupBox, WithMargins);
|
||||
|
||||
Column {
|
||||
groupBox,
|
||||
buttonBox
|
||||
}.attachTo(this);
|
||||
|
||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
RevertDialog::~RevertDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
RevertDialog::~RevertDialog() = default;
|
||||
|
||||
QString RevertDialog::revision() const
|
||||
{
|
||||
return m_ui->revisionLineEdit->text();
|
||||
return m_revisionLineEdit->text();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Mercurial
|
||||
} // Mercurial::Internal
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ui_revertdialog.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Mercurial {
|
||||
namespace Internal {
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Mercurial::Internal {
|
||||
|
||||
class RevertDialog : public QDialog
|
||||
{
|
||||
@@ -21,8 +22,7 @@ public:
|
||||
QString revision() const;
|
||||
|
||||
private:
|
||||
Ui::RevertDialog *m_ui;
|
||||
QLineEdit *m_revisionLineEdit;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Mercurial
|
||||
} // Mercurial::Internal
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Mercurial::Internal::RevertDialog</class>
|
||||
<widget class="QDialog" name="Mercurial::Internal::RevertDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>162</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Revert</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Specify a revision other than the default?</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="formLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>361</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="revisionLabel">
|
||||
<property name="text">
|
||||
<string>Revision:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="revisionLineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Mercurial::Internal::RevertDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Mercurial::Internal::RevertDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user