Fix the most egregious style guide violations in the kdesktoplock plugin sources

No functional changes were made to the source
pull/2/head
Timothy Pearson 9 years ago
parent b45b9ed9b1
commit c54c4e7003

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
#include <config.h>
@ -62,86 +62,88 @@ extern bool trinity_desktop_lock_use_system_modal_dialogs;
// Simple dialog for displaying an unlock status or recurring error message
//
InfoDlg::InfoDlg(LockProcess *parent)
: TQDialog(parent, "information dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false)
: TQDialog(parent, "information dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false)
{
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Information"));
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Information"));
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs)
frame->setFrameStyle( TQFrame::NoFrame );
else
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
frame->setLineWidth( 2 );
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs) {
frame->setFrameStyle( TQFrame::NoFrame );
}
else {
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
}
frame->setLineWidth( 2 );
mpixLabel = new TQLabel( frame, "pixlabel" );
mpixLabel->setPixmap(DesktopIcon("unlock"));
mpixLabel = new TQLabel( frame, "pixlabel" );
mpixLabel->setPixmap(DesktopIcon("unlock"));
KUser user;
KUser user;
mStatusLabel = new TQLabel( "<b> </b>", frame );
mStatusLabel->setAlignment( TQLabel::AlignCenter );
mStatusLabel = new TQLabel( "<b> </b>", frame );
mStatusLabel->setAlignment( TQLabel::AlignCenter );
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mStatusLabel );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mStatusLabel );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( mpixLabel, 0, 2, 0, 0, Qt::AlignTop );
frameLayout->addLayout( layStatus, 1, 1 );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( mpixLabel, 0, 2, 0, 0, Qt::AlignTop );
frameLayout->addLayout( layStatus, 1, 1 );
installEventFilter(this);
setFixedSize( sizeHint() );
}
installEventFilter(this);
setFixedSize( sizeHint() );
}
InfoDlg::~InfoDlg()
{
hide();
hide();
}
void InfoDlg::updateLabel(TQString &txt)
{
mStatusLabel->setPaletteForegroundColor(Qt::black);
mStatusLabel->setText("<b>" + txt + "</b>");
mStatusLabel->setPaletteForegroundColor(Qt::black);
mStatusLabel->setText("<b>" + txt + "</b>");
}
void InfoDlg::setUnlockIcon()
{
mpixLabel->setPixmap(DesktopIcon("unlock"));
mpixLabel->setPixmap(DesktopIcon("unlock"));
}
void InfoDlg::setKDEIcon()
{
mpixLabel->setPixmap(DesktopIcon("about_kde"));
mpixLabel->setPixmap(DesktopIcon("about_kde"));
}
void InfoDlg::setInfoIcon()
{
mpixLabel->setPixmap(DesktopIcon("messagebox_info"));
mpixLabel->setPixmap(DesktopIcon("messagebox_info"));
}
void InfoDlg::setWarningIcon()
{
mpixLabel->setPixmap(DesktopIcon("messagebox_warning"));
mpixLabel->setPixmap(DesktopIcon("messagebox_warning"));
}
void InfoDlg::setErrorIcon()
{
mpixLabel->setPixmap(DesktopIcon("messagebox_critical"));
mpixLabel->setPixmap(DesktopIcon("messagebox_critical"));
}
void InfoDlg::show()
{
TQDialog::show();
TQApplication::flushX();
TQDialog::show();
TQApplication::flushX();
}
#include "infodlg.moc"

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
//
#ifndef __INFODLG_H__
@ -26,30 +26,30 @@ class TQListView;
//
class InfoDlg : public TQDialog
{
Q_OBJECT
public:
InfoDlg(LockProcess *parent);
~InfoDlg();
virtual void show();
void updateLabel( TQString &txt );
void setUnlockIcon();
void setKDEIcon();
void setInfoIcon();
void setWarningIcon();
void setErrorIcon();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
TQLabel *mpixLabel;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
Q_OBJECT
public:
InfoDlg(LockProcess *parent);
~InfoDlg();
virtual void show();
void updateLabel( TQString &txt );
void setUnlockIcon();
void setKDEIcon();
void setInfoIcon();
void setWarningIcon();
void setErrorIcon();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
TQLabel *mpixLabel;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
};
#endif

