usr/lib/km/km-plug-dialog.py

00001 #!/usr/bin/python
00002 #Python script to download trackpoints and waypoints form a KeyMaze 300 GPS.
00003     #Copyright (C) 2008  Julien TOUS
00004 
00005     #This program is free software: you can redistribute it and/or modify
00006     #it under the terms of the GNU General Public License as published by
00007     #the Free Software Foundation, either version 3 of the License, or
00008     #(at your option) any later version.
00009 
00010     #This program is distributed in the hope that it will be useful,
00011     #but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     #GNU General Public License for more details.
00014 
00015     #You should have received a copy of the GNU General Public License
00016     #along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 
00019 import pygtk
00020 pygtk.require('2.0')
00021 
00022 import gobject
00023 import gtk
00024 import gtk.glade
00025 
00026 class km_plug_dialog:
00027         
00028         def __init__(self):
00029                 self.gladefile = ""/usr"/share/km/km-plug-dialog.glade"
00030                 self.wTree = gtk.glade.XML(self.gladefile)
00031                 self.window = self.wTree.get_widget("km_plug_dialog_window")
00032                 self.window.show_all()
00033                 #Create our dictionay and connect it
00034                 dic = { "on_cancel_button_clicked" : self.close,
00035                         "on_close_button_clicked" : self.set_device_and_close, 
00036                         "on_km_plug_dialog_window_close" : self.set_device_and_close 
00037                         }
00038                 self.wTree.signal_autoconnect(dic)
00039 
00040         def set_device_and_close(self,dummy):
00041                 print "KeyMaze300"
00042                 gtk.main_quit()
00043                 #quit()
00044 
00045         def close(self,dummy):
00046                 gtk.main_quit()
00047                 #quit()
00048 
00049 
00050 if __name__ == '__main__':
00051         #debug = open('~/km.debug','w')
00052         #debug.write('km-plu-dialog was launched !')
00053         #debug.close()
00054         plug_dialog = km_plug_dialog()
00055         gtk.main()

Generated on Wed May 21 15:14:04 2008 for KeyMaze interface by  doxygen 1.5.4