当前位置: 首页>>代码示例>>C++>>正文


C++ Profile::Load方法代码示例

本文整理汇总了C++中Profile::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::Load方法的具体用法?C++ Profile::Load怎么用?C++ Profile::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profile的用法示例。


在下文中一共展示了Profile::Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MessageReceived

void BeGadu::MessageReceived( BMessage *aMessage ) {
	switch( aMessage->what ) {
		/* sending mesgs from libgadu to network */
		case GOT_MESSAGE:
		case ADD_HANDLER:
		case DEL_HANDLER:
			BMessenger( iWindow->GetNetwork() ).SendMessage( aMessage );
			break;
		case ADD_MESSENGER:
			DEBUG_TRACE( "BeGadu::MessageReceived( ADD_MESSENGER )\n" );
			aMessage->FindMessenger( "messenger", &iMessenger );
			if( iWindow ) {
				iWindow->SetMessenger( iMessenger );
				BMessenger( iMessenger ).SendMessage( PROFILE_SELECTED );
			}
			break;
		case SET_AVAIL:
		case SET_BRB:
		case SET_INVIS:
		case SET_NOT_AVAIL:
		case SET_DESCRIPTION:
		case BEGG_ABOUT:
		case SHOW_MAIN_WINDOW:
		case CHANGE_DESCRIPTION:
		case PREFERENCES_SWITCH:
			if( iWindow )
				BMessenger( iWindow ).SendMessage( aMessage );
			break;
		case OPEN_PROFILE_WIZARD:
			{
			DEBUG_TRACE( "BeGadu::MessageReceived( OPEN_PROFILE_WIZARD )\n" );
//			if( iProfileSelector )
//				iProfileSelector = NULL;
			if( iWindow ) {
				BMessenger( iWindow ).SendMessage( new BMessage( CLOSE_MAIN_WINDOW ) );
				if( iWindow->Lock() )
					iWindow->Quit();
				iWindow = NULL;
			}
			ProfileWizard *pw = new ProfileWizard();
			pw->Show();
			break;
			}
		case CONFIG_OK:
			{
			DEBUG_TRACE( "BeGadu::MessageReceived( CONFIG_OK )\n" );
			iReadyToRun = true;
			AddDeskbarIcon();
			Profile *profile = new Profile();
			int ret = profile->Load( iLastProfile );
			if( ret != 0 ) {
				delete profile;
				BMessenger( be_app ).SendMessage( new BMessage( PROFILE_SELECT ) );
				break;
			}
			if( strcmp( profile->GetProfilePassword(), "" ) != 0 ) {
				BResources res;
				BRoster roster;
				entry_ref ref;
				BFile resfile;
				roster.FindApp( APP_MIME, &ref );
				resfile.SetTo( &ref, B_READ_ONLY );
				res.SetTo( &resfile );
				BScreen *screen = new BScreen( B_MAIN_SCREEN_ID );
				display_mode mode;
				screen->GetMode( &mode );
//				int32 width = 250;
//				int32 height = 110; // 70
//				int32 x_wind = mode.timing.h_display / 2 - ( width / 2);
//				int32 y_wind = mode.timing.v_display / 2 - ( height / 2 );
//				int32 new_width = x_wind + width;	// x 2
//				int32 new_height = y_wind + height;		// x 2
				BMessenger( iMessenger ).SendMessage( new BMessage( PROFILE_NOT_SELECTED ) );
//				iProfileSelector = new ProfileSelector( iLastProfile, BRect( x_wind, y_wind, new_width, new_height ), &res );
//				if( iProfileSelector->LockLooper() ) {
//					iProfileSelector->Show();
//					iProfileSelector->UnlockLooper();
//				}
			} else {
				BMessenger( iMessenger ).SendMessage( new BMessage( PROFILE_SELECTED ) );
				iWindow = new MainWindow( iLastProfile );
				if( !iHideAtStart ) {
					if( iWindow->LockLooper() ) {
						iWindow->Show();
						iWindow->UnlockLooper();
					}
				} else {
					if( iWindow->LockLooper() ) {
						iWindow->Show();
						iWindow->Hide();
						iWindow->UnlockLooper();
					}
				}
			}
			break;
			}
		case PROFILE_CREATED:
			DEBUG_TRACE( "BeGadu::MessageReceived( PROFILE_CREATED )\n" );
			iReadyToRun = true;
			AddDeskbarIcon();
//.........这里部分代码省略.........
开发者ID:louisdem,项目名称:beos-begadu,代码行数:101,代码来源:BeGadu.cpp


注:本文中的Profile::Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。