mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	cleanup: remove maintab.ui
This file was so confusing: A tabwidget containing a layout containing a tabwidget. This strange situation is probably due to moving the multi-dive warning message. Remove the file, there seems to be nothing of importance in there. All the UI was moved to the individual tabs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									357e115121
								
							
						
					
					
						commit
						ec96cbaab5
					
				
					 4 changed files with 14 additions and 49 deletions
				
			
		|  | @ -32,22 +32,20 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), | |||
| 	lastTabSelectedDive(0), | ||||
| 	lastTabSelectedDiveTrip(0) | ||||
| { | ||||
| 	ui.setupUi(this); | ||||
| 
 | ||||
| 	extraWidgets << new TabDiveNotes(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Notes")); | ||||
| 	addTab(extraWidgets.last(), tr("Notes")); | ||||
| 	extraWidgets << new TabDiveEquipment(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Equipment")); | ||||
| 	addTab(extraWidgets.last(), tr("Equipment")); | ||||
| 	extraWidgets << new TabDiveInformation(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Information")); | ||||
| 	addTab(extraWidgets.last(), tr("Information")); | ||||
| 	extraWidgets << new TabDiveStatistics(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Summary")); | ||||
| 	addTab(extraWidgets.last(), tr("Summary")); | ||||
| 	extraWidgets << new TabDivePhotos(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Media")); | ||||
| 	addTab(extraWidgets.last(), tr("Media")); | ||||
| 	extraWidgets << new TabDiveExtraInfo(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Extra Info")); | ||||
| 	addTab(extraWidgets.last(), tr("Extra Info")); | ||||
| 	extraWidgets << new TabDiveSite(this); | ||||
| 	ui.tabWidget->addTab(extraWidgets.last(), tr("Dive sites")); | ||||
| 	addTab(extraWidgets.last(), tr("Dive sites")); | ||||
| 
 | ||||
| 	// make sure we know if this is a light or dark mode
 | ||||
| 	isDark = paletteIsDark(palette()); | ||||
|  | @ -125,24 +123,24 @@ void MainTab::updateDiveInfo() | |||
| 		// 1) this disrupts the user-experience and
 | ||||
| 		// 2) the filter is reset, potentially erasing the current trip under our feet.
 | ||||
| 		// TODO: Don't hard code tab location!
 | ||||
| 		bool onDiveSiteTab = ui.tabWidget->currentIndex() == 6; | ||||
| 		bool onDiveSiteTab = currentIndex() == 6; | ||||
| 		if (single_selected_trip()) { | ||||
| 			// Remember the tab selected for last dive but only if we're not on the dive site tab
 | ||||
| 			if (lastSelectedDive && !onDiveSiteTab) | ||||
| 				lastTabSelectedDive = ui.tabWidget->currentIndex(); | ||||
| 			ui.tabWidget->setTabText(0, tr("Trip notes")); | ||||
| 				lastTabSelectedDive = currentIndex(); | ||||
| 			setTabText(0, tr("Trip notes")); | ||||
| 			// Recover the tab selected for last dive trip but only if we're not on the dive site tab
 | ||||
| 			if (lastSelectedDive && !onDiveSiteTab) | ||||
| 				ui.tabWidget->setCurrentIndex(lastTabSelectedDiveTrip); | ||||
| 				setCurrentIndex(lastTabSelectedDiveTrip); | ||||
| 			lastSelectedDive = false; | ||||
| 		} else { | ||||
| 			// Remember the tab selected for last dive trip but only if we're not on the dive site tab
 | ||||
| 			if (!lastSelectedDive && !onDiveSiteTab) | ||||
| 				lastTabSelectedDiveTrip = ui.tabWidget->currentIndex(); | ||||
| 			ui.tabWidget->setTabText(0, tr("Notes")); | ||||
| 				lastTabSelectedDiveTrip = currentIndex(); | ||||
| 			setTabText(0, tr("Notes")); | ||||
| 			// Recover the tab selected for last dive but only if we're not on the dive site tab
 | ||||
| 			if (!lastSelectedDive && !onDiveSiteTab) | ||||
| 				ui.tabWidget->setCurrentIndex(lastTabSelectedDive); | ||||
| 				setCurrentIndex(lastTabSelectedDive); | ||||
| 			lastSelectedDive = true; | ||||
| 		} | ||||
| 	} else { | ||||
|  |  | |||
|  | @ -10,7 +10,6 @@ | |||
| 
 | ||||
| #include <QTabWidget> | ||||
| 
 | ||||
| #include "ui_maintab.h" | ||||
| #include "core/dive.h" | ||||
| #include "core/subsurface-qt/divelistnotifier.h" | ||||
| 
 | ||||
|  | @ -29,7 +28,6 @@ slots: | |||
| 	void escDetected(); | ||||
| 	void colorsChanged(); | ||||
| private: | ||||
| 	Ui::MainTab ui; | ||||
| 	bool lastSelectedDive; | ||||
| 	int lastTabSelectedDive; | ||||
| 	int lastTabSelectedDiveTrip; | ||||
|  |  | |||
|  | @ -1,30 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>MainTab</class> | ||||
|  <widget class="QWidget" name="MainTab"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>555</width> | ||||
|     <height>848</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Form</string> | ||||
|   </property> | ||||
|   <layout class="QVBoxLayout" name="verticalLayout_9"> | ||||
|    <item> | ||||
|     <widget class="QTabWidget" name="tabWidget"> | ||||
|      <property name="currentIndex"> | ||||
|       <number>0</number> | ||||
|      </property> | ||||
|     </widget> | ||||
|    </item> | ||||
|   </layout> | ||||
|  </widget> | ||||
|  <resources> | ||||
|   <include location="../../subsurface.qrc"/> | ||||
|  </resources> | ||||
|  <connections/> | ||||
| </ui> | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue