Beispiel #1
0
void Viewport::mouseMoveEvent(QMouseEvent *event)
{
    _dragging = true;
    _current_pos = event->pos();

    QGraphicsView::mouseMoveEvent(event);
    if (scene->mouseGrabberItem() == NULL)
    {
        if (event->buttons() == Qt::LeftButton)
        {
            pan(_click_pos_world - sceneToWorld(mapToScene(event->pos())));
        }
        else if (event->buttons() == Qt::RightButton && !angle_locked)
        {
            QPointF d = _click_pos - event->pos();
            pitch = fmin(0, fmax(-M_PI, pitch - 0.01 * d.y()));
            yaw = fmod(yaw + M_PI - 0.01 * d.x(), M_PI*2) - M_PI;

            _click_pos = event->pos();
            update();
            scene->invalidate(QRect(),QGraphicsScene::ForegroundLayer);
            emit(viewChanged());
        }
    }

    updateInfo();
}
//英雄按钮
void EquipUpgradeLayer::heroButton_OnTouch(Ref* sender, Widget::TouchEventType type)
{
    if (type!=Widget::TouchEventType::ENDED) return;
    SoundBLL::getInstance()->playEffect(kButtonSound);
    
    for (auto &btn : m_HeroItemButtons) {
        btn->setTouchEnabled(true);
        btn->setBright(true);
    }
    
    auto btn=(ui::Button*)sender;
    btn->setTouchEnabled(false);
    btn->setBright(false);
    
    currSelectHeroID=btn->getTag();
    
    showWearpack();
    
    m_WearPanel->setVisible(false);
    s_wearborder->setVisible(false);
    //英雄
    HeroBase *hero=GameObjectFactory::getHero(currSelectHeroID-1);
    //刷新数据
    updateInfo(hero->getHeroModel());
}
Beispiel #3
0
//使用按钮
void EquipLayer::Button_shiyong_BtnOnTouch(Ref* sender, Widget::TouchEventType type)
{
    if (type!=Widget::TouchEventType::ENDED) return;
    SoundBLL::getInstance()->playEffect(kButtonSound);
    
    //是否有选择的ID
    if(currSelectBackpackID==-1){
        PopTipsLayer::addTipLayer(this, "请选择装备!");
        return;
    }
    
    if(!equiplocalBll->wearEquip(currSelectBackpackID, currSelectHeroID)) {
        PopTipsLayer::addTipLayer(this, "装备栏已满!");
        return;
    }
    currSelectBackpackID=-1;
    
    setWearpackDataView(false);
    setBackpackDataView(false);
    
    showBackpack();
    showWearpack();
    
    //刷新数据
    HeroBase *hero=GameObjectFactory::getHero(currSelectHeroID-1);
    updateInfo(hero->getHeroModel());
    
    if (updateCalllback) {
        updateCalllback(this);
    }
}
BalanceWindow::BalanceWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::BalanceWindow)
{
    ui->setupUi(this);

    INFO = QSystemTrayIcon::Information;
    WARNING = QSystemTrayIcon::Warning;
    CRYTICAL = QSystemTrayIcon::Critical;


    isAuthPage = true;

    setCentralWidget(ui->verticalLayoutWidget);

    setupStatusBar();

    setupTrayIcon();


    trayMessageTimer = new QTimer();
    trayMessageTimer->setSingleShot(true);
    updateTimer = new QTimer();
    connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateBalance()));
    connect(ui->updateAction, SIGNAL(triggered()), this, SLOT(updateBalance()));

    getSettings();

    updateInfo();

    if(!d)
        updateBalance();


}
Beispiel #5
0
// this is the function called by the timer
// it loops through all accounts
static gboolean callUpdateInfo()
{
	GList* cur;
	AcctVar* curAcct;
	gboolean isPlaying;
	char* prevInfo;
	char* title;
	char* artist;

	isPlaying = getSong(&title, &artist);

	cur = g_list_first(accounts);

	while(cur != NULL)
	{
		curAcct = (AcctVar*)cur->data;
		prevInfo = updateInfo(curAcct->c, curAcct->prevInfo,
			       title, artist, isPlaying, FALSE);
		g_free(curAcct->prevInfo);
		curAcct->prevInfo = prevInfo;
		cur = cur->next;
	}
	if(isPlaying)
	{
		g_free(title);
		g_free(artist);
	}
	return TRUE;
}
ADMVideoYadif::ADMVideoYadif(AVDMGenericVideoStream *in, CONFcouple *couples)
{
  _in=in;		

  memcpy(&_info,_in->getInfo(),sizeof(_info)); 
  _info.encoding=1;

 // _uncompressed=new uint8_t [3*_in->getInfo()->width*_in->getInfo()->height];
 

  if(couples)
  {
   	 _param=new (YADIF_PARAM);
	GET(mode);
        GET(order);
  }
  else
  {
    _param = new ( YADIF_PARAM);
    _param->mode=0;
    _param->order=1;
  }
  _uncompressed=new ADMImage(_in->getInfo()->width,_in->getInfo()->height);
  ADM_assert(_uncompressed);    	  	
  vidCache = new VideoCache (10, in);
  updateInfo();
}
uint8_t ADMVideoYadif::configure( AVDMGenericVideoStream *instream) 
{
  _in= instream;
     diaMenuEntry tMode[]={
                             {0,      QT_TR_NOOP("Temporal & spatial check"),NULL},
                             {1,   QT_TR_NOOP("Bob, temporal & spatial check"),NULL},
                             {2,      QT_TR_NOOP("Skip spatial temporal check"),NULL},
                             {3,  QT_TR_NOOP("Bob, skip spatial temporal check"),NULL}
          };
     diaMenuEntry tOrder[]={
                             {0,      QT_TR_NOOP("Bottom field first"),NULL},
                             {1,   QT_TR_NOOP("Top field first"),NULL}
          };
  
     diaElemMenu mMode(&(_param->mode),   QT_TR_NOOP("_Mode:"), 4,tMode);
     diaElemMenu morder(&(_param->order),   QT_TR_NOOP("_Order:"), 2,tOrder);
     
     diaElem *elems[]={&mMode,&morder};
     
     if(diaFactoryRun(QT_TR_NOOP("yadif"),sizeof(elems)/sizeof(diaElem *),elems))
     {
        updateInfo();
        return 1;
     }
     return 0;
}
Beispiel #8
0
bool MainCityMoreView::init(int buildId, int type)
{
    if (!PopupBaseView::init()) {
        return false;
    }
    setIsHDPanel(true);
    m_buildId = buildId;
    m_type = type;
    auto tmpCCB = CCBLoadFile("MainCityMoreView",this,this);
    if (CCCommonUtils::isIosAndroidPad()) {
        this->setContentSize(CCDirector::sharedDirector()->getWinSize());
    }
    else
        this->setContentSize(tmpCCB->getContentSize());
    
    if (!CCCommonUtils::isIosAndroidPad()) {
        int oldBgHeight = m_buildBG->getContentSize().height;
        changeBGHeight(m_buildBG);
        int newBgHeight = m_buildBG->getContentSize().height;
        int addHeight = newBgHeight - oldBgHeight;
        int oldWidth = m_infoList->getContentSize().width;
        int oldHeight = m_infoList->getContentSize().height;
        m_infoList->setPositionY(m_infoList->getPositionY()-addHeight);
        m_infoList->setContentSize(CCSizeMake(oldWidth, oldHeight+addHeight));
    }
    
    m_scrollView = CCScrollView::create(m_infoList->getContentSize());
    m_scrollView->setDirection(kCCScrollViewDirectionVertical);
    m_infoList->addChild(m_scrollView);
    
    updateInfo();
    
    return true;
}
Beispiel #9
0
void SizeAdapter::updateGui(const ::Atlas::Message::Element& element)
{
	AdapterSelfUpdateContext context(*this);
	WFMath::AxisBox<3> axisBox;
	try {
		axisBox.fromAtlas(element.asList());
	} catch (...) {
		axisBox = WFMath::AxisBox<3>(WFMath::Point<3>(-0.5, -0.5, -0.5), WFMath::Point<3>(0.5, 0.5, 0.5));
	}
	if (mLowerXWindow) {
		mLowerXWindow->setText(toString(axisBox.lowCorner().x()));
	}
	if (mLowerYWindow) {
		mLowerYWindow->setText(toString(axisBox.lowCorner().y()));
	}
	if (mLowerZWindow) {
		mLowerZWindow->setText(toString(axisBox.lowCorner().z()));
	}
	if (mUpperXWindow) {
		mUpperXWindow->setText(toString(axisBox.highCorner().x()));
	}
	if (mUpperYWindow) {
		mUpperYWindow->setText(toString(axisBox.highCorner().y()));
	}
	if (mUpperZWindow) {
		mUpperZWindow->setText(toString(axisBox.highCorner().z()));
	}

	updateInfo();

}
void UpdateCheckerDialog::downloadUpdate()
{
	QPushButton *button(qobject_cast<QPushButton*>(sender()));

	if (button)
	{
		QVariant updateInfo(button->property("downloadInfo"));

		if (!updateInfo.isNull())
		{
			for (int i = 0; i < m_ui->gridLayout->count(); ++i)
			{
				m_ui->gridLayout->itemAt(i)->widget()->setVisible(false);
				m_ui->gridLayout->itemAt(i)->widget()->deleteLater();
			}

			m_ui->label->setText(tr("Downloading:"));
			m_ui->progressBar->setRange(0, 100);
			m_ui->progressBar->show();
			m_ui->buttonBox->setDisabled(true);

			Updater *updater(new Updater(updateInfo.value<UpdateInformation>(), this));

			connect(updater, SIGNAL(progress(int)), this, SLOT(updateProgress(int)));
			connect(updater, SIGNAL(finished(bool)), this, SLOT(transferFinished(bool)));
		}
	}
}
void SVIParticleAnimation::update(SVIUInt& time) {
	if( getStatus() == IDLE ) {
	}

	updateInfo(time);

	if( getStatus() == ANIMATING ) {
		
		if(mParticleEffect != NULL) {
			if(mParticleEffect->getStatus() == SVIParticleEffect::IDLE) {
				mSlide->getProjectionSlide()->addParticleEffect(mParticleEffect);
			}

			SVIFloat interpolateTime = mInterpolator->getTimeInterpolation(time);
		if(mParticleEffect)
			mParticleEffect->updateFromAnimation(time, interpolateTime, mDuration);
		}



		if( isEnd(time) ) {
			setStatus(END);
			if( !mIsContainedInAniSet && mSlide != NULL ) {
				//mSlide->getProjectionSlide()->removeParticleEffect(mParticleEffect);
				mParticleEffect->stop();
				mParticleEffect = NULL;
				mSlide->removeAnimation();
			}
		}
	}
}
Beispiel #12
0
UserConfig::UserConfig(Contact *contact, Group *group)
        : ConfigureDialogBase(NULL, "userconfig", false, WDestructiveClose)
{
    m_contact  = contact;
    m_group    = group;
    m_nUpdates = 0;

    SET_WNDPROC("configure")
    setIcon(Pict(contact ? "info" : "configure"));
    setButtonsPict(this);
    setTitle();
    const QIconSet *iconSet = Icon("webpress");
    if (iconSet)
        btnUpdate->setIconSet(*iconSet);
    btnUpdate->hide();

    lstBox->setHScrollBarMode(QScrollView::AlwaysOff);
    lstBox->setSorting(1);
    lstBox->header()->hide();

    fill();

    connect(lstBox, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(itemSelected(QListViewItem*)));
    connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    connect(btnUpdate, SIGNAL(clicked()), this, SLOT(updateInfo()));

    lstBox->setCurrentItem(lstBox->firstChild());
    itemSelected(lstBox->firstChild());
}
Beispiel #13
0
UserConfig::UserConfig(Contact *contact, Group *group)
        : QDialog( NULL)
{
    this->setAttribute( Qt::WA_DeleteOnClose);
    setupUi( this);
    m_contact  = contact;
    m_group    = group;
    m_nUpdates = 0;

    SET_WNDPROC("configure")
    setIcon(Pict(contact ? "info" : "configure").pixmap());
    setButtonsPict(this);
    setTitle();
    QIcon iconSet = Icon("webpress");
    if (!iconSet.pixmap(QIcon::Small, QIcon::Normal).isNull())
        btnUpdate->setIconSet(iconSet);
    btnUpdate->hide();

    lstBox->setHScrollBarMode(Q3ScrollView::AlwaysOff);
    lstBox->setSorting(1);
    lstBox->header()->hide();

    fill();

    connect(lstBox, SIGNAL(currentChanged(Q3ListViewItem*)), this, SLOT(itemSelected(Q3ListViewItem*)));
    connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    connect(btnUpdate, SIGNAL(clicked()), this, SLOT(updateInfo()));

    lstBox->setCurrentItem(lstBox->firstChild());
    itemSelected(lstBox->firstChild());
}
void UserInfoBox::processResponse(const Response &r)
{
    const Response_GetUserInfo &response = r.GetExtension(Response_GetUserInfo::ext);
    updateInfo(response.user_info());
    setFixedSize(sizeHint());
    show();
}
Beispiel #15
0
App::App() : KUniqueApplication()
    ,m_networkAccessManager(new NetworkAccessManager(this))
    ,m_oauth(new QOAuth::Interface(this))
    ,m_parser(new QJson::Parser)
    ,m_mainWindow(0)
    ,m_controller(0)
    ,m_tray(0)
{
    qmlRegisterType<QDeclarativePropertyMap>();

    m_controller = new Controller;
    m_mainWindow = new MainWindow;
    m_tray = new KStatusNotifierItem(m_mainWindow);
    m_tray->setIconByName("kmoefm");
    m_tray->setTitle(i18n("Moe FM"));
    m_tray->setToolTipIconByName("kmoefm");
    m_tray->setToolTipTitle(i18n("KMoeFM"));
    m_tray->setToolTipSubTitle(i18n("Moe FM"));
    KAction* action;
    action = m_tray->actionCollection()->addAction(QLatin1String("relogin"), this, SLOT(relogin()));
    action->setText(i18n("Relogin"));
    m_tray->contextMenu()->addAction(action);
    m_tray->setAssociatedWidget(m_mainWindow);

    connect(m_controller, SIGNAL(infoChanged()), this, SLOT(updateInfo()));

    m_oauth->setConsumerKey(CONSUMER_KEY);
    m_oauth->setConsumerSecret(CONSUMER_SECRET);

    readSettings();

    connect(this, SIGNAL(checkCredentialFinished(bool)), SLOT(firstRunCheck(bool)));
    QTimer::singleShot(0, this, SLOT(checkCredential()));
}
Beispiel #16
0
HRESULT HostDnsServiceDarwin::init()
{
    SCDynamicStoreContext ctx;
    RT_ZERO(ctx);

    ctx.info = this;

    m->m_store = SCDynamicStoreCreate(NULL, CFSTR("org.virtualbox.VBoxSVC"),
                                   (SCDynamicStoreCallBack)HostDnsServiceDarwin::hostDnsServiceStoreCallback,
                                   &ctx);
    AssertReturn(m->m_store, E_FAIL);

    m->m_DnsWatcher = SCDynamicStoreCreateRunLoopSource(NULL, m->m_store, 0);
    if (!m->m_DnsWatcher)
        return E_OUTOFMEMORY;

    int rc = RTSemEventCreate(&m->m_evtStop);
    AssertRCReturn(rc, E_FAIL);

    CFRunLoopSourceContext sctx;
    RT_ZERO(sctx);
    sctx.perform = HostDnsServiceDarwin::Data::performShutdownCallback;
    m->m_Stopper = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &sctx);
    AssertReturn(m->m_Stopper, E_FAIL);

    HRESULT hrc = HostDnsMonitor::init();
    AssertComRCReturn(hrc, hrc);

    return updateInfo();
}
    void ContactsForVideoConference::updateMemberList()
    {
        if (allMembers_.Members_.size() == 0)
        {
            // Fetch all members first.
            auto model = Logic::getCustomSearchModelDLG(false, true);
            connection_ = connect(model, &QAbstractItemModel::dataChanged, this, &ContactsForVideoConference::allMembersDataChanged);
            model->searchPatternChanged(QString());
        }
        else
        {
            std::shared_ptr<Data::ChatInfo> chatInfo = std::make_shared<Data::ChatInfo>();
            int nCount = 0;
            for (int i = 0; i < allMembers_.Members_.size(); i++)
            {
                Data::ChatMemberInfo memberInfo = allMembers_.Members_[i];

                if (!videoConferenceModel_.isContactInChat(memberInfo.AimId_))
                {
                    chatInfo->Members_.push_back(memberInfo);
                    nCount++;
                }
            }

            chatInfo->MembersCount_ = nCount;

            updateInfo(chatInfo, true);
        }
    }
