summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 479d056)
raw | patch | inline | side by side (parent: 479d056)
author | daleharvey <daleharvey@users.sourceforge.net> | |
Sat, 8 Jul 2006 15:53:34 +0000 (15:53 +0000) | ||
committer | daleharvey <daleharvey@users.sourceforge.net> | |
Sat, 8 Jul 2006 15:53:34 +0000 (15:53 +0000) |
src/jabber_whiteboard/pedrogui.cpp | patch | blob | history | |
src/jabber_whiteboard/pedrogui.h | patch | blob | history |
index 4b4bccbaa53489ffd93d5c3f6e6cdab57e04f414..6aff31ccaf335d39948a6dc7d21f4b747db4f844 100644 (file)
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "pedrogui.h"
+#include "jabber_whiteboard/pedrogui.h"
+#include "jabber_whiteboard/session-manager.h"
+
#include <stdarg.h>
parent->doSendFile(nick);
}
+void Roster::shareCallback()
+{
+ Glib::RefPtr<Gtk::TreeModel> model = rosterView.get_model();
+ Glib::RefPtr<Gtk::TreeSelection> sel = rosterView.get_selection();
+ Gtk::TreeModel::iterator iter = sel->get_selected();
+ DOMString nick = iter->get_value(rosterColumns.userColumn);
+ //printf("share to:%s\n", nick.c_str());
+ if (parent)
+ parent->doShare(nick);
+}
+
bool Roster::buttonPressCallback(GdkEventButton* event)
{
if( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) )
actionGroup->add( Gtk::Action::create("SendFile",
Gtk::Stock::CONNECT, "Send file"),
sigc::mem_fun(*this, &Roster::sendFileCallback) );
+ actionGroup->add( Gtk::Action::create("Share",
+ Gtk::Stock::CONNECT, "Share whiteboard"),
+ sigc::mem_fun(*this, &Roster::shareCallback) );
uiManager = Gtk::UIManager::create();
" <popup name='PopupMenu'>"
" <menuitem action='Chat'/>"
" <menuitem action='SendFile'/>"
+ " <menuitem action='Share'/>"
" </popup>"
"</ui>";
parent->doSendFile(nick);
}
+void UserList::shareCallback()
+{
+ Glib::RefPtr<Gtk::TreeModel> model = userList.get_model();
+ Glib::RefPtr<Gtk::TreeSelection> sel = userList.get_selection();
+ Gtk::TreeModel::iterator iter = sel->get_selected();
+ DOMString nick = iter->get_value(userListColumns.userColumn);
+ //printf("Send file to:%s\n", nick.c_str());
+ if (parent)
+ parent->doShare(nick);
+}
+
bool UserList::buttonPressCallback(GdkEventButton* event)
{
if( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) )
actionGroup->add( Gtk::Action::create("SendFile",
Gtk::Stock::CONNECT, "Send file"),
sigc::mem_fun(*this, &UserList::sendFileCallback) );
+ actionGroup->add( Gtk::Action::create("Share",
+ Gtk::Stock::CONNECT, "Share whiteboard"),
+ sigc::mem_fun(*this, &UserList::shareCallback) );
uiManager = Gtk::UIManager::create();
" <popup name='PopupMenu'>"
" <menuitem action='Chat'/>"
" <menuitem action='SendFile'/>"
+ " <menuitem action='Share'/>"
" </popup>"
"</ui>";
parent.chatDelete(jid);
}
+void ChatWindow::shareCallback()
+{
+// hide();
+ parent.doShare(this->jid);
+}
void ChatWindow::textEnterCallback()
{
actionGroup->add( Gtk::Action::create("MenuFile", "_File") );
actionGroup->add( Gtk::Action::create("Leave", Gtk::Stock::CANCEL),
sigc::mem_fun(*this, &ChatWindow::leaveCallback) );
+ actionGroup->add( Gtk::Action::create("Share", Gtk::Stock::CONNECT,
+ "Share whiteboard"), sigc::mem_fun(*this, &ChatWindow::shareCallback) );
Glib::RefPtr<Gtk::UIManager> uiManager = Gtk::UIManager::create();
" <menubar name='MenuBar'>"
" <menu action='MenuFile'>"
" <menuitem action='Leave'/>"
+ " <menuitem action='Share'/>"
" </menu>"
" </menubar>"
"</ui>";
inputTxt.set_text("");
}
+void GroupChatWindow::shareCallback()
+{
+ parent.doGroupShare(groupJid);
+}
+
bool GroupChatWindow::doSetup()
{
DOMString title = "Group Chat - ";
actionGroup->add( Gtk::Action::create("MenuFile", "_File") );
actionGroup->add( Gtk::Action::create("Leave", Gtk::Stock::CANCEL),
sigc::mem_fun(*this, &GroupChatWindow::leaveCallback) );
+ actionGroup->add( Gtk::Action::create("Share", Gtk::Stock::CONNECT, "Share whiteboard"),
+ sigc::mem_fun(*this, &GroupChatWindow::shareCallback) );
Glib::RefPtr<Gtk::UIManager> uiManager = Gtk::UIManager::create();
"<ui>"
" <menubar name='MenuBar'>"
" <menu action='MenuFile'>"
- " <menuitem action='Leave'/>"
+ " <menuitem action='Leave'/>"
+ " <menuitem action='Share'/>"
" </menu>"
" </menubar>"
"</ui>";
}
+void GroupChatWindow::doShare(const DOMString &nick)
+{
+ printf("##Share inkboard with %s\n", nick.c_str());
+ DOMString fullJid = groupJid;
+ fullJid.append("/");
+ fullJid.append(nick);
+ parent.doShare(fullJid);
+}
//#########################################################################
}
+void PedroGui::doShare(const DOMString &jid)
+{
+ Inkscape::Whiteboard::SessionManager& sm = Inkscape::Whiteboard::SessionManager::instance();
+ sm.doShare(jid, Inkscape::Whiteboard::INKBOARD_PRIVATE);
+
+// Inkscape::Whiteboard::SessionManager::instance().createInkboardDesktop(jid, Inkscape::Whiteboard::INKBOARD_PRIVATE);
+}
+
+void PedroGui::doGroupShare(const DOMString &groupJid)
+{
+ Inkscape::Whiteboard::SessionManager& sm = Inkscape::Whiteboard::SessionManager::instance();
+ sm.doShare(groupJid, Inkscape::Whiteboard::INKBOARD_MUC);
+
+// Inkscape::Whiteboard::SessionManager::instance().createInkboardDesktop(groupJid, Inkscape::Whiteboard::INKBOARD_MUC);
+}
//##################
//# CALLBACKS
index 2758c81d1ffb565a00cb16da6e643acee8ce5486..b223d72635cd6468e9946ea4de84a8d5655fc068 100644 (file)
void sendFileCallback();
void chatCallback();
+ void shareCallback();
bool buttonPressCallback(GdkEventButton* event);
bool doSetup();
void sendFileCallback();
void chatCallback();
+ void shareCallback();
bool buttonPressCallback(GdkEventButton* event);
bool doSetup();
void leaveCallback();
void hideCallback();
+ void shareCallback();
void textEnterCallback();
bool doSetup();
virtual void doSendFile(const DOMString &nick);
virtual void doChat(const DOMString &nick);
+ virtual void doShare(const DOMString &nick);
private:
void textEnterCallback();
void leaveCallback();
void hideCallback();
+ void shareCallback();
bool doSetup();
long size,
const DOMString &hash);
+ void doShare(const DOMString &jid);
+ void doGroupShare(const DOMString &groupJid);
//# File menu
void connectCallback();