ChatMainWindow() : base() { m_messages = new List <string>(); m_ui = new Ui.ChatMainWindow(); m_ui.SetupUi(this); m_ui.sendButton.Enabled = false; Connect(m_ui.messageLineEdit, SIGNAL("textChanged(QString)"), this, SLOT("TextChangedSlot(QString)")); Connect(m_ui.sendButton,SIGNAL("clicked(bool)"),this,SLOT("SendClickedSlot()")); Connect(m_ui.actionChangeNickname,SIGNAL("triggered(bool)"),this,SLOT("ChangeNickname()")); Connect(m_ui.actionAboutQt,SIGNAL("triggered(bool)"),this,SLOT("AboutQt()")); Connect(qApp,SIGNAL("lastWindowClosed()"),this,SLOT("Exiting()")); // add our D-Bus interface and connect to D-Bus new ChatAdaptor(this); QDBusConnection.SessionBus().RegisterObject("/",this); com.trolltech.chat iface; iface = new com.trolltech.chat("","",QDBusConnection.SessionBus(),this); //Connect(iface, SIGNAL("message(QString,QString)"), this, SLOT("messageSlot(QString,QString)")); QDBusConnection.SessionBus().Connect("","","com.trolltech.chat","message",this,SLOT("MessageSlot(QString,QString)")); Connect(iface,SIGNAL("Action(QString,QString)"),this,SLOT("ActionSlot(QString,QString)")); NicknameDialog dialog = new NicknameDialog(); dialog.m_ui.cancelButton.SetVisible(false); dialog.Exec(); m_nickname = dialog.m_ui.nickname.Text.Trim(); Emit.Action(m_nickname,"joins the chat"); }
ChatMainWindow() : base() { m_messages = new List<string>(); m_ui = new Ui.ChatMainWindow(); m_ui.SetupUi(this); m_ui.sendButton.Enabled = false; Connect(m_ui.messageLineEdit, SIGNAL("textChanged(QString)"), this, SLOT("TextChangedSlot(QString)")); Connect(m_ui.sendButton, SIGNAL("clicked(bool)"), this, SLOT("SendClickedSlot()")); Connect(m_ui.actionChangeNickname, SIGNAL("triggered(bool)"), this, SLOT("ChangeNickname()")); Connect(m_ui.actionAboutQt, SIGNAL("triggered(bool)"), this, SLOT("AboutQt()")); Connect(qApp, SIGNAL("lastWindowClosed()"), this, SLOT("Exiting()")); // add our D-Bus interface and connect to D-Bus new ChatAdaptor(this); QDBusConnection.SessionBus().RegisterObject("/", this); com.trolltech.chat iface; iface = new com.trolltech.chat("", "", QDBusConnection.SessionBus(), this); //Connect(iface, SIGNAL("message(QString,QString)"), this, SLOT("messageSlot(QString,QString)")); QDBusConnection.SessionBus().Connect("", "", "com.trolltech.chat", "message", this, SLOT("MessageSlot(QString,QString)")); Connect(iface, SIGNAL("Action(QString,QString)"), this, SLOT("ActionSlot(QString,QString)")); NicknameDialog dialog = new NicknameDialog(); dialog.m_ui.cancelButton.SetVisible(false); dialog.Exec(); m_nickname = dialog.m_ui.nickname.Text.Trim(); Emit.Action(m_nickname, "joins the chat"); }
void ChangeNickname() { NicknameDialog dialog = new NicknameDialog(this); if (dialog.Exec() == (int)QDialog.DialogCode.Accepted) { string old = m_nickname; m_nickname = dialog.m_ui.nickname.Text.Trim(); Emit.Action(old,"is now known as " + m_nickname); } }
void ChangeNickname() { NicknameDialog dialog = new NicknameDialog(this); if (dialog.Exec() == (int) QDialog.DialogCode.Accepted) { string old = m_nickname; m_nickname = dialog.m_ui.nickname.Text.Trim(); Emit.Action(old, "is now known as " + m_nickname); } }