forked from qt-creator/qt-creator
Fossil: Inline revertdialog.ui
Change-Id: I2585c705fce03e3278ec344b0078b50144485d22 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -15,7 +15,6 @@ add_qtc_plugin(Fossil
|
|||||||
fossilplugin.cpp fossilplugin.h
|
fossilplugin.cpp fossilplugin.h
|
||||||
fossilsettings.cpp fossilsettings.h
|
fossilsettings.cpp fossilsettings.h
|
||||||
pullorpushdialog.cpp pullorpushdialog.h
|
pullorpushdialog.cpp pullorpushdialog.h
|
||||||
revertdialog.ui
|
|
||||||
revisioninfo.h
|
revisioninfo.h
|
||||||
wizard/fossiljsextension.cpp wizard/fossiljsextension.h
|
wizard/fossiljsextension.cpp wizard/fossiljsextension.h
|
||||||
)
|
)
|
||||||
|
@@ -25,7 +25,6 @@ QtcPlugin {
|
|||||||
"configuredialog.cpp", "configuredialog.h",
|
"configuredialog.cpp", "configuredialog.h",
|
||||||
"revisioninfo.h",
|
"revisioninfo.h",
|
||||||
"fossil.qrc",
|
"fossil.qrc",
|
||||||
"revertdialog.ui",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
|
@@ -11,8 +11,6 @@
|
|||||||
#include "commiteditor.h"
|
#include "commiteditor.h"
|
||||||
#include "wizard/fossiljsextension.h"
|
#include "wizard/fossiljsextension.h"
|
||||||
|
|
||||||
#include "ui_revertdialog.h"
|
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -32,6 +30,7 @@
|
|||||||
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
||||||
|
|
||||||
#include <utils/commandline.h>
|
#include <utils/commandline.h>
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/parameteraction.h>
|
#include <utils/parameteraction.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -44,14 +43,16 @@
|
|||||||
#include <vcsbase/vcscommand.h>
|
#include <vcsbase/vcscommand.h>
|
||||||
#include <vcsbase/vcsoutputwindow.h>
|
#include <vcsbase/vcsoutputwindow.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMenu>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMessageBox>
|
#include <QDialogButtonBox>
|
||||||
|
#include <QDir>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <QtPlugin>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -244,6 +245,16 @@ public:
|
|||||||
|
|
||||||
static FossilPluginPrivate *dd = nullptr;
|
static FossilPluginPrivate *dd = nullptr;
|
||||||
|
|
||||||
|
class RevertDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(Fossil::Internal::FossilPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
RevertDialog(const QString &title, QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
QLineEdit *m_revisionLineEdit;
|
||||||
|
};
|
||||||
|
|
||||||
FossilPlugin::~FossilPlugin()
|
FossilPlugin::~FossilPlugin()
|
||||||
{
|
{
|
||||||
delete dd;
|
delete dd;
|
||||||
@@ -423,13 +434,14 @@ void FossilPluginPrivate::revertCurrentFile()
|
|||||||
QTC_ASSERT(state.hasFile(), return);
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
|
|
||||||
QDialog dialog(Core::ICore::dialogParent());
|
QDialog dialog(Core::ICore::dialogParent());
|
||||||
Ui::RevertDialog revertUi;
|
|
||||||
revertUi.setupUi(&dialog);
|
auto revisionLineEdit = new QLineEdit;
|
||||||
|
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
if (dialog.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
m_client.revertFile(state.currentFileTopLevel(),
|
m_client.revertFile(state.currentFileTopLevel(),
|
||||||
state.relativeCurrentFile(),
|
state.relativeCurrentFile(),
|
||||||
revertUi.revisionLineEdit->text());
|
revisionLineEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FossilPluginPrivate::statusCurrentFile()
|
void FossilPluginPrivate::statusCurrentFile()
|
||||||
@@ -501,12 +513,9 @@ void FossilPluginPrivate::revertAll()
|
|||||||
const VcsBase::VcsBasePluginState state = currentState();
|
const VcsBase::VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasTopLevel(), return);
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
|
|
||||||
QDialog dialog(Core::ICore::dialogParent());
|
RevertDialog dialog(tr("Revert"), Core::ICore::dialogParent());
|
||||||
Ui::RevertDialog revertUi;
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
revertUi.setupUi(&dialog);
|
m_client.revertAll(state.topLevel(), dialog.m_revisionLineEdit->text());
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
|
||||||
return;
|
|
||||||
m_client.revertAll(state.topLevel(), revertUi.revisionLineEdit->text());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FossilPluginPrivate::statusMulti()
|
void FossilPluginPrivate::statusMulti()
|
||||||
@@ -618,13 +627,9 @@ void FossilPluginPrivate::update()
|
|||||||
const VcsBase::VcsBasePluginState state = currentState();
|
const VcsBase::VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasTopLevel(), return);
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
|
|
||||||
QDialog dialog(Core::ICore::dialogParent());
|
RevertDialog dialog(tr("Update"), Core::ICore::dialogParent());
|
||||||
Ui::RevertDialog revertUi;
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
revertUi.setupUi(&dialog);
|
m_client.update(state.topLevel(), dialog.m_revisionLineEdit->text());
|
||||||
dialog.setWindowTitle(tr("Update"));
|
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
|
||||||
return;
|
|
||||||
m_client.update(state.topLevel(), revertUi.revisionLineEdit->text());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FossilPluginPrivate::configureRepository()
|
void FossilPluginPrivate::configureRepository()
|
||||||
@@ -1066,6 +1071,35 @@ void FossilPluginPrivate::changed(const QVariant &v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RevertDialog::RevertDialog(const QString &title, QWidget *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
{
|
||||||
|
resize(600, 0);
|
||||||
|
setWindowTitle(title);
|
||||||
|
|
||||||
|
auto *groupBox = new QGroupBox(tr("Specify a revision other than the default?"));
|
||||||
|
groupBox->setCheckable(true);
|
||||||
|
groupBox->setChecked(false);
|
||||||
|
groupBox->setToolTip(tr("Checkout revision, can also be a branch or a tag name."));
|
||||||
|
|
||||||
|
m_revisionLineEdit = new QLineEdit;
|
||||||
|
|
||||||
|
auto buttonBox = new QDialogButtonBox;
|
||||||
|
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
|
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
|
||||||
|
using namespace Utils::Layouting;
|
||||||
|
Form {
|
||||||
|
tr("Revision"), m_revisionLineEdit, br,
|
||||||
|
}.attachTo(groupBox);
|
||||||
|
|
||||||
|
Column {
|
||||||
|
groupBox,
|
||||||
|
buttonBox,
|
||||||
|
}.attachTo(this);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Fossil
|
} // namespace Fossil
|
||||||
|
|
||||||
|
@@ -1,106 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Fossil::Internal::RevertDialog</class>
|
|
||||||
<widget class="QDialog" name="Fossil::Internal::RevertDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>400</width>
|
|
||||||
<height>120</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>31</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="revisionLabel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Checkout revision, can also be a branch or a tag name.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Revision:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="revisionLineEdit">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Checkout revision, can also be a branch or a tag name.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</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>Fossil::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>Fossil::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