Use tdeApp

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/17/head
Michele Calgaro 1 month ago
parent e949d4975f
commit 29ef1ba2f1
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -65,7 +65,7 @@
</para> </para>
</chapter><!-- introduction --> </chapter><!-- introduction -->
<chapter id="using-kapp"> <chapter id="using-tdeApp">
<title>Benutzen von &kmyapplication;</title> <title>Benutzen von &kmyapplication;</title>
<sect1 id="using-mainwindow"> <sect1 id="using-mainwindow">
<title>Hauptfenster</title> <title>Hauptfenster</title>
@ -95,7 +95,7 @@
<listitem><para>Rechter Mausknopf - Zeigt das Kontextmenü</para></listitem> <listitem><para>Rechter Mausknopf - Zeigt das Kontextmenü</para></listitem>
</itemizedlist> </itemizedlist>
</sect1> </sect1>
</chapter><!-- using-kapp --> </chapter><!-- using-tdeApp -->
<chapter id="command-line"> <chapter id="command-line">
<title>Kommandozeile</title> <title>Kommandozeile</title>

@ -65,7 +65,7 @@
</para> </para>
</chapter><!-- introduction --> </chapter><!-- introduction -->
<chapter id="using-kapp"> <chapter id="using-tdeApp">
<title>Using &kmyapplication;</title> <title>Using &kmyapplication;</title>
<sect1 id="using-mainwindow"> <sect1 id="using-mainwindow">
<title>Main Window</title> <title>Main Window</title>
@ -95,7 +95,7 @@
<listitem><para>Right mouse button - show context menu</para></listitem> <listitem><para>Right mouse button - show context menu</para></listitem>
</itemizedlist> </itemizedlist>
</sect1> </sect1>
</chapter><!-- using-kapp --> </chapter><!-- using-tdeApp -->
<chapter id="command-line"> <chapter id="command-line">
<title>Command Line</title> <title>Command Line</title>

