diff --git a/plinth/modules/quassel/__init__.py b/plinth/modules/quassel/__init__.py index 54a2ec45b..c30f0abcc 100644 --- a/plinth/modules/quassel/__init__.py +++ b/plinth/modules/quassel/__init__.py @@ -16,7 +16,7 @@ # """ -Plinth module for quassel. +Plinth module for Quassel. """ from django.utils.translation import ugettext_lazy as _ @@ -24,22 +24,48 @@ from django.utils.translation import ugettext_lazy as _ from plinth import action_utils from plinth import cfg from plinth import service as service_module +from plinth.utils import format_lazy + +version = 1 depends = ['apps'] +title = _('IRC Client (Quassel)') + +description = [ + format_lazy( + _('Quassel is an IRC application that is split into two parts, a ' + '"core" and a "client". This allows the core to remain connected ' + 'to IRC servers, and to continue receiving messages, even when ' + 'the client is disconnected. {box_name} can run the Quassel ' + 'core service keeping you always online and one or more Quassel ' + 'clients from a desktop or a mobile can be used to connect and ' + 'disconnect from it.'), box_name=_(cfg.box_name)), + + _('You can connect to your Quassel core on the default Quassel port ' + '4242. Clients to connect to Quassel from your ' + 'desktop and ' + 'mobile devices ' + 'are available.') +] + service = None def init(): """Initialize the quassel module.""" menu = cfg.main_menu.get('apps:index') - menu.add_urlname(_('IRC Client (Quassel)'), 'glyphicon-retweet', - 'quassel:index', 730) + menu.add_urlname(title, 'glyphicon-retweet', 'quassel:index', 730) global service service = service_module.Service( - 'quassel-plinth', _('Quassel IRC Client'), - is_external=True, enabled=is_enabled()) + 'quassel-plinth', title, is_external=True, enabled=is_enabled()) + + +def setup(helper, old_version=None): + """Install and configure the module.""" + helper.install(['quassel-core']) + helper.call('post', service.notify_enabled, None, True) def is_enabled(): diff --git a/plinth/modules/quassel/templates/quassel.html b/plinth/modules/quassel/templates/quassel.html index c2f47ce0c..227769463 100644 --- a/plinth/modules/quassel/templates/quassel.html +++ b/plinth/modules/quassel/templates/quassel.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of Plinth. @@ -21,31 +21,7 @@ {% load bootstrap %} {% load i18n %} -{% block content %} - -

{% trans "IRC Client (Quassel)" %}

- -

- {% blocktrans trimmed %} - Quassel is an IRC application that is split into two parts, a - "core" and a "client". This allows the core to remain connected - to IRC servers, and to continue receiving messages, even when - the client is disconnected. {{ box_name }} can run the Quassel - core service keeping you always online and one or more Quassel - clients from a desktop or a mobile can be used to connect and - disconnect from it. - {% endblocktrans %} -

- -

- {% blocktrans trimmed %} - You can connect to your Quassel core on the default Quassel port - 4242. Clients to connect to Quassel from your - desktop and - mobile devices - are available. - {% endblocktrans %} -

+{% block configuration %}

{% trans "Status" %}

diff --git a/plinth/modules/quassel/views.py b/plinth/modules/quassel/views.py index 3918c849b..2adee5260 100644 --- a/plinth/modules/quassel/views.py +++ b/plinth/modules/quassel/views.py @@ -25,16 +25,9 @@ from django.utils.translation import ugettext as _ from .forms import QuasselForm from plinth import actions -from plinth import package from plinth.modules import quassel -def on_install(): - """Notify that the service is now enabled.""" - quassel.service.notify_enabled(None, True) - - -@package.required(['quassel-core'], on_install=on_install) def index(request): """Serve configuration page.""" status = get_status() @@ -51,7 +44,8 @@ def index(request): form = QuasselForm(initial=status, prefix='quassel') return TemplateResponse(request, 'quassel.html', - {'title': _('IRC Client (Quassel)'), + {'title': quassel.title, + 'description': quassel.description, 'status': status, 'form': form})