示例#1
0
int LsnBase::analysAndDealSys(char * shelldir, char * proName)
{
	char strsms[1024];
	memset(strsms,0,1024);
	char strEn[512];
	memset(strEn,0,512);
	char proNameTmp[256];
	memset(proNameTmp,0,256);
	char phoneTmp[256];
	memset(phoneTmp, 0, 256);
	char shelldirTmp[128];
	memset(shelldirTmp,0,128);
	char strtime[50];
	memset(strtime,0,50);
	char *ptime = strtime;
	int ishell = 1;
	
	if(NULL == shelldir && NULL == proName)
	{
		trace_log(SYS, "shelldir or proName is NULL");
		return 1;
	}

	ptime = getDtStr(&ptime);
	strcpy(proNameTmp, proName);
	
	char * p = proNameTmp;
	char *p1 = NULL;
    while(NULL != (p1 = strsep(&p, ",")))
	{
		memset(shelldirTmp,0,128);
        sprintf(shelldirTmp,"%s %s",shelldir, p1);
		ishell = dealSystem(shelldirTmp);
		trace_log(SYS, "shelldirTmp:%s shell return:%d.",shelldirTmp, ishell);
		if(2 == ishell)
		{
			memset(phoneTmp, 0, 256);
			strcpy(phoneTmp, g_Cfg.cfgProp.phoneNum);
			char *pPhone = phoneTmp;
			//trace_log(DBG, "phone number:%s.",g_Cfg.cfgProp.phoneNum);
			char *p2 = NULL;
    		while(NULL != (p2 = strsep(&pPhone, ",")))
    		{
				memset(strsms,0,1024);
				memset(strEn,0,512);
				sprintf(strsms,"%s%s%s%s%s%s%s%s", g_Cfg.cfgProp.smsprefix,p2,g_Cfg.cfgProp.smsdesc,g_Cfg.cfgProp.prjname,": ",p1,"进程异常. ",ptime);
				sprintf(strEn,"%s%s%s%s%s%s%s%s", g_Cfg.cfgProp.routeNum,p2,g_Cfg.cfgProp.prjname,": ",p1,"进程异常. ",ptime,g_Cfg.cfgProp.orgName);
				trace_log(SYS, "strsms:%s", strsms);
				trace_log(SYS, "strEn:%s", strEn);
				sendSms(strsms, strEn);
				//trace_log(SYS, "phone%s.",tokenphone);
				//tokenphone= strtok(NULL,",");
			}
		}
    }

	return ishell;
}
示例#2
0
void SmsDialog::editReturnPressed()
{
	kdebugf();

	if (ContentEdit->toPlainText().isEmpty())
		ContentEdit->setFocus();
	else
		sendSms();

	kdebugf2();
}
示例#3
0
int smshttp::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: logIn(); break;
        case 1: showHelp(); break;
        case 2: sendSms(); break;
        case 3: updateChars(); break;
        case 4: showNumber((*reinterpret_cast< int(*)>(_a[1]))); break;
        }
        _id -= 5;
    }
    return _id;
}
QString SmppClient::sendSms(const QString &recepient, const QString &sender, const QString &smsText)
{
    QString messageId = createNewMessageId();
    sendSms(messageId, recepient, sender, smsText);
    return messageId;
}
示例#5
0
ChatWindow::ChatWindow(Account* account, ChatSession* s, EmoticonSelector* emoticonSelector, MultSelector* multSelector)
	: QWidget(),
	  m_account(account), session(s), messageEditor(0), smsEditor(0), flashPlayer(0)
{
	qDebug() << Q_FUNC_INFO << "{";

	transferStatus = None;

	QVBoxLayout* layout = new QVBoxLayout;
	layout->setContentsMargins(0, 0, 0, 0);

	isNewMessage = false;

	connect(s->contact(), SIGNAL(renamed(QString)), this, SLOT(contactUpdated()));
	connect(s->contact(), SIGNAL(ignoredChanged()), this, SLOT(contactIgnored()));

	timer = new QTimer(this);
	timer->setSingleShot(true);
	connect(timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));

	QHBoxLayout* mainLayout = new QHBoxLayout;
	splitter = new QSplitter(Qt::Vertical, this);

	QWidget* chatWidget = new QWidget;
	QHBoxLayout* chatWidgetLayout = new QHBoxLayout;
	chatWidgetLayout->setContentsMargins(1, 1, 1, 1);
	chatWidgetLayout->setSpacing(1);

	QToolBar* topToolbar = new QToolBar;
	QAction* games = new QAction(QIcon(), "", this);
	games->setCheckable(true);
	connect(games, SIGNAL(triggered(bool)), this, SLOT(showGameMenu(bool)));

	topToolbar->addAction(games);

	layout->addWidget(topToolbar);

	chatView = new AnimatedTextBrowser;
	chatWidgetLayout->addWidget(chatView);
	connect(chatView, SIGNAL(anchorClicked(QUrl)), this, SLOT(slotAnchorClicked(QUrl)));
	if (!s->contact()->isPhone() && !session->contact()->isConference())
	{
		AvatarBoxWithHandle* avatarBoxWithHandle = new AvatarBoxWithHandle(m_account->avatarsPath(), session->contact()->email());

		avatarBoxWithHandle->toggle(m_account->settings()->value("ChatWindow/TopAvatarBoxState", false).toBool());

		connect(avatarBoxWithHandle, SIGNAL(toggled(bool)), SLOT(saveTopAvatarBoxState(bool)));
		chatWidgetLayout->addWidget(avatarBoxWithHandle);
	}
	chatWidget->setLayout(chatWidgetLayout);
	splitter->addWidget(chatWidget);

	if (!s->contact()->isPhone())
	{
		QWidget* bottomWidget = new QWidget;
		QHBoxLayout* bottomWidgetLayout = new QHBoxLayout;
		bottomWidgetLayout->setContentsMargins(1, 1, 1, 1);
		bottomWidgetLayout->setSpacing(1);

		editorsWidget = new QTabWidget;
		editorsWidget->setStyleSheet("QTabWidget::pane { border: 0px; } QTabWidget::tab-bar { left: 1px; } QTabBar::tab { padding: 0px 32px 0px 32px; font: bold 9px; }");
		editorsWidget->setTabPosition(QTabWidget::South);
		editorsWidget->setTabShape(QTabWidget::Triangular);

		messageEditor = new MessageEditor(m_account, session->contact(), emoticonSelector, multSelector);
		connect(messageEditor, SIGNAL(sendPressed()), this, SLOT(sendMessage()));
		connect(messageEditor, SIGNAL(textChanged()), session, SLOT(sendTyping()));
		connect(messageEditor, SIGNAL(wakeupPressed()), this, SLOT(wakeupContact()));
		connect(messageEditor, SIGNAL(showMult(const QString&)), this, SLOT(sendMult(const QString&)));
		connect(this, SIGNAL(messageEditorActivate()), messageEditor, SLOT(messageEditorActivate()));

		connect(messageEditor, SIGNAL(setIgnore(bool)), this, SIGNAL(setIgnore(bool)));
		connect(this, SIGNAL(ignoreSet(bool)), messageEditor, SLOT(slotIgnoreSet(bool)));

		connect(messageEditor, SIGNAL(setSignalCheckSpelling(bool)), this, SIGNAL(setSignalCheckSpelling(bool)));
		connect(this, SIGNAL(signalCheckSpellingSet(bool)), messageEditor, SLOT(setCheckSpelling(bool)));

		fileMessageOut = new FileMessage(FileMessage::Outgoing, this);
		fileMessageIn = new FileMessage(FileMessage::Incoming, this);
		fileMessageIn->setAccEmail(account->email());
		fileMessageIn->setContEmail(session->contact()->email());
		fileMessageOut->setAccEmail(account->email());
		fileMessageOut->setContEmail(session->contact()->email());

		connect(fileMessageOut, SIGNAL(fileTransferred(FileMessage::Status, QString, QString)), this, SLOT(slotFileTransferred(FileMessage::Status, QString, QString)));
		connect(fileMessageOut, SIGNAL(progress(FileMessage::Status, int)), messageEditor, SLOT(slotProgress(FileMessage::Status, int)));
		connect(fileMessageIn, SIGNAL(startTransferring(quint32)), this, SLOT(transferStarted(quint32)));
		connect(fileMessageIn, SIGNAL(fileTransferred(FileMessage::Status, QString, QString)), this, SLOT(slotFileTransferred(FileMessage::Status, QString, QString)));
		connect(fileMessageIn, SIGNAL(progress(FileMessage::Status, int)), messageEditor, SLOT(slotProgress(FileMessage::Status, int)));
		connect(m_account->client(), SIGNAL(fileTransferAck(quint32, QByteArray, quint32, QByteArray)), fileMessageOut, SLOT(slotFileTransferStatus(quint32, QByteArray, quint32, QByteArray)));
		connect(m_account->client(), SIGNAL(proxyAck(quint32, QByteArray, quint32, quint32, QByteArray, QByteArray, quint32, quint32, quint32, quint32)), fileMessageOut, SLOT(slotProxyAck(quint32, QByteArray, quint32, quint32, QByteArray, QByteArray, quint32, quint32, quint32, quint32)));
		connect(m_account->client(), SIGNAL(fileTransferAck(quint32, QByteArray, quint32, QByteArray)), fileMessageIn, SLOT(slotFileTransferStatus(quint32, QByteArray, quint32, QByteArray)));
		connect(m_account->client(), SIGNAL(proxy(QByteArray, quint32, quint32, QByteArray, QByteArray, quint32, quint32, quint32, quint32)), fileMessageIn, SLOT(slotProxy(QByteArray, quint32, quint32, QByteArray, QByteArray, quint32, quint32, quint32, quint32)));

		connect(messageEditor, SIGNAL(transferringCancel()), this, SLOT(transferringCancelled()));

		editorsWidget->addTab(messageEditor, tr("Text"));
		if (!session->contact()->isConference())
		{
			smsEditor = new SmsEditor(m_account, session->contact());
			connect(smsEditor, SIGNAL(sendPressed()), this, SLOT(sendSms()));

			editorsWidget->addTab(smsEditor, tr("SMS"));

			connect(editorsWidget, SIGNAL(currentChanged(int)), this, SLOT(slotEditorActivate(int)));
		}