ConferenceWindow::ConferenceWindow(const QString &profile_name,bool webkit_mode)
{
        smiler=false;
	m_profile_name = profile_name;
	m_webkit_mode = webkit_mode;
	setNULLs();
	loadSettings();

	QString window_file_path;
	if ( m_webkit_mode )
	{
		window_file_path = m_chat_form_path + "/webconfwindow.ui";
	}
	else
	{
		window_file_path = m_chat_form_path + "/textconfwindow.ui";
	}

	if (m_chat_form_path.isEmpty() || !QFile::exists(window_file_path) )
		loadDefaultForm();
	else
		loadCustomForm(window_file_path);

	setAttribute(Qt::WA_QuitOnClose, false);
	setAttribute(Qt::WA_DeleteOnClose, true);
	setIcons();
	if ( m_conference_list )
	{
		m_item_delegate = new ContactListItemDelegate();
		m_item_delegate->setTreeView(m_conference_list);
		m_conference_list->setItemDelegate(m_item_delegate);
		m_conference_list->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
		m_conference_list->setSelectionMode(QAbstractItemView::SingleSelection);
		m_conference_list->setSelectionBehavior(QAbstractItemView::SelectItems);
		m_cl_event_eater = new ConfContactListEventEater();
		m_conference_list->findChild<QObject *>("qt_scrollarea_viewport")->installEventFilter(m_cl_event_eater);
		m_conference_list->installEventFilter(m_cl_event_eater);

	}

	if ( m_plain_text_edit)
	{
		m_tab_compl = new ConfTabCompletion(this);
		m_tab_compl->setTextEdit(m_plain_text_edit);
		m_plain_text_edit->installEventFilter(this);
	}
	GeneralWindow::installEventEater();
	GeneralWindow::setFocusPolicy();
	focusTextEdit();
	if ( m_splitter_chat && m_splitter_cl )
	{
		QSettings settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_profile_name, "profilesettings");
		settings.beginGroup("conference");
		m_splitter_chat->restoreState(settings.value("splitter1", QByteArray()).toByteArray());
		m_splitter_cl->restoreState(settings.value("splitter2", QByteArray()).toByteArray());
		settings.endGroup();
	}
	if ( m_send_button ) m_send_button->setEnabled(false);
}
Example #2
0
void SeparateConference::on_clearButton_clicked()
{
  if ( m_text_browser )
  {
    m_text_browser->clear();
    m_message_positions.clear();
  }
  focusTextEdit();
}