How to use the hydrus.client.gui.QtPorting.isValid function in hydrus

To help you get started, we’ve selected a few hydrus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUITagSuggestions.py View on Github external
def qt_code( recent_tags ):
                
                if not self or not QP.isValid( self ):
                    
                    return
                    
                
                self._last_fetched_tags = recent_tags
                
                self._UpdateTagDisplay()
                
                if len( self._recent_tags.GetTags() ) > 0:
                    
                    self._recent_tags.SelectTopItem()
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUIPanels.py View on Github external
def qt_code( ipfs_shares ):
                
                if not self or not QP.isValid( self ):
                    
                    return
                    
                
                # list of ( multihash, num_files, total_size, note )
                
                self._ipfs_shares.SetData( ipfs_shares )
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUIDialogsManage.py View on Github external
def qt_code( mappings ):
            
            if not self or not QP.isValid( self ):
                
                return
                
            
            self._mappings = mappings
            
            self._mappings_list_ctrl.SetData( self._mappings )
            
            self._status_st.setText( '' )
            
            if not self._started_external_ip_fetch:
                
                self._started_external_ip_fetch = True
                
                self._RefreshExternalIP()
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUIPanels.py View on Github external
def _Refresh( self ):
            
            if not self or not QP.isValid( self ):
                
                return
                
            
            HG.client_controller.CallToThread( self.THREADFetchInfo, self._service )
github hydrusnetwork / hydrus / hydrus / client / ClientController.py View on Github external
def qt_code( splash ):
            
            if splash and QP.isValid( splash ):
                
                splash.hide()
                
                splash.close()
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUIPanels.py View on Github external
def _Refresh( self ):
            
            if not self or not QP.isValid( self ):
                
                return
                
            
            port = self._service.GetPort()
            
            if port is None:
                
                status = 'The local booru is not running.'
                
            else:
                
                status = 'The local booru should be running on port {}.'.format( port )
                
                upnp_port = self._service.GetUPnPPort()
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUITagSuggestions.py View on Github external
def qt_code():
                
                if not self or not QP.isValid( self ):
                    
                    return
                    
                
                script_names_to_scripts = { script.GetName() : script for script in scripts }
                
                for ( name, script ) in list(script_names_to_scripts.items()):
                    
                    self._script_choice.addItem( script.GetName(), script )
                    
                
                new_options = HG.client_controller.new_options
                
                favourite_file_lookup_script = new_options.GetNoneableString( 'favourite_file_lookup_script' )
                
                if favourite_file_lookup_script in script_names_to_scripts:
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUIAsync.py View on Github external
def qt_deliver_result( result ):
            
            if self._win is None or not QP.isValid( self._win ):
                
                self._win = None
                
                return
                
            
            self._publishResult( result )
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUIPanels.py View on Github external
def _Refresh( self ):
            
            if not self or not QP.isValid( self ):
                
                return
                
            
            port = self._service.GetPort()
            
            if port is None:
                
                status = 'The client api is not running.'
                
            else:
                
                status = 'The client api should be running on port {}.'.format( port )
                
                upnp_port = self._service.GetUPnPPort()
github hydrusnetwork / hydrus / hydrus / client / gui / ClientGUITopLevelWindows.py View on Github external
if parent is None:
        
        width = min_width
        height = min_height
        
    else:
        
        parent_window = parent.window()
        
        # when we initialise, we might not have a frame yet because we haven't done show() yet
        # so borrow main gui's
        if frame_padding.isEmpty():
            
            main_gui = HG.client_controller.gui
            
            if main_gui is not None and QP.isValid( main_gui ) and not main_gui.isFullScreen():
                
                frame_padding = main_gui.frameGeometry().size() - main_gui.size()
                
            
        
        if parent_window.isFullScreen():
            
            parent_available_size = parent_window.size()
            
        else:
            
            parent_frame_size = parent_window.frameGeometry().size()
            
            parent_available_size = parent_frame_size - frame_padding