示例#1
0
文件: preview.cpp 项目: leewood/kadu
void Preview::syntaxChanged(const QString &content)
{
	QString syntax = content;
	QString text = Parser::parse(syntax, Talkable(Buddy::dummy()), ParserEscape::HtmlEscape);
	emit needFixup(text);

	WebView->setHtml(text);
}
示例#2
0
void Preview::syntaxChanged(const QString &content)
{
	QString syntax = content;
	QString text = m_parser->parse(syntax, Talkable(m_buddyDummyFactory->dummy()), ParserEscape::HtmlEscape);
	emit needFixup(text);

	m_webView->setHtml(text);
}
示例#3
0
void HistoryMessagesTab::updateData()
{
    if (!Storage)
    {
        setTalkables(QVector<Talkable>());
        displayTalkable(Talkable(), false);
        return;
    }

    setFutureTalkables(Storage->talkables());
}
示例#4
0
void SmsDialog::recipientNumberChanged(const QString &number)
{
	QString gatewayId = m_mobileNumberManager->gatewayId(RecipientEdit->text());
	ProviderComboBox->setCurrentIndex(ProviderComboBox->findData(gatewayId));

	if (-1 == ProviderComboBox->currentIndex())
		ProviderComboBox->setCurrentIndex(0);

	if (number.isEmpty())
	{
		RecipientComboBox->setCurrentTalkable(Talkable());
		return;
	}

	foreach (const Buddy &buddy, m_buddyManager->items())
		if (buddy.mobile() == number)
		{
			RecipientComboBox->setCurrentTalkable(buddy);
			return;
		}
}
示例#5
0
void StatusWindow::applyStatus()
{
    disconnect(DescriptionSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(descriptionSelected(int)));

    QString description = DescriptionEdit->toPlainText();
    m_descriptionManager->addDescription(description);

    if (m_configuration->deprecatedApi()->readBoolEntry("General", "ParseStatus", false))
        description = m_parser->parse(description, Talkable(m_myself->buddy()), ParserEscape::NoEscape);

    for (auto &&container : Container->subStatusContainers())
    {
        Status status = m_statusSetter->manuallySetStatus(container);
        status.setDescription(description);

        StatusType statusType = static_cast<StatusType>(StatusSelect->itemData(StatusSelect->currentIndex()).toInt());
        if (statusType != StatusType::None)
            status.setType(statusType);

        m_statusSetter->setStatusManually(container, status);
        container->storeStatus(status);
    }
}
示例#6
0
	MessageDialog *dialog = MessageDialog::create(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;

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

	updateData();
	displayTalkable(Talkable(), true);
}

void HistoryMessagesTab::showTimelinePopupMenu()
{
	if (TimelineView->currentDate().isValid())
		TimelinePopupMenu->exec(QCursor::pos());
}

void HistoryMessagesTab::removeEntries()
{
	QDate date = TimelineView->currentDate();
	if (!Storage || !date.isValid())
		return;

	Storage->deleteMessages(CurrentTalkable, date);