Fix #35
This commit is contained in:
parent
2220473c22
commit
6273077dbe
|
|
@ -72,12 +72,15 @@ int server_thread(void *data)
|
||||||
}
|
}
|
||||||
CloseHandle(pipe);
|
CloseHandle(pipe);
|
||||||
#else
|
#else
|
||||||
|
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);
|
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);
|
SDL_LockMutex(mutex);
|
||||||
|
active = true;
|
||||||
if (message_len > 0)
|
if (message_len > 0)
|
||||||
write(out_pipe, (char*)message_buffer, message_len);
|
write(out_pipe, (char*)message_buffer, message_len);
|
||||||
SDL_UnlockMutex(mutex);
|
SDL_UnlockMutex(mutex);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,5 +26,7 @@ cp -rf "./_______.app" "$ONESHOT_PATH"
|
||||||
cp -R "./Graphics/" "$ONESHOT_PATH/Wallpaper"
|
cp -R "./Graphics/" "$ONESHOT_PATH/Wallpaper"
|
||||||
ln -sfh "$ONESHOT_PATH/OneShot.app" "$HOME/Applications/OneShot.app"
|
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}"
|
echo "\n${green}Complete! ${white}Please report any issues to https://github.com/vinyldarkscratch/synglechance/issues${color_reset}"
|
||||||
open "$ONESHOT_PATH"
|
open "$ONESHOT_PATH"
|
||||||
|
|
@ -75,6 +75,7 @@ class Journal(QWidget):
|
||||||
self.setMinimumSize(800, 600)
|
self.setMinimumSize(800, 600)
|
||||||
self.setMaximumSize(800, 600)
|
self.setMaximumSize(800, 600)
|
||||||
self.setGeometry(0, 0, 800, 600)
|
self.setGeometry(0, 0, 800, 600)
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
|
|
@ -162,12 +163,20 @@ if __name__ == '__main__':
|
||||||
save.seek(-8, os.SEEK_END)
|
save.seek(-8, os.SEEK_END)
|
||||||
lang = save.read().decode('utf-8')
|
lang = save.read().decode('utf-8')
|
||||||
lang = lang[lang.find('[') + 1:lang.find(']')]
|
lang = lang[lang.find('[') + 1:lang.find(']')]
|
||||||
if lang == 'en_US':
|
if lang == 'en_US': lang = 'en'
|
||||||
lang = 'en'
|
|
||||||
journal.change_image('save_' + lang)
|
journal.change_image('save_' + lang)
|
||||||
else:
|
else:
|
||||||
thread = WatchPipe()
|
thread = WatchPipe()
|
||||||
thread.change_image.connect(journal.change_image)
|
thread.change_image.connect(journal.change_image)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
|
pipe_file = open(pipe_path, "w+")
|
||||||
|
pipe_file.close()
|
||||||
|
|
||||||
app.exec_()
|
app.exec_()
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.remove(pipe_path)
|
||||||
|
except:
|
||||||
|
# Most likely due to the file being in use. Ignore.
|
||||||
|
pass
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,8 @@ module Script
|
||||||
end
|
end
|
||||||
rescue Errno::EACCES => e
|
rescue Errno::EACCES => e
|
||||||
#this probably means the file already exists and is open, so no need to create it again
|
#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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue