phoneterminal.cpp

来自「KDE下的西门子手机管理程序」· C++ 代码 · 共 71 行

CPP
71
字号
/***************************************************************************                          phoneterminal.cpp  -  description                             -------------------    begin                : Fri Jan 19 2001    copyright            : (C) 2001 by Matthias Welwarsky    email                : matze@stud.fbi.fh-darmstadt.de ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include <kdebug.h>#include <qregexp.h>#include <qlineedit.h>#include <qtextview.h>#include "phoneterminal.h"#include "phonectrlcenter.h"#include "messagedispatcher.h"PhoneTerminal::PhoneTerminal(QWidget *parent, const char *name ) : PhoneTerminalDlg(parent,name){	PhoneCtrlCenter* pcCenter = dynamic_cast<PhoneCtrlCenter*>(parentWidget());	if (!pcCenter) {		kdDebug() << "cannot resolve control center\n";		return;	}	messageDispatcher = pcCenter->getDispatcher();	messageDispatcher->registerControl(this, QRegExp(".+"));	kdDebug() << "PhoneTerminal registered\n";	// designer should have done this, but it didn't! BUG!	connect((QObject*)transmitEdit, SIGNAL(returnPressed()), (QObject*)this, SLOT(commandReady()));	connect((QObject*)escButton, SIGNAL(clicked()), (QObject*)this, SLOT(sendEscape()));}PhoneTerminal::~PhoneTerminal(){}/** reimplemented from PhoneControl */void PhoneTerminal::startControl(){}/** reimplemented from PhoneControl */void PhoneTerminal::stopControl(){}/** reimplemented from PhoneControl */void PhoneTerminal::deliverMessage(QString message){	receiveView->append(message);}/** called by the transmitEdit when the enter key is pressed */void PhoneTerminal::commandReady(){	messageDispatcher->sendCommand(transmitEdit->text());}/** sends an escape character to the phone */void PhoneTerminal::sendEscape(){	messageDispatcher->sendPDU(transmitEdit->text());}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?