diff options
Diffstat (limited to 'krootwarning/krootwarning')
-rw-r--r-- | krootwarning/krootwarning/.cvsignore | 1 | ||||
-rw-r--r-- | krootwarning/krootwarning/Makefile.am | 46 | ||||
-rw-r--r-- | krootwarning/krootwarning/krootwarning.cpp | 149 | ||||
-rw-r--r-- | krootwarning/krootwarning/krootwarning.desktop | 14 | ||||
-rw-r--r-- | krootwarning/krootwarning/krootwarning.h | 50 | ||||
-rw-r--r-- | krootwarning/krootwarning/krootwarningrc | 2 | ||||
-rw-r--r-- | krootwarning/krootwarning/lo16-app-krootwarning.png | bin | 376 -> 0 bytes | |||
-rw-r--r-- | krootwarning/krootwarning/lo32-app-krootwarning.png | bin | 575 -> 0 bytes | |||
-rw-r--r-- | krootwarning/krootwarning/main.cpp | 54 | ||||
-rw-r--r-- | krootwarning/krootwarning/pics/.cvsignore | 1 | ||||
-rw-r--r-- | krootwarning/krootwarning/pics/Makefile.am | 6 | ||||
-rw-r--r-- | krootwarning/krootwarning/pics/ic-attention-64.png | bin | 3485 -> 0 bytes | |||
-rw-r--r-- | krootwarning/krootwarning/templates/cpp_template | 16 | ||||
-rw-r--r-- | krootwarning/krootwarning/templates/header_template | 16 |
14 files changed, 0 insertions, 355 deletions
diff --git a/krootwarning/krootwarning/.cvsignore b/krootwarning/krootwarning/.cvsignore deleted file mode 100644 index 70845e0..0000000 --- a/krootwarning/krootwarning/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.in diff --git a/krootwarning/krootwarning/Makefile.am b/krootwarning/krootwarning/Makefile.am deleted file mode 100644 index dbdac20..0000000 --- a/krootwarning/krootwarning/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ - -bin_PROGRAMS = krootwarning -krootwarning_SOURCES = krootwarning.cpp main.cpp -krootwarning_METASOURCES = AUTO -krootwarning_LDADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIBSOCKET) - - -EXTRA_DIST = main.cpp krootwarning.cpp krootwarning.h krootwarning.desktop lo32-app-krootwarning.png lo16-app-krootwarning.png - -install-data-local: - $(mkinstalldirs) $(kde_appsdir)/Applications/ - $(INSTALL_DATA) $(srcdir)/krootwarning.desktop $(kde_appsdir)/Applications/krootwarning.desktop - $(mkinstalldirs) $(kde_icondir)/locolor/32x32/apps/ - $(INSTALL_DATA) $(srcdir)/lo32-app-krootwarning.png $(kde_icondir)/locolor/32x32/apps/krootwarning.png - $(mkinstalldirs) $(kde_icondir)/locolor/16x16/apps/ - $(INSTALL_DATA) $(srcdir)/lo16-app-krootwarning.png $(kde_icondir)/locolor/16x16/apps/krootwarning.png - -uninstall-local: - -rm -f $(kde_appsdir)/Applications/krootwarning.desktop - -rm -f $(kde_icondir)/locolor/32x32/apps/krootwarning.png - -rm -f $(kde_icondir)/locolor/16x16/apps/krootwarning.png - - -# set the include path for X, qt and KDE -INCLUDES= $(all_includes) - -SUBDIRS = . pics - -METASOURCES = AUTO - -# the library search path. -krootwarning_LDFLAGS = $(all_libraries) $(KDE_RPATH) - -autostart_DATA = krootwarning.desktop -autostartdir = $(prefix)/share/autostart - -data_DATA = krootwarningrc -datadir = $(kde_confdir) -EXTRA_DIST = $(data_DATA) - -messages: - LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \ - if test -n "$$LIST"; then \ - $(XGETTEXT) $$LIST -o $(podir)/krootwarning.pot; \ - fi - diff --git a/krootwarning/krootwarning/krootwarning.cpp b/krootwarning/krootwarning/krootwarning.cpp deleted file mode 100644 index e375dd7..0000000 --- a/krootwarning/krootwarning/krootwarning.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/*************************************************************************** - krootwarning.cpp - description - ------------------- - begin : mar jui 10 13:42:19 CEST 2001 - copyright : (C) 2001 by Laurent MONTEL - email : lmontel@mandrakesoft.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "krootwarning.h" -#include <kdialogbase.h> -#include <klocale.h> -#include <qlabel.h> -#include <kdebug.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <kapp.h> -#include <kconfig.h> -#include <dcopclient.h> -#include <qmessagebox.h> -#include <klocale.h> -#include <kstddirs.h> - -extern "C" { -#ifdef HAVE_XINERAMA -# include <X11/XKBlib.h> -# include <X11/extensions/Xinerama.h> -#endif -}; - -Krootwarning::Krootwarning(QWidget *parent, const char *name) - :KDialogBase( parent, "urldialog", true, i18n("Warning"), User1|User2, User1, true,i18n("Logout"),i18n("Continue") ) -{ - initInterface(); -} - -Krootwarning::~Krootwarning() -{ -} - -void Krootwarning::initInterface() -{ - QWidget *page = new QWidget( this ); - setMainWidget(page); - if ( !kapp->dcopClient()->isAttached() ) - kapp->dcopClient()->attach(); - QGridLayout *grid = new QGridLayout( page, 9, 3, KDialog::marginHint(), KDialog::spacingHint() ); - - QLabel *label1 = new QLabel( page ); - - QString resource_prefix = "krootwarning/pics/"; - - label1->setPixmap(QPixmap(locate("data", resource_prefix + "ic-attention-64.png"))); - - - grid->addMultiCellWidget(label1,0,8,0,0); - - QLabel *info=new QLabel("<qt>" +i18n("You are running a graphical interface as root.")+"<br><br>"+ - i18n("This is a bad idea because as root, you can damage your system, and nothing will stop you.")+"<br><br>"+ - i18n("Click on ")+"<b>"+i18n("'Continue'")+"</b>"+i18n(" if you really know what you are doing.")+"<br>" - +i18n("Otherwise, please click on ")+"<b>"+i18n("'Logout' ")+"</b>"+i18n("and read your manual ")+"<br>"+ - i18n("to know how to add a non-privileged user account ")+"<br>" - +i18n("to the system.")+"<br></qt>",page); - - grid->addMultiCellWidget(info,0,7,1,1); - m_showAtTheNewStartUp=new QCheckBox( i18n("Show this window again."), page); - grid->addMultiCellWidget(m_showAtTheNewStartUp,8,8,0,1); - resize(400,280); - - int dw, dh, gw, gh, x, y; -#ifdef HAVE_XINERAMA - int numHeads; - XineramaScreenInfo *xineramaInfo; - if (XineramaIsActive(qt_xdisplay()) && - ((xineramaInfo = XineramaQueryScreens(qt_xdisplay(), &numHeads)))) { - dw = xineramaInfo->width; - dh = xineramaInfo->height; - XFree(xineramaInfo); - } else -#endif - { - dw = QApplication::desktop()->width(); - dh = QApplication::desktop()->height(); - } - - gw = width(); - gh = height(); - x = dw/2; - y = dh/2; - - x -= gw/2; - y -= gh/2; - - if (x + gw > dw) - x = dw - gw; - if (y + gh > dh) - y = dh - gh; - move( x < 0 ? 0 : x, y < 0 ? 0 : y ); - m_showAtTheNewStartUp->setChecked(false); - loadConfig(); -} - -void Krootwarning::slotUser1() -{ - //logout!!!!!!!!!!!!!!! - saveConfig(); - logout(); - accept(); -} - -void Krootwarning::loadConfig() -{ - KConfig* config=kapp->config(); - if( config->hasGroup("Parameter" ) ) - { - config->setGroup( "Parameter" ); - m_showAtTheNewStartUp->setChecked(config->readBoolEntry("DontShowWindowAtTheNextStartUp",false)); - } -} - -void Krootwarning::slotUser2() -{ - //ok - saveConfig(); - accept(); -} - -void Krootwarning::saveConfig() -{ - KConfig* config=kapp->config(); - config->setGroup( "Parameter" ); - config->writeEntry("DontShowWindowAtTheNextStartUp", m_showAtTheNewStartUp->isChecked() ); -} - -void Krootwarning::logout() -{ - //send a messge to kdesktop logout without confirmation - kapp->dcopClient()->send( "kdesktop", "", "logoutWithoutConfirmation()", "" ); -} - -#include "krootwarning.moc" diff --git a/krootwarning/krootwarning/krootwarning.desktop b/krootwarning/krootwarning/krootwarning.desktop deleted file mode 100644 index 76cb655..0000000 --- a/krootwarning/krootwarning/krootwarning.desktop +++ /dev/null @@ -1,14 +0,0 @@ -# KDE Config File -[Desktop Entry] -Type=Application -Exec=krootwarning -caption "%c" %i %m -Icon=krootwarning.png -MiniIcon=krootwarning.png -DocPath=krootwarning/index.html -Comment= -Comment[de]= -Terminal=0 -Name=Krootwarning -Name[de]=Krootwarning -X-KDE-autostart-after=kdesktop -X-KDE-autostart-condition=krootwarningrc:Parameter:DontShowWindowAtTheNextStartUp:true diff --git a/krootwarning/krootwarning/krootwarning.h b/krootwarning/krootwarning/krootwarning.h deleted file mode 100644 index d379b54..0000000 --- a/krootwarning/krootwarning/krootwarning.h +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************** - krootwarning.h - description - ------------------- - begin : mar jui 10 13:42:19 CEST 2001 - copyright : (C) 2001 by Laurent MONTEL - email : lmontel@mandrakesoft.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef KROOTWARNING_H -#define KROOTWARNING_H - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <kapp.h> -#include <kdialogbase.h> -class QCheckBox; - -/** Krootwarning is the base class of the porject */ -class Krootwarning : public KDialogBase -{ - Q_OBJECT - public: - /** construtor */ - Krootwarning(QWidget* parent=0, const char *name=0); - /** destructor */ - ~Krootwarning(); - protected: - void initInterface(); - void saveConfig(); - void loadConfig(); - void logout(); - private: - QCheckBox *m_showAtTheNewStartUp; - protected slots: - virtual void slotUser1(); - virtual void slotUser2(); -}; - -#endif diff --git a/krootwarning/krootwarning/krootwarningrc b/krootwarning/krootwarning/krootwarningrc deleted file mode 100644 index f0976b6..0000000 --- a/krootwarning/krootwarning/krootwarningrc +++ /dev/null @@ -1,2 +0,0 @@ -[Parameter] -DontShowWindowAtTheNextStartUp=true diff --git a/krootwarning/krootwarning/lo16-app-krootwarning.png b/krootwarning/krootwarning/lo16-app-krootwarning.png Binary files differdeleted file mode 100644 index db881ed..0000000 --- a/krootwarning/krootwarning/lo16-app-krootwarning.png +++ /dev/null diff --git a/krootwarning/krootwarning/lo32-app-krootwarning.png b/krootwarning/krootwarning/lo32-app-krootwarning.png Binary files differdeleted file mode 100644 index c119573..0000000 --- a/krootwarning/krootwarning/lo32-app-krootwarning.png +++ /dev/null diff --git a/krootwarning/krootwarning/main.cpp b/krootwarning/krootwarning/main.cpp deleted file mode 100644 index 531f051..0000000 --- a/krootwarning/krootwarning/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - main.cpp - description - ------------------- - begin : mar jui 10 13:42:19 CEST 2001 - copyright : (C) 2001 by Laurent MONTEL - email : lmontel@mandrakesoft.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include <kcmdlineargs.h> -#include <kaboutdata.h> -#include <klocale.h> -#include <unistd.h> -#include <sys/types.h> -#include <stdlib.h> -#include "krootwarning.h" - -static const char *description = - I18N_NOOP("Krootwarning"); -// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE - - -static KCmdLineOptions options[] = -{ - { 0, 0, 0 } - // INSERT YOUR COMMANDLINE OPTIONS HERE -}; - -int main(int argc, char *argv[]) -{ - if(getuid()!=0) - exit(1); - KAboutData aboutData( "krootwarning", I18N_NOOP("Krootwarning"), - VERSION, description, KAboutData::License_GPL, - "(c) 2001, Laurent MONTEL", 0, 0, "lmontel@mandrakesoft.com"); - aboutData.addAuthor("Laurent MONTEL",0, "lmontel@mandrakesoft.com"); - KCmdLineArgs::init( argc, argv, &aboutData ); - KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. - - KApplication a; - Krootwarning *krootwarning = new Krootwarning(); - a.setMainWidget(krootwarning); - krootwarning->show(); - - return 0; -} diff --git a/krootwarning/krootwarning/pics/.cvsignore b/krootwarning/krootwarning/pics/.cvsignore deleted file mode 100644 index 70845e0..0000000 --- a/krootwarning/krootwarning/pics/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.in diff --git a/krootwarning/krootwarning/pics/Makefile.am b/krootwarning/krootwarning/pics/Makefile.am deleted file mode 100644 index 0197737..0000000 --- a/krootwarning/krootwarning/pics/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -data_DATA = ic-attention-64.png -datadir = $(kde_datadir)/krootwarning/pics - -EXTRA_DIST = $(data_DATA) - - diff --git a/krootwarning/krootwarning/pics/ic-attention-64.png b/krootwarning/krootwarning/pics/ic-attention-64.png Binary files differdeleted file mode 100644 index fbfe87c..0000000 --- a/krootwarning/krootwarning/pics/ic-attention-64.png +++ /dev/null diff --git a/krootwarning/krootwarning/templates/cpp_template b/krootwarning/krootwarning/templates/cpp_template deleted file mode 100644 index 6afef5d..0000000 --- a/krootwarning/krootwarning/templates/cpp_template +++ /dev/null @@ -1,16 +0,0 @@ -/*************************************************************************** - |FILENAME| - description - ------------------- - begin : |DATE| - copyright : (C) |YEAR| by |AUTHOR| - email : |EMAIL| - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ diff --git a/krootwarning/krootwarning/templates/header_template b/krootwarning/krootwarning/templates/header_template deleted file mode 100644 index 6afef5d..0000000 --- a/krootwarning/krootwarning/templates/header_template +++ /dev/null @@ -1,16 +0,0 @@ -/*************************************************************************** - |FILENAME| - description - ------------------- - begin : |DATE| - copyright : (C) |YEAR| by |AUTHOR| - email : |EMAIL| - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ |