Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from hardingadonis/develop
Browse files Browse the repository at this point in the history
develop: update for Eyes_Protection_Reminder - v4.1.1 - done
  • Loading branch information
hardingadonis authored Dec 7, 2022
2 parents 0a1f69f + fd59f8b commit bc47015
Show file tree
Hide file tree
Showing 18 changed files with 171 additions and 49 deletions.
6 changes: 3 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'Eyes_Protection_Reminder_v$NEXT_MINOR_VERSION 👀'
tag-template: v$NEXT_MINOR_VERSION
name-template: 'Eyes_Protection_Reminder_v$NEXT_PATCH_VERSION 👀'
tag-template: v$NEXT_PATCH_VERSION
categories:
- title: '🚀 Features'
labels:
Expand All @@ -18,7 +18,7 @@ template: |
$CHANGES
**Full Changelog**: [`$PREVIOUS_TAG...v$NEXT_MINOR_VERSION`](https://github.com/hardingadonis/Eyes_Protection_Reminder/compare/$PREVIOUS_TAG...v$NEXT_MINOR_VERSION)
**Full Changelog**: [`$PREVIOUS_TAG...v$NEXT_PATCH_VERSION`](https://github.com/hardingadonis/Eyes_Protection_Reminder/compare/$PREVIOUS_TAG...v$NEXT_PATCH_VERSION)
## Contributors
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ jobs:
uses: TheDoctor0/[email protected]
with:
type: zip
filename: Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.zip
path: ${{ github.workspace }}\build\source\Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.exe
filename: Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.zip
path: ${{ github.workspace }}\build\source\Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.exe

- name: Upload built executable file
uses: tanyagray/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.update_release_draft.outputs.upload_url }}
asset_path: ${{ github.workspace }}\Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.zip
asset_name: Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.zip
asset_path: ${{ github.workspace }}\Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.zip
asset_name: Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.zip
asset_content_type: application/zip

publish_release:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10.2)

project(Eyes_Protection_Reminder VERSION 4.1.0)
project(Eyes_Protection_Reminder VERSION 4.1.1)

