whiteboard-connect.cpp revision 4852f347df5405e934e2ccd5b30597d196f3949c
/**
* Whiteboard connection establishment dialog
*
* Authors:
* David Yip <yipdw@rose-hulman.edu>
* Jason Segal, Jonas Collaros, Stephen Montgomery, Brandi Soggs, Matthew Weinstock (original C/Gtk version)
*
* Copyright (c) 2004-2005 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gtk/gtkdialog.h>
#include <gtkmm/checkbutton.h>
#include "inkscape.h"
#include "desktop.h"
#include "message-stack.h"
#include "preferences.h"
#include "jabber_whiteboard/session-manager.h"
#include "message-context.h"
#include "ui/dialog/whiteboard-connect.h"
#include "util/ucompose.hpp"
namespace Inkscape {
namespace UI {
namespace Dialog {
{
return new WhiteboardConnectDialogImpl();
}
{
this->setSessionManager();
this->_construct();
//this->set_resize_mode(Gtk::RESIZE_IMMEDIATE);
this->set_resizable(false);
this->get_vbox()->show_all_children();
}
{
}
void WhiteboardConnectDialogImpl::present()
{
}
void
{
this->_desktop = this->getDesktop();
}
void
{
// Construct dialog interface
/// @todo Convert port to an integer preference?
this->_password.set_visibility(false);
// Buttons
this->_ok.signal_clicked().connect(sigc::bind< 0 >(sigc::mem_fun(*this, &WhiteboardConnectDialogImpl::_respCallback), GTK_RESPONSE_OK));
this->_cancel.signal_clicked().connect(sigc::bind< 0 >(sigc::mem_fun(*this, &WhiteboardConnectDialogImpl::_respCallback), GTK_RESPONSE_CANCEL));
this->_register.signal_clicked().connect(sigc::mem_fun(*this, &WhiteboardConnectDialogImpl::_registerCallback));
this->_usessl.signal_clicked().connect(sigc::mem_fun(*this, &WhiteboardConnectDialogImpl::_useSSLClickedCallback));
// Pack widgets into main vbox
}
void
{
if (this->_register.get_active())
{
bool usessl;
Glib::ustring msg = String::ucompose(_("Establishing connection to Jabber server <b>%1</b>"), server);
{
{
Glib::ustring LabelText = entries[i].replace(zero,one,one,Glib::Unicode::toupper(entries[i].at(0)));
this->_layout.attach (*label, 0, 1, i+3, i+4, Gtk::FILL|Gtk::EXPAND|Gtk::SHRINK, (Gtk::AttachOptions)0,0,0);
this->_layout.attach (*entry, 1, 4, i+3, i+4, Gtk::FILL|Gtk::EXPAND|Gtk::SHRINK, (Gtk::AttachOptions)0,0,0);
}
}else{
Glib::ustring msg = String::ucompose(_("Failed to establish connection to Jabber server <b>%1</b>"), server);
}
}else{
for(unsigned i = 0; i<registerlabels.size();i++)
{
delete registerlabels[i];
delete registerentries[i];
}
}
this->get_vbox()->show_all_children();
//this->reshow_with_initial_size();
}
void
{
if (resp == GTK_RESPONSE_OK)
{
bool usessl;
Glib::ustring msg = String::ucompose(_("Establishing connection to Jabber server <b>%1</b> as user <b>%2</b>"), server, username);
if (!this->_register.get_active())
{
case FAILED_TO_CONNECT:
break;
case INVALID_AUTH:
msg = String::ucompose(_("Authentication failed on Jabber server <b>%1</b> as <b>%2</b>"), server, username);
break;
case SSL_INITIALIZATION_ERROR:
msg = String::ucompose(_("SSL initialization failed when connecting to Jabber server <b>%1</b>"), server);
break;
case CONNECT_SUCCESS:
// Save preferences
break;
default:
break;
}
}else{
for(unsigned i = 0; i<registerlabels.size();i++)
{
}
{
case FAILED_TO_CONNECT:
break;
case INVALID_AUTH:
msg = String::ucompose(_("Registration failed on Jabber server <b>%1</b> as <b>%2</b>"), server, username);
break;
case SSL_INITIALIZATION_ERROR:
msg = String::ucompose(_("SSL initialization failed when connecting to Jabber server <b>%1</b>"), server);
break;
case CONNECT_SUCCESS:
// Save preferences
break;
default:
break;
}
}
}
this->hide();
}
void
{
if (this->_usessl.get_active()) {
// String::ucompose seems to format numbers according to locale; unfortunately,
// I'm not yet sure how to turn that off
//this->_port.set_text(String::ucompose("%1", LM_CONNECTION_DEFAULT_PORT_SSL));
} else {
}
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :