예제 #1
0
void FVBoxField::setupMenu( )
{
	contextMenuObj->clear();

        if (field->dim() > 1) {
		contextMenuObj->addAction(tr("&Draw Vectors"), this, SLOT( slotDrawVectors() ) );
                QString msg("Field" + this->getName() + " may be drawn as vectors" );
                qDebug(msg.toAscii());
            } else {
            QString msg("Field" + this->getName() + " will not be drawn as vectors");
                            qDebug(msg.toAscii());
        }
	contextMenuObj->addAction(tr("&Draw Colormap"), this, SLOT( slotDrawColormap() ) );

	contextMenuObj->addSeparator();
	contextMenuObj->addAction(tr("&Add Slice"), this, SLOT( slotSlice() ) );
	
	contextMenuObj->addSeparator();
	contextMenuObj->addAction(tr("&Animate Visualisation"), this, SLOT( slotAnimate() ) );

        contextMenuObj->addSeparator();
        contextMenuObj->addAction(tr("&Reload"), this, SLOT( slotReload() ) );

        contextMenuObj->addSeparator();
	contextMenuObj->addAction(tr("De&lete"),(QWidget*) manager, SLOT(slotDelete()) );
}
IdentityStatusWidget::IdentityStatusWidget(Kopete::Identity *identity, QWidget *parent)
: QWidget(parent), d(new Private())
{
	d->identity = 0;
	
	// animation for showing/hiding
	d->timeline = new QTimeLine( 150, this );
	d->timeline->setCurveShape( QTimeLine::EaseInOutCurve );
	connect( d->timeline, SIGNAL(valueChanged(qreal)),
			 this, SLOT(slotAnimate(qreal)) );

	d->ui.setupUi(this);
	d->ui.accounts->setContextMenuPolicy( Qt::CustomContextMenu );
	QWidget::setVisible( false );

	setIdentity(identity);

	// user input signals
	connect( d->ui.accounts, SIGNAL(customContextMenuRequested(QPoint)),
			this, SLOT(showAccountContextMenu(QPoint)) );
	connect( d->ui.accounts, SIGNAL(itemClicked(QListWidgetItem*)),
			this, SLOT(slotAccountClicked(QListWidgetItem*)) );
	connect( d->ui.accounts, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
			this, SLOT(slotAccountDoubleClicked(QListWidgetItem*)) );
	connect( d->ui.photo, SIGNAL(clicked()), 
			 this, SLOT(slotPhotoClicked()));

	connect( Kopete::AccountManager::self(), SIGNAL(accountRegistered(Kopete::Account*)),
			this, SLOT(slotAccountRegistered(Kopete::Account*)));
	connect( Kopete::AccountManager::self(), SIGNAL(accountUnregistered(const Kopete::Account*)),
			this, SLOT(slotAccountUnregistered(const Kopete::Account*)));

	connect( Kopete::IdentityManager::self(), SIGNAL(identityUnregistered(const Kopete::Identity*)),
			this, SLOT(slotIdentityUnregistered(const Kopete::Identity*)));

	d->ui.accounts->viewport()->installEventFilter( this );
}