forked from xak-mcu/ruleuser
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdialogs.py
More file actions
86 lines (74 loc) · 3.39 KB
/
dialogs.py
File metadata and controls
86 lines (74 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#! /usr/bin/env python
# -*- coding: utf8 -*-
###################################################################################################
# RuleUser
# dialogs.py
#
# Copyright (C) 2012,2013 Andrey Burbovskiy <xak-altsp@yandex.ru>
# Copyright (C) 2017 Артем Проскурнев (Artem Proskurnev) <tema@proskurnev.name>
# Поддерживается в Школе №830 г. Москва
#
# Developed specially for ALT Linux School.
# http://www.altlinux.org/LTSP
#
# Computer management and monitoring of users:
# - LTSP servers
# - Linux standalone clients
# - Windows standalone clients(only VNC)
#
# This program 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; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################################
from util import *
_ = gettext.gettext
####################################################################################################
def message_dialog(window, text, list, buttons_ok=None, list_type="list"):
# Возвращает True если нажата OK
if list_type == "list":
for z in list:
if len(z) > 9:
if z[9] == "server":
name = z[0] + "(" + z[4] + ")"
else:
name = z[0] + "(" + z[9] + ")"
else:
name = z[0]
text = text + "\n" + name
elif list_type == "str":
for item in list:
text = text + "\n" + item
dialog = gtk.MessageDialog(window, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_NONE, text)
if buttons_ok:
dialog.add_button(_("Ok"), gtk.BUTTONS_OK)
dialog.add_button(_("Cancel"), gtk.BUTTONS_CANCEL)
if dialog.run() == gtk.BUTTONS_OK:
dialog.destroy()
return True
else:
dialog.destroy()
return False
####################################################################################################
def about_dialog(data=None):
about = gtk.AboutDialog()
about.set_name("RuleUser")
about.set_comments(_("Computer management and monitoring users") + "\n"+_("Developed specially for ALT Linux School") + "\n"+_("Поддерживается в Школе №830 г. Москва"))
about.set_version("1.1.0")
about.set_copyright("\n(c) 2013 " + _("Andrey Burbovskiy") + "\n"+"Email: xak-altsp@yandex.ru""\n(c) 2017 " + _("Артем Проскурнев") + "\n"+"Email: tema@proskurnev.name")
about.set_website("http://www.altlinux.org/LTSP/")
about.set_authors(["Тестирование:" + "\n" + " Александр Шеметов berkut_174@altlinux.org" + "\n"])
about.set_license("GPLv3")
about.set_logo(gtk.gdk.pixbuf_new_from_file(os.path.expanduser("icons/ruleuser2_48.png")))
about.run()
about.destroy()
####################################################################################################