NotesAgentSettingsDialog::NotesAgentSettingsDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(i18n("Configure Notes Agent")); setWindowIcon(QIcon::fromTheme(QStringLiteral("knotes"))); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, this); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, &QDialogButtonBox::rejected, this, &NotesAgentSettingsDialog::reject); connect(okButton, &QPushButton::clicked, this, &NotesAgentSettingsDialog::slotOkClicked); setModal(true); QWidget *mainWidget = new QWidget(this); QHBoxLayout *lay = new QHBoxLayout(mainWidget); QTabWidget *tab = new QTabWidget; lay->addWidget(tab); mNotify = new KNotifyConfigWidget(this); mNotify->setApplication(QStringLiteral("akonadi_notes_agent")); tab->addTab(mNotify, i18n("Notify")); mNetworkConfig = new NoteShared::NoteNetworkConfigWidget(this); tab->addTab(mNetworkConfig, i18n("Network")); mNetworkConfig->load(); mainLayout->addWidget(mainWidget); mainLayout->addWidget(buttonBox); readConfig(); KAboutData aboutData = KAboutData( QStringLiteral("notesagent"), i18n("Notes Agent"), QStringLiteral(KNOTES_VERSION), i18n("Notes Agent."), KAboutLicense::GPL_V2, i18n("Copyright (C) 2013-2016 Laurent Montel")); aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("*****@*****.**")); QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("knotes"))); aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); KHelpMenu *helpMenu = new KHelpMenu(this, aboutData, true); //Initialize menu QMenu *menu = helpMenu->menu(); helpMenu->action(KHelpMenu::menuAboutApp)->setIcon(QIcon::fromTheme(QStringLiteral("knotes"))); buttonBox->button(QDialogButtonBox::Help)->setMenu(menu); }
KComponentData::KComponentData(const QByteArray &name, const QByteArray &catalog, MainComponentRegistration registerAsMain) : d(new KComponentDataPrivate(KAboutData(name, catalog, KLocalizedString(), "", KLocalizedString()))) { Q_ASSERT(!name.isEmpty()); if (kdeLibraryPathsAdded == NeedLazyInit) { kdeLibraryPathsAdded = LazyInitDone; d->lazyInit(*this); } if (registerAsMain == RegisterAsMainComponent) { KGlobal::newComponentData(*this); } }
SendLaterConfigureDialog::SendLaterConfigureDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(i18n("Configure")); setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail"))); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help); QVBoxLayout *mainLayout = new QVBoxLayout(this); setLayout(mainLayout); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, &QDialogButtonBox::rejected, this, &SendLaterConfigureDialog::reject); mWidget = new SendLaterWidget(this); mWidget->setObjectName(QStringLiteral("sendlaterwidget")); connect(mWidget, &SendLaterWidget::sendNow, this, &SendLaterConfigureDialog::sendNow); mainLayout->addWidget(mWidget); mainLayout->addWidget(buttonBox); connect(okButton, &QPushButton::clicked, this, &SendLaterConfigureDialog::slotSave); readConfig(); KAboutData aboutData = KAboutData( QStringLiteral("sendlateragent"), i18n("Send Later Agent"), QStringLiteral(KDEPIM_VERSION), i18n("Send emails later agent."), KAboutLicense::GPL_V2, i18n("Copyright (C) 2013-2016 Laurent Montel")); aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("*****@*****.**")); QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail"))); aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); KHelpMenu *helpMenu = new KHelpMenu(this, aboutData, true); //Initialize menu QMenu *menu = helpMenu->menu(); helpMenu->action(KHelpMenu::menuAboutApp)->setIcon(QIcon::fromTheme(QStringLiteral("kmail"))); buttonBox->button(QDialogButtonBox::Help)->setMenu(menu); }
KWebKitPart::KWebKitPart(QWidget *parentWidget, QObject *parent, const QByteArray& cachedHistory, const QStringList& /*args*/) :KParts::ReadOnlyPart(parent), m_emitOpenUrlNotify(true), m_hasCachedFormData(false), m_doLoadFinishedActions(false), m_statusBarWalletLabel(0), m_searchBar(0), m_passwordBar(0), m_featurePermissionBar(0) { KAboutData about = KAboutData("kwebkitpart", i18nc("Program Name", "KWebKitPart"), /*version*/ "1.3.0", i18nc("Short Description", "QtWebKit Browser Engine Component"), KAboutLicense::LGPL, i18n("(C) 2009-2010 Dawit Alemayehu\n" "(C) 2008-2010 Urs Wolfer\n" "(C) 2007 Trolltech ASA")); about.addAuthor(i18n("Dawit Alemayehu"), i18n("Maintainer, Developer"), "*****@*****.**"); about.addAuthor(i18n("Urs Wolfer"), i18n("Maintainer, Developer"), "*****@*****.**"); about.addAuthor(i18n("Michael Howell"), i18n("Developer"), "*****@*****.**"); about.addAuthor(i18n("Laurent Montel"), i18n("Developer"), "*****@*****.**"); about.addAuthor(i18n("Dirk Mueller"), i18n("Developer"), "*****@*****.**"); about.setProductName("kwebkitpart/general"); // KComponentData componentData(&about); setComponentData(about, false /*don't load plugins yet*/); // NOTE: If the application does not set its version number, we automatically // set it to KDE's version number so that the default user-agent string contains // proper application version number information. See QWebPage::userAgentForUrl... if (QCoreApplication::applicationVersion().isEmpty()) QCoreApplication::setApplicationVersion(QString("%1.%2.%3") .arg(KDE::versionMajor()) .arg(KDE::versionMinor()) .arg(KDE::versionRelease())); setXMLFile(QL1S("kwebkitpart.rc")); // Create this KPart's widget QWidget *mainWidget = new QWidget (parentWidget); mainWidget->setObjectName("kwebkitpart"); // Create the WebView... m_webView = new WebView (this, parentWidget); // Create the browser extension. m_browserExtension = new WebKitBrowserExtension(this, cachedHistory); // Add status bar extension... m_statusBarExtension = new KParts::StatusBarExtension(this); // Add a web history interface for storing visited links. if (!QWebHistoryInterface::defaultInterface()) QWebHistoryInterface::setDefaultInterface(new WebHistoryInterface(this)); // Add text and html extensions... new KWebKitTextExtension(this); new KWebKitHtmlExtension(this); new KWebKitScriptableExtension(this); // Layout the GUI... QVBoxLayout* l = new QVBoxLayout(mainWidget); l->setContentsMargins(0, 0, 0, 0); l->setSpacing(0); l->addWidget(m_webView); mainWidget->setLayout(l); // Set the part's widget setWidget(mainWidget); // Set the web view as the the focus object mainWidget->setFocusProxy(m_webView); // Connect the signals from the webview connect(m_webView, SIGNAL(titleChanged(QString)), this, SIGNAL(setWindowCaption(QString))); connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SLOT(slotUrlChanged(QUrl))); connect(m_webView, SIGNAL(linkMiddleOrCtrlClicked(QUrl)), this, SLOT(slotLinkMiddleOrCtrlClicked(QUrl))); connect(m_webView, SIGNAL(selectionClipboardUrlPasted(QUrl,QString)), this, SLOT(slotSelectionClipboardUrlPasted(QUrl,QString))); connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool))); // Connect the signals from the page... connectWebPageSignals(page()); // Init the QAction we are going to use... initActions(); // Load plugins once we are fully ready loadPlugins(); }
static inline KAboutData aboutData() { return KAboutData("kwrited", 0, i18n("kwrited"), KWRITED_STRING_VERSION); }