Example #1
0
void QtResourceViewPrivate::slotResourceSetActivated(QtResourceSet *resourceSet)
{
    const bool resourceActive = resourceSet;
    m_editResourcesAction->setEnabled(resourceActive);
    m_reloadResourcesAction->setEnabled(resourceActive);

    storeExpansionState();
    const QString currentPath = m_itemToPath.value(m_treeWidget->currentItem());
    const QString currentResource = m_itemToResource.value(m_listWidget->currentItem());
    m_treeWidget->clear();
    m_pathToContents.clear();
    m_pathToItem.clear();
    m_itemToPath.clear();
    m_listWidget->clear();
    m_resourceToItem.clear();
    m_itemToResource.clear();

    createPaths();
    applyExpansionState();

    if (!currentResource.isEmpty())
        q_ptr->selectResource(currentResource);
    else if (!currentPath.isEmpty())
        q_ptr->selectResource(currentPath);
}
Example #2
0
void QtResourceViewPrivate::slotResourceSetActivated(QtResourceSet *resourceSet)
{
    Q_UNUSED(resourceSet)

    updateActions();

    storeExpansionState();
    const QString currentPath = m_itemToPath.value(m_treeWidget->currentItem());
    const QString currentResource = m_itemToResource.value(m_listWidget->currentItem());
    m_treeWidget->clear();
    m_pathToContents.clear();
    m_pathToParentPath.clear();
    m_pathToSubPaths.clear();
    m_pathToItem.clear();
    m_itemToPath.clear();
    m_listWidget->clear();
    m_resourceToItem.clear();
    m_itemToResource.clear();

    createPaths();
    applyExpansionState();

    if (!currentResource.isEmpty())
        q_ptr->selectResource(currentResource);
    else if (!currentPath.isEmpty())
        q_ptr->selectResource(currentPath);
    filterOutResources();
}
void MusicBackgroundRemoteWidget::buttonClicked(int index)
{
    int count = 0;
    if(m_currentIndex != index)
    {
        m_downloadQueue->abort();
    }
    switch(m_currentIndex = index)
    {
        case 0: count = 13; break;
        case 1: count = 14; break;
        case 2: count = 27; break;
        case 3: count = 9; break;
    }

    QDir dir( "." );
    dir.mkpath( QString("%1%2").arg(DATA_CACHED_AL).arg(m_currentIndex) );

    m_listWidget->clearAllItems();
    for(int i=0; i<count; i++)
    {
        m_listWidget->createItem(QString(), ":/image/noneImage");
    }

    m_downloadQueue->addImageQueue(m_urls[m_currentIndex], createPaths());
    m_downloadQueue->startToDownload();
}
Example #4
0
void ControlPanel::resized()
{
    int w = getWidth();
    int h = 32; //getHeight();

    if (playButton != 0)
        playButton->setBounds(w-h*10,5,h-5,h-10);

    if (recordButton != 0)
        recordButton->setBounds(w-h*9,5,h-5,h-10);

    if (masterClock != 0)
        masterClock->setBounds(w-h*7-15,0,h*7-15,h);

    if (cpuMeter != 0)
        cpuMeter->setBounds(8,h/4,h*3,h/2);

    if (diskMeter != 0)
        diskMeter->setBounds(16+h*3,h/4,h*3,h/2);

    if (audioEditor != 0)
        audioEditor->setBounds(h*7,5,h*8,h-10);

    if (cpb != 0)
        cpb->setBounds(w-28,5,h-10,h-10);

    createPaths();

    if (open)
    {
        filenameComponent->setBounds(165, h+5, w-500, h-10);
        filenameComponent->setVisible(true);

        newDirectoryButton->setBounds(w-h+4, h+5, h-10, h-10);
        newDirectoryButton->setVisible(true);

        prependText->setBounds(165+w-490, h+5, 50, h-10);
        prependText->setVisible(true);

        dateText->setBounds(165+w-435, h+5, 175, h-10);
        dateText->setVisible(true);

        appendText->setBounds(165+w-255, h+5, 50, h-10);
        appendText->setVisible(true);

    }
    else
    {
        filenameComponent->setVisible(false);
        newDirectoryButton->setVisible(false);
        prependText->setVisible(false);
        dateText->setVisible(false);
        appendText->setVisible(false);
    }

    repaint();
}
		void runTests() {
			std::cout << "Detected home directory: " << ::core::Path::home() << std::endl;
			std::cout << "Application data directory: " << ::core::Path::data() << std::endl;
			std::cout << "Current working directory: " << ::core::Path::current() << std::endl;

			createPaths();
			checkPaths();
			absolutePaths();
			makeDir();

			time(timeFs, 1000);
		}
