Ejemplo n.º 1
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader() 
        uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        #group = QGroupBox()
        #box = QVBoxLayout(group)
        #button = QPushButton(group)
        #box.addWidget(button)
        #group.show()
        #self.canvas.AddWidget(group)

        lineedit = QLineEdit()
        self.widget = lineedit
        #lineedit.show()
        #uiprops = UiWidgetProperties("PythonQt Test")
        #uism.AddWidgetToScene(lineedit) #uiprops) #self.canvas.AddWidget(lineedit)

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty()
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        lineedit.connect('textChanged(QString)', self.changed)

        r.logInfo("TestGui inited.")
Ejemplo n.º 2
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader() 
        uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        #group = QGroupBox()
        #box = QVBoxLayout(group)
        #button = QPushButton(group)
        #box.addWidget(button)
        #group.show()
        #self.canvas.AddWidget(group)

        lineedit = QLineEdit()
        self.widget = lineedit
        #lineedit.show()
        #uiprops = UiWidgetProperties("PythonQt Test")
        #uism.AddWidgetToScene(lineedit) #uiprops) #self.canvas.AddWidget(lineedit)

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty()
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        lineedit.connect('textChanged(QString)', self.changed)

        r.logInfo("TestGui inited.")
Ejemplo n.º 3
0
    def __init__(self, uistring, queue, endApplication, controller):
        self.controller = controller
        loader = QUiLoader()
        uifile = QFile(uistring)
        ui = loader.load(uifile)
        self.gui = ui
        width = ui.size.width()
        height = ui.size.height()
        
        uism = r.getUiSceneManager()
        
        # uiprops = r.createUiWidgetProperty(1) #1 is ModuleWidget, shown at toolbar
        # uiprops.SetMenuGroup(2) #2 is server tools group
        # uiprops.widget_name_ = "Local Scene"
        
        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        #self.proxywidget = r.createUiProxyWidget(ui, uiprops)
        
        self.proxywidget = r.createUiProxyWidget(ui)

        #if not uism.AddProxyWidget(self.proxywidget):
        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding the ProxyWidget to the bar failed.")

        uism.AddWidgetToMenu(self.proxywidget, "Local Scene", "Server Tools", "./data/ui/images/menus/edbutton_LSCENE_normal.png")
            
        self.inputQueue = queue
        self.endApplication = endApplication
        
        self.tableitems = []
        
        pass
Ejemplo n.º 4
0
 def on_exit(self):
     if self.webview != None:
         self.webview.stop()
     if self.proxywidget is not None:
         self.proxywidget.hide()
         uism = r.getUiSceneManager()
         uism.RemoveWidgetFromScene(self.proxywidget)
Ejemplo n.º 5
0
    def __init__(self, uistring, queue, endApplication, controller):
        self.controller = controller
        loader = QUiLoader()
        uifile = QFile(uistring)
        ui = loader.load(uifile)
        self.gui = ui
        width = ui.size.width()
        height = ui.size.height()

        uism = r.getUiSceneManager()

        # uiprops = r.createUiWidgetProperty(1) #1 is ModuleWidget, shown at toolbar
        # uiprops.SetMenuGroup(2) #2 is server tools group
        # uiprops.widget_name_ = "Local Scene"

        # uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        # self.proxywidget = r.createUiProxyWidget(ui, uiprops)

        self.proxywidget = r.createUiProxyWidget(ui)

        # if not uism.AddProxyWidget(self.proxywidget):
        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding the ProxyWidget to the bar failed.")

        uism.AddWidgetToMenu(
            self.proxywidget, "Local Scene", "Server Tools", "./data/ui/images/menus/edbutton_LSCENE_normal.png"
        )

        self.inputQueue = queue
        self.endApplication = endApplication

        self.tableitems = []

        pass
Ejemplo n.º 6
0
    def on_exit(self):
        r.logInfo("TestGui starting exit...")
        
        #qtmod = r.getQtModule()
        #qtmod.DeleteCanvas(self.canvas)

        uism = r.getUiSceneManager()
        uism.RemoveProxyWidgetFromScene(self.proxywidget)
        r.logInfo("TestGui proxywidget removed from scene.")
Ejemplo n.º 7
0
    def on_exit(self):
        r.logInfo("TestGui starting exit...")
        
        #qtmod = r.getQtModule()
        #qtmod.DeleteCanvas(self.canvas)

        uism = r.getUiSceneManager()
        uism.RemoveProxyWidgetFromScene(self.proxywidget)
        r.logInfo("TestGui proxywidget removed from scene.")
Ejemplo n.º 8
0
    def __init__(self):
        self.sels = []
        Component.__init__(self)
        self.window = window.ObjectEditWindow(self)
        self.resetValues()
        self.worldstream = r.getServerConnection()

        self.mouse_events = {
            #r.LeftMouseClickPressed: self.LeftMousePressed,
            r.InWorldClick: self.LeftMousePressed,
            r.LeftMouseClickReleased: self.LeftMouseReleased,
            r.RightMouseClickPressed: self.RightMousePressed,
            r.RightMouseClickReleased: self.RightMouseReleased
        }

        self.shortcuts = {
            #r.PyObjectEditDeselect: self.deselect,
            r.PyObjectEditToggleMove:
            self.window.manipulator_move,  #"ALT+M", #move
            r.PyObjectEditToggleScale:
            self.window.manipulator_scale,  #"ALT+S" #, #scale
            r.Delete:
            self.deleteObject,
            r.Undo:
            self.undo,
            r.PyDuplicateDrag:
            self.duplicateStart,
            r.ObjectLink:
            self.linkObjects,
            r.ObjectUnlink:
            self.unlinkObjects,
        }

        self.resetManipulators()

        loader = QUiLoader()
        selectionfile = QFile(self.SELECTIONRECT)
        self.selection_rect = loader.load(selectionfile)
        rectprops = r.createUiWidgetProperty(2)
        #~ print type(rectprops), dir(rectprops)
        #print rectprops.WidgetType
        #uiprops.widget_name_ = "Selection Rect"

        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        proxy = r.createUiProxyWidget(self.selection_rect, rectprops)
        uism = r.getUiSceneManager()
        uism.AddProxyWidget(proxy)
        proxy.setWindowFlags(0)  #changing it to Qt::Widget

        self.selection_rect.setGeometry(0, 0, 0, 0)
        self.selection_rect_startpos = None

        r.c = self  #this is for using objectedit from command.py
Ejemplo n.º 9
0
    def initgui(self):
        self.widget = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.widget.connect('valueChanged(int)', self.sliderChanged)

        #naali proxywidget boilerplate
        uism = r.getUiSceneManager()
        self.proxywidget = r.createUiProxyWidget(self.widget)
        self.proxywidget.setWindowTitle(self.GUINAME)
        if not uism.AddWidgetToScene(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."
        #uism.AddWidgetToMenu(self.proxywidget, self.GUINAME, "Developer Tools")

        #to not flood the network
        self.prev_sync = 0
Ejemplo n.º 10
0
    def initgui(self):
        self.widget = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.widget.connect('valueChanged(int)', self.sliderChanged)

        #naali proxywidget boilerplate
        uism = r.getUiSceneManager()
        self.proxywidget = r.createUiProxyWidget(self.widget)
        self.proxywidget.setWindowTitle(self.GUINAME)
        if not uism.AddWidgetToScene(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."
        #uism.AddWidgetToMenu(self.proxywidget, self.GUINAME, "Developer Tools")

        #to not flood the network
        self.prev_sync = 0
Ejemplo n.º 11
0
 def on_exit(self):
     try:
         # end incoming loop
         self.controller.isrunning = 0
         
         self.proxywidget.hide()
         uism = r.getUiSceneManager()
         uism.RemoveWidgetFromMenu(self.proxywidget)
         uism.RemoveWidgetFromScene(self.proxywidget)
         return True
     except:
         r.logInfo("Estate Window failure:")
         traceback.print_exc()
         return False
Ejemplo n.º 12
0
    def on_exit(self):
        try:
            # end incoming loop
            self.controller.isrunning = 0

            self.proxywidget.hide()
            uism = r.getUiSceneManager()
            uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("Estate Window failure:")
            traceback.print_exc()
            return False
Ejemplo n.º 13
0
    def on_exit(self):
        try:
            # end incoming loop
            self.endmethod()
            self.queue.put('__end__', 'none')

            self.proxywidget.hide()
            uism = r.getUiSceneManager()
            uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("LocalSceneWindow failure:")
            traceback.print_exc()
            return False
Ejemplo n.º 14
0
 def on_exit(self):
     try:
         # end incoming loop
         self.endmethod()
         self.queue.put('__end__', 'none')
         
         self.proxywidget.hide()
         uism = r.getUiSceneManager()
         uism.RemoveWidgetFromMenu(self.proxywidget)
         uism.RemoveWidgetFromScene(self.proxywidget)
         return True
     except:
         r.logInfo("LocalSceneWindow failure:")
         traceback.print_exc()
         return False
Ejemplo n.º 15
0
    def __init__(self):
        self.sels = []  
        Component.__init__(self)
        self.window = window.ObjectEditWindow(self)
        self.resetValues()
        self.worldstream = r.getServerConnection()
        
        self.mouse_events = {
            #r.LeftMouseClickPressed: self.LeftMousePressed,
            r.InWorldClick: self.LeftMousePressed,
            r.LeftMouseClickReleased: self.LeftMouseReleased,  
            r.RightMouseClickPressed: self.RightMousePressed,
            r.RightMouseClickReleased: self.RightMouseReleased
        }

        self.shortcuts = {
            #r.PyObjectEditDeselect: self.deselect,
            r.PyObjectEditToggleMove: self.window.manipulator_move,#"ALT+M", #move
            r.PyObjectEditToggleScale: self.window.manipulator_scale,#"ALT+S" #, #scale
            r.Delete: self.deleteObject,
            r.Undo: self.undo, 
            r.PyDuplicateDrag: self.duplicateStart, 
            r.ObjectLink: self.linkObjects,
            r.ObjectUnlink: self.unlinkObjects,
        }
        
        self.resetManipulators()
        
        loader = QUiLoader()
        selectionfile = QFile(self.SELECTIONRECT)
        self.selection_rect = loader.load(selectionfile)
        rectprops = r.createUiWidgetProperty(2)
        #~ print type(rectprops), dir(rectprops)
        #print rectprops.WidgetType
        #uiprops.widget_name_ = "Selection Rect"
        
        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        proxy = r.createUiProxyWidget(self.selection_rect, rectprops)
        uism = r.getUiSceneManager()
        uism.AddProxyWidget(proxy)
        proxy.setWindowFlags(0) #changing it to Qt::Widget
        
        self.selection_rect.setGeometry(0,0,0,0)
        self.selection_rect_startpos = None
        
        r.c = self #this is for using objectedit from command.py
Ejemplo n.º 16
0
    def __init__(self):
        Component.__init__(self)

        loader = QUiLoader()
        uism = r.getUiSceneManager()

        uifile = QFile(UIFILELOC)
        self.widget = loader.load(uifile)
        uism.SetDemoLoginWidget(self.widget)

        def make_worldlogin(w):
            def worldlogin():
                self.login(w)
            return worldlogin

        for w in self.WORLDS:
            but = getattr(self.widget, w.butname)
            but.connect('clicked()', make_worldlogin(w))       
Ejemplo n.º 17
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader()
        #uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        group = QGroupBox()
        box = QVBoxLayout(group)

        button1 = QPushButton("Button 1", group)
        box.addWidget(button1)

        button2 = QPushButton("Button 2", group)
        box.addWidget(button2)

        slider = QtGui.QSlider(PythonQt.QtCore.Qt.Horizontal)
        box.addWidget(slider)
        slider.connect('valueChanged(int)', self.changed)

        #group.show()

        lineedit = QtGui.QLineEdit()
        box.addWidget(lineedit)
        lineedit.connect('textChanged(QString)', self.changed)

        self.widget = group

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty(1)
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        r.logInfo("TestGui inited.")
Ejemplo n.º 18
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader()
        #uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        group = QGroupBox()
        box = QVBoxLayout(group)

        button1 = QPushButton("Button 1", group)
        box.addWidget(button1)

        button2 = QPushButton("Button 2", group)
        box.addWidget(button2)

        slider = QtGui.QSlider(PythonQt.QtCore.Qt.Horizontal)
        box.addWidget(slider)
        slider.connect('valueChanged(int)', self.changed)

        #group.show()

        lineedit = QtGui.QLineEdit()
        box.addWidget(lineedit)
        lineedit.connect('textChanged(QString)', self.changed)

        self.widget = group

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty(1)
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        r.logInfo("TestGui inited.")
Ejemplo n.º 19
0
Archivo: door.py Proyecto: Chiru/naali
    def initgui(self):
        #qt widget ui
        group = QGroupBox()
        box = QVBoxLayout(group)

        self.openbut = QPushButton("init", group)
        self.lockbut = QPushButton("init", group)
        box.addWidget(self.openbut)
        box.addWidget(self.lockbut)

        self.openbut.connect('clicked()', self.open)
        self.lockbut.connect('clicked()', self.lock)

        self.widget = group
        self.forcepos = None

        #naali proxywidget boilerplate
        uism = r.getUiSceneManager()
        self.proxywidget = r.createUiProxyWidget(self.widget)
        self.proxywidget.setWindowTitle(self.GUINAME)
        if not uism.AddWidgetToScene(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."
        uism.AddWidgetToMenu(self.proxywidget, self.GUINAME, "Developer Tools")
Ejemplo n.º 20
0
    def initgui(self):
        #qt widget ui
        group = QGroupBox()
        box = QVBoxLayout(group)

        self.openbut = QPushButton("init", group)
        self.lockbut = QPushButton("init", group)
        box.addWidget(self.openbut)
        box.addWidget(self.lockbut)

        self.openbut.connect('clicked()', self.open)
        self.lockbut.connect('clicked()', self.lock)

        self.widget = group
        self.forcepos = None

        #naali proxywidget boilerplate
        uism = r.getUiSceneManager()
        self.proxywidget = r.createUiProxyWidget(self.widget)
        self.proxywidget.setWindowTitle(self.GUINAME)
        if not uism.AddWidgetToScene(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."
        uism.AddWidgetToMenu(self.proxywidget, self.GUINAME, "Developer Tools")
Ejemplo n.º 21
0
    PRIMTYPES = {"0": "Texture", "45": "Material"}

    def swoot():
        print "booyah!"

    def noswoot():
        print "!booyah!"

    from PythonQt.QtUiTools import QUiLoader
    from PythonQt.QtCore import QFile, QSize
    from PythonQt.QtGui import QLineEdit, QHBoxLayout, QComboBox, QLabel

    loader = QUiLoader()
    uifile = QFile("pymodules/editgui/materials.ui")
    ui = loader.load(uifile)
    uism = r.getUiSceneManager()
    uiprops = r.createUiWidgetProperty()
    uiprops.show_at_toolbar_ = False
    uiprops.widget_name_ = "Test"
    uiprops.my_size_ = QSize(ui.size.width(), ui.size.height())
    pw = r.createUiProxyWidget(ui, uiprops)
    uism.AddProxyWidget(pw)
    r.formwidget = ui.gridLayoutWidget
    r.pw = pw
    r.pw.show()

    #print dir(r.formwidget), r.formwidget.rowCount()

    #~ qprim = r.getQPrim(2985471908)
    #~ mats = qprim.Materials
    #~ print mats#, r.formwidget.formLayout.children()
Ejemplo n.º 22
0
 def on_exit(self):
     self.proxywidget.hide()
     uism = r.getUiSceneManager()
     uism.RemoveProxyWidgetFromScene(self.proxywidget)
     uism.RemoveProxyWidgetFromScene(self.propeditwidget)
Ejemplo n.º 23
0
 def removegui(self, evid):
     self.proxywidget.hide()
     uism = r.getUiSceneManager()
     uism.RemoveWidgetFromMenu(self.proxywidget)
     uism.RemoveWidgetFromScene(self.proxywidget)
Ejemplo n.º 24
0
    def init_ui(self):
        loader = QUiLoader()
        
        # Container widget
        self.container = ui = loader.load(QFile("pymodules/loadurlhandler/webbrowser.ui"))
        
        # Webview
        self.webview = QWebView(self.container)
        self.webview.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        
        self.webview.connect("loadStarted()", self.on_load_start)
        self.webview.connect("loadFinished(bool)", self.on_load_stop)
        self.webview.connect("loadProgress(int)", self.on_load_progress)
        self.webview.connect("linkClicked(QUrl)", self.link_clicked)
        
        layout = ui.findChild("QVBoxLayout", "verticalLayout_Container")
        layout.insertWidget(2, self.webview)
        
        # Buttons
        ui.findChild("QPushButton", "pushButton_ClearCookie").hide()
        self.button_back = ui.findChild("QPushButton", "pushButton_Back")
        self.button_forward = ui.findChild("QPushButton", "pushButton_Forward")
        self.button_refresh = ui.findChild("QPushButton", "pushButton_Refresh")
        self.button_stop = ui.findChild("QPushButton", "pushButton_Stop")
        self.button_go = ui.findChild("QPushButton", "pushButton_Go")        

        self.button_back.setIcon(QIcon("./data/ui/images/arrow_left_48.png"));
        self.button_back.setIconSize(QSize(20, 20));
        self.button_forward.setIcon(QIcon("./data/ui/images/arrow_right_48.png"));
        self.button_forward.setIconSize(QSize(20, 20));
        self.button_refresh.setIcon(QIcon("./data/ui/images/refresh_48.png"));
        self.button_refresh.setIconSize(QSize(20, 20));
        self.button_stop.setIcon(QIcon("./data/ui/images/cross_48.png"));
        self.button_stop.setIconSize(QSize(20, 20));
        self.button_stop.setEnabled(False);
        self.button_go.setIcon(QIcon("./data/ui/images/arrow_right_green_48.png"));
        self.button_go.setIconSize(QSize(20, 20));

        self.button_back.connect("clicked()", self.on_back)
        self.button_forward.connect("clicked()", self.on_forward)
        self.button_refresh.connect("clicked()", self.on_refresh)
        self.button_stop.connect("clicked()", self.on_stop)
        self.button_go.connect("clicked()", self.go_to_linedit_url)
        
        # Address bar
        self.lineedit_address = ui.findChild("QComboBox", "comboBox_Address")
        self.lineedit_address.lineEdit().connect("returnPressed()", self.go_to_linedit_url)
        
        # Progress bar and label
        self.progress_bar = ui.findChild("QProgressBar", "progressBar_Status")
        self.progress_bar.hide()
        
        self.progress_label = ui.findChild("QLabel", "label_Status")
        
        # Add to scene
        uism = r.getUiSceneManager()
        self.proxywidget = r.createUiProxyWidget(self.container)
        self.proxywidget.setWindowTitle("Naali Web Browser")
        self.proxywidget.connect("Visible(bool)", self.vibibility_changed)
        if not uism.AddWidgetToScene(self.proxywidget):
            r.logError('LoadURLHandler: Adding the ProxyWidget to the scene failed.')
Ejemplo n.º 25
0
    def __init__(self, controller):
        self.controller = controller
        loader = QUiLoader()
        uifile = QFile(self.UIFILE)

        ui = loader.load(uifile)
        width = ui.size.width()
        height = ui.size.height()
        
        #if not DEV:
        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty(1) #1 is ModuleWidget, shown at toolbar
        uiprops.widget_name_ = "Object Edit"
        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        self.proxywidget = r.createUiProxyWidget(ui, uiprops)

        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."
        
        self.widget = ui
        self.tabwidget = ui.findChild("QTabWidget", "MainTabWidget")

        self.mainTab = ui.findChild("QWidget", "MainFrame")
        self.materialTab = ui.findChild("QWidget", "MaterialsTab")
        self.tabwidget.setTabEnabled(1, False)
        self.materialTabFormWidget = self.materialTab.formLayoutWidget
        self.mainTab.label.text = "<none>"

        self.meshline = lines.MeshAssetidEditline(controller) 
        self.meshline.name = "meshLineEdit"

        button_ok = self.getButton("Apply", self.ICON_OK, self.meshline, self.meshline.applyAction)
        button_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.meshline, self.meshline.cancelAction)
        
        box = self.mainTab.findChild("QHBoxLayout", "meshLine")
        box.addWidget(self.meshline)
        box.addWidget(button_ok)
        box.addWidget(button_cancel)
        
        self.propedit = r.getPropertyEditor()
        self.tabwidget.addTab(self.propedit, "Properties")
        self.tabwidget.setTabEnabled(2, False)
        
        def poschanger(i):
            def pos_at_index(v):
                self.controller.changepos(i, v)
            return pos_at_index
        for i, poswidget in enumerate([self.mainTab.xpos, self.mainTab.ypos, self.mainTab.zpos]):
            poswidget.connect('valueChanged(double)', poschanger(i))

        def rotchanger(i):
            def rot_at_index(v):
                self.controller.changerot(i, v)
            return rot_at_index
        for i, rotwidget in enumerate([self.mainTab.rot_x, self.mainTab.rot_y, self.mainTab.rot_z]):
            rotwidget.connect('valueChanged(double)', rotchanger(i))
        
        def scalechanger(i):
            def scale_at_index(v):
                self.controller.changescale(i, v)
            return scale_at_index
        for i, scalewidget in enumerate([self.mainTab.scalex, self.mainTab.scaley, self.mainTab.scalez]):
            scalewidget.connect('valueChanged(double)', scalechanger(i))
        
        self.mainTab.treeWidget.connect('clicked(QModelIndex)', self.itemActivated)
        self.mainTab.treeWidget.connect('activated(QModelIndex)', self.itemActivated)
        
        self.proxywidget.connect('Visible(bool)', self.controller.on_hide)
        #self.tabwidget.connect('currentChanged(int)', self.tabChanged)

        self.meshline.connect('textEdited(QString)', button_ok.lineValueChanged)
        self.meshline.connect('textEdited(QString)', button_cancel.lineValueChanged)
        
        self.mainTab.findChild("QPushButton", "newObject").connect('clicked()', self.controller.createObject)
        self.mainTab.findChild("QPushButton", "deleteObject").connect('clicked()', self.controller.deleteObject)
        self.mainTab.findChild("QPushButton", "duplicate").connect('clicked()', self.controller.duplicate)
        
        self.mainTab.findChild("QPushButton", "undo").connect('clicked()', self.controller.undo)
        
        self.mainTab.findChild("QToolButton", "move_button").connect('clicked()', self.manipulator_move)
        self.mainTab.findChild("QToolButton", "scale_button").connect('clicked()', self.manipulator_scale)
        self.mainTab.findChild("QToolButton", "rotate_button").connect('clicked()', self.manipulator_rotate)

        self.mainTabList = {}
        
        self.currentlySelectedTreeWidgetItem = []
Ejemplo n.º 26
0
    def __init__(self, controller, queue):
        loader = QUiLoader()
        loader.setLanguageChangeEnabled(True)
        #uifile = QFile("pymodules/estatemanagement/estatemanagement.ui")
        uifile = QFile(EstateManagementWindow.UIFILE)
        self.gui = loader.load(uifile)
        self.controller = controller
        IncomingMessagesHandler.__init__(self, queue, self.endMethod)

        uism = r.getUiSceneManager()
        #        uiprops = r.createUiWidgetProperty(1) # 1 = Qt::Dialog
        #        uiprops.SetMenuGroup("Server Tools")
        #        uiprops.name_ = "Estate Management"

        self.proxywidget = r.createUiProxyWidget(self.gui)
        self.proxywidget.setWindowTitle("Estate Management")

        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding ProxyWidget failed.")

        uism.AddWidgetToMenu(
            self.proxywidget, "Estate Management", "Server Tools",
            "./data/ui/images/menus/edbutton_ESMNG_normal.png")

        self.btnLoadEstate = self.gui.findChild("QPushButton", "btnLoadEstate")
        self.listWEI = self.gui.findChild("QListWidget",
                                          "listWidgetEstateInfo")
        self.listWRU = self.gui.findChild("QListWidget",
                                          "listWidgetRegionUsers")
        self.listWEB = self.gui.findChild("QListWidget", "listWidgetBanList")
        self.listWAL = self.gui.findChild("QListWidget",
                                          "listWidgetAccessList")
        self.listWEM = self.gui.findChild("QListWidget",
                                          "listWidgetEstateManagers")
        self.listWSU = self.gui.findChild("QListWidget",
                                          "listWidgetSavedUsers")

        self.labelEstateInfo = self.gui.findChild("QLabel", "labelEstateInfo")
        self.tableEstates = self.gui.findChild("QListWidget",
                                               "tableWidgetEstates")
        self.chkEstateAccess = self.gui.findChild("QCheckBox",
                                                  "checkBoxEstateAccess")

        self.lineCurrentEstate = self.gui.findChild("QLineEdit",
                                                    "lineEditCurrentEstate")
        self.listWidgetEstates = self.gui.findChild("QListWidget",
                                                    "listWidgetEstates")
        self.btnSetEstate = self.gui.findChild("QPushButton",
                                               "pushButtonSetEstate")

        self.chkSunFixed = self.gui.findChild("QCheckBox", "checkBoxSunFixed")
        # PublicAllowed
        # ExternallyVisible);
        self.chkAllowVoice = self.gui.findChild("QCheckBox",
                                                "checkBoxAllowVoice")
        self.chkAllowDirectTeleport = self.gui.findChild(
            "QCheckBox", "checkBoxAllowDirectTeleport")
        self.chkDenyAnonymous = self.gui.findChild("QCheckBox",
                                                   "checkBoxDenyAnonymous")
        self.chkDenyIdentified = self.gui.findChild("QCheckBox",
                                                    "checkBoxDenyIdentified")
        self.chkDenyTransacted = self.gui.findChild("QCheckBox",
                                                    "checkBoxDenyTransacted")
        self.chkAbuseEmailToEstateOwner = self.gui.findChild(
            "QCheckBox", "checkBoxAbuseEmailToEstateOwner")
        self.chkBlockDwell = self.gui.findChild("QCheckBox",
                                                "checkBoxBlockDwell")
        self.chkEstateSkipScripts = self.gui.findChild(
            "QCheckBox", "checkBoxEstateSkipScripts")
        self.chkResetHomeOnTeleport = self.gui.findChild(
            "QCheckBox", "checkBoxResetHomeOnTeleport")
        self.chkTaxFree = self.gui.findChild("QCheckBox", "checkBoxTaxFree")
        self.chkDenyAgeUnverified = self.gui.findChild(
            "QCheckBox", "checkBoxDenyAgeUnverified")

        self.btnLoadEstate.connect("clicked(bool)", self.btnLoadEstateClicked)

        self.btnToBan = self.gui.findChild("QPushButton", "pushButtonToBan")
        self.btnToAccess = self.gui.findChild("QPushButton",
                                              "pushButtonToAccess")
        self.btnToManagers = self.gui.findChild("QPushButton",
                                                "pushButtonToManagers")
        self.btnSaveUserInfo = self.gui.findChild("QPushButton",
                                                  "pushButtonSaveUserInfo")

        self.btnRemoveBan = self.gui.findChild("QPushButton",
                                               "pushButtonRemoveBan")
        self.btnRemoveAccess = self.gui.findChild("QPushButton",
                                                  "pushButtonRemoveAccess")
        self.btnRemoveManagers = self.gui.findChild("QPushButton",
                                                    "pushButtonRemoveManager")
        self.btnRemoveSaved = self.gui.findChild("QPushButton",
                                                 "pushButtonRemoveSaved")

        self.btnSavedToAccess = self.gui.findChild("QPushButton",
                                                   "pushButtonSavedToAccess")
        self.btnSavedToBan = self.gui.findChild("QPushButton",
                                                "pushButtonSavedToBan")
        self.btnSavedToManagers = self.gui.findChild(
            "QPushButton", "pushButtonSavedToManagers")

        self.btnKick = self.gui.findChild("QPushButton", "pushButtonKick")
        self.btnRequestGodLikePowers = self.gui.findChild(
            "QPushButton", "pushButtonRequestGodLikePowers")
        self.lineKickMessage = self.gui.findChild("QLineEdit",
                                                  "lineEditKickMessage")

        self.btnToBan.connect("clicked(bool)", self.btnToBanClicked)
        self.btnToAccess.connect("clicked(bool)", self.btnToAccessClicked)
        self.btnToManagers.connect("clicked(bool)", self.btnToManagersClicked)
        self.btnSaveUserInfo.connect("clicked(bool)",
                                     self.btnSaveUserInfoClicked)

        self.btnRemoveBan.connect("clicked(bool)", self.btnRemoveBanClicked)
        self.btnRemoveAccess.connect("clicked(bool)",
                                     self.btnRemoveAccessClicked)
        self.btnRemoveManagers.connect("clicked(bool)",
                                       self.btnRemoveManagersClicked)

        self.btnRemoveSaved.connect("clicked(bool)",
                                    self.btnRemoveSavedClicked)

        self.btnSavedToAccess.connect("clicked(bool)",
                                      self.btnSavedToAccessClicked)
        self.btnSavedToBan.connect("clicked(bool)", self.btnSavedToBanClicked)
        self.btnSavedToManagers.connect("clicked(bool)",
                                        self.btnSavedToManagersClicked)

        self.btnRequestGodLikePowers.connect(
            "clicked(bool)", self.btnRequestGodLikePowersClicked)
        self.btnKick.connect("clicked(bool)", self.btnKickClicked)
        self.btnSetEstate.connect("clicked(bool)", self.btnSetEstateClicked)

        self.chkEstateAccess.connect("toggled(bool)",
                                     self.chkEstateAccessToggled)

        # add incoming event handlers
        self.addHandler('EstateUpdate', self.setEstateInfo)
        self.addHandler('setEstateManagers', self.setEstateManagers)
        self.addHandler('setEstateBans', self.setEstateBans)
        self.addHandler('setEsteteAccessList', self.setEsteteAccessList)
        self.addHandler('noCapability', self.noCapabilityInfoMessage)
        self.addHandler('estateSetting', self.handleEstateAccessSetting)
        self.addHandler('failedEstateSetting', self.handleEstateAccessFailure)
        self.addHandler('unknownResponse', self.handleEstateAccessFailure)
        self.addHandler('malformedResp', self.handleEstateAccessFailure)
        self.addHandler('currentEstateIdAndName',
                        self.handleCurrentEstateIdAndName)
        self.addHandler('estates', self.handleEstates)
        self.addHandler('displayerror', self.handleDisplayError)
Ejemplo n.º 27
0
    }
    
    def swoot():
        print "booyah!"
    
    def noswoot():
        print "!booyah!"
        
    from PythonQt.QtUiTools import QUiLoader
    from PythonQt.QtCore import QFile, QSize
    from PythonQt.QtGui import QLineEdit, QHBoxLayout, QComboBox, QLabel
    
    loader = QUiLoader()
    uifile = QFile("pymodules/editgui/materials.ui")
    ui = loader.load(uifile)
    uism = r.getUiSceneManager()
    uiprops = r.createUiWidgetProperty()
    uiprops.show_at_toolbar_ = False
    uiprops.widget_name_ = "Test"
    uiprops.my_size_ = QSize(ui.size.width(), ui.size.height())
    pw = r.createUiProxyWidget(ui, uiprops)
    uism.AddProxyWidget(pw)
    r.formwidget = ui.gridLayoutWidget
    r.pw = pw
    r.pw.show()
    
    #print dir(r.formwidget), r.formwidget.rowCount()

    #~ qprim = r.getQPrim(2985471908)
    #~ mats = qprim.Materials
    #~ print mats#, r.formwidget.formLayout.children() 
Ejemplo n.º 28
0
    def __init__(self, controller):
        self.controller = controller
        loader = QUiLoader()
        loader.setLanguageChangeEnabled(True)
        uifile = QFile(self.UIFILE)

        ui = loader.load(uifile)
        width = ui.size.width()
        height = ui.size.height()
        
        uism = r.getUiSceneManager()

        self.widget = ui

        # Material/Texture widgets
        self.materialTabFormWidget = ui.findChild("QWidget", "MaterialsTab").formLayoutWidget

        # Mesh line edit and buttons
        self.meshline = lines.MeshAssetidEditline(controller) 
        self.meshline.name = "meshLineEdit"

        button_ok = self.getButton("Apply", self.ICON_OK, self.meshline, self.meshline.applyAction)
        button_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.meshline, self.meshline.cancelAction)
        button_browse = self.getButton("Browse", self.ICON_FOLDER, None, None)
        
        box = QHBoxLayout()
        box.setContentsMargins(0,0,0,0)
        box.addWidget(self.meshline)
        box.addWidget(button_browse)
        box.addWidget(button_ok)
        box.addWidget(button_cancel)
        self.mesh_widget = QWidget()
        self.mesh_widget.setLayout(box)
        
        # Sound line edit and buttons
        self.soundline = lines.SoundAssetidEditline(controller) 
        self.soundline.name = "soundLineEdit"
        soundbutton_ok = self.getButton("Apply", self.ICON_OK, self.soundline, self.soundline.applyAction)
        soundbutton_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.soundline, self.soundline.cancelAction)
        soundbutton_browse = self.getButton("Browse", self.ICON_FOLDER, None, None)
        soundRadius = self.getDoubleSpinBox("soundRadius", "Set sound radius", self.soundline)
        soundVolume = self.getDoubleSpinBox("soundVolume", "Set sound volume", self.soundline)
        
        main_box = QVBoxLayout()
        main_box.setContentsMargins(0,0,0,0)
        box_buttons = QHBoxLayout()
        box_buttons.setContentsMargins(0,0,0,0)
        
        # TODO no need for self?
        # crashed always if didnt put self to second label :P you can try to remove them...
        # basically the qwidget ptr must stay somewhere in py otherwise will crash when gets to painting -Pforce
        self.label_radius = QLabel("Radius")
        self.label_radius.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
        self.label_volume = QLabel("Volume")
        self.label_volume.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)

        box_buttons.addWidget(self.label_radius)
        box_buttons.addWidget(soundRadius)
        box_buttons.addWidget(self.label_volume)
        box_buttons.addWidget(soundVolume)
        box_buttons.addWidget(soundbutton_browse)        
        box_buttons.addWidget(soundbutton_ok)
        box_buttons.addWidget(soundbutton_cancel)

        main_box.addWidget(self.soundline)
        main_box.addLayout(box_buttons)
        self.sound_widget = QWidget()
        self.sound_widget.setLayout(main_box)

        # Animation line edit and buttons
        self.animation_title = QLabel("Skeleton Animation")
        self.animation_title.setStyleSheet("font-size:18px;font-weight:bold;padding-top:5px;")
        self.animation_title.setIndent(0)
        self.animationline = lines.AnimationAssetidEditline(controller)
        self.animationline.name = "animationLineEdit"
        animation_combobox = self.getCombobox("AnimationName", "Animation Name", self.animationline)
        animationbutton_ok = self.getButton("Apply", self.ICON_OK, self.animationline, self.animationline.applyAction)
        animationbutton_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.animationline, self.animationline.cancelAction)
        animationbutton_browse = self.getButton("Browse", self.ICON_FOLDER, None, None)
        animationRate = self.getDoubleSpinBox("animationRate", "Set animation rate", self.animationline)

        animationbox = QVBoxLayout()
        animationbox.setContentsMargins(0,0,0,0)
        self.anim_box_buttons = QHBoxLayout()
        self.anim_box_buttons.name = "AnimBoxButtons"
        self.anim_box_buttons.setContentsMargins(0,0,0,0)

        label_rate = QLabel("Rate")
        label_rate.name = "Animation Rate"
        label_rate.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)

        self.anim_box_buttons.addWidget(animation_combobox)
        self.anim_box_buttons.addWidget(label_rate)
        self.anim_box_buttons.addWidget(animationRate)
        self.anim_box_buttons.addWidget(animationbutton_browse)
        self.anim_box_buttons.addWidget(animationbutton_ok)
        self.anim_box_buttons.addWidget(animationbutton_cancel)

        animationbox.addWidget(self.animation_title)
        animationbox.addWidget(self.animationline)
        animationbox.addLayout(self.anim_box_buttons)
        self.animation_widget = QWidget()
        self.animation_widget.setLayout(animationbox)
        self.animation_widget.hide()

        self.updatingSelection = False
        
        # mesh buttons
        self.meshline.connect('textEdited(QString)', button_ok.lineValueChanged)
        self.meshline.connect('textEdited(QString)', button_cancel.lineValueChanged)

        # audio buttons
        self.soundline.connect('textEdited(QString)', soundbutton_ok.lineValueChanged)
        self.soundline.connect('textEdited(QString)', soundbutton_cancel.lineValueChanged)
        soundRadius.connect('valueChanged(double)', soundbutton_ok.lineValueChanged)
        soundRadius.connect('valueChanged(double)', soundbutton_cancel.lineValueChanged)
        soundVolume.connect('valueChanged(double)', soundbutton_ok.lineValueChanged)
        soundVolume.connect('valueChanged(double)', soundbutton_cancel.lineValueChanged)

        # animation buttons
        self.animationline.connect('textEdited(QString)', animationbutton_ok.lineValueChanged)
        self.animationline.connect('textEdited(QString)', animationbutton_cancel.lineValueChanged)
        animationRate.connect('valueChanged(double)', animationbutton_ok.lineValueChanged)
        animationRate.connect('valueChanged(double)', animationbutton_cancel.lineValueChanged)
        animation_combobox.connect('currentIndexChanged(int)', animationbutton_ok.lineValueChanged)
        animation_combobox.connect('currentIndexChanged(int)', animationbutton_cancel.lineValueChanged)

        self.mainTabList = {}
        self.currentlySelectedTreeWidgetItem = []
