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


C++ DirectoryPrx::removeTerminal方法代码示例

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


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

示例1: menuTriggered


//.........这里部分代码省略.........
					statusbar->showMessage(message, 5000);
				}

				ic->destroy();

			} catch (TerminalExistsException ex) {
				QMessageBox::critical( this, this->windowTitle(),
						"User already registered, change your alias!");
				return;
			}  catch (...) {
				QMessageBox::critical( this, this->windowTitle(),
						"Connection to directory failed, please check your configuration!");
				return;
			}
		}

	} else if (operation == "Log out") {

		if (!isRegistered) {
			QMessageBox::critical( this, this->windowTitle(),
					"User not registered");
			return;
		}

		// Get directory reference
		QString errorMessage = this->configuration->validateDirectory().c_str();

		if (errorMessage.count() > 0) {
			QMessageBox::critical( this, this->windowTitle(),
					errorMessage);

		} else {
			// search for directory
			try {
				Ice::CommunicatorPtr ic = Ice::initialize();
				stringstream a;
				a << *(configuration->directoryName)
				<< ":default -h " << *(configuration->directoryAddress)
				<< " -p " << *(configuration->directoryPort);
				Ice::ObjectPrx base = ic->stringToProxy ( a.str() );
				DirectoryPrx directory = DirectoryPrx::checkedCast ( base );

				if ( !directory ) {
					QMessageBox::critical( this, this->windowTitle(),
							"Connection to directory failed, please check your configuration!");
				} else {
					directory->removeTerminal(registeredAddress->name);

					QString message("Terminal ");
					message += registeredAddress->name.c_str();
					message += " successfully unregistered.";
					statusbar->showMessage(message, 5000);

					delete registeredAddress;
					isRegistered = false;
				}

				ic->destroy();

			} catch (NoSuchTerminalException ex) {
				QMessageBox::critical( this, this->windowTitle(),
						"Such user does not exists in directory!");
			}  catch (...) {
				QMessageBox::critical( this, this->windowTitle(),
						"Connection to directory failed, please check your configuration!");
				return;
			}
		}
	} else if (operation == "About") {
		QString about;
		QDate curDate = QDate::currentDate();
		about += "AGHPhone VoIP application\n";
		about += "\n\nVersion 0.9.0.2b from ";
		about += curDate.toString();
		about += "\n\nCopyright (C) 2008  Mateusz Kramarczyk <[email protected]>\n";
		about += "Copyright (C) 2008  Tomasz Kijas <[email protected]>\n";
		about += "Copyright (C) 2008  Tomir Kryza <[email protected]>\n";
		about += "Copyright (C) 2008  Maciej Kluczny <[email protected]>\n";
		about += "Copyright (C) 2008  AGH University of Science and Technology <www.agh.edu.pl>\n";
		QMessageBox::about(this, "About AGHPhone", about);
	} else if (operation == "About Qt") {
		QMessageBox::aboutQt(this, "About Qt");
	} else if (operation == "License") {
		QString msg;
		msg += "This program is free software: you can redistribute it and/or modify\n";
		msg += "it under the terms of the GNU General Public License as published by\n";
		msg += "the Free Software Foundation, either version 3 of the License, or\n";
		msg += "(at your option) any later version.\n";
		msg += "\n";
		msg += "This program is distributed in the hope that it will be useful,\n";
		msg += "but WITHOUT ANY WARRANTY; without even the implied warranty of\n";
		msg += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n";
		msg += "GNU General Public License for more details.\n";
		msg += "\n";
		msg += "You should have received a copy of the GNU General Public License\n";
		msg += "along with this program.  If not, see <http://www.gnu.org/licenses/>.\n";

		QMessageBox::about(this, "AGHPhone license regulations", msg);
	}
}
开发者ID:fffaraz,项目名称:Multimedia,代码行数:101,代码来源:aghphonedialog.cpp


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