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

Commit bc47015

Browse files
Merge pull request #21 from hardingadonis/develop
develop: update for Eyes_Protection_Reminder - v4.1.1 - done
2 parents 0a1f69f + fd59f8b commit bc47015

18 files changed

+171
-49
lines changed

.github/release-drafter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name-template: 'Eyes_Protection_Reminder_v$NEXT_MINOR_VERSION 👀'
2-
tag-template: v$NEXT_MINOR_VERSION
1+
name-template: 'Eyes_Protection_Reminder_v$NEXT_PATCH_VERSION 👀'
2+
tag-template: v$NEXT_PATCH_VERSION
33
categories:
44
- title: '🚀 Features'
55
labels:
@@ -18,7 +18,7 @@ template: |
1818
1919
$CHANGES
2020
21-
**Full Changelog**: [`$PREVIOUS_TAG...v$NEXT_MINOR_VERSION`](https://github.com/hardingadonis/Eyes_Protection_Reminder/compare/$PREVIOUS_TAG...v$NEXT_MINOR_VERSION)
21+
**Full Changelog**: [`$PREVIOUS_TAG...v$NEXT_PATCH_VERSION`](https://github.com/hardingadonis/Eyes_Protection_Reminder/compare/$PREVIOUS_TAG...v$NEXT_PATCH_VERSION)
2222
2323
## Contributors
2424

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ jobs:
6363
uses: TheDoctor0/zip-release@0.6.2
6464
with:
6565
type: zip
66-
filename: Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.zip
67-
path: ${{ github.workspace }}\build\source\Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.exe
66+
filename: Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.zip
67+
path: ${{ github.workspace }}\build\source\Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.exe
6868

6969
- name: Upload built executable file
7070
uses: tanyagray/action-upload-release-asset@v1.1.3
7171
env:
7272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7373
with:
7474
upload_url: ${{ needs.update_release_draft.outputs.upload_url }}
75-
asset_path: ${{ github.workspace }}\Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.zip
76-
asset_name: Eyes_Protection_Reminder_v4.1.0.Windows.${{ matrix.architecture }}.zip
75+
asset_path: ${{ github.workspace }}\Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.zip
76+
asset_name: Eyes_Protection_Reminder_v4.1.1.Windows.${{ matrix.architecture }}.zip
7777
asset_content_type: application/zip
7878

7979
publish_release:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.10.2)
22

3-
project(Eyes_Protection_Reminder VERSION 4.1.0)
3+
project(Eyes_Protection_Reminder VERSION 4.1.1)
44

55
add_subdirectory(libs/wxWidgets)
66
add_subdirectory(source)

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Languages](https://img.shields.io/github/languages/top/hardingadonis/Eyes_Protection_Reminder?style=flat)
77
![Repo Size](https://img.shields.io/github/repo-size/hardingadonis/Eyes_Protection_Reminder?style=flat)
88
![License](https://img.shields.io/github/license/hardingadonis/Eyes_Protection_Reminder?style=flat)
9-
[![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)
9+
[![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)
1010

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

@@ -60,10 +60,16 @@ cmake --build . --target EPR
6060
```
6161

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

66-
- Or, you can download the binary in [here](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.0)
66+
- Or, you can download the binary in [here](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1)
67+
68+
## Usage
69+
70+
You do not know how to use this tool?
71+
72+
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)
6773

6874
## License
6975

docs/Usage.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Eyes Protection Reminder - Usage
2+
3+
## Requirements
4+
5+
- Windows OS such as:
6+
- Windows XP
7+
- Windows 7
8+
- Windows 8/8.1
9+
- Windows 10
10+
- Windows 11
11+
12+
## Usage
13+
14+
### Download Eyes Protection Reminder
15+
16+
You can download the binary in [here](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1).
17+
18+
Choose one of two:
19+
20+
- *.Windows.x86 for Windows 32 bit.
21+
- *.Windows.x64 for Windows 64 bit.
22+
23+
<p align="center">
24+
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_1.png" />
25+
</p>
26+
27+
### Extract and open Eyes Protection Reminder
28+
29+
After downloading **Eyes Protection Reminder**, we will extract and run it.
30+
31+
This is the main interface of **Eyes Protection Reminder**.
32+
33+
<p align="center">
34+
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_2.png" />
35+
</p>
36+
37+
### Main functions
38+
39+
- **Start** button to begin the timer.
40+
- **Stop** button to stop the timer.
41+
- When the timer is over, **Eyes Protection Reminder** will send a notification for you like this:
42+
43+
<p align="center">
44+
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_3.png" />
45+
</p>
46+
47+
## Hotkey
48+
49+
- **F1**: to open **About Dialog**.
50+
- **F2**: to hide **Eyes Protection Reminder**.
51+
- **F3**: to open **Settings Dialog**.
52+
- **Alt+F4**: to exit **Eyes Protection Reminder**.

docs/Usage_vi_VN.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Eyes Protection Reminder - Cách sử dụng
2+
3+
## Yêu cầu
4+
5+
- Hệ điều hành Windows:
6+
- Windows XP
7+
- Windows 7
8+
- Windows 8/8.1
9+
- Windows 10
10+
- Windows 11
11+
12+
## Cách sử dụng
13+
14+
### Tải Eyes Protection Reminder
15+
16+
Bạn có thể tải **Eyes Protection Reminder** [tại đây](https://github.com/hardingadonis/Eyes_Protection_Reminder/releases/tag/v4.1.1).
17+
18+
Chọn một trong hai:
19+
20+
- *.Windows.x86 for Windows 32 bit.
21+
- *.Windows.x64 for Windows 64 bit.
22+
23+
<p align="center">
24+
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_1.png" />
25+
</p>
26+
27+
### Giải nén và chạy Eyes Protection Reminder
28+
29+
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.
30+
31+
Đây là giao diện chính của **Eyes Protection Reminder**.
32+
33+
<p align="center">
34+
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_2.png" />
35+
</p>
36+
37+
### Chức năng chính
38+
39+
- Nút **Start** để bắt đầu tính giờ.
40+
- Nút **Stop** để dừng việc tính giờ lại.
41+
- 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:
42+
43+
<p align="center">
44+
<img src="https://github.com/hardingadonis/Eyes_Protection_Reminder/blob/main/docs/imgs/EPR_docs_image_3.png" />
45+
</p>
46+
47+
## Phím tắt
48+
49+
- **F1**: để mở **About Dialog**.
50+
- **F2**: để ẩn **Eyes Protection Reminder**.
51+
- **F3**: để mở **Settings Dialog**.
52+
- **Alt+F4**: để thoát **Eyes Protection Reminder**.

docs/imgs/EPR_docs_image_1.png

4.89 KB
Loading

docs/imgs/EPR_docs_image_2.png

5.26 KB
Loading

docs/imgs/EPR_docs_image_3.png

2.04 KB
Loading

imgs/EPR_showcase.png

19 Bytes
Loading

source/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.10.2)
22

3-
project(EPR VERSION 4.1.0)
3+
project(EPR VERSION 4.1.1)
44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66

@@ -34,4 +34,4 @@ set(EPR_ICON ${CMAKE_SOURCE_DIR}/assets/EPR_icon.rc)
3434
add_executable(${PROJECT_NAME} WIN32 ${EPR_SOURCES} ${EPR_ICON})
3535
target_link_libraries(${PROJECT_NAME} PUBLIC wx::core wx::base)
3636
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
37-
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME Eyes_Protection_Reminder_v4.1.0.Windows.${EPR_ARCH})
37+
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME Eyes_Protection_Reminder_v4.1.1.Windows.${EPR_ARCH})

source/include/UI/MainPanel.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ namespace EPR
4242
void OnTimerElapsed(wxTimerEvent& _event);
4343
void OnRestedElapsed(wxTimerEvent& _event);
4444

45+
void ResetTimer();
46+
4547
private:
4648
void CreateControls();
4749

48-
void ResetTimer();
49-
5050
private:
5151
wxStaticText* m_timerValue;
5252
wxStaticText* m_restedValue;

source/include/UI/SettingsDialog.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@
2929
#include <wx/wx.h>
3030
#include <wx/spinctrl.h>
3131

32+
#include <UI/MainPanel.hpp>
33+
3234
namespace EPR
3335
{
3436
class SettingsDialog : public wxDialog
3537
{
3638
public:
37-
SettingsDialog(wxWindow* _parent);
39+
SettingsDialog(wxWindow* _parent, MainPanel* _mainPanel);
3840
virtual ~SettingsDialog() = default;
3941

4042
void OnSaveButtonPressed(wxCommandEvent& _event);
@@ -49,6 +51,8 @@ namespace EPR
4951
wxTextCtrl* m_stringNotification;
5052
wxCheckBox* m_startupWithWindows;
5153

54+
MainPanel* m_mainPanel;
55+
5256
public:
5357
wxDECLARE_EVENT_TABLE();
5458
};

source/src/Application.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ namespace EPR
6060
}
6161

6262
// Set name for this tool
63-
SetAppName("Eyes Protection Remimder");
63+
SetAppName("Eyes Protection Reminder");
6464

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

6868
if (m_mainFrame == nullptr)
6969
{

source/src/UI/MainFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace EPR
8989

9090
void MainFrame::OnMenuSettings(wxCommandEvent& _event)
9191
{
92-
(new SettingsDialog(this))->ShowModal();
92+
(new SettingsDialog(this, m_mainPanel))->ShowModal();
9393

9494
_event.Skip();
9595
}
@@ -100,7 +100,7 @@ namespace EPR
100100

101101
// Set the information for about dialog
102102
_aboutInfo.SetName(wxTheApp->GetAppName());
103-
_aboutInfo.SetVersion("- v4.1.0");
103+
_aboutInfo.SetVersion("- v4.1.1");
104104
_aboutInfo.SetIcon(s_EPR_icon_64);
105105
_aboutInfo.SetCopyright("Copyright (c) 2022 " + wxString::FromUTF8("Minh Vương.") + "\nAll rights reserved.");
106106
_aboutInfo.SetDescription("A small tool to remind you to\nprotect your eyes with the 20:20:20 rule.");

source/src/UI/MainPanel.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace EPR
9999
{
100100
// Show the notification
101101
m_taskBarIcon->ShowBalloon(
102-
"Eyes Protection Remimder",
102+
"Eyes Protection Reminder",
103103
Config::GetInstance()->GetStringNotification(),
104104
Config::GetInstance()->GetTimeNotification() * 1000,
105105
wxICON_INFORMATION,
@@ -144,6 +144,28 @@ namespace EPR
144144
));
145145
}
146146

147+
void MainPanel::ResetTimer()
148+
{
149+
s_timer_time_remaining = Config::GetInstance()->GetTimeRemaining();
150+
s_timer_rested_remaining = Config::GetInstance()->GetRestedRemaining();
151+
152+
m_timerValue->SetLabel(wxString::Format(
153+
"%s%d:%s%d",
154+
s_timer_time_remaining / 60 < 10 ? "0" : "",
155+
s_timer_time_remaining / 60,
156+
s_timer_time_remaining % 60 < 10 ? "0" : "",
157+
s_timer_time_remaining % 60
158+
));
159+
160+
m_restedValue->SetLabel(wxString::Format(
161+
"%s%d:%s%d",
162+
s_timer_rested_remaining / 60 < 10 ? "0" : "",
163+
s_timer_rested_remaining / 60,
164+
s_timer_rested_remaining % 60 < 10 ? "0" : "",
165+
s_timer_rested_remaining % 60
166+
));
167+
}
168+
147169
void MainPanel::CreateControls()
148170
{
149171
// Create label to show the value of timer
@@ -195,26 +217,4 @@ namespace EPR
195217
m_timer->Bind(wxEVT_TIMER, &EPR::MainPanel::OnTimerElapsed, this);
196218
m_rested->Bind(wxEVT_TIMER, &EPR::MainPanel::OnRestedElapsed, this);
197219
}
198-
199-
void MainPanel::ResetTimer()
200-
{
201-
s_timer_time_remaining = Config::GetInstance()->GetTimeRemaining();
202-
s_timer_rested_remaining = Config::GetInstance()->GetRestedRemaining();
203-
204-
m_timerValue->SetLabel(wxString::Format(
205-
"%s%d:%s%d",
206-
s_timer_time_remaining / 60 < 10 ? "0" : "",
207-
s_timer_time_remaining / 60,
208-
s_timer_time_remaining % 60 < 10 ? "0" : "",
209-
s_timer_time_remaining % 60
210-
));
211-
212-
m_restedValue->SetLabel(wxString::Format(
213-
"%s%d:%s%d",
214-
s_timer_rested_remaining / 60 < 10 ? "0" : "",
215-
s_timer_rested_remaining / 60,
216-
s_timer_rested_remaining % 60 < 10 ? "0" : "",
217-
s_timer_rested_remaining % 60
218-
));
219-
}
220220
}

source/src/UI/SettingsDialog.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ namespace EPR
4040
EVT_BUTTON(EPR_Button_Save, SettingsDialog::OnSaveButtonPressed)
4141
wxEND_EVENT_TABLE()
4242

43-
SettingsDialog::SettingsDialog(wxWindow* _parent) :
44-
wxDialog(_parent, wxID_ANY, "Eyes Protection Remimder - Settings")
43+
SettingsDialog::SettingsDialog(wxWindow* _parent, MainPanel* _mainPanel) :
44+
wxDialog(_parent, wxID_ANY, "Eyes Protection Reminder - Settings"),
45+
m_mainPanel(_mainPanel)
4546
{
4647
Center();
4748
CreateControls();
@@ -58,6 +59,8 @@ namespace EPR
5859

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

62+
m_mainPanel->ResetTimer();
63+
6164
Destroy();
6265
}
6366

0 commit comments

Comments
 (0)