Skip to content

Commit

Permalink
Don't open menu during data refresh
Browse files Browse the repository at this point in the history
Refs: #51
  • Loading branch information
orontee committed Sep 30, 2023
1 parent 415b0ad commit a23d4d0
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 2 deletions.
106 changes: 106 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,112 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Changed

- Don't open menu during data refresh
[#51](https://github.com/orontee/taranis/issues/51)

- Fix some (minor) visual glitches
[#47](https://github.com/orontee/taranis/issues/47)

- Display full date in status bar
[#46](https://github.com/orontee/taranis/issues/46)

- Fix background color of icons
[#45](https://github.com/orontee/taranis/issues/45)

### Removed

## [1.1.0] - 2023-09-16

### Added

- Display daily forecast
[#8](https://github.com/orontee/taranis/issues/8)

- Display credits in about dialog
[#34](https://github.com/orontee/taranis/issues/34)

- History of locations in menu
[#18](https://github.com/orontee/taranis/issues/18)

- Display alerts [#24](https://github.com/orontee/taranis/issues/24)

- Polish translations
[#22](https://github.com/orontee/taranis/issues/22)

### Changed

- Switching forecast view should not refresh data nor update whole
screen [#38](https://github.com/orontee/taranis/issues/38)

- Don't refresh data after cancel of location edit
[#39](https://github.com/orontee/taranis/issues/39)

- Fix invisible alerts button handing touch events
[#35](https://github.com/orontee/taranis/issues/35)

## [1.0.1] - 2023-09-07

### Added

- Check software version at startup
[#30](https://github.com/orontee/taranis/issues/30)

## [1.0.0] - 2023-09-06

### Added

- Draw precipitation histogram
[#20](https://github.com/orontee/taranis/issues/20)

- Sub-menu to select unit system
[#4](https://github.com/orontee/taranis/issues/4)

- Location selection through text input
[#12](https://github.com/orontee/taranis/issues/12)

- Specify language when calling OpenWeather API
[#15](https://github.com/orontee/taranis/issues/15)

- Take profile into account when reading configuration
[#13](https://github.com/orontee/taranis/issues/13)

- Display current weather description
[#14](https://github.com/orontee/taranis/issues/14)

- Elide location text when too long
[#12](https://github.com/orontee/taranis/issues/12)

- About dialog [#7](https://github.com/orontee/taranis/issues/7)

- Application menu [#6](https://github.com/orontee/taranis/issues/6)

- Support for translations
[#3](https://github.com/orontee/taranis/issues/3)

- Weather icons [#1](https://github.com/orontee/taranis/issues/1)
Automatic refresh should not popup connection dialog
[#50](https://github.com/orontee/taranis/issues/50)

- API key can be specified through configuration file
[#44](https://github.com/orontee/taranis/issues/44)

- Automatic refresh every hour
[#26](https://github.com/orontee/taranis/issues/26)

- Show month day and name under day name
[#48](https://github.com/orontee/taranis/issues/48)

- Evenly distribute space between columns of daily forecast view
[#49](https://github.com/orontee/taranis/issues/49)

- Touch control allow to switch pages
[#27](https://github.com/orontee/taranis/issues/27)

- Min and max temperatures are displayed in daily forecast
[#43](https://github.com/orontee/taranis/issues/43)

### Changed

- Fix some (minor) visual glitches
[#47](https://github.com/orontee/taranis/issues/47)

Expand Down
3 changes: 2 additions & 1 deletion src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class App {
}
return 1;
} else if (param_one == CustomEvent::model_updated) {
this->model->refresh_date = std::time(nullptr);
this->history->update_history_maybe();
this->show();
} else if (param_one == CustomEvent::warning_emitted) {
Expand Down Expand Up @@ -277,7 +278,7 @@ class App {

ClearTimerByName(App::refresh_timer_name);

this->model->refresh_date = std::time(nullptr);
this->model->refresh_date = 0;

const auto units = Units{this->model}.to_string();
try {
Expand Down
8 changes: 7 additions & 1 deletion src/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,14 @@ class MenuButton : public Button {
}

void open_menu() {
if (not this->menu_handler)
if (not this->menu_handler) {
return;
}
if (this->model->refresh_date == 0) {
// don't popup menu while refreshing due to display update bug
// after menu dialog is hidden... See issue #51
return;
}

this->update_location_history_items();
this->update_unit_system_bullet();
Expand Down

0 comments on commit a23d4d0

Please sign in to comment.