summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 747b029)
raw | patch | inline | side by side (parent: 747b029)
author | ishmal <ishmal@users.sourceforge.net> | |
Sun, 28 May 2006 23:03:10 +0000 (23:03 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Sun, 28 May 2006 23:03:10 +0000 (23:03 +0000) |
src/pedro/pedrogui.cpp | patch | blob | history | |
src/pedro/pedrogui.h | patch | blob | history | |
src/pedro/pedroxmpp.cpp | patch | blob | history | |
src/pedro/pedroxmpp.h | patch | blob | history |
diff --git a/src/pedro/pedrogui.cpp b/src/pedro/pedrogui.cpp
index d5df2f5d71fb716698f163f1628668d35da02092..eb02c3e5637d1a67971b8bae0353a20b5311d136 100644 (file)
--- a/src/pedro/pedrogui.cpp
+++ b/src/pedro/pedrogui.cpp
table.resize(6, 2);
get_vbox()->pack_start(table);
- parent.client.setHost("gristle.org");
- parent.client.setPort(5223);
+ parent.client.setHost("broadway.dynalias.com");
+ parent.client.setPort(5222);
parent.client.setUsername("");
parent.client.setPassword("");
parent.client.setResource("pedroXmpp");
//# EVENTS
//################################
+/**
+ *
+ */
+void PedroGui::padlockEnable()
+{
+ padlockIcon.set(Gtk::Stock::DIALOG_AUTHENTICATION,
+ Gtk::ICON_SIZE_MENU);
+}
+
+/**
+ *
+ */
+void PedroGui::padlockDisable()
+{
+ padlockIcon.clear();
+}
+
+
/**
*
*/
actionEnable("Disconnect", false);
actionEnable("RegPass", false);
actionEnable("RegCancel", false);
+ padlockDisable();
DOMString title = "Pedro";
set_title(title);
chatDeleteAll();
{
//printf("##### ERROR: %s\n", event.getData().c_str());
error(event.getData().c_str());
+ padlockDisable();
+ break;
+ }
+ case XmppEvent::EVENT_SSL_STARTED:
+ {
+ padlockEnable();
break;
}
case XmppEvent::EVENT_CONNECTED:
}
}
+
+
void PedroGui::chatCallback()
{
ChatDialog dialog(*this);
}
}
+
+
void PedroGui::groupChatCallback()
{
GroupChatDialog dialog(*this);
client.groupChatJoin(groupJid, dialog.getNick(), dialog.getPass() );
}
+
void PedroGui::disconnectCallback()
{
client.disconnect();
}
+
void PedroGui::quitCallback()
{
Gtk::Main::quit();
}
+
void PedroGui::fontCallback()
{
Gtk::FontSelectionDialog dlg;
}
}
+
+
void PedroGui::sendFileCallback()
{
doSendFile("");
}
+
+
void PedroGui::aboutCallback()
{
Gtk::AboutDialog dlg;
dlg.run();
}
+
+
void PedroGui::actionEnable(const DOMString &name, bool val)
{
- DOMString path = "/ui/MenuBar/MenuFile/";
+ DOMString path = "/ui/MenuBar/";
path.append(name);
Glib::RefPtr<Gtk::Action> action = uiManager->get_action(path);
+ if (!action)
+ {
+ path = "/ui/MenuBar/MenuFile/";
+ path.append(name);
+ action = uiManager->get_action(path);
+ }
if (!action)
{
path = "/ui/MenuBar/MenuEdit/";
}
+
+
bool PedroGui::doSetup()
{
- set_title("Inkscape XMPP (Inkboard)");
+ set_title("Pedro XMPP Client");
set_size_request(500, 300);
add(mainBox);
uiManager->add_ui_from_string(ui_info);
Gtk::Widget* pMenuBar = uiManager->get_widget("/MenuBar");
- mainBox.pack_start(*pMenuBar, Gtk::PACK_SHRINK);
+ menuBarBox.pack_start(*pMenuBar, Gtk::PACK_SHRINK);
+
+ padlockDisable();
+ menuBarBox.pack_end(padlockIcon, Gtk::PACK_SHRINK);
+
+ mainBox.pack_start(menuBarBox, Gtk::PACK_SHRINK);
actionEnable("Connect", true);
actionEnable("Chat", false);
diff --git a/src/pedro/pedrogui.h b/src/pedro/pedrogui.h
index a600e6d5011f3ae8e890dac8d50f74c7b81b913d..b4655bec16ee293674fb67650fb799152728c007 100644 (file)
--- a/src/pedro/pedrogui.h
+++ b/src/pedro/pedrogui.h
Gtk::VBox mainBox;
+ Gtk::HBox menuBarBox;
+
+ Gtk::Image padlockIcon;
+ void padlockEnable();
+ void padlockDisable();
+
+
Pango::FontDescription fontDesc;
Gdk::Color foregroundColor;
Gdk::Color backgroundColor;
index 92fa2f9a1a79e923adfa968bd01dd667c08f9f18..1f137850f353a22dbb2212e9f8bea9a62578aa36 100644 (file)
--- a/src/pedro/pedroxmpp.cpp
+++ b/src/pedro/pedroxmpp.cpp
static void hash(unsigned char *dataIn,
unsigned long len, unsigned char *digest);
- static DOMString Md5::hashHex(unsigned char *dataIn, unsigned long len);
+ static DOMString hashHex(unsigned char *dataIn, unsigned long len);
/**
* Initialize the context (also zeroizes contents)
recbuf = readStanza();
status("RECV: '%s'\n", recbuf.c_str());
elem = parser.parse(recbuf);
+
+ XmppEvent event(XmppEvent::EVENT_SSL_STARTED);
+ dispatchXmppEvent(event);
}
//register, if user requests
return false;
}
+ if (sock->getEnableSSL())
+ {
+ XmppEvent event(XmppEvent::EVENT_SSL_STARTED);
+ dispatchXmppEvent(event);
+ }
+
char *fmt =
"<stream:stream "
"to='%s' "
char *fmt =
"<presence from='%s' to='%s/%s' type='unavailable'>"
"<x xmlns='http://jabber.org/protocol/muc'/></presence>\n";
- if (!write(fmt, jid.c_str(), groupJid.c_str(), user.c_str(), xmlPresence.c_str()))
+ if (!write(fmt, jid.c_str(), groupJid.c_str(),
+ user.c_str(), xmlPresence.c_str()))
return true;
return true;
}
diff --git a/src/pedro/pedroxmpp.h b/src/pedro/pedroxmpp.h
index d26b83b765dc77babd677c8b75fcff27fcdf6081..0e07013e6f47f810f8e7f68777edb21eff6b7c76 100644 (file)
--- a/src/pedro/pedroxmpp.h
+++ b/src/pedro/pedroxmpp.h
*/
static const int EVENT_DISCONNECTED = 11;
+ /**
+ * Client has begun speaking to the server in SSL. This is usually
+ * emitted just before EVENT_CONNECTED, since authorization has not
+ * yet taken place.
+ */
+ static const int EVENT_SSL_STARTED = 12;
+
/**
* Client has successfully registered a new account on a server.
* The server is in getFrom(), the user in getTo()
*
*/
virtual std::vector<XmppUser>
- XmppClient::groupChatGetUserList(const DOMString &groupJid);
+ groupChatGetUserList(const DOMString &groupJid);
/**
*