Ejemplo n.º 1
0
void YaTabBarBase::updateLayout()
{
	// force re-layout
	QEvent e(QEvent::ActivationChange);
	changeEvent(&e);

	updateSendButton();
}
Ejemplo n.º 2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    updateConnectButton();
    updateSendButton();

    m_connectionTimeout.setInterval(5000);
    m_connectionTimeout.setSingleShot(true);
    connect(&m_connectionTimeout, SIGNAL(timeout()), this, SLOT(onConnectTimeout()));

    ChatInputSendFilter * sendFilter = new ChatInputSendFilter(this);
    connect(sendFilter, SIGNAL(sendPressed()), this, SLOT(on_sendButton_clicked()));
    ui->sayLineEdit->installEventFilter(sendFilter);

    connect(ui->actionSave_chat_as_HTML_page, SIGNAL(triggered(bool)), this, SLOT(onSaveChat()));
}
Ejemplo n.º 3
0
void MainWindow::changeConnectionState(ConnectionState newState)
{
    if(m_connectionState != newState)
    {
        m_connectionState = newState;
        updateConnectButton();
        updateSendButton();

        if(newState == ConnectionState::Connecting)
        {
            m_connectionTimeout.start();
        }
        else
        {
            m_connectionTimeout.stop();

            if(newState == ConnectionState::Disconnected)
            {
                cleanup();
            }
        }
    }
}