Compare commits

...

3 Commits

Author SHA1 Message Date
EinTim23 be3a50d42a updated readme images 2025-01-12 21:31:18 +01:00
EinTim23 aa734cf45a fixed linux app image build 2025-01-12 20:54:26 +01:00
EinTim23 cbc96614d0 fixed placeholder text on password inputs 2025-01-12 20:17:00 +01:00
7 changed files with 75 additions and 30 deletions

View File

@ -50,14 +50,15 @@ jobs:
- name: Download linuxdeploy - name: Download linuxdeploy
run: | run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x linuxdeploy-x86_64.AppImage wget "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-gtk.sh
sudo mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy sudo mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy
- name: Create AppImage - name: Create AppImage
run: | run: |
cp -r build/PlayerLink linux/AppDir/usr/bin/ cp -r build/PlayerLink linux/AppDir/usr/bin/
linuxdeploy --appdir=linux/AppDir --output appimage linuxdeploy --appdir=linux/AppDir --plugin gtk --output appimage
- name: Upload AppImage artifact - name: Upload AppImage artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@ -126,35 +127,53 @@ jobs:
path: PlayerLink.dmg path: PlayerLink.dmg
create-release: create-release:
if: startsWith(github.ref, 'refs/tags/')
needs: [build-linux, build-windows, build-macos] needs: [build-linux, build-windows, build-macos]
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- name: Download AppImage artifact - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: PlayerLink-AppImage
path: ./release-assets path: ./release-assets
merge-multiple: true
- name: Download Windows artifact - name: Display structure of downloaded files
uses: actions/download-artifact@v4 run: ls -R ./release-assets
with:
name: PlayerLink-Windows-Executable
path: ./release-assets
- name: Download macOS DMG artifact
uses: actions/download-artifact@v4
with:
name: PlayerLink-macOS-DMG
path: ./release-assets
- name: Create GitHub Release - name: Create GitHub Release
uses: actions/create-release@v1 uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ github.ref_name }} tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }} release_name: Release ${{ github.ref_name }}
draft: false draft: false
prerelease: false prerelease: false
files: | - name: Upload AppImage
./release-assets/*.AppImage uses: actions/upload-release-asset@v1
./release-assets/*.exe env:
./release-assets/*.dmg GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-assets/PlayerLink-x86_64.AppImage
asset_name: PlayerLink-x86_64.AppImage
asset_content_type: application/octet-stream
- name: Upload Windows Executable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-assets/PlayerLink.exe
asset_name: PlayerLink.exe
asset_content_type: application/octet-stream
- name: Upload macOS DMG
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-assets/PlayerLink.dmg
asset_name: PlayerLink.dmg
asset_content_type: application/octet-stream

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -12,6 +12,9 @@
DBusConnection* conn = nullptr; DBusConnection* conn = nullptr;
std::string getExecutablePath() { std::string getExecutablePath() {
if (const char* appImagePath = std::getenv("APPIMAGE"))
return std::string(appImagePath);
char result[PATH_MAX]{}; char result[PATH_MAX]{};
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
return (count != -1) ? std::string(result, count) : std::string(); return (count != -1) ? std::string(result, count) : std::string();

View File

@ -184,30 +184,37 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxValidator& validator = wxDefaultValidator, long style = 0, const wxValidator& validator = wxDefaultValidator,
const wxString& name = "textCtrl") const wxString& name = "textCtrl")
: wxTextCtrl(parent, id, value, pos, size, style, validator, name), placeholder(""), showPlaceholder(true) { : wxTextCtrl(parent, id, value, pos, size, style, validator, name),
placeholder(""),
showPlaceholder(true),
isPassword((style & wxTE_PASSWORD) != 0) {
Bind(wxEVT_SET_FOCUS, &wxTextCtrlWithPlaceholder::OnFocus, this); Bind(wxEVT_SET_FOCUS, &wxTextCtrlWithPlaceholder::OnFocus, this);
Bind(wxEVT_KILL_FOCUS, &wxTextCtrlWithPlaceholder::OnBlur, this); Bind(wxEVT_KILL_FOCUS, &wxTextCtrlWithPlaceholder::OnBlur, this);
} }
void SetPlaceholderText(const wxString& p) { void SetPlaceholderText(const wxString& p) {
placeholder = p; placeholder = p;
SetValue(placeholder); if (GetValue().IsEmpty() || showPlaceholder)
Refresh(); UpdatePlaceholder();
} }
protected: protected:
void OnFocus(wxFocusEvent& event) { void OnFocus(wxFocusEvent& event) {
if (GetValue() == placeholder) if (showPlaceholder && GetValue() == placeholder) {
Clear(); Clear();
if (isPassword)
SetStyleToPassword();
}
showPlaceholder = false; showPlaceholder = false;
event.Skip(); event.Skip();
} }
void OnBlur(wxFocusEvent& event) { void OnBlur(wxFocusEvent& event) {
if (GetValue().IsEmpty() || GetValue() == "") { if (GetValue().IsEmpty()) {
SetValue(placeholder);
showPlaceholder = true; showPlaceholder = true;
UpdatePlaceholder();
} }
event.Skip(); event.Skip();
} }
@ -215,6 +222,21 @@ protected:
private: private:
wxString placeholder; wxString placeholder;
bool showPlaceholder; bool showPlaceholder;
bool isPassword;
void UpdatePlaceholder() {
if (isPassword)
SetStyleToNormal();
SetValue(placeholder);
}
void SetStyleToPassword() {
SetWindowStyle(GetWindowStyle() | wxTE_PASSWORD);
}
void SetStyleToNormal() {
SetWindowStyle(GetWindowStyle() & ~wxTE_PASSWORD);
}
}; };
class PlayerLinkFrame : public wxFrame { class PlayerLinkFrame : public wxFrame {

View File

@ -11,9 +11,10 @@ SET(BUILD_STATIC_LIBS ON)
SET(BUILD_SHARED_LIBS OFF) SET(BUILD_SHARED_LIBS OFF)
SET(BUILD_CURL_EXE OFF) SET(BUILD_CURL_EXE OFF)
SET(MBEDTLS_INCLUDE_DIRS ../mbedtls/include) SET(MBEDTLS_INCLUDE_DIRS ../mbedtls/include)
file(REMOVE curl/CMake/FindMbedTLS.cmake) #replace curls FindMbedTLS that expects mbedtls to be prebuilt with a dummy file(RENAME curl/CMake/FindMbedTLS.cmake curl/CMake/FindMbedTLS.cmake.bak) #replace curls FindMbedTLS that expects mbedtls to be prebuilt with a dummy
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dummy ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dummy ${CMAKE_MODULE_PATH})
add_subdirectory("curl") add_subdirectory("curl")
file(RENAME curl/CMake/FindMbedTLS.cmake.bak curl/CMake/FindMbedTLS.cmake)
set(wxBUILD_SHARED OFF) set(wxBUILD_SHARED OFF)
set(wxBUILD_MONOLITHIC ON) set(wxBUILD_MONOLITHIC ON)
set(wxUSE_GUI ON) set(wxUSE_GUI ON)