diff --git a/CMakeLists.txt b/CMakeLists.txt index 869e69f..503a469 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,136 +1,136 @@ set(PIM_VERSION "5.14.40") cmake_minimum_required(VERSION 3.5) project(knotes VERSION ${PIM_VERSION}) set(RELEASE_SERVICE_VERSION "20.07.40") set(KF5_MIN_VERSION "5.68.0") find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${knotes_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) include(ECMInstallIcons) include(ECMSetupVersion) include(ECMAddTests) include(GenerateExportHeader) include(ECMGenerateHeaders) include(FeatureSummary) include(CheckFunctionExists) include(ECMGeneratePriFile) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMAddAppIcon) include(ECMQtDeclareLoggingCategory) # Do NOT add quote set(KDEPIM_DEV_VERSION alpha) # add an extra space if(DEFINED KDEPIM_DEV_VERSION) set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}") endif() set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})") set(KDEPIM_LIB_VERSION "${PIM_VERSION}") set(KDEPIM_LIB_SOVERSION "5") set(AKONADINOTES_LIB_VERSION "5.14.40") set(AKONADI_VERSION "5.14.40") set(CALENDARUTILS_LIB_VERSION "5.14.40") set(KDEPIM_APPS_LIB_VERSION "5.14.40") -set(KONTACTINTERFACE_LIB_VERSION "5.14.41") +set(KONTACTINTERFACE_LIB_VERSION "5.14.42") set(KPIMTEXTEDIT_LIB_VERSION "5.14.40") set(LIBKDEPIM_LIB_VERSION "5.14.40") set(KMIME_LIB_VERSION "5.14.40") set(PIMCOMMON_LIB_VERSION "5.14.40") set(GRANTLEETHEME_LIB_VERSION "5.14.40") set(QT_REQUIRED_VERSION "5.12.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network PrintSupport Test Widgets Xml) find_package(Qt5X11Extras NO_MODULE) find_package(Grantlee5 "5.2" CONFIG REQUIRED) # Find KF5 package find_package(KF5Completion ${KF5_MIN_VERSION} REQUIRED) find_package(KF5Config ${KF5_MIN_VERSION} REQUIRED) find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} REQUIRED) find_package(KF5CoreAddons ${KF5_MIN_VERSION} REQUIRED) find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED) find_package(KF5DNSSD ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED) find_package(KF5GlobalAccel ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ItemModels ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ItemViews ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5TextWidgets ${KF5_MIN_VERSION} REQUIRED) find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED) find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED) # Find KdepimLibs Package find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED) find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED) find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED) find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED) find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiSearch "5.14.40" CONFIG REQUIRED) set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://kde.org/" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi") if (NOT APPLE) find_package(X11) endif() set(KDEPIM_HAVE_X11 ${X11_FOUND}) set(CMAKE_MODULE_PATH ${knotes_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) find_package(Xsltproc) set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.") include_directories(${knotes_SOURCE_DIR} ${knotes_BINARY_DIR}) if (EXISTS "${CMAKE_SOURCE_DIR}/.git") add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00) endif() add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400) add_definitions(-DQT_NO_FOREACH) set(CMAKE_CXX_STANDARD 14) configure_file(knotes-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/knotes-version.h @ONLY) if(BUILD_TESTING) add_definitions(-DBUILD_TESTING) endif() add_subdirectory(noteshared) add_subdirectory(src) add_subdirectory(notesagent) ecm_qt_install_logging_categories( EXPORT KNOTES FILE knotes.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} ) add_subdirectory(doc) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/kontactplugin/CMakeLists.txt b/src/kontactplugin/CMakeLists.txt index 598a653..addee83 100644 --- a/src/kontactplugin/CMakeLists.txt +++ b/src/kontactplugin/CMakeLists.txt @@ -1,64 +1,66 @@ ########### next target ############### set(kontact_knotesplugin_PART_SRCS knotes_plugin.cpp knotes_part.cpp summarywidget.cpp knotesiconview.cpp knoteslistwidgetsearchline.cpp knoteswidget.cpp knoteseditdialog.cpp knotesselectdeletenotesdialog.cpp ) qt5_add_dbus_adaptor(kontact_knotesplugin_PART_SRCS org.kde.kontact.KNotes.xml knotes_part.h KNotesPart) qt5_add_dbus_interfaces(kontact_knotesplugin_interface_SRCS org.kde.kontact.KNotes.xml) ecm_qt_declare_logging_category(kontact_knotesplugin_PART_SRCS HEADER knotes_kontact_plugin_debug.h IDENTIFIER KNOTES_KONTACT_PLUGIN_LOG CATEGORY_NAME org.kde.pim.knoteskontactplugin DESCRIPTION "knotes (knotes kontact plugin)" OLD_CATEGORY_NAMES log_knoteskontactplugin EXPORT KNOTES ) add_library(kontact_knotesplugin MODULE ${kontact_knotesplugin_PART_SRCS} ${kontact_knotesplugin_interface_SRCS} ) target_link_libraries(kontact_knotesplugin knotesprivate KF5::CalendarCore KF5::CalendarUtils KF5::KontactInterface - KF5::Libkdepim + KF5::Libkdepim notesharedprivate KF5::DNSSD KF5::Mime KF5::KCMUtils KF5::AkonadiWidgets KF5::AkonadiNotes KF5::ItemViews - KF5::Contacts + KF5::Contacts ) +kcoreaddons_desktop_to_json(kontact_knotesplugin knotesplugin.desktop) + ########### install files ############### set(kcm_knotessummary_PART_SRCS kcmknotessummary.cpp ) add_library(kcm_knotessummary MODULE ${kcm_knotessummary_PART_SRCS}) target_link_libraries(kcm_knotessummary KF5::PimCommonAkonadi KF5::AkonadiNotes KF5::ConfigWidgets KF5::I18n) install(TARGETS kcm_knotessummary DESTINATION ${KDE_INSTALL_PLUGINDIR}) install(FILES kcmknotessummary.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) -install(TARGETS kontact_knotesplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}) +install(TARGETS kontact_knotesplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/kontact5) install(FILES knotes_part.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/knotes) install(FILES knotesplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/kontact) install(FILES org.kde.kontact.KNotes.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}) install(FILES knotes.setdlg DESTINATION ${KDE_INSTALL_DATADIR}/kontact/ksettingsdialog) diff --git a/src/kontactplugin/knotes_plugin.cpp b/src/kontactplugin/knotes_plugin.cpp index 867c23c..ef75ad0 100644 --- a/src/kontactplugin/knotes_plugin.cpp +++ b/src/kontactplugin/knotes_plugin.cpp @@ -1,232 +1,232 @@ /* This file is part of Kontact Copyright (c) 2002 Daniel Molkentin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "knotes_plugin.h" #include "knotes_part.h" #include "apps/knotes_options.h" #include "utils/knoteutils.h" #include "summarywidget.h" #include "knotesglobalconfig.h" #include #include #include #include "knotes-version.h" #include using namespace KPIM; using namespace KCalUtils; using namespace KCalendarCore; #include #include #include #include #include "knotes_kontact_plugin_debug.h" #include #include #include #include #include #include -EXPORT_KONTACT_PLUGIN(KNotesPlugin, knotes) +EXPORT_KONTACT_PLUGIN_WITH_JSON(KNotesPlugin, "knotesplugin.json") KNotesPlugin::KNotesPlugin(KontactInterface::Core *core, const QVariantList &) : KontactInterface::Plugin(core, core, "knotes") { setComponentName(QStringLiteral("knotes"), i18n("KNotes")); QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("knotes")), i18nc("@action:inmenu", "New Popup Note..."), this); actionCollection()->addAction(QStringLiteral("new_note"), action); connect(action, &QAction::triggered, this, &KNotesPlugin::slotNewNote); actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_N)); //action->setHelpText( // i18nc( "@info:status", "Create new popup note" ) ); action->setWhatsThis( i18nc("@info:whatsthis", "You will be presented with a dialog where you can create a new popup note.")); insertNewAction(action); mUniqueAppWatcher = new KontactInterface::UniqueAppWatcher( new KontactInterface::UniqueAppHandlerFactory(), this); } KNotesPlugin::~KNotesPlugin() { } bool KNotesPlugin::isRunningStandalone() const { return mUniqueAppWatcher->isRunningStandalone(); } KParts::Part *KNotesPlugin::createPart() { return new KNotesPart(this); } KontactInterface::Summary *KNotesPlugin::createSummaryWidget(QWidget *parentWidget) { return new KNotesSummaryWidget(this, parentWidget); } const KAboutData KNotesPlugin::aboutData() { KAboutData aboutData = KAboutData(QStringLiteral("knotes"), xi18nc("@title", "KNotes"), QStringLiteral(KNOTES_VERSION), xi18nc("@title", "Popup Notes"), KAboutLicense::GPL_V2, xi18nc("@info:credit", "Copyright © 2003–2020 Kontact authors")); aboutData.addAuthor(xi18nc("@info:credit", "Laurent Montel"), xi18nc("@info:credit", "Current Maintainer"), QStringLiteral("montel@kde.org")); aboutData.addAuthor(xi18nc("@info:credit", "Michael Brade"), xi18nc("@info:credit", "Previous Maintainer"), QStringLiteral("brade@kde.org")); aboutData.addAuthor(xi18nc("@info:credit", "Tobias Koenig"), xi18nc("@info:credit", "Developer"), QStringLiteral("tokoe@kde.org")); return aboutData; } bool KNotesPlugin::canDecodeMimeData(const QMimeData *mimeData) const { return mimeData->hasText() || MailList::canDecode(mimeData) || KContacts::VCardDrag::canDecode(mimeData) || ICalDrag::canDecode(mimeData); } void KNotesPlugin::processDropEvent(QDropEvent *event) { const QMimeData *md = event->mimeData(); if (KContacts::VCardDrag::canDecode(md)) { KContacts::Addressee::List contacts; KContacts::VCardDrag::fromMimeData(md, contacts); KContacts::Addressee::List::ConstIterator it; QStringList attendees; KContacts::Addressee::List::ConstIterator end(contacts.constEnd()); for (it = contacts.constBegin(); it != end; ++it) { const QString email = (*it).fullEmail(); if (email.isEmpty()) { attendees.append((*it).realName() + QLatin1String("<>")); } else { attendees.append(email); } } event->accept(); static_cast(part())->newNote( i18nc("@item", "Meeting"), attendees.join(QLatin1String(", "))); return; } if (KCalUtils::ICalDrag::canDecode(md)) { KCalendarCore::MemoryCalendar::Ptr cal(new KCalendarCore::MemoryCalendar(QTimeZone::systemTimeZone())); if (KCalUtils::ICalDrag::fromMimeData(md, cal)) { KCalendarCore::Incidence::List incidences = cal->incidences(); Q_ASSERT(incidences.count()); if (!incidences.isEmpty()) { event->accept(); KCalendarCore::Incidence::Ptr i = incidences.first(); QString summary; if (i->type() == KCalendarCore::Incidence::TypeJournal) { summary = i18nc("@item", "Note: %1", i->summary()); } else { summary = i->summary(); } static_cast(part())-> newNote(i18nc("@item", "Note: %1", summary), i->description()); return; } } } if (md->hasText()) { static_cast(part())->newNote( i18nc("@item", "New Note"), md->text()); return; } if (MailList::canDecode(md)) { MailList mails = MailList::fromMimeData(md); event->accept(); if (mails.count() != 1) { KMessageBox::sorry( core(), i18nc("@info", "Dropping multiple mails is not supported.")); } else { MailSummary mail = mails.constFirst(); const QString txt = i18nc("@item", "From: %1\nTo: %2\nSubject: %3", mail.from(), mail.to(), mail.subject()); static_cast(part())->newNote( i18nc("@item", "Mail: %1", mail.subject()), txt); } return; } qCWarning(KNOTES_KONTACT_PLUGIN_LOG) << QStringLiteral("Cannot handle drop events of type '%1'.").arg(event->mimeData()->formats().join(QLatin1Char(';'))); } void KNotesPlugin::shortcutChanged() { if (part()) { static_cast(part())->updateClickMessage(); } } // private slots void KNotesPlugin::slotNewNote() { if (part()) { static_cast(part())->newNote(); core()->selectPlugin(this); } } void KNotesUniqueAppHandler::loadCommandLineOptions(QCommandLineParser *parser) { knotesOptions(parser); } int KNotesUniqueAppHandler::activate(const QStringList &args, const QString &workingDir) { qCDebug(KNOTES_KONTACT_PLUGIN_LOG); // Ensure part is loaded (void)plugin()->part(); return KontactInterface::UniqueAppHandler::activate(args, workingDir); } #include "knotes_plugin.moc" diff --git a/src/kontactplugin/knotesplugin.desktop b/src/kontactplugin/knotesplugin.desktop index 93613fb..ff5f01f 100644 --- a/src/kontactplugin/knotesplugin.desktop +++ b/src/kontactplugin/knotesplugin.desktop @@ -1,136 +1,136 @@ [Desktop Entry] Type=Service Icon=view-pim-notes X-KDE-ServiceTypes=Kontact/Plugin,KPluginInfo -X-KDE-Library=kontact_knotesplugin +X-KDE-Library=kontact5/kontact_knotesplugin X-KDE-KontactPluginVersion=10 X-KDE-KontactPluginHasSummary=true X-KDE-KontactPartExecutableName=knotes X-KDE-PluginInfo-Website=https://userbase.kde.org/KNotes X-KDE-PluginInfo-Name=kontact_knotesplugin X-KDE-PluginInfo-Version=0.1 X-KDE-PluginInfo-License=LGPL X-KDE-PluginInfo-EnabledByDefault=true X-KDE-PluginInfo-AllowEmptySettings=true Comment=Kontact KNotes Plugin Comment[af]=Kontact KNotes inprop module Comment[ar]=ملحقة «ملاحظاتك» لِ‍«متراسلك» Comment[be]=Утулка Kontact KNotes Comment[bg]=Приставка за бележки Comment[br]=Lugent Kontact KNotes Comment[bs]=Kontakt KNotes dodatak Comment[ca]=Connector del KNotes pel Kontact Comment[ca@valencia]=Connector del KNotes pel Kontact Comment[cs]=Modul KNotes pro aplikaci Kontact Comment[cy]=Ategyn KNotes Kontact Comment[da]=Kontact KNotes-plugin Comment[de]=KNotes-Modul für Kontact Comment[el]=Πρόσθετο KNotes του Kontact Comment[en_GB]=Kontact KNotes Plugin Comment[eo]=Kontact-KNotes-kromaĵo Comment[es]=Complemento de KNotes para Kontact Comment[et]=Kontacti KNotesi plugin Comment[eu]=Kontact-en KNotes plugin-a Comment[fa]=وصله Kontact KNotes Comment[fi]=Kontactin KNotes-liitännäinen Comment[fr]=Module KNotes pour Kontact Comment[fy]=Kontact KNotes-plugin Comment[ga]=Breiseán KNotes le haghaidh Kontact Comment[gl]=Complemento de KNotes para Kontact Comment[hu]=Kontact KNotes-bővítőmodul Comment[ia]=Plug-in de Kontact KNotes Comment[is]=Kontact KNotes íforrit Comment[it]=Estensione per Kontact di KNotes Comment[ja]=Kontact KNotes プラグイン Comment[ka]=Kontact KNotes მოდული Comment[kk]=Kontact-тың KNotes плагині Comment[km]=កម្មវិធី​ជំនួយ KNotes ក្នុង Kontact Comment[ko]=Kontact KNotes 플러그인 Comment[lt]=Kontact KNotes papildinys Comment[lv]=Kontact KNotes spraudnis Comment[mk]=Приклучок за КБелешки во Контакт Comment[mr]=कॉन्टेक्ट के-नोट्स प्लगइन Comment[ms]=Plugin KNotes Kontact KNotes Comment[nb]=Kontact programtillegg for KNotes Comment[nds]=KNotes-Moduul för Kontact Comment[ne]=केडीई टिपोट प्लगइन सम्पर्क गर्नुहोस् Comment[nl]=Kontact KNotes-plug-in Comment[nn]=Kontakt-programtillegg for KNotes Comment[pl]=Wtyczka Kontact do współpracy z KNotatkami Comment[pt]='Plugin' do KNotes para o Kontact Comment[pt_BR]=Plugin do KNotes para o Kontact Comment[ro]=Modul KNotes pentru Kontact Comment[ru]=Заметки Comment[se]=Kontact, KNotes-lassemoduvla Comment[sk]=Kontact KNotes Plugin Comment[sl]=Vstavek KNotes za Kontact Comment[sr]=Прикључак Контакта за К‑белешке Comment[sr@ijekavian]=Прикључак Контакта за К‑биљешке Comment[sr@ijekavianlatin]=Priključak Kontacta za K‑bilješke Comment[sr@latin]=Priključak Kontacta za K‑beleške Comment[sv]=Kontacts insticksprogram för Knotes Comment[ta]= கேகுறிப்புகளை சொருகுப்பொருளை தொடர்புகொள் Comment[tg]=Модули Kontact барои дастрасӣ ба ахборот Comment[tr]=Kontact KNotes Eklentisi Comment[uk]=Додаток приміток (KNotes) Kontact Comment[uz]=Kontact uchun KNotes plagini Comment[uz@cyrillic]=Kontact учун KNotes плагини Comment[wa]=Module KNotes di Kontact Comment[x-test]=xxKontact KNotes Pluginxx Comment[zh_CN]=Kontact KNotes 插件 Comment[zh_TW]=Kontact KNotes 外掛程式 Name=Popup Notes Name[ar]=ملاحظات منبثقة Name[bs]=Iskočne napomene Name[ca]=Notes emergents Name[ca@valencia]=Notes emergents Name[cs]=Vyskakovací poznámky Name[da]=Pop op-noter Name[de]=Haftnotizen Name[el]=Αναδυόμενες σημειώσεις Name[en_GB]=Popup Notes Name[eo]=Glunotoj Name[es]=Notas emergentes Name[et]=Sedelid Name[fi]=Ponnahdusviestit Name[fr]=Notes Name[ga]=Preabnótaí Name[gl]=Notas emerxentes Name[hu]=Jegyzetlapok Name[ia]=Notas de popup Name[it]=Note a comparsa Name[ja]=ポップアップメモ Name[kk]=Қалқымалы жазбалар Name[km]=ចំណាំ​លេច​ឡើង Name[ko]=팝업 노트 Name[lt]=Lipnūs lapeliai Name[lv]=Piezīmju lapiņas Name[mr]=पॉपअप नोंदी Name[nb]=Sprettopp-notater Name[nds]=Opduk-Notizen Name[nl]=Popup notities Name[nn]=Sprettoppnotat Name[pa]=ਪੋਪਅੱਪ ਨੋਟਿਸ Name[pl]=Żółte karteczki Name[pt]=Notas Name[pt_BR]=Notas instantâneas Name[ro]=Notițe Name[ru]=Заметки Name[sk]=Vyskakujúce poznámky Name[sl]=Pojavna sporočilca Name[sr]=Искачуће белешке Name[sr@ijekavian]=Искачуће биљешке Name[sr@ijekavianlatin]=Iskačuće bilješke Name[sr@latin]=Iskačuće beleške Name[sv]=Anteckningslappar Name[th]=บันทึกย่อแบบป๊อปอับ Name[tr]=Seyyar Notlar Name[ug]=سەكرىمە ئىزاھلار Name[uk]=Записник Name[wa]=Aspitantès notes Name[x-test]=xxPopup Notesxx Name[zh_CN]=弹出便笺 Name[zh_TW]=彈出式便條