void ObjectsController::renameObject()
{
    std::vector< Carna::base::model::Object3D* > selectedObjects;
    view->fetchSelectedObjects( selectedObjects );

    if( selectedObjects.size() == 1 )
    {
        renameObject( *selectedObjects[ 0 ] );
    }
}
示例#2
0
DccConfig::DccConfig(QObject *parent)
    : SyncableObject(parent)
{
    static auto regTypes = []() -> bool {
        qRegisterMetaTypeStreamOperators<IpDetectionMode>("DccConfig::IpDetectionMode");
        qRegisterMetaTypeStreamOperators<PortSelectionMode>("DccConfig::PortSelectionMode");
        return true;
    }();
    Q_UNUSED(regTypes);

    renameObject("DccConfig");
    setAllowClientUpdates(true);
}
示例#3
0
文件: transfer.cpp 项目: TC01/quassel
void Transfer::init()
{
    static auto regTypes = []() -> bool {
        qRegisterMetaType<Status>("Transfer::Status");
        qRegisterMetaType<Direction>("Transfer::Direction");
        qRegisterMetaTypeStreamOperators<Status>("Transfer::Status");
        qRegisterMetaTypeStreamOperators<Direction>("Transfer::Direction");
        return true;
    }();
    Q_UNUSED(regTypes);

    renameObject(QString("Transfer/%1").arg(_uuid.toString()));
    setAllowClientUpdates(true);
}
示例#4
0
void GameObjectManager::prepareObject(GameObject * object)
{
    if (! object)
        return;

    connect(object, SIGNAL(destroyed(GameObject*)),
            this, SLOT(onObjectDestroyed(GameObject*)), Qt::UniqueConnection);

    if (! hasValidName(object))
        renameObject(object);

    object->setManager(this);
    if (mTakeObjectsOwnership)
        object->setParent(mObjectsParent);
}
ObjectsController::ObjectsController( Record::Server& server, ObjectsComponent& component )
    : server( server )
    , component( component )
    , view( new ObjectsView( server ) )
    , objectReleasing( new QAction( QIcon( ":/icons/trash.png" ) , "&Release", this ) )
    , objectRenaming ( new QAction( QIcon( ":/icons/pencil.png" ), "Rena&me" , this ) )
    , editorDetaching( new QAction( QIcon( ":/icons/pin.png" )   , "&Detach", this ) )
    , pointCreation  ( new QAction( "Create &Point", this ) )
    , pointerCreation( new QAction( "Create Pointe&r", this ) )
    , polylineImport ( new QAction( "Import Poly&line", this ) )
    , tempPointCreation( new QAction( "Create Temporary Seed", this ) )
    , editorContainer( new QFrame() )
    , currentObjectEditor( nullptr )
{
    editorContainer->setLayout( new QVBoxLayout() );
    editorContainer->setContentsMargins( 0, 0, 0, 0 );
    editorContainer->setMinimumWidth( 200 );
    editorContainer->hide();

    QToolBar* const toolBar = new QToolBar();
    toolBar->setIconSize( QSize( 24, 24 ) );
    toolBar->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );

    QToolButton* acquireButton = new QToolButton( toolBar );
    QMenu* acquireMenu = new QMenu( acquireButton );
    acquireButton->setMenu( acquireMenu );
    acquireButton->setPopupMode( QToolButton::InstantPopup );
    acquireButton->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
    acquireButton->setText( "Cre&ate" );
    acquireButton->setIcon( QIcon( ":/icons/add.png" ) );

    acquireMenu->addAction( pointCreation );
    acquireMenu->addAction( pointerCreation );
    acquireMenu->addSeparator();
    acquireMenu->addAction( tempPointCreation );
    acquireMenu->addSeparator();
    acquireMenu->addAction( polylineImport );

    toolBar->addWidget( acquireButton );
    toolBar->addAction( objectReleasing );
    toolBar->addAction( objectRenaming );
    toolBar->addSeparator();
    toolBar->addAction( editorDetaching );

    connect( pointCreation, SIGNAL( triggered() ), this, SLOT( createPoint3D() ) );
    connect( polylineImport, SIGNAL( triggered() ), this, SLOT( importPolyline() ) );
    connect( tempPointCreation, SIGNAL( triggered() ), this, SLOT( createTempPoint1() ) );

#ifndef NO_CRA
    connect( pointerCreation, SIGNAL( triggered() ), this, SLOT( createPointer3D() ) );
#endif

    this->setMinimumWidth( toolBar->sizeHint().width() );
    this->setLayout( new QVBoxLayout() );
    this->layout()->addWidget( view );
    this->layout()->addWidget( toolBar );
    this->layout()->addWidget( editorContainer );

    connect( objectReleasing, SIGNAL( triggered() ), this, SLOT( releaseObjects() ) );
    connect( objectRenaming , SIGNAL( triggered() ), this, SLOT(   renameObject() ) );
    connect( editorDetaching, SIGNAL( triggered() ), this, SLOT(   detachEditor() ) );

    editorDetaching->setEnabled( false );

    connect( view, SIGNAL( selectionChanged() ), this, SLOT( objectsSelectionChanged() ) );
    connect( view, SIGNAL( objectDoubleClicked( Carna::base::model::Object3D& ) ), this, SLOT( renameObject( Carna::base::model::Object3D& ) ) );

    objectsSelectionChanged();
}
示例#6
0
void GameObjectManager::renameObjects()
{
    for(int i=0; i < mGameObjects.size(); i++) {
        renameObject(mGameObjects.at(i));
    }
}
示例#7
0
void FleetWidget::renameButtonClicked(bool)
{
    emit renameObject(fleet);
}
void CoreCertManager::setId(IdentityId id)
{
    renameObject(QString::number(id.toInt()));
}
示例#9
0
void Transfer::init()
{
    renameObject(QString("Transfer/%1").arg(_uuid.toString()));
    setAllowClientUpdates(true);
}