mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-03-25 13:31:02 +08:00
ggwave-gui : add focus argument to addFile
This commit is contained in:
@@ -320,7 +320,8 @@ void addFile(
|
||||
const char * uri,
|
||||
const char * filename,
|
||||
const char * dataBuffer,
|
||||
size_t dataSize) {
|
||||
size_t dataSize,
|
||||
bool focus) {
|
||||
GGSock::FileServer::FileData file;
|
||||
file.info.uri = uri;
|
||||
file.info.filename = filename;
|
||||
@@ -329,15 +330,16 @@ void addFile(
|
||||
|
||||
g_fileServer.addFile(std::move(file));
|
||||
|
||||
#ifndef IOS
|
||||
g_focusFileSend = true;
|
||||
#endif
|
||||
if (focus) {
|
||||
g_focusFileSend = true;
|
||||
}
|
||||
}
|
||||
|
||||
void addFile(
|
||||
const char * uri,
|
||||
const char * filename,
|
||||
std::vector<char> && data) {
|
||||
std::vector<char> && data,
|
||||
bool focus) {
|
||||
GGSock::FileServer::FileData file;
|
||||
file.info.uri = uri;
|
||||
file.info.filename = filename;
|
||||
@@ -345,9 +347,9 @@ void addFile(
|
||||
|
||||
g_fileServer.addFile(std::move(file));
|
||||
|
||||
#ifndef IOS
|
||||
g_focusFileSend = true;
|
||||
#endif
|
||||
if (focus) {
|
||||
g_focusFileSend = true;
|
||||
}
|
||||
}
|
||||
|
||||
std::string generateFileBroadcastMessage() {
|
||||
|
||||
@@ -53,9 +53,11 @@ void addFile(
|
||||
const char * uri,
|
||||
const char * filename,
|
||||
const char * dataBuffer,
|
||||
size_t dataSize);
|
||||
size_t dataSize,
|
||||
bool focus);
|
||||
|
||||
void addFile(
|
||||
const char * uri,
|
||||
const char * filename,
|
||||
std::vector<char> && data);
|
||||
std::vector<char> && data,
|
||||
bool focus);
|
||||
|
||||
@@ -41,7 +41,7 @@ void interface_receiveFile(
|
||||
const char * filename,
|
||||
const char * dataBuffer,
|
||||
size_t dataSize) {
|
||||
addFile(uri, filename, dataBuffer, dataSize);
|
||||
addFile(uri, filename, dataBuffer, dataSize, false);
|
||||
}
|
||||
|
||||
bool interface_needReloadFiles() {
|
||||
|
||||
@@ -47,7 +47,7 @@ bool ImGui_BeginFrame(SDL_Window * window) {
|
||||
if (uri.find("/") || uri.find("\\")) {
|
||||
filename = uri.substr(uri.find_last_of("/\\") + 1);
|
||||
}
|
||||
addFile(uri.c_str(), filename.c_str(), std::move(data));
|
||||
addFile(uri.c_str(), filename.c_str(), std::move(data), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user