kgreeter: stub KCM

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-03-31 19:00:40 +03:00
parent 1cd604c831
commit cdc2a6834e
7 changed files with 174 additions and 1 deletions

View file

@ -27,6 +27,8 @@ set_package_properties(GLIB2 PROPERTIES
TYPE REQUIRED
)
add_subdirectory(kcm)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-kgreeter.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-kgreeter.h

View file

@ -0,0 +1,24 @@
########### next target ###############
set(kgreeterconfig_SRCS
kgreeterconfig.cpp
kgreeterconfig.ui
)
kde4_add_plugin(kcm_kgreeterconfig ${kgreeterconfig_SRCS})
target_link_libraries(kcm_kgreeterconfig
${KDE4_KDEUI_LIBS}
${KDE4_KCMUTILS_LIBS}
${KDE4_KIO_LIBS}
)
install(
TARGETS kcm_kgreeterconfig
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
)
install(
FILES kcm_kgreeterconfig.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)

View file

@ -0,0 +1,16 @@
[Desktop Entry]
Exec=kcmshell4 kgreeterconfig
Icon=preferences-system-login
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_kgreeterconfig
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=workspace-appearance-and-behavior
X-KDE-System-Settings-Parent-Category-V2=workspace-appearance-and-behavior
X-DocPath=kcontrol/kgreeterconfig/index.html
Categories=Qt;KDE;X-KDE-settings-workspace-appearance-and-behavior;
Name=Greeter
Comment=Change greeter options
X-KDE-Keywords=Greeter,Login

View file

@ -0,0 +1,71 @@
/* This file is part of the KDE project
Copyright (C) 2022 Ivailo Monev <xakepa10@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2, as published by the Free Software Foundation.
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 "kgreeterconfig.h"
#include <kdebug.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>
K_PLUGIN_FACTORY(KCMGreeterFactory, registerPlugin<KCMGreeter>();)
K_EXPORT_PLUGIN(KCMGreeterFactory("kcmgreeterconfig", "kcm_greeterconfig"))
KCMGreeter::KCMGreeter(QWidget* parent, const QVariantList& args)
: KCModule(KCMGreeterFactory::componentData(), parent)
{
Q_UNUSED(args);
setQuickHelp(i18n("<h1>KGreeter</h1>"
"This module allows you to change KDE greeter options."));
setupUi(this);
KAboutData *about =
new KAboutData(I18N_NOOP("KCMGreeter"), 0,
ki18n("KDE Greeter Module"),
0, KLocalizedString(), KAboutData::License_GPL,
ki18n("Copyright 2022, Ivailo Monev <email>xakepa10@gmail.com</email>"
));
about->addAuthor(ki18n("Ivailo Monev"), KLocalizedString(), "xakepa10@gmail.com");
setAboutData(about);
layout()->setContentsMargins(0, 0, 0, 0);
load();
}
KCMGreeter::~KCMGreeter()
{
}
void KCMGreeter::load()
{
emit changed(false);
}
void KCMGreeter::save()
{
emit changed(false);
}
#include "moc_kgreeterconfig.cpp"

View file

@ -0,0 +1,43 @@
/* This file is part of the KDE project
Copyright (C) 2022 Ivailo Monev <xakepa10@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2, as published by the Free Software Foundation.
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.
*/
#ifndef KGREETERCONFIG_H
#define KGREETERCONFIG_H
#include <kcmodule.h>
#include "ui_kgreeterconfig.h"
/**
* Control look of KDE greeter
*
* @author Ivailo Monev (xakepa10@gmail.com)
*/
class KCMGreeter : public KCModule, public Ui_KGreeterDialog
{
Q_OBJECT
public:
KCMGreeter(QWidget* parent, const QVariantList&);
~KCMGreeter();
virtual void load();
virtual void save();
};
#endif // KGREETERCONFIG_H

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="System"?>
<ui version="4.0">
<class>KGreeterDialog</class>
<widget class="QWidget" name="KGreeterDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>481</width>
<height>466</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout"/>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -83,6 +83,7 @@ KGreeter::KGreeter(QWidget *parent)
G_CALLBACK(KGreeter::showMessageCb), this
);
// TODO: sort and then add
GList *ldmlayouts = lightdm_get_layouts();
for (GList *ldmitem = ldmlayouts; ldmitem; ldmitem = ldmitem->next) {
LightDMLayout *ldmlayout = static_cast<LightDMLayout*>(ldmitem->data);
@ -108,7 +109,6 @@ KGreeter::KGreeter(QWidget *parent)
}
}
// TODO: sort and then add
GList *ldmsessions = lightdm_get_sessions();
for (GList* ldmitem = ldmsessions; ldmitem; ldmitem = ldmitem->next) {
LightDMSession *ldmsession = static_cast<LightDMSession*>(ldmitem->data);