@ -72,7 +72,7 @@ bool Action::endSession(const TDEApplication::ShutdownType type, const Type acti
_totalExit = true; _totalExit = true;
if ( if (
!kapp->requestShutDown( !tdeApp->requestShutDown(
TDEApplication::ShutdownConfirmNo, TDEApplication::ShutdownConfirmNo,
type, type,
TDEApplication::ShutdownModeForceNow TDEApplication::ShutdownModeForceNow
@ -402,7 +402,7 @@ bool Action::lockScreen() {
if (kshutdown_screen_number) if (kshutdown_screen_number)
kdesktop.sprintf("kdesktop-screen-%d", kshutdown_screen_number); kdesktop.sprintf("kdesktop-screen-%d", kshutdown_screen_number);
if (!kapp->dcopClient()->send(kdesktop, "KScreensaverIface", "lock()", "")) { if (!tdeApp->dcopClient()->send(kdesktop, "KScreensaverIface", "lock()", "")) {
KMessageBox::error(0, i18n("kdesktop: DCOP call failed!")); KMessageBox::error(0, i18n("kdesktop: DCOP call failed!"));
return false; // error return false; // error

@ -89,7 +89,7 @@ public:
/** /**
* Ends current session. * Ends current session.
* This function is a wrapper for the @c kapp->requestShutDown(). * This function is a wrapper for the @c tdeApp->requestShutDown().
* @param type A shut down type * @param type A shut down type
* @param action An action to execute * @param action An action to execute
* @return @c true if successful; otherwise @c false * @return @c true if successful; otherwise @c false

@ -46,13 +46,13 @@ bool Confirmation::confirm(const Action::Type action, const TQString &delay)
/* /*
TQWidget *background = new TQWidget(0, "TQWidget::background", TQt::WType_Popup); TQWidget *background = new TQWidget(0, "TQWidget::background", TQt::WType_Popup);
background->setBackgroundMode(TQt::NoBackground); background->setBackgroundMode(TQt::NoBackground);
background->setGeometry(kapp->desktop()->geometry()); background->setGeometry(tdeApp->desktop()->geometry());
// Take screenshot - based on the aKregator's TrayIcon::takeScreenshot() (trayicon.cpp) // Take screenshot - based on the aKregator's TrayIcon::takeScreenshot() (trayicon.cpp)
// and "ksmserver/shutdown.cpp". // and "ksmserver/shutdown.cpp".
TQPixmap shot = TQPixmap::grabWindow( TQPixmap shot = TQPixmap::grabWindow(
tqt_xrootwin(), tqt_xrootwin(),
0, 0, // x, y 0, 0, // x, y
kapp->desktop()->width(), kapp->desktop()->height() tdeApp->desktop()->width(), tdeApp->desktop()->height()
); );
TQImage shotImage = shot.convertToImage(); TQImage shotImage = shot.convertToImage();
KImageEffect::flatten(shotImage, TQt::green, TQt::black); KImageEffect::flatten(shotImage, TQt::green, TQt::black);
@ -79,7 +79,7 @@ bool Confirmation::confirm(const Action::Type action, const TQString &delay)
.arg(ks_actions->getName(action)) .arg(ks_actions->getName(action))
.arg(selectedTime); .arg(selectedTime);
kapp->dcopClient()->suspend(); tdeApp->dcopClient()->suspend();
bool result = (KMessageBox::createKMessageBox( bool result = (KMessageBox::createKMessageBox(
dialog, dialog,
@ -91,7 +91,7 @@ bool Confirmation::confirm(const Action::Type action, const TQString &delay)
KMessageBox::Notify KMessageBox::Notify
) == KDialogBase::Yes); ) == KDialogBase::Yes);
kapp->dcopClient()->resume(); tdeApp->dcopClient()->resume();
return result; return result;
} }

@ -41,7 +41,7 @@ Links::Links(TQWidget *parent)
{ {
setSpacing(5); setSpacing(5);
int alignment = AlignVCenter; int alignment = AlignVCenter;
alignment |= kapp->reverseLayout() ? AlignLeft : AlignRight; alignment |= tdeApp->reverseLayout() ? AlignLeft : AlignRight;
// location // location
@ -63,7 +63,7 @@ Links::Links(TQWidget *parent)
l_type->setAlignment(alignment); l_type->setAlignment(alignment);
cb_type = new TQComboBox(w_type, "TQComboBox::cb_type"); cb_type = new TQComboBox(w_type, "TQComboBox::cb_type");
cb_type->setFocusPolicy(StrongFocus); cb_type->setFocusPolicy(StrongFocus);
cb_type->insertItem(kapp->miniIcon(), "KShutDown"); cb_type->insertItem(tdeApp->miniIcon(), "KShutDown");
// NOTE: slotAddRemoveLink() // NOTE: slotAddRemoveLink()
cb_type->insertItem(SmallIcon("system-log-out"), i18n("Standard Logout Dialog")); cb_type->insertItem(SmallIcon("system-log-out"), i18n("Standard Logout Dialog"));

@ -117,8 +117,8 @@ private:
int KShutDownApplication::newInstance() int KShutDownApplication::newInstance()
{ {
// autostart // autostart
if (kapp->isRestored()) { if (tdeApp->isRestored()) {
TDEConfig *config = kapp->config(); TDEConfig *config = tdeApp->config();
config->setGroup("KShutDown"); config->setGroup("KShutDown");
if (!config->readBoolEntry("Autostart", false)) { if (!config->readBoolEntry("Autostart", false)) {
quit(); quit();
@ -133,7 +133,7 @@ int KShutDownApplication::newInstance()
// create main window (only one) // create main window (only one)
if (!ks_main) { if (!ks_main) {
(void)new MMainWindow(); (void)new MMainWindow();
kapp->setMainWidget(ks_main); tdeApp->setMainWidget(ks_main);
connect( connect(
this, TQ_SIGNAL(aboutToQuit()), this, TQ_SIGNAL(aboutToQuit()),
ks_main, TQ_SLOT(deleteLater())); ks_main, TQ_SLOT(deleteLater()));
@ -155,7 +155,7 @@ int KShutDownApplication::newInstance()
// gui mode // gui mode
if ((retval == Mode_Visible) || (retval == Mode_Hidden)) { if ((retval == Mode_Visible) || (retval == Mode_Hidden)) {
if ((retval == Mode_Visible) && (!kapp->isRestored() || doShow)) { if ((retval == Mode_Visible) && (!tdeApp->isRestored() || doShow)) {
ks_main->show(); ks_main->show();
if (doRaise) if (doRaise)
ks_main->makeVisible(); ks_main->makeVisible();
@ -269,7 +269,7 @@ int KShutDownApplication::doProcessArgs(const TDECmdLineArgs *args) {
// standard logout dialog // standard logout dialog
if (args->isSet("standard")) { if (args->isSet("standard")) {
kapp->requestShutDown( tdeApp->requestShutDown(
TDEApplication::ShutdownConfirmYes, TDEApplication::ShutdownConfirmYes,
TDEApplication::ShutdownTypeDefault, TDEApplication::ShutdownTypeDefault,
TDEApplication::ShutdownModeDefault TDEApplication::ShutdownModeDefault

@ -95,7 +95,7 @@ TQString MiscUtils::formatDateTime(const TQDateTime &dt)
bool MiscUtils::isRestricted(const TQString &key) bool MiscUtils::isRestricted(const TQString &key)
{ {
return !kapp->authorize("kshutdown_" + key); return !tdeApp->authorize("kshutdown_" + key);
} }
void MiscUtils::notifyUser(const int secs) void MiscUtils::notifyUser(const int secs)
@ -210,7 +210,7 @@ bool MiscUtils::runShellCommand(const TQString &command, const TDEProcess::RunMo
} }
void MiscUtils::setAutostart(const bool yes) { void MiscUtils::setAutostart(const bool yes) {
TDEConfig *config = kapp->config(); TDEConfig *config = tdeApp->config();
config->setGroup("KShutDown"); config->setGroup("KShutDown");
config->writeEntry("Autostart", yes); config->writeEntry("Autostart", yes);
} }

@ -67,7 +67,7 @@ MMainWindow::MMainWindow()
_delayType(DelayType_Now) _delayType(DelayType_Now)
{ {
_instance = this; _instance = this;
connect(kapp, TQ_SIGNAL(aboutToQuit()), TQ_SLOT(slotAboutToQuit())); connect(tdeApp, TQ_SIGNAL(aboutToQuit()), TQ_SLOT(slotAboutToQuit()));
// init date/time // init date/time
dt_end = TQDateTime(); dt_end = TQDateTime();
@ -83,11 +83,11 @@ MMainWindow::MMainWindow()
initMainMenu(); initMainMenu();
// init DCOP // init DCOP
DCOPClient *client = kapp->dcopClient(); DCOPClient *client = tdeApp->dcopClient();
client->registerAs(kapp->name(), false); client->registerAs(tdeApp->name(), false);
client->setDefaultObject(objId()); // KShutdownIface client->setDefaultObject(objId()); // KShutdownIface
TDEConfig *config = kapp->config(); TDEConfig *config = tdeApp->config();
config->setGroup("Extras"); config->setGroup("Extras");
TQString extrasCommand = config->readEntry("Command", TQString::null); TQString extrasCommand = config->readEntry("Command", TQString::null);
TQString extrasDescription = config->readEntry("Description", TQString::null); TQString extrasDescription = config->readEntry("Description", TQString::null);
@ -123,7 +123,7 @@ MMainWindow::MMainWindow()
MMainWindow::~MMainWindow() MMainWindow::~MMainWindow()
{ {
TDEConfig *config = kapp->config(); TDEConfig *config = tdeApp->config();
config->setGroup("Extras"); config->setGroup("Extras");
config->writeEntry("Command", ks_extras->fileToExecute()); config->writeEntry("Command", ks_extras->fileToExecute());
config->writeEntry("Description", ks_extras->getActionDescription()); config->writeEntry("Description", ks_extras->getActionDescription());
@ -891,7 +891,7 @@ void MMainWindow::slotUpdateTimeInfo()
bool MMainWindow::queryClose() bool MMainWindow::queryClose()
{ {
// exit // exit
if (ks_actions->totalExit() || kapp->sessionSaving()) if (ks_actions->totalExit() || tdeApp->sessionSaving())
return true; return true;
// MSystemTray::Always // MSystemTray::Always

@ -95,7 +95,7 @@ void ProgressBar::mousePressEvent(TQMouseEvent *e) {
// TODO: 2.0: size configuration // TODO: 2.0: size configuration
// show popup menu // show popup menu
TDEPopupMenu *popup = new TDEPopupMenu(this); TDEPopupMenu *popup = new TDEPopupMenu(this);
popup->insertTitle(kapp->miniIcon(), "KShutDown"); popup->insertTitle(tdeApp->miniIcon(), "KShutDown");
popup->insertItem(i18n("Hide"), this, TQ_SLOT(hide())); popup->insertItem(i18n("Hide"), this, TQ_SLOT(hide()));
popup->insertTitle("Position"); popup->insertTitle("Position");
int topPositionItem = popup->insertItem(i18n("Top"), this, TQ_SLOT(slotSetTopPosition())); int topPositionItem = popup->insertItem(i18n("Top"), this, TQ_SLOT(slotSetTopPosition()));

@ -182,7 +182,7 @@ void SystemConfig::slotExecuted(TQListViewItem *item)
if (item == _shutdownAllowItem) if (item == _shutdownAllowItem)
{ {
kapp->invokeBrowser("http://doc.gwos.org/index.php/NonRootShutdown"); tdeApp->invokeBrowser("http://doc.gwos.org/index.php/NonRootShutdown");
return; return;
} }

@ -104,9 +104,9 @@ Lockout::Lockout(const TQString& configFile, TQWidget *parent)
config->setGroup("kshutdownlockout"); config->setGroup("kshutdownlockout");
_transparent = config->readBoolEntry("Transparent", true); _transparent = config->readBoolEntry("Transparent", true);
*/ */
if (!kapp->dcopClient()->isAttached()) if (!tdeApp->dcopClient()->isAttached())
kapp->dcopClient()->attach(); tdeApp->dcopClient()->attach();
connect(kapp, TQ_SIGNAL(iconChanged(int)), TQ_SLOT(slotIconChanged())); connect(tdeApp, TQ_SIGNAL(iconChanged(int)), TQ_SLOT(slotIconChanged()));
TQToolTip::add( TQToolTip::add(
this, this,
@ -135,7 +135,7 @@ int Lockout::widthForHeight(int/* height*/) const
// private // private
void Lockout::callKShutDown(const TQCString &function) { void Lockout::callKShutDown(const TQCString &function) {
DCOPClient *client = kapp->dcopClient(); DCOPClient *client = tdeApp->dcopClient();
if (!client->isApplicationRegistered("kshutdown")) { if (!client->isApplicationRegistered("kshutdown")) {
// run KShutDown // run KShutDown
TDEProcess *p = new TDEProcess(); TDEProcess *p = new TDEProcess();

Loading…
Cancel
Save