Skip to content
This repository
Newer
Older
100755 157 lines (115 sloc) 3.896 kb
5748b024 » Sergio Costas
2011-04-02 First public version in GITHUB repository
1 #!/usr/bin/env python
2 # -*- coding: UTF-8 -*-
3
4 # Copyright 2006-2007 (C) Raster Software Vigo (Sergio Costas)
5 # Copyright 2006-2007 (C) Peter Gill - win32 parts
6
7 # This file is part of DeVeDe
8 #
9 # DeVeDe is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # DeVeDe is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 import pygtk # for testing GTK version number
23 pygtk.require ('2.0')
24 import gtk
25 import devede_other
26
27 class show_error:
28
29 def __init__(self,gladefile,message):
30
31 """ Shows a window with an error """
32
33 self.newtree=devede_other.create_tree(self,"werror_dialog",gladefile,False)
34 label=self.newtree.get_object("label_error_dialog")
35 label.set_text(message)
36 window=self.newtree.get_object("werror_dialog")
37 window.show()
38 window.run()
39 window.hide()
40 window.destroy()
41 window=None
42
43
44 class show_warning:
45
46 def __init__(self,gladefile,message):
47
48 """ Shows a window with an error """
49
50 self.newtree=devede_other.create_tree(self,"wwarning_dialog",gladefile,False)
51 label=self.newtree.get_object("wwarning_dialog_text")
52 label.set_text(message)
53 window=self.newtree.get_object("wwarning_dialog")
54 window.show()
55 window.run()
56 window.hide()
57 window.destroy()
58 window=None
59
60
61 class ask_exit:
62
63 def __init__(self,gladefile):
64
65 self.newtree=devede_other.create_tree(self,"wcancel_dialog",gladefile,False)
66 self.window=self.newtree.get_object("wcancel_dialog")
67
68 def run(self):
69 self.window.show()
70 retval=self.window.run()
71 self.window.hide()
72 self.window.destroy()
73 self.window=None
74 return retval
75
76
77 class ask_overwrite_onload:
78
79 def __init__(self,gladefile):
80
81 self.newtree=devede_other.create_tree(self,"wloosecurrent",gladefile,False)
82 self.window=self.newtree.get_object("wloosecurrent")
83
84 def run(self):
85 self.window.show()
86 retval=self.window.run()
87 self.window.hide()
88 self.window.destroy()
89 self.window=None
90 return retval
91
92
93 class ask_delete_title:
94
95 def __init__(self,titlename,gladefile):
96
97 self.newtree=devede_other.create_tree(self,"wdel_title_dialog",gladefile,False)
98 self.window=self.newtree.get_object("wdel_title_dialog")
99 label=self.newtree.get_object("what_title")
100 label.set_text(titlename)
101
102 def run(self):
103 self.window.show()
104 retval=self.window.run()
105 self.window.hide()
106 self.window.destroy()
107 self.window=None
108 return retval
109
110
111 class ask_delete_chapter:
112
113 def __init__(self,titlename,gladefile):
114
115 self.newtree=devede_other.create_tree(self,"wdel_chapter_dialog",gladefile,False)
116 self.window=self.newtree.get_object("wdel_chapter_dialog")
117 label=self.newtree.get_object("labelchapter")
118 label.set_text(titlename)
119
120 def run(self):
121 self.window.show()
122 retval=self.window.run()
123 self.window.hide()
124 self.window.destroy()
125 self.window=None
126 return retval
127
128
129 class ask_erase_all:
130
131 def __init__(self,gladefile):
132
133 self.newtree=devede_other.create_tree(self,"werase_dialog",gladefile,False)
134 self.window=self.newtree.get_object("werase_dialog")
135
136 def run(self):
137 self.window.show()
138 retval=self.window.run()
139 self.window.hide()
140 self.window.destroy()
141 self.window=None
142 return retval
143
144
145 class show_about:
146
147 def __init__(self,gladefile):
148
149 """ Shows the About dialog """
150
151 self.newtree=devede_other.create_tree(self,"aboutdialog1",gladefile,False)
152 window=self.newtree.get_object("aboutdialog1")
153 window.show()
154 window.run()
155 window.hide()
156 window.destroy()
157 window=None
Something went wrong with that request. Please try again.