File: simple_marble.py

package info (click to toggle)
marble 4%3A16.08.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 76,596 kB
  • ctags: 22,881
  • sloc: cpp: 177,552; xml: 39,363; ansic: 7,204; python: 2,209; sh: 1,140; makefile: 230; perl: 222; ruby: 97; java: 66
file content (66 lines) | stat: -rw-r--r-- 2,320 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!env python
#
#    Copyright 2008 Simon Edwards <simon@simonzone.com>
#
#    This file is part of the Marble Virtual Globe.
#
#    This library is free software you can redistribute it and/or
#    modify it under the terms of the GNU Library General Public
#    License as published by the Free Software Foundation either
#    version 2 of the License, or (at your option) any later version.
#
#    This library is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#    Library General Public License for more details.
#
#    You should have received a copy of the GNU Library General Public License
#    aint with this library see the file COPYING.LIB.  If not, write to
#    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#    Boston, MA 02110-1301, USA.
#
# A very simple example of how to use the marble widget.

from PyQt4.QtCore import *
from PyKDE4.kdeui import *
from PyKDE4.kdecore import *
from PyKDE4.marble import *
import sys

class MainWin (KMainWindow):
    def __init__ (self, *args):
        KMainWindow.__init__ (self)
        self.resize(640, 480)

        self.marble = Marble.MarbleWidget(self)
        self.marble.setMapThemeId("earth/bluemarble/bluemarble.dgml")
        self.setCentralWidget(self.marble)
        self.marble.centerOn(5.8333, 51.8333)
        self.marble.zoomView(2000)

def main():
    appName     = "simple_marble"
    catalog     = ""
    programName = ki18n ("default")
    version     = "1.0"
    description = ki18n ("Simple Python Marble Example")
    license     = KAboutData.License_GPL
    copyright   = ki18n ("(c) 2008 Simon Edwards")
    text        = ki18n ("none")
    homePage    = "www.simonzone.com"
    bugEmail    = "simon@simonzone.com"

    aboutData   = KAboutData (appName, catalog, programName, version, description,
                              license, copyright, text, homePage, bugEmail)

    aboutData.addAuthor (ki18n("Simon Edwards"), ki18n("Developer"))
    
    KCmdLineArgs.init(sys.argv, aboutData)
    
    app = KApplication()
    mainWindow = MainWin(None, "main window")
    mainWindow.show()
    app.connect(app, SIGNAL ("lastWindowClosed ()"), app.quit)
    app.exec_()

main()