File diff suppressed because it is too large Load Diff

@ -1,9 +1,10 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
// Copyright (c) 2003 Oswald Buddenhagen <ossi@kde.org>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
//
#ifndef __LOCKDLG_H__
@ -32,69 +33,69 @@ class TQListView;
//
class PasswordDlg : public TQDialog, public KGreeterPluginHandler
{
Q_OBJECT
Q_OBJECT
public:
PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin);
PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin, TQDateTime lockStartDateTime);
~PasswordDlg();
void init(GreeterPluginHandle *plugin);
virtual void show();
// from KGreetPluginHandler
virtual void gplugReturnText( const char *text, int tag );
virtual void gplugReturnBinary( const char *data );
virtual void gplugSetUser( const TQString & );
virtual void gplugStart();
virtual void gplugActivity();
virtual void gplugMsgBox( TQMessageBox::Icon type, const TQString &text );
protected:
virtual void timerEvent(TQTimerEvent *);
virtual bool eventFilter(TQObject *, TQEvent *);
private slots:
void slotSwitchUser();
void slotSessionActivated();
void slotStartNewSession();
void slotOK();
void layoutClicked();
void slotActivity();
protected slots:
virtual void reject();
private:
void setLayoutText( const TQString &txt );
void capsLocked();
void updateLabel();
int Reader (void *buf, int count);
bool GRead (void *buf, int count);
bool GWrite (const void *buf, int count);
bool GSendInt (int val);
bool GSendStr (const char *buf);
bool GSendArr (int len, const char *buf);
bool GRecvInt (int *val);
bool GRecvArr (char **buf);
void handleVerify();
void reapVerify();
void cantCheck();
GreeterPluginHandle *mPlugin;
KGreeterPlugin *greet;
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
KPushButton *mNewSessButton, *ok, *cancel;
TQPushButton *mLayoutButton;
int mFailedTimerId;
int mTimeoutTimerId;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
TQListView *lv;
TQDateTime m_lockStartDT;
public:
PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin);
PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin, TQDateTime lockStartDateTime);
~PasswordDlg();
void init(GreeterPluginHandle *plugin);
virtual void show();
// from KGreetPluginHandler
virtual void gplugReturnText( const char *text, int tag );
virtual void gplugReturnBinary( const char *data );
virtual void gplugSetUser( const TQString & );
virtual void gplugStart();
virtual void gplugActivity();
virtual void gplugMsgBox( TQMessageBox::Icon type, const TQString &text );
protected:
virtual void timerEvent(TQTimerEvent *);
virtual bool eventFilter(TQObject *, TQEvent *);
private slots:
void slotSwitchUser();
void slotSessionActivated();
void slotStartNewSession();
void slotOK();
void layoutClicked();
void slotActivity();
protected slots:
virtual void reject();
private:
void setLayoutText( const TQString &txt );
void capsLocked();
void updateLabel();
int Reader (void *buf, int count);
bool GRead (void *buf, int count);
bool GWrite (const void *buf, int count);
bool GSendInt (int val);
bool GSendStr (const char *buf);
bool GSendArr (int len, const char *buf);
bool GRecvInt (int *val);
bool GRecvArr (char **buf);
void handleVerify();
void reapVerify();
void cantCheck();
GreeterPluginHandle *mPlugin;
KGreeterPlugin *greet;
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
KPushButton *mNewSessButton, *ok, *cancel;
TQPushButton *mLayoutButton;
int mFailedTimerId;
int mTimeoutTimerId;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
TQListView *lv;
TQDateTime m_lockStartDT;
};
#endif

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
#include <config.h>
@ -62,100 +62,102 @@ extern bool trinity_desktop_lock_use_system_modal_dialogs;
// Simple dialog for displaying a password/PIN entry dialog
//
QueryDlg::QueryDlg(LockProcess *parent)
: TQDialog(parent, "query dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false)
: TQDialog(parent, "query dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false)
{
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Information Needed"));
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs)
frame->setFrameStyle( TQFrame::NoFrame );
else
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
frame->setLineWidth( 2 );
mpixLabel = new TQLabel( frame, "pixlabel" );
mpixLabel->setPixmap(DesktopIcon("unlock"));
KUser user;
mStatusLabel = new TQLabel( "<b> </b>", frame );
//mStatusLabel->setAlignment( TQLabel::AlignCenter );
mStatusLabel->setAlignment( TQLabel::AlignLeft );
KSeparator *sep = new KSeparator( KSeparator::HLine, frame );
ok = new KPushButton( i18n("Unl&ock"), frame );
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mStatusLabel );
TQHBoxLayout *layPin = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
pin_box = new KPasswordEdit( this, "pin_box" );
layPin->addWidget( pin_box );
pin_box->setFocus();
TQHBoxLayout *layButtons = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layButtons->addStretch();
layButtons->addWidget( ok );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( mpixLabel, 0, 2, 0, 0, Qt::AlignTop );
frameLayout->addLayout( layStatus, 0, 1 );
frameLayout->addLayout( layPin, 2, 1 );
frameLayout->addMultiCellWidget( sep, 3, 3, 0, 1 );
frameLayout->addMultiCellLayout( layButtons, 4, 4, 0, 1 );
connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(slotOK()));
installEventFilter(this);
setFixedSize( sizeHint() );
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Information Needed"));
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs) {
frame->setFrameStyle( TQFrame::NoFrame );
}
else {
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
}
frame->setLineWidth( 2 );
mpixLabel = new TQLabel( frame, "pixlabel" );
mpixLabel->setPixmap(DesktopIcon("unlock"));
KUser user;
mStatusLabel = new TQLabel( "<b> </b>", frame );
//mStatusLabel->setAlignment( TQLabel::AlignCenter );
mStatusLabel->setAlignment( TQLabel::AlignLeft );
KSeparator *sep = new KSeparator( KSeparator::HLine, frame );
ok = new KPushButton( i18n("Unl&ock"), frame );
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mStatusLabel );
TQHBoxLayout *layPin = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
pin_box = new KPasswordEdit( this, "pin_box" );
layPin->addWidget( pin_box );
pin_box->setFocus();
TQHBoxLayout *layButtons = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layButtons->addStretch();
layButtons->addWidget( ok );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( mpixLabel, 0, 2, 0, 0, Qt::AlignTop );
frameLayout->addLayout( layStatus, 0, 1 );
frameLayout->addLayout( layPin, 2, 1 );
frameLayout->addMultiCellWidget( sep, 3, 3, 0, 1 );
frameLayout->addMultiCellLayout( layButtons, 4, 4, 0, 1 );
connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(slotOK()));
installEventFilter(this);
setFixedSize( sizeHint() );
}
QueryDlg::~QueryDlg()
{
hide();
hide();
}
void QueryDlg::slotOK()
{
close();
close();
}
const char * QueryDlg::getEntry()
{
return pin_box->password();
return pin_box->password();
}
void QueryDlg::updateLabel(TQString &txt)
{
mStatusLabel->setPaletteForegroundColor(Qt::black);
mStatusLabel->setText("<b>" + txt + "</b>");
mStatusLabel->setPaletteForegroundColor(Qt::black);
mStatusLabel->setText("<b>" + txt + "</b>");
}
void QueryDlg::setUnlockIcon()
{
mpixLabel->setPixmap(DesktopIcon("unlock"));
mpixLabel->setPixmap(DesktopIcon("unlock"));
}
void QueryDlg::setWarningIcon()
{
mpixLabel->setPixmap(DesktopIcon("messagebox_warning"));
mpixLabel->setPixmap(DesktopIcon("messagebox_warning"));
}
void QueryDlg::show()
{
TQDialog::show();
TQApplication::flushX();
TQDialog::show();
TQApplication::flushX();
}
#include "querydlg.moc"

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
//
#ifndef __QUERYDLG_H__
@ -28,33 +28,33 @@ class TQListView;
//
class QueryDlg : public TQDialog
{
Q_OBJECT
public:
QueryDlg(LockProcess *parent);
~QueryDlg();
virtual void show();
void updateLabel( TQString &txt );
void setUnlockIcon();
void setWarningIcon();
const char * getEntry();
private slots:
void slotOK();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
TQLabel *mpixLabel;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
KPushButton *ok;
KPasswordEdit *pin_box;
Q_OBJECT
public:
QueryDlg(LockProcess *parent);
~QueryDlg();
virtual void show();
void updateLabel( TQString &txt );
void setUnlockIcon();
void setWarningIcon();
const char * getEntry();
private slots:
void slotOK();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
TQLabel *mpixLabel;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
KPushButton *ok;
KPasswordEdit *pin_box;
};
#endif

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010-2011 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
#include <config.h>
@ -64,71 +64,75 @@ extern bool trinity_desktop_lock_use_sak;
// Simple dialog for displaying an unlock status or recurring error message
//
SAKDlg::SAKDlg(LockProcess *parent)
: TQDialog(parent, "information dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false)
: TQDialog(parent, "information dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false)
{
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Desktop Session Locked"));
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Desktop Session Locked"));
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs)
frame->setFrameStyle( TQFrame::NoFrame );
else
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
frame->setLineWidth( 2 );
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs) {
frame->setFrameStyle( TQFrame::NoFrame );
}
else {
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
}
frame->setLineWidth( 2 );
KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame );
KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame );
KUser user;
KUser user;
mStatusLabel = new TQLabel( "<b> </b>", frame );
mStatusLabel->setAlignment( TQLabel::AlignVCenter );
mStatusLabel = new TQLabel( "<b> </b>", frame );
mStatusLabel->setAlignment( TQLabel::AlignVCenter );
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mStatusLabel );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mStatusLabel );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( theader, 0, 0, 0, 1, AlignTop | AlignLeft );
frameLayout->addMultiCellLayout( layStatus, 1, 1, 0, 1, AlignLeft | AlignVCenter);
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( theader, 0, 0, 0, 1, AlignTop | AlignLeft );
frameLayout->addMultiCellLayout( layStatus, 1, 1, 0, 1, AlignLeft | AlignVCenter);
mStatusLabel->setText("<b>" + i18n("Press Ctrl+Alt+Del to begin.") + "</b><p>" + i18n("This process helps keep your password secure.") + "<br>" + i18n("It prevents unauthorized users from emulating the login screen."));
mStatusLabel->setText("<b>" + i18n("Press Ctrl+Alt+Del to begin.") + "</b><p>" + i18n("This process helps keep your password secure.") + "<br>" + i18n("It prevents unauthorized users from emulating the login screen."));
installEventFilter(this);
setFixedSize( sizeHint() );
installEventFilter(this);
setFixedSize( sizeHint() );
mSAKProcess = new TDEProcess;
*mSAKProcess << "tdmtsak";
connect(mSAKProcess, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(slotSAKProcessExited()));
mSAKProcess->start();
mSAKProcess = new TDEProcess;
*mSAKProcess << "tdmtsak";
connect(mSAKProcess, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(slotSAKProcessExited()));
mSAKProcess->start();
}
void SAKDlg::slotSAKProcessExited()
{
int retcode = mSAKProcess->exitStatus();
if (retcode != 0) trinity_desktop_lock_use_sak = false;
hide();
int retcode = mSAKProcess->exitStatus();
if (retcode != 0) {
trinity_desktop_lock_use_sak = false;
}
hide();
}
SAKDlg::~SAKDlg()
{
if ((mSAKProcess) && (mSAKProcess->isRunning())) {
mSAKProcess->kill(SIGTERM);
delete mSAKProcess;
}
hide();
if ((mSAKProcess) && (mSAKProcess->isRunning())) {
mSAKProcess->kill(SIGTERM);
delete mSAKProcess;
}
hide();
}
void SAKDlg::closeDialogForced()
{
TQDialog::reject();
TQDialog::reject();
}
void SAKDlg::reject()
@ -138,14 +142,14 @@ void SAKDlg::reject()
void SAKDlg::updateLabel(TQString &txt)
{
mStatusLabel->setPaletteForegroundColor(Qt::black);
mStatusLabel->setText("<b>" + txt + "</b>");
mStatusLabel->setPaletteForegroundColor(Qt::black);
mStatusLabel->setText("<b>" + txt + "</b>");
}
void SAKDlg::show()
{
TQDialog::show();
TQApplication::flushX();
TQDialog::show();
TQApplication::flushX();
}
#include "sakdlg.moc"

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
//
#ifndef __SAKDLG_H__
@ -26,32 +26,32 @@ class TQListView;
//
class SAKDlg : public TQDialog
{
Q_OBJECT
public:
SAKDlg(LockProcess *parent);
~SAKDlg();
virtual void show();
void updateLabel( TQString &txt );
void closeDialogForced();
private slots:
void slotSAKProcessExited();
protected slots:
virtual void reject();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
TDEProcess* mSAKProcess;
Q_OBJECT
public:
SAKDlg(LockProcess *parent);
~SAKDlg();
virtual void show();
void updateLabel( TQString &txt );
void closeDialogForced();
private slots:
void slotSAKProcessExited();
protected slots:
virtual void reject();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mStatusLabel;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
TDEProcess* mSAKProcess;
};
#endif

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010-2011 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
#include <config.h>
@ -64,152 +64,154 @@ extern bool trinity_desktop_lock_use_sak;
// Simple dialog for displaying an unlock status or recurring error message
//
SecureDlg::SecureDlg(LockProcess *parent)
: TQDialog(parent, "information dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false), retInt(NULL)
: TQDialog(parent, "information dialog", true, (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)WStyle_StaysOnTop):((WFlags)WX11BypassWM))),
mUnlockingFailed(false), retInt(NULL)
{
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Secure Desktop Area"));
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs)
frame->setFrameStyle( TQFrame::NoFrame );
else
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
frame->setLineWidth( 2 );
KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame );
KUser user;
mLogonStatus = new TQLabel( frame );
TQString userString = user.fullName();
if (userString == "") {
userString = user.loginName();
}
if (userString != "") {
mLogonStatus->setText(i18n("'%1' is currently logged on").arg( user.fullName() ));
}
else {
mLogonStatus->setText(i18n("You are currently logged on")); // We should never get here, and this message is somewhat obtuse, but it is better than displaying two qotation marks with no text between them...
}
KSeparator *sep = new KSeparator( KSeparator::HLine, frame );
mLockButton = new TQPushButton( frame );
mLockButton->setText(i18n("Lock Session"));
mTaskButton = new TQPushButton( frame );
mTaskButton->setText(i18n("Task Manager"));
mShutdownButton = new TQPushButton( frame );
mShutdownButton->setText(i18n("Logoff Menu"));
mCancelButton = new TQPushButton( frame );
mCancelButton->setText(i18n("Cancel"));
mSwitchButton = new TQPushButton( frame );
mSwitchButton->setText(i18n("Switch User"));
mSwitchButton->setEnabled(false); // FIXME
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mLogonStatus );
TQGridLayout *layPBGrid = new TQGridLayout( 0, 0, KDialog::spacingHint());
layPBGrid->addWidget( mLockButton, 0, 0 );
layPBGrid->addWidget( mTaskButton, 0, 1 );
layPBGrid->addWidget( mShutdownButton, 0, 2 );
layPBGrid->addWidget( mCancelButton, 0, 3 );
layPBGrid->addWidget( mSwitchButton, 1, 0 );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( theader, 0, 0, 0, 1, AlignTop | AlignLeft );
frameLayout->addMultiCellLayout( layStatus, 1, 1, 0, 1, AlignLeft | AlignVCenter);
frameLayout->addMultiCellWidget( sep, 2, 2, 0, 1 );
frameLayout->addMultiCellLayout( layPBGrid, 3, 3, 0, 1, AlignLeft | AlignVCenter);
connect(mCancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnCancel()));
connect(mLockButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnLock()));
connect(mTaskButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnTask()));
connect(mShutdownButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnShutdown()));
connect(mSwitchButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnSwitchUser()));
TQSize dlgSz = sizeHint();
int btnSize = dlgSz.width();
btnSize = btnSize / 4;
btnSize = btnSize - (KDialog::spacingHint() / 2);
mLockButton->setFixedWidth(btnSize);
mTaskButton->setFixedWidth(btnSize);
mCancelButton->setFixedWidth(btnSize);
mShutdownButton->setFixedWidth(btnSize);
mSwitchButton->setFixedWidth(btnSize);
installEventFilter(this);
setFixedSize( sizeHint() );
if (trinity_desktop_lock_use_system_modal_dialogs) {
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
XChangeProperty(tqt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L);
}
setCaption(i18n("Secure Desktop Area"));
frame = new TQFrame( this );
if (trinity_desktop_lock_use_system_modal_dialogs) {
frame->setFrameStyle( TQFrame::NoFrame );
}
else {
frame->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
}
frame->setLineWidth( 2 );
KSMModalDialogHeader* theader = new KSMModalDialogHeader( frame );
KUser user;
mLogonStatus = new TQLabel( frame );
TQString userString = user.fullName();
if (userString == "") {
userString = user.loginName();
}
if (userString != "") {
mLogonStatus->setText(i18n("'%1' is currently logged on").arg( user.fullName() ));
}
else {
mLogonStatus->setText(i18n("You are currently logged on")); // We should never get here, and this message is somewhat obtuse, but it is better than displaying two qotation marks with no text between them...
}
KSeparator *sep = new KSeparator( KSeparator::HLine, frame );
mLockButton = new TQPushButton( frame );
mLockButton->setText(i18n("Lock Session"));
mTaskButton = new TQPushButton( frame );
mTaskButton->setText(i18n("Task Manager"));
mShutdownButton = new TQPushButton( frame );
mShutdownButton->setText(i18n("Logoff Menu"));
mCancelButton = new TQPushButton( frame );
mCancelButton->setText(i18n("Cancel"));
mSwitchButton = new TQPushButton( frame );
mSwitchButton->setText(i18n("Switch User"));
mSwitchButton->setEnabled(false); // FIXME
TQVBoxLayout *unlockDialogLayout = new TQVBoxLayout( this );
unlockDialogLayout->addWidget( frame );
TQHBoxLayout *layStatus = new TQHBoxLayout( 0, 0, KDialog::spacingHint());
layStatus->addWidget( mLogonStatus );
TQGridLayout *layPBGrid = new TQGridLayout( 0, 0, KDialog::spacingHint());
layPBGrid->addWidget( mLockButton, 0, 0 );
layPBGrid->addWidget( mTaskButton, 0, 1 );
layPBGrid->addWidget( mShutdownButton, 0, 2 );
layPBGrid->addWidget( mCancelButton, 0, 3 );
layPBGrid->addWidget( mSwitchButton, 1, 0 );
frameLayout = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
frameLayout->addMultiCellWidget( theader, 0, 0, 0, 1, AlignTop | AlignLeft );
frameLayout->addMultiCellLayout( layStatus, 1, 1, 0, 1, AlignLeft | AlignVCenter);
frameLayout->addMultiCellWidget( sep, 2, 2, 0, 1 );
frameLayout->addMultiCellLayout( layPBGrid, 3, 3, 0, 1, AlignLeft | AlignVCenter);
connect(mCancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnCancel()));
connect(mLockButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnLock()));
connect(mTaskButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnTask()));
connect(mShutdownButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnShutdown()));
connect(mSwitchButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBtnSwitchUser()));
TQSize dlgSz = sizeHint();
int btnSize = dlgSz.width();
btnSize = btnSize / 4;
btnSize = btnSize - (KDialog::spacingHint() / 2);
mLockButton->setFixedWidth(btnSize);
mTaskButton->setFixedWidth(btnSize);
mCancelButton->setFixedWidth(btnSize);
mShutdownButton->setFixedWidth(btnSize);
mSwitchButton->setFixedWidth(btnSize);
installEventFilter(this);
setFixedSize( sizeHint() );
}
SecureDlg::~SecureDlg()
{
hide();
hide();
}
void SecureDlg::slotBtnCancel()
{
if (retInt) *retInt = 0;
hide();
if (retInt) *retInt = 0;
hide();
}
void SecureDlg::slotBtnLock()
{
if (retInt) *retInt = 1;
hide();
if (retInt) *retInt = 1;
hide();
}
void SecureDlg::slotBtnTask()
{
if (retInt) *retInt = 2;
hide();
if (retInt) *retInt = 2;
hide();
}
void SecureDlg::slotBtnShutdown()
{
if (retInt) *retInt = 3;
hide();
if (retInt) *retInt = 3;
hide();
}
void SecureDlg::slotBtnSwitchUser()
{
if (retInt) *retInt = 4;
hide();
if (retInt) *retInt = 4;
hide();
}
void SecureDlg::setRetInt(int *i)
{
retInt = i;
retInt = i;
}
void SecureDlg::closeDialogForced()
{
if (retInt) *retInt = 0;
TQDialog::reject();
if (retInt) *retInt = 0;
TQDialog::reject();
}
void SecureDlg::reject()
{
closeDialogForced();
closeDialogForced();
}
void SecureDlg::show()
{
TQDialog::show();
TQApplication::flushX();
TQDialog::show();
TQApplication::flushX();
}
#include "securedlg.moc"

