2 ## src/features_window.py
4 ## Copyright (C) 2007 Jean-Marie Traissard <jim AT lapin.org>
5 ## Julien Pivotto <roidelapluie AT gmail.com>
6 ## Stefan Bethge <stefan AT lanpartei.de>
7 ## Stephan Erb <steve-e AT h3c.de>
8 ## Copyright (C) 2007-2010 Yann Leboulanger <asterix AT lagaule.org>
9 ## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
11 ## This file is part of Gajim.
13 ## Gajim is free software; you can redistribute it and/or modify
14 ## it under the terms of the GNU General Public License as published
15 ## by the Free Software Foundation; version 3 only.
17 ## Gajim is distributed in the hope that it will be useful,
18 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ## GNU General Public License for more details.
22 ## You should have received a copy of the GNU General Public License
23 ## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
31 from common
import gajim
32 from common
import helpers
33 from common
import kwalletbinding
34 from common
.i18n
import Q_
38 Class for features window
42 self
.xml
= gtkgui_helpers
.get_gtk_builder('features_window.ui')
43 self
.window
= self
.xml
.get_object('features_window')
44 treeview
= self
.xml
.get_object('features_treeview')
45 self
.desc_label
= self
.xml
.get_object('feature_desc_label')
47 # {name: (available_function, unix_text, windows_text)}
49 _('SSL certificat validation'): (self
.pyopenssl_available
,
50 _('A library used to validate server certificates to ensure a secure connection.'),
51 _('Requires python-pyopenssl.'),
52 _('Requires python-pyopenssl.')),
53 _('Bonjour / Zeroconf'): (self
.zeroconf_available
,
54 _('Serverless chatting with autodetected clients in a local network.'),
55 _('Requires python-avahi.'),
56 _('Requires pybonjour (http://o2s.csail.mit.edu/o2s-wiki/pybonjour).')),
57 _('Command line'): (self
.dbus_available
,
58 _('A script to control Gajim via commandline.'),
59 _('Requires python-dbus.'),
60 _('Feature not available under Windows.')),
61 _('OpenGPG message encryption'): (self
.gpg_available
,
62 _('Encrypting chat messages with gpg keys.'),
63 _('Requires gpg and python-gnupg (http://code.google.com/p/python-gnupg/).'),
64 _('Requires gpg.exe in PATH.')),
65 _('Network-manager'): (self
.network_manager_available
,
66 _('Autodetection of network status.'),
67 _('Requires gnome-network-manager and python-dbus.'),
68 _('Feature not available under Windows.')),
69 _('Session Management'): (self
.session_management_available
,
70 _('Gajim session is stored on logout and restored on login.'),
71 _('Requires python-gnome2.'),
72 _('Feature not available under Windows.')),
73 _('Password encryption'): (self
.some_keyring_available
,
74 _('Passwords can be stored securely and not just in plaintext.'),
75 _('Requires gnome-keyring and python-gnome2-desktop, or kwalletcli.'),
76 _('Feature not available under Windows.')),
77 _('SRV'): (self
.srv_available
,
78 _('Ability to connect to servers which are using SRV records.'),
79 _('Requires dnsutils.'),
80 _('Requires nslookup to use SRV records.')),
81 _('Spell Checker'): (self
.speller_available
,
82 _('Spellchecking of composed messages.'),
83 _('Requires libgtkspell.'),
84 _('Feature not available under Windows.')),
85 _('Notification'): (self
.notification_available
,
86 _('Passive popups notifying for new events.'),
87 _('Requires python-notify or instead python-dbus in conjunction with notification-daemon.'),
88 _('Feature not available under Windows.')),
89 _('Automatic status'): (self
.idle_available
,
90 _('Ability to measure idle time, in order to set auto status.'),
91 _('Requires libxss library.'),
92 _('Requires python2.5.')),
93 _('LaTeX'): (self
.latex_available
,
94 _('Transform LaTeX expressions between $$ $$.'),
95 _('Requires texlive-latex-base and (dvipng or ImageMagick). You have to set \'use_latex\' to True in the Advanced Configuration Editor.'),
96 _('Requires texlive-latex-base and (dvipng or ImageMagick) (All is in MikTeX). You have to set \'use_latex\' to True in the Advanced Configuration Editor.')),
97 _('End to End message encryption'): (self
.pycrypto_available
,
98 _('Encrypting chat messages.'),
99 _('Requires python-crypto.'),
100 _('Requires python-crypto.')),
101 _('RST Generator'): (self
.docutils_available
,
102 _('Generate XHTML output from RST code (see http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html).'),
103 _('Requires python-docutils.'),
104 _('Requires python-docutils.')),
105 _('Audio / Video'): (self
.farsight_available
,
106 _('Ability to start audio and video chat.'),
107 _('Requires python-farsight.'),
108 _('Feature not available under Windows.')),
112 self
.model
= gtk
.ListStore(str, bool)
113 treeview
.set_model(self
.model
)
115 col
= gtk
.TreeViewColumn(Q_('?features:Available'))
116 treeview
.append_column(col
)
117 cell
= gtk
.CellRendererToggle()
118 cell
.set_property('radio', True)
120 col
.set_attributes(cell
, active
= 1)
122 col
= gtk
.TreeViewColumn(_('Feature'))
123 treeview
.append_column(col
)
124 cell
= gtk
.CellRendererText()
125 col
.pack_start(cell
, expand
= True)
126 col
.add_attribute(cell
, 'text', 0)
129 for feature
in self
.features
:
130 func
= self
.features
[feature
][0]
132 self
.model
.append([feature
, rep
])
134 self
.model
.set_sort_column_id(0, gtk
.SORT_ASCENDING
)
136 self
.xml
.connect_signals(self
)
137 self
.window
.show_all()
138 self
.xml
.get_object('close_button').grab_focus()
140 def on_close_button_clicked(self
, widget
):
141 self
.window
.destroy()
143 def on_features_treeview_cursor_changed(self
, widget
):
144 selection
= widget
.get_selection()
147 rows
= selection
.get_selected_rows()[1]
151 feature
= self
.model
[path
][0].decode('utf-8')
152 text
= self
.features
[feature
][1] + '\n'
154 text
= text
+ self
.features
[feature
][3]
156 text
= text
+ self
.features
[feature
][2]
157 self
.desc_label
.set_text(text
)
159 def pyopenssl_available(self
):
162 import OpenSSL
.crypto
167 def zeroconf_available(self
):
177 def dbus_available(self
):
180 from common
import dbus_support
181 return dbus_support
.supported
183 def gpg_available(self
):
184 return gajim
.HAVE_GPG
186 def network_manager_available(self
):
189 import network_manager_listener
190 return network_manager_listener
.supported
192 def session_management_available(self
):
201 def some_keyring_available(self
):
204 if kwalletbinding
.kwallet_available():
212 def srv_available(self
):
215 return helpers
.is_in_path('nslookup')
217 def speller_available(self
):
226 def notification_available(self
):
229 from common
import dbus_support
230 if self
.dbus_available() and dbus_support
.get_notifications_interface():
238 def idle_available(self
):
239 from common
import sleepy
240 return sleepy
.SUPPORTED
242 def latex_available(self
):
243 from common
import latex
244 return latex
.check_for_latex_support()
246 def pycrypto_available(self
):
247 return gajim
.HAVE_PYCRYPTO
249 def docutils_available(self
):
256 def farsight_available(self
):
257 return gajim
.HAVE_FARSIGHT