diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-18 22:38:38 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-18 22:38:38 -0300 |
commit | 506b1338750ba9f29b80e7909693f60781a54ccc (patch) | |
tree | fe57272968660c5cd29655d4bb33aba054fd7766 | |
parent | bcefa4baff2140b8eaa8d9222555656284258ffb (diff) | |
download | subsurface-506b1338750ba9f29b80e7909693f60781a54ccc.tar.gz |
Add a Warning icon on the changed tabs, for edition of dives.
Adds a Warning icon on the changed tabs, this is important as
usability, for you could change something on the 'notes' tab,
change the tab and did't realized that something was changed
( by forgotting or something ), then clicking on the cancel
button. so now there's a friendly reminder that you actually
changed something.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | icons/warning.png | bin | 0 -> 24526 bytes | |||
-rw-r--r-- | qt-ui/maintab.cpp | 7 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 | ||||
-rw-r--r-- | subsurface.qrc | 1 |
4 files changed, 7 insertions, 2 deletions
diff --git a/icons/warning.png b/icons/warning.png Binary files differnew file mode 100644 index 000000000..cf53cddc3 --- /dev/null +++ b/icons/warning.png diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 5905285fa..3b879133b 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -132,10 +132,12 @@ void MainTab::enableEdition() bool MainTab::eventFilter(QObject* object, QEvent* event) { if (isEnabled() && event->type() == QEvent::FocusIn && (object == ui->rating || object == ui->visibility)){ + tabBar()->setTabIcon(currentIndex(), QIcon(":warning")); enableEdition(); } if (isEnabled() && event->type() == QEvent::MouseButtonPress ) { + tabBar()->setTabIcon(currentIndex(), QIcon(":warning")); enableEdition(); } return false; // don't "eat" the event. @@ -340,7 +342,8 @@ void MainTab::reload() void MainTab::acceptChanges() { mainWindow()->dive_list()->setEnabled(true); - + tabBar()->setTabIcon(0, QIcon()); // Notes + tabBar()->setTabIcon(1, QIcon()); // Equipment ui->diveNotesMessage->animatedHide(); ui->notesButtonBox->hide(); /* now figure out if things have changed */ @@ -388,6 +391,8 @@ void MainTab::acceptChanges() void MainTab::rejectChanges() { + tabBar()->setTabIcon(0, QIcon()); // Notes + tabBar()->setTabIcon(1, QIcon()); // Equipment mainWindow()->dive_list()->setEnabled(true); if (mainWindow() && mainWindow()->dive_list()->selectedTrips.count() == 1){ ui->notes->setText(notesBackup[NULL].notes ); diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 6cc99db96..b30f10a03 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -14,7 +14,6 @@ struct DiveList; class QSortFilterProxyModel; class DiveTripModel; - namespace Ui { class MainWindow; diff --git a/subsurface.qrc b/subsurface.qrc index cf7864b27..4e9e8ff84 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -10,6 +10,7 @@ <file alias="minimum">icons/minimum.svg</file> <file alias="maximum">icons/maximum.svg</file> <file alias="average">icons/average.svg</file> + <file alias="warning">icons/warning.png</file> <file alias="table-css">qt-ui/css/tableviews.css</file> </qresource> </RCC> |