diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/utils/removefiledialog.cpp | 59 | ||||
-rw-r--r-- | src/libs/utils/removefiledialog.h | 51 | ||||
-rw-r--r-- | src/libs/utils/removefiledialog.ui | 140 | ||||
-rw-r--r-- | src/libs/utils/utils-lib.pri | 11 | ||||
-rw-r--r-- | src/libs/utils/utils.qbs | 1 |
5 files changed, 258 insertions, 4 deletions
diff --git a/src/libs/utils/removefiledialog.cpp b/src/libs/utils/removefiledialog.cpp new file mode 100644 index 0000000000..0d2208cff8 --- /dev/null +++ b/src/libs/utils/removefiledialog.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "removefiledialog.h" +#include "ui_removefiledialog.h" + +#include <QDir> + +namespace Utils { + +RemoveFileDialog::RemoveFileDialog(const QString &filePath, QWidget *parent) : + QDialog(parent), + m_ui(new Ui::RemoveFileDialog) +{ + m_ui->setupUi(this); + m_ui->fileNameLabel->setText(QDir::toNativeSeparators(filePath)); + + // TODO + m_ui->removeVCCheckBox->setVisible(false); +} + +RemoveFileDialog::~RemoveFileDialog() +{ + delete m_ui; +} + +void RemoveFileDialog::setDeleteFileVisible(bool visible) +{ + m_ui->deleteFileCheckBox->setVisible(visible); +} + +bool RemoveFileDialog::isDeleteFileChecked() const +{ + return m_ui->deleteFileCheckBox->isChecked(); +} + +} // Utils diff --git a/src/libs/utils/removefiledialog.h b/src/libs/utils/removefiledialog.h new file mode 100644 index 0000000000..459917e1f8 --- /dev/null +++ b/src/libs/utils/removefiledialog.h @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include "utils_global.h" + +#include <QDialog> + +namespace Utils { + +namespace Ui { class RemoveFileDialog; } + +class QTCREATOR_UTILS_EXPORT RemoveFileDialog : public QDialog +{ + Q_OBJECT + +public: + explicit RemoveFileDialog(const QString &filePath, QWidget *parent = 0); + virtual ~RemoveFileDialog(); + + void setDeleteFileVisible(bool visible); + bool isDeleteFileChecked() const; + +private: + Ui::RemoveFileDialog *m_ui; +}; + +} // namespace Utils diff --git a/src/libs/utils/removefiledialog.ui b/src/libs/utils/removefiledialog.ui new file mode 100644 index 0000000000..88314065b8 --- /dev/null +++ b/src/libs/utils/removefiledialog.ui @@ -0,0 +1,140 @@ +<?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> diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 268ab2597d..e64adf9c90 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -120,7 +120,8 @@ SOURCES += \ $$PWD/textutils.cpp \ $$PWD/url.cpp \ $$PWD/filecrumblabel.cpp \ - $$PWD/fixedsizeclicklabel.cpp + $$PWD/fixedsizeclicklabel.cpp \ + $$PWD/removefiledialog.cpp win32:SOURCES += $$PWD/consoleprocess_win.cpp else:SOURCES += $$PWD/consoleprocess_unix.cpp @@ -256,12 +257,14 @@ HEADERS += \ $$PWD/filecrumblabel.h \ $$PWD/linecolumn.h \ $$PWD/link.h \ - $$PWD/fixedsizeclicklabel.h + $$PWD/fixedsizeclicklabel.h \ + $$PWD/removefiledialog.h FORMS += $$PWD/filewizardpage.ui \ - $$PWD/projectintropage.ui \ $$PWD/newclasswidget.ui \ - $$PWD/proxycredentialsdialog.ui + $$PWD/projectintropage.ui \ + $$PWD/proxycredentialsdialog.ui \ + $$PWD/removefiledialog.ui RESOURCES += $$PWD/utils.qrc diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 5606c114ba..61895256cf 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -193,6 +193,7 @@ Project { "qtcprocess.h", "reloadpromptutils.cpp", "reloadpromptutils.h", + "removefiledialog.cpp", "removefiledialog.h", "removefiledialog.ui", "runextensions.cpp", "runextensions.h", "savedaction.cpp", |