Browse Source

Initial TQt conversion

tags/r14.0.0
Slávek Banko 6 years ago
parent
commit
cf4f444abb
40 changed files with 571 additions and 571 deletions
  1. +24
    -24
      acinclude.m4
  2. +23
    -23
      kshutdown/actions.cpp
  3. +13
    -13
      kshutdown/actions.h
  4. +21
    -21
      kshutdown/appobserver.cpp
  5. +13
    -13
      kshutdown/appobserver.h
  6. +1
    -1
      kshutdown/configuration.cpp
  7. +3
    -3
      kshutdown/configuration.h
  8. +12
    -12
      kshutdown/confirmation.cpp
  9. +1
    -1
      kshutdown/confirmation.h
  10. +21
    -21
      kshutdown/extras.cpp
  11. +12
    -12
      kshutdown/extras.h
  12. +1
    -1
      kshutdown/kshutdowniface.h
  13. +14
    -14
      kshutdown/kshutdowniface_skel.cpp
  14. +30
    -30
      kshutdown/kshutdowniface_stub.cpp
  15. +3
    -3
      kshutdown/kshutdowniface_stub.h
  16. +25
    -25
      kshutdown/links.cpp
  17. +14
    -14
      kshutdown/links.h
  18. +25
    -25
      kshutdown/mactioneditdialog.cpp
  19. +7
    -7
      kshutdown/mactioneditdialog.h
  20. +10
    -10
      kshutdown/main.cpp
  21. +22
    -22
      kshutdown/miscutils.cpp
  22. +15
    -15
      kshutdown/miscutils.h
  23. +65
    -65
      kshutdown/mmainwindow.cpp
  24. +14
    -14
      kshutdown/mmainwindow.h
  25. +20
    -20
      kshutdown/mmessagedialog.cpp
  26. +4
    -4
      kshutdown/mmessagedialog.h
  27. +58
    -58
      kshutdown/msettingsdialog.cpp
  28. +8
    -8
      kshutdown/msettingsdialog.h
  29. +19
    -19
      kshutdown/mstatstab.cpp
  30. +8
    -8
      kshutdown/mstatstab.h
  31. +6
    -6
      kshutdown/msystemtray.cpp
  32. +3
    -3
      kshutdown/msystemtray.h
  33. +6
    -6
      kshutdown/mtip.cpp
  34. +4
    -4
      kshutdown/mtip.h
  35. +11
    -11
      kshutdown/progressbar.cpp
  36. +4
    -4
      kshutdown/progressbar.h
  37. +12
    -12
      kshutdown/systemconfig.cpp
  38. +5
    -5
      kshutdown/systemconfig.h
  39. +11
    -11
      kshutdownlockout/lockout.cpp
  40. +3
    -3
      kshutdownlockout/lockout.h

+ 24
- 24
acinclude.m4 View File

@@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes=""
x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@@ -1092,19 +1092,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <ntqglobal.h>
#include <ntqapplication.h>
EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <ntqevent.h>
#include <ntqstring.h>
#include <ntqstyle.h>
EOF

if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210
#if TQT_VERSION < 210
#error 1
#endif
EOF
@@ -1113,8 +1113,8 @@ fi

