# Your name, email and other copyright information

from gi.repository import Gtk #Don't support PyGtk

from ubuntutweak.gui.containers import TablePack # TablePack is a container to pack any numbers of widgets
from ubuntutweak.modules  import TweakModule # Subclass this Module then it will become a plugin of Ubuntu Tweak
from ubuntutweak.factory import WidgetFactory # Use to create the setting related widget easily

class BluetoothSettings(TweakModule):
    __title__ = _('Bluetooth Settings')
    __desc__ = _('Tweak some hidden bluetooth settings')
    __icon__ = 'bluetooth' # The icon name, currently don't support path to image
    __category__ = 'system' # the category

    __author__ = 'Your Name <your@mail.com>'
    __url__ = 'Your home page'
    __url_title__ = 'The title of Home page'

    def __init__(self):
        TweakModule.__init__(self)

        # WidgetFactory will return a tuple of widgets 
        box = TablePack(_("Bluetooth Options"), (
                    WidgetFactory.create("CheckButton",
                                         label=_('Share Public directory over Bluetooth'),
                                         key="/desktop/gnome/file_sharing/bluetooth_enabled",
                                         backend='gconf', # GSettings will support in the future
                                         enable_reset=True),
                    WidgetFactory.create("CheckButton",
                                         label=_("Whether to notify about newly received files"),
                                         key="/desktop/gnome/file_sharing/bluetooth_notify",
                                         backend='gconf',
                                         enable_reset=True),
                    WidgetFactory.create("CheckButton",
                                         label=_("Whether to allow Bluetooth clients to write files."),
                                         key="/desktop/gnome/file_sharing/bluetooth_allow_write",
                                         backend='gconf',
                                         enable_reset=True),
                    WidgetFactory.create('ComboBox',
                                         label=_('When to accept files sent over Bluetooth'),
                                         key='/desktop/gnome/file_sharing/bluetooth_accept_files',
                                         enable_reset=True,
                                         backend='gconf',
                                         texts=[_('Always'), _('Bonded'), _('Ask')],
                                         values=["always", "bonded", "ask"]),
            ))

        self.add_start(box, False, False, 0)
