ChatDataWindow::ChatDataWindow(ChatConfigurationWidgetFactoryRepository *chatConfigurationWidgetFactoryRepository, const Chat &chat) : QWidget(0, Qt::Dialog), MyChatConfigurationWidgetFactoryRepository(chatConfigurationWidgetFactoryRepository), ValueStateNotifier(new CompositeConfigurationValueStateNotifier(this)), SimpleStateNotifier(new SimpleConfigurationValueStateNotifier(this)), MyChat(chat), EditWidget(0) { setWindowRole("kadu-chat-data"); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("Chat Properties - %1").arg(MyChat.display())); createGui(); new WindowGeometryManager(new ConfigFileVariantWrapper("General", "ChatDataWindowGeometry"), QRect(0, 50, 425, 500), this); connect(Core::instance()->chatManager(), SIGNAL(chatRemoved(Chat)), this, SLOT(chatRemoved(Chat))); SimpleStateNotifier->setState(StateNotChanged); ValueStateNotifier->addConfigurationValueStateNotifier(SimpleStateNotifier); connect(ValueStateNotifier, SIGNAL(stateChanged(ConfigurationValueState)), this, SLOT(stateChangedSlot(ConfigurationValueState))); stateChangedSlot(ValueStateNotifier->state()); if (MyChatConfigurationWidgetFactoryRepository) { connect(MyChatConfigurationWidgetFactoryRepository, SIGNAL(factoryRegistered(ChatConfigurationWidgetFactory*)), this, SLOT(factoryRegistered(ChatConfigurationWidgetFactory*))); connect(MyChatConfigurationWidgetFactoryRepository, SIGNAL(factoryUnregistered(ChatConfigurationWidgetFactory*)), this, SLOT(factoryUnregistered(ChatConfigurationWidgetFactory*))); foreach (ChatConfigurationWidgetFactory *factory, MyChatConfigurationWidgetFactoryRepository->factories()) factoryRegistered(factory); } }
void GaduEditAccountWidget::createGui() { QVBoxLayout *mainLayout = new QVBoxLayout(this); QTabWidget *tabWidget = new QTabWidget(this); mainLayout->addWidget(tabWidget); createGeneralTab(tabWidget); createPersonalInfoTab(tabWidget); createBuddiesTab(tabWidget); createConnectionTab(tabWidget); createOptionsTab(tabWidget); new AccountConfigurationWidgetTabAdapter(this, tabWidget, this); QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this); ApplyButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogApplyButton), tr("Apply"), this); connect(ApplyButton, SIGNAL(clicked(bool)), this, SLOT(apply())); CancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Cancel"), this); connect(CancelButton, SIGNAL(clicked(bool)), this, SLOT(cancel())); QPushButton *removeAccount = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Delete account"), this); connect(removeAccount, SIGNAL(clicked(bool)), this, SLOT(removeAccount())); buttons->addButton(ApplyButton, QDialogButtonBox::ApplyRole); buttons->addButton(CancelButton, QDialogButtonBox::RejectRole); buttons->addButton(removeAccount, QDialogButtonBox::DestructiveRole); mainLayout->addWidget(buttons); connect(stateNotifier(), SIGNAL(stateChanged(ConfigurationValueState)), this, SLOT(stateChangedSlot(ConfigurationValueState))); }
VideoInterface::VideoInterface(QWidget *parent) : QDialog(parent), ui(new Ui::VideoInterface) { ui->setupUi(this); connect(&vsm, SIGNAL(stateChanged(VideoState)), this, SLOT(stateChangedSlot(VideoState))); connect(this, SIGNAL(eventTrigerSignal(Event)), &vsm, SLOT(eventTriger(Event))); }
void GaduEditAccountWidget::init() { createGui(); loadAccountData(); stateChangedSlot(stateNotifier()->state()); }