HowToWritePlugins
Attachment 'bluetoothsettings.py'
Download 1 # Your name, email and other copyright information
2
3 from gi.repository import Gtk #Don't support PyGtk
4
5 from ubuntutweak.gui.containers import TablePack # TablePack is a container to pack any numbers of widgets
6 from ubuntutweak.modules import TweakModule # Subclass this Module then it will become a plugin of Ubuntu Tweak
7 from ubuntutweak.factory import WidgetFactory # Use to create the setting related widget easily
8
9 class BluetoothSettings(TweakModule):
10 __title__ = _('Bluetooth Settings')
11 __desc__ = _('Tweak some hidden bluetooth settings')
12 __icon__ = 'bluetooth' # The icon name, currently don't support path to image
13 __category__ = 'system' # the category
14
15 __author__ = 'Your Name <your@mail.com>'
16 __url__ = 'Your home page'
17 __url_title__ = 'The title of Home page'
18
19 def __init__(self):
20 TweakModule.__init__(self)
21
22 # WidgetFactory will return a tuple of widgets
23 box = TablePack(_("Bluetooth Options"), (
24 WidgetFactory.create("CheckButton",
25 label=_('Share Public directory over Bluetooth'),
26 key="/desktop/gnome/file_sharing/bluetooth_enabled",
27 backend='gconf', # GSettings will support in the future
28 enable_reset=True),
29 WidgetFactory.create("CheckButton",
30 label=_("Whether to notify about newly received files"),
31 key="/desktop/gnome/file_sharing/bluetooth_notify",
32 backend='gconf',
33 enable_reset=True),
34 WidgetFactory.create("CheckButton",
35 label=_("Whether to allow Bluetooth clients to write files."),
36 key="/desktop/gnome/file_sharing/bluetooth_allow_write",
37 backend='gconf',
38 enable_reset=True),
39 WidgetFactory.create('ComboBox',
40 label=_('When to accept files sent over Bluetooth'),
41 key='/desktop/gnome/file_sharing/bluetooth_accept_files',
42 enable_reset=True,
43 backend='gconf',
44 texts=[_('Always'), _('Bonded'), _('Ask')],
45 values=["always", "bonded", "ask"]),
46 ))
47
48 self.add_start(box, False, False, 0)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.