[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Thu Nov 11 21:53:17 CET 2010
SVN commit 1195715 by nienhueser:
Add an optional footer when printing driving instructions.
CCMAIL: zaz at mitre.org
M +16 -0 ControlView.cpp
M +1 -0 ControlView.h
M +7 -0 lib/PrintOptions.ui
M +10 -0 lib/PrintOptionsWidget.cpp
M +4 -0 lib/PrintOptionsWidget.h
--- trunk/KDE/kdeedu/marble/src/ControlView.cpp #1195714:1195715
@@ -183,6 +183,7 @@
bool hasRoute = marbleWidget()->model()->routingManager()->routingModel()->rowCount() > 0;
printOptions->setPrintRouteSummary( hasRoute );
printOptions->setPrintDrivingInstructions( hasRoute );
+ printOptions->setPrintDrivingInstructionsAdvice( hasRoute );
printOptions->setRouteControlsEnabled( hasRoute );
printDialog->setOptionTabs( QList<QWidget*>() << printOptions );
@@ -215,6 +216,10 @@
printDrivingInstructions( document, text );
}
+ if ( printOptions->printDrivingInstructionsAdvice() ) {
+ printDrivingInstructionsAdvice( document, text );
+ }
+
text += "</body></html>";
document.setHtml( text );
document.print( printDialog->printer() );
@@ -417,6 +422,17 @@
#endif
}
+void ControlView::printDrivingInstructionsAdvice( QTextDocument &, QString &text )
+{
+#ifndef QT_NO_PRINTER
+ text += "<p>" + tr( "The Marble development team wishes you a pleasant and safe journey." ) + "</p>";
+ text += "<p>" + tr( "Caution: Driving instructions may be incomplete or inaccurate." );
+ text += " " + tr( "Road construction, weather and other unforeseen variables can result in this suggested route not to be the most expedient or safest route to your destination." );
+ text += " " + tr( "Please use common sense while navigating." ) + "</p>";
+#endif
+}
+
+
void ControlView::launchExternalMapEditor()
{
QString editor = m_externalEditor;
--- trunk/KDE/kdeedu/marble/src/ControlView.h #1195714:1195715
@@ -112,6 +112,7 @@
void printLegend( QTextDocument &document, QString &text );
void printRouteSummary( QTextDocument &document, QString &text );
void printDrivingInstructions( QTextDocument &document, QString &text );
+ void printDrivingInstructionsAdvice( QTextDocument &document, QString &text );
//MarbleModel *m_marbleModel;
MarbleWidget *m_marbleWidget;
--- trunk/KDE/kdeedu/marble/src/lib/PrintOptions.ui #1195714:1195715
@@ -113,6 +113,13 @@
</widget>
</item>
<item row="2" column="0">
+ <widget class="QCheckBox" name="drivingInstructionsAdviceCheckBox">
+ <property name="text">
+ <string>Footer</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
--- trunk/KDE/kdeedu/marble/src/lib/PrintOptionsWidget.cpp #1195714:1195715
@@ -84,6 +84,16 @@
routeGroupBox->setEnabled( enabled );
}
+bool PrintOptionsWidget::printDrivingInstructionsAdvice() const
+{
+ return drivingInstructionsAdviceCheckBox->isChecked();
}
+void PrintOptionsWidget::setPrintDrivingInstructionsAdvice( bool enabled )
+{
+ drivingInstructionsAdviceCheckBox->setChecked( enabled );
+}
+
+}
+
#include "PrintOptionsWidget.moc"
--- trunk/KDE/kdeedu/marble/src/lib/PrintOptionsWidget.h #1195714:1195715
@@ -47,6 +47,10 @@
void setPrintDrivingInstructions( bool print );
+ bool printDrivingInstructionsAdvice() const;
+
+ void setPrintDrivingInstructionsAdvice( bool print );
+
void setBackgroundControlsEnabled( bool enabled );
void setRouteControlsEnabled( bool enabled );
More information about the Marble-commits
mailing list