mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
sys: Clear project context when closing all providers, Display project name in window title (#860)
* clear project context when closing all providers * Show project name on window title * refactor RequestChangeWindowTitle to RequestUpdateWindowTitle * add spaces
This commit is contained in:
@@ -126,7 +126,7 @@ namespace hex {
|
||||
EVENT_DEF(RequestSelectionChange, Region);
|
||||
EVENT_DEF(RequestAddBookmark, Region, std::string, std::string, color_t);
|
||||
EVENT_DEF(RequestSetPatternLanguageCode, std::string);
|
||||
EVENT_DEF(RequestChangeWindowTitle, std::string);
|
||||
EVENT_DEF(RequestUpdateWindowTitle);
|
||||
EVENT_DEF(RequestCloseImHex, bool);
|
||||
EVENT_DEF(RequestRestartImHex);
|
||||
EVENT_DEF(RequestOpenFile, std::fs::path);
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace hex {
|
||||
static bool store(std::optional<std::fs::path> filePath = std::nullopt);
|
||||
|
||||
static bool hasPath();
|
||||
static void clearPath();
|
||||
static std::fs::path getPath();
|
||||
|
||||
static void registerHandler(const Handler &handler) {
|
||||
getHandlers().push_back(handler);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
ProjectFile::s_currProjectPath = filePath;
|
||||
|
||||
EventManager::post<RequestUpdateWindowTitle>();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,4 +124,12 @@ namespace hex {
|
||||
return !ProjectFile::s_currProjectPath.empty();
|
||||
}
|
||||
|
||||
void ProjectFile::clearPath() {
|
||||
ProjectFile::s_currProjectPath.clear();
|
||||
}
|
||||
|
||||
std::fs::path ProjectFile::getPath() {
|
||||
return ProjectFile::s_currProjectPath;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user