Update copyright years
[pysize.git] / pysize / ui / gtk / help.py
bloba1ab44a828a14b7c03c49d6a947687f4b4ef70e5
1 # This program is free software; you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation; either version 2 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU Library General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 # See the COPYING file for license information.
17 # Copyright (c) 2006, 2007, 2008 Guillaume Chazarain <guichaz@yahoo.fr>
19 import gtk
20 import pango
22 help = gtk.TextBuffer()
23 normal = help.create_tag(scale=pango.SCALE_LARGE)
24 big = help.create_tag(scale=pango.SCALE_X_LARGE, weight=pango.WEIGHT_BOLD)
25 blue = help.create_tag(scale=pango.SCALE_LARGE, background='#7676DB')
26 red = help.create_tag(scale=pango.SCALE_LARGE, background='#FA7F7F')
27 cyan = help.create_tag(scale=pango.SCALE_LARGE, background='#85F8F8')
29 def add(text, tag=normal, bullet=False):
30 if bullet:
31 add(u'\u2022 ')
32 help.insert_with_tags(help.get_end_iter(), text, tag)
34 def show_help():
35 dialog = gtk.Dialog(title='Pysize Help',
36 buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
37 dialog.connect('response', lambda widget, event: widget.destroy())
38 view = gtk.TextView(buffer=help)
39 view.set_cursor_visible(False)
40 view.set_editable(False)
41 view.set_wrap_mode(gtk.WRAP_WORD)
42 scroll = gtk.ScrolledWindow()
43 scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
44 scroll.add(view)
45 dialog.set_default_size(400, 500)
46 dialog.vbox.add(scroll)
47 dialog.show_all()
49 ################################################################################
51 add('For each parent directory box, its files and sub-directories are ' +
52 'vertically sorted by size on its right.\n')
54 add('\nColors\n\n', tag=big)
56 add('Darker colors indicate bigger files or directories.\n', bullet=True)
57 add('Shades of blue represent directories.\n', tag=blue, bullet=True)
58 add('Files are shown in red.\n', tag=red, bullet=True)
59 add('Cyan boxes aggregate files and directories too small for a single box.\n',
60 tag=cyan, bullet=True)
62 add('\nNavigation\n\n', tag=big)
64 add('The directory to display can be selected in the Open dialog, ' +
65 'accessible from the menu or the toolbar button.\n')
66 add('\nOnce a directory is displayed, it is possible to browse it by double ' +
67 'clicking on the boxes. ')
68 add('By default, boxes are sized so that the whole analyzed directory fits ' +
69 'the window. Altering the zoom level will make scrollbars appear and will ' +
70 'let more files and directories be displayed.\n')
71 add('\nAn history is available both with the Back/Forward buttons and the ' +
72 'History menu, it can be used to get back to previously displayed folders.\n')
74 add('\nDeletion\n\n', tag=big)
76 add('Files and directories can be selected by clicking on them. ')
77 add('Selections can be combined with the Control or Shift key. ')
78 add('Selected files and directories can be scheduled for deletion using the ' +
79 'contextual menu.\n')
80 add('Then, the "Deleted Files" window accessible from the View menu can be ' +
81 'used to actually delete or restore those files and directories.\n')
82 add('\nWithout this confirmation step, no file or directory will be deleted ' +
83 'by pysize\n')
85 add('\nCommand line\n\n', tag=big)
87 add('A curses and ASCII modes are respectively available with the ' +
88 '--ui=curses and --ui=ascii command line options. See the --help option for ' +
89 'more detail.')