| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
"""Displays the About message menu""" |
| 19 |
|
| 20 |
import urwid |
| 21 |
|
| 22 |
from s_tui.helper_functions import __version__ |
| 23 |
from s_tui.sturwid.ui_elements import ViListBox |
| 24 |
|
| 25 |
ABOUT_MESSAGE = """ |
| 26 |
s-tui is a monitoring tool for your CPU's temperature, frequency, utilization \ |
| 27 |
and power.\n\ |
| 28 |
|
| 29 |
Code for s-tui is available on github\n\ |
| 30 |
https://github.com/amanusk/s-tui\n\ |
| 31 |
\n\ |
| 32 |
Help, issues and pull requests are appreciated. |
| 33 |
\n\ |
| 34 |
Created by:\n\ |
| 35 |
- Alex Manuskin\n\ |
| 36 |
- Gil Tsuker\n\ |
| 37 |
- Maor Veitsman\n\ |
| 38 |
And others |
| 39 |
\n\ |
| 40 |
April 2017\n\ |
| 41 |
\n\ |
| 42 |
""" |
| 43 |
|
| 44 |
ABOUT_MESSAGE += "s-tui " + __version__ + " Released under GNU GPLv2 " |
| 45 |
|
| 46 |
MESSAGE_LEN = 20 |
| 47 |
|
| 48 |
|
| 49 |
class AboutMenu: |
| 50 |
"""Displays the About message menu""" |
| 51 |
|
| 52 |
MAX_TITLE_LEN = 50 |
| 53 |
|
| 54 |
def __init__(self, return_fn): |
| 55 |
self.return_fn = return_fn |
| 56 |
|
| 57 |
self.about_message = ABOUT_MESSAGE |
| 58 |
|
| 59 |
self.time_out_ctrl = urwid.Text(self.about_message) |
| 60 |
|
| 61 |
cancel_button = urwid.Button("Exit", on_press=self.on_cancel) |
| 62 |
cancel_button._label.align = "center" |
| 63 |
|
| 64 |
if_buttons = urwid.Columns([cancel_button]) |
| 65 |
|
| 66 |
title = urwid.Text(("bold text", " About Menu \n"), "center") |
| 67 |
|
| 68 |
self.titles = [title, self.time_out_ctrl, if_buttons] |
| 69 |
|
| 70 |
self.main_window = urwid.LineBox(ViListBox(self.titles)) |
| 71 |
|
| 72 |
def get_size(self): |
| 73 |
return MESSAGE_LEN + 3, self.MAX_TITLE_LEN |
| 74 |
|
| 75 |
def on_cancel(self, w): |
| 76 |
self.return_fn() |