File: aboutDialog.py

package info (click to toggle)
releaseforge 1.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,088 kB
  • ctags: 1,239
  • sloc: python: 13,801; makefile: 68; sh: 32
file content (89 lines) | stat: -rw-r--r-- 1,710 bytes parent folder | download
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
87
88
89
from qt import *
from aboutDialogBA import AboutDialogBA
from version import VERSION



message = """




ReleaseForge version: %s


http://releaseforge.sourceforge.net
 
Developed By: Phil Schwartz
phil_schwartz@users.sourceforge.net


  
Logo designed by: Curtis Taylor
curtistee@users.sourceforge.net


ReleaseForge is licensed according to the GPL


Other projects by Phil Schwartz:

Kodos - A Regular Expression Debugger
http://kodos.sourceforge.net

DenyHosts - Thwarts SSH server attacks
http://denyhosts.sourceforge.net


Scratchy - Apache log parser and report generator
http://scratchy.sourceforge.net


FAQtor - The easy way to generate FAQs
http://faqtor.sourceforge.net



""" % VERSION



class AboutDialog(AboutDialogBA):
    def __init__(self, parent):
        AboutDialogBA.__init__(self)
        msg = self.center_message()

        self.messageTextBrowser.setText(msg)

        self.num_paragraphs = self.messageTextBrowser.paragraphs()
        self.paragraph = 4 # skip passed blank lines, initially
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL("timeout()"),
                     self.update_message)
        self.timer.start(1000, False)


    def center_message(self):
        lines = message.splitlines()
        #w = self.messageTextBrowser.width()
        w = 50
        centered = []
        for line in lines:
            centered.append(line.center(w).rstrip())
        return '\n'.join(centered)


    def update_message(self):
        if self.paragraph >= self.num_paragraphs - 1:
            self.paragraph = 0
        else:
            self.paragraph += 1
            
        self.messageTextBrowser.setCursorPosition(self.paragraph, 0)