From: Alexandr Popov Date: Sat, 28 Mar 2009 20:57:25 +0000 (+0300) Subject: add src/output.py - first approximation X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=eb0ac75659ce1fa83ced8fbcc19071a43a40639c;p=findit add src/output.py - first approximation --- diff --git a/src/output.py b/src/output.py new file mode 100644 index 0000000..abcafcd --- /dev/null +++ b/src/output.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*-coding: utf-8 -*- +# vim: sw=4 ts=4 expandtab ai + +import gtk + +class Output_Control(object): + def __init__(self): + + +class Output_Abstraction(object): + def __init__(self): + + +class Output_Presentation(object): + def __init__(self): + # Список файлов + self.scrollwind = gtk.ScrolledWindow() + self.scrollwind.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + + # Определяем переменную в которой будет храниться выводимый список + self.liststore = gtk.ListStore(str, str, int) + self.treeview = gtk.TreeView(self.liststore) + # На таблетке не отображаються заголовки столбцов по умолчанию - + # след строка заставляет их отображаться принудительно + self.treeview.set_headers_visible(1) + + self.liststore.append(['', '', 0]) + + # Создаем и настраиваем колонку с размером файла + size_col = gtk.TreeViewColumn( 'Size') + cell = gtk.CellRendererText() + cell.set_property('width', 90) + size_col.pack_start(cell, True) + size_col.add_attribute(cell, 'text', 1) + self.treeview.append_column(size_col) + # Создаем и настраиваем колонку с именем файла + path_col = gtk.TreeViewColumn( 'Path') + cell2 = gtk.CellRendererText() + path_col.pack_start(cell2, True) + path_col.add_attribute(cell2, 'text', 0) + self.treeview.append_column(path_col) + + # Добавляем сортировку для колонок + self.treeview.set_search_column(1) + path_col.set_sort_column_id(0) + size_col.set_sort_column_id(2) + + self.scrollwind.add(self.treeview) + + def get_ui(self): + return self.scrollwind + + def show_result(self, filelist): +