68 lines
1.6 KiB
C++
Executable File
68 lines
1.6 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* FileManagement - Rename Folder Dialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2017-05-22
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LtsWidgets/lts_frameless_dialog.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
|
|
#include <Services/FileManagement/flm_dtc.h>
|
|
#include <Services/FileManagement/flm_ftc.h>
|
|
#include <Services/FileManagement/logger.h>
|
|
|
|
#include <QModelIndex>
|
|
|
|
namespace Ui
|
|
{
|
|
class FolderEditDialog;
|
|
}
|
|
|
|
namespace FileManagement
|
|
{
|
|
class FolderEditDialog : public LtsWidgets::LtsFramelessDialog
|
|
, protected FileManagement::Interface::Ftc::FolderModifyReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit FolderEditDialog(QWidget *parent = nullptr);
|
|
~FolderEditDialog();
|
|
|
|
bool init(const QModelIndex &workingIndex, const int &folderId, const int &parentFolderId,
|
|
const std::shared_ptr<FileManagement::Interface::Dtc> &dtc,
|
|
const std::shared_ptr<FileManagement::Interface::Ftc> &ftc,
|
|
bool isAdminMode,
|
|
const Folder &data = Folder());
|
|
bool apply();
|
|
|
|
protected:
|
|
void onFolderModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
|
|
|
private Q_SLOTS:
|
|
void onAddEditFolder();
|
|
void validate(const QString &folderName);
|
|
void onReturnPressed();
|
|
|
|
private:
|
|
std::shared_ptr<FileManagement::Interface::Dtc> m_dtc;
|
|
std::shared_ptr<FileManagement::Interface::Ftc> m_ftc;
|
|
|
|
LtsUtils::RequestHelper *m_requestHelper{nullptr};
|
|
Ui::FolderEditDialog *m_ui{nullptr};
|
|
QModelIndex m_workingIndex;
|
|
Folder m_editData;
|
|
|
|
int m_folderId{-1};
|
|
int m_parentFolderId{-1};
|
|
|
|
LOGGER_T m_logger;
|
|
|
|
};
|
|
}
|