Commit f01f7517 authored by Albert Astals Cid's avatar Albert Astals Cid

Use a KCMultiDialog instead of calling kcmshell directly

Reviewed by Aleix
parent d42a65e6
find_package(KF5Notifications REQUIRED)
find_package(KF5KCMUtils REQUIRED)
add_executable(kdeconnect-indicator main.cpp deviceindicator.cpp)
target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications kdeconnectinterfaces)
target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::KCMUtils kdeconnectinterfaces)
install(TARGETS kdeconnect-indicator ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -32,6 +32,7 @@
#endif
#include <KAboutData>
#include <KCMultiDialog>
#include <KLocalizedString>
#include "interfaces/devicesmodel.h"
......@@ -61,7 +62,9 @@ int main(int argc, char** argv)
menu->clear();
auto configure = menu->addAction(i18n("Configure..."));
QObject::connect(configure, &QAction::triggered, configure, [](){
QProcess::startDetached("kcmshell5", {"kdeconnect"});
KCMultiDialog dialog;
dialog.addModule("kcm_kdeconnect");
dialog.exec();
});
for (int i=0, count = model.rowCount(); i<count; ++i) {
DeviceDbusInterface* device = model.getDevice(i);
......@@ -115,5 +118,7 @@ int main(int argc, char** argv)
refreshMenu();
app.setQuitOnLastWindowClosed(false);
return app.exec();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment