This commit is contained in:
Vinyl Darkscratch 2018-04-24 04:26:01 -07:00
parent 2220473c22
commit 6273077dbe
4 changed files with 24 additions and 8 deletions

View file

@ -72,12 +72,15 @@ int server_thread(void *data)
}
CloseHandle(pipe);
#else
out_pipe = open(PIPE_PATH, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
active = true;
SDL_LockMutex(mutex);
if (message_len > 0)
write(out_pipe, (char*)message_buffer, message_len);
SDL_UnlockMutex(mutex);
if (FILE *file = fopen(PIPE_PATH, "r")) {
fclose(file);
out_pipe = open(PIPE_PATH, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
SDL_LockMutex(mutex);
active = true;
if (message_len > 0)
write(out_pipe, (char*)message_buffer, message_len);
SDL_UnlockMutex(mutex);
}
return 0;
#endif
}

View file

@ -26,5 +26,7 @@ cp -rf "./_______.app" "$ONESHOT_PATH"
cp -R "./Graphics/" "$ONESHOT_PATH/Wallpaper"
ln -sfh "$ONESHOT_PATH/OneShot.app" "$HOME/Applications/OneShot.app"
rm -f /tmp/oneshot-pipe # Important for pre-release version cleanup
echo "\n${green}Complete! ${white}Please report any issues to https://github.com/vinyldarkscratch/synglechance/issues${color_reset}"
open "$ONESHOT_PATH"

View file

@ -75,6 +75,7 @@ class Journal(QWidget):
self.setMinimumSize(800, 600)
self.setMaximumSize(800, 600)
self.setGeometry(0, 0, 800, 600)
self.show()
def mousePressEvent(self, event):
@ -162,12 +163,20 @@ if __name__ == '__main__':
save.seek(-8, os.SEEK_END)
lang = save.read().decode('utf-8')
lang = lang[lang.find('[') + 1:lang.find(']')]
if lang == 'en_US':
lang = 'en'
if lang == 'en_US': lang = 'en'
journal.change_image('save_' + lang)
else:
thread = WatchPipe()
thread.change_image.connect(journal.change_image)
thread.start()
pipe_file = open(pipe_path, "w+")
pipe_file.close()
app.exec_()
try:
os.remove(pipe_path)
except:
# Most likely due to the file being in use. Ignore.
pass

View file

@ -450,6 +450,8 @@ module Script
end
rescue Errno::EACCES => e
#this probably means the file already exists and is open, so no need to create it again
rescue Errno::EEXIST => e
#this probably means the file already exists, so no need to create it again
end
end