mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Ask before discarding edits
This is equivalent to what we do for the planner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									d211bc55be
								
							
						
					
					
						commit
						a12b10c008
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -27,6 +27,7 @@
 | 
			
		|||
#include <QPalette>
 | 
			
		||||
#include <QScrollBar>
 | 
			
		||||
#include <QShortcut>
 | 
			
		||||
#include <QMessageBox>
 | 
			
		||||
 | 
			
		||||
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
 | 
			
		||||
	weightModel(new WeightModel(this)),
 | 
			
		||||
| 
						 | 
				
			
			@ -780,6 +781,13 @@ void MainTab::resetPallete()
 | 
			
		|||
void MainTab::rejectChanges()
 | 
			
		||||
{
 | 
			
		||||
	EditMode lastMode = editMode;
 | 
			
		||||
	if (lastMode != NONE && current_dive && memcmp(&editedDive, current_dive, sizeof(struct dive))) {
 | 
			
		||||
		if (QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(tr("Discard the Changes?"),
 | 
			
		||||
									       tr("You are about to discard your changes.")),
 | 
			
		||||
					 QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard) != QMessageBox::Discard) {
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	editMode = NONE;
 | 
			
		||||
	tabBar()->setTabIcon(0, QIcon()); // Notes
 | 
			
		||||
	tabBar()->setTabIcon(1, QIcon()); // Equipment
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue