mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Allow reselecting currently selected favourite
This commit is contained in:
parent
ebc363b4c6
commit
44c83da8e5
@ -532,8 +532,10 @@ void Daily::UpdateCalendarDay(QDate date)
|
||||
}
|
||||
void Daily::LoadDate(QDate date)
|
||||
{
|
||||
ui->calendar->blockSignals(true);
|
||||
ui->calendar->setSelectedDate(date);
|
||||
// on_calendar_selectionChanged();
|
||||
ui->calendar->blockSignals(false);
|
||||
on_calendar_selectionChanged();
|
||||
}
|
||||
|
||||
void Daily::on_calendar_selectionChanged()
|
||||
|
@ -1022,6 +1022,7 @@ void MainWindow::on_summaryButton_clicked()
|
||||
}
|
||||
void MainWindow::updateFavourites()
|
||||
{
|
||||
ui->favouritesList->blockSignals(true);
|
||||
ui->favouritesList->clear();
|
||||
|
||||
QDate date=PROFILE.LastDay();
|
||||
@ -1046,6 +1047,7 @@ void MainWindow::updateFavourites()
|
||||
|
||||
date=date.addDays(-1);
|
||||
} while (date>=PROFILE.FirstDay());
|
||||
ui->favouritesList->blockSignals(false);
|
||||
}
|
||||
|
||||
void MainWindow::on_backButton_clicked()
|
||||
@ -2082,3 +2084,16 @@ void MainWindow::on_favouritesList_itemSelectionChanged()
|
||||
ui->tabWidget->setCurrentWidget(daily);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_favouritesList_itemClicked(QListWidgetItem *item)
|
||||
{
|
||||
if (!item) return;
|
||||
QDate date=item->data(Qt::UserRole).toDate();
|
||||
if (date.isValid()) {
|
||||
if (date==daily->getDate()) {
|
||||
ui->tabWidget->setCurrentWidget(daily);
|
||||
daily->graphView()->ResetBounds();
|
||||
daily->graphView()->redraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,6 +257,8 @@ private slots:
|
||||
|
||||
void on_favouritesList_itemSelectionChanged();
|
||||
|
||||
void on_favouritesList_itemClicked(QListWidgetItem *item);
|
||||
|
||||
private:
|
||||
|
||||
Ui::MainWindow *ui;
|
||||
|
Loading…
Reference in New Issue
Block a user