mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
quassel: Use new setup mechanism
This commit is contained in:
parent
a33f68f051
commit
528fe47c16
@ -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 '
|
||||
'<a href="http://quassel-irc.org/downloads">desktop</a> and '
|
||||
'<a href="http://quasseldroid.iskrembilen.com/">mobile</a> 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():
|
||||
|
||||
@ -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 %}
|
||||
|
||||
<h2>{% trans "IRC Client (Quassel)" %}</h2>
|
||||
|
||||
<p>
|
||||
{% 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 %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
You can connect to your Quassel core on the default Quassel port
|
||||
4242. Clients to connect to Quassel from your
|
||||
<a href="http://quassel-irc.org/downloads">desktop</a> and
|
||||
<a href="http://quasseldroid.iskrembilen.com/">mobile</a> devices
|
||||
are available.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% block configuration %}
|
||||
|
||||
<h3>{% trans "Status" %}</h3>
|
||||
|
||||
|
||||
@ -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})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user