Exemple #1
0
    def __init__(self, aModelEditor, aDuration):

        self.theModelEditor = aModelEditor
        # Sets the return number

        self.___num = CANCEL_PRESSED
        self.__off = False

        self.win = gtk.Dialog('AutosaveWindow', None)
        self.win.connect("destroy", self.destroy)

        # Sets size and position
        self.win.set_border_width(2)
        self.win.set_default_size(300, 75)
        self.win.set_position(gtk.WIN_POS_MOUSE)

        # appends ok button
        ok_button = gtk.Button("  OK  ")
        self.win.action_area.pack_start(
            ok_button,
            False,
            False,
        )
        ok_button.set_flags(gtk.CAN_DEFAULT)
        ok_button.grab_default()
        ok_button.show()
        ok_button.connect("clicked", self.okButtonClicked)

        # appends cancel button
        cancel_button = gtk.Button(" Cancel ")
        self.win.action_area.pack_start(cancel_button, False, False)
        cancel_button.show()
        cancel_button.connect("clicked", self.cancelButtonClicked)

        # Sets title
        self.win.set_title('Preferences')

        self.ViewComponentObject = ViewComponent(self.win.vbox,
                                                 'attachment_box',
                                                 'AutosaveWindow.glade')
        self.ViewComponentObject['duration']

        aPixbuf16 = gtk.gdk.pixbuf_new_from_file(
            os.path.join(config.GLADEFILE_PATH, "modeleditor.png"))
        aPixbuf32 = gtk.gdk.pixbuf_new_from_file(
            os.path.join(config.GLADEFILE_PATH, "modeleditor32.png"))
        self.win.set_icon_list(aPixbuf16, aPixbuf32)

        self.win.show_all()
        self.__setAutosaveDuration(aDuration)
        self.ViewComponentObject.addHandlers({
            "on_duration_toggled":
            self.__buttonChosen,
            "on_operations_toggled":
            self.__buttonChosen,
            "on_turn_off_toggled":
            self.__buttonChosen
        })
        gtk.main()
Exemple #2
0
    def __init__(self, aModelEditor):
        """
        sets up a modal dialogwindow displaying 
        the AboutModelEditor window
             
        """

        self.theModelEditor = aModelEditor

        # Create the Dialog
        self.win = gtk.Dialog('AboutModelEditor', None)
        self.win.connect("destroy", self.destroy)

        # Sets size and position
        self.win.set_border_width(2)
        self.win.set_default_size(300, 75)
        self.win.set_position(gtk.WIN_POS_MOUSE)

        # appends ok button
        ok_button = gtk.Button("  OK  ")
        self.win.action_area.pack_start(
            ok_button,
            False,
            False,
        )
        ok_button.set_flags(gtk.CAN_DEFAULT)
        ok_button.grab_default()
        ok_button.show()
        ok_button.connect("clicked", self.destroy)

        # Sets title
        self.win.set_title('About Model Editor')

        ViewComponent(self.win.vbox, 'attachment_box',
                      'AboutModelEditor.glade')
        aPixbuf16 = gtk.gdk.pixbuf_new_from_file(
            os.path.join(config.GLADEFILE_PATH, "modeleditor.png"))
        aPixbuf32 = gtk.gdk.pixbuf_new_from_file(
            os.path.join(config.GLADEFILE_PATH, "modeleditor32.png"))
        self.win.set_icon_list(aPixbuf16, aPixbuf32)

        self.win.show_all()

        self.theModelEditor.toggleAboutModelEditor(True, self)