File indexing completed on 2024-12-01 12:27:09

0001 #!env python
0002 #
0003 #    SPDX-FileCopyrightText: 2008 Simon Edwards <simon@simonzone.com>
0004 #
0005 #    SPDX-License-Identifier: LGPL-2.0-or-later
0006 #
0007 # A very simple example of how to use the marble widget.
0008 
0009 from PyQt4.QtCore import *
0010 from PyKDE4.kdeui import *
0011 from PyKDE4.kdecore import *
0012 from PyKDE4.marble import *
0013 import sys
0014 
0015 class MainWin (KMainWindow):
0016     def __init__ (self, *args):
0017         KMainWindow.__init__ (self)
0018         self.resize(640, 480)
0019 
0020         self.marble = Marble.MarbleWidget(self)
0021         self.marble.setMapThemeId("earth/bluemarble/bluemarble.dgml")
0022         self.setCentralWidget(self.marble)
0023         self.marble.centerOn(5.8333, 51.8333)
0024         self.marble.zoomView(2000)
0025 
0026 def main():
0027     appName     = "simple_marble"
0028     catalog     = ""
0029     programName = ki18n ("default")
0030     version     = "1.0"
0031     description = ki18n ("Simple Python Marble Example")
0032     license     = KAboutData.License_GPL
0033     copyright   = ki18n ("(c) 2008 Simon Edwards")
0034     text        = ki18n ("none")
0035     homePage    = "www.simonzone.com"
0036     bugEmail    = "simon@simonzone.com"
0037 
0038     aboutData   = KAboutData (appName, catalog, programName, version, description,
0039                               license, copyright, text, homePage, bugEmail)
0040 
0041     aboutData.addAuthor (ki18n("Simon Edwards"), ki18n("Developer"))
0042     
0043     KCmdLineArgs.init(sys.argv, aboutData)
0044     
0045     app = KApplication()
0046     mainWindow = MainWin(None, "main window")
0047     mainWindow.show()
0048     app.connect(app, SIGNAL ("lastWindowClosed ()"), app.quit)
0049     app.exec_()
0050 
0051 main()