void AddRoomChatAction::triggered(QWidget *widget, ActionContext *context, bool toggled) { Q_UNUSED(context) Q_UNUSED(toggled) (injectedFactory()->makeInjected<AddRoomChatWindow>(widget))->show(); }
void DefaultProxyAction::populateMenu(QMenu *menu, QActionGroup *actionGroup, NetworkProxy defaultProxy) { auto proxyModel = injectedFactory()->makeInjected<NetworkProxyModel>(); auto proxyProxyModel = new NetworkProxyProxyModel(); proxyProxyModel->setSourceModel(proxyModel); int proxCount = proxyProxyModel->rowCount(); for (int i = 0; i < proxCount; i++) { NetworkProxy networkProxy = proxyProxyModel->data(proxyProxyModel->index(i, 0), NetworkProxyRole).value<NetworkProxy>(); if (networkProxy) { QAction *proxyAction = menu->addAction(networkProxy.displayName()); actionGroup->addAction(proxyAction); proxyAction->setData(QVariant::fromValue(networkProxy)); proxyAction->setCheckable(true); if (defaultProxy == networkProxy) proxyAction->setChecked(true); } } delete proxyProxyModel; delete proxyModel; }
void RecentChatsAction::actionInstanceCreated(Action *action) { auto recentChatsMenu = injectedFactory()->makeOwned<RecentChatsMenu>(action->parentWidget()); connect(recentChatsMenu, SIGNAL(triggered(QAction *)), this, SLOT(openRecentChats(QAction *))); action->setEnabled(false); action->setMenu(recentChatsMenu); connect(recentChatsMenu, SIGNAL(chatsListAvailable(bool)), action, SLOT(setEnabled(bool))); recentChatsMenu->invalidate(); }
void MainConfigurationWindow::showLookChatAdvanced() { if (!lookChatAdvanced) { lookChatAdvanced = injectedFactory()->makeInjected<ConfigurationWindow>( "LookChatAdvanced", tr("Advanced chat's look configuration"), "General", dataManager()); lookChatAdvanced.data()->widget()->appendUiFile( m_pathsProvider->dataPath() + QStringLiteral("configuration/dialog-look-chat-advanced.ui")); } lookChatAdvanced.data()->show(); }
void ChatEditBox::init() { chatEditBoxes.append(this); Context = static_cast<BaseActionContext *>(actionContext()); ChangeNotifierLock lock(Context->changeNotifier()); RoleSet roles; if (CurrentChat.contacts().size() > 1) roles.insert(ChatRole); else roles.insert(BuddyRole); Context->setRoles(roles); Context->setChat(CurrentChat); Context->setContacts(CurrentChat.contacts()); Context->setBuddies(CurrentChat.contacts().toBuddySet()); updateContext(); connect(m_statusConfigurationHolder, SIGNAL(setStatusModeChanged()), this, SLOT(updateContext())); InputBox = injectedFactory()->makeInjected<CustomInput>(CurrentChat, this); InputBox->setWordWrapMode(QTextOption::WordWrap); setCentralWidget(InputBox); bool old_top = loadOldToolBarsFromConfig("chatTopDockArea", Qt::TopToolBarArea); bool old_middle = loadOldToolBarsFromConfig("chatMiddleDockArea", Qt::TopToolBarArea); bool old_bottom = loadOldToolBarsFromConfig("chatBottomDockArea", Qt::BottomToolBarArea); bool old_left = loadOldToolBarsFromConfig("chatLeftDockArea", Qt::LeftToolBarArea); bool old_right = loadOldToolBarsFromConfig("chatRightDockArea", Qt::RightToolBarArea); if (old_top || old_middle || old_bottom || old_left || old_right) writeToolBarsToConfig(); // port old config else loadToolBarsFromConfig(); // load new config // connect(m_chatWidgetActions->colorSelector(), SIGNAL(actionCreated(Action *)), // this, SLOT(colorSelectorActionCreated(Action *))); connect(InputBox, SIGNAL(keyPressed(QKeyEvent *,CustomInput *, bool &)), this, SIGNAL(keyPressed(QKeyEvent *,CustomInput *,bool &))); connect(InputBox, SIGNAL(fontChanged(QFont)), this, SLOT(fontChanged(QFont))); connect(InputBox, SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged())); connect(m_chatConfigurationHolder, SIGNAL(chatConfigurationUpdated()), this, SLOT(configurationUpdated())); configurationUpdated(); }
void ShowOnlyBuddiesWithDescriptionAction::actionInstanceCreated(Action *action) { auto window = qobject_cast<MainWindow *>(action->parentWidget()); if (!window) return; if (!window->talkableProxyModel()) return; auto enabled = !m_configuration->deprecatedApi()->readBoolEntry("General", "ShowWithoutDescription"); auto filter = injectedFactory()->makeInjected<HideWithoutDescriptionTalkableFilter>(action); filter->setEnabled(enabled); action->setData(QVariant::fromValue(filter)); action->setChecked(enabled); window->talkableProxyModel()->addFilter(filter); }
void MainConfigurationWindow::init() { setWindowRole("kadu-configuration"); widget()->appendUiFile(m_pathsProvider->dataPath() + QStringLiteral("configuration/dialog.ui")); #ifndef Q_OS_WIN widget()->widgetById("startup")->hide(); widget()->widgetById("hideMainWindowFromTaskbar")->hide(); #endif #if !defined(Q_OS_UNIX) widget()->widgetById("windowActivationMethod")->hide(); #endif #if defined(Q_OS_UNIX) && !defined(Q_OS_WIN) widget()->widgetById("notify/fullscreenSilentMode")->hide(); #endif #if !defined(Q_OS_UNIX) widget()->widgetById("useTransparency")->hide(); widget()->widgetById("userboxTransparency")->hide(); widget()->widgetById("userboxAlpha")->hide(); widget()->widgetById("userboxBlur")->hide(); #endif onStartupSetLastDescription = static_cast<QCheckBox *>(widget()->widgetById("onStartupSetLastDescription")); disconnectDescription = static_cast<QLineEdit *>(widget()->widgetById("disconnectDescription")); onStartupSetDescription = static_cast<QLineEdit *>(widget()->widgetById("onStartupSetDescription")); Account account = m_accountManager->defaultAccount(); if (!account.isNull() && account.protocolHandler()) { disconnectDescription->setMaxLength(account.statusContainer()->maxDescriptionLength()); onStartupSetDescription->setMaxLength(account.statusContainer()->maxDescriptionLength()); } connect( widget()->widgetById("disconnectWithCurrentDescription"), SIGNAL(activated(int)), this, SLOT(onChangeShutdownStatus(int))); connect(onStartupSetLastDescription, SIGNAL(activated(int)), this, SLOT(onChangeStartupDescription(int))); connect(widget()->widgetById("startupStatus"), SIGNAL(activated(int)), this, SLOT(onChangeStartupStatus(int))); connect(widget()->widgetById("lookChatAdvanced"), SIGNAL(clicked()), this, SLOT(showLookChatAdvanced())); connect(widget()->widgetById("installIconTheme"), SIGNAL(clicked()), this, SLOT(installIconTheme())); Preview *infoPanelSyntaxPreview = static_cast<Preview *>(widget()->widgetById("infoPanelSyntaxPreview")); connect( infoPanelSyntaxPreview, SIGNAL(needFixup(QString &)), m_kaduWindowService->kaduWindow()->infoPanel(), SLOT(styleFixup(QString &))); connect( widget()->widgetById("infoPanelSyntax"), SIGNAL(syntaxChanged(const QString &)), infoPanelSyntaxPreview, SLOT(syntaxChanged(const QString &))); widget()->widgetById("parseStatus")->setToolTip(QCoreApplication::translate("@default", SyntaxText)); (static_cast<ConfigSyntaxEditor *>(widget()->widgetById("infoPanelSyntax"))) ->setSyntaxHint(QCoreApplication::translate("@default", SyntaxText)); userboxTransparency = static_cast<QCheckBox *>(widget()->widgetById("userboxTransparency")); userboxAlpha = static_cast<QSlider *>(widget()->widgetById("userboxAlpha")); userboxBlur = static_cast<QCheckBox *>(widget()->widgetById("userboxBlur")); buddyColors = new BuddyListBackgroundColorsWidget(this); PluginList = injectedFactory()->makeInjected<PluginListWidget>(this); PluginList->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); connect(this, SIGNAL(configurationWindowApplied()), this, SLOT(applied())); connect( m_configurationUiHandlerRepository, SIGNAL(configurationUiHandlerAdded(ConfigurationUiHandler *)), this, SLOT(configurationUiHandlerAdded(ConfigurationUiHandler *))); connect( m_configurationUiHandlerRepository, SIGNAL(configurationUiHandlerRemoved(ConfigurationUiHandler *)), this, SLOT(configurationUiHandlerRemoved(ConfigurationUiHandler *))); triggerCompositingStateChanged(); }