[form_handler] Add Form Handler plugin

This commit is contained in:
Philipp Hörist
2018-11-29 23:28:24 +01:00
parent ca331879ef
commit 51096a0453
5 changed files with 199 additions and 0 deletions

29
form_handler/gtk/util.py Normal file
View File

@@ -0,0 +1,29 @@
# Copyright (C) 2018 Philipp Hörist <philipp AT hoerist.com>
#
# This file is part of Form Handler.
#
# Form Handler is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; version 3 only.
#
# Form Handler is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Form Handler. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk
from gajim.common import app
def get_button(label, data, callback):
button = Gtk.Button(label=label)
button.connect('clicked', callback, data)
return button
def find_control(account, jid):
return app.interface.msg_win_mgr.get_control(jid, account)