/*! \brief constructor * * initialize layout, attributes, etc. */ XletSwitchBoard::XletSwitchBoard(QWidget *parent) : XLet(parent), m_drawGrid(false), m_trace_box(false), m_group_to_resize(0) { setTitle(tr("Switchboard")); m_layout = new PeersLayout(this); setObjectName("scroller"); // in order for the style settings to be set accordingly setAccessibleName(tr("Switchboard")); setAcceptDrops(true); reloadGroups(); reloadExternalPhones(); connect(b_engine, SIGNAL(userUpdated(UserInfo *)), this, SLOT(updateUser(UserInfo *))); connect(b_engine, SIGNAL(updatePeerAgent(double, const QString &, const QString &, const QVariant &)), this, SLOT(updatePeerAgent(double, const QString &, const QString &, const QVariant &))); // savePositions() needs m_peerhash to be non-empty in order to be useful, // thus we call it before removePeers() connect(b_engine, SIGNAL(delogged()), this, SLOT(savePositions())); connect(b_engine, SIGNAL(delogged()), this, SLOT(removePeers())); setMouseTracking(true); }
SearchPanel::SearchPanel(QWidget *parent) : XLet(parent), m_live_reload_enabled(false) { setTitle(tr("Contacts")); ChitChatWindow::chitchat_instance = new ChitChatWindow(); QVBoxLayout *vlayout = new QVBoxLayout(this); vlayout->setMargin(0); QLabel *lbl = new QLabel(tr("N&ame or number to search :"), this); vlayout->addWidget(lbl, 0, Qt::AlignCenter); m_input = new ExtendedLineEdit(this); lbl->setBuddy(m_input); connect(m_input, SIGNAL(textChanged(const QString &)), this, SLOT(affTextChanged(const QString &))); vlayout->addWidget(m_input); m_scrollarea = new QScrollArea(this); m_scrollarea->setWidgetResizable(true); QWidget *widget = new QWidget(m_scrollarea); widget->setObjectName("scroller"); m_scrollarea->setWidget(widget); QVBoxLayout *scrollarealayout = new QVBoxLayout(widget); m_peerlayout = new QGridLayout; m_peerlayout->setMargin(0); m_peerlayout->setSpacing(SearchPanel::peer_spacing); scrollarealayout->addLayout(m_peerlayout); scrollarealayout->addStretch(10); vlayout->addWidget(m_scrollarea); m_searchpattern = ""; // connect signal/slots connect(b_engine, SIGNAL(updateUserConfig(const QString &)), this, SLOT(updateUserConfig(const QString &))); connect(b_engine, SIGNAL(updateUserStatus(const QString &)), this, SLOT(updateUserStatus(const QString &))); connect(b_engine, SIGNAL(removeUserConfig(const QString &)), this, SLOT(removeUserConfig(const QString &))); connect(b_engine, SIGNAL(updatePhoneConfig(const QString &)), this, SLOT(updatePhoneConfig(const QString &))); connect(b_engine, SIGNAL(updatePhoneStatus(const QString &)), this, SLOT(updatePhoneStatus(const QString &))); connect(b_engine, SIGNAL(removePhoneConfig(const QString &)), this, SLOT(removePhoneConfig(const QString &))); connect(b_engine, SIGNAL(delogged()), this, SLOT(removePeers())); connect(b_engine, SIGNAL(settingsChanged()), this, SLOT(updateDisplay())); connect(b_engine, SIGNAL(initialized()), this, SLOT(initializationComplete())); connect(b_engine, SIGNAL(initializing()), this, SLOT(initializationStarting())); }
Statusbar::Statusbar(MainWindow *parent) : QObject(parent), m_statusbar(parent->ui->statusbar), m_status(new QLabel), m_padlock(new QLabel), m_config_profile(new QLabel), m_pixmap_disconnected(QPixmap(":/images/disconnected.png").scaledToHeight(18, Qt::SmoothTransformation)), m_pixmap_connected(QPixmap(":/images/connected.png").scaledToHeight(18, Qt::SmoothTransformation)) { this->connect(b_engine, SIGNAL(logged()), SLOT(setStatusLogged())); this->connect(b_engine, SIGNAL(delogged()), SLOT(setStatusNotLogged())); this->connect(b_engine, SIGNAL(settingsChanged()), SLOT(confUpdated())); connect(b_engine, SIGNAL(emitTextMessage(const QString &)), this->m_statusbar, SLOT(showMessage(const QString &))); this->connect(parent, SIGNAL(initialized()), SLOT(initialize())); }
XletAgentStatusDashboard::XletAgentStatusDashboard(QWidget *parent) : XLet(parent) { setTitle(tr("Agent status dashboard")); this->m_model = new AgentsModel(this); this->m_widget_builder = new AgentStatusWidgetBuilder; this->m_widget_storage = new AgentStatusWidgetStorage(this->m_widget_builder); this->m_delegate = new AgentStatusDelegate(this->m_widget_storage); // When embedding QMainWindow in a widget, setParent must be called after instantiation. this->m_window = new QMainWindow(); this->m_window->setParent(this); this->m_window->setDockNestingEnabled(true); this->m_window->show(); QVBoxLayout * layout = new QVBoxLayout(this); layout->addWidget(this->m_window); connect(b_engine, SIGNAL(initialized()), this, SLOT(restoreState())); connect(b_engine, SIGNAL(delogged()), this, SLOT(saveState())); connect(b_engine, SIGNAL(updateQueueConfig(const QString &)), this, SLOT(updateQueueConfig(const QString &))); connect(b_engine, SIGNAL(removeQueueConfig(const QString &)), this, SLOT(removeQueueConfig(const QString &))); QTimer * timer_display = new QTimer(this); connect(timer_display, SIGNAL(timeout()), m_model, SLOT(increaseAvailability())); timer_display->start(1000); }