diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
commit | 2ee99ab520931c5efe91123c85ba10064a45e95d (patch) | |
tree | a367666e410de28d0f258aed77b11e17cafb28e4 /sessionapplet | |
parent | cfa36e1a95e82492c17225ff376911abb3688f62 (diff) | |
download | tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.tar.gz tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.zip |
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'sessionapplet')
-rw-r--r-- | sessionapplet/dmctl.cpp | 46 | ||||
-rw-r--r-- | sessionapplet/dmctl.h | 18 | ||||
-rw-r--r-- | sessionapplet/usermanager.cpp | 38 | ||||
-rw-r--r-- | sessionapplet/usermanager.h | 30 |
4 files changed, 66 insertions, 66 deletions
diff --git a/sessionapplet/dmctl.cpp b/sessionapplet/dmctl.cpp index 52ab3eb..eb7fc7c 100644 --- a/sessionapplet/dmctl.cpp +++ b/sessionapplet/dmctl.cpp @@ -68,7 +68,7 @@ DM::DM() : fd( -1 ) break; case OldKDM: { - QString tf( ctl ); + TQString tf( ctl ); tf.truncate( tf.find( ',' ) ); fd = ::open( tf.latin1(), O_WRONLY ); } @@ -85,7 +85,7 @@ DM::~DM() bool DM::exec( const char *cmd ) { - QCString buf; + TQCString buf; return exec( cmd, buf ); } @@ -103,7 +103,7 @@ DM::exec( const char *cmd ) * from KDM. */ bool -DM::exec( const char *cmd, QCString &buf ) +DM::exec( const char *cmd, TQCString &buf ) { bool ret = false; int tl; @@ -151,7 +151,7 @@ DM::canShutdown() if (DMType == OldKDM) return strstr( ctl, ",maysd" ) != 0; - QCString re; + TQCString re; return exec( "caps\n", re ) && re.find( "\tshutdown" ) >= 0; } @@ -159,13 +159,13 @@ DM::canShutdown() void DM::shutdown( KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, - const QString &bootOption ) + const TQString &bootOption ) { if (!bootOption.isEmpty() && DMType != NewKDM) return; if (shutdownType != KApplication::ShutdownTypeNone) { - QCString cmd( "shutdown\t" ); + TQCString cmd( "shutdown\t" ); cmd.append( shutdownType == KApplication::ShutdownTypeReboot ? "reboot\t" : "halt\t" ); if (!bootOption.isNull()) @@ -181,16 +181,16 @@ DM::shutdown( KApplication::ShutdownType shutdownType, } bool -DM::bootOptions( QStringList &opts, int &defopt, int ¤t ) +DM::bootOptions( TQStringList &opts, int &defopt, int ¤t ) { if (DMType != NewKDM) return false; - QCString re; + TQCString re; if (!exec( "listbootoptions\n", re )) return false; - opts = QStringList::split( '\t', QString::fromLocal8Bit( re.data() ) ); + opts = TQStringList::split( '\t', TQString::fromLocal8Bit( re.data() ) ); if (opts.size() < 4) return false; @@ -202,8 +202,8 @@ DM::bootOptions( QStringList &opts, int &defopt, int ¤t ) if (!ok) return false; - opts = QStringList::split( ' ', opts[1] ); - for (QStringList::Iterator it = opts.begin(); it != opts.end(); ++it) + opts = TQStringList::split( ' ', opts[1] ); + for (TQStringList::Iterator it = opts.begin(); it != opts.end(); ++it) (*it).replace( "\\s", " " ); return true; @@ -221,7 +221,7 @@ DM::isSwitchable() if (DMType == OldKDM) return dpy[0] == ':'; - QCString re; + TQCString re; return exec( "caps\n", re ) && re.find( "\tlocal" ) >= 0; } @@ -232,7 +232,7 @@ DM::numReserve() if (DMType == OldKDM) return strstr( ctl, ",rsvd" ) ? 1 : -1; - QCString re; + TQCString re; int p; if (!(exec( "caps\n", re ) && (p = re.find( "\treserve " )) >= 0)) @@ -252,13 +252,13 @@ DM::localSessions( SessList &list ) if (DMType == OldKDM) return false; - QCString re; + TQCString re; if (!exec( "list\talllocal\n", re )) return false; - QStringList sess = QStringList::split( QChar('\t'), re.data() + 3 ); - for (QStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { - QStringList ts = QStringList::split( QChar(','), *it, true ); + TQStringList sess = TQStringList::split( TQChar('\t'), re.data() + 3 ); + for (TQStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { + TQStringList ts = TQStringList::split( TQChar(','), *it, true ); SessEnt se; se.display = ts[0]; if (ts[1][0] == '@') @@ -275,11 +275,11 @@ DM::localSessions( SessList &list ) } void -DM::sess2Str2( const SessEnt &se, QString &user, QString &loc ) +DM::sess2Str2( const SessEnt &se, TQString &user, TQString &loc ) { if (se.tty) { user = i18n("user: ...", "%1: TTY login").arg( se.user ); - loc = se.vt ? QString("vt%1").arg( se.vt ) : se.display ; + loc = se.vt ? TQString("vt%1").arg( se.vt ) : se.display ; } else { user = se.user.isEmpty() ? @@ -292,15 +292,15 @@ DM::sess2Str2( const SessEnt &se, QString &user, QString &loc ) .arg( se.user ).arg( se.session ); loc = se.vt ? - QString("%1, vt%2").arg( se.display ).arg( se.vt ) : + TQString("%1, vt%2").arg( se.display ).arg( se.vt ) : se.display; } } -QString +TQString DM::sess2Str( const SessEnt &se ) { - QString user, loc; + TQString user, loc; sess2Str2( se, user, loc ); return i18n("session (location)", "%1 (%2)").arg( user ).arg( loc ); @@ -309,7 +309,7 @@ DM::sess2Str( const SessEnt &se ) bool DM::switchVT( int vt ) { - return exec( QString("activate\tvt%1\n").arg(vt).latin1() ); + return exec( TQString("activate\tvt%1\n").arg(vt).latin1() ); } void diff --git a/sessionapplet/dmctl.h b/sessionapplet/dmctl.h index bc58fcb..a8328d2 100644 --- a/sessionapplet/dmctl.h +++ b/sessionapplet/dmctl.h @@ -24,12 +24,12 @@ #include <kapplication.h> struct SessEnt { - QString display, from, user, session; + TQString display, from, user, session; int vt; bool self:1, tty:1; }; -typedef QValueList<SessEnt> SessList; +typedef TQValueList<SessEnt> SessList; class DM { @@ -42,7 +42,7 @@ public: bool canShutdown(); void shutdown( KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, - const QString &bootOption = QString::null ); + const TQString &bootOption = TQString::null ); void setLock( bool on ); @@ -53,15 +53,15 @@ public: bool switchVT( int vt ); void lockSwitchVT( int vt ); - bool bootOptions( QStringList &opts, int &dflt, int &curr ); + bool bootOptions( TQStringList &opts, int &dflt, int &curr ); - static QString sess2Str( const SessEnt &se ); - static void sess2Str2( const SessEnt &se, QString &user, QString &loc ); + static TQString sess2Str( const SessEnt &se ); + static void sess2Str2( const SessEnt &se, TQString &user, TQString &loc ); private: int fd; - bool exec( const char *cmd, QCString &ret ); + bool exec( const char *cmd, TQCString &ret ); bool exec( const char *cmd ); #else // Q_WS_X11 @@ -72,7 +72,7 @@ public: bool canShutdown() { return false; } void shutdown( KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, - const QString &bootOption = QString::null ) {} + const TQString &bootOption = TQString::null ) {} void setLock( bool ) {} @@ -82,7 +82,7 @@ public: bool localSessions( SessList &list ) { return false; } void switchVT( int vt ) {} - bool bootOptions( QStringList &opts, int &dflt, int &curr ); + bool bootOptions( TQStringList &opts, int &dflt, int &curr ); #endif // Q_WS_X11 diff --git a/sessionapplet/usermanager.cpp b/sessionapplet/usermanager.cpp index faf491f..107d9b8 100644 --- a/sessionapplet/usermanager.cpp +++ b/sessionapplet/usermanager.cpp @@ -20,9 +20,9 @@ #include <stdlib.h> #include <kmenubar.h> -// #include <qlabel.h> -#include <qlayout.h> -#include <qpopupmenu.h> +// #include <tqlabel.h> +#include <tqlayout.h> +#include <tqpopupmenu.h> #include <dcopclient.h> #include <kglobal.h> #include <kiconloader.h> @@ -40,7 +40,7 @@ #define _ICONSET_(i) KGlobal::iconLoader()->loadIconSet(i, KIcon::Small, 0, false) -UserManager::UserManager(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) +UserManager::UserManager(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name) { @@ -53,24 +53,24 @@ UserManager::UserManager(const QString& configFile, Type type, int actions, QWid menu = new KMenuBar(this); menu->setTopLevelMenu(false); - menu->setFrameShape ( QFrame::NoFrame ); + menu->setFrameShape ( TQFrame::NoFrame ); menu->setMargin ( 0 ); menu->setLineWidth ( 0 ); // sessions - sessionPopup = new QPopupMenu(this); + sessionPopup = new TQPopupMenu(this); menu->insertItem ( getenv("USER"), sessionPopup, 0); connect( sessionPopup, SIGNAL(aboutToShow()), SLOT(slotPopulateSessions()) ); connect( sessionPopup, SIGNAL(activated(int)), SLOT(slotSessionActivated(int)) ); // languages - langPopup = new QPopupMenu(this); + langPopup = new TQPopupMenu(this); KConfigBase *config = KGlobal::config(); config->setGroup("Locale"); langList = config->readListEntry ("Language", ':'); -// QString flag( locate( "locale", QString::fromLatin1( "l10n/%1/flag.png" ).arg(langList[0]) ) ); -// langLabel = new QLabel(this); +// TQString flag( locate( "locale", TQString::fromLatin1( "l10n/%1/flag.png" ).arg(langList[0]) ) ); +// langLabel = new TQLabel(this); // langLabel->setPixmap(_ICONSET_(flag).pixmap()); menu->insertItem ( '[' + langList[0].section('_',0,0) + ']', langPopup, 1 ); @@ -83,7 +83,7 @@ UserManager::UserManager(const QString& configFile, Type type, int actions, QWid setFixedWidth(menu->width()+5); mainView = menu; - menu->move(menu->mapToParent(QPoint(0,0)).x(),0); + menu->move(menu->mapToParent(TQPoint(0,0)).x(),0); menu->show(); } @@ -108,7 +108,7 @@ void UserManager::about() void UserManager::lock() { - QCString appname( "kdesktop" ); + TQCString appname( "kdesktop" ); // if ( kicker_screen_number ) // appname.sprintf("kdesktop-screen-%d", kicker_screen_number); kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", ""); @@ -127,18 +127,18 @@ void UserManager::slotPopulateLanguages() config->setGroup("Locale"); langList = config->readListEntry ("Language", ':'); int i = 0; - for ( QStringList::ConstIterator it = langList.begin(); + for ( TQStringList::ConstIterator it = langList.begin(); it != langList.end(); ++it ) { - KConfig entry(locate( "locale", QString::fromLatin1( "%1/entry.desktop" ).arg(*it) )); + KConfig entry(locate( "locale", TQString::fromLatin1( "%1/entry.desktop" ).arg(*it) )); entry.setGroup("KCM Locale"); - QString name = entry.readEntry("Name", i18n("without name")); + TQString name = entry.readEntry("Name", i18n("without name")); - QString flag( locate( "locale", QString::fromLatin1( "%1/flag.png" ).arg(*it) ) ); + TQString flag( locate( "locale", TQString::fromLatin1( "%1/flag.png" ).arg(*it) ) ); langPopup->insertItem( _ICONSET_(flag), name, i ); i++; } -// langPopup->popup(langLabel->mapToGlobal(QPoint(0,height()))); +// langPopup->popup(langLabel->mapToGlobal(TQPoint(0,height()))); } void UserManager::slotLanguageActivated( int i ) @@ -149,7 +149,7 @@ void UserManager::slotLanguageActivated( int i ) // langLabel->setPixmap(*langPopup->pixmap(i)); KConfig *config = new KConfig("kdeglobals"); config->setGroup("Locale"); - QString tmp = langList[i]; + TQString tmp = langList[i]; langList.remove(langList.at(i)); langList.prepend(tmp); config->writeEntry ("Language", langList, ':'); @@ -265,7 +265,7 @@ void UserManager::doNewSession( bool lock_ ) void UserManager::saveSession() { - QByteArray data; + TQByteArray data; kapp->dcopClient()->send( "ksmserver", "default", "saveCurrentSession()", data ); } @@ -273,7 +273,7 @@ void UserManager::saveSession() extern "C" { - KPanelApplet* init( QWidget *parent, const QString& configFile) + KPanelApplet* init( TQWidget *parent, const TQString& configFile) { KGlobal::locale()->insertCatalogue("usermanager"); return new UserManager(configFile, KPanelApplet::Normal, KPanelApplet::About, parent, "usermanager"); diff --git a/sessionapplet/usermanager.h b/sessionapplet/usermanager.h index 87f8864..80357ec 100644 --- a/sessionapplet/usermanager.h +++ b/sessionapplet/usermanager.h @@ -27,22 +27,22 @@ #endif #include <kpanelapplet.h> -#include <qstring.h> -#include <qiconset.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqiconset.h> +#include <tqstringlist.h> #include <kconfig.h> class KMenuBar; -class QPopunMenu; -// class QLabel; +class TQPopunMenu; +// class TQLabel; class UserManager : public KPanelApplet { Q_OBJECT public: - UserManager(const QString& configFile, Type t = Normal, int actions = 0, - QWidget *parent = 0, const char *name = 0); + UserManager(const TQString& configFile, Type t = Normal, int actions = 0, + TQWidget *parent = 0, const char *name = 0); /** destructor */ ~UserManager(); @@ -64,15 +64,15 @@ protected: private: KConfig *ksConfig; - QWidget *mainView; + TQWidget *mainView; KMenuBar *menu; - QPopupMenu *sessionPopup; - QPopupMenu *langPopup; - QStringList langList; - QIconSet exitIcon; - QIconSet lockIcon; - QIconSet fileSaveIcon; -// QLabel *langLabel; + TQPopupMenu *sessionPopup; + TQPopupMenu *langPopup; + TQStringList langList; + TQIconSet exitIcon; + TQIconSet lockIcon; + TQIconSet fileSaveIcon; +// TQLabel *langLabel; }; #endif |