Example #1
0
// --------------------------------------------------------------------------------------------------------
void KFileTreeWidget::doubleClicked ()
{
    if (picked_pickable == current_dir_node) return;
    if (((KFileTreeNode*)picked_pickable)->getType() == KDL_FILE_TYPE_DIR)
    {
        setCurrentDir (((KFileTreeNode*)picked_pickable)->getAbsPathName());
    }
    else
    {
        notifyReceivers (((KFileTreeNode*)picked_pickable)->getAbsPathName(), KDL_NOTIFICATION_TYPE_OPEN_FILE);
        notifyReceivers ();
    }
}
Example #2
0
// --------------------------------------------------------------------------------------------------------
void KFileTreeWidget::setCurrentDir ( const std::string & dirName )
{
    std::string absDirPath;
    
    if (dirName[0] == '.' && current_dir_node) 
    {
        // path relative to the current directory should begin with a dot
        absDirPath = current_dir_node->getAbsPathName() + "/" + dirName;
    }
    else
    {
        absDirPath = kFileAbsPathName(dirName);
    }

    if (kFileIsDir(absDirPath) && (current_dir_node == NULL || (current_dir_node->getAbsPathName() != absDirPath)))
    {
        removeAllPickables();
        if (current_dir_node) 
        {
            delete current_dir_node;
        }
        current_dir_node = new KFileTreeDirCurrent(absDirPath);
        
        addPickable(up_node);
        addPickable(current_dir_node);
        current_dir_node->createTree();
        up_node->setCurrentDir(current_dir_node);
        initializeIds();
        deleteDisplayList();
        
        notifyReceivers (current_dir_node->getAbsPathName(), KDL_NOTIFICATION_TYPE_OPEN_DIRECTORY);
    }
}
Example #3
0
		/**
		 * @brief Start the transmission of a TransmissionObject on this
		 * PhysicalResource and notify all attached Receivers
		 */
		void startTransmission(TransmissionObjectPtr transmissionObject)
		{
			transmissionObject->setPhysicalResource(this);
			transmissionObject->setIsStart(true);
			notifyReceivers(transmissionObject);
			transmissionObjects.push_front(transmissionObject);
		};
Example #4
0
// --------------------------------------------------------------------------------------------------------
bool KKeyRecorder::handleKey ( const KKey & key )
{
    if (key.name == "RETURN")
    {
        stopRecording(); 
        return true;
    }
    
    if (recorded_sequence == "")
    {
        recorded_sequence = key.name;
    }
    else
    {
        recorded_sequence += " " + key.name;
    }

    num_recorded_keys++;
        
    if (num_recorded_keys >= max_num_recorded_keys)
    {
        stopRecording();
        return true;
    }

    notifyReceivers(recorded_sequence);
    
    return true;
}
Example #5
0
	void FrameCapture::captureLoop()
	{
		while(keepCapturing)
		{
			cv::Mat frame;
			*captureDevice >> frame; 
			cv::flip( frame, frame, 1); //1 is flip horizontal
			notifyReceivers(frame);
			
			boost::this_thread::interruptible_wait(framerateWaitMs);
		}
	}
Example #6
0
// --------------------------------------------------------------------------------------------------------
void KFileTreeWidget::picked ()
{
    deleteDisplayList();
    notifyReceivers (((KFileTreeNode*)picked_pickable)->getPathName(), KDL_NOTIFICATION_TYPE_SELECT_NODE);
}
Example #7
0
		/**
		 * @brief Stop the transmission of a TransmissionObject on this
		 * PhysicalResource and notify all attached Receivers
		 */
		void stopTransmission(TransmissionObjectPtr transmissionObject)
		{
			transmissionObject->setIsStart(false);
			notifyReceivers(transmissionObject);
			transmissionObjects.remove(transmissionObject);
		};
Example #8
0
// --------------------------------------------------------------------------------------------------------
void KKeyRecorder::stopRecording ()
{
    recording = false;
    KEventHandler::setFocusKeyHandler(NULL);
    notifyReceivers(recorded_sequence);
}