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


C++ MessageDialog类代码示例

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


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

示例1: chans

void MainWindow::checkTextSettings()
{
    QFont consfont;
    if (consfont.fromString(settings.consolefont))
    {
        if (consfont!=consolebrowser->font())
            consolebrowser->setFont(consfont);
    }
    QFont textfont;
    if (textfont.fromString(settings.chatfont))
    {
        QHashIterator<QString, IrcTextBrowser *> chans(channelsJoined);
        while (chans.hasNext())
        {
            chans.next();
            IrcTextBrowser * brwsr = chans.value();
            brwsr->setFont(textfont);
        }

        QHashIterator<QString, MessageDialog *> chats(usersChatting);
        while (chats.hasNext())
        {
            chats.next();
            MessageDialog *msgdlg = chats.value();
            msgdlg->setFont(textfont);
        }
    }
}
开发者ID:reddrop,项目名称:datawolf3-moarstuffandgoats,代码行数:28,代码来源:mainwindow.cpp

示例2: MessageDialog

void Game::handleKeypress(const Common::Event &event) {
	if (event.kbd.flags & Common::KBD_CTRL) {
		if (_widepipeCtr == 8) {
			// Implement original game cheating keys here someday
		} else {
			if (event.kbd.keycode == (Common::KEYCODE_a +
					(DEBUG_STRING[_widepipeCtr] - 'a'))) {
				if (++_widepipeCtr == 8) {
					MessageDialog *dlg = new MessageDialog(_vm, 2,
						"CHEATING ENABLED", "(for your convenience).");
					dlg->show();
					delete dlg;
				}
			}
		}
	}

	switch (event.kbd.keycode) {
	case Common::KEYCODE_F1:
		_vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU;
		break;
	case Common::KEYCODE_F5:
		_vm->_dialogs->_pendingDialog = DIALOG_SAVE;
		break;
	case Common::KEYCODE_F7:
		_vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
		break;
	default:
		break;
	}
}
开发者ID:clone2727,项目名称:scummvm,代码行数:31,代码来源:game.cpp

示例3: Q_ASSERT

void HistoryMessagesTab::clearTalkableHistory()
{
    if (!Storage)
        return;

    Q_ASSERT(TalkableTree->selectionModel());

    const QModelIndexList &selectedIndexes = TalkableTree->selectionModel()->selectedIndexes();
    QList<Talkable> talkables;

    MessageDialog *dialog = MessageDialog::create(
        m_iconsManager->iconByPath(KaduIcon("dialog-question")), tr("Kadu"),
        tr("Do you really want to delete history?"));
    dialog->addButton(QMessageBox::Yes, tr("Delete history"));
    dialog->addButton(QMessageBox::No, tr("Cancel"));

    if (!dialog->ask())
        return;

    for (auto const &selectedIndex : selectedIndexes)
    {
        Talkable talkable = selectedIndex.data(TalkableRole).value<Talkable>();
        if (!talkable.isEmpty())
            Storage->deleteMessages(talkable);
    }

    updateData();
    displayTalkable(Talkable(), true);
}
开发者ID:vogel,项目名称:kadu,代码行数:29,代码来源:history-messages-tab.cpp

示例4: foreach

void GaduEditAccountWidget::showStatusToEveryoneToggled(bool toggled)
{
	if (toggled)
		return;

	int count = 0;

	const QVector<Contact> &contacts = m_contactManager->contacts(account());
	foreach (const Contact &contact, contacts)
		if (!contact.isAnonymous() && contact.ownerBuddy().isOfflineTo())
			count++;

	if (!count)
		return;

	MessageDialog *dialog = MessageDialog::create(m_iconsManager->iconByPath(KaduIcon("dialog-warning")), tr("Status Visibility"),
	                        tr("You are going to reveal your status to several buddies which are currently not allowed to see it.\n"
				  "Are you sure to allow them to know you are available?"));
	dialog->addButton(QMessageBox::Yes, tr("Make my status visible anyway"));
	dialog->addButton(QMessageBox::No, tr("Stay with private status"));
	dialog->setDefaultButton(QMessageBox::No);
	int decision = dialog->exec();

	if (decision == QMessageBox::Yes)
		return;

	ShowStatusToEveryone->setChecked(false);
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例5: MessageDialog

int MessageDialog::show2(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) {
	MessageDialog *dlg = new MessageDialog(message, btn1Message, btn2Message);
	dlg->draw();

	GfxButton *defaultButton = !btn2Message.empty() ? &dlg->_btn2 : &dlg->_btn1;
	GfxButton *selectedButton = dlg->execute(defaultButton);
	int result =  (selectedButton == defaultButton) ? 1 : 0;

	delete dlg;
	return result;
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:11,代码来源:dialogs.cpp

示例6: MessageDialog

void RingworldDemoGame::pauseGame() {
	g_globals->_events.setCursor(CURSOR_ARROW);
	MessageDialog *dlg = new MessageDialog(DEMO_PAUSED_MSG, EXIT_BTN_STRING, DEMO_RESUME_BTN_STRING);
	dlg->draw();

	GfxButton *selectedButton = dlg->execute(&dlg->_btn2);
	bool exitFlag  =  selectedButton != &dlg->_btn2;

	delete dlg;
	g_globals->_events.hideCursor();

	if (exitFlag)
		g_vm->quitGame();
}
开发者ID:CatalystG,项目名称:scummvm,代码行数:14,代码来源:ringworld_demo.cpp

示例7: DeleteFile

int FTPWindow::DeleteFile(FileObject * file) {
	MessageDialog md;

	int res = md.Create(m_hwnd, TEXT("Deleting file"), TEXT("Are you sure you want to delete this file?"));
	if (res != 1)
		return 0;

	res = m_ftpSession->DeleteFile(file->GetPath());
	if (res == -1)
		return -1;

	m_ftpSession->GetDirectory(file->GetParent()->GetPath());

	return 0;
}
开发者ID:Praymundo,项目名称:NppFTP,代码行数:15,代码来源:FTPWindow.cpp

示例8: DeleteDirectory

int FTPWindow::DeleteDirectory(FileObject * dir) {
	MessageDialog md;

	int res = md.Create(m_hwnd, TEXT("Deleting directory"), TEXT("Are you sure you want to delete this directory?"));
	if (res != 1)
		return 0;

	res = m_ftpSession->RmDir(dir->GetPath());
	if (res == -1)
		return -1;

	m_ftpSession->GetDirectory(dir->GetParent()->GetPath());

	return 0;
}
开发者ID:Praymundo,项目名称:NppFTP,代码行数:15,代码来源:FTPWindow.cpp

示例9: clearDescriptionsHistory

void StatusWindow::clearDescriptionsHistory()
{
    MessageDialog *dialog = MessageDialog::create(
        m_iconsManager->iconByPath(KaduIcon("dialog-warning")), tr("Clear Descriptions History"),
        tr("Do you really want to clear the descriptions history?"), this);
    dialog->addButton(QMessageBox::Yes, tr("Clear history"));
    dialog->addButton(QMessageBox::No, tr("Cancel"));

    if (!dialog->ask())
        return;

    m_descriptionManager->clearDescriptions();
    DescriptionSelect->setModel(m_descriptionManager->model());
    DescriptionSelect->setCurrentIndex(-1);
    DescriptionSelect->setEnabled(false);
    ClearDescriptionsHistoryButton->setEnabled(false);
}
开发者ID:vogel,项目名称:kadu,代码行数:17,代码来源:status-window.cpp

示例10: tr

void GaduEditAccountWidget::removeAccount()
{
	MessageDialog *dialog = MessageDialog::create(m_iconsManager->iconByPath(KaduIcon("dialog-warning")), tr("Confrim Account Removal"),
	                        tr("Are you sure do you want to remove account %1 (%2)?")
				.arg(account().accountIdentity().name())
				.arg(account().id()));
	dialog->addButton(QMessageBox::Yes, tr("Remove account"));
	dialog->addButton(QMessageBox::Cancel, tr("Cancel"));
	dialog->setDefaultButton(QMessageBox::Cancel);
	int decision = dialog->exec();

	if (decision == QMessageBox::Yes)
	{
		m_accountManager->removeAccountAndBuddies(account());
		deleteLater();
	}
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例11: chats

MainWindow::~MainWindow()
{
    delete consolebrowser;
    delete smilebar;
    delete smilewidgetaction;
    delete smilebutton;
    delete channellistdialog;
    delete ui;
    QHashIterator<QString, MessageDialog *> chats(usersChatting);
    while(chats.hasNext())
    {
        chats.next();
        MessageDialog *dlg = chats.value();
        dlg->close();
        delete dlg;
    }
    usersChatting.clear();
}
开发者ID:reddrop,项目名称:datawolf3-moarstuffandgoats,代码行数:18,代码来源:mainwindow.cpp

示例12: MessageDialog

void MainWindow::userDoubleClicked(const QString &nick)
{
    if (!usersChatting.contains(nick))
    {
        MessageDialog *msgdlg = new MessageDialog(nick, 0);
        connect(msgdlg, SIGNAL(messageReady(QString,QString)), irc, SLOT(sendMessage(QString,QString)));

        QFont chatfont;
        if (chatfont.fromString(settings.chatfont))
            msgdlg->setFont(chatfont);

        msgdlg->show();
        usersChatting.insert(nick, msgdlg);
    }

    MessageDialog *msgdlg = usersChatting.value(nick);
    if (msgdlg)
        msgdlg->show();
}
开发者ID:reddrop,项目名称:datawolf3-moarstuffandgoats,代码行数:19,代码来源:mainwindow.cpp

示例13: MessageDialog

void Game::handleKeypress(const Common::KeyState &kbd) {
	if (kbd.flags & Common::KBD_CTRL) {
		if (_widepipeCtr == 8) {
			// Implement original game cheating keys here someday
		} else {
			if (kbd.keycode == (Common::KEYCODE_a +
					(DEBUG_STRING[_widepipeCtr] - 'a'))) {
				if (++_widepipeCtr == 8) {
					MessageDialog *dlg = new MessageDialog(_vm, 2,
						"CHEATING ENABLED", "(for your convenience).");
					dlg->show();
					delete dlg;
				}
			}
		}
	}

	Scene &scene = _vm->_game->_scene;
	switch (kbd.keycode) {
	case Common::KEYCODE_F1:
		_vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU;
		break;
	case Common::KEYCODE_F5:
		_vm->_dialogs->_pendingDialog = DIALOG_SAVE;
		break;
	case Common::KEYCODE_F7:
		_vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
		break;
	case Common::KEYCODE_PAGEUP:
		scene._userInterface._scrollbarStrokeType = SCROLLBAR_UP;
		scene._userInterface.changeScrollBar();
		break;
	case Common::KEYCODE_PAGEDOWN:
		scene._userInterface._scrollbarStrokeType = SCROLLBAR_DOWN;
		scene._userInterface.changeScrollBar();
		break;


	default:
		break;
	}
}
开发者ID:heather162,项目名称:scummvm,代码行数:42,代码来源:game.cpp

示例14: kdebugf

void ChatWindow::closeEvent(QCloseEvent *e)
{
	kdebugf();

	if (m_configuration->deprecatedApi()->readBoolEntry("Chat", "ChatCloseTimer"))
	{
		int period = m_configuration->deprecatedApi()->readNumEntry("Chat", "ChatCloseTimerPeriod", 2);

		if (QDateTime::currentDateTime() < m_chatWidget->lastReceivedMessageTime().addSecs(period))
		{
			MessageDialog *dialog = MessageDialog::create(m_iconsManager->iconByPath(KaduIcon("dialog-question")), tr("Kadu"), tr("New message received, close window anyway?"));
			dialog->addButton(QMessageBox::Yes, tr("Close window"));
			dialog->addButton(QMessageBox::No, tr("Cancel"));

			if (!dialog->ask())
			{
				e->ignore();
				return;
			}
		}
	}

 	QWidget::closeEvent(e);
}
开发者ID:,项目名称:,代码行数:24,代码来源:

示例15: BasicServerCommand

MessageDialogTC::MessageDialogTC(MessageDialog &messageDialog, unsigned int dialogId) : BasicServerCommand(SC_MESSAGEDIALOG_TC) {
    addStringToBuffer(messageDialog.getTitle());
    addStringToBuffer(messageDialog.getText());
    addIntToBuffer(dialogId);
}
开发者ID:shcalm,项目名称:Illarion-Server,代码行数:5,代码来源:ServerCommands.cpp


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