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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
TileCreatorDialog.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 2006-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 
13 // Own
14 #include "TileCreatorDialog.h"
15 
16 // Qt
17 #include <QTimer>
18 
19 // Marble
20 #include "MarbleDebug.h"
21 #include "TileCreator.h"
22 
23 #include "ui_TileCreatorDialog.h"
24 
25 namespace Marble
26 {
27 
28 class TileCreatorDialogPrivate
29 {
30  public:
31  Ui::TileCreatorDialog uiWidget;
32 
33  TileCreator *m_creator;
34 };
35 
36 
37 TileCreatorDialog::TileCreatorDialog(TileCreator *creator, QWidget *parent)
38  : QDialog(parent),
39  d( new TileCreatorDialogPrivate )
40 {
41  d->m_creator = creator;
42 
43  d->uiWidget.setupUi(this);
44 
45  connect( d->m_creator, SIGNAL(progress(int)),
46  this, SLOT(setProgress(int)), Qt::QueuedConnection );
47  connect( d->uiWidget.cancelButton, SIGNAL(clicked()),
48  this, SLOT(cancelTileCreation()) );
49 
50  // Start the creation process
51  d->m_creator->start();
52 }
53 
54 void TileCreatorDialog::cancelTileCreation()
55 {
56  d->uiWidget.cancelButton->setEnabled( false );
57 
59  // d->m_creator->cancelTileCreation();
60 }
61 
62 TileCreatorDialog::~TileCreatorDialog()
63 {
64  disconnect( d->m_creator, SIGNAL(progress(int)),
65  this, SLOT(setProgress(int)) );
66 
67  if ( d->m_creator->isRunning() )
68  d->m_creator->cancelTileCreation();
69  d->m_creator->wait();
70  d->m_creator->deleteLater();
71  delete d;
72 }
73 
74 void TileCreatorDialog::setProgress( int progress )
75 {
76  d->uiWidget.progressBar->setValue( progress );
77 
78  if ( progress == 100 )
79  {
80  QTimer::singleShot( 0, this, SLOT(accept()) );
81  }
82 }
83 
84 void TileCreatorDialog::setSummary( const QString& name,
85  const QString& description )
86 {
87  const QString summary = "<B>" + tr( name.toUtf8() ) + "</B><BR>" + tr( description.toUtf8() );
88  d->uiWidget.descriptionLabel->setText( summary );
89 }
90 
91 }
92 
93 #include "TileCreatorDialog.moc"
QWidget
TileCreator.h
QObject::disconnect
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
MarbleDebug.h
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
Marble::TileCreatorDialog::setSummary
void setSummary(const QString &name, const QString &description)
Definition: TileCreatorDialog.cpp:84
Marble::TileCreatorDialog::setProgress
void setProgress(int progress)
Definition: TileCreatorDialog.cpp:74
Marble::TileCreator
Definition: TileCreator.h:53
QString
Marble::TileCreatorDialog::~TileCreatorDialog
~TileCreatorDialog()
Definition: TileCreatorDialog.cpp:62
QDialog::accept
virtual void accept()
Marble::TileCreatorDialog::TileCreatorDialog
TileCreatorDialog(TileCreator *creator, QWidget *parent=0)
Definition: TileCreatorDialog.cpp:37
QDialog
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
TileCreatorDialog.h
QTimer::singleShot
singleShot
QString::toUtf8
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:42 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
  • 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