• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
QtMarbleConfigDialog.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Bastian Holst <bastianholst@gmx.de>
9 // Copyright 2012 Mohammed Nafees <nafees.technocool@gmail.com>
10 //
11 
12 // Own
13 #include "QtMarbleConfigDialog.h"
14 
15 #include "ui_MarbleCacheSettingsWidget.h"
16 #include "ui_MarbleViewSettingsWidget.h"
17 #include "ui_MarbleNavigationSettingsWidget.h"
18 #include "ui_MarbleTimeSettingsWidget.h"
19 #include "ui_MarbleCloudSyncSettingsWidget.h"
20 
21 // Qt
22 #include <QList>
23 #include <QSettings>
24 #include <QNetworkProxy>
25 #include <QApplication>
26 #include <QDialogButtonBox>
27 #include <QMessageBox>
28 #include <QStandardItem>
29 #include <QTabWidget>
30 #include <QVBoxLayout>
31 #include <QWidget>
32 #include <QDateTime>
33 
34 // Marble
35 #include "MarbleGlobal.h"
36 #include "DialogConfigurationInterface.h"
37 #include "MarbleDebug.h"
38 #include "MarbleDirs.h"
39 #include "MarblePluginSettingsWidget.h"
40 #include "MarbleLocale.h"
41 #include "MarbleWidget.h"
42 #include "MarbleModel.h"
43 #include "RenderPlugin.h"
44 #include "RenderPluginModel.h"
45 #include "MarbleClock.h"
46 #include "routing/RoutingProfilesWidget.h"
47 
48 namespace Marble
49 {
50 
51 class QtMarbleConfigDialogPrivate
52 {
53  public:
54  QtMarbleConfigDialogPrivate( MarbleWidget *marbleWidget )
55  : ui_viewSettings(),
56  ui_navigationSettings(),
57  ui_timeSettings(),
58  ui_cacheSettings(),
59  m_marbleWidget( marbleWidget ),
60  m_pluginModel(),
61  m_cloudSyncSettings( 0 ),
62  m_cloudSyncTabIndex( -1 ),
63  m_tabWidget( 0 )
64  {
65  }
66 
67  Ui::MarbleViewSettingsWidget ui_viewSettings;
68  Ui::MarbleNavigationSettingsWidget ui_navigationSettings;
69  Ui::MarbleTimeSettingsWidget ui_timeSettings;
70  Ui::MarbleCacheSettingsWidget ui_cacheSettings;
71  Ui::MarbleCloudSyncSettingsWidget ui_cloudSyncSettings;
72  MarblePluginSettingsWidget *w_pluginSettings;
73 
74  QSettings m_settings;
75 
76  MarbleWidget *const m_marbleWidget;
77 
78  RenderPluginModel m_pluginModel;
79 
80  QHash< int, int > m_timezone;
81 
82  // Information about the graphics system
83  Marble::GraphicsSystem m_initialGraphicsSystem;
84  Marble::GraphicsSystem m_previousGraphicsSystem;
85  QWidget* m_cloudSyncSettings;
86  int m_cloudSyncTabIndex;
87  QTabWidget* m_tabWidget;
88 };
89 
90 QtMarbleConfigDialog::QtMarbleConfigDialog( MarbleWidget *marbleWidget, QWidget *parent )
91  : QDialog( parent ),
92  d( new QtMarbleConfigDialogPrivate( marbleWidget ) )
93 {
94  d->m_tabWidget = new QTabWidget( this );
95  QDialogButtonBox *buttons =
96  new QDialogButtonBox( QDialogButtonBox::Ok
97  | QDialogButtonBox::Apply
98  | QDialogButtonBox::Cancel,
99  Qt::Horizontal,
100  this );
101 
102  // Connect the signals of the ButtonBox
103  // to the corresponding slots of the dialog.
104  connect( buttons, SIGNAL(accepted()), this, SLOT(accept()) ); // Ok
105  connect( buttons, SIGNAL(rejected()), this, SLOT(reject()) ); // Cancel
106  connect( buttons->button( QDialogButtonBox::Apply ),SIGNAL(clicked()),
107  this, SLOT(writeSettings()) ); // Apply
108  // If the dialog is accepted. Save the settings.
109  connect( this, SIGNAL(accepted()), this, SLOT(writeSettings()) );
110 
111  // view page
112  QWidget *w_viewSettings = new QWidget( this );
113 
114  d->ui_viewSettings.setupUi( w_viewSettings );
115  d->m_tabWidget->addTab( w_viewSettings, tr( "View" ) );
116 
117  // It's experimental -- so we remove it for now.
118  // FIXME: Delete the following line once OpenGL support is officially supported.
119  d->ui_viewSettings.kcfg_graphicsSystem->removeItem( Marble::OpenGLGraphics );
120 
121  QString nativeString ( tr("Native") );
122 
123  #ifdef Q_WS_X11
124  nativeString = tr( "Native (X11)" );
125  #endif
126  #ifdef Q_WS_MAC
127  nativeString = tr( "Native (Mac OS X Core Graphics)" );
128  #endif
129 
130  d->ui_viewSettings.kcfg_graphicsSystem->setItemText( Marble::NativeGraphics, nativeString );
131 
132  // navigation page
133  QWidget *w_navigationSettings = new QWidget( this );
134 
135  d->ui_navigationSettings.setupUi( w_navigationSettings );
136  d->m_tabWidget->addTab( w_navigationSettings, tr( "Navigation" ) );
137 
138  // cache page
139  QWidget *w_cacheSettings = new QWidget( this );
140 
141  d->ui_cacheSettings.setupUi( w_cacheSettings );
142  d->m_tabWidget->addTab( w_cacheSettings, tr( "Cache and Proxy" ) );
143  // Forwarding clear button signals
144  connect( d->ui_cacheSettings.button_clearVolatileCache, SIGNAL(clicked()), SIGNAL(clearVolatileCacheClicked()) );
145  connect( d->ui_cacheSettings.button_clearPersistentCache, SIGNAL(clicked()), SIGNAL(clearPersistentCacheClicked()) );
146 
147  // time page
148  QWidget *w_timeSettings = new QWidget( this );
149  d->ui_timeSettings.setupUi( w_timeSettings );
150  d->m_tabWidget->addTab( w_timeSettings, tr( "Date and Time" ) );
151 
152  // routing page
153  QWidget *w_routingSettings = new RoutingProfilesWidget( marbleWidget->model() );
154  d->m_tabWidget->addTab( w_routingSettings, tr( "Routing" ) );
155 
156  // plugin page
157  d->m_pluginModel.setRenderPlugins( d->m_marbleWidget->renderPlugins() );
158  d->w_pluginSettings = new MarblePluginSettingsWidget( this );
159  d->w_pluginSettings->setModel( &d->m_pluginModel );
160  d->w_pluginSettings->setObjectName( "plugin_page" );
161  d->m_tabWidget->addTab( d->w_pluginSettings, tr( "Plugins" ) );
162 
163  // Setting the icons for the plugin dialog.
164  d->w_pluginSettings->setAboutIcon( QIcon(":/icons/help-about.png") );
165  d->w_pluginSettings->setConfigIcon( QIcon(":/icons/settings-configure.png") );
166 
167  connect( this, SIGNAL(rejected()), &d->m_pluginModel, SLOT(retrievePluginState()) );
168  connect( this, SIGNAL(accepted()), &d->m_pluginModel, SLOT(applyPluginState()) );
169 
170  d->m_cloudSyncSettings = new QWidget;
171  d->ui_cloudSyncSettings.setupUi( d->m_cloudSyncSettings );
172  d->ui_cloudSyncSettings.button_syncNow->setEnabled( syncBookmarks() );
173  connect( d->ui_cloudSyncSettings.button_syncNow, SIGNAL(clicked()), SIGNAL(syncNowClicked()) );
174 
175  // Layout
176  QVBoxLayout *layout = new QVBoxLayout( this );
177  layout->addWidget( d->m_tabWidget );
178  layout->addWidget( buttons );
179 
180  this->setLayout( layout );
181 
182  // When the settings have been changed, write to disk.
183  connect( this, SIGNAL(settingsChanged()), this, SLOT(syncSettings()) );
184 
185  initializeCustomTimezone();
186 }
187 
188 QtMarbleConfigDialog::~QtMarbleConfigDialog()
189 {
190  delete d;
191 }
192 
193 void QtMarbleConfigDialog::syncSettings()
194 {
195  d->m_settings.sync();
196 
197  QNetworkProxy proxy;
198 
199  // Make sure that no proxy is used for an empty string or the default value:
200  if ( proxyUrl().isEmpty() || proxyUrl() == "http://" ) {
201  proxy.setType( QNetworkProxy::NoProxy );
202  } else {
203  if ( proxyType() == Marble::Socks5Proxy ) {
204  proxy.setType( QNetworkProxy::Socks5Proxy );
205  }
206  else if ( proxyType() == Marble::HttpProxy ) {
207  proxy.setType( QNetworkProxy::HttpProxy );
208  }
209  else {
210  mDebug() << "Unknown proxy type! Using Http Proxy instead.";
211  proxy.setType( QNetworkProxy::HttpProxy );
212  }
213  }
214 
215  proxy.setHostName( proxyUrl() );
216  proxy.setPort( proxyPort() );
217 
218  if ( proxyAuth() ) {
219  proxy.setUser( proxyUser() );
220  proxy.setPassword( proxyPass() );
221  }
222 
223  QNetworkProxy::setApplicationProxy(proxy);
224 }
225 
226 void QtMarbleConfigDialog::readSettings()
227 {
228  d->m_initialGraphicsSystem = graphicsSystem();
229  d->m_previousGraphicsSystem = d->m_initialGraphicsSystem;
230 
231  // Sync settings to make sure that we read the current settings.
232  syncSettings();
233 
234  // View
235  d->ui_viewSettings.kcfg_distanceUnit->setCurrentIndex( measurementSystem() );
236  d->ui_viewSettings.kcfg_angleUnit->setCurrentIndex( angleUnit() );
237  d->ui_viewSettings.kcfg_stillQuality->setCurrentIndex( stillQuality() );
238  d->ui_viewSettings.kcfg_animationQuality->setCurrentIndex( animationQuality() );
239  d->ui_viewSettings.kcfg_labelLocalization->setCurrentIndex( Marble::Native );
240  d->ui_viewSettings.kcfg_mapFont->setCurrentFont( mapFont() );
241  d->ui_viewSettings.kcfg_graphicsSystem->setCurrentIndex( graphicsSystem() );
242 
243  // Navigation
244  d->ui_navigationSettings.kcfg_dragLocation->setCurrentIndex( Marble::KeepAxisVertically );
245  d->ui_navigationSettings.kcfg_onStartup->setCurrentIndex( onStartup() );
246  d->ui_navigationSettings.kcfg_inertialEarthRotation->setChecked( inertialEarthRotation() );
247  d->ui_navigationSettings.kcfg_animateTargetVoyage->setChecked( animateTargetVoyage() );
248  int editorIndex = 0;
249  if ( externalMapEditor() == "potlatch") {
250  editorIndex = 1;
251  } else if ( externalMapEditor() == "josm") {
252  editorIndex = 2;
253  } else if ( externalMapEditor() == "merkaartor") {
254  editorIndex = 3;
255  }
256  d->ui_navigationSettings.kcfg_externalMapEditor->setCurrentIndex( editorIndex );
257 
258  // Cache
259  d->ui_cacheSettings.kcfg_volatileTileCacheLimit->setValue( volatileTileCacheLimit() );
260  d->ui_cacheSettings.kcfg_persistentTileCacheLimit->setValue( persistentTileCacheLimit() );
261  d->ui_cacheSettings.kcfg_proxyUrl->setText( proxyUrl() );
262  d->ui_cacheSettings.kcfg_proxyPort->setValue( proxyPort() );
263  d->ui_cacheSettings.kcfg_proxyUser->setText( proxyUser() );
264  d->ui_cacheSettings.kcfg_proxyPass->setText( proxyPass() );
265  d->ui_cacheSettings.kcfg_proxyType->setCurrentIndex( proxyType() );
266  d->ui_cacheSettings.kcfg_proxyAuth->setChecked( proxyAuth() );
267 
268  // Time
269  d->ui_timeSettings.kcfg_systemTimezone->setChecked( systemTimezone() );
270  d->ui_timeSettings.kcfg_customTimezone->setChecked( customTimezone() );
271  d->ui_timeSettings.kcfg_chosenTimezone->setCurrentIndex( chosenTimezone() );
272  d->ui_timeSettings.kcfg_utc->setChecked( UTC() );
273  d->ui_timeSettings.kcfg_systemTime->setChecked( systemTime() );
274  d->ui_timeSettings.kcfg_lastSessionTime->setChecked( lastSessionTime() );
275  if( systemTimezone() == true )
276  {
277  QDateTime localTime = QDateTime::currentDateTime().toLocalTime();
278  localTime.setTimeSpec( Qt::UTC );
279  d->m_marbleWidget->model()->setClockTimezone( QDateTime::currentDateTime().toUTC().secsTo( localTime ) );
280  }
281  else if( UTC() == true )
282  {
283  d->m_marbleWidget->model()->setClockTimezone( 0 );
284  }
285  else if( customTimezone() == true )
286  {
287  d->m_marbleWidget->model()->setClockTimezone( d->m_timezone.value( chosenTimezone() ) );
288  }
289 
290  // Routing
291 
292  // ownCloud
293  d->ui_cloudSyncSettings.kcfg_enableSync->setChecked( syncEnabled() );
294  d->ui_cloudSyncSettings.kcfg_syncBookmarks->setChecked( syncBookmarks() );
295  d->ui_cloudSyncSettings.kcfg_syncRoutes->setChecked( syncRoutes() );
296  d->ui_cloudSyncSettings.kcfg_owncloudServer->setText( owncloudServer() );
297  d->ui_cloudSyncSettings.kcfg_owncloudUsername->setText( owncloudUsername() );
298  d->ui_cloudSyncSettings.kcfg_owncloudPassword->setText( owncloudPassword() );
299 
300  // Read the settings of the plugins
301  d->m_marbleWidget->readPluginSettings( d->m_settings );
302 
303  // The settings loaded in the config dialog have been changed.
304  emit settingsChanged();
305 }
306 
307 void QtMarbleConfigDialog::writeSettings()
308 {
309  syncSettings();
310 
311  // Determining the graphicsSystemString
312  QString graphicsSystemString;
313  switch ( d->ui_viewSettings.kcfg_graphicsSystem->currentIndex() )
314  {
315  case Marble::RasterGraphics :
316  graphicsSystemString = "raster";
317  break;
318  case Marble::OpenGLGraphics :
319  graphicsSystemString = "opengl";
320  break;
321  default:
322  case Marble::NativeGraphics :
323  graphicsSystemString = "native";
324  break;
325  }
326 
327  d->m_settings.beginGroup( "View" );
328  d->m_settings.setValue( "distanceUnit", d->ui_viewSettings.kcfg_distanceUnit->currentIndex() );
329  d->m_settings.setValue( "angleUnit", d->ui_viewSettings.kcfg_angleUnit->currentIndex() );
330  d->m_settings.setValue( "stillQuality", d->ui_viewSettings.kcfg_stillQuality->currentIndex() );
331  d->m_settings.setValue( "animationQuality", d->ui_viewSettings.kcfg_animationQuality->currentIndex() );
332  d->m_settings.setValue( "mapFont", d->ui_viewSettings.kcfg_mapFont->currentFont() );
333  d->m_settings.setValue( "graphicsSystem", graphicsSystemString );
334  d->m_settings.endGroup();
335 
336  d->m_settings.beginGroup( "Navigation" );
337  d->m_settings.setValue( "onStartup", d->ui_navigationSettings.kcfg_onStartup->currentIndex() );
338  d->m_settings.setValue( "inertialEarthRotation", d->ui_navigationSettings.kcfg_inertialEarthRotation->isChecked() );
339  d->m_settings.setValue( "animateTargetVoyage", d->ui_navigationSettings.kcfg_animateTargetVoyage->isChecked() );
340  if( d->ui_navigationSettings.kcfg_externalMapEditor->currentIndex() == 0 ) {
341  d->m_settings.setValue( "externalMapEditor", "" );
342  } else if( d->ui_navigationSettings.kcfg_externalMapEditor->currentIndex() == 1 ) {
343  d->m_settings.setValue( "externalMapEditor", "potlatch" );
344  } else if( d->ui_navigationSettings.kcfg_externalMapEditor->currentIndex() == 2 ) {
345  d->m_settings.setValue( "externalMapEditor", "josm" );
346  } else if( d->ui_navigationSettings.kcfg_externalMapEditor->currentIndex() == 3 ) {
347  d->m_settings.setValue( "externalMapEditor", "merkaartor" );
348  } else {
349  Q_ASSERT( false && "Unexpected index of the external editor setting" );
350  }
351  d->m_settings.endGroup();
352 
353  d->m_settings.beginGroup( "Cache" );
354  d->m_settings.setValue( "volatileTileCacheLimit", d->ui_cacheSettings.kcfg_volatileTileCacheLimit->value() );
355  d->m_settings.setValue( "persistentTileCacheLimit", d->ui_cacheSettings.kcfg_persistentTileCacheLimit->value() );
356  d->m_settings.setValue( "proxyUrl", d->ui_cacheSettings.kcfg_proxyUrl->text() );
357  d->m_settings.setValue( "proxyPort", d->ui_cacheSettings.kcfg_proxyPort->value() );
358  d->m_settings.setValue( "proxyType", d->ui_cacheSettings.kcfg_proxyType->currentIndex() );
359  if ( d->ui_cacheSettings.kcfg_proxyAuth->isChecked() ) {
360  d->m_settings.setValue( "proxyAuth", true );
361  d->m_settings.setValue( "proxyUser", d->ui_cacheSettings.kcfg_proxyUser->text() );
362  d->m_settings.setValue( "proxyPass", d->ui_cacheSettings.kcfg_proxyPass->text() );
363  } else {
364  d->m_settings.setValue( "proxyAuth", false );
365  }
366  d->m_settings.endGroup();
367 
368  d->m_settings.beginGroup( "Time" );
369  d->m_settings.setValue( "systemTimezone", d->ui_timeSettings.kcfg_systemTimezone->isChecked() );
370  d->m_settings.setValue( "UTC", d->ui_timeSettings.kcfg_utc->isChecked() );
371  d->m_settings.setValue( "customTimezone", d->ui_timeSettings.kcfg_customTimezone->isChecked() );
372  d->m_settings.setValue( "systemTime", d->ui_timeSettings.kcfg_systemTime->isChecked() );
373  d->m_settings.setValue( "lastSessionTime", d->ui_timeSettings.kcfg_lastSessionTime->isChecked() );
374  d->m_settings.setValue( "chosenTimezone", d->ui_timeSettings.kcfg_chosenTimezone->currentIndex() );
375  d->m_settings.endGroup();
376 
377  d->m_settings.beginGroup( "CloudSync" );
378  d->m_settings.setValue( "enableSync", d->ui_cloudSyncSettings.kcfg_enableSync->isChecked() );
379  d->m_settings.setValue( "syncBackend", "owncloud" );
380  d->m_settings.setValue( "syncBookmarks", d->ui_cloudSyncSettings.kcfg_syncBookmarks->isChecked() );
381  d->m_settings.setValue( "syncRoutes", d->ui_cloudSyncSettings.kcfg_syncRoutes->isChecked() );
382  d->m_settings.setValue( "owncloudServer", d->ui_cloudSyncSettings.kcfg_owncloudServer->text() );
383  d->m_settings.setValue( "owncloudUsername", d->ui_cloudSyncSettings.kcfg_owncloudUsername->text() );
384  d->m_settings.setValue( "owncloudPassword", d->ui_cloudSyncSettings.kcfg_owncloudPassword->text() );
385  d->m_settings.endGroup();
386 
387  // Plugins
388  d->m_marbleWidget->writePluginSettings( d->m_settings );
389 
390  emit settingsChanged();
391 
392  if ( d->m_initialGraphicsSystem != graphicsSystem()
393  && d->m_previousGraphicsSystem != graphicsSystem() ) {
394  QMessageBox::information (this, tr("Graphics System Change"),
395  tr("You have decided to run Marble with a different graphics system.\n"
396  "For this change to become effective, Marble has to be restarted.\n"
397  "Please close the application and start Marble again.") );
398  }
399  d->m_previousGraphicsSystem = graphicsSystem();
400 }
401 
402 QLocale::MeasurementSystem QtMarbleConfigDialog::measurementSystem() const
403 {
404  if( d->m_settings.contains( "View/distanceUnit" ) ) {
405  return (QLocale::MeasurementSystem) d->m_settings.value( "View/distanceUnit" ).toInt();
406  }
407 
408  MarbleLocale *locale = MarbleGlobal::getInstance()->locale();
409 
410  return locale->measurementSystem();
411 }
412 
413 Marble::AngleUnit QtMarbleConfigDialog::angleUnit() const
414 {
415  return (Marble::AngleUnit) d->m_settings.value( "View/angleUnit", Marble::DMSDegree ).toInt();
416 }
417 
418 Marble::MapQuality QtMarbleConfigDialog::stillQuality() const
419 {
420  return (Marble::MapQuality) d->m_settings.value( "View/stillQuality",
421  Marble::HighQuality ).toInt();
422 }
423 
424 Marble::MapQuality QtMarbleConfigDialog::animationQuality() const
425 {
426  return (Marble::MapQuality) d->m_settings.value( "View/animationQuality",
427  Marble::LowQuality ).toInt();
428 }
429 
430 QFont QtMarbleConfigDialog::mapFont() const
431 {
432  return d->m_settings.value( "View/mapFont", QApplication::font() ).value<QFont>();
433 }
434 
435 Marble::GraphicsSystem QtMarbleConfigDialog::graphicsSystem() const
436 {
437  QString graphicsSystemString = d->m_settings.value( "View/graphicsSystem", "raster" ).toString();
438 
439  if ( graphicsSystemString == "raster" ) return Marble::RasterGraphics;
440  if ( graphicsSystemString == "opengl" ) return Marble::OpenGLGraphics;
441 
442  // default case: graphicsSystemString == "raster"
443  return Marble::NativeGraphics;
444 }
445 
446 int QtMarbleConfigDialog::onStartup() const
447 {
448  bool smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
449  int defaultValue = smallScreen ? Marble::LastLocationVisited : Marble::ShowHomeLocation;
450  return d->m_settings.value( "Navigation/onStartup", defaultValue ).toInt();
451 }
452 
453 QString QtMarbleConfigDialog::externalMapEditor() const
454 {
455  return d->m_settings.value( "Navigation/externalMapEditor", "" ).toString();
456 }
457 
458 bool QtMarbleConfigDialog::animateTargetVoyage() const
459 {
460  const bool smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
461  return d->m_settings.value( "Navigation/animateTargetVoyage", smallScreen ).toBool();
462 }
463 
464 bool QtMarbleConfigDialog::inertialEarthRotation() const
465 {
466  return d->m_settings.value( "Navigation/inertialEarthRotation", true ).toBool();
467 }
468 
469 int QtMarbleConfigDialog::volatileTileCacheLimit() const
470 {
471  int defaultValue = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ? 6 : 100;
472  return d->m_settings.value( "Cache/volatileTileCacheLimit", defaultValue ).toInt();
473 }
474 
475 int QtMarbleConfigDialog::persistentTileCacheLimit() const
476 {
477  return d->m_settings.value( "Cache/persistentTileCacheLimit", 0 ).toInt(); // default to unlimited
478 }
479 
480 QString QtMarbleConfigDialog::proxyUrl() const
481 {
482  return d->m_settings.value( "Cache/proxyUrl", "" ).toString();
483 }
484 
485 int QtMarbleConfigDialog::proxyPort() const
486 {
487  return d->m_settings.value( "Cache/proxyPort", 8080 ).toInt();
488 }
489 
490 QString QtMarbleConfigDialog::proxyUser() const
491 {
492  return d->m_settings.value( "Cache/proxyUser", "" ).toString();
493 }
494 
495 QString QtMarbleConfigDialog::proxyPass() const
496 {
497  return d->m_settings.value( "Cache/proxyPass", "" ).toString();
498 }
499 
500 bool QtMarbleConfigDialog::proxyType() const
501 {
502  return d->m_settings.value( "Cache/proxyType", Marble::HttpProxy ).toInt();
503 }
504 
505 bool QtMarbleConfigDialog::proxyAuth() const
506 {
507  return d->m_settings.value( "Cache/proxyAuth", false ).toBool();
508 }
509 
510 bool QtMarbleConfigDialog::systemTimezone() const
511 {
512  return d->m_settings.value( "Time/systemTimezone", true ).toBool();
513 }
514 
515 bool QtMarbleConfigDialog::customTimezone() const
516 {
517  return d->m_settings.value( "Time/customTimezone", false ).toBool();
518 }
519 
520 bool QtMarbleConfigDialog::UTC() const
521 {
522  return d->m_settings.value( "Time/UTC", false ).toBool();
523 }
524 
525 bool QtMarbleConfigDialog::systemTime() const
526 {
527  return d->m_settings.value( "Time/systemTime", true ).toBool();
528 }
529 
530 bool QtMarbleConfigDialog::lastSessionTime() const
531 {
532  return d->m_settings.value( "Time/lastSessionTime", false ).toBool();
533 }
534 
535 int QtMarbleConfigDialog::chosenTimezone() const
536 {
537  return d->m_settings.value( "Time/chosenTimezone", 0 ).toInt();
538 }
539 
540 void QtMarbleConfigDialog::initializeCustomTimezone()
541 {
542  if( d->m_timezone.count() == 0)
543  {
544  d->m_timezone.insert( 0, 0 );
545  d->m_timezone.insert( 1, 3600 );
546  d->m_timezone.insert( 2, 7200 );
547  d->m_timezone.insert( 3, 7200 );
548  d->m_timezone.insert( 4, 10800 );
549  d->m_timezone.insert( 5, 12600 );
550  d->m_timezone.insert( 6, 14400 );
551  d->m_timezone.insert( 7, 18000 );
552  d->m_timezone.insert( 8, 19800 );
553  d->m_timezone.insert( 9, 21600 );
554  d->m_timezone.insert( 10, 25200 );
555  d->m_timezone.insert( 11, 28800 );
556  d->m_timezone.insert( 12, 32400 );
557  d->m_timezone.insert( 13, 34200 );
558  d->m_timezone.insert( 14, 36000 );
559  d->m_timezone.insert( 15, 39600 );
560  d->m_timezone.insert( 16, 43200 );
561  d->m_timezone.insert( 17, -39600 );
562  d->m_timezone.insert( 18, -36000 );
563  d->m_timezone.insert( 19, -32400 );
564  d->m_timezone.insert( 20, -28800 );
565  d->m_timezone.insert( 21, -25200 );
566  d->m_timezone.insert( 22, -25200 );
567  d->m_timezone.insert( 23, -21600 );
568  d->m_timezone.insert( 24, -18000 );
569  d->m_timezone.insert( 25, -18000 );
570  d->m_timezone.insert( 26, -14400 );
571  d->m_timezone.insert( 27, -12600 );
572  d->m_timezone.insert( 28, -10800 );
573  d->m_timezone.insert( 29, -10800 );
574  d->m_timezone.insert( 30, -3600 );
575  }
576 }
577 
578 void QtMarbleConfigDialog::setShowCloudSync( bool show )
579 {
580  if ( show && d->m_cloudSyncTabIndex < 0 ) {
581  d->m_cloudSyncTabIndex = d->m_tabWidget->addTab( d->m_cloudSyncSettings, tr( "Synchronization" ) );
582  } else if ( !show && d->m_cloudSyncTabIndex >= 0 ) {
583  d->m_tabWidget->removeTab( d->m_cloudSyncTabIndex );
584  d->m_cloudSyncTabIndex = -1;
585  }
586 }
587 
588 bool QtMarbleConfigDialog::syncEnabled() const
589 {
590  return d->m_settings.value( "CloudSync/enableSync", false ).toBool();
591 }
592 
593 QString QtMarbleConfigDialog::syncBackend() const
594 {
595  return d->m_settings.value( "CloudSync/syncBackend", "" ).toString();
596 }
597 
598 bool QtMarbleConfigDialog::syncBookmarks() const
599 {
600  return d->m_settings.value( "CloudSync/syncBookmarks", true ).toBool();
601 }
602 
603 bool QtMarbleConfigDialog::syncRoutes() const
604 {
605  return d->m_settings.value( "CloudSync/syncRoutes", true ).toBool();
606 }
607 
608 QString QtMarbleConfigDialog::owncloudServer() const
609 {
610  return d->m_settings.value( "CloudSync/owncloudServer", "" ).toString();
611 }
612 
613 QString QtMarbleConfigDialog::owncloudUsername() const
614 {
615  return d->m_settings.value( "CloudSync/owncloudUsername", "" ).toString();
616 }
617 
618 QString QtMarbleConfigDialog::owncloudPassword() const
619 {
620  return d->m_settings.value( "CloudSync/owncloudPassword", "" ).toString();
621 }
622 
623 }
624 
625 #include "QtMarbleConfigDialog.moc"
Marble::RasterGraphics
Renders everything onto a pixmap.
Definition: MarbleGlobal.h:93
Marble::QtMarbleConfigDialog::clearPersistentCacheClicked
void clearPersistentCacheClicked()
The user clicked on the button to clear persistent tile cache.
Marble::ShowHomeLocation
Show home location on startup.
Definition: MarbleGlobal.h:141
RenderPluginModel.h
Marble::QtMarbleConfigDialog::animateTargetVoyage
bool animateTargetVoyage() const
Definition: QtMarbleConfigDialog.cpp:458
Marble::QtMarbleConfigDialog::initializeCustomTimezone
void initializeCustomTimezone()
Definition: QtMarbleConfigDialog.cpp:540
Marble::MarbleLocale::measurementSystem
QLocale::MeasurementSystem measurementSystem() const
Definition: MarbleLocale.cpp:45
MarblePluginSettingsWidget.h
This file contains the multiple inheritance ui-wrapper for the MarblePluginSettingsWidget ui file...
QDialog
Marble::QtMarbleConfigDialog::proxyPort
int proxyPort() const
Definition: QtMarbleConfigDialog.cpp:485
Marble::KeepAxisVertically
Keep planet axis vertically.
Definition: MarbleGlobal.h:133
Marble::QtMarbleConfigDialog::proxyUser
QString proxyUser() const
Definition: QtMarbleConfigDialog.cpp:490
MarbleModel.h
This file contains the headers for MarbleModel.
QWidget
QtMarbleConfigDialog.h
Marble::QtMarbleConfigDialog::owncloudServer
QString owncloudServer() const
Definition: QtMarbleConfigDialog.cpp:608
Marble::MapQuality
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:80
Marble::MarblePluginSettingsWidget
Definition: MarblePluginSettingsWidget.h:39
MarbleDebug.h
Marble::OpenGLGraphics
Uses OpenGL.
Definition: MarbleGlobal.h:94
Marble::QtMarbleConfigDialog::proxyUrl
QString proxyUrl() const
Definition: QtMarbleConfigDialog.cpp:480
Marble::QtMarbleConfigDialog::owncloudPassword
QString owncloudPassword() const
Definition: QtMarbleConfigDialog.cpp:618
Marble::QtMarbleConfigDialog::proxyPass
QString proxyPass() const
Definition: QtMarbleConfigDialog.cpp:495
Marble::NativeGraphics
Uses the native graphics system of the OS.
Definition: MarbleGlobal.h:92
Marble::QtMarbleConfigDialog::onStartup
int onStartup() const
Definition: QtMarbleConfigDialog.cpp:446
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
Marble::QtMarbleConfigDialog::setShowCloudSync
void setShowCloudSync(bool show)
Definition: QtMarbleConfigDialog.cpp:578
Marble::LowQuality
Low resolution (e.g. interlaced)
Definition: MarbleGlobal.h:82
Marble::QtMarbleConfigDialog::persistentTileCacheLimit
int persistentTileCacheLimit() const
Definition: QtMarbleConfigDialog.cpp:475
Marble::QtMarbleConfigDialog::chosenTimezone
int chosenTimezone() const
Read the value of 'Time/chosenTimezone' key from settings.
Definition: QtMarbleConfigDialog.cpp:535
Marble::Native
Display the name in the official language and glyphs of the labeled place.
Definition: MarbleGlobal.h:125
MarbleDirs.h
Marble::QtMarbleConfigDialog::inertialEarthRotation
bool inertialEarthRotation() const
Definition: QtMarbleConfigDialog.cpp:464
Marble::MarbleWidget::model
MarbleModel * model() const
Return the model that this view shows.
Definition: MarbleWidget.cpp:283
DialogConfigurationInterface.h
Marble::MarbleGlobal::locale
MarbleLocale * locale() const
Definition: MarbleGlobal.cpp:43
MarbleLocale.h
MarbleGlobal.h
RoutingProfilesWidget.h
Marble::QtMarbleConfigDialog::mapFont
QFont mapFont() const
Definition: QtMarbleConfigDialog.cpp:430
Marble::QtMarbleConfigDialog::~QtMarbleConfigDialog
~QtMarbleConfigDialog()
Definition: QtMarbleConfigDialog.cpp:188
Marble::QtMarbleConfigDialog::proxyAuth
bool proxyAuth() const
Definition: QtMarbleConfigDialog.cpp:505
MarbleClock.h
Marble::MarbleGlobal::SmallScreen
Definition: MarbleGlobal.h:268
Marble::MarbleGlobal::getInstance
static MarbleGlobal * getInstance()
Definition: MarbleGlobal.cpp:37
Marble::MarbleLocale
A class that contains all localization stuff for Marble.
Definition: MarbleLocale.h:31
Marble::QtMarbleConfigDialog::customTimezone
bool customTimezone() const
Read the value of 'Time/customTimezone' key from settings.
Definition: QtMarbleConfigDialog.cpp:515
Marble::QtMarbleConfigDialog::syncRoutes
bool syncRoutes() const
Definition: QtMarbleConfigDialog.cpp:603
Marble::LastLocationVisited
Show last location visited on quit.
Definition: MarbleGlobal.h:142
Marble::QtMarbleConfigDialog::syncBackend
QString syncBackend() const
Definition: QtMarbleConfigDialog.cpp:593
Marble::QtMarbleConfigDialog::measurementSystem
QLocale::MeasurementSystem measurementSystem() const
Definition: QtMarbleConfigDialog.cpp:402
Marble::QtMarbleConfigDialog::lastSessionTime
bool lastSessionTime() const
Read the value of 'Time/lastSessionTime' key from settings.
Definition: QtMarbleConfigDialog.cpp:530
Marble::QtMarbleConfigDialog::externalMapEditor
QString externalMapEditor() const
Definition: QtMarbleConfigDialog.cpp:453
Marble::HttpProxy
Uses an Http proxy.
Definition: MarbleGlobal.h:101
Marble::DMSDegree
Degrees in DMS notation.
Definition: MarbleGlobal.h:64
Marble::AngleUnit
AngleUnit
This enum is used to choose the unit chosen to measure angles.
Definition: MarbleGlobal.h:63
Marble::HighQuality
High quality (e.g. antialiasing for lines)
Definition: MarbleGlobal.h:84
Marble::QtMarbleConfigDialog::readSettings
void readSettings()
Read settings and update interface.
Definition: QtMarbleConfigDialog.cpp:226
Marble::QtMarbleConfigDialog::systemTimezone
bool systemTimezone() const
Read the value of 'Time/systemTimezone' key from settings.
Definition: QtMarbleConfigDialog.cpp:510
RenderPlugin.h
Marble::QtMarbleConfigDialog::proxyType
bool proxyType() const
Definition: QtMarbleConfigDialog.cpp:500
Marble::QtMarbleConfigDialog::owncloudUsername
QString owncloudUsername() const
Definition: QtMarbleConfigDialog.cpp:613
Marble::MarbleGlobal::profiles
Profiles profiles() const
Definition: MarbleGlobal.cpp:48
Marble::Socks5Proxy
Uses a Socks5Proxy.
Definition: MarbleGlobal.h:102
Marble::QtMarbleConfigDialog::settingsChanged
void settingsChanged()
This signal is emitted when when the loaded settings were changed.
Marble::QtMarbleConfigDialog::syncNowClicked
void syncNowClicked()
The user clicked on the button to manually synchronize bookmarks.
Marble::QtMarbleConfigDialog::clearVolatileCacheClicked
void clearVolatileCacheClicked()
The user clicked on the button to clear volatile tile cache.
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::QtMarbleConfigDialog::systemTime
bool systemTime() const
Read the value of 'Time/systemTime' key from settings.
Definition: QtMarbleConfigDialog.cpp:525
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
Marble::QtMarbleConfigDialog::syncEnabled
bool syncEnabled() const
Definition: QtMarbleConfigDialog.cpp:588
Marble::QtMarbleConfigDialog::UTC
bool UTC() const
Read the value of 'Time/UTC' key from settings.
Definition: QtMarbleConfigDialog.cpp:520
Marble::QtMarbleConfigDialog::writeSettings
void writeSettings()
Write settings to disk.
Definition: QtMarbleConfigDialog.cpp:307
Marble::GraphicsSystem
GraphicsSystem
This enum is used to choose which graphics system Qt is using.
Definition: MarbleGlobal.h:91
Marble::RoutingProfilesWidget
Definition: RoutingProfilesWidget.h:24
Marble::QtMarbleConfigDialog::syncBookmarks
bool syncBookmarks() const
Definition: QtMarbleConfigDialog.cpp:598
Marble::QtMarbleConfigDialog::angleUnit
Marble::AngleUnit angleUnit() const
Definition: QtMarbleConfigDialog.cpp:413
Marble::QtMarbleConfigDialog::volatileTileCacheLimit
int volatileTileCacheLimit() const
Definition: QtMarbleConfigDialog.cpp:469
Marble::QtMarbleConfigDialog::animationQuality
Marble::MapQuality animationQuality() const
Definition: QtMarbleConfigDialog.cpp:424
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
Marble::QtMarbleConfigDialog::QtMarbleConfigDialog
QtMarbleConfigDialog(MarbleWidget *marbleWidget, QWidget *parent=0)
Definition: QtMarbleConfigDialog.cpp:90
Marble::QtMarbleConfigDialog::stillQuality
Marble::MapQuality stillQuality() const
Definition: QtMarbleConfigDialog.cpp:418
Marble::QtMarbleConfigDialog::graphicsSystem
Marble::GraphicsSystem graphicsSystem() const
Definition: QtMarbleConfigDialog.cpp:435
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal