mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Print: remove the height sliders from the PrintOptions class
These were hidden and we don't really support them because our print layouting is not that flexible in Qt! Note: printoptions.ui is now converted to UNIX line breaks. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									3e669481f6
								
							
						
					
					
						commit
						6e4ebe3c54
					
				
					 3 changed files with 219 additions and 457 deletions
				
			
		|  | @ -14,18 +14,7 @@ PrintOptions::PrintOptions(QWidget *parent, struct options *printOpt) | ||||||
| 
 | 
 | ||||||
| void PrintOptions::setup(struct options *printOpt) | void PrintOptions::setup(struct options *printOpt) | ||||||
| { | { | ||||||
| 	/* these options are not supported ATM and we hide them.
 |  | ||||||
| 	 * basically the entire PrintDialog class needs re-implementation, so that |  | ||||||
| 	 * the paper size, DPI and all other options are displayed in one dialog. |  | ||||||
| 	 * this way we can print directly or do an optional preview first. |  | ||||||
| 	 */ |  | ||||||
| 	ui.sizingHeights->setVisible(false); |  | ||||||
| 
 |  | ||||||
| 	printOptions = printOpt; | 	printOptions = printOpt; | ||||||
| 	// layout height sliders
 |  | ||||||
| 	initSliderWithLabel(ui.sliderPHeight, ui.valuePHeight, printOptions->profile_height); |  | ||||||
| 	initSliderWithLabel(ui.sliderOHeight, ui.valueOHeight, printOptions->notes_height); |  | ||||||
| 	initSliderWithLabel(ui.sliderNHeight, ui.valueNHeight, printOptions->tanks_height); |  | ||||||
| 	// print type radio buttons
 | 	// print type radio buttons
 | ||||||
| 	switch (printOptions->type) { | 	switch (printOptions->type) { | ||||||
| 	case options::PRETTY: | 	case options::PRETTY: | ||||||
|  | @ -52,9 +41,6 @@ void PrintOptions::setup(struct options *printOpt) | ||||||
| 	// connect slots only once
 | 	// connect slots only once
 | ||||||
| 	if (hasSetupSlots) | 	if (hasSetupSlots) | ||||||
| 		return; | 		return; | ||||||
| 	connect(ui.sliderPHeight, SIGNAL(sliderMoved(int)), this, SLOT(sliderPHeightMoved(int))); |  | ||||||
| 	connect(ui.sliderOHeight, SIGNAL(sliderMoved(int)), this, SLOT(sliderOHeightMoved(int))); |  | ||||||
| 	connect(ui.sliderNHeight, SIGNAL(sliderMoved(int)), this, SLOT(sliderNHeightMoved(int))); |  | ||||||
| 
 | 
 | ||||||
| 	connect(ui.radioSixDives, SIGNAL(clicked(bool)), this, SLOT(radioSixDivesClicked(bool))); | 	connect(ui.radioSixDives, SIGNAL(clicked(bool)), this, SLOT(radioSixDivesClicked(bool))); | ||||||
| 	connect(ui.radioTwoDives, SIGNAL(clicked(bool)), this, SLOT(radioTwoDivesClicked(bool))); | 	connect(ui.radioTwoDives, SIGNAL(clicked(bool)), this, SLOT(radioTwoDivesClicked(bool))); | ||||||
|  | @ -68,37 +54,6 @@ void PrintOptions::setup(struct options *printOpt) | ||||||
| 	hasSetupSlots = true; | 	hasSetupSlots = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // layout height sliders
 |  | ||||||
| void PrintOptions::initSliderWithLabel(QSlider *slider, QLabel *label, int value) |  | ||||||
| { |  | ||||||
| 	slider->setValue(value); |  | ||||||
| 	label->setText(formatSliderValueText(value)); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| QString PrintOptions::formatSliderValueText(int value) |  | ||||||
| { |  | ||||||
| 	QString str = QString("%1%").arg(QString::number(value)); |  | ||||||
| 	return str; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PrintOptions::sliderPHeightMoved(int value) |  | ||||||
| { |  | ||||||
| 	ui.valuePHeight->setText(formatSliderValueText(value)); |  | ||||||
| 	printOptions->profile_height = value; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PrintOptions::sliderOHeightMoved(int value) |  | ||||||
| { |  | ||||||
| 	ui.valueOHeight->setText(formatSliderValueText(value)); |  | ||||||
| 	printOptions->notes_height = value; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void PrintOptions::sliderNHeightMoved(int value) |  | ||||||
| { |  | ||||||
| 	ui.valueNHeight->setText(formatSliderValueText(value)); |  | ||||||
| 	printOptions->tanks_height = value; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| // print type radio buttons
 | // print type radio buttons
 | ||||||
| void PrintOptions::radioSixDivesClicked(bool check) | void PrintOptions::radioSixDivesClicked(bool check) | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -15,17 +15,11 @@ public: | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
| 	Ui::PrintOptions ui; | 	Ui::PrintOptions ui; | ||||||
| 	void setLabelFromSlider(QSlider *slider, QLabel *label); |  | ||||||
| 	void initSliderWithLabel(QSlider *slider, QLabel *label, int value); |  | ||||||
| 	QString formatSliderValueText(int value); |  | ||||||
| 	struct options *printOptions; | 	struct options *printOptions; | ||||||
| 	bool hasSetupSlots; | 	bool hasSetupSlots; | ||||||
| 
 | 
 | ||||||
| private | private | ||||||
| slots: | slots: | ||||||
| 	void sliderPHeightMoved(int value); |  | ||||||
| 	void sliderOHeightMoved(int value); |  | ||||||
| 	void sliderNHeightMoved(int value); |  | ||||||
| 	void radioSixDivesClicked(bool check); | 	void radioSixDivesClicked(bool check); | ||||||
| 	void radioTwoDivesClicked(bool check); | 	void radioTwoDivesClicked(bool check); | ||||||
| 	void radioTablePrintClicked(bool check); | 	void radioTablePrintClicked(bool check); | ||||||
|  |  | ||||||
|  | @ -7,7 +7,7 @@ | ||||||
|     <x>0</x> |     <x>0</x> | ||||||
|     <y>0</y> |     <y>0</y> | ||||||
|     <width>511</width> |     <width>511</width> | ||||||
|     <height>448</height> |     <height>308</height> | ||||||
|    </rect> |    </rect> | ||||||
|   </property> |   </property> | ||||||
|   <widget class="QGroupBox" name="printOptions"> |   <widget class="QGroupBox" name="printOptions"> | ||||||
|  | @ -206,190 +206,6 @@ | ||||||
|     </property> |     </property> | ||||||
|    </widget> |    </widget> | ||||||
|   </widget> |   </widget> | ||||||
|   <widget class="QGroupBox" name="sizingHeights"> |  | ||||||
|    <property name="geometry"> |  | ||||||
|     <rect> |  | ||||||
|      <x>10</x> |  | ||||||
|      <y>250</y> |  | ||||||
|      <width>489</width> |  | ||||||
|      <height>141</height> |  | ||||||
|     </rect> |  | ||||||
|    </property> |  | ||||||
|    <property name="title"> |  | ||||||
|     <string>Sizing heights (% of layout)</string> |  | ||||||
|    </property> |  | ||||||
|    <widget class="QSlider" name="sliderPHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>260</x> |  | ||||||
|       <y>30</y> |  | ||||||
|       <width>211</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="minimum"> |  | ||||||
|      <number>43</number> |  | ||||||
|     </property> |  | ||||||
|     <property name="maximum"> |  | ||||||
|      <number>85</number> |  | ||||||
|     </property> |  | ||||||
|     <property name="orientation"> |  | ||||||
|      <enum>Qt::Horizontal</enum> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QLabel" name="labelPHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>10</x> |  | ||||||
|       <y>30</y> |  | ||||||
|       <width>201</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="sizePolicy"> |  | ||||||
|      <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> |  | ||||||
|       <horstretch>0</horstretch> |  | ||||||
|       <verstretch>0</verstretch> |  | ||||||
|      </sizepolicy> |  | ||||||
|     </property> |  | ||||||
|     <property name="text"> |  | ||||||
|      <string>Profile height (43% - 85%)</string> |  | ||||||
|     </property> |  | ||||||
|     <property name="alignment"> |  | ||||||
|      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QLabel" name="labelOHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>10</x> |  | ||||||
|       <y>70</y> |  | ||||||
|       <width>201</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="sizePolicy"> |  | ||||||
|      <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> |  | ||||||
|       <horstretch>0</horstretch> |  | ||||||
|       <verstretch>0</verstretch> |  | ||||||
|      </sizepolicy> |  | ||||||
|     </property> |  | ||||||
|     <property name="text"> |  | ||||||
|      <string>Other data height (8% - 17%)</string> |  | ||||||
|     </property> |  | ||||||
|     <property name="alignment"> |  | ||||||
|      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QSlider" name="sliderOHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>260</x> |  | ||||||
|       <y>70</y> |  | ||||||
|       <width>211</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="minimum"> |  | ||||||
|      <number>8</number> |  | ||||||
|     </property> |  | ||||||
|     <property name="maximum"> |  | ||||||
|      <number>17</number> |  | ||||||
|     </property> |  | ||||||
|     <property name="orientation"> |  | ||||||
|      <enum>Qt::Horizontal</enum> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QSlider" name="sliderNHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>260</x> |  | ||||||
|       <y>110</y> |  | ||||||
|       <width>211</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="maximum"> |  | ||||||
|      <number>52</number> |  | ||||||
|     </property> |  | ||||||
|     <property name="orientation"> |  | ||||||
|      <enum>Qt::Horizontal</enum> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QLabel" name="labelNHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>10</x> |  | ||||||
|       <y>110</y> |  | ||||||
|       <width>201</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="sizePolicy"> |  | ||||||
|      <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> |  | ||||||
|       <horstretch>0</horstretch> |  | ||||||
|       <verstretch>0</verstretch> |  | ||||||
|      </sizepolicy> |  | ||||||
|     </property> |  | ||||||
|     <property name="layoutDirection"> |  | ||||||
|      <enum>Qt::LeftToRight</enum> |  | ||||||
|     </property> |  | ||||||
|     <property name="text"> |  | ||||||
|      <string>Notes height (0% - 52%)</string> |  | ||||||
|     </property> |  | ||||||
|     <property name="alignment"> |  | ||||||
|      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QLabel" name="valuePHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>220</x> |  | ||||||
|       <y>30</y> |  | ||||||
|       <width>31</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="text"> |  | ||||||
|      <string>0</string> |  | ||||||
|     </property> |  | ||||||
|     <property name="alignment"> |  | ||||||
|      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QLabel" name="valueOHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>220</x> |  | ||||||
|       <y>70</y> |  | ||||||
|       <width>31</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="text"> |  | ||||||
|      <string>0</string> |  | ||||||
|     </property> |  | ||||||
|     <property name="alignment"> |  | ||||||
|      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|    <widget class="QLabel" name="valueNHeight"> |  | ||||||
|     <property name="geometry"> |  | ||||||
|      <rect> |  | ||||||
|       <x>220</x> |  | ||||||
|       <y>110</y> |  | ||||||
|       <width>31</width> |  | ||||||
|       <height>20</height> |  | ||||||
|      </rect> |  | ||||||
|     </property> |  | ||||||
|     <property name="text"> |  | ||||||
|      <string>0</string> |  | ||||||
|     </property> |  | ||||||
|     <property name="alignment"> |  | ||||||
|      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |  | ||||||
|     </property> |  | ||||||
|    </widget> |  | ||||||
|   </widget> |  | ||||||
|  </widget> |  </widget> | ||||||
|  <tabstops> |  <tabstops> | ||||||
|   <tabstop>radioSixDives</tabstop> |   <tabstop>radioSixDives</tabstop> | ||||||
|  | @ -399,9 +215,6 @@ | ||||||
|   <tabstop>printInColor</tabstop> |   <tabstop>printInColor</tabstop> | ||||||
|   <tabstop>profileOnTop</tabstop> |   <tabstop>profileOnTop</tabstop> | ||||||
|   <tabstop>notesOnTop</tabstop> |   <tabstop>notesOnTop</tabstop> | ||||||
|   <tabstop>sliderPHeight</tabstop> |  | ||||||
|   <tabstop>sliderOHeight</tabstop> |  | ||||||
|   <tabstop>sliderNHeight</tabstop> |  | ||||||
|  </tabstops> |  </tabstops> | ||||||
|  <resources/> |  <resources/> | ||||||
|  <connections/> |  <connections/> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue