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


C++ ShowAlert函数代码示例

本文整理汇总了C++中ShowAlert函数的典型用法代码示例。如果您正苦于以下问题:C++ ShowAlert函数的具体用法?C++ ShowAlert怎么用?C++ ShowAlert使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: modifySyslog_hand

void modifySyslog_hand(struct list *lpublic, struct list *lsystem)
{
  char na[N]={0};  
  char log[10]={0};
  char oper[10]={0};
  int ret = 0;
  
  memset(na,0,N);					 /*清空临时变量*/
  memset(log,0,10);
  memset(oper,0,10);
  cgiFormStringNoNewlines("a_name", na, N);
  cgiFormStringNoNewlines("log_lever",log,10);  
  cgiFormStringNoNewlines("oper_lever",oper,10);  

  ret = mod_user_syslog_by_name(na,log,oper);
  
  if(ret == 1)
  {
	  ShowAlert(search(lpublic,"oper_succ"));
  }
  else 
  {
	  ShowAlert(search(lpublic,"oper_fail"));
  }
}
开发者ID:inibir,项目名称:daemongroup,代码行数:25,代码来源:wp_modsyslog.c

示例2: dhcp_relay_status

void  dhcp_relay_status(struct list *lcontrol,struct list *lpublic,char *addn)
{
	if(checkuser_group(addn)==0)
	{
		char allslotid[10] = {0};
		int allslot_id = 0;
		cgiFormStringNoNewlines("allslot",allslotid,sizeof(allslotid));
		allslot_id = atoi(allslotid);
		char status[20] = {0};
		cgiFormStringNoNewlines("State",status,20);
		unsigned int ifenable = 0;
		int ret = -1;
		/////enable or disable 
		if (strcmp(status,"stop") == 0)
		{
			ifenable = 0;
		}
		else if (strcmp(status,"start") == 0)
		{
			ifenable = 1;
		}
		ret = ccgi_set_relay_enable(ifenable,allslot_id);
		if (ret == 1)
		{
			ShowAlert(search(lpublic,"oper_succ"));
		}
		else
		{
			ShowAlert(search(lpublic,"oper_fail"));
		}	
	}
}
开发者ID:inibir,项目名称:daemongroup,代码行数:32,代码来源:wp_dhcrelay.c

示例3: getSCPath

///Daje użytkownikowi możliwość wprowadzenia ścieżki do sclang
bool getSCPath()
{
	FILE* pathFile=fopen(SC_PATH_FILE, "r");
	if(pathFile!=NULL)
	{
		fgets(sclangPath, MAX_PATH, pathFile);
		if(existsTest(sclangPath))
		{
			return true;
		}
	}
	fclose(pathFile);
	
	ShowAlert(L"SuperCollider Path", L"To launch program you must provide path to sclang in SuperCollider folder.");
	getOpenFile(sclangPath, MAX_PATH);
	
	printf("Selected path: %s\n", sclangPath);
	
	if(existsTest(sclangPath))
	{
		return true;
	}
	else
	{
		ShowAlert(L"SuperCollider Path", L"Patch to sclang is incorrect!");
		return false;
	}
}
开发者ID:rafalcieslak,项目名称:CELLOTRONICUM,代码行数:29,代码来源:main.cpp

示例4: MapShotPath

		void Client::TakeMapShot(){
			
			try{
				std::string name = MapShotPath();
				{
					std::unique_ptr<IStream> stream(FileManager::OpenForWriting(name.c_str()));
					try{
						GameMap *map = GetWorld()->GetMap();
						if(map == nullptr){
							SPRaise("No map loaded");
						}
						map->Save(stream.get());
					}catch(...){
						throw;
					}
				}
				
				std::string msg;
				msg = _Tr("Client", "Map saved: {0}", name);
				ShowAlert(msg, AlertType::Notice);
			}catch(const Exception& ex){
				std::string msg;
				msg = _Tr("Client", "Saving map failed: ");
				msg += ex.GetShortMessage();
				ShowAlert(msg, AlertType::Error);
				SPLog("Saving map failed: %s", ex.what());
			}catch(const std::exception& ex){
				std::string msg;
				msg = _Tr("Client", "Saving map failed: ");
				msg += ex.what();
				ShowAlert(msg, AlertType::Error);
				SPLog("Saving map failed: %s", ex.what());
			}
		}
开发者ID:PlutoniumHeart,项目名称:openspades,代码行数:34,代码来源:Client.cpp

示例5: Config_load_balance

void Config_load_balance(struct list *lpublic,struct list *lcon)
{
  int ret;	
  char *load_balance=(char *)malloc(15);
  memset(load_balance,0,15);
  cgiFormStringNoNewlines("load_balance",load_balance,15);  

  ccgi_dbus_init();
  ret=set_load_balance(load_balance);     /*mode列表:based-port|based-mac|based-ip|based-L4|mac+ip|mac+L4|ip+L4|mac+ip+L4*/
                                          /*返回0表示失败,返回1表示成功,返回-1表示there no trunk exist*/
                                          /*返回-2表示load-balance Mode same to corrent mode*/
										  /*返回-3表示设备不支持这种模式*/	
  switch(ret)
  {
	case 0:ShowAlert(search(lcon,"con_load_balance_fail"));
		   break;
	case 1:ShowAlert(search(lcon,"con_load_balance_succ"));
   	       break;
	case -1:ShowAlert(search(lcon,"no_trunk"));
		    break;
	case -2:ShowAlert(search(lcon,"same_load_balance"));
	   	    break;	
    //kehao add 2011-04-26			
    /////////////////////////////////////////////////////
	case -3:ShowAlert(search(lcon,"device_unsupported_balance_mode"));
	   	    break;
    /////////////////////////////////////////////////////
	
 }   
 free(load_balance);
}
开发者ID:inibir,项目名称:daemongroup,代码行数:31,代码来源:wp_trunkcon.c

示例6: NS_NewURI

nsresult
nsAlertsIconListener::StartRequest(const nsAString & aImageUrl, bool aInPrivateBrowsing)
{
  if (mIconRequest) {
    // Another icon request is already in flight.  Kill it.
    mIconRequest->Cancel(NS_BINDING_ABORTED);
    mIconRequest = nullptr;
  }

  nsCOMPtr<nsIURI> imageUri;
  NS_NewURI(getter_AddRefs(imageUri), aImageUrl);
  if (!imageUri)
    return ShowAlert(nullptr);

  nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1"));
  if (!il)
    return ShowAlert(nullptr);

  // XXX: Hrmm.... Bypass cache, or isolate to imageUrl?
  nsresult rv = il->LoadImageXPCOM(imageUri, imageUri, nullptr,
                                   NS_LITERAL_STRING("default"), nullptr, nullptr,
                                   this, nullptr,
                                   aInPrivateBrowsing ? nsIRequest::LOAD_ANONYMOUS :
                                                        nsIRequest::LOAD_NORMAL,
                                   nullptr, 0 /* use default */,
                                   getter_AddRefs(mIconRequest));
  if (NS_FAILED(rv))
    return rv;

  return NS_OK;
}
开发者ID:Acidburn0zzz,项目名称:tor-browser,代码行数:31,代码来源:nsAlertsIconListener.cpp

示例7: Set_Master_port

void Set_Master_port(int id,struct list *lpublic,struct list *lcon)
{
  int ret;	
  char *port_name=(char *)malloc(10);
  memset(port_name,0,10);
  cgiFormStringNoNewlines("port",port_name,10);  
  if((strcmp(port_name,"")!=0)&&(strchr(port_name,' ')==NULL))			  /*port不能为空*/
  {
	ccgi_dbus_init();
	ret=set_master_port(id,port_name);
	switch(ret)
	{
	  case 0:ShowAlert(search(lcon,"set_master_port_fail"));
			 break;
	  case 1:ShowAlert(search(lcon,"set_master_port_succ"));
   		     break;
	  case -1:ShowAlert(search(lcon,"unknown_portno_format"));
		      break;
	  case -2:ShowAlert(search(lcon,"port_not_exist"));
			  break;			
	  case -3:ShowAlert(search(lcon,"trunk_not_exist"));
			  break;
	  case -4:ShowAlert(search(lcon,"port_is_not_trunk_member"));
			  break;	
	  case -5:ShowAlert(search(lcon,"port_is_l3"));
			  break;	
	  case -6:ShowAlert(search(lpublic,"error"));
			  break;	
   }   
 }
 else
   ShowAlert(search(lcon,"enter_port"));
 free(port_name);
}
开发者ID:inibir,项目名称:daemongroup,代码行数:34,代码来源:wp_trunkcon.c

示例8: modifyprivilege_hand

void modifyprivilege_hand(struct list *lpublic, struct list *lsystem)
{
  char na[N],apri[N];  
  int ret=10;
  int status;
  memset(na,0,N);					 /*清空临时变量*/
  memset(apri,0,N);
  cgiFormStringNoNewlines("a_name", na, N);
  cgiFormStringNoNewlines("privilege",apri,N);  
  char *command = (char *)malloc(PATH_LENG); /*修改权限参数*/
  memset(command, 0, PATH_LENG);
  strcat(command,"userrole.sh");
  strcat(command," ");
  strcat(command,na);
  strcat(command," ");
  strcat(command,apri);

  if(strcmp(na,"")!=0)
  	{
  	  if(checkuser_exist(na)==0)
  	  	{
  	  		if(strcmp(na,"admin")!=0)
  	  		{
		  
/***********************************************************************************/
	    		/*调用修改权限脚本*/
				status = system(command);
				ret = WEXITSTATUS(status);
	    		if(ret == 0)
	    			ShowAlert(search(lpublic,"oper_succ"));
	    		else 
					ShowAlert(search(lpublic,"oper_fail"));

/***********************************************************************************/
  	  		}
			else
			{
					ShowAlert(search(lsystem,"admin_pri"));
			}
	    }
	  else
	  	{
	  	  ShowAlert(search(lsystem,"user_not_exist"));
	  	}
  	}
  else
  	{
  		ShowAlert(search(lpublic,"name_not_null"));
  	}

  	
  free(command);
}
开发者ID:inibir,项目名称:daemongroup,代码行数:53,代码来源:wp_modpri.c

示例9: DeleteV3user

void DeleteV3user(DBusConnection *select_connection,struct list *lpublic,struct list *lsnmpd)
{
	int ret = AC_MANAGE_DBUS_ERROR;
	char V3userName[25] = { 0 };
	int ret_c = 0;
	
	memset(V3userName,0,sizeof(V3userName));
    cgiFormStringNoNewlines("V3userName", V3userName, 25);
	if(strcmp(V3userName,""))
	{
	    ret_c = check_snmp_name(V3userName, 0);
		if((ret_c == -2)||(ret_c == -1)) 
		{
			ShowAlert(search(lsnmpd,"v3user_lenth_illegal"));
			return;
		}
		else if(ret_c == -3)
		{
			ShowAlert(search(lsnmpd,"v3user_illegal1"));
			return;
		}
		else if(ret_c == -4) 
		{
			ShowAlert(search(lsnmpd,"v3user_illegal2"));
			return;
		}
		else if(ret_c == -5)
		{
			ShowAlert(search(lsnmpd,"v3user_illegal3"));
			return;
		}		
	
		ret = ac_manage_config_snmp_del_v3user(select_connection, V3userName);
	    if(AC_MANAGE_SUCCESS == ret) 
		{
			ShowAlert(search(lsnmpd,"delete_v3user_succ"));
	    }
	    else if(AC_MANAGE_SERVICE_ENABLE == ret) 
		{
			ShowAlert(search(lsnmpd,"disable_snmp_service"));
	    }
	    else if(AC_MANAGE_CONFIG_NONEXIST == ret)
		{
			ShowAlert(search(lsnmpd,"v3user_not_exist"));
	    }
	    else if(AC_MANAGE_DBUS_ERROR == ret)
		{
			ShowAlert(search(lsnmpd,"delete_v3user_fail"));
	    }
	    else 
		{
			ShowAlert(search(lsnmpd,"delete_v3user_fail"));
	    }
	}	
}
开发者ID:inibir,项目名称:daemongroup,代码行数:55,代码来源:wp_v3user_list.c

示例10: wxGetApp

void CBOINCBaseFrame::ShowConnectionBadPasswordAlert( bool bUsedDefaultPassword, int iReadGUIRPCAuthFailure ) {
    CSkinAdvanced*      pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
    wxString            strDialogTitle = wxEmptyString;


    wxASSERT(pSkinAdvanced);
    wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));


    wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowConnectionBadPasswordAlert - Function Begin"));

    // %s is the application name
    //    i.e. 'BOINC Manager', 'GridRepublic Manager'
    strDialogTitle.Printf(
        _("%s - Connection Error"),
        pSkinAdvanced->GetApplicationName().c_str()
    );

    if ( bUsedDefaultPassword ) {
#ifdef __WXMSW__
        if ( EACCES == iReadGUIRPCAuthFailure || ENOENT == iReadGUIRPCAuthFailure ) {
            ShowAlert(
                strDialogTitle,
                _("You currently are not authorized to manage the client.\nPlease contact your administrator to add you to the 'boinc_users' local user group."),
                wxOK | wxICON_ERROR
            );
        } else
#endif
        {
            ShowAlert(
                strDialogTitle,
#ifndef __WXMAC__
                _("Authorization failed connecting to running client.\nMake sure you start this program in the same directory as the client."),
#else
                _("Authorization failed connecting to running client."),
#endif
                wxOK | wxICON_ERROR
            );
        }
    } else {
        ShowAlert(
            strDialogTitle,
            _("The password you have provided is incorrect, please try again."),
            wxOK | wxICON_ERROR
        );
    }

    wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowConnectionBadPasswordAlert - Function End"));
}
开发者ID:hanxue,项目名称:Boinc,代码行数:49,代码来源:BOINCBaseFrame.cpp

示例11: main

