2
# @file geisview/deviceview.py
3
# @brief Device viewer for geisview.
5
# Copyright (C) 2011 Canonical Ltd
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
25
class DeviceView(gtk.Window):
27
def __init__(self, devices):
28
gtk.Window.__init__(self)
29
self.set_title("GEIS Devices")
30
self.set_size_request(200, 200)
32
self._devices = devices
33
self._tree_store = gtk.TreeStore(str)
34
for device in devices:
35
it = self._tree_store.append(None, ["%s" % device])
36
self._tree_view = gtk.TreeView(self._tree_store)
37
# self._tree_view.set_mode(gtk.SELECTION_SINGLE)
38
cell = gtk.CellRendererText()
39
col = gtk.TreeViewColumn('Label')
40
col.pack_start(cell, True)
41
col.add_attribute(cell, 'text', 0)
42
self._tree_view.append_column(col)
44
self.add(self._tree_view)