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
|
# -*- coding: utf-8 -*-
#Copyright (C) 2008 Federico Mon Trotti, Daniel Tabas, Carlos Agra, Roberto Cano
#This file is part of HDLorean.
#
#HDLorean 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.
#HDLorean 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 HDLorean. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
import pygtk
import gtk
import gtk.glade
import gnome.ui
## @brief Menu closes the app.
#
# Shows a menu with a button to close the main app.
class ToCD:
## The constructor.
# The first is load in self->wTree.
# The dictionaty connects the widget's signals with class functions.
def __init__(self): #constructora clase gui
## @var gladefile
# Variable wich contains the .glade file.
self.gladefile="../../share/glade/HDLoreanToCDMenu.glade"
## @var wTree
# Contains the XML info of the .glade
self.wTree = gtk.glade.XML (self.gladefile)
#diccionario: una tabla hash que se hace solita
#sirve para conectar las seƱales que tira el gtk con las funciones q tratan
dic = { "on_closeCancButton_clicked" : self.Cancel,
"on_closeExitButton_clicked" : self.Exit
}
self.wTree.signal_autoconnect(dic)
self.window=self.wTree.get_widget('Close')
def Cancel(self,widget):
self.window.destroy()
def Exit(self,widget):
self.window.destroy()
|