@ -1,8 +1,8 @@
//===========================================================================
//
// This file is part of the KDE project
// This file is part of the TDE project
//
// Copyright (c) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
//
#ifndef __SECUREDLG_H__
@ -27,41 +27,41 @@ class TQListView;
//
class SecureDlg : public TQDialog
{
Q_OBJECT
Q_OBJECT
public:
SecureDlg(LockProcess *parent);
~SecureDlg();
virtual void show();
public:
SecureDlg(LockProcess *parent);
~SecureDlg();
virtual void show();
void closeDialogForced();
void setRetInt(int *);
void closeDialogForced();
void setRetInt(int *);
private slots:
void slotBtnCancel();
void slotBtnLock();
void slotBtnTask();
void slotBtnShutdown();
void slotBtnSwitchUser();
private slots:
void slotBtnCancel();
void slotBtnLock();
void slotBtnTask();
void slotBtnShutdown();
void slotBtnSwitchUser();
protected slots:
virtual void reject();
protected slots:
virtual void reject();
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mLogonStatus;
TQButton *mCancelButton;
TQButton *mLockButton;
TQButton *mTaskButton;
TQButton *mShutdownButton;
TQButton *mSwitchButton;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
int* retInt;
private:
TQFrame *frame;
TQGridLayout *frameLayout;
TQLabel *mLogonStatus;
TQButton *mCancelButton;
TQButton *mLockButton;
TQButton *mTaskButton;
TQButton *mShutdownButton;
TQButton *mSwitchButton;
int mCapsLocked;
bool mUnlockingFailed;
TQStringList layoutsList;
TQStringList::iterator currLayout;
int sPid, sFd;
int* retInt;
};
#endif

Loading…
Cancel
Save