Ejemplo n.º 29
0
    def __init__(self):
        self.sels = []
        Component.__init__(self)
        self.window = window.ObjectEditWindow(self)
        self.resetValues()
        self.worldstream = r.getServerConnection()
        self.usingManipulator = False
        self.useLocalTransform = False
        self.cpp_python_handler = None
        self.left_button_down = False
        self.keypressed = False

        self.shortcuts = {
            (Qt.Key_Z, Qt.ControlModifier): self.undo,
            (Qt.Key_Delete, Qt.NoModifier): self.deleteObject,
            (Qt.Key_L, Qt.AltModifier): self.linkObjects,
            (Qt.Key_L, Qt.ControlModifier | Qt.ShiftModifier):
            self.unlinkObjects,
        }

        # Connect to key pressed signal from input context
        self.edit_inputcontext = naali.createInputContext("object-edit", 100)
        self.edit_inputcontext.SetTakeMouseEventsOverQt(True)
        self.edit_inputcontext.connect('KeyPressed(KeyEvent*)',
                                       self.on_keypressed)

        # Connect to mouse events
        self.edit_inputcontext.connect('MouseScroll(MouseEvent*)',
                                       self.on_mousescroll)
        self.edit_inputcontext.connect('MouseLeftPressed(MouseEvent*)',
                                       self.on_mouseleftpressed)
        self.edit_inputcontext.connect('MouseLeftReleased(MouseEvent*)',
                                       self.on_mouseleftreleased)
        self.edit_inputcontext.connect('MouseMove(MouseEvent*)',
                                       self.on_mousemove)

        self.resetManipulators()

        loader = QUiLoader()
        selectionfile = QFile(self.SELECTIONRECT)
        self.selection_rect = loader.load(selectionfile)
        #rectprops = r.createUiWidgetProperty(2)
        #~ print type(rectprops), dir(rectprops)
        #print rectprops.WidgetType
        #uiprops.widget_name_ = "Selection Rect"

        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        proxy = r.createUiProxyWidget(self.selection_rect)
        uism = r.getUiSceneManager()
        uism.AddWidgetToScene(proxy)
        proxy.setWindowFlags(0)  #changing it to Qt::Widget

        self.selection_rect.setGeometry(0, 0, 0, 0)
        self.selection_rect_startpos = None

        r.c = self  #this is for using objectedit from command.py

        # Get world building modules python handler
        self.cpp_python_handler = r.getQWorldBuildingHandler()
        if self.cpp_python_handler == None:
            r.logDebug(
                "Could not aqquire world building service to object edit")
        else:
            # Connect signals
            self.cpp_python_handler.connect('ActivateEditing(bool)',
                                            self.on_activate_editing)
            self.cpp_python_handler.connect('ManipulationMode(int)',
                                            self.on_manupulation_mode_change)
            self.cpp_python_handler.connect('RemoveHightlight()',
                                            self.deselect_all)
            self.cpp_python_handler.connect(
                'RotateValuesToNetwork(int, int, int)', self.changerot_cpp)
            self.cpp_python_handler.connect(
                'ScaleValuesToNetwork(double, double, double)',
                self.changescale_cpp)
            self.cpp_python_handler.connect(
                'PosValuesToNetwork(double, double, double)',
                self.changepos_cpp)
            self.cpp_python_handler.connect('CreateObject()',
                                            self.createObject)
            self.cpp_python_handler.connect('DuplicateObject()',
                                            self.duplicate)
            self.cpp_python_handler.connect('DeleteObject()',
                                            self.deleteObject)
            # Pass widgets
            self.cpp_python_handler.PassWidget("Mesh", self.window.mesh_widget)
            self.cpp_python_handler.PassWidget("Animation",
                                               self.window.animation_widget)
            self.cpp_python_handler.PassWidget("Sound",
                                               self.window.sound_widget)
            self.cpp_python_handler.PassWidget(
                "Materials", self.window.materialTabFormWidget)
            # Check if build mode is active, required on python restarts
            self.on_activate_editing(
                self.cpp_python_handler.IsBuildingActive())
