Skip to content

Commit

Permalink
log improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
grazianobolla committed Nov 20, 2021
1 parent 991040b commit 60b3d21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"iostream": "cpp"
}
}
22 changes: 11 additions & 11 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ void host_button_callback(Fl_Widget*w, void* data)
std::string cmd = main_window.java_prefix->value();
cmd.append(" -S");

log("Running '" << cmd << "'");
log("\nRunning '" << cmd << "'");

//start server
system(cmd.c_str());
log("\nFinishing receiving file!");
int res = system(cmd.c_str());

if(res == 0)
log("\nFinishing receiving file!");
else
log("\nThere was a problem while receiving the file.");

server_mode = false;
}
Expand All @@ -33,19 +37,15 @@ void transfer_button_callback(Fl_Widget*w, void* data)
std::string file_path = main_window.file_input->value();

cmd.append(" -c " + address + " -d rec " + file_path);

log("Running '" << cmd << "'");

//send file
int res = system(cmd.c_str());

if(res != 0)
{
if(res == 0)
log("\nFinishing sending file!");
else
log("\nThere was an error while trying to transfer the files, check your address, java prefix and file name.");
return;
}

log("\nFinishing sending file!");
}

int main(int argc, char **argv)
Expand Down

0 comments on commit 60b3d21

Please sign in to comment.