add_subdirectory(libs/wxWidgets)
add_subdirectory(source)
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
![Languages](https://img.shields.io/github/languages/top/hardingadonis/Eyes_Protection_Reminder?style=flat)
![Repo Size](https://img.shields.io/github/repo-size/hardingadonis/Eyes_Protection_Reminder?style=flat)
![License](https://img.shields.io/github/license/hardingadonis/Eyes_Protection_Reminder?style=flat)
[![Download](https://img.shields.io/github/downloads/hardingadonis/Eyes_Protection_Reminder/v4.1.0/total?style=flat)](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.0)
[![Download](https://img.shields.io/github/downloads/hardingadonis/Eyes_Protection_Reminder/v4.1.1/total?style=flat)](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1)

![EPR_banner](https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/imgs/EPR_banner.png)

Expand Down Expand Up @@ -60,10 +60,16 @@ cmake --build . --target EPR
```

- Run project
- Find an application that named `Eyes_Protection_Reminder_v4.1.0.Windows.x86.exe` or `Eyes_Protection_Reminder_v4.1.0.Windows.x64.exe`
- Find an application that named `Eyes_Protection_Reminder_v4.1.1.Windows.x86.exe` or `Eyes_Protection_Reminder_v4.1.1.Windows.x64.exe`
- Now, run it!!!

- Or, you can download the binary in [here](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.0)
- Or, you can download the binary in [here](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1)

## Usage

You do not know how to use this tool?

Don't worry, click here to know usage: [Usage](https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/Usage.md) or [Usage (for Vietnamese)](https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/Usage_vi_VN.md)

## License

Expand Down
52 changes: 52 additions & 0 deletions docs/Usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Eyes Protection Reminder - Usage

## Requirements

- Windows OS such as:
- Windows XP
- Windows 7
- Windows 8/8.1
- Windows 10
- Windows 11

## Usage

### Download Eyes Protection Reminder

You can download the binary in [here](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1).

Choose one of two:

- *.Windows.x86 for Windows 32 bit.
- *.Windows.x64 for Windows 64 bit.

<p align="center">
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_1.png" />
</p>

### Extract and open Eyes Protection Reminder

After downloading **Eyes Protection Reminder**, we will extract and run it.

This is the main interface of **Eyes Protection Reminder**.

<p align="center">
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_2.png" />
</p>

### Main functions

- **Start** button to begin the timer.
- **Stop** button to stop the timer.
- When the timer is over, **Eyes Protection Reminder** will send a notification for you like this:

<p align="center">
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_3.png" />
</p>

## Hotkey

- **F1**: to open **About Dialog**.
- **F2**: to hide **Eyes Protection Reminder**.
- **F3**: to open **Settings Dialog**.
- **Alt+F4**: to exit **Eyes Protection Reminder**.
52 changes: 52 additions & 0 deletions docs/Usage_vi_VN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Eyes Protection Reminder - Cách sử dụng

## Yêu cầu

- Hệ điều hành Windows:
- Windows XP
- Windows 7
- Windows 8/8.1
- Windows 10
- Windows 11

## Cách sử dụng

### Tải Eyes Protection Reminder

Bạn có thể tải **Eyes Protection Reminder** [tại đây](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1).

Chọn một trong hai:

- *.Windows.x86 for Windows 32 bit.
- *.Windows.x64 for Windows 64 bit.

<p align="center">
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_1.png" />
</p>

### Giải nén và chạy Eyes Protection Reminder

Sau khi tải xuống **Eyes Protection Reminder**, chúng ta sẽ giải nén và chạy cái tool này.

Đây là giao diện chính của **Eyes Protection Reminder**.

<p align="center">
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_2.png" />
</p>

### Chức năng chính

- Nút **Start** để bắt đầu tính giờ.
- Nút **Stop** để dừng việc tính giờ lại.
- Khi thời gian kết thúc, **Eyes Protection Reminder** gửi cho chúng ta một cái thông báo như sau:

<p align="center">
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_3.png" />
</p>

## Phím tắt

- **F1**: để mở **About Dialog**.
- **F2**: để ẩn **Eyes Protection Reminder**.
- **F3**: để mở **Settings Dialog**.
- **Alt+F4**: để thoát **Eyes Protection Reminder**.
Binary file added docs/imgs/EPR_docs_image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/EPR_docs_image_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/EPR_docs_image_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/EPR_showcase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10.2)

project(EPR VERSION 4.1.0)
project(EPR VERSION 4.1.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -34,4 +34,4 @@ set(EPR_ICON ${CMAKE_SOURCE_DIR}/assets/EPR_icon.rc)
add_executable(${PROJECT_NAME} WIN32 ${EPR_SOURCES} ${EPR_ICON})
target_link_libraries(${PROJECT_NAME} PUBLIC wx::core wx::base)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME Eyes_Protection_Reminder_v4.1.0.Windows.${EPR_ARCH})
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME Eyes_Protection_Reminder_v4.1.1.Windows.${EPR_ARCH})
4 changes: 2 additions & 2 deletions source/include/UI/MainPanel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ namespace EPR
void OnTimerElapsed(wxTimerEvent& _event);
void OnRestedElapsed(wxTimerEvent& _event);

void ResetTimer();

private:
void CreateControls();

void ResetTimer();

private:
wxStaticText* m_timerValue;
wxStaticText* m_restedValue;
Expand Down
6 changes: 5 additions & 1 deletion source/include/UI/SettingsDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
#include <wx/wx.h>
#include <wx/spinctrl.h>

#include <UI/MainPanel.hpp>

namespace EPR
{
class SettingsDialog : public wxDialog
{
public:
SettingsDialog(wxWindow* _parent);
SettingsDialog(wxWindow* _parent, MainPanel* _mainPanel);
virtual ~SettingsDialog() = default;

void OnSaveButtonPressed(wxCommandEvent& _event);
Expand All @@ -49,6 +51,8 @@ namespace EPR
wxTextCtrl* m_stringNotification;
wxCheckBox* m_startupWithWindows;

MainPanel* m_mainPanel;

public:
wxDECLARE_EVENT_TABLE();
};
Expand Down
4 changes: 2 additions & 2 deletions source/src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ namespace EPR
}

// Set name for this tool
SetAppName("Eyes Protection Remimder");
SetAppName("Eyes Protection Reminder");

// Create the main frame
m_mainFrame = new MainFrame("Eyes Protection Remimder - v4.1.0", wxSize(500, 350));
m_mainFrame = new MainFrame("Eyes Protection Reminder - v4.1.1", wxSize(500, 350));

if (m_mainFrame == nullptr)
{
Expand Down
4 changes: 2 additions & 2 deletions source/src/UI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace EPR

void MainFrame::OnMenuSettings(wxCommandEvent& _event)
{
(new SettingsDialog(this))->ShowModal();
(new SettingsDialog(this, m_mainPanel))->ShowModal();

_event.Skip();
}
Expand All @@ -100,7 +100,7 @@ namespace EPR

// Set the information for about dialog
_aboutInfo.SetName(wxTheApp->GetAppName());
_aboutInfo.SetVersion("- v4.1.0");
_aboutInfo.SetVersion("- v4.1.1");
_aboutInfo.SetIcon(s_EPR_icon_64);
_aboutInfo.SetCopyright("Copyright (c) 2022 " + wxString::FromUTF8("Minh Vương.") + "\nAll rights reserved.");
_aboutInfo.SetDescription("A small tool to remind you to\nprotect your eyes with the 20:20:20 rule.");
Expand Down
46 changes: 23 additions & 23 deletions source/src/UI/MainPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace EPR
{
// Show the notification
m_taskBarIcon->ShowBalloon(
"Eyes Protection Remimder",
"Eyes Protection Reminder",
Config::GetInstance()->GetStringNotification(),
Config::GetInstance()->GetTimeNotification() * 1000,
wxICON_INFORMATION,
Expand Down Expand Up @@ -144,6 +144,28 @@ namespace EPR
));
}

void MainPanel::ResetTimer()
{
s_timer_time_remaining = Config::GetInstance()->GetTimeRemaining();
s_timer_rested_remaining = Config::GetInstance()->GetRestedRemaining();

m_timerValue->SetLabel(wxString::Format(
"%s%d:%s%d",
s_timer_time_remaining / 60 < 10 ? "0" : "",
s_timer_time_remaining / 60,
s_timer_time_remaining % 60 < 10 ? "0" : "",
s_timer_time_remaining % 60
));

m_restedValue->SetLabel(wxString::Format(
"%s%d:%s%d",
s_timer_rested_remaining / 60 < 10 ? "0" : "",
s_timer_rested_remaining / 60,
s_timer_rested_remaining % 60 < 10 ? "0" : "",
s_timer_rested_remaining % 60
));
}

void MainPanel::CreateControls()
{
// Create label to show the value of timer
Expand Down Expand Up @@ -195,26 +217,4 @@ namespace EPR
m_timer->Bind(wxEVT_TIMER, &EPR::MainPanel::OnTimerElapsed, this);
m_rested->Bind(wxEVT_TIMER, &EPR::MainPanel::OnRestedElapsed, this);
}

void MainPanel::ResetTimer()
{
s_timer_time_remaining = Config::GetInstance()->GetTimeRemaining();
s_timer_rested_remaining = Config::GetInstance()->GetRestedRemaining();

m_timerValue->SetLabel(wxString::Format(
"%s%d:%s%d",
s_timer_time_remaining / 60 < 10 ? "0" : "",
s_timer_time_remaining / 60,
s_timer_time_remaining % 60 < 10 ? "0" : "",
s_timer_time_remaining % 60
));

m_restedValue->SetLabel(wxString::Format(
"%s%d:%s%d",
s_timer_rested_remaining / 60 < 10 ? "0" : "",
s_timer_rested_remaining / 60,
s_timer_rested_remaining % 60 < 10 ? "0" : "",
s_timer_rested_remaining % 60
));
}
}
7 changes: 5 additions & 2 deletions source/src/UI/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ namespace EPR
EVT_BUTTON(EPR_Button_Save, SettingsDialog::OnSaveButtonPressed)
wxEND_EVENT_TABLE()

SettingsDialog::SettingsDialog(wxWindow* _parent) :
wxDialog(_parent, wxID_ANY, "Eyes Protection Remimder - Settings")
SettingsDialog::SettingsDialog(wxWindow* _parent, MainPanel* _mainPanel) :
wxDialog(_parent, wxID_ANY, "Eyes Protection Reminder - Settings"),
m_mainPanel(_mainPanel)
{
Center();
CreateControls();
Expand All @@ -58,6 +59,8 @@ namespace EPR

Config::GetInstance()->Save();

m_mainPanel->ResetTimer();

Destroy();
}

Expand Down
Loading

0 comments on commit bc47015

Please sign in to comment.