Ejemplo n.º 30
0
    def __init__(self, controller, queue):
        loader = QUiLoader()
        loader.setLanguageChangeEnabled(True)
        #uifile = QFile("pymodules/estatemanagement/estatemanagement.ui")
        uifile = QFile(EstateManagementWindow.UIFILE)
        self.gui = loader.load(uifile)
        self.controller = controller
        IncomingMessagesHandler.__init__(self, queue, self.endMethod)        
        
        uism = r.getUiSceneManager()
#        uiprops = r.createUiWidgetProperty(1) # 1 = Qt::Dialog
#        uiprops.SetMenuGroup("Server Tools")
#        uiprops.name_ = "Estate Management"
        
        self.proxywidget = r.createUiProxyWidget(self.gui)
        self.proxywidget.setWindowTitle("Estate Management")

        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding ProxyWidget failed.")

        uism.AddWidgetToMenu(self.proxywidget, "Estate Management", "Server Tools", "./data/ui/images/menus/edbutton_ESMNG_normal.png")

        self.btnLoadEstate = self.gui.findChild("QPushButton", "btnLoadEstate")
        self.listWEI = self.gui.findChild("QListWidget","listWidgetEstateInfo")
        self.listWRU = self.gui.findChild("QListWidget","listWidgetRegionUsers")
        self.listWEB = self.gui.findChild("QListWidget","listWidgetBanList")
        self.listWAL = self.gui.findChild("QListWidget","listWidgetAccessList")
        self.listWEM = self.gui.findChild("QListWidget","listWidgetEstateManagers")
        self.listWSU = self.gui.findChild("QListWidget","listWidgetSavedUsers")
        
        self.labelEstateInfo = self.gui.findChild("QLabel","labelEstateInfo")
        self.tableEstates = self.gui.findChild("QListWidget","tableWidgetEstates")        
        self.chkEstateAccess = self.gui.findChild("QCheckBox","checkBoxEstateAccess")

        self.lineCurrentEstate = self.gui.findChild("QLineEdit", "lineEditCurrentEstate")
        self.listWidgetEstates = self.gui.findChild("QListWidget", "listWidgetEstates")
        self.btnSetEstate = self.gui.findChild("QPushButton", "pushButtonSetEstate")
         

        self.chkSunFixed = self.gui.findChild("QCheckBox", "checkBoxSunFixed");
        # PublicAllowed
        # ExternallyVisible);
        self.chkAllowVoice = self.gui.findChild("QCheckBox", "checkBoxAllowVoice")
        self.chkAllowDirectTeleport = self.gui.findChild("QCheckBox", "checkBoxAllowDirectTeleport")
        self.chkDenyAnonymous = self.gui.findChild("QCheckBox", "checkBoxDenyAnonymous")
        self.chkDenyIdentified = self.gui.findChild("QCheckBox", "checkBoxDenyIdentified")
        self.chkDenyTransacted = self.gui.findChild("QCheckBox", "checkBoxDenyTransacted")
        self.chkAbuseEmailToEstateOwner = self.gui.findChild("QCheckBox", "checkBoxAbuseEmailToEstateOwner")
        self.chkBlockDwell = self.gui.findChild("QCheckBox", "checkBoxBlockDwell")
        self.chkEstateSkipScripts = self.gui.findChild("QCheckBox", "checkBoxEstateSkipScripts")
        self.chkResetHomeOnTeleport = self.gui.findChild("QCheckBox", "checkBoxResetHomeOnTeleport")
        self.chkTaxFree = self.gui.findChild("QCheckBox", "checkBoxTaxFree")
        self.chkDenyAgeUnverified = self.gui.findChild("QCheckBox", "checkBoxDenyAgeUnverified")

        self.btnLoadEstate.connect("clicked(bool)", self.btnLoadEstateClicked)
        
        self.btnToBan = self.gui.findChild("QPushButton", "pushButtonToBan")
        self.btnToAccess = self.gui.findChild("QPushButton", "pushButtonToAccess")
        self.btnToManagers = self.gui.findChild("QPushButton", "pushButtonToManagers")
        self.btnSaveUserInfo = self.gui.findChild("QPushButton", "pushButtonSaveUserInfo")
        
        self.btnRemoveBan = self.gui.findChild("QPushButton", "pushButtonRemoveBan")
        self.btnRemoveAccess = self.gui.findChild("QPushButton", "pushButtonRemoveAccess")
        self.btnRemoveManagers = self.gui.findChild("QPushButton", "pushButtonRemoveManager")        
        self.btnRemoveSaved = self.gui.findChild("QPushButton", "pushButtonRemoveSaved")
        
        self.btnSavedToAccess = self.gui.findChild("QPushButton", "pushButtonSavedToAccess")
        self.btnSavedToBan = self.gui.findChild("QPushButton", "pushButtonSavedToBan")
        self.btnSavedToManagers = self.gui.findChild("QPushButton", "pushButtonSavedToManagers")
        
        self.btnKick = self.gui.findChild("QPushButton", "pushButtonKick")
        self.btnRequestGodLikePowers = self.gui.findChild("QPushButton", "pushButtonRequestGodLikePowers")
        self.lineKickMessage = self.gui.findChild("QLineEdit","lineEditKickMessage")
        
        
        self.btnToBan.connect("clicked(bool)", self.btnToBanClicked)
        self.btnToAccess.connect("clicked(bool)", self.btnToAccessClicked)
        self.btnToManagers.connect("clicked(bool)", self.btnToManagersClicked)
        self.btnSaveUserInfo.connect("clicked(bool)", self.btnSaveUserInfoClicked)

        self.btnRemoveBan.connect("clicked(bool)", self.btnRemoveBanClicked)
        self.btnRemoveAccess.connect("clicked(bool)", self.btnRemoveAccessClicked)
        self.btnRemoveManagers.connect("clicked(bool)", self.btnRemoveManagersClicked)
        
        self.btnRemoveSaved.connect("clicked(bool)", self.btnRemoveSavedClicked)

        self.btnSavedToAccess.connect("clicked(bool)", self.btnSavedToAccessClicked)
        self.btnSavedToBan.connect("clicked(bool)", self.btnSavedToBanClicked)
        self.btnSavedToManagers.connect("clicked(bool)", self.btnSavedToManagersClicked)
        
        self.btnRequestGodLikePowers.connect("clicked(bool)", self.btnRequestGodLikePowersClicked)
        self.btnKick.connect("clicked(bool)", self.btnKickClicked)
        self.btnSetEstate.connect("clicked(bool)", self.btnSetEstateClicked)
        
        self.chkEstateAccess.connect("toggled(bool)", self.chkEstateAccessToggled)
        
        
        # add incoming event handlers
        self.addHandler('EstateUpdate', self.setEstateInfo)
        self.addHandler('setEstateManagers', self.setEstateManagers)
        self.addHandler('setEstateBans', self.setEstateBans)
        self.addHandler('setEsteteAccessList', self.setEsteteAccessList)
        self.addHandler('noCapability', self.noCapabilityInfoMessage)
        self.addHandler('estateSetting', self.handleEstateAccessSetting)
        self.addHandler('failedEstateSetting', self.handleEstateAccessFailure)
        self.addHandler('unknownResponse', self.handleEstateAccessFailure)
        self.addHandler('malformedResp', self.handleEstateAccessFailure)        
        self.addHandler('currentEstateIdAndName', self.handleCurrentEstateIdAndName)        
        self.addHandler('estates', self.handleEstates)
        self.addHandler('displayerror', self.handleDisplayError)
