Exemplo n.º 1
0
	void ChatHistoryWidget::on_Calendar__activated (const QDate& date)
	{
		if (CurrentEntry_.isEmpty ())
			return;

		ShowLoading ();

		PreviousSearchText_.clear ();
		Ui_.HistorySearch_->clear ();
		Core::Instance ()->Search (CurrentAccount_, CurrentEntry_, QDateTime (date));
	}
Exemplo n.º 2
0
	void ChatHistoryWidget::handleGotUsersForAccount (const QStringList& users,
			const QString& id, const QStringList& nameCache)
	{
		if (id != Ui_.AccountBox_->itemData (Ui_.AccountBox_->currentIndex ()).toString ())
			return;

		IProxyObject *proxy = Core::Instance ()->GetPluginProxy ();
		ContactsModel_->clear ();

		Ui_.HistView_->clear ();

		QStandardItem *ourFocus = 0;
		const QString& focusId = EntryToFocus_ ?
				EntryToFocus_->GetEntryID () :
				CurrentEntry_;
		EntryToFocus_ = 0;
		for (int i = 0; i < users.size (); ++i)
		{
			const QString& user = users.at (i);
			ICLEntry *entry = qobject_cast<ICLEntry*> (proxy->GetEntry (user, id));
			const QString& name = entry ?
					entry->GetEntryName () :
					(nameCache.value (i).isEmpty () ?
						user :
						nameCache.value (i));

			EntryID2NameCache_ [user] = name;

			QStandardItem *item = new QStandardItem (name);
			item->setData (user, MRIDRole);
			item->setToolTip (name);
			item->setEditable (false);
			ContactsModel_->appendRow (item);

			if (!ourFocus && user == focusId)
				ourFocus = item;
		}

		if (ourFocus)
		{
			ShowLoading ();
			QModelIndex idx = ContactsModel_->indexFromItem (ourFocus);
			idx = SortFilter_->mapFromSource (idx);
			Ui_.Contacts_->selectionModel ()->
					setCurrentIndex (idx, QItemSelectionModel::SelectCurrent);
		}
	}
Exemplo n.º 3
0
	void ChatHistoryWidget::handleContactSelected (const QModelIndex& index)
	{
		CurrentAccount_ = Ui_.AccountBox_->
				itemData (Ui_.AccountBox_->currentIndex ()).toString ();
		CurrentEntry_ = index.data (MRIDRole).toString ();
		if (!ContactSelectedAsGlobSearch_)
		{
			SearchShift_ = 0;
			PreviousSearchText_.clear ();
			Backpages_ = 0;
			SearchResultPosition_ = -1;
		}
		ContactSelectedAsGlobSearch_ = false;

		ShowLoading ();

		RequestLogs ();
		UpdateDates ();
	}
Exemplo n.º 4
0
	void ChatHistoryWidget::on_HistorySearch__returnPressed ()
	{
		ShowLoading ();

		const QString& text = Ui_.HistorySearch_->text ();
		if (text.isEmpty ())
		{
			PreviousSearchText_.clear ();
			Backpages_ = 0;
			SearchResultPosition_ = -1;
			RequestLogs ();
			return;
		}

		if (text == PreviousSearchText_)
			++SearchShift_;
		else
		{
			SearchShift_ = 0;
			PreviousSearchText_ = text;
		}

		RequestSearch ();
	}
Exemplo n.º 5
0
BOOL CProcessMgr::OnRunModel()
{
	//先保存
	//然后上传
	//然后调ICE
	//然后拼参数启动

	//运行所需的变量是否有效
	CCxStructTreeNodeFlow* pRoot = GetTreeRoot();
	if (!pRoot)
	{
		return FALSE;
	}

	//查询是否允许运行
	//if (!GetProcessStateCanRun())
	//{
	//	return FALSE;
	//}
	//查询是否可以保存
	if (!GetProcessStateCanSave())
	{
		return FALSE;
	}

	//如果ticket为空,且单机版安装标志为TRUE时,走单机版逻辑;否则走网络版逻辑
	if ( theApp.m_LoginData.m_strTicket.IsEmpty() )
	{
		if ( theApp.m_bAloneVersionWs )
		{
			ShowLoading();
			if ( !RunAloneVersion( TRUE ) )
			{
				HideLoading();
				return FALSE;
			}
			return TRUE;
		}
		else
		{
			//使用网络引擎,必须要登录才可以运行
			CDlgLoginBk dlgLogin;
			dlgLogin.DoModal();
			if ( theApp.m_LoginData.m_strTicket.IsEmpty() )
			{
				return FALSE;
			}
		}
	}

	if (m_bProcessStarting)
	{
		return FALSE;
	}
	
	ShowLoading();

	if ( !RunInServerVersion( TRUE ) )
	{
		ClearRunVar();
		HideLoading();
		return FALSE;
	}

	return TRUE;	
}
Exemplo n.º 6
0
BOOL CProcessMgr::OnRunSubProcess()
{
	if (!theApp.m_pBarJianmoTree)
	{
		return FALSE;
	}
	CCxStructTreeNode * pNodeCur = theApp.m_pBarJianmoTree->m_wndGridTree.GetCurSelNodeData();
	if ( pNodeCur == NULL ) return FALSE;

	CCxStructTreeNodeFlow * pNode = reinterpret_cast< CCxStructTreeNodeFlow * >(pNodeCur);
	if ( pNode == NULL )
	{
		ZTools::WriteZToolsFormatLog("没有取到当前节点");
		return FALSE;
	}
	if ( pNode->m_pTree == NULL )
	{
		ZTools::WriteZToolsFormatLog("没有取到当前节点的m_pTree");
		return FALSE;
	}
	//pNode->m_pTree->BeforeRunning( pNode );

	CDlgSvg * pSvg = GetSvgDilogPtr();
	if ( pSvg == NULL )
	{
		ZTools::WriteZToolsFormatLog("没有建模页面,无法运行");
		return FALSE;
	}

	if ( theApp.m_pMainWnd == NULL ) return FALSE;
	if ( !IsWindow( theApp.m_pMainWnd->GetSafeHwnd() ) ) return FALSE;
	
	//查询是否允许运行
	if (!CanRunSubProcess())
	{
		return FALSE;
	}
	//查询是否可以保存
	if (!GetSubProcessStateCanSave())
	{
		return FALSE;
	}

	//如果ticket为空,且单机版安装标志为TRUE时,走单机版逻辑;否则走网络版逻辑
	if ( theApp.m_LoginData.m_strTicket.IsEmpty() )
	{
		if ( theApp.m_bAloneVersionWs )
		{
			ShowLoading();
			if ( !RunAloneVersion( FALSE ) )
			{
				HideLoading();
				return FALSE;
			}
			return TRUE;
		}
		else
		{
			//使用网络引擎,必须要登录才可以运行
			CDlgLoginBk dlgLogin;
			dlgLogin.DoModal();
			if ( theApp.m_LoginData.m_strTicket.IsEmpty() )
			{
				return FALSE;
			}
		}
	}

	ShowLoading();

	if ( !RunInServerVersion( FALSE ) )
	{
		HideLoading();
		return FALSE;
	}

	return TRUE;	
}
Exemplo n.º 7
0
void LoadingSprit::onEnter()
{
	CCLayer::onEnter();
	ShowLoading();
}
Exemplo n.º 8
0
int main(int argc,char *argv[])
{
	tikka_status tikka;

	// SDLの初期化
	if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_EVENTTHREAD|SDL_INIT_TIMER)!=0)
	{
		fprintf(stderr,"Unable to init SDL:%s\n",SDL_GetError());
		exit(1);
	}

	// SDLスクリーンの取得
	screen = SDL_SetVideoMode(640,480,16,SDL_SWSURFACE);
	if(screen == NULL)
	{
		fprintf(stderr,"Unable to set 640x480 video:%s\n",SDL_GetError());
		exit(1);
	}

	// フォントライブラリの初期化
	if(TTF_Init() != 0)
	{
		fprintf(stderr,"Unable to init ttf:%s\n",SDL_GetError());
		exit(1);
	}

	// フォントをオープン
	font = TTF_OpenFont("./res/YomogiFont.ttf",24);

	// タイトル画面へ遷移
	NavigateToTitle();
	ShowLoading();
	tikka.position = 1;
	tikka.day = 1;
	tikka.ext = 0;
	tikka.gen = 1;
	tikka.hp = tikka.position*2;

	// セーブデータの読み出し
	tikka = LoadTikka();

	// シーンマネージメント
	int tikka_ret = 1;
	for(;;)
	{
		tikka_ret = NavigateToTikka(&tikka);
		if(tikka_ret==0)
		{
			fprintf(stderr,"Unknown Error.\n");
			break;
		}
		else if(tikka_ret==DAY_END)
		{
			NavigateToDayResult(&tikka);
			tikka.day++;
			tikka.hp = tikka.position*3;
			SaveTikka(&tikka);
		}
		else if(tikka_ret==LIFE_END)
		{
			NavigateToLifeResult(&tikka);
			tikka.position = EGG;
			tikka.hp = tikka.position*3;
		}
		else
		{
			fprintf(stderr,"Unknown Error.\n");
			break;
		}
	}

	// イベントループ
	while(1)
	{
		SDL_WaitEvent(&event);
		switch(event.type)
		{
			case SDL_QUIT:
				if(screen!=NULL)
				SDL_FreeSurface(SDL_GetVideoSurface());
				if(font!=NULL)
				TTF_CloseFont(font);
				TTF_Quit();
				SDL_Quit();
				exit(0);
				break;
		}
	}

	return 0;
}