from PyQt4 import QtGui
from ui_mant_libros_new import NewLibrosWindow
from ui_mant_libros_edit import EditLibrosWindow
from ui_mant_libros_id_edit import GetIdEditWindow

# Debug only
import inspect


class MenuLibros(QtGui.QWidget):
    """
        Ventana-menu para editar Libros
    """
    def __init__(self):
        super(MenuLibros, self).__init__()

        self.createButtons()

        self.setWindowTitle('Mantenimiento Libros')

        self.setWindowIcon(QtGui.QIcon('images/user-plus.png'))
        self.setWindowTitle("Mantenimiento Libros")
        self.setGeometry(650, 300, 150, 100)

    def createButtons(self):
        btn_new_libros = QtGui.QPushButton('Nuevo')
        btn_new_libros.clicked.connect(self.open_new_libros_window)

        btn_edit_libros = QtGui.QPushButton('Editar')
        btn_edit_libros.clicked.connect(self.open_edit_libros_window)

        btn_list_libros = QtGui.QPushButton('Listar')
        btn_list_libros.clicked.connect(self.close)

        btn_delete_libros = QtGui.QPushButton('Eliminar')
        btn_delete_libros.clicked.connect(self.close)


        hbox = QtGui.QHBoxLayout()
        hbox.addWidget(btn_new_libros)
        hbox.addWidget(btn_edit_libros)
        hbox.addWidget(btn_list_libros)
        hbox.addWidget(btn_delete_libros)
        vbox = QtGui.QVBoxLayout()
        vbox.addLayout(hbox)

        self.setLayout(vbox)

    def open_new_libros_window(self):
        self.new_libros_view = NewLibrosWindow()
        self.new_libros_view.show()
        print(inspect.stack()[0][3])

        self.close()

    def open_edit_libros_window(self):
        self.edit_libros_view = GetIdEditWindow()
        self.edit_libros_view.show()
        print(inspect.stack()[0][3])

        self.close()

    def open_list_reserva_window(self):
        # self.new_reserva_view = NewReserva()
        # self.new_reserva_view.show()
        print(inspect.stack()[0][3])

        self.close()

    def open_delete_reserva_window(self):
        # self.new_reserva_view = NewReserva()
        # self.new_reserva_view.show()
        print(inspect.stack()[0][3])

        self.close()

if __name__ == '__main__':

    import sys

    app = QtGui.QApplication(sys.argv)
    mainWin = MenuLibros()
    mainWin.show()
    sys.exit(app.exec_())

[((2188, 2216), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (2206, 2216), False, 'from PyQt4 import QtGui\n'), ((658, 684), 'PyQt4.QtGui.QPushButton', 'QtGui.QPushButton', (['"""Nuevo"""'], {}), "('Nuevo')\n", (675, 684), False, 'from PyQt4 import QtGui\n'), ((780, 807), 'PyQt4.QtGui.QPushButton', 'QtGui.QPushButton', (['"""Editar"""'], {}), "('Editar')\n", (797, 807), False, 'from PyQt4 import QtGui\n'), ((905, 932), 'PyQt4.QtGui.QPushButton', 'QtGui.QPushButton', (['"""Listar"""'], {}), "('Listar')\n", (922, 932), False, 'from PyQt4 import QtGui\n'), ((1014, 1043), 'PyQt4.QtGui.QPushButton', 'QtGui.QPushButton', (['"""Eliminar"""'], {}), "('Eliminar')\n", (1031, 1043), False, 'from PyQt4 import QtGui\n'), ((1115, 1134), 'PyQt4.QtGui.QHBoxLayout', 'QtGui.QHBoxLayout', ([], {}), '()\n', (1132, 1134), False, 'from PyQt4 import QtGui\n'), ((1311, 1330), 'PyQt4.QtGui.QVBoxLayout', 'QtGui.QVBoxLayout', ([], {}), '()\n', (1328, 1330), False, 'from PyQt4 import QtGui\n'), ((1460, 1477), 'ui_mant_libros_new.NewLibrosWindow', 'NewLibrosWindow', ([], {}), '()\n', (1475, 1477), False, 'from ui_mant_libros_new import NewLibrosWindow\n'), ((1645, 1662), 'ui_mant_libros_id_edit.GetIdEditWindow', 'GetIdEditWindow', ([], {}), '()\n', (1660, 1662), False, 'from ui_mant_libros_id_edit import GetIdEditWindow\n'), ((469, 504), 'PyQt4.QtGui.QIcon', 'QtGui.QIcon', (['"""images/user-plus.png"""'], {}), "('images/user-plus.png')\n", (480, 504), False, 'from PyQt4 import QtGui\n'), ((1528, 1543), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1541, 1543), False, 'import inspect\n'), ((1714, 1729), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1727, 1729), False, 'import inspect\n'), ((1900, 1915), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1913, 1915), False, 'import inspect\n'), ((2088, 2103), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (2101, 2103), False, 'import inspect\n')]