84 lines
2.0 KiB
C++
Executable File
84 lines
2.0 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Show the exported scripts and allow them to upload them to the server
|
|
* $Id: tpm_exported_scripts_dialog.h 51804 2020-07-31 04:47:28Z fritsche_h $
|
|
* $HeadURL: svn://slssvn/TDS/branches/product/iterations/21_03_salted_caramel/Lts/Plugins/TakeHomePackageManager/tpm_exported_scripts_dialog.h $
|
|
* $Author: fritsche_h $
|
|
*
|
|
* Created by Mike Wille, SLTE, 2024-01-11
|
|
*/
|
|
#pragma once
|
|
|
|
#include "logger.h"
|
|
|
|
#include <Common2/tpm_file_copy.h>
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
|
|
#include <QFileInfoList>
|
|
|
|
namespace Ui
|
|
{
|
|
class USB2Dialog;
|
|
}
|
|
namespace LtsSession
|
|
{
|
|
class LtsSession;
|
|
}
|
|
|
|
namespace TakeHomePackageManager
|
|
{
|
|
class ExportedScriptsModel;
|
|
class TopicsModel;
|
|
|
|
class USB2Dialog : public LtsWidgets::LtsDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
* @brief USBDialog => WARNING: throws! catch exception!
|
|
* @param session
|
|
* @param parent
|
|
*/
|
|
explicit USB2Dialog(LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
|
~USB2Dialog();
|
|
|
|
void retranslate() override;
|
|
|
|
static QString getContentFolder(const QString &rootFolder, int exerciseId);
|
|
QString getContentFolder(const QString &rootFolder) const;
|
|
|
|
static QString exerciseDirectoryName(int exerciseId);
|
|
static QString getScriptFolder(const QString &rootFolder, int exerciseId, int scriptId);
|
|
|
|
signals:
|
|
void nextMap();
|
|
|
|
private slots:
|
|
void slotSelectionChangedLocal();
|
|
void slotSelectionChangedUSB();
|
|
void slotCopy();
|
|
void slotRemove();
|
|
void slotChangePath();
|
|
void slotUnmount();
|
|
|
|
private:
|
|
void removeScript(const QString &scriptId);
|
|
void reset();
|
|
void initLocalModel() noexcept(false);
|
|
void initUsbModel();
|
|
bool checkIsInUSB(const QString &path);
|
|
void unmountUSB(const QString &device);
|
|
ExportedScriptsModel *m_localThpModel;
|
|
TopicsModel *m_localTopicsModel;
|
|
ExportedScriptsModel *m_usbThpModel;
|
|
Ui::USB2Dialog *m_ui;
|
|
LtsSession::LtsSession *m_session;
|
|
// int m_exerciseId;
|
|
// int m_paths;
|
|
QMap<QString, QFileInfoList> m_files;
|
|
|
|
QString m_usbRoot;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
} // namespace TakeHomePackageManager
|