forked from qt-creator/qt-creator
Utils: Inline removefiledialog.ui
Change-Id: Iaff681b83cb0e4b0bf0c993734a3a715ddcedd9e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -135,7 +135,7 @@ add_qtc_library(Utils
|
||||
qtcprocess.cpp qtcprocess.h
|
||||
qtcsettings.cpp qtcsettings.h
|
||||
reloadpromptutils.cpp reloadpromptutils.h
|
||||
removefiledialog.cpp removefiledialog.h removefiledialog.ui
|
||||
removefiledialog.cpp removefiledialog.h
|
||||
runextensions.cpp runextensions.h
|
||||
savefile.cpp savefile.h
|
||||
scopedswap.h
|
||||
|
@@ -24,36 +24,62 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "removefiledialog.h"
|
||||
#include "ui_removefiledialog.h"
|
||||
|
||||
#include "filepath.h"
|
||||
#include "layoutbuilder.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
RemoveFileDialog::RemoveFileDialog(const FilePath &filePath, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
m_ui(new Ui::RemoveFileDialog)
|
||||
RemoveFileDialog::RemoveFileDialog(const FilePath &filePath, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->fileNameLabel->setText(filePath.toUserOutput());
|
||||
setWindowTitle(tr("Remove File"));
|
||||
resize(514, 159);
|
||||
|
||||
// TODO
|
||||
m_ui->removeVCCheckBox->setVisible(false);
|
||||
QFont font;
|
||||
font.setFamilies({"Courier New"});
|
||||
|
||||
auto fileNameLabel = new QLabel(filePath.toUserOutput());
|
||||
fileNameLabel->setFont(font);
|
||||
fileNameLabel->setWordWrap(true);
|
||||
|
||||
m_deleteFileCheckBox = new QCheckBox(tr("&Delete file permanently"));
|
||||
|
||||
auto removeVCCheckBox = new QCheckBox(tr("&Remove from version control"));
|
||||
removeVCCheckBox->setVisible(false); // TODO
|
||||
|
||||
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||
|
||||
using namespace Layouting;
|
||||
|
||||
Column {
|
||||
tr("File to remove:"),
|
||||
fileNameLabel,
|
||||
Space(10),
|
||||
m_deleteFileCheckBox,
|
||||
removeVCCheckBox,
|
||||
buttonBox
|
||||
}.attachTo(this);
|
||||
|
||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
RemoveFileDialog::~RemoveFileDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
RemoveFileDialog::~RemoveFileDialog() = default;
|
||||
|
||||
void RemoveFileDialog::setDeleteFileVisible(bool visible)
|
||||
{
|
||||
m_ui->deleteFileCheckBox->setVisible(visible);
|
||||
m_deleteFileCheckBox->setVisible(visible);
|
||||
}
|
||||
|
||||
bool RemoveFileDialog::isDeleteFileChecked() const
|
||||
{
|
||||
return m_ui->deleteFileCheckBox->isChecked();
|
||||
return m_deleteFileCheckBox->isChecked();
|
||||
}
|
||||
|
||||
} // Utils
|
||||
|
@@ -29,10 +29,13 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCheckBox;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class FilePath;
|
||||
namespace Ui { class RemoveFileDialog; }
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT RemoveFileDialog : public QDialog
|
||||
{
|
||||
@@ -46,7 +49,7 @@ public:
|
||||
bool isDeleteFileChecked() const;
|
||||
|
||||
private:
|
||||
Ui::RemoveFileDialog *m_ui;
|
||||
QCheckBox *m_deleteFileCheckBox;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
@@ -1,140 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Utils::RemoveFileDialog</class>
|
||||
<widget class="QDialog" name="Utils::RemoveFileDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>514</width>
|
||||
<height>159</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Remove File</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="fileToDeleteLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File to remove:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="fileNameLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">placeholder</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="deleteFileCheckBox">
|
||||
<property name="text">
|
||||
<string>&Delete file permanently</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="removeVCCheckBox">
|
||||
<property name="text">
|
||||
<string>&Remove from version control</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<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>Utils::RemoveFileDialog</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>Utils::RemoveFileDialog</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>
|
@@ -261,7 +261,6 @@ Project {
|
||||
"reloadpromptutils.h",
|
||||
"removefiledialog.cpp",
|
||||
"removefiledialog.h",
|
||||
"removefiledialog.ui",
|
||||
"runextensions.cpp",
|
||||
"runextensions.h",
|
||||
"savefile.cpp",
|
||||
|
Reference in New Issue
Block a user