implement up/forward/back/top buttons
This commit is contained in:
parent
f5d408f02f
commit
d904117b79
|
@ -27,9 +27,12 @@ macro(make_qt_project TARGET_NAME)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
${TARGET_NAME}
|
${TARGET_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
-DQT_DEPRECATED_WARNINGS
|
-DQT_DISABLE_DEPRECATED_BEFORE=0x051300
|
||||||
-DQT_STRICT_ITERATORS
|
-DQT_NO_CAST_FROM_ASCII
|
||||||
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
|
-DQT_NO_CAST_TO_ASCII
|
||||||
|
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
||||||
|
-DQT_NO_URL_CAST_FROM_STRING
|
||||||
|
-DQT_STRICT_ITERATORS)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
find_package(
|
find_package(
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <functional>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
#include <istream>
|
#include <istream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
@ -28,8 +29,6 @@ using Option = std::optional<T>;
|
||||||
template<typename... Ts>
|
template<typename... Ts>
|
||||||
using Variant = std::variant<Ts...>;
|
using Variant = std::variant<Ts...>;
|
||||||
|
|
||||||
using Path = std::filesystem::path;
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using UniquePtr = std::unique_ptr<T>;
|
using UniquePtr = std::unique_ptr<T>;
|
||||||
|
|
||||||
|
@ -104,7 +103,7 @@ static inline std::array<char, N> readBytes(std::istream &st) {
|
||||||
return std::move(b);
|
return std::move(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline std::ifstream openReadBin(Path path) {
|
static inline std::ifstream openReadBin(std::filesystem::path path) {
|
||||||
return std::ifstream{path, std::ios_base::in | std::ios_base::binary};
|
return std::ifstream{path, std::ios_base::in | std::ios_base::binary};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,42 +18,120 @@ namespace Arc {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node::Node(std::string _name, Dir *_parent) :
|
Node::Node(std::string _name) :
|
||||||
name(_name),
|
name(_name),
|
||||||
parent(_parent)
|
parent(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Node::~Node() {
|
Node::~Node() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Dir::Dir(std::string _name, Dir *_parent) :
|
Dir *Node::getRoot() {
|
||||||
Node(_name, _parent),
|
if(!parent) {
|
||||||
baseType()
|
return getDir();
|
||||||
|
} else {
|
||||||
|
Dir *rover = parent;
|
||||||
|
while(rover->parent) {
|
||||||
|
rover = rover->parent;
|
||||||
|
}
|
||||||
|
return rover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Node *Node::findPath(std::string path) {
|
||||||
|
if(path.empty()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dir *rover;
|
||||||
|
|
||||||
|
// get the initial dir, which will either be:
|
||||||
|
// - the root if the path starts with /
|
||||||
|
// - the node itself
|
||||||
|
// - the node's current Dir (when it's not a Dir)
|
||||||
|
if(path.front() == '/') {
|
||||||
|
path.erase(path.begin());
|
||||||
|
rover = getRoot();
|
||||||
|
} else {
|
||||||
|
rover = getDir();
|
||||||
|
if(!rover) {
|
||||||
|
rover = parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(path.empty()) {
|
||||||
|
// no file, so just the directory itself
|
||||||
|
return rover;
|
||||||
|
} else if(auto slash = path.find('/'); slash != std::string::npos) {
|
||||||
|
std::string prev;
|
||||||
|
prev = path.substr(0, slash);
|
||||||
|
path = path.substr(slash + 1);
|
||||||
|
|
||||||
|
if(prev == "..") {
|
||||||
|
// parent dir on ".."
|
||||||
|
rover = rover->parent ? rover->parent : rover;
|
||||||
|
} else if(prev != ".") {
|
||||||
|
if(auto node = rover->findNode(prev)) {
|
||||||
|
// we want a subdirectory since this path continues
|
||||||
|
rover = node->getDir();
|
||||||
|
} else {
|
||||||
|
// took a wrong turn
|
||||||
|
rover = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// recurse
|
||||||
|
return rover ? rover->findPath(path) : nullptr;
|
||||||
|
} else {
|
||||||
|
// must be a node inside a directory
|
||||||
|
return rover->findNode(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Node::getPath(bool fromChild) const {
|
||||||
|
if(parent) {
|
||||||
|
return parent->getPath(true) + '/' + name;
|
||||||
|
} else if(fromChild) {
|
||||||
|
return std::string{};
|
||||||
|
} else {
|
||||||
|
return "/";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dir::Dir(std::string _name) :
|
||||||
|
Node(_name),
|
||||||
|
m_data()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Dir::~Dir() {
|
Dir::~Dir() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UniquePtr<Node> const &Dir::emplaceBack(Node *node) {
|
||||||
|
node->parent = this;
|
||||||
|
return m_data.emplace_back(node);
|
||||||
|
}
|
||||||
|
|
||||||
Dir Dir::readArchive(std::istream &st, ArcType type) {
|
Dir Dir::readArchive(std::istream &st, ArcType type) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case ArcType::Pack: return readPack(st);
|
case ArcType::Pack: return readPack(st);
|
||||||
case ArcType::Wad2: return readWad2(st);
|
case ArcType::Wad2: return readWad2(st);
|
||||||
}
|
}
|
||||||
|
Q_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *Dir::findNode(std::string const &name) {
|
Node *Dir::findNode(std::string const &name) {
|
||||||
auto it = std::find_if(begin(), end(),
|
auto it = std::find_if(m_data.begin(), m_data.end(),
|
||||||
[&name](auto const &node) {
|
[&name](auto const &node) {
|
||||||
return node->name == name;
|
return node->name == name;
|
||||||
});
|
});
|
||||||
return it != end() ? &**it : nullptr;
|
return it != m_data.end() ? &**it : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
File::File(std::string _name, Dir *_parent) :
|
File::File(std::string _name, QByteArray &&_data) :
|
||||||
Node(_name, _parent),
|
Node(_name),
|
||||||
baseType()
|
m_data(std::move(_data))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +188,7 @@ namespace Arc {
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
if(col == Column::Name) {
|
if(col == Column::Name) {
|
||||||
auto icon = node->getDir() ? "folder" : "text-x-generic";
|
auto icon = node->getDir() ? "folder" : "text-x-generic";
|
||||||
return QVariant{QIcon::fromTheme(icon)};
|
return QVariant{QIcon::fromTheme(QString::fromUtf8(icon))};
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
|
@ -167,7 +245,7 @@ namespace Arc {
|
||||||
if(!m_dir || !hasIndex(row, col, parent) || row > m_dir->size()) {
|
if(!m_dir || !hasIndex(row, col, parent) || row > m_dir->size()) {
|
||||||
return QModelIndex{};
|
return QModelIndex{};
|
||||||
} else {
|
} else {
|
||||||
return createIndex(row, col, &*m_dir->at(row));
|
return createIndex(row, col, m_dir->at(row));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +265,10 @@ namespace Arc {
|
||||||
return m_dir;
|
return m_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Node *Model::findPath(std::string path) {
|
||||||
|
return m_dir->findPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
void Model::setDir(Dir *to) {
|
void Model::setDir(Dir *to) {
|
||||||
auto from = m_dir;
|
auto from = m_dir;
|
||||||
if(to != from) {
|
if(to != from) {
|
||||||
|
@ -209,7 +291,7 @@ namespace Arc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Model::dirUp() {
|
bool Model::goUp() {
|
||||||
if(m_dir && m_dir->parent) {
|
if(m_dir && m_dir->parent) {
|
||||||
setDir(m_dir->parent);
|
setDir(m_dir->parent);
|
||||||
return true;
|
return true;
|
||||||
|
@ -217,6 +299,17 @@ namespace Arc {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Model::goPath(std::string path) {
|
||||||
|
Node *node;
|
||||||
|
Dir *dir;
|
||||||
|
if(m_dir && (node = m_dir->findPath(path)) && (dir = node->getDir())) {
|
||||||
|
setDir(dir);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -50,18 +50,23 @@ namespace Arc {
|
||||||
virtual File const *getFile() const = 0;
|
virtual File const *getFile() const = 0;
|
||||||
virtual File *getFile() = 0;
|
virtual File *getFile() = 0;
|
||||||
|
|
||||||
|
Dir *getRoot();
|
||||||
|
Node *findPath(std::string path);
|
||||||
|
|
||||||
|
std::string getPath(bool fromChild = false) const;
|
||||||
|
|
||||||
Dir *parent{nullptr};
|
Dir *parent{nullptr};
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Node(std::string name, Dir *parent);
|
Node(std::string name);
|
||||||
};
|
};
|
||||||
|
|
||||||
class Dir : public Node, public std::vector<UniquePtr<Node>> {
|
class Dir : public Node {
|
||||||
public:
|
public:
|
||||||
using baseType = std::vector<UniquePtr<Node>>;
|
using DataType = std::vector<UniquePtr<Node>>;
|
||||||
|
|
||||||
Dir(std::string name, Dir *parent = nullptr);
|
Dir(std::string name);
|
||||||
Dir(Dir const &) = delete;
|
Dir(Dir const &) = delete;
|
||||||
Dir(Dir &&) = default;
|
Dir(Dir &&) = default;
|
||||||
virtual ~Dir();
|
virtual ~Dir();
|
||||||
|
@ -71,16 +76,25 @@ namespace Arc {
|
||||||
File const *getFile() const override {return nullptr;}
|
File const *getFile() const override {return nullptr;}
|
||||||
File *getFile() override {return nullptr;}
|
File *getFile() override {return nullptr;}
|
||||||
|
|
||||||
|
DataType const &data() const {return m_data;}
|
||||||
|
Node *at(std::size_t i) const {return &*m_data.at(i);}
|
||||||
|
|
||||||
|
std::size_t size() const {return m_data.size();}
|
||||||
|
|
||||||
|
UniquePtr<Node> const &emplaceBack(Node *node);
|
||||||
Node *findNode(std::string const &name);
|
Node *findNode(std::string const &name);
|
||||||
|
|
||||||
static Dir readArchive(std::istream &st, ArcType type);
|
static Dir readArchive(std::istream &st, ArcType type);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DataType m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class File : public Node, public QByteArray {
|
class File : public Node {
|
||||||
public:
|
public:
|
||||||
using baseType = QByteArray;
|
using DataType = QByteArray;
|
||||||
|
|
||||||
File(std::string name, Dir *parent = nullptr);
|
File(std::string name, QByteArray &&data);
|
||||||
File(File const &) = delete;
|
File(File const &) = delete;
|
||||||
File(File &&) = default;
|
File(File &&) = default;
|
||||||
virtual ~File();
|
virtual ~File();
|
||||||
|
@ -90,7 +104,14 @@ namespace Arc {
|
||||||
File const *getFile() const override {return this;}
|
File const *getFile() const override {return this;}
|
||||||
File *getFile() override {return this;}
|
File *getFile() override {return this;}
|
||||||
|
|
||||||
|
DataType const &data() const {return m_data;}
|
||||||
|
|
||||||
|
std::size_t size() const {return m_data.size();}
|
||||||
|
|
||||||
FileType type{FileType::Normal};
|
FileType type{FileType::Normal};
|
||||||
|
|
||||||
|
private:
|
||||||
|
DataType m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Model : public QAbstractItemModel {
|
class Model : public QAbstractItemModel {
|
||||||
|
@ -115,10 +136,14 @@ namespace Arc {
|
||||||
|
|
||||||
Dir *dir() const;
|
Dir *dir() const;
|
||||||
|
|
||||||
|
Node *findPath(std::string path);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setDir(Dir *dir);
|
void setDir(Dir *dir);
|
||||||
void setDirToIndex(QModelIndex const &ind);
|
void setDirToIndex(QModelIndex const &ind);
|
||||||
bool dirUp();
|
|
||||||
|
bool goUp();
|
||||||
|
bool goPath(std::string path);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirChanged(Dir *from, Dir *to);
|
void dirChanged(Dir *from, Dir *to);
|
||||||
|
@ -152,12 +177,12 @@ namespace Arc {
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QDebug operator<<(QDebug debug, Arc::Dir const &t) {
|
static inline QDebug operator<<(QDebug debug, Arc::Dir const &t) {
|
||||||
debug << static_cast<Arc::Dir::baseType const &>(t);
|
debug << t.data();
|
||||||
return debug;
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QDebug operator<<(QDebug debug, Arc::File const &t) {
|
static inline QDebug operator<<(QDebug debug, Arc::File const &t) {
|
||||||
debug << static_cast<Arc::File::baseType const &>(t);
|
debug << t.data();
|
||||||
return debug;
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
static void setupAppl(QCoreApplication &appl) {
|
static void setupAppl(QCoreApplication &appl) {
|
||||||
appl.setApplicationName("QuAM!");
|
appl.setApplicationName(QString::fromUtf8("QuAM!"));
|
||||||
appl.setApplicationVersion("1.0");
|
appl.setApplicationVersion(QString::fromUtf8("1.0"));
|
||||||
appl.setOrganizationDomain("greyserv.net");
|
appl.setOrganizationDomain(QString::fromUtf8("greyserv.net"));
|
||||||
appl.setOrganizationName("Project Golan");
|
appl.setOrganizationName(QString::fromUtf8("Project Golan"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int modeGui(int argc, char *argv[]) {
|
static int modeGui(int argc, char *argv[]) {
|
||||||
|
@ -26,14 +26,15 @@ static int modeText(int argc, char *argv[]) {
|
||||||
|
|
||||||
QCommandLineParser par;
|
QCommandLineParser par;
|
||||||
|
|
||||||
par.setApplicationDescription("Quake Archive Manager");
|
par.setApplicationDescription(QString::fromUtf8("Quake Archive Manager"));
|
||||||
par.setSingleDashWordOptionMode(
|
par.setSingleDashWordOptionMode(
|
||||||
QCommandLineParser::ParseAsCompactedShortOptions);
|
QCommandLineParser::ParseAsCompactedShortOptions);
|
||||||
|
|
||||||
par.addHelpOption();
|
par.addHelpOption();
|
||||||
par.addVersionOption();
|
par.addVersionOption();
|
||||||
|
|
||||||
QCommandLineOption fileNameOpt{QStringList{"f", "file"},
|
QCommandLineOption fileNameOpt{QStringList{QString::fromUtf8("f"),
|
||||||
|
QString::fromUtf8("file")},
|
||||||
trMain("Open the archive <file>."),
|
trMain("Open the archive <file>."),
|
||||||
trMain("file")};
|
trMain("file")};
|
||||||
par.addOption(fileNameOpt);
|
par.addOption(fileNameOpt);
|
||||||
|
|
|
@ -5,6 +5,16 @@
|
||||||
|
|
||||||
#include <QErrorMessage>
|
#include <QErrorMessage>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QMdiSubWindow>
|
||||||
|
|
||||||
|
static bool applyActiveWin(QMdiArea *area, std::function<bool(Project *)> fn) {
|
||||||
|
if(auto subWin = area->activeSubWindow()) {
|
||||||
|
if(auto win = qobject_cast<Project *>(subWin->widget())) {
|
||||||
|
return fn(win);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow{parent},
|
QMainWindow{parent},
|
||||||
|
@ -16,6 +26,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
actionClose->setShortcut(QKeySequence{QKeySequence::Close});
|
actionClose->setShortcut(QKeySequence{QKeySequence::Close});
|
||||||
actionOpen->setShortcut(QKeySequence{QKeySequence::Open});
|
actionOpen->setShortcut(QKeySequence{QKeySequence::Open});
|
||||||
actionQuit->setShortcut(QKeySequence{QKeySequence::Quit});
|
actionQuit->setShortcut(QKeySequence{QKeySequence::Quit});
|
||||||
|
|
||||||
|
actionUp->setShortcut(Qt::ALT + Qt::Key_Up);
|
||||||
|
actionTop->setShortcut(Qt::ALT + Qt::Key_Home);
|
||||||
|
actionBack->setShortcut(QKeySequence{QKeySequence::Back});
|
||||||
|
actionForward->setShortcut(QKeySequence{QKeySequence::Forward});
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
|
@ -34,8 +49,15 @@ void MainWindow::fileOpen() {
|
||||||
|
|
||||||
if(!fileName.isEmpty()) {
|
if(!fileName.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
auto st = openReadBin(fileName.toStdString());
|
auto path = std::filesystem::path(fileName.toStdString());
|
||||||
new Project{st, m_errors, mdiArea};
|
auto st = openReadBin(path);
|
||||||
|
auto win = new QMdiSubWindow;
|
||||||
|
auto proj = new Project{st, m_errors, win};
|
||||||
|
win->setWidget(proj);
|
||||||
|
win->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
win->setWindowTitle(QString::fromStdString(path.filename()));
|
||||||
|
mdiArea->addSubWindow(win);
|
||||||
|
win->showMaximized();
|
||||||
} catch(std::exception const &exc) {
|
} catch(std::exception const &exc) {
|
||||||
m_errors->showMessage(tr(exc.what()));
|
m_errors->showMessage(tr(exc.what()));
|
||||||
}
|
}
|
||||||
|
@ -48,4 +70,20 @@ void MainWindow::fileClose() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::goBack() {
|
||||||
|
return applyActiveWin(mdiArea, [](auto win) {return win->goBack();});
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MainWindow::goForward() {
|
||||||
|
return applyActiveWin(mdiArea, [](auto win) {return win->goForward();});
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MainWindow::goTop() {
|
||||||
|
return applyActiveWin(mdiArea, [](auto win) {return win->goTop();});
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MainWindow::goUp() {
|
||||||
|
return applyActiveWin(mdiArea, [](auto win) {return win->goUp();});
|
||||||
|
}
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -20,6 +20,11 @@ public slots:
|
||||||
void fileOpen();
|
void fileOpen();
|
||||||
void fileClose();
|
void fileClose();
|
||||||
|
|
||||||
|
bool goBack();
|
||||||
|
bool goForward();
|
||||||
|
bool goTop();
|
||||||
|
bool goUp();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QErrorMessage *m_errors;
|
QErrorMessage *m_errors;
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,15 @@
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QMdiArea" name="mdiArea">
|
<widget class="QMdiArea" name="mdiArea">
|
||||||
|
<property name="background">
|
||||||
|
<brush brushstyle="Dense7Pattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</property>
|
||||||
<property name="viewMode">
|
<property name="viewMode">
|
||||||
<enum>QMdiArea::TabbedView</enum>
|
<enum>QMdiArea::TabbedView</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -39,7 +48,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>640</width>
|
<width>640</width>
|
||||||
<height>29</height>
|
<height>24</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
@ -53,7 +62,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuGo">
|
<widget class="QMenu" name="menuGo">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Go</string>
|
<string>&Go</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionUp"/>
|
<addaction name="actionUp"/>
|
||||||
<addaction name="actionBack"/>
|
<addaction name="actionBack"/>
|
||||||
|
@ -93,34 +102,38 @@
|
||||||
</action>
|
</action>
|
||||||
<action name="actionUp">
|
<action name="actionUp">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="go-up"/>
|
<iconset theme="go-up">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Up</string>
|
<string>&Up</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionBack">
|
<action name="actionBack">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="go-previous"/>
|
<iconset theme="go-previous">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Back</string>
|
<string>&Back</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionForward">
|
<action name="actionForward">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="go-next"/>
|
<iconset theme="go-next">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Forward</string>
|
<string>&Forward</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionTop">
|
<action name="actionTop">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="go-top"/>
|
<iconset theme="go-top">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Top</string>
|
<string>&Top</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -174,10 +187,78 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionUp</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>goUp()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>-1</x>
|
||||||
|
<y>-1</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionTop</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>goTop()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>-1</x>
|
||||||
|
<y>-1</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionBack</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>goBack()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>-1</x>
|
||||||
|
<y>-1</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionForward</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>goForward()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>-1</x>
|
||||||
|
<y>-1</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>fileOpen()</slot>
|
<slot>fileOpen()</slot>
|
||||||
<slot>selectCell(int,int)</slot>
|
<slot>selectCell(int,int)</slot>
|
||||||
<slot>fileClose()</slot>
|
<slot>fileClose()</slot>
|
||||||
|
<slot>goUp()</slot>
|
||||||
|
<slot>goForward()</slot>
|
||||||
|
<slot>goBack()</slot>
|
||||||
|
<slot>goTop()</slot>
|
||||||
</slots>
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -24,21 +24,20 @@ static Arc::File readPackEntry(std::istream &st) {
|
||||||
auto entOffset = readLE<quint32>(st);
|
auto entOffset = readLE<quint32>(st);
|
||||||
auto entSize = readLE<quint32>(st);
|
auto entSize = readLE<quint32>(st);
|
||||||
|
|
||||||
|
if(entName.front() == '/') {
|
||||||
|
throw FileFormatError("empty root directory name");
|
||||||
|
}
|
||||||
|
|
||||||
auto pos = st.tellg();
|
auto pos = st.tellg();
|
||||||
|
|
||||||
st.seekg(entOffset);
|
st.seekg(entOffset);
|
||||||
|
|
||||||
Arc::File file{ntbsToString(entName)};
|
QByteArray data;
|
||||||
|
data.resize(entSize);
|
||||||
file.resize(entSize);
|
st.read(data.data(), entSize);
|
||||||
st.read(file.data(), entSize);
|
|
||||||
st.seekg(pos);
|
st.seekg(pos);
|
||||||
|
|
||||||
if(file.name.front() == '/') {
|
return Arc::File{ntbsToString(entName), std::move(data)};
|
||||||
throw FileFormatError("empty root directory name");
|
|
||||||
}
|
|
||||||
|
|
||||||
return file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void insertFile(Arc::Dir &dir, Arc::File &file, std::string name) {
|
static void insertFile(Arc::Dir &dir, Arc::File &file, std::string name) {
|
||||||
|
@ -55,12 +54,14 @@ static void insertFile(Arc::Dir &dir, Arc::File &file, std::string name) {
|
||||||
if(existing) {
|
if(existing) {
|
||||||
ref = existing;
|
ref = existing;
|
||||||
} else {
|
} else {
|
||||||
ref = &*dir.emplace_back(new Arc::Dir(name, &dir));
|
ref = new Arc::Dir(name);
|
||||||
|
dir.emplaceBack(ref);
|
||||||
}
|
}
|
||||||
insertFile(*ref->getDir(), file, *next);
|
insertFile(*ref->getDir(), file, *next);
|
||||||
} else if(!existing) {
|
} else if(!existing) {
|
||||||
file.name = name;
|
file.name = name;
|
||||||
dir.emplace_back(new Arc::File(std::move(file)));
|
file.parent = &dir;
|
||||||
|
dir.emplaceBack(new Arc::File(std::move(file)));
|
||||||
} else {
|
} else {
|
||||||
throw FileFormatError("duplicate file");
|
throw FileFormatError("duplicate file");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
#include "quam/project.h"
|
#include "quam/project.h"
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
|
||||||
#include <QErrorMessage>
|
#include <QErrorMessage>
|
||||||
#include <QMdiArea>
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
Project::Project(std::istream &st, QErrorMessage *errors, QMdiArea *parent) :
|
Project::Project(std::istream &st, QErrorMessage *errors, QWidget *parent) :
|
||||||
QMdiSubWindow{parent},
|
QWidget{parent},
|
||||||
Ui::Project{},
|
Ui::Project{},
|
||||||
|
m_seekingDir{false},
|
||||||
|
m_histPos{0},
|
||||||
|
m_hist(),
|
||||||
m_arc{new Arc::Arc{st, this}},
|
m_arc{new Arc::Arc{st, this}},
|
||||||
m_root{&m_arc->root},
|
|
||||||
m_errors{errors},
|
m_errors{errors},
|
||||||
m_model{new Arc::Model{this}},
|
m_model{new Arc::Model{this}},
|
||||||
m_sorter{new QSortFilterProxyModel{this}}
|
m_sorter{new QSortFilterProxyModel{this}}
|
||||||
{
|
{
|
||||||
auto widget = new QWidget{this};
|
setupUi(this);
|
||||||
setupUi(widget);
|
|
||||||
setWidget(widget);
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
showMaximized();
|
|
||||||
|
|
||||||
connect(m_model, &Arc::Model::dirChanged,
|
connect(m_model, &Arc::Model::dirChanged,
|
||||||
this, &Project::dirChanged);
|
this, &Project::dirChanged);
|
||||||
|
@ -28,18 +24,80 @@ Project::Project(std::istream &st, QErrorMessage *errors, QMdiArea *parent) :
|
||||||
dirName->setValidator(m_arc->validator);
|
dirName->setValidator(m_arc->validator);
|
||||||
m_sorter->setSourceModel(m_model);
|
m_sorter->setSourceModel(m_model);
|
||||||
tableView->setModel(m_sorter);
|
tableView->setModel(m_sorter);
|
||||||
m_model->setDir(m_root);
|
seekTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
Project::~Project() {
|
Project::~Project() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::dirChanged(Arc::Dir *from, Arc::Dir *to) {
|
void Project::dirChanged(Arc::Dir *from, Arc::Dir *to) {
|
||||||
|
if(!m_seekingDir) {
|
||||||
|
if(std::ptrdiff_t(m_histPos) < std::ptrdiff_t(m_hist.size()) - 1) {
|
||||||
|
auto beg = m_hist.begin();
|
||||||
|
std::advance(beg, m_histPos + 1);
|
||||||
|
m_hist.erase(beg, m_hist.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hist.push_back(to->getPath());
|
||||||
|
m_histPos = m_hist.size() - 1;
|
||||||
|
} else {
|
||||||
|
m_seekingDir = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
tableView->sortByColumn(int(Arc::Column::Type), Qt::AscendingOrder);
|
||||||
tableView->resizeColumnsToContents();
|
tableView->resizeColumnsToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Project::dirUp() {
|
void Project::seekTop() {
|
||||||
return m_model->dirUp();
|
m_model->setDir(&m_arc->root);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Project::seekHistory(std::ptrdiff_t newPos) {
|
||||||
|
if(newPos < 0 || newPos >= m_hist.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_histPos = newPos;
|
||||||
|
|
||||||
|
qDebug() << "hist pos changed:" << m_histPos;
|
||||||
|
|
||||||
|
auto newPath = m_hist.at(newPos);
|
||||||
|
if(auto node = m_model->findPath(newPath)) {
|
||||||
|
if(auto dir = node->getDir()) {
|
||||||
|
m_seekingDir = true;
|
||||||
|
m_model->setDir(dir);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
m_errors->showMessage(QString::fromStdString("'"s + newPath + "' ") +
|
||||||
|
tr("is not a directory"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
m_errors->showMessage(tr("could not find directory") +
|
||||||
|
QString::fromStdString(" '"s + newPath + "'"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Project::goBack() {
|
||||||
|
return seekHistory(std::ptrdiff_t(m_histPos) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Project::goForward() {
|
||||||
|
return seekHistory(std::ptrdiff_t(m_histPos) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Project::goTop() {
|
||||||
|
seekTop();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Project::goUp() {
|
||||||
|
return m_model->goUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Project::goPath(std::string path) {
|
||||||
|
return m_model->goPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -5,33 +5,40 @@
|
||||||
#include "quam/archive.h"
|
#include "quam/archive.h"
|
||||||
#include "quam/ui_project.h"
|
#include "quam/ui_project.h"
|
||||||
|
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QMdiSubWindow>
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QAbstractItemModel;
|
|
||||||
class QErrorMessage;
|
class QErrorMessage;
|
||||||
class QSortFilterProxyModel;
|
class QSortFilterProxyModel;
|
||||||
|
|
||||||
class Project : public QMdiSubWindow, private Ui::Project {
|
class Project : public QWidget, private Ui::Project {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Project(std::istream &st, QErrorMessage *errors, QMdiArea *parent);
|
explicit Project(std::istream &st, QErrorMessage *errors, QWidget *parent);
|
||||||
virtual ~Project();
|
virtual ~Project();
|
||||||
|
|
||||||
|
bool seekHistory(std::ptrdiff_t newPos);
|
||||||
|
void seekTop();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool dirUp();
|
bool goBack();
|
||||||
|
bool goForward();
|
||||||
|
bool goTop();
|
||||||
|
bool goUp();
|
||||||
|
|
||||||
|
bool goPath(std::string path);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void dirChanged(Arc::Dir *from, Arc::Dir *to);
|
void dirChanged(Arc::Dir *from, Arc::Dir *to);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Arc::Arc *m_arc;
|
bool m_seekingDir;
|
||||||
Arc::Dir *m_root;
|
std::size_t m_histPos;
|
||||||
QErrorMessage *m_errors;
|
std::vector<std::string> m_hist;
|
||||||
Arc::Model *m_model;
|
Arc::Arc *m_arc;
|
||||||
QSortFilterProxyModel *m_sorter;
|
QErrorMessage *m_errors;
|
||||||
|
Arc::Model *m_model;
|
||||||
|
QSortFilterProxyModel *m_sorter;
|
||||||
};
|
};
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -13,16 +13,68 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Project View</string>
|
<string>Project View</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="splitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="dirName"/>
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="buttonBack">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-previous"/>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="buttonForward">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-next"/>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="buttonUp">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-up"/>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="dirName"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="tableView">
|
<widget class="QTableView" name="tableView">
|
||||||
|
@ -72,5 +124,60 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBack</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>Project</receiver>
|
||||||
|
<slot>goBack()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>18</x>
|
||||||
|
<y>17</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonForward</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>Project</receiver>
|
||||||
|
<slot>goForward()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>47</x>
|
||||||
|
<y>17</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonUp</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>Project</receiver>
|
||||||
|
<slot>goUp()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>76</x>
|
||||||
|
<y>17</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>319</x>
|
||||||
|
<y>239</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
<slots>
|
||||||
|
<slot>goUp()</slot>
|
||||||
|
<slot>goForward()</slot>
|
||||||
|
<slot>goBack()</slot>
|
||||||
|
<slot>goTop()</slot>
|
||||||
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -49,14 +49,14 @@ static Arc::File readWad2Entry(std::istream &st) {
|
||||||
|
|
||||||
st.seekg(entOffset);
|
st.seekg(entOffset);
|
||||||
|
|
||||||
Arc::File file{ntbsToString(entName)};
|
QByteArray data;
|
||||||
|
|
||||||
file.resize(entSize);
|
data.resize(entSize);
|
||||||
st.read(file.data(), entSize);
|
st.read(data.data(), entSize);
|
||||||
st.seekg(pos);
|
st.seekg(pos);
|
||||||
|
|
||||||
|
Arc::File file{ntbsToString(entName), std::move(data)};
|
||||||
file.type = getFileType(entType);
|
file.type = getFileType(entType);
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ Arc::Dir readWad2(std::istream &st) {
|
||||||
Arc::Dir root{std::string{}};
|
Arc::Dir root{std::string{}};
|
||||||
|
|
||||||
for(quint32 i = 0; i < hdr.second; i++) {
|
for(quint32 i = 0; i < hdr.second; i++) {
|
||||||
root.emplace_back(new Arc::File(readWad2Entry(st)));
|
root.emplaceBack(new Arc::File(readWad2Entry(st)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user