Ejemplo n.º 31
0
Archivo: door.py Proyecto: Chiru/naali
 def removegui(self, evid):
     self.proxywidget.hide()
     uism = r.getUiSceneManager()
     uism.RemoveWidgetFromMenu(self.proxywidget)
     uism.RemoveWidgetFromScene(self.proxywidget)
Ejemplo n.º 32
0
    def __init__(self):
        self.sels = []  
        Component.__init__(self)
        self.window = window.ObjectEditWindow(self)
        self.resetValues()
        self.worldstream = r.getServerConnection()
        self.usingManipulator = False
        self.useLocalTransform = False
        self.cpp_python_handler = None
        self.left_button_down = False
        self.keypressed = False

        self.shortcuts = {
            (Qt.Key_Z, Qt.ControlModifier) : self.undo,
            (Qt.Key_Delete, Qt.NoModifier) : self.deleteObject,
            (Qt.Key_L, Qt.AltModifier) : self.linkObjects,
            (Qt.Key_L, Qt.ControlModifier|Qt.ShiftModifier) : self.unlinkObjects,
        }

        # Connect to key pressed signal from input context
        self.edit_inputcontext = naali.createInputContext("object-edit", 100)
        self.edit_inputcontext.SetTakeMouseEventsOverQt(True)
        self.edit_inputcontext.connect('KeyPressed(KeyEvent*)', self.on_keypressed)

        # Connect to mouse events
        self.edit_inputcontext.connect('MouseScroll(MouseEvent*)', self.on_mousescroll)
        self.edit_inputcontext.connect('MouseLeftPressed(MouseEvent*)', self.on_mouseleftpressed)
        self.edit_inputcontext.connect('MouseLeftReleased(MouseEvent*)', self.on_mouseleftreleased)
        self.edit_inputcontext.connect('MouseMove(MouseEvent*)', self.on_mousemove)
        
        self.resetManipulators()
        
        loader = QUiLoader()
        selectionfile = QFile(self.SELECTIONRECT)
        self.selection_rect = loader.load(selectionfile)
        #rectprops = r.createUiWidgetProperty(2)
        #~ print type(rectprops), dir(rectprops)
        #print rectprops.WidgetType
        #uiprops.widget_name_ = "Selection Rect"
        
        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        proxy = r.createUiProxyWidget(self.selection_rect)
        uism = r.getUiSceneManager()
        uism.AddWidgetToScene(proxy)
        proxy.setWindowFlags(0) #changing it to Qt::Widget
        
        self.selection_rect.setGeometry(0,0,0,0)
        self.selection_rect_startpos = None
        
        r.c = self #this is for using objectedit from command.py
        
        # Get world building modules python handler
        self.cpp_python_handler = r.getQWorldBuildingHandler()
        if self.cpp_python_handler == None:
            r.logDebug("Could not aqquire world building service to object edit")
        else:
            # Connect signals
            self.cpp_python_handler.connect('ActivateEditing(bool)', self.on_activate_editing)
            self.cpp_python_handler.connect('ManipulationMode(int)', self.on_manupulation_mode_change)
            self.cpp_python_handler.connect('RemoveHightlight()', self.deselect_all)
            self.cpp_python_handler.connect('RotateValuesToNetwork(int, int, int)', self.changerot_cpp)
            self.cpp_python_handler.connect('ScaleValuesToNetwork(double, double, double)', self.changescale_cpp)
            self.cpp_python_handler.connect('PosValuesToNetwork(double, double, double)', self.changepos_cpp)
            self.cpp_python_handler.connect('CreateObject()', self.createObject)
            self.cpp_python_handler.connect('DuplicateObject()', self.duplicate)
            self.cpp_python_handler.connect('DeleteObject()', self.deleteObject)
            # Pass widgets
            self.cpp_python_handler.PassWidget("Mesh", self.window.mesh_widget)
            self.cpp_python_handler.PassWidget("Animation", self.window.animation_widget)
            self.cpp_python_handler.PassWidget("Sound", self.window.sound_widget)
            self.cpp_python_handler.PassWidget("Materials", self.window.materialTabFormWidget)
            # Check if build mode is active, required on python restarts
            self.on_activate_editing(self.cpp_python_handler.IsBuildingActive())