Beispiel #18
0
void SizeAdapter::updateGui(const ::Atlas::Message::Element& element)
{
	SelfUpdateContext context(*this);
	
	WFMath::AxisBox<3> axisBox;
	try {
		axisBox.fromAtlas(element.asList());
	} catch (...) {
		axisBox = WFMath::AxisBox<3>(WFMath::Point<3>(-0.5, -0.5, -0.5), WFMath::Point<3>(0.5, 0.5, 0.5));
	}
	if (mWidgets.lowerXWindow) {
		mWidgets.lowerXWindow->setText(ValueTypeHelper<float, std::string>::convert(axisBox.lowCorner().x()));
	}
	if (mWidgets.lowerYWindow) {
		mWidgets.lowerYWindow->setText(ValueTypeHelper<float, std::string>::convert(axisBox.lowCorner().y()));
	}
	if (mWidgets.lowerZWindow) {
		mWidgets.lowerZWindow->setText(ValueTypeHelper<float, std::string>::convert(axisBox.lowCorner().z()));
	}
	if (mWidgets.upperXWindow) {
		mWidgets.upperXWindow->setText(ValueTypeHelper<float, std::string>::convert(axisBox.highCorner().x()));
	}
	if (mWidgets.upperYWindow) {
		mWidgets.upperYWindow->setText(ValueTypeHelper<float, std::string>::convert(axisBox.highCorner().y()));
	}
	if (mWidgets.upperZWindow) {
		mWidgets.upperZWindow->setText(ValueTypeHelper<float, std::string>::convert(axisBox.highCorner().z()));
	}

	updateInfo();

}
Beispiel #19
0
bool DccVoiceWindow::event(QEvent *e)
{
    if(e->type() == KVI_THREAD_EVENT)
    {
        switch(((KviThreadEvent *)e)->id())
        {
        case KVI_DCC_THREAD_EVENT_ERROR:
        {
            KviError::Code * pError = ((KviThreadDataEvent<KviError::Code> *)e)->getData();
            QString ssss = KviError::getDescription(*pError);
            output(KVI_OUT_DCCERROR,__tr2qs_ctx("ERROR: %Q","dcc"),&(ssss));
            delete pError;
            m_pUpdateTimer->stop();
            updateInfo();
            m_pTalkButton->setEnabled(false);
            m_pRecordingLabel->setEnabled(false);
            m_pPlayingLabel->setEnabled(false);
            return true;
        }
        break;
        case KVI_DCC_THREAD_EVENT_MESSAGE:
        {
            KviCString * str = ((KviThreadDataEvent<KviCString> *)e)->getData();
            outputNoFmt(KVI_OUT_DCCMSG,__tr_no_xgettext_ctx(str->ptr(),"dcc"));
            delete str;
            return true;
        }
        break;
        case KVI_DCC_THREAD_EVENT_ACTION:
        {
            int * act = ((KviThreadDataEvent<int> *)e)->getData();
            switch(*act)
            {
            case KVI_DCC_VOICE_THREAD_ACTION_START_RECORDING:
                m_pRecordingLabel->setEnabled(true);
                break;
            case KVI_DCC_VOICE_THREAD_ACTION_STOP_RECORDING:
                m_pRecordingLabel->setEnabled(false);
                break;
            case KVI_DCC_VOICE_THREAD_ACTION_START_PLAYING:
                m_pPlayingLabel->setEnabled(true);
                break;
            case KVI_DCC_VOICE_THREAD_ACTION_STOP_PLAYING:
                m_pPlayingLabel->setEnabled(false);
                break;
            }
            delete act;
            return true;
        }
        break;
        default:
            qDebug("Invalid event type %d received",((KviThreadEvent *)e)->id());
            break;
        }

    }

    return KviWindow::event(e);
}
Beispiel #20
0
void Viewport::setPitch(float p)
{
    pitch = p;
    update();
    updateInfo();
    scene->invalidate(QRect(),QGraphicsScene::ForegroundLayer);
    emit(viewChanged());
}
void updateClientInfo(struct info info_ary[], int info_num, struct client* clnt, struct info info){
    int idx;

    idx = getClientInfo(info_ary, info_num, clnt->info.name);
    updateInfo(info_ary, idx, info);
    clnt->info = info;
    saveClientInfo(clnt);
}
Beispiel #22
0
bool SizeAdapter::window_TextChanged(const CEGUI::EventArgs& e)
{
	if (!mSelfUpdate) {
		EventValueChanged.emit();
	}
	updateInfo();
	return true;
}
Beispiel #23
0
void Viewport::setScale(float s)
{
    scale = s;
    update();
    updateInfo();
    scene->invalidate(QRect(), QGraphicsScene::ForegroundLayer);
    emit(viewChanged());
}
Beispiel #24
0
void UIItemNetworkHost::fetchNetworkData(const UIDataNetworkHost &data)
{
    /* Get from cache: */
    m_data = data;

    /* Fetch info: */
    updateInfo();
}
Beispiel #25
0
void item_equipBag::on_btn_pgDn_clicked()
{
	if (CurrentPage < pages)
	{
		++CurrentPage;
		updateInfo();
	}
}
Beispiel #26
0
void item_equipBag::on_btn_pgUp_clicked()
{
	if (CurrentPage > 1)
	{
		--CurrentPage;
		updateInfo();
	}
}
Beispiel #27
0
BugEditDialog::BugEditDialog(Bug *b, QWidget *parent, Qt::WFlags flags)
	: QDialog(parent, flags), bug(b)
{
	ui.setupUi(this);

	connect(bug, SIGNAL(dying()), this, SLOT(close()));
	connect(bug, SIGNAL(dying()), this, SLOT(deleteLater()));

	ui.procPage->setProcessor(&bug->get_processor());
	ui.dnaPage->setBug(bug);

	connect(bug, SIGNAL(changed()), ui.procPage, SLOT(updateInfo()));
	connect(bug, SIGNAL(changed()), ui.dnaPage, SLOT(updateInfo()));

	setAttribute(Qt::WA_QuitOnClose, false);
	setAttribute(Qt::WA_DeleteOnClose, true);
}
Beispiel #28
0
/* Get data to item: */
void UIHostInterfaceItem::fetchNetworkData(const UIHostNetworkData &data)
{
    /* Fetch from cache: */
    m_data = data;

    /* Update tool-tip: */
    updateInfo();
}
Beispiel #29
0
void Viewport::setYaw(float y)
{
    yaw = y;
    update();
    updateInfo();
    scene->invalidate(QRect(),QGraphicsScene::ForegroundLayer);
    emit(viewChanged());
}
Beispiel #30
0
void Viewport::setCenter(QVector3D c)
{
    center = c;
    update();
    updateInfo();
    scene->invalidate(QRect(), QGraphicsScene::ForegroundLayer);
    emit(viewChanged());
}