Example #6
0
void ControlPanel::paint(Graphics& g)
{
    g.setColour(backgroundColour);
    g.fillRect(0,0,getWidth(),getHeight());

    if (open)
    {
        createPaths();
        g.setColour(Colours::black);
        g.fillPath(p1);
        g.fillPath(p2);
    }

}
Example #7
0
File: Map.cpp Project: Qata/Wibbly
bool Map::loadMap(string path)
{
	bool retVal = true;
	if (IO::readBin(map.get(), sizeof(map_t), path))
	{
		createPaths();
	}
	else
	{
		retVal = false;
		map = nullptr;
	}
	return retVal;
}
Example #8
0
void ControlPanel::resized()
{
    int w = getWidth();
    int h = 32; //getHeight();

    if (playButton != 0)
    {
        if (w > 330)
            playButton->setBounds(w-h*10,5,h-5,h-10);
        \
        else
            playButton->setBounds(5,5,h-5,h-10);
        \
    }

    if (recordButton != 0)
    {
        if (w > 330)
            recordButton->setBounds(w-h*9,5,h-5,h-10);
        else
            recordButton->setBounds(5+h,5,h-5,h-10);
    }

    if (masterClock != 0)
    {
        if (w > 330)
            masterClock->setBounds(w-h*7-15,0,h*7-15,h);
        else
            masterClock->setBounds(5+h*2+15,0,h*7-15,h);
    }

    int offset1 = 750 - getWidth();
    if (offset1 > h)
        offset1 = h;

    int offset2 = 570 - getWidth();
    if (offset2 > h)
        offset2 = h;

    if (cpuMeter != 0)
    {

        if (getWidth() < 750 && getWidth() >= 570)
            cpuMeter->setBounds(8,h/4+offset1,h*3,h/2);
        else if (getWidth() < 570)
            cpuMeter->setBounds(8,h/4+offset1+offset2,h*3,h/2);
        else
            cpuMeter->setBounds(8,h/4,h*3,h/2);
    }

    if (diskMeter != 0)
    {
        if (getWidth() < 750 && getWidth() >= 570)
            diskMeter->setBounds(16+h*3,h/4+offset1,h*3,h/2);
        else if (getWidth() < 570)
            diskMeter->setBounds(16+h*3,h/4+offset1+offset2,h*3,h/2);
        else
            diskMeter->setBounds(16+h*3,h/4,h*3,h/2);

    }

    if (audioEditor != 0)
    {
        if (getWidth() < 750 && getWidth() >= 570)
            audioEditor->setBounds(w-526,0,h*8,h);
        else if (getWidth() < 570)
            audioEditor->setBounds(8,0+offset2,h*8,h);
        else
            audioEditor->setBounds(h*7,0,h*8,h);
    }


    if (cpb != 0)
    {
        if (open)
            cpb->setBounds(w-28,getHeight()-5-h*2+10,h-10,h-10);
        else
            cpb->setBounds(w-28,getHeight()-5-h+10,h-10,h-10);
    }

    createPaths();

    if (open)
    {
        int topBound = getHeight()-h+10-5;

        filenameComponent->setBounds(165, topBound, w-500, h-10);
        filenameComponent->setVisible(true);

        newDirectoryButton->setBounds(w-h+4, topBound, h-10, h-10);
        newDirectoryButton->setVisible(true);

        prependText->setBounds(165+w-490, topBound, 50, h-10);
        prependText->setVisible(true);

        dateText->setBounds(165+w-435, topBound, 175, h-10);
        dateText->setVisible(true);

        appendText->setBounds(165+w-255, topBound, 50, h-10);
        appendText->setVisible(true);

    }
    else
    {
        filenameComponent->setVisible(false);
        newDirectoryButton->setVisible(false);
        prependText->setVisible(false);
        dateText->setVisible(false);
        appendText->setVisible(false);
    }

    repaint();


}