Ejemplo n.º 1
0
    def showSettingsUI(self, parentWidget):
        self.settingsDialog = QUiLoader().load(QFile(workingDir + "/settings.ui"), parentWidget)

        # Inject the image title format.
        self.settingsDialog.group_upload.input_name.connect("textChanged(QString)", self.nameFormatEdited)
        self.settingsDialog.connect("accepted()", self.saveSettings)

        # Inject the upload stream
        self.settingsDialog.group_upload.input_stream.text = self.Stream

        # Inject default values.
        self.loadSettings()

        self.settingsDialog.group_upload.input_name.text      = self.Format
        self.settingsDialog.group_account.input_username.text = self.Username
        self.settingsDialog.group_account.input_password.text = self.Password

        self.settingsDialog.group_clipboard.radio_direct.setChecked(not self.copyDirect)
        self.settingsDialog.group_clipboard.radio_nothing.setChecked(not self.copyNothing)

        # Wait for login/out button activation.
        self.settingsDialog.group_account.widget_loggedIn.connect("clicked()", self.Logout)
        self.settingsDialog.group_account.button_authenticate.connect("clicked()", self.Login)

        self.updateUi()
        self.settingsDialog.open()
Ejemplo n.º 2
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.º 3
0
	def __init__(self):
		try:
			tempLocation = QDesktopServices.storageLocation(QDesktopServices.TempLocation)
		except AttributeError:
			from PythonQt.QtCore import QStandardPaths #fix for Qt5
			tempLocation = QStandardPaths.writableLocation(QStandardPaths.TempLocation)

		self.uil = QUiLoader()
		self.loadSettings()
Ejemplo n.º 4
0
    def __init__(self):
        try:
            tempLocation = QDesktopServices.storageLocation(
                QDesktopServices.TempLocation)
        except AttributeError:
            from PythonQt.QtCore import QStandardPaths  #fix for Qt5
            tempLocation = QStandardPaths.writableLocation(
                QStandardPaths.TempLocation)

        #paramiko.util.log_to_file(tempLocation + "/screencloud-sftp.log")
        self.uil = QUiLoader()
        self.loadSettings()
Ejemplo n.º 5
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.º 6
0
 def __init__(self):
     self.uil = QUiLoader()
     self.loadSettings()
     self.clientID, self.clientSecret = '417133363442-dtm48svvid8ntj6locavdvdt3e982n6k.apps.googleusercontent.com', 'UmzBQInps-09e6VNbnsRT0BG'
     if self.accessToken and self.refreshToken:
         credentials = client.GoogleCredentials(
             self.accessToken, self.clientID, self.clientSecret,
             self.refreshToken, None,
             "https://accounts.google.com/o/oauth2/token",
             'ScreenCloudGoogleDrivePlugin/1.3')
         self.driveService = build('drive',
                                   'v3',
                                   http=credentials.authorize(Http()))
Ejemplo n.º 7
0
    def __init__(self):
        self.uil = QUiLoader()
        self.loadSettings()

        http_provider = onedrivesdk.HttpProvider()
        auth_provider = onedrivesdk.AuthProvider(http_provider=http_provider,
                                                 client_id=CLIENT_ID,
                                                 scopes=SCOPES,
                                                 session_type=QSettingsSession)

        try:
            auth_provider.load_session()
            self.loggedIn = True
        except:
            self.loggedIn = False

        self.client = onedrivesdk.OneDriveClient(API_BASE_URL, auth_provider,
                                                 http_provider)
Ejemplo n.º 8
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.º 9
0
 def __init__(self):
     self.uil = QUiLoader()
Ejemplo n.º 10
0
 def __init__(self):
     self.uil = QUiLoader()
     self.loadSettings()
Ejemplo n.º 11
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 = naali.ui
        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.º 12
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.º 13
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.º 14
0
 def __init__(self):
     self.uil = QUiLoader()
     self.loadSettings()
     if self.access_token:
         self.client = dropbox.client.DropboxClient(self.access_token)
Ejemplo n.º 15
0
 def __init__(self):
     paramiko.util.log_to_file(
         QDesktopServices.storageLocation(QDesktopServices.TempLocation) +
         "/screencloud-sftp.log")
     self.uil = QUiLoader()
     self.loadSettings()
Ejemplo n.º 16
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 = naali.ui

        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.º 17
0
    #print dir(box.treeWidget)

if 0:
    box = r.c.widget
    #print box, dir(box.treeWidget)
    text = box.treeWidget.currentItem().text(0)
    print text
    print type(text), r.c.widgetList
    print r.c.widgetList[720010]

if 0:  #QtUI::UICanvas::External ?! not here...
    from PythonQt.QtUiTools import QUiLoader
    from PythonQt.QtCore import QFile, QIODevice
    #print dir(quil)
    #print dir(PythonQt.QtCore.QIODevice)
    loader = QUiLoader()
    canvas = r.createCanvas(0)

    file = QFile("pymodules/usr/editobject.ui")
    iodev = QIODevice(file)

    widget = loader.load(file)
    canvas.AddWidget(widget)
    canvas.Show()

if 0:  #collada load testing
    import collada
    print collada.Collada
    try:
        pycollada_test
    except:
Ejemplo n.º 18
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 = naali.ui
        #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.')
        self.container.show()
Ejemplo n.º 19
0
 def __init__(self):
     self.uil = QUiLoader()
     self.config_path = workingDir + '/config.json'
     self.loadSettings()