Exemplo n.º 1
0
//-------------------------------------------------------------------------------------------------
void FrmFileExplorer::notifyFileLoad(const IFile *pFile)
{
    int i = getTabIndex(pFile);
    if (i>=0)
    {
        ui->tcProject->setTabIcon(i, QIcon(":/images/res/ok.ico"));
    }
}
Exemplo n.º 2
0
//-------------------------------------------------------------------------------------------------
void FrmFileExplorer::notifyPathChanged(const IFile *pFile)
{
    int i = getTabIndex(pFile);
    if (i>=0)
    {
        ui->tcProject->setTabText(i, pFile->getName());
        ui->paCaption->setInfo(1, QString("File: %1    ").arg(pFile->getPath()));
    }
}
Exemplo n.º 3
0
//-------------------------------------------------------------------------------------------------
void FrmFileExplorer::notifyBeforeFileSave(IFile *pFile)
{
    // Entfernen der "unsaved" Markierung
    int i = getTabIndex(pFile);
    if (i>=0)
    {
        ui->tcProject->setTabIcon(i, QIcon(":/images/res/ok.ico"));
    }
}
Exemplo n.º 4
0
//-------------------------------------------------------------------------------------------------
void FrmFileExplorer::notifyFileActivate(const IFile *pFile)
{
    int i = getTabIndex(pFile);
    if (i>=0)
    {
        ui->tcProject->setCurrentIndex(i);
        ui->paCaption->setInfo(1, QString("File: %1    ").arg(pFile->getPath()));
    }
}
Exemplo n.º 5
0
//-------------------------------------------------------------------------------------------------
void FrmFileExplorer::notifyFileLineSelected(const IFile *pFile, int nLine, ETextMarker eMarker)
{
    // Tabsheet mit dem File raussuchen und Zeile markieren
    int i = getTabIndex(pFile);
    if (i>=0)
    {
        ui->tcProject->setCurrentIndex(i);
    }

    qDebug() << "FrmFileExplorer::notifyFileLineSelected:" << QString::number(nLine) << "\n";
}
Exemplo n.º 6
0
void TabTree::insertTab(const QString &path, int index, bool selected)
{
    QStringList pathComponents = path.split('/');
    QTreeWidgetItem *item = findLastTreeItem(*this, &pathComponents);

    foreach (const QString &text, pathComponents) {
        QTreeWidgetItem *parent = item;

        if (parent != NULL) {
            int to = 0;
            for ( ; to < parent->childCount(); ++to ) {
                 const int index2 = getTabIndex(parent->child(to));
                 if (index2 != -1 && index < index2)
                     break;
            }
            int from = parent->childCount();
            item = new QTreeWidgetItem(parent);
            if (from != to)
                parent->insertChild(to, parent->takeChild(from));
        } else {
            int to = 0;
            for ( ; to < topLevelItemCount(); ++to ) {
                 const int index2 = getTabIndex(topLevelItem(to));
                 if (index2 != -1 && index < index2)
                     break;
            }
            int from = topLevelItemCount();
            item = new QTreeWidgetItem(this);
            if (from != to)
                insertTopLevelItem(to, takeTopLevelItem(from));
        }

        item->setExpanded(true);
        item->setData(0, DataIndex, -1);
        item->setData(0, DataText, text);

        labelItem(item);
    }
Exemplo n.º 7
0
/** \brief Auswählen des Tabsheets mit dem Lua Files. */
void FrmFileExplorer::notifyFileModified(const IFile *pFile)
{
    if (pFile==NULL || m_pWndMain==NULL || m_pWndMain->getScriptEngine()==NULL)
        return;

    int i = getTabIndex(pFile);
    if (i<0)
        return;

    ui->tcProject->setTabIcon(i, QIcon(":/images/res/warning.ico"));

    qDebug() << "FrmFileExplorer::notifyFileModified: emit checkFile(...)\n";
    emit checkFile(pFile);
}
void HTMLElementImp::focus()
{
    if (!ownerDocument || !ownerDocument->getDefaultView() || getTabIndex() < 0)
        return;
    ownerDocument->setFocus(this);
}