Commit 7cba5fc4 authored by Eike Ziller's avatar Eike Ziller

Move RemoveFileDialog to Utils

Change-Id: I88892fc8d43ca3f59598b5b44e0daac0bfb439b5
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent b2a6899e
......@@ -28,7 +28,7 @@
#include <QDir>
using namespace Core;
namespace Utils {
RemoveFileDialog::RemoveFileDialog(const QString &filePath, QWidget *parent) :
QDialog(parent),
......@@ -55,3 +55,5 @@ bool RemoveFileDialog::isDeleteFileChecked() const
{
return m_ui->deleteFileCheckBox->isChecked();
}
} // Utils
......@@ -25,15 +25,15 @@
#pragma once
#include "core_global.h"
#include "utils_global.h"
#include <QDialog>
namespace Core {
namespace Utils {
namespace Ui { class RemoveFileDialog; }
class CORE_EXPORT RemoveFileDialog : public QDialog
class QTCREATOR_UTILS_EXPORT RemoveFileDialog : public QDialog
{
Q_OBJECT
......@@ -48,4 +48,4 @@ private:
Ui::RemoveFileDialog *m_ui;
};
} // namespace Core
} // namespace Utils
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Core::RemoveFileDialog</class>
<widget class="QDialog" name="Core::RemoveFileDialog">
<class>Utils::RemoveFileDialog</class>
<widget class="QDialog" name="Utils::RemoveFileDialog">
<property name="geometry">
<rect>
<x>0</x>
......@@ -107,7 +107,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Core::RemoveFileDialog</receiver>
<receiver>Utils::RemoveFileDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......@@ -123,7 +123,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Core::RemoveFileDialog</receiver>
<receiver>Utils::RemoveFileDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
......
......@@ -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
......
......@@ -193,6 +193,7 @@ Project {
"qtcprocess.h",
"reloadpromptutils.cpp",
"reloadpromptutils.h",
"removefiledialog.cpp", "removefiledialog.h", "removefiledialog.ui",
"runextensions.cpp",
"runextensions.h",
"savedaction.cpp",
......
......@@ -100,7 +100,6 @@ SOURCES += corejsextensions.cpp \
idocumentfactory.cpp \
textdocument.cpp \
documentmanager.cpp \
removefiledialog.cpp \
iversioncontrol.cpp \
dialogs/addtovcsdialog.cpp \
ioutputpane.cpp \
......@@ -214,7 +213,6 @@ HEADERS += corejsextensions.h \
idocumentfactory.h \
textdocument.h \
documentmanager.h \
removefiledialog.h \
dialogs/addtovcsdialog.h \
patchtool.h \
windowsupport.h \
......@@ -234,7 +232,6 @@ FORMS += dialogs/newdialog.ui \
dialogs/externaltoolconfig.ui \
mimetypesettingspage.ui \
mimetypemagicdialog.ui \
removefiledialog.ui \
dialogs/addtovcsdialog.ui \
systemsettings.ui
......
......@@ -89,7 +89,6 @@ Project {
"patchtool.cpp", "patchtool.h",
"plugindialog.cpp", "plugindialog.h",
"reaper.cpp", "reaper.h", "reaper_p.h",
"removefiledialog.cpp", "removefiledialog.h", "removefiledialog.ui",
"rightpane.cpp", "rightpane.h",
"settingsdatabase.cpp", "settingsdatabase.h",
"shellcommand.cpp", "shellcommand.h",
......
......@@ -113,7 +113,6 @@
#include <coreplugin/vcsmanager.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/fileutils.h>
#include <coreplugin/removefiledialog.h>
#include <coreplugin/diffservice.h>
#include <texteditor/findinfiles.h>
#include <texteditor/textdocument.h>
......@@ -128,6 +127,7 @@
#include <utils/parameteraction.h>
#include <utils/processhandle.h>
#include <utils/qtcassert.h>
#include <utils/removefiledialog.h>
#include <utils/stringutils.h>
#include <utils/utilsicons.h>
......@@ -3221,7 +3221,7 @@ void ProjectExplorerPluginPrivate::removeProject()
return;
ProjectNode *projectNode = subProjectNode->managingProject();
if (projectNode) {
RemoveFileDialog removeFileDialog(subProjectNode->filePath().toString(), ICore::mainWindow());
Utils::RemoveFileDialog removeFileDialog(subProjectNode->filePath().toString(), ICore::mainWindow());
removeFileDialog.setDeleteFileVisible(false);
if (removeFileDialog.exec() == QDialog::Accepted)
projectNode->removeSubProject(subProjectNode->filePath().toString());
......@@ -3262,7 +3262,7 @@ void ProjectExplorerPluginPrivate::removeFile()
QTC_ASSERT(currentNode && currentNode->nodeType() == NodeType::File, return);
const Utils::FileName filePath = currentNode->filePath();
RemoveFileDialog removeFileDialog(filePath.toString(), ICore::mainWindow());
Utils::RemoveFileDialog removeFileDialog(filePath.toString(), ICore::mainWindow());
if (removeFileDialog.exec() == QDialog::Accepted) {
const bool deleteFile = removeFileDialog.isDeleteFileChecked();
......
......@@ -28,10 +28,10 @@
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/fileutils.h>
#include <coreplugin/icore.h>
#include <coreplugin/removefiledialog.h>
#include <coreplugin/vcsmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/fileutils.h>
#include <utils/removefiledialog.h>
#include <QCoreApplication>
#include <QDebug>
......@@ -1234,7 +1234,7 @@ EntryBackup * RelativeResourceModel::removeEntry(const QModelIndex &index)
deleteItem(index);
return new FileEntryBackup(*this, prefixIndex.row(), index.row(), fileNameBackup, aliasBackup);
}
Core::RemoveFileDialog removeFileDialog(fileNameBackup, Core::ICore::mainWindow());
Utils::RemoveFileDialog removeFileDialog(fileNameBackup, Core::ICore::mainWindow());
if (removeFileDialog.exec() == QDialog::Accepted) {
deleteItem(index);
Core::FileUtils::removeFile(fileNameBackup, removeFileDialog.isDeleteFileChecked());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment