-
Notifications
You must be signed in to change notification settings - Fork 11
/
devede_disctype.py
executable file
·117 lines (79 loc) · 2.8 KB
/
devede_disctype.py
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
# Copyright 2006-2009 (C) Peter Gill - win32 parts
# This file is part of DeVeDe
#
# DeVeDe 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 3 of the License, or
# (at your option) any later version.
#
# DeVeDe 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/>.
import pygtk # for testing GTK version number
pygtk.require ('2.0')
import gtk
import devede_main
import devede_dialogs
import os
import devede_other
class disctype:
def __init__(self,global_vars):
self.gladefile=global_vars["gladefile"]
self.global_vars=global_vars
self.tree=devede_other.create_tree(self,"wdisk_type",self.gladefile)
self.window=self.tree.get_object("wdisk_type")
self.main_window=None
self.window.show()
def on_wdisk_type_delete_event(self,widget,signal):
""" Callback which shows the "Are you sure?" window """
return self.ask_cancel()
def on_wdisk_type_cancel_clicked(self,widget):
""" Callback which shows the "Are you sure?" window """
return self.ask_cancel()
def ask_cancel(self):
window=devede_dialogs.ask_exit(self.gladefile)
retval=window.run()
window=None
print "Retorno: ",
print retval
if retval==-5:
gtk.main_quit()
return False
return True
def on_disctype_dvd(self,widget):
self.global_vars["disctocreate"]="dvd"
self.global_vars["menu_top_margin"]=0.125
self.global_vars["menu_bottom_margin"]=0.125
self.global_vars["menu_left_margin"]=0.1
self.global_vars["menu_right_margin"]=0.1
self.set_disk_type()
def on_disctype_vcd(self,widget):
self.global_vars["disctocreate"]="vcd"
self.set_disk_type()
def on_disctype_svcd(self,widget):
self.global_vars["disctocreate"]="svcd"
self.set_disk_type()
def on_disctype_cvd(self,widget):
self.global_vars["disctocreate"]="cvd"
self.set_disk_type()
def on_disctype_divx(self,widget):
self.global_vars["disctocreate"]="divx"
self.set_disk_type()
def set_disk_type(self):
if self.main_window==None:
self.main_window=devede_main.main_window(self.global_vars,self.show_again)
self.main_window.set_disc_type(True)
self.main_window.show()
self.window.hide()
def show_again(self):
""" Callback which is called from main window when the user wants to change the
disk type """
self.main_window.hide()
self.window.show()