if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF
#include <qcursor.h>
#include <qstylefactory.h>
#include <ntqcursor.h>
#include <ntqstylefactory.h>
#include <private/qucomextra_p.h>
EOF
fi
@@ -1201,22 +1201,22 @@ fi
if test -z "$3"; then
if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else
kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
fi
fi
if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222"
kde_qt_verstring="TQT_VERSION >= 222"
else
kde_qt_verstring="QT_VERSION >= 200"
kde_qt_verstring="TQT_VERSION >= 200"
fi
fi
if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi
else
kde_qt_verstring="$3"
@@ -1325,7 +1325,7 @@ AC_ARG_ENABLE(
USING_QT_MT=""

dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host.
dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------

KDE_MT_LDFLAGS=
@@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------
fi

dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------

if test "x$kde_use_qt_mt" = "xyes"; then
@@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi

if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h
kde_qt_header=ntqstyle.h
else
kde_qt_header=qglobal.h
kde_qt_header=ntqglobal.h
fi

AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@@ -2034,7 +2034,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"

AC_TRY_LINK([
#include <qdom.h>
#include <ntqdom.h>
],
[
QDomDocument doc;
@@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK(
[#include <qapplication.h>],
[#include <ntqapplication.h>],
[
int argc;
char** argv;
@@ -3397,7 +3397,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],

AC_TRY_COMPILE(
[
#include <qglobal.h>
#include <ntqglobal.h>
#if Q_EXPORT - 0 != 0
/* if this compiles, then Q_EXPORT is undefined */
/* if Q_EXPORT is nonempty, this will break compilation */
@@ -4635,7 +4635,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl
[
#include <qimageio.h>
#include <qstring.h>
#include <ntqstring.h>
int main() {
QString t = "hallo";
t.fill('t');
@@ -5480,7 +5480,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir"
fi

AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR)

AC_SUBST(QTDOCDIR)
@@ -5501,7 +5501,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER)

KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes
fi
AC_SUBST(KDE_HAS_DOXYGEN)


+ 23
- 23
kshutdown/actions.cpp View File

@@ -26,8 +26,8 @@
#include "msystemtray.h"
#include "systemconfig.h"

#include <qimage.h>
#include <qtimer.h>
#include <ntqimage.h>
#include <ntqtimer.h>

#include <dcopclient.h>
#include <kdebug.h>
@@ -42,7 +42,7 @@ Action::~Action()
{
}

QString Action::actionToConfigGroup(const Type action) const
TQString Action::actionToConfigGroup(const Type action) const
{
switch (action)
{
@@ -50,7 +50,7 @@ QString Action::actionToConfigGroup(const Type action) const
case Reboot: return "Reboot";
case LockScreen: return "Lock Screen";
case Logout: return "Logout";
default: return QString::null;
default: return TQString::null;
}
}

@@ -102,7 +102,7 @@ bool Action::exec(const Type action, const bool stopTimer)
_totalExit = false;

Method method = Method_KDE;
QString command;
TQString command;

if (!isEnabled(action))
return false; // error
@@ -195,7 +195,7 @@ bool Action::exec(const Type action, const bool stopTimer)
return false; // error
}

bool Action::execConfirm(const Type action, const QString &delay)
bool Action::execConfirm(const Type action, const TQString &delay)
{
if (
(action != LockScreen) && // no confirmation for "Lock Session"
@@ -211,19 +211,19 @@ bool Action::execCurrent()
return exec(_current);
}

QString Action::getCurrentName() const
TQString Action::getCurrentName() const
{
return getName(_current);
}

QPixmap Action::getIcon(const Type action) const
TQPixmap Action::getIcon(const Type action) const
{
QMapIterator<Type, QPixmap> i = iconCache->find(action);
TQMapIterator<Type, TQPixmap> i = iconCache->find(action);

return (i == iconCache->end()) ? SmallIcon("misc") : i.data();
}

QString Action::getIconName(const Type action) const
TQString Action::getIconName(const Type action) const
{
switch (action)
{
@@ -238,18 +238,18 @@ QString Action::getIconName(const Type action) const
}
}

QString Action::getMethod(const Action::Type action, Method &method, QString &command)
TQString Action::getMethod(const Action::Type action, Method &method, TQString &command)
{
QString group = actionToConfigGroup(action);
TQString group = actionToConfigGroup(action);

if (group.isNull())
{
// kdDebug() << "Action::getMethod: No group in config for action " << action << endl;

return QString::null;
return TQString::null;
}

QString defaultCommand;
TQString defaultCommand;
switch (action)
{
case ShutDown:
@@ -265,7 +265,7 @@ QString Action::getMethod(const Action::Type action, Method &method, QString &co
defaultCommand = DEFAULT_LOGOUT_COMMAND;
break;
default:
defaultCommand = QString::null;
defaultCommand = TQString::null;
}

KConfig *conf = kshutdownrc->config();
@@ -303,7 +303,7 @@ QString Action::getMethod(const Action::Type action, Method &method, QString &co
return defaultCommand;
}

void Action::setMethod(const QString &group, const Method method, const QString &command) const
void Action::setMethod(const TQString &group, const Method method, const TQString &command) const
{
KConfig *conf = kshutdownrc->config();
conf->setGroup(group);
@@ -312,7 +312,7 @@ void Action::setMethod(const QString &group, const Method method, const QString
conf->writeEntry("Method", method);
}

QString Action::getName(const Type action) const
TQString Action::getName(const Type action) const
{
switch (action)
{
@@ -330,7 +330,7 @@ QString Action::getName(const Type action) const
bool Action::isEnabled(const Type action)
{
Method m = Method_KDE;
QString c = QString::null;
TQString c = TQString::null;
switch (action)
{
case Nothing:
@@ -363,7 +363,7 @@ void Action::totalExec()
}

Action::Action()
: QObject(ks_main),
: TQObject(ks_main),
_active(false),
_testMode(false),
_totalExit(false),
@@ -371,7 +371,7 @@ Action::Action()
{
// NOTE: compatible with the standard KDE logout dialog
// NOTE: sync. with panel applet
iconCache = new QMap<Type, QPixmap>();
iconCache = new TQMap<Type, TQPixmap>();
#define KS_ADD_ICON(action) \
iconCache->insert(action, SmallIcon(getIconName(action)));
KS_ADD_ICON(Nothing);
@@ -384,7 +384,7 @@ Action::Action()

bool Action::lockScreen() {
Method method;
QString command;
TQString command;
getMethod(LockScreen, method, command);
MiscUtils::runCommandBeforeAction("Lock Screen");
if (method == Method_KDE) {
@@ -397,8 +397,8 @@ bool Action::lockScreen() {

// this is a modified "void Lockout::lock()"
// from the "Lock/Logout Applet" (lockout.cpp [3.1.4])
QCString kdesktop("kdesktop");
int kshutdown_screen_number = qt_xscreen();
TQCString kdesktop("kdesktop");
int kshutdown_screen_number = tqt_xscreen();
if (kshutdown_screen_number)
kdesktop.sprintf("kdesktop-screen-%d", kshutdown_screen_number);



+ 13
- 13
kshutdown/actions.h View File

@@ -23,7 +23,7 @@
#include <kapplication.h>

// default external commands
const QString
const TQString
DEFAULT_LOCK_SCREEN_COMMAND("xscreensaver-command -lock"),
// TODO: 2.0: logout command for GNOME (gnome-session-save --kill?)
DEFAULT_LOGOUT_COMMAND(""),
@@ -32,10 +32,10 @@ const QString

#define ks_actions Action::getInstance()

class QPixmap;
class TQPixmap;

/** @short An action manager. */
class Action: public QObject
class Action: public TQObject
{
Q_OBJECT
public:
@@ -67,7 +67,7 @@ public:
/**
* Converts @p action value to the configuration group name.
*/
QString actionToConfigGroup(const Type action) const;
TQString actionToConfigGroup(const Type action) const;

/**
* Returns @c true if the current action is active.
@@ -110,7 +110,7 @@ public:
* @param action An action to execute
* @param delay A selected delay
*/
bool execConfirm(const Type action, const QString &delay = QString::null);
bool execConfirm(const Type action, const TQString &delay = TQString::null);

/**
* Executes the current action without confirmation.
@@ -120,17 +120,17 @@ public:
/**
* Returns the current action name as text.
*/
QString getCurrentName() const;
TQString getCurrentName() const;

/**
* Returns an icon for @p action.
*/
QPixmap getIcon(const Type action) const;
TQPixmap getIcon(const Type action) const;

/**
* Returns an icon name for @p action.
*/
QString getIconName(const Type action) const;
TQString getIconName(const Type action) const;

/**
* Initializes and return singleton instance of the @c Action class.
@@ -150,10 +150,10 @@ public:
* @retval command A command to run
* @return A default command
*/
QString getMethod(
TQString getMethod(
const Type action,
Method &method,
QString &command
TQString &command
);

/**
@@ -162,13 +162,13 @@ public:
* @param method A new method
* @param command A new command
*/
void setMethod(const QString &group, const Method method, const QString &command) const;
void setMethod(const TQString &group, const Method method, const TQString &command) const;

/**
* Returns an action name as text.
* @param action An action
*/
QString getName(const Type action) const;
TQString getName(const Type action) const;

/** Returns @c true if @p action is @b not disabled by KIOSK. */
bool isEnabled(const Type action);
@@ -203,7 +203,7 @@ private:
_active,
_testMode,
_totalExit;
QMap<Type, QPixmap> *iconCache;
TQMap<Type, TQPixmap> *iconCache;
Type _current;
Action();
bool lockScreen();


+ 21
- 21
kshutdown/appobserver.cpp View File

@@ -26,10 +26,10 @@
#include <errno.h>
#include <signal.h>

#include <qcombobox.h>
#include <qlistbox.h>
#include <qprocess.h>
#include <qwhatsthis.h>
#include <ntqcombobox.h>
#include <ntqlistbox.h>
#include <ntqprocess.h>
#include <ntqwhatsthis.h>

#include <kdebug.h>
#include <kiconloader.h>
@@ -42,40 +42,40 @@

// public

AppObserver::AppObserver(QWidget *parent)
: QHBox(parent),
_processesMap(new QMap<int, Process>()),
AppObserver::AppObserver(TQWidget *parent)
: TQHBox(parent),
_processesMap(new TQMap<int, Process>()),
_process(0),
_buf(QString::null)
_buf(TQString::null)
{
setName("AppObserver");

// refresh button
b_refresh = new KPushButton(this, "KPushButton::b_refresh");
b_refresh->setIconSet(SmallIcon("reload"));
b_refresh->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
b_refresh->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred));
MiscUtils::setHint(b_refresh, i18n("Refresh the list of processes"));
connect(b_refresh, SIGNAL(clicked()), SLOT(slotRefresh()));

// processes combo box
cb_processes = new QComboBox(this, "QComboBox::cb_processes");
cb_processes = new TQComboBox(this, "TQComboBox::cb_processes");
cb_processes->setFocusPolicy(StrongFocus);
MiscUtils::setHint(cb_processes, i18n("List of the running processes"));

// kill button
b_kill = new KPushButton(SmallIcon("editdelete"), i18n("Kill"), this, "KPushButton::b_kill");
b_kill->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
b_kill->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred));
MiscUtils::setHint(b_kill, i18n("Kill the selected process"));
connect(b_kill, SIGNAL(clicked()), SLOT(slotKill()));
}

QString AppObserver::getInfo() const
TQString AppObserver::getInfo() const
{
int index = cb_processes->currentItem();
QMapIterator<int, Process> i = _processesMap->find(index);
TQMapIterator<int, Process> i = _processesMap->find(index);

if (i == _processesMap->end())
return QString::null;
return TQString::null;

return i18n("Waiting for \"%1\"").arg(i.data().command);
}
@@ -84,7 +84,7 @@ bool AppObserver::isSelectedProcessRunning() const
{
// TODO: 2.0: common code
int index = cb_processes->currentItem();
QMapIterator<int, Process> i = _processesMap->find(index);
TQMapIterator<int, Process> i = _processesMap->find(index);

if (i == _processesMap->end())
return false;
@@ -125,13 +125,13 @@ void AppObserver::refresh()
cb_processes->setEnabled(false);
b_kill->setEnabled(false);

_buf = QString::null;
_buf = TQString::null;
cb_processes->clear();
_processesMap->clear();

if (!_process)
{
_process = new QProcess(this);
_process = new TQProcess(this);
connect(_process, SIGNAL(processExited()), SLOT(slotProcessExit()));
connect(_process, SIGNAL(readyReadStdout()), SLOT(slotReadStdout()));
}
@@ -182,7 +182,7 @@ void AppObserver::setWidgetsEnabled(const bool yes) const
void AppObserver::slotKill()
{
int index = cb_processes->currentItem();
QMapIterator<int, Process> i = _processesMap->find(index);
TQMapIterator<int, Process> i = _processesMap->find(index);
// FIXME: 2.0: error message
if (i != _processesMap->end())
{
@@ -232,8 +232,8 @@ void AppObserver::slotProcessExit()
int index = 0;
int line = 0;
Process p;
QStringList list = QStringList::split(" ", _buf.simplifyWhiteSpace());
for (QStringList::Iterator i = list.begin(); i != list.end(); ++i)
TQStringList list = TQStringList::split(" ", _buf.simplifyWhiteSpace());
for (TQStringList::Iterator i = list.begin(); i != list.end(); ++i)
{
switch (line)
{
@@ -254,7 +254,7 @@ void AppObserver::slotProcessExit()
p.command = *i;
_processesMap->insert(index, p);
// kdDebug() << "USER=" << p.user << " PID=" << p.pid << " COMMAND=" << p.command << endl;
QString text = QString("%1 (pid %2, %3)")
TQString text = TQString("%1 (pid %2, %3)")
.arg(p.command)
.arg(p.pid)
.arg(p.user);


+ 13
- 13
kshutdown/appobserver.h View File

@@ -22,10 +22,10 @@

#include <sys/types.h>

#include <qhbox.h>
#include <ntqhbox.h>

class QComboBox;
class QProcess;
class TQComboBox;
class TQProcess;

class KPushButton;

@@ -37,14 +37,14 @@ class Process
private:
friend class AppObserver;
pid_t pid; /**< A process ID. */
QString command; /**< A process command (e.g. "firefox"). */
QString user; /**< An owner of the process (e.g. "root"). */
TQString command; /**< A process command (e.g. "firefox"). */
TQString user; /**< An owner of the process (e.g. "root"). */
};

/**
* An application observer/killer (stupid name ;-).
*/
class AppObserver: public QHBox
class AppObserver: public TQHBox
{
Q_OBJECT
public:
@@ -52,13 +52,13 @@ public:
* Constructor.
* @param parent A parent widget
*/
AppObserver(QWidget *parent);
AppObserver(TQWidget *parent);

/**
* Returns textual information about the current state,
* or @c QString::null.
* or @c TQString::null.
*/
QString getInfo() const;
TQString getInfo() const;

/**
* Returns @c true if selected process exists.
@@ -85,10 +85,10 @@ private:
KPushButton
*b_kill,
*b_refresh;
QComboBox *cb_processes;
QMap<int, Process> *_processesMap;
QProcess *_process;
QString _buf;
TQComboBox *cb_processes;
TQMap<int, Process> *_processesMap;
TQProcess *_process;
TQString _buf;
private slots:
void slotKill();
void slotProcessExit();


+ 1
- 1
kshutdown/configuration.cpp View File

@@ -51,7 +51,7 @@ Config::Config()
i = addItemInt("general_delay_type", generalDelayType, MMainWindow::DelayType_TimeFromNow, "DelayType");
i->setMinValue(MMainWindow::DelayType_Now);
i->setMaxValue(MMainWindow::DelayType_OnAppExit);
addItemDateTime("general_date_time", generalDateTime, QDateTime::currentDateTime(), "DelayTime");
addItemDateTime("general_date_time", generalDateTime, TQDateTime::currentDateTime(), "DelayTime");

// progress bar
setCurrentGroup("Progress Bar");


+ 3
- 3
kshutdown/configuration.h View File

@@ -37,19 +37,19 @@ public:
// automation
bool cdTrayClose;
ItemBool *i_cdTrayClose;
QString cdTrayCloseCommand;
TQString cdTrayCloseCommand;
ItemString *i_cdTrayCloseCommand;

// custom message
bool customMessageEnabled;
ItemBool *i_customMessageEnabled;
QString customMessageCommand;
TQString customMessageCommand;
ItemString *i_customMessageCommand;

// general
int generalAction;
int generalDelayType;
QDateTime generalDateTime;
TQDateTime generalDateTime;

// progress bar
bool progressBarEnabled;


+ 12
- 12
kshutdown/confirmation.cpp View File

@@ -31,11 +31,11 @@

// public

bool Confirmation::confirm(const Action::Type action, const QString &delay)
bool Confirmation::confirm(const Action::Type action, const TQString &delay)
{
KWin::setOnDesktop(ks_main->winId(), KWin::currentDesktop());

QWidget *parent;
TQWidget *parent;
if (ks_main->isVisible())
parent = ks_main;
else if (MSystemTray::isInstance() && ks_tray->isVisible())
@@ -44,18 +44,18 @@ bool Confirmation::confirm(const Action::Type action, const QString &delay)
parent = 0;

/*
QWidget *background = new QWidget(0, "QWidget::background", Qt::WType_Popup);
background->setBackgroundMode(Qt::NoBackground);
TQWidget *background = new TQWidget(0, "TQWidget::background", TQt::WType_Popup);
background->setBackgroundMode(TQt::NoBackground);
background->setGeometry(kapp->desktop()->geometry());
// Take screenshot - based on the aKregator's TrayIcon::takeScreenshot() (trayicon.cpp)
// and "ksmserver/shutdown.cpp".
QPixmap shot = QPixmap::grabWindow(
qt_xrootwin(),
TQPixmap shot = TQPixmap::grabWindow(
tqt_xrootwin(),
0, 0, // x, y
kapp->desktop()->width(), kapp->desktop()->height()
);
QImage shotImage = shot.convertToImage();
KImageEffect::flatten(shotImage, Qt::green, Qt::black);
TQImage shotImage = shot.convertToImage();
KImageEffect::flatten(shotImage, TQt::green, TQt::black);
bitBlt(background, 0, 0, &shotImage);
background->show();
*/
@@ -73,8 +73,8 @@ bool Confirmation::confirm(const Action::Type action, const QString &delay)
KGuiItem(i18n("&Cancel"), SmallIcon("button_cancel"))
);
bool checkboxResultDummy = false;
QString selectedTime = delay.isNull() ? i18n("Unknown") : delay;
QString text =
TQString selectedTime = delay.isNull() ? i18n("Unknown") : delay;
TQString text =
i18n("Are you sure?<br><br>Selected Action: <b>%1</b><br>Selected Time: <b>%2</b>")
.arg(ks_actions->getName(action))
.arg(selectedTime);
@@ -85,8 +85,8 @@ bool Confirmation::confirm(const Action::Type action, const QString &delay)
dialog,
MainBarIcon(ks_actions->getIconName(action), 32),
MiscUtils::HTML(text),
QStringList(),
QString::null,
TQStringList(),
TQString::null,
&checkboxResultDummy,
KMessageBox::Notify
) == KDialogBase::Yes);


+ 1
- 1
kshutdown/confirmation.h View File

@@ -32,7 +32,7 @@ public:
* @param delay A selected delay
* @return @c true if action has been confirmed; otherwise @c false
*/
static bool confirm(const Action::Type action, const QString &delay);
static bool confirm(const Action::Type action, const TQString &delay);
};

#endif // __CONFIRMATION_H__

+ 21
- 21
kshutdown/extras.cpp View File

@@ -23,7 +23,7 @@
#include "miscutils.h"
#include "mmainwindow.h"

#include <qdir.h>
#include <ntqdir.h>

#include <kdebug.h>
#include <kdesktopfile.h>
@@ -49,13 +49,13 @@ Extras::~Extras()
delete _menu;
}

void Extras::createButton(QWidget *parent)
void Extras::createButton(TQWidget *parent)
{
_button = new KPushButton(parent, "KPushButton::_button");
_button->hide();
_button->setPopup(_menu);
MiscUtils::setHint(_button, i18n("More actions..."));
setAction(QString::null, QString::null); /* evil */
setAction(TQString::null, TQString::null); /* evil */
}

bool Extras::execAction() const
@@ -73,16 +73,16 @@ bool Extras::execAction() const
return true; // ok
}

QString Extras::getActionDescription() const
TQString Extras::getActionDescription() const
{
return
_description.isEmpty()
? QString::null
? TQString::null
// "Substitute characters at the middle of a string by \"...\""
: KStringHandler::csqueeze(_description, 100);
}

void Extras::setAction(const QString &fileToExecute, const QString &description, QIconSet *icon)
void Extras::setAction(const TQString &fileToExecute, const TQString &description, TQIconSet *icon)
{
_description = description;
_fileToExecute = fileToExecute;
@@ -104,7 +104,7 @@ void Extras::setAction(const QString &fileToExecute, const QString &description,
// private

Extras::Extras()
: QObject(ks_main, "Extras"),
: TQObject(ks_main, "Extras"),
_idToFileMap(0) // initialized in getIdToFileMap()
{
_menu = new KPopupMenu(0, "KPopupMenu::_menu");
@@ -113,19 +113,19 @@ Extras::Extras()
}

// TODO: 2.0: recent items
void Extras::buildMenu(KPopupMenu *parentMenu, const QString &subdir)
void Extras::buildMenu(KPopupMenu *parentMenu, const TQString &subdir)
{
int id;
QDir d(subdir);
QFileInfo fi;
QString
TQDir d(subdir);
TQFileInfo fi;
TQString
description,
icon,
mimeType,
name,
path;

QStringList list = d.entryList(QDir::DefaultFilter, QDir::Name | QDir::DirsFirst);
TQStringList list = d.entryList(TQDir::DefaultFilter, TQDir::Name | TQDir::DirsFirst);
list.remove(".");
list.remove("..");

@@ -223,7 +223,7 @@ bool Extras::execFile() const


// HACK: It seems that KRun::runURL sometimes does not work for hibernate :/ ?
QFileInfo fi(_fileToExecute);
TQFileInfo fi(_fileToExecute);
if (fi.fileName() == "hibernate.desktop") {
kdDebug() << "Extras::execFile(): Using hacked run..." << endl;

@@ -241,10 +241,10 @@ bool Extras::execFile() const
}
}

QMap<int, QString> *Extras::getIdToFileMap()
TQMap<int, TQString> *Extras::getIdToFileMap()
{
if (!_idToFileMap)
_idToFileMap = new QMap<int, QString>;
_idToFileMap = new TQMap<int, TQString>;

return _idToFileMap;
}
@@ -275,10 +275,10 @@ void Extras::slotModify()

void Extras::slotActivated(int id)
{
QMap<int, QString>::iterator i = getIdToFileMap()->find(id);
TQMap<int, TQString>::iterator i = getIdToFileMap()->find(id);
if (i == getIdToFileMap()->end())
{
setAction(QString::null, QString::null);
setAction(TQString::null, TQString::null);
KMessageBox::error(
0,
"Internal error!\nSelected menu item is broken.",
@@ -293,14 +293,14 @@ void Extras::slotActivated(int id)

void Extras::slotShowMenu()
{
setAction(QString::null, QString::null);
setAction(TQString::null, TQString::null);
_menu->clear(); // reset menu
getIdToFileMap()->clear(); // reset map
QStringList extrasDirs(KGlobal::dirs()->findDirs("data", "kshutdown/extras"));
QStringList::ConstIterator
TQStringList extrasDirs(KGlobal::dirs()->findDirs("data", "kshutdown/extras"));
TQStringList::ConstIterator
begin = extrasDirs.begin(),
end = extrasDirs.end();
for (QStringList::ConstIterator it = begin; it != end; ++it)
for (TQStringList::ConstIterator it = begin; it != end; ++it)
{
if ((it != begin) && (_menu->count() > 0))
_menu->insertSeparator();


+ 12
- 12
kshutdown/extras.h View File

@@ -20,8 +20,8 @@
#ifndef __EXTRAS_H__
#define __EXTRAS_H__

#include <qobject.h>
#include <qiconset.h>
#include <ntqobject.h>
#include <ntqiconset.h>

class KPopupMenu;
class KPushButton;
@@ -29,7 +29,7 @@ class KPushButton;
#define ks_extras Extras::getInstance()

/** @short Extras - user commands stored in "extras" directory. */
class Extras: public QObject
class Extras: public TQObject
{
Q_OBJECT
public:
@@ -47,7 +47,7 @@ public:
* Creates the @b Extras button.
* @param parent A parent widget
*/
void createButton(QWidget *parent);
void createButton(TQWidget *parent);

/**
* Executes an "extras" action previously selected from the menu.
@@ -58,13 +58,13 @@ public:
/**
* Returns a file name which will be executed by @ref execAction.
*/
inline QString fileToExecute() const { return _fileToExecute; }
inline TQString fileToExecute() const { return _fileToExecute; }

/**
* Returns a full description of the action,
* or @c QString::null if no action.
* or @c TQString::null if no action.
*/
QString getActionDescription() const;
TQString getActionDescription() const;

/**
* Initializes and returns the instance of the "extras" manager.
@@ -77,13 +77,13 @@ public:
return _instance;
}
void setAction(const QString &fileToExecute, const QString &description, QIconSet *icon = 0);
void setAction(const TQString &fileToExecute, const TQString &description, TQIconSet *icon = 0);
private:
static Extras *_instance;
KPopupMenu *_menu;
KPushButton *_button;
QMap<int, QString> *_idToFileMap;
QString
TQMap<int, TQString> *_idToFileMap;
TQString
_description,
_fileToExecute;
Extras();
@@ -93,10 +93,10 @@ private:
* @param parentMenu A parent menu
* @param subdir A subdirectory
*/
void buildMenu(KPopupMenu *parentMenu, const QString &subdir);
void buildMenu(KPopupMenu *parentMenu, const TQString &subdir);

bool execFile() const;
QMap<int, QString> *getIdToFileMap();
TQMap<int, TQString> *getIdToFileMap();
public slots:
/**
* Opens the "extras" directory in the @b Konqueror.


+ 1
- 1
kshutdown/kshutdowniface.h View File

@@ -76,7 +76,7 @@ k_dcop:
* (e.g. "Idle", "Busy", "1 minute warning", etc).
* Can be used in Karamba themes, for example.
*/
virtual QString getStatusInfo() = 0;
virtual TQString getStatusInfo() = 0;

/**
* Hides the main window and its system tray icon.


+ 14
- 14
kshutdown/kshutdowniface_skel.cpp View File

@@ -9,7 +9,7 @@
#include "kshutdowniface.h"

#include <kdatastream.h>
#include <qasciidict.h>
#include <ntqasciidict.h>


static const int KShutdownIface_fhash = 13;
@@ -21,7 +21,7 @@ static const char* const KShutdownIface_ftable[12][3] = {
{ "bool", "lockScreen()", "lockScreen()" },
{ "bool", "logout()", "logout()" },
{ "ASYNC", "configure()", "configure()" },
{ "QString", "getStatusInfo()", "getStatusInfo()" },
{ "TQString", "getStatusInfo()", "getStatusInfo()" },
{ "void", "makeInvisible()", "makeInvisible()" },
{ "ASYNC", "makeVisible()", "makeVisible()" },
{ "ASYNC", "setTestMode(bool)", "setTestMode(bool yes)" },
@@ -41,11 +41,11 @@ static const int KShutdownIface_ftable_hiddens[11] = {
0,
};

bool KShutdownIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
bool KShutdownIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
static QAsciiDict<int>* fdict = 0;
static TQAsciiDict<int>* fdict = 0;
if ( !fdict ) {
fdict = new QAsciiDict<int>( KShutdownIface_fhash, true, false );
fdict = new TQAsciiDict<int>( KShutdownIface_fhash, true, false );
for ( int i = 0; KShutdownIface_ftable[i][1]; i++ )
fdict->insert( KShutdownIface_ftable[i][1], new int( i ) );
}
@@ -57,36 +57,36 @@ bool KShutdownIface::process(const QCString &fun, const QByteArray &data, QCStri
} break;
case 1: { // bool shutDown()
replyType = KShutdownIface_ftable[1][0];
QDataStream _replyStream( replyData, IO_WriteOnly );
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << shutDown( );
} break;
case 2: { // bool shutdown()
replyType = KShutdownIface_ftable[2][0];
QDataStream _replyStream( replyData, IO_WriteOnly );
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << shutdown( );
} break;
case 3: { // bool reboot()
replyType = KShutdownIface_ftable[3][0];
QDataStream _replyStream( replyData, IO_WriteOnly );
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << reboot( );
} break;
case 4: { // bool lockScreen()
replyType = KShutdownIface_ftable[4][0];
QDataStream _replyStream( replyData, IO_WriteOnly );
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << lockScreen( );
} break;
case 5: { // bool logout()
replyType = KShutdownIface_ftable[5][0];
QDataStream _replyStream( replyData, IO_WriteOnly );
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << logout( );
} break;
case 6: { // void configure()
replyType = KShutdownIface_ftable[6][0];
configure( );
} break;
case 7: { // QString getStatusInfo()
case 7: { // TQString getStatusInfo()
replyType = KShutdownIface_ftable[7][0];
QDataStream _replyStream( replyData, IO_WriteOnly );
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << getStatusInfo( );
} break;
case 8: { // void makeInvisible()
@@ -99,7 +99,7 @@ bool KShutdownIface::process(const QCString &fun, const QByteArray &data, QCStri
} break;
case 10: { // void setTestMode(bool)
bool arg0;
QDataStream arg( data, IO_ReadOnly );
TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = KShutdownIface_ftable[10][0];
@@ -124,7 +124,7 @@ QCStringList KShutdownIface::functions()
for ( int i = 0; KShutdownIface_ftable[i][2]; i++ ) {
if (KShutdownIface_ftable_hiddens[i])
continue;
QCString func = KShutdownIface_ftable[i][0];
TQCString func = KShutdownIface_ftable[i][0];
func += ' ';
func += KShutdownIface_ftable[i][2];
funcs << func;


+ 30
- 30
kshutdown/kshutdowniface_stub.cpp View File

@@ -12,12 +12,12 @@
#include <kdatastream.h>


KShutdownIface_stub::KShutdownIface_stub( const QCString& app, const QCString& obj )
KShutdownIface_stub::KShutdownIface_stub( const TQCString& app, const TQCString& obj )
: DCOPStub( app, obj )
{
}

KShutdownIface_stub::KShutdownIface_stub( DCOPClient* client, const QCString& app, const QCString& obj )
KShutdownIface_stub::KShutdownIface_stub( DCOPClient* client, const TQCString& app, const TQCString& obj )
: DCOPStub( client, app, obj )
{
}
@@ -33,7 +33,7 @@ void KShutdownIface_stub::cancel()
setStatus( CallFailed );
return;
}
QByteArray data;
TQByteArray data;
dcopClient()->send( app(), obj(), "cancel()", data );
setStatus( CallSucceeded );
}
@@ -45,11 +45,11 @@ bool KShutdownIface_stub::shutDown()
setStatus( CallFailed );
return result;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "shutDown()", data, replyType, replyData ) ) {
if ( replyType == "bool" ) {
QDataStream _reply_stream( replyData, IO_ReadOnly );
TQDataStream _reply_stream( replyData, IO_ReadOnly );
_reply_stream >> result;
setStatus( CallSucceeded );
} else {
@@ -68,11 +68,11 @@ bool KShutdownIface_stub::shutdown()
setStatus( CallFailed );
return result;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "shutdown()", data, replyType, replyData ) ) {
if ( replyType == "bool" ) {
QDataStream _reply_stream( replyData, IO_ReadOnly );
TQDataStream _reply_stream( replyData, IO_ReadOnly );
_reply_stream >> result;
setStatus( CallSucceeded );
} else {
@@ -91,11 +91,11 @@ bool KShutdownIface_stub::reboot()
setStatus( CallFailed );
return result;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "reboot()", data, replyType, replyData ) ) {
if ( replyType == "bool" ) {
QDataStream _reply_stream( replyData, IO_ReadOnly );
TQDataStream _reply_stream( replyData, IO_ReadOnly );
_reply_stream >> result;
setStatus( CallSucceeded );
} else {
@@ -114,11 +114,11 @@ bool KShutdownIface_stub::lockScreen()
setStatus( CallFailed );
return result;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "lockScreen()", data, replyType, replyData ) ) {
if ( replyType == "bool" ) {
QDataStream _reply_stream( replyData, IO_ReadOnly );
TQDataStream _reply_stream( replyData, IO_ReadOnly );
_reply_stream >> result;
setStatus( CallSucceeded );
} else {
@@ -137,11 +137,11 @@ bool KShutdownIface_stub::logout()
setStatus( CallFailed );
return result;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "logout()", data, replyType, replyData ) ) {
if ( replyType == "bool" ) {
QDataStream _reply_stream( replyData, IO_ReadOnly );
TQDataStream _reply_stream( replyData, IO_ReadOnly );
_reply_stream >> result;
setStatus( CallSucceeded );
} else {
@@ -159,23 +159,23 @@ void KShutdownIface_stub::configure()
setStatus( CallFailed );
return;
}
QByteArray data;
TQByteArray data;
dcopClient()->send( app(), obj(), "configure()", data );
setStatus( CallSucceeded );
}

QString KShutdownIface_stub::getStatusInfo()
TQString KShutdownIface_stub::getStatusInfo()
{
QString result;
TQString result;
if ( !dcopClient() ) {
setStatus( CallFailed );
return result;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "getStatusInfo()", data, replyType, replyData ) ) {
if ( replyType == "QString" ) {
QDataStream _reply_stream( replyData, IO_ReadOnly );
if ( replyType == "TQString" ) {
TQDataStream _reply_stream( replyData, IO_ReadOnly );
_reply_stream >> result;
setStatus( CallSucceeded );
} else {
@@ -193,8 +193,8 @@ void KShutdownIface_stub::makeInvisible()
setStatus( CallFailed );
return;
}
QByteArray data, replyData;
QCString replyType;
TQByteArray data, replyData;
TQCString replyType;
if ( dcopClient()->call( app(), obj(), "makeInvisible()", data, replyType, replyData ) ) {
setStatus( CallSucceeded );
} else {
@@ -208,7 +208,7 @@ void KShutdownIface_stub::makeVisible()
setStatus( CallFailed );
return;
}
QByteArray data;
TQByteArray data;
dcopClient()->send( app(), obj(), "makeVisible()", data );
setStatus( CallSucceeded );
}
@@ -219,8 +219,8 @@ void KShutdownIface_stub::setTestMode( bool arg0 )
setStatus( CallFailed );
return;
}
QByteArray data;
QDataStream arg( data, IO_WriteOnly );
TQByteArray data;
TQDataStream arg( data, IO_WriteOnly );
arg << arg0;
dcopClient()->send( app(), obj(), "setTestMode(bool)", data );
setStatus( CallSucceeded );


+ 3
- 3
kshutdown/kshutdowniface_stub.h View File

@@ -16,8 +16,8 @@
class KShutdownIface_stub : virtual public DCOPStub
{
public:
KShutdownIface_stub( const QCString& app, const QCString& id );
KShutdownIface_stub( DCOPClient* client, const QCString& app, const QCString& id );
KShutdownIface_stub( const TQCString& app, const TQCString& id );
KShutdownIface_stub( DCOPClient* client, const TQCString& app, const TQCString& id );
explicit KShutdownIface_stub( const DCOPRef& ref );
virtual ASYNC cancel();
virtual bool shutDown();
@@ -26,7 +26,7 @@ public:
virtual bool lockScreen();
virtual bool logout();
virtual ASYNC configure();
virtual QString getStatusInfo();
virtual TQString getStatusInfo();
virtual void makeInvisible();
virtual ASYNC makeVisible();
virtual ASYNC setTestMode( bool yes );


+ 25
- 25
kshutdown/links.cpp View File

@@ -21,9 +21,9 @@
#include "links.h"
#include "miscutils.h"

#include <qcombobox.h>
#include <qfile.h>
#include <qlabel.h>
#include <ntqcombobox.h>
#include <ntqfile.h>
#include <ntqlabel.h>

#include <kapplication.h>
#include <kdesktopfile.h>
@@ -36,8 +36,8 @@

// public

Links::Links(QWidget *parent)
: QVBox(parent, "Links")
Links::Links(TQWidget *parent)
: TQVBox(parent, "Links")
{
setSpacing(5);
int alignment = AlignVCenter;
@@ -45,11 +45,11 @@ Links::Links(QWidget *parent)


// location
QHBox *w_location = new QHBox(this);
TQHBox *w_location = new TQHBox(this);
w_location->setSpacing(5);
QLabel *l_location = new QLabel(i18n("Location where to create the link:"), w_location);
TQLabel *l_location = new TQLabel(i18n("Location where to create the link:"), w_location);
l_location->setAlignment(alignment);
cb_location = new QComboBox(w_location, "QComboBox::cb_location");
cb_location = new TQComboBox(w_location, "TQComboBox::cb_location");
cb_location->setFocusPolicy(StrongFocus);
cb_location->insertItem(SmallIcon("desktop"), i18n("Desktop"));
cb_location->insertItem(SmallIcon("kmenu"), i18n("K Menu"));
@@ -57,11 +57,11 @@ Links::Links(QWidget *parent)
connect(cb_location, SIGNAL(activated(int)), SLOT(slotActivated(int)));

// type
QHBox *w_type = new QHBox(this);
TQHBox *w_type = new TQHBox(this);
w_type->setSpacing(5);
QLabel *l_type = new QLabel(i18n("Type of the link:"), w_type);
TQLabel *l_type = new TQLabel(i18n("Type of the link:"), w_type);
l_type->setAlignment(alignment);
cb_type = new QComboBox(w_type, "QComboBox::cb_type");
cb_type = new TQComboBox(w_type, "TQComboBox::cb_type");
cb_type->setFocusPolicy(StrongFocus);
cb_type->insertItem(kapp->miniIcon(), "KShutDown");

@@ -82,7 +82,7 @@ Links::Links(QWidget *parent)
updateAddRemoveButton();
}

void Links::createLink(const QString &path, const QString &command, const QString &icon, const QString &name, const QString &comment)
void Links::createLink(const TQString &path, const TQString &command, const TQString &icon, const TQString &name, const TQString &comment)
{
if (path.isNull())
return;
@@ -99,7 +99,7 @@ void Links::createLink(const QString &path, const QString &command, const QStrin
df->writeEntry("Type", "Application");
delete df;

if (!QFile::exists(path))
if (!TQFile::exists(path))
{
KMessageBox::error(
0,
@@ -108,9 +108,9 @@ void Links::createLink(const QString &path, const QString &command, const QStrin
}
}

void Links::removeLink(const QString &path)
void Links::removeLink(const TQString &path)
{
if (QFile::exists(path) && !QFile::remove(path))
if (TQFile::exists(path) && !TQFile::remove(path))
{
KMessageBox::error(
0,
@@ -121,9 +121,9 @@ void Links::removeLink(const QString &path)

// private

QString Links::getCurrentLocationPath() const
TQString Links::getCurrentLocationPath() const
{
QString path;
TQString path;
switch (cb_location->currentItem())
{
case 0:
@@ -133,7 +133,7 @@ QString Links::getCurrentLocationPath() const
path = locateLocal("apps", "") + "/";
break;
default:
return QString::null;
return TQString::null;
}
switch (cb_type->currentItem())
{
@@ -143,11 +143,11 @@ QString Links::getCurrentLocationPath() const
case 3: return path += "kshutdown-reboot.desktop";
case 4: return path += "kshutdown-lock.desktop";
case 5: return path += "kshutdown-logout.desktop";
default: return QString::null;
default: return TQString::null;
}
}

QString Links::getCurrentTypeCommand() const
TQString Links::getCurrentTypeCommand() const
{
switch (cb_type->currentItem())
{
@@ -157,11 +157,11 @@ QString Links::getCurrentTypeCommand() const
case 3: return "kshutdown --confirm --reboot";
case 4: return "kshutdown --confirm --lock";
case 5: return "kshutdown --confirm --logout";
default: return QString::null;
default: return TQString::null;
}
}

QString Links::getCurrentTypeIcon() const
TQString Links::getCurrentTypeIcon() const
{
switch (cb_type->currentItem())
{
@@ -172,12 +172,12 @@ QString Links::getCurrentTypeIcon() const
case 3: return "reload";
case 4: return "lock";
case 5: return "undo";
default: return QString::null;
default: return TQString::null;
}
}

void Links::updateAddRemoveButton() {
if (QFile::exists(getCurrentLocationPath())) {
if (TQFile::exists(getCurrentLocationPath())) {
b_addRemoveLink->setIconSet(SmallIcon("editdelete"));
b_addRemoveLink->setText(i18n("Remove Link"));
}
@@ -194,7 +194,7 @@ void Links::slotActivated(int/* index*/) {
}

void Links::slotAddRemoveLink() {
if (QFile::exists(getCurrentLocationPath())) {
if (TQFile::exists(getCurrentLocationPath())) {
removeLink(getCurrentLocationPath());
}
else {


+ 14
- 14
kshutdown/links.h View File

@@ -20,13 +20,13 @@
#ifndef __LINKS_H__
#define __LINKS_H__

#include <qvbox.h>
#include <ntqvbox.h>

class KPushButton;
class QComboBox;
class TQComboBox;

/** @short A link creator/remover. */
class Links: public QVBox
class Links: public TQVBox
{
Q_OBJECT
public:
@@ -34,7 +34,7 @@ public:
* Constructor.
* @param parent A parent widget
*/
Links(QWidget *parent);
Links(TQWidget *parent);

/**
* Creates a new <b>.desktop</b> file.
@@ -45,26 +45,26 @@ public:
* @param comment A comment
*/
static void createLink(
const QString &path,
const QString &command,
const QString &icon,
const QString &name,
const QString &comment
const TQString &path,
const TQString &command,
const TQString &icon,
const TQString &name,
const TQString &comment
);

/**
* Removes a <b>.desktop</b> file.
* @param path A <b>.desktop</b> file to remove
*/
static void removeLink(const QString &path);
static void removeLink(const TQString &path);
private:
KPushButton *b_addRemoveLink;
QComboBox
TQComboBox
*cb_location,
*cb_type;
QString getCurrentLocationPath() const;
QString getCurrentTypeCommand() const;
QString getCurrentTypeIcon() const;
TQString getCurrentLocationPath() const;
TQString getCurrentTypeCommand() const;
TQString getCurrentTypeIcon() const;
void updateAddRemoveButton();
private slots:
void slotActivated(int index);


+ 25
- 25
kshutdown/mactioneditdialog.cpp View File

@@ -22,21 +22,21 @@
#include "miscutils.h"
#include "mtip.h"

#include <qcheckbox.h>
#include <qcombobox.h>
#include <qhbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qvgroupbox.h>
#include <qwhatsthis.h>
#include <ntqcheckbox.h>
#include <ntqcombobox.h>
#include <ntqhbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqvbox.h>
#include <ntqvgroupbox.h>
#include <ntqwhatsthis.h>

#include <klineedit.h>
#include <klocale.h>
#include <knuminput.h>
#include <kpushbutton.h>

MActionEditDialog::MActionEditDialog(QWidget *parent, Action::Type action)
MActionEditDialog::MActionEditDialog(TQWidget *parent, Action::Type action)
: KDialogBase(
parent,
"MActionEditDialog",
@@ -49,42 +49,42 @@ MActionEditDialog::MActionEditDialog(QWidget *parent, Action::Type action)
_action(action),
_userCommand("")
{
QVBox *main = new QVBox(this);
TQVBox *main = new TQVBox(this);
setMainWidget(main);

// title
l_title = new QLabel(main);
QFont f = QFont(l_title->font());
l_title = new TQLabel(main);
TQFont f = TQFont(l_title->font());
f.setPointSize(16);
l_title->setFont(f);
l_title->setMargin(10);

QHBox *gb_south = new QHBox(main);
TQHBox *gb_south = new TQHBox(main);
gb_south->setSpacing(5);

QVBox *gb_widgets = new QVBox(gb_south);
TQVBox *gb_widgets = new TQVBox(gb_south);

QVGroupBox *gb_method = new QVGroupBox(i18n("Method"), gb_widgets);
TQVGroupBox *gb_method = new TQVGroupBox(i18n("Method"), gb_widgets);

// method label
QLabel *l_method = new QLabel(i18n("Select a method:"), gb_method);
TQLabel *l_method = new TQLabel(i18n("Select a method:"), gb_method);

// method combo box
_methods = new QComboBox(gb_method, "QComboBox::_methods");
_methods = new TQComboBox(gb_method, "TQComboBox::_methods");
_methods->setFocusPolicy(StrongFocus);
_methods->insertItem(i18n("KDE (default)"));
l_method->setBuddy(_methods);
connect(_methods, SIGNAL(activated(int)), SLOT(slotMethodChange(int)));

// command label
l_command = new QLabel(i18n("Enter a custom command:"), gb_method);
l_command = new TQLabel(i18n("Enter a custom command:"), gb_method);

// command edit line
in_command = new KLineEdit(gb_method, "KLineEdit::in_command");
l_command->setBuddy(in_command);

QVGroupBox *gb_commandBeforeAction = new QVGroupBox(i18n("Command before action"), gb_widgets);
c_runCommandBeforeAction = new QCheckBox(i18n("Run command"), gb_commandBeforeAction);
TQVGroupBox *gb_commandBeforeAction = new TQVGroupBox(i18n("Command before action"), gb_widgets);
c_runCommandBeforeAction = new TQCheckBox(i18n("Run command"), gb_commandBeforeAction);
i_commandBeforeAction = new KLineEdit(gb_commandBeforeAction, "KLineEdit::i_commandBeforeAction");
i_commandBeforeActionPause = new KIntNumInput(gb_commandBeforeAction, "KIntNumInput::i_commandBeforeActionPause");
i_commandBeforeActionPause->setLabel(i18n("Pause after run command:"));
@@ -124,11 +124,11 @@ MActionEditDialog::MActionEditDialog(QWidget *parent, Action::Type action)
connect(this, SIGNAL(okClicked()), SLOT(slotOKClicked()));

Action::Method m = Action::Method_KDE;
QString c;
QString group = ks_actions->actionToConfigGroup(_action);
TQString c;
TQString group = ks_actions->actionToConfigGroup(_action);
_methods->insertItem(ks_actions->getMethod(_action, m, c));

QString s = ks_actions->getName(_action);
TQString s = ks_actions->getName(_action);
l_title->setText(s);
setCaption(s);

@@ -196,8 +196,8 @@ void MActionEditDialog::slotMethodChange(int index)
void MActionEditDialog::slotOKClicked()
{
Action::Method m;
QString c;
QString group = ks_actions->actionToConfigGroup(_action);
TQString c;
TQString group = ks_actions->actionToConfigGroup(_action);

// method
m = (Action::Method)_methods->currentItem();


+ 7
- 7
kshutdown/mactioneditdialog.h View File

@@ -24,8 +24,8 @@

#include <kdialogbase.h>

class QCheckBox;
class QComboBox;
class TQCheckBox;
class TQComboBox;

class KIntNumInput;
class KLineEdit;
@@ -44,20 +44,20 @@ public:
* @param parent A parent widget
* @param action An action type to edit
*/
MActionEditDialog(QWidget *parent, const Action::Type action);
MActionEditDialog(TQWidget *parent, const Action::Type action);

/** Destructor. */
virtual ~MActionEditDialog();
private:
Action::Type _action;
QComboBox *_methods;
QLabel
TQComboBox *_methods;
TQLabel
*l_command,
*l_title;
QString _userCommand;
TQString _userCommand;
KLineEdit *in_command;
// command before action
QCheckBox *c_runCommandBeforeAction;
TQCheckBox *c_runCommandBeforeAction;
KLineEdit *i_commandBeforeAction;
KIntNumInput *i_commandBeforeActionPause;
KPushButton *b_testCommandBeforeAction;


+ 10
- 10
kshutdown/main.cpp View File

@@ -24,7 +24,7 @@
#include "mmainwindow.h"
#include "msystemtray.h"

#include <qfileinfo.h>
#include <ntqfileinfo.h>

#include <kaboutdata.h>
#include <kcmdlineargs.h>
@@ -34,7 +34,7 @@

// 0.1.x, 0.3.x, etc - Unstable, Beta
// 0.2.x, 0.4.x, etc - Stable
QString version = "1.0.4";
TQString version = "1.0.4";

KAboutData aboutData(
"kshutdown", // internal name
@@ -107,7 +107,7 @@ private:
isTimeArg,
now,
timeArgIsValid;
QString timeArg;
TQString timeArg;
int doExecAction(const Action::Type action);
int doProcessArgs(const KCmdLineArgs *args);
};
@@ -211,7 +211,7 @@ int KShutDownApplication::doProcessArgs(const KCmdLineArgs *args) {
// read time arg.
bool absoluteTime = false;
int minutes = 0;
QDateTime dt = QDateTime::currentDateTime();
TQDateTime dt = TQDateTime::currentDateTime();
if (args->count()) {
timeArg = args->arg(0); // first arg. is a "time" arg.
if (!timeArg.isEmpty()) {
@@ -233,7 +233,7 @@ int KShutDownApplication::doProcessArgs(const KCmdLineArgs *args) {
else {
absoluteTime = true;
// FIXME: 2.0: AM/PM
QTime t = QTime::fromString(timeArg);
TQTime t = TQTime::fromString(timeArg);
if (t.isValid() && !t.isNull()) { // HH:MM[:SS]?
ok = true;
dt.setTime(t);
@@ -298,7 +298,7 @@ int KShutDownApplication::doProcessArgs(const KCmdLineArgs *args) {
else
{
ks_main->setDelayType(MMainWindow::DelayType_TimeFromNow);
ks_main->setTime(QTime().addSecs(minutes * 60));
ks_main->setTime(TQTime().addSecs(minutes * 60));
}
}
ks_main->makeVisible();
@@ -308,16 +308,16 @@ int KShutDownApplication::doProcessArgs(const KCmdLineArgs *args) {

// extra
if (args->isSet("extra")) {
QString extrasCommand = args->getOption("extra");
TQString extrasCommand = args->getOption("extra");
if (!extrasCommand.isEmpty()) {
QFileInfo extra(extrasCommand);
TQFileInfo extra(extrasCommand);
if (extra.exists()) {
ks_extras->setAction(extra.filePath(), extra.baseName());
return doExecAction(Action::Extras);
}
else {
qWarning("ERROR: File \"%s\" does not exist", extrasCommand.latin1());
tqWarning("ERROR: File \"%s\" does not exist", extrasCommand.latin1());
}
}
@@ -368,7 +368,7 @@ int main(int argc, char **argv)
aboutData.addCredit("Paulo Zambon", "Portuguese Brazil translation", "pzambon ( at ) astornet.com.br");
aboutData.addCredit("Philipp Weissenbacher");
aboutData.addCredit("Piotr Budny");
aboutData.addCredit("Quique", "Spanish translation", "quique ( at ) sindominio.net");
aboutData.addCredit("Quique", "Spanish translation", "tquique ( at ) sindominio.net");
aboutData.addCredit("Robert Kratky", "Czech translation", "kratky ( at ) rob.cz");
aboutData.addCredit("Romain Beauxis", "Debian Package", "", "http://www.cti.ecp.fr/~beauxir5/debian/");
aboutData.addCredit("Spider (ALT Linux)", "Russian translation");


+ 22
- 22
kshutdown/miscutils.cpp View File

@@ -24,9 +24,9 @@
#include "mmainwindow.h"
#include "msystemtray.h"

#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

#include <kaction.h>
#include <kdebug.h>
@@ -47,9 +47,9 @@ void MiscUtils::closeCDTray()
runShellCommand(kshutdownrc->cdTrayCloseCommand, KProcess::Block);
}

void MiscUtils::customMessage(const QString &text, const QString &testCommand)
void MiscUtils::customMessage(const TQString &text, const TQString &testCommand)
{
QString c;
TQString c;
if (testCommand.isNull())
c = kshutdownrc->customMessageCommand;
else
@@ -64,7 +64,7 @@ void MiscUtils::customMessage(const QString &text, const QString &testCommand)
}
}

QString MiscUtils::formatDateTime(const int secs, const QString &format)
TQString MiscUtils::formatDateTime(const int secs, const TQString &format)
{
if ((secs >= 86400) || (secs < 0)) // 24h
return ">24";
@@ -72,7 +72,7 @@ QString MiscUtils::formatDateTime(const int secs, const QString &format)
int h = secs / 3600;
int m = (secs / 60) % 60;
int s = secs % 60;
QTime t(h, m, s);
TQTime t(h, m, s);

if (format.isNull())
return t.toString();
@@ -80,9 +80,9 @@ QString MiscUtils::formatDateTime(const int secs, const QString &format)
return t.toString(format);
}

QString MiscUtils::formatDateTime(const QDateTime &dt)
TQString MiscUtils::formatDateTime(const TQDateTime &dt)
{
QDateTime now = QDateTime::currentDateTime();
TQDateTime now = TQDateTime::currentDateTime();

return
dt.toString(
@@ -93,7 +93,7 @@ QString MiscUtils::formatDateTime(const QDateTime &dt)
" (+" + formatDateTime(now.secsTo(dt), "hh:mm") + ")";
}

bool MiscUtils::isRestricted(const QString &key)
bool MiscUtils::isRestricted(const TQString &key)
{
return !kapp->authorize("kshutdown_" + key);
}
@@ -123,7 +123,7 @@ void MiscUtils::notifyUser(const int secs)
}
}

void MiscUtils::passiveMessage(const QString &text, QWidget *parent) {
void MiscUtils::passiveMessage(const TQString &text, TQWidget *parent) {
KPassivePopup *popup = KPassivePopup::message(
"KShutDown",
text,
@@ -138,13 +138,13 @@ void MiscUtils::plug(const KAction *action, KPushButton *pushButton) {
pushButton->disconnect(); // disconnect all
pushButton->connect(pushButton, SIGNAL(clicked()), action, SLOT(activate()));
pushButton->setIconSet(action->iconSet());
QString text = action->text();
TQString text = action->text();
if (text.contains("%1"))
text = text.arg(action->shortcutText());
pushButton->setText(text);
}

bool MiscUtils::runCommand(const QString &command)
bool MiscUtils::runCommand(const TQString &command)
{
pid_t pid = KRun::run(command, KURL::List());

@@ -156,7 +156,7 @@ bool MiscUtils::runCommand(const QString &command)
return false; // error
}

void MiscUtils::runCommandBeforeAction(const QString &configEntry)
void MiscUtils::runCommandBeforeAction(const TQString &configEntry)
{
KConfig *conf = kshutdownrc->config();

@@ -168,14 +168,14 @@ void MiscUtils::runCommandBeforeAction(const QString &configEntry)
if (!conf->readBoolEntry("RunCommandBeforeAction", false))
return;

QString command = conf->readEntry("CommandBeforeAction", "");
TQString command = conf->readEntry("CommandBeforeAction", "");
int pause = conf->readNumEntry("CommandBeforeActionPause", 10);
if ((pause < 0) || (pause > 300))
pause = 10;
runShellCommand(command, KProcess::DontCare, pause);
}

bool MiscUtils::runShellCommand(const QString &command, const KProcess::RunMode mode, const int pause)
bool MiscUtils::runShellCommand(const TQString &command, const KProcess::RunMode mode, const int pause)
{
if (command.isEmpty())
return false;
@@ -215,25 +215,25 @@ void MiscUtils::setAutostart(const bool yes) {
config->writeEntry("Autostart", yes);
}

void MiscUtils::setHint(QWidget *widget, const QString &value)
void MiscUtils::setHint(TQWidget *widget, const TQString &value)
{
QToolTip::add(widget, value);
QWhatsThis::add(widget, value);
TQToolTip::add(widget, value);
TQWhatsThis::add(widget, value);
}

void MiscUtils::showRunErrorMessage(const QString &command)
void MiscUtils::showRunErrorMessage(const TQString &command)
{
notifyUser("kshutdown-runerror", i18n("Could not run \"%1\"!").arg(command));
}

void MiscUtils::showTestMessage(const QString &message)
void MiscUtils::showTestMessage(const TQString &message)
{
KMessageBox::information(0, message, i18n("Test"));
}

// private

void MiscUtils::notifyUser(const QString &name, const QString &text)
void MiscUtils::notifyUser(const TQString &name, const TQString &text)
{
WId id;
if (MSystemTray::isInstance())


+ 15
- 15
kshutdown/miscutils.h View File

@@ -20,7 +20,7 @@
#ifndef __MISCUTILS_H__
#define __MISCUTILS_H__

#include <qdatetime.h>
#include <ntqdatetime.h>

#include <kprocess.h>

@@ -41,7 +41,7 @@ public:
* @param text A text to display
* @param testCommand A command to execute (used internally in settings dialog to test entered command)
*/
static void customMessage(const QString &text, const QString &testCommand = QString::null);
static void customMessage(const TQString &text, const TQString &testCommand = TQString::null);

/**
* Converts seconds to time string.
@@ -49,20 +49,20 @@ public:
* @param format A date/time format
* @return Converted seconds or ">24", if @p secs >= 86400
*/
static QString formatDateTime(const int secs, const QString &format = QString::null);
static TQString formatDateTime(const int secs, const TQString &format = TQString::null);

/**
* Converts seconds to time string.
* @param dt A date/time to convert
* @return Converted seconds or ">24", if @p secs >= 86400
*/
static QString formatDateTime(const QDateTime &dt);
static TQString formatDateTime(const TQDateTime &dt);

inline static QString HTML(const QString &text) {
inline static TQString HTML(const TQString &text) {
return ("<qt>" + text + "</qt>");
}