mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Simple hex file viewing.
This commit is contained in:
@@ -453,6 +453,15 @@ public:
|
||||
FSOP_GETFILEINFO, dc->dirent->path));
|
||||
}
|
||||
|
||||
void OnBrowserOpenButton(wxCommandEvent&)
|
||||
{
|
||||
auto item = browserTree->GetSelection();
|
||||
auto dc = (DirentContainer*)_filesystemModel->GetItemData(item);
|
||||
|
||||
QueueBrowserOperation(std::make_unique<FilesystemOperation>(
|
||||
FSOP_OPEN, dc->dirent->path));
|
||||
}
|
||||
|
||||
void QueueBrowserOperation(std::unique_ptr<FilesystemOperation> op)
|
||||
{
|
||||
_filesystemQueue.push_back(std::move(op));
|
||||
@@ -520,6 +529,25 @@ public:
|
||||
ss << e.first << "="
|
||||
<< quote(e.second) << "\n";
|
||||
|
||||
TextViewerWindow::Create(this,
|
||||
op->path.to_str(),
|
||||
ss.str(),
|
||||
true)
|
||||
->Show();
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case FSOP_OPEN:
|
||||
{
|
||||
auto bytes = _filesystem->getFile(op->path);
|
||||
|
||||
runOnUiThread(
|
||||
[&]()
|
||||
{
|
||||
std::stringstream ss;
|
||||
hexdump(ss, bytes);
|
||||
|
||||
TextViewerWindow::Create(this,
|
||||
op->path.to_str(),
|
||||
ss.str(),
|
||||
@@ -975,6 +1003,7 @@ private:
|
||||
FSOP_MOUNT,
|
||||
FSOP_LIST,
|
||||
FSOP_GETFILEINFO,
|
||||
FSOP_OPEN,
|
||||
};
|
||||
|
||||
class FilesystemOperation
|
||||
|
||||
Reference in New Issue
Block a user