mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
generic: misc cleanups
This commit is contained in:
parent
7c95601a4e
commit
bad27e353b
3 changed files with 53 additions and 72 deletions
|
@ -24,11 +24,8 @@
|
|||
#include <KToggleAction>
|
||||
#include <KToggleAction>
|
||||
#include <KLocalizedString>
|
||||
#include <KIcon>
|
||||
#include <KIconLoader>
|
||||
#include <KCmdLineArgs>
|
||||
#include <KHelpMenu>
|
||||
#include <KMenu>
|
||||
#include <KFontDialog>
|
||||
#include <KUniqueApplication>
|
||||
|
||||
|
@ -50,9 +47,6 @@ KbdTray::~KbdTray()
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QMenu* KbdTray::getContextMenu()
|
||||
{
|
||||
return this->contextMenu();
|
||||
|
|
|
@ -72,8 +72,6 @@ KvkbdApp::KvkbdApp(bool loginhelper) : KUniqueApplication(), is_login(loginhelpe
|
|||
|
||||
KConfigGroup cfg = KGlobal::config()->group("");
|
||||
|
||||
|
||||
|
||||
if (!is_login) {
|
||||
widget->setAttribute(Qt::WA_ShowWithoutActivating);
|
||||
widget->setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
|
@ -150,7 +148,6 @@ KvkbdApp::KvkbdApp(bool loginhelper) : KUniqueApplication(), is_login(loginhelpe
|
|||
connect(stickyModKeysAction,SIGNAL(triggered(bool)), this, SLOT(setStickyModKeys(bool)));
|
||||
widget->setProperty("stickyModKeys", stickyModKeys);
|
||||
|
||||
|
||||
QFont font = cfg.readEntry("font", widget->font());
|
||||
widget->setFont(font);
|
||||
|
||||
|
@ -199,14 +196,11 @@ KvkbdApp::KvkbdApp(bool loginhelper) : KUniqueApplication(), is_login(loginhelpe
|
|||
|
||||
widget->show();
|
||||
|
||||
|
||||
bool extensionVisible = cfg.readEntry("extentVisible", QVariant(true)).toBool();
|
||||
if (!extensionVisible) {
|
||||
toggleExtension();
|
||||
}
|
||||
|
||||
|
||||
|
||||
setQuitOnLastWindowClosed (is_login);
|
||||
|
||||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(storeConfig()));
|
||||
|
@ -221,14 +215,11 @@ KvkbdApp::KvkbdApp(bool loginhelper) : KUniqueApplication(), is_login(loginhelpe
|
|||
if (!is_login) {
|
||||
bool vis = cfg.readEntry("visible", QVariant(true)).toBool();
|
||||
if (!vis ) {
|
||||
|
||||
widget->showMinimized();
|
||||
|
||||
}
|
||||
widget->setWindowTitle("kvkbd");
|
||||
tray->show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->setInterval(1000);
|
||||
connect(timer, SIGNAL(timeout()), widget, SLOT(raise()));
|
||||
|
@ -293,8 +284,8 @@ void KvkbdApp::chooseFont()
|
|||
|
||||
QFont widgetFont = widget->font();
|
||||
|
||||
int result = KFontDialog::getFont( widgetFont, KFontChooser::NoDisplayFlags, widget );
|
||||
if ( result == KFontDialog::Accepted ) {
|
||||
int result = KFontDialog::getFont(widgetFont, KFontChooser::NoDisplayFlags, widget);
|
||||
if (result == KFontDialog::Accepted) {
|
||||
|
||||
widget->setFont(widgetFont);
|
||||
emit fontUpdated(widgetFont);
|
||||
|
|
|
@ -43,21 +43,17 @@ void findLoginWindow()
|
|||
char *win_name=0;
|
||||
|
||||
dipsy = XOpenDisplay(0);
|
||||
if (!dipsy)return;
|
||||
if (!dipsy) return;
|
||||
|
||||
scrn = DefaultScreen(dipsy);
|
||||
root = RootWindow(dipsy, scrn);
|
||||
|
||||
XQueryTree(dipsy, root, &r, &p, &kids, &numkids);
|
||||
|
||||
|
||||
for (i = 0; i < numkids; ++i)
|
||||
{
|
||||
for (i = 0; i < numkids; ++i) {
|
||||
XFetchName(dipsy, kids[i], &win_name);
|
||||
QString c(win_name);
|
||||
|
||||
if (c=="kvkbd.login")
|
||||
{
|
||||
if (c=="kvkbd.login") {
|
||||
long wid = kids[i];
|
||||
XDestroyWindow(dipsy,wid);
|
||||
XFlush(dipsy);
|
||||
|
|
Loading…
Add table
Reference in a new issue