aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-18 22:38:38 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-18 22:38:38 -0300
commit506b1338750ba9f29b80e7909693f60781a54ccc (patch)
treefe57272968660c5cd29655d4bb33aba054fd7766 /qt-ui/maintab.cpp
parentbcefa4baff2140b8eaa8d9222555656284258ffb (diff)
downloadsubsurface-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>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp7
1 files changed, 6 insertions, 1 deletions
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 );