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));
|
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)
|
void QueueBrowserOperation(std::unique_ptr<FilesystemOperation> op)
|
||||||
{
|
{
|
||||||
_filesystemQueue.push_back(std::move(op));
|
_filesystemQueue.push_back(std::move(op));
|
||||||
@@ -528,6 +537,25 @@ public:
|
|||||||
});
|
});
|
||||||
break;
|
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(),
|
||||||
|
true)
|
||||||
|
->Show();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -975,6 +1003,7 @@ private:
|
|||||||
FSOP_MOUNT,
|
FSOP_MOUNT,
|
||||||
FSOP_LIST,
|
FSOP_LIST,
|
||||||
FSOP_GETFILEINFO,
|
FSOP_GETFILEINFO,
|
||||||
|
FSOP_OPEN,
|
||||||
};
|
};
|
||||||
|
|
||||||
class FilesystemOperation
|
class FilesystemOperation
|
||||||
|
|||||||
Reference in New Issue
Block a user