Exemple #1
0
 def _updateTracklist(self):
     model = self._gpsTable.get_model()
     model.clear()
     for trackname in domain_gps.getLocalTrackList():
         model.append([trackname])
Exemple #2
0
    def __init__(self,  parent):
        """
        Contructor - all components are assembled in here
        """
        gtk.Dialog.__init__(self, "oSHyReMan: GPS Track Management",  parent,  gtk.DIALOG_MODAL ,  (gtk.STOCK_QUIT,gtk.RESPONSE_OK))
        self.set_size_request(600, -1)
        box = gtk.VBox(False,  5)
        
        labelTitle= gtk.Label()
        labelTitle.set_markup('<big><b>GPS Track Management</b></big>')
        box.pack_start(labelTitle, False, False, 0)
        
        separator = gtk.HSeparator()
        box.pack_start(separator, False, True, 5)

        hbox = gtk.HBox(False, 5)
        
        scrolled_window = gtk.ScrolledWindow()
        scrolled_window.set_border_width(10)
        scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        hbox.pack_start(scrolled_window, True, True, 0)
        
        store = gtk.ListStore(str)
        for trackname in domain_gps.getLocalTrackList():
            store.append([trackname])

        self._gpsTable = gtk.TreeView(model=store)
        cell = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Tracknames (local)", cell, text=0)
        col.pack_start(cell, False)
        self._gpsTable.append_column(col)
                
        self._gpsTable.get_selection().set_mode(gtk.SELECTION_SINGLE)
        scrolled_window.add_with_viewport(self._gpsTable)
        
        
        separator = gtk.VSeparator()
        hbox.pack_start(separator, False, True, 5)
        
        bButtons = gtk.VBox(False, 5)
        bButtons.set_size_request(180, -1)
        b = gtk.Button("Rename selected Track")
        b.connect('clicked', self._doRename)
        bButtons.pack_start(b, False, False,  5)
        b = gtk.Button("Delete selected Track")
        b.connect('clicked', self._doDelete)
        bButtons.pack_start(b, False, False,  5)
        b = gtk.Button("Import Track")
        b.connect('clicked', self._doImport)
        bButtons.pack_start(b, False, False,  5)
        separator = gtk.HSeparator()
        bButtons.pack_start(separator, False, True, 5)
        b = gtk.Button("Pull Tracks from Freerunner")
        b.connect('clicked', self._doPull)
        bButtons.pack_start(b, False, False,  5)
        b = gtk.Button("Push Tracks to Freerunner")
        b.connect('clicked', self._doPush)
        bButtons.pack_start(b, False, False,  5)
        separator = gtk.HSeparator()
        bButtons.pack_start(separator, False, True, 5)
        b = gtk.Button("Clear Tracks on Freerunner")
        b.connect('clicked', self._doRemoteClear)
        bButtons.pack_start(b, False, False,  5)
        b = gtk.Button("Clear Tracks locally")
        b.connect('clicked', self._doLocalClear)
        bButtons.pack_end(b, False, False,  5)
        
        hbox.pack_end(bButtons, False, True,  5)
        
        box.pack_end(hbox, True, True, 0)

        self.vbox.pack_start(box, True, True, 5)
        self.vbox.show_all()