int main(int argc, char **argv) {
    try {
        std::string memMaxArg = std::string();
        char * varMemMax = getenv("NEXTFRACTAL_MAX_MEMORY");
        int varMemMaxLen = varMemMax != NULL ? strlen(varMemMax) : 0;
        if (varMemMaxLen > 0) {
            memMaxArg.append("-Xmx");
            memMaxArg.append(std::to_string(std::stoi(varMemMax)));
            memMaxArg.append("m");
        } else {
            memMaxArg.append("-Xmx3g");
        }
        std::string basePath = GetBasePath(GetExePath());
        std::cout << "Base path " << basePath << std::endl;
        std::string jarsPath = basePath + "/../Resources";
        std::string classpathArg = "-Djava.class.path=" + GetClasspath(jarsPath);
        std::string libPathArg = "-Djava.library.path=" + basePath + "/../Resources";
        std::string locPathArg = "-Dbrowser.location=" + basePath + "/../../../examples";
        const char *vm_arglist[] = {
            "-Djava.util.logging.config.class=com.nextbreakpoint.nextfractal.runtime.LogConfig",
            classpathArg.c_str(),
            libPathArg.c_str(),
            locPathArg.c_str(),
            memMaxArg.c_str(),
            0
        };
        struct start_args args(vm_arglist, "com/nextbreakpoint/nextfractal/runtime/javafx/NextFractalApp");
        pthread_t thr;
        pthread_create(&thr, NULL, start_java, &args);
        CFRunLoopRun();
    } catch (const std::runtime_error& e) {
        ShowAlert("Did you install Java JDK 8 or later?", e);
    }
}
开发者ID:adriens,项目名称:nextfractal,代码行数:34,代码来源:NextFractal.cpp

示例12: StopFuse

void
CGame::Finish (void)
{
	StopFuse();

	if (mSoundFxExplosion)
		Mix_PlayChannel (-1, mSoundFxExplosion, 0);

	mGameRunning = false;
	mGameFinished = true;
	mGameEndTicks = 0;

	mRemovedEntries.clear();
	for (int x = 0; x < sGridColCount; x++)
		for (int y = 0; y < sGridRowCount; y++)
			mRemovedEntries.push_back ({ x, y });

	StartExplode();

	// wait a fraction of a second to sync the sound better
	SDL_Delay (200);

	SDL_Point newPos = { 400, 200 };
	ShowAlert ("Press N to play again", &newPos);
}
开发者ID:robosolt,项目名称:Gemstone-Miner-Demo,代码行数:25,代码来源:CGame.cpp

示例13: GetCellPosition

void
CGame::Prepare (void)
{
	mScore = 0;

	mGameBoard->Fill();

	mArtifacts.Resize (sGridColCount, sGridRowCount);

	for (int x = 0; x < sGridColCount; x++)
	{
		for (int y = 0; y < sGridRowCount; y++)
		{
			int type = mGameBoard->Get (x,y);
			SDL_Point thePos = GetCellPosition ({ x, y });

			CArtifactPtr artifact = std::make_shared<CArtifact> (mStage, mArtifactTextures[type]);

			artifact->SetPosition (thePos);
			artifact->SetClip (&mClipRect);

			mArtifacts.Set (x, y, artifact);
			mStage->AddDrawable (artifact);
		}
	}

	if (mGameBoard->RemoveCombinations (mRemovedEntries))
		StartExplode();

	StartDropping();

	ShowAlert ("Press N to start");
}
开发者ID:robosolt,项目名称:Gemstone-Miner-Demo,代码行数:33,代码来源:CGame.cpp

示例14: CFStringCreateWithCString

void DialogDriver_Cocoa::Error( CString sError, CString ID )
{
	CFStringRef error = CFStringCreateWithCString( NULL, sError, kCFStringEncodingASCII );
	ShowAlert(kAlertStopAlert, error, CFSTR("OK"));

	CFRelease(error);
}
开发者ID:augustg,项目名称:stepmania-3.9,代码行数:7,代码来源:DialogDriver_Cocoa.cpp

示例15: do_GetService

NS_IMETHODIMP
nsAlertsIconListener::OnStopFrame(imgIRequest* aRequest,
                                  PRUint32 aFrame)
{
  if (aRequest != mIconRequest)
    return NS_ERROR_FAILURE;

  if (mLoadedFrame)
    return NS_OK; // only use one frame

  nsCOMPtr<imgIContainer> image;
  nsresult rv = aRequest->GetImage(getter_AddRefs(image));
  if (NS_FAILED(rv))
    return rv;

  nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
    do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");

  GdkPixbuf* imagePixbuf = imgToPixbuf->ConvertImageToPixbuf(image);
  if (!imagePixbuf)
    return NS_ERROR_FAILURE;

  ShowAlert(imagePixbuf);

  g_object_unref(imagePixbuf);

  mLoadedFrame = true;
  return NS_OK;
}
开发者ID:moussa1,项目名称:mozilla-central,代码行数:29,代码来源:nsAlertsIconListener.cpp


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