By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 500
Collapse All | Expand All

(-)./src/customtraylabel.cpp (-43 / +43 lines)
Lines 19-32 Link Here
19
19
20
// $Id: customtraylabel.cpp,v 1.13 2005/04/05 17:16:12 cs19713 Exp $
20
// $Id: customtraylabel.cpp,v 1.13 2005/04/05 17:16:12 cs19713 Exp $
21
21
22
#include <qsettings.h>
22
#include <tqt3/ntqsettings.h>
23
#include <qpopupmenu.h>
23
#include <tqt3/ntqpopupmenu.h>
24
#include <qmessagebox.h>
24
#include <tqt3/ntqmessagebox.h>
25
#include <qfiledialog.h>
25
#include <tqt3/ntqfiledialog.h>
26
#include <qinputdialog.h>
26
#include <tqt3/ntqinputdialog.h>
27
#include <qaction.h>
27
#include <tqt3/ntqaction.h>
28
#include <qtimer.h>
28
#include <tqt3/ntqtimer.h>
29
#include <qsize.h>
29
#include <tqt3/ntqsize.h>
30
#include <stdlib.h>
30
#include <stdlib.h>
31
31
32
#include "trace.h"
32
#include "trace.h"
Lines 34-47 Link Here
34
#include "traylabelmgr.h"
34
#include "traylabelmgr.h"
35
#include "kdocker.h"
35
#include "kdocker.h"
36
36
37
CustomTrayLabel::CustomTrayLabel(Window w, QWidget* p, const QString& t)
37
CustomTrayLabel::CustomTrayLabel(Window w, TQWidget* p, const TQString& t)
38
  : QTrayLabel(w, p, t), mUndockWhenDead(false)
38
  : QTrayLabel(w, p, t), mUndockWhenDead(false)
39
{ 
39
{ 
40
  installMenu(); 
40
  installMenu(); 
41
}
41
}
42
42
43
CustomTrayLabel::CustomTrayLabel(const QStringList& argv, pid_t pid, 
43
CustomTrayLabel::CustomTrayLabel(const TQStringList& argv, pid_t pid, 
44
                                 QWidget* parent)
44
                                 TQWidget* parent)
45
  : QTrayLabel(argv, pid, parent), mUndockWhenDead(false)
45
  : QTrayLabel(argv, pid, parent), mUndockWhenDead(false)
46
{ 
46
{ 
47
  installMenu(); 
47
  installMenu(); 
Lines 52-71 Link Here
52
 */
52
 */
53
void CustomTrayLabel::installMenu()
53
void CustomTrayLabel::installMenu()
54
{
54
{
55
  QPixmap kdocker_png(QString(ICONS_PATH) + "/kdocker.png");
55
  TQPixmap kdocker_png(TQString(ICONS_PATH) + "/kdocker.png");
56
  if (kdocker_png.isNull()) 
56
  if (kdocker_png.isNull()) 
57
    kdocker_png.load(qApp->applicationDirPath() + "/icons/kdocker.png");
57
    kdocker_png.load(tqApp->applicationDirPath() + "/icons/kdocker.png");
58
  setIcon(kdocker_png);
58
  setIcon(kdocker_png);
59
  TrayLabelMgr *tlMgr = TrayLabelMgr::instance();
59
  TrayLabelMgr *tlMgr = TrayLabelMgr::instance();
60
60
61
  mOptionsMenu = new QPopupMenu(this);
61
  mOptionsMenu = new TQPopupMenu(this);
62
  mSessionManagement = new QAction(tr("Dock when session restored"), 0, this);
62
  mSessionManagement = new TQAction(tr("Dock when session restored"), 0, this);
63
  mSessionManagement->setToggleAction(true);
63
  mSessionManagement->setToggleAction(true);
64
  connect(mSessionManagement, SIGNAL(toggled(bool)),
64
  connect(mSessionManagement, SIGNAL(toggled(bool)),
65
          this, SLOT(enableSessionManagement(bool)));
65
          this, SLOT(enableSessionManagement(bool)));
66
  mSessionManagement->addTo(mOptionsMenu);
66
  mSessionManagement->addTo(mOptionsMenu);
67
67
68
  mAutoLaunch = new QAction(tr("Launch on startup"), 0, this);
68
  mAutoLaunch = new TQAction(tr("Launch on startup"), 0, this);
69
	mAutoLaunch->setToggleAction(true);
69
	mAutoLaunch->setToggleAction(true);
70
  connect(mAutoLaunch, SIGNAL(activated()), 
70
  connect(mAutoLaunch, SIGNAL(activated()), 
71
          this, SLOT(slotSetLaunchOnStartup()));
71
          this, SLOT(slotSetLaunchOnStartup()));
Lines 73-103 Link Here
73
73
74
  mOptionsMenu->insertItem(tr("Set Icon"), this, SLOT(setCustomIcon()));
74
  mOptionsMenu->insertItem(tr("Set Icon"), this, SLOT(setCustomIcon()));
75
75
76
  mBalloonTimeout = new QAction(tr("Set balloon timeout"), 0, this);
76
  mBalloonTimeout = new TQAction(tr("Set balloon timeout"), 0, this);
77
  connect(mBalloonTimeout, SIGNAL(activated()), 
77
  connect(mBalloonTimeout, SIGNAL(activated()), 
78
	        this, SLOT(slotSetBalloonTimeout()));
78
	        this, SLOT(slotSetBalloonTimeout()));
79
  mBalloonTimeout->addTo(mOptionsMenu);
79
  mBalloonTimeout->addTo(mOptionsMenu);
80
80
81
  mDockWhenObscured = new QAction(tr("Dock when obscured"), 0, this);
81
  mDockWhenObscured = new TQAction(tr("Dock when obscured"), 0, this);
82
  mDockWhenObscured->setToggleAction(true);
82
  mDockWhenObscured->setToggleAction(true);
83
  connect(mDockWhenObscured, SIGNAL(toggled(bool)),
83
  connect(mDockWhenObscured, SIGNAL(toggled(bool)),
84
          this, SLOT(setDockWhenObscured(bool)));
84
          this, SLOT(setDockWhenObscured(bool)));
85
  mDockWhenObscured->addTo(mOptionsMenu);
85
  mDockWhenObscured->addTo(mOptionsMenu);
86
86
87
  mDockWhenMinimized = new QAction(tr("Dock when minimized"), 0, this);
87
  mDockWhenMinimized = new TQAction(tr("Dock when minimized"), 0, this);
88
  mDockWhenMinimized->setToggleAction(true);
88
  mDockWhenMinimized->setToggleAction(true);
89
  connect(mDockWhenMinimized, SIGNAL(toggled(bool)),
89
  connect(mDockWhenMinimized, SIGNAL(toggled(bool)),
90
          this, SLOT(setDockWhenMinimized(bool)));
90
          this, SLOT(setDockWhenMinimized(bool)));
91
  mDockWhenMinimized->addTo(mOptionsMenu);
91
  mDockWhenMinimized->addTo(mOptionsMenu);
92
92
93
  mSkipTaskbar = new QAction(tr("Skip taskbar"), 0, this);
93
  mSkipTaskbar = new TQAction(tr("Skip taskbar"), 0, this);
94
  mSkipTaskbar->setToggleAction(true);
94
  mSkipTaskbar->setToggleAction(true);
95
  connect(mSkipTaskbar, SIGNAL(toggled(bool)), 
95
  connect(mSkipTaskbar, SIGNAL(toggled(bool)), 
96
          this, SLOT(setSkipTaskbar(bool)));
96
          this, SLOT(setSkipTaskbar(bool)));
97
  mSkipTaskbar->addTo(mOptionsMenu);
97
  mSkipTaskbar->addTo(mOptionsMenu);
98
98
99
  mMainMenu = new QPopupMenu(this);
99
  mMainMenu = new TQPopupMenu(this);
100
  mMainMenu->insertItem(QIconSet(kdocker_png),
100
  mMainMenu->insertItem(TQIconSet(kdocker_png),
101
                        tr("About KDocker"), tlMgr, SLOT(about()));
101
                        tr("About KDocker"), tlMgr, SLOT(about()));
102
  mMainMenu->insertSeparator();
102
  mMainMenu->insertSeparator();
103
  mMainMenu->insertItem(tr("Options"), mOptionsMenu);
103
  mMainMenu->insertItem(tr("Options"), mOptionsMenu);
Lines 105-114 Link Here
105
  mMainMenu->insertItem(tr("Undock All"), tlMgr, SLOT(undockAll()));
105
  mMainMenu->insertItem(tr("Undock All"), tlMgr, SLOT(undockAll()));
106
  mMainMenu->insertSeparator();
106
  mMainMenu->insertSeparator();
107
107
108
  mShowId = mMainMenu->insertItem(QString("Show/Hide [untitled]"), 
108
  mShowId = mMainMenu->insertItem(TQString("Show/Hide [untitled]"), 
109
                                  this, SLOT(toggleShow()));
109
                                  this, SLOT(toggleShow()));
110
  mMainMenu->insertItem(QString(tr("Undock")), this, SLOT(undock()));
110
  mMainMenu->insertItem(TQString(tr("Undock")), this, SLOT(undock()));
111
  mMainMenu->insertItem(QString(tr("Close")), this, SLOT(close()));
111
  mMainMenu->insertItem(TQString(tr("Close")), this, SLOT(close()));
112
112
113
  connect(mMainMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
113
  connect(mMainMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
114
114
Lines 124-130 Link Here
124
/*
124
/*
125
 * Session Management
125
 * Session Management
126
 */
126
 */
127
bool CustomTrayLabel::restoreState(QSettings& settings)
127
bool CustomTrayLabel::restoreState(TQSettings& settings)
128
{
128
{
129
  mAutoLaunch->setOn(settings.readBoolEntry("/LaunchOnStartup"));
129
  mAutoLaunch->setOn(settings.readBoolEntry("/LaunchOnStartup"));
130
  setDockWhenObscured(settings.readBoolEntry("/DockWhenObscured"));
130
  setDockWhenObscured(settings.readBoolEntry("/DockWhenObscured"));
Lines 133-139 Link Here
133
  return QTrayLabel::restoreState(settings);
133
  return QTrayLabel::restoreState(settings);
134
}
134
}
135
135
136
bool CustomTrayLabel::saveState(QSettings& settings)
136
bool CustomTrayLabel::saveState(TQSettings& settings)
137
{
137
{
138
  if (!mSessionManagement->isOn()) return false;
138
  if (!mSessionManagement->isOn()) return false;
139
  
139
  
Lines 179-185 Link Here
179
  mSkipTaskbar->setOn(isSkippingTaskbar());
179
  mSkipTaskbar->setOn(isSkippingTaskbar());
180
}
180
}
181
181
182
void CustomTrayLabel::setAppName(const QString& name)
182
void CustomTrayLabel::setAppName(const TQString& name)
183
{
183
{
184
  QTrayLabel::setAppName(name.lower());
184
  QTrayLabel::setAppName(name.lower());
185
}
185
}
Lines 197-212 Link Here
197
// Get icon from user, load it and if successful load it.
197
// Get icon from user, load it and if successful load it.
198
void CustomTrayLabel::setCustomIcon(void)
198
void CustomTrayLabel::setCustomIcon(void)
199
{
199
{
200
  QString icon;
200
  TQString icon;
201
  
201
  
202
  while (true)
202
  while (true)
203
  {
203
  {
204
    // Nag the user to give us a valid icon or press cancel
204
    // Nag the user to give us a valid icon or press cancel
205
    icon = QFileDialog::getOpenFileName();
205
    icon = TQFileDialog::getOpenFileName();
206
    if (icon.isNull()) return;     // user cancelled
206
    if (icon.isNull()) return;     // user cancelled
207
    if (!QPixmap(icon).isNull()) break;
207
    if (!TQPixmap(icon).isNull()) break;
208
    TRACE("Attempting to set icon to %s", icon.latin1());
208
    TRACE("Attempting to set icon to %s", icon.latin1());
209
    QMessageBox::critical(this, tr("KDocker"), 
209
    TQMessageBox::critical(this, tr("KDocker"), 
210
                          tr("%1 is not a valid icon").arg(icon));
210
                          tr("%1 is not a valid icon").arg(icon));
211
  }
211
  }
212
    
212
    
Lines 217-223 Link Here
217
void CustomTrayLabel::slotSetBalloonTimeout(void)
217
void CustomTrayLabel::slotSetBalloonTimeout(void)
218
{
218
{
219
  bool ok;
219
  bool ok;
220
  int timeout = QInputDialog::getInteger(tr("KDocker"), 
220
  int timeout = TQInputDialog::getInteger(tr("KDocker"), 
221
      tr("Enter balloon timeout (secs). 0 to disable ballooning"), 
221
      tr("Enter balloon timeout (secs). 0 to disable ballooning"), 
222
			balloonTimeout()/1000, 0, 60, 1, &ok);
222
			balloonTimeout()/1000, 0, 60, 1, &ok);
223
	
223
	
Lines 235-241 Link Here
235
{
235
{
236
  TRACE("%i", mAutoLaunch->isOn());
236
  TRACE("%i", mAutoLaunch->isOn());
237
  if (!mAutoLaunch->isOn()) return;
237
  if (!mAutoLaunch->isOn()) return;
238
  QString app = appName();
238
  TQString app = appName();
239
239
240
  TRACE("Validating %s", app.latin1());
240
  TRACE("Validating %s", app.latin1());
241
241
Lines 250-256 Link Here
250
    }
250
    }
251
251
252
    // Request user to provide file name himself
252
    // Request user to provide file name himself
253
    if (QMessageBox::critical(NULL, tr("KDocker"),
253
    if (TQMessageBox::critical(NULL, tr("KDocker"),
254
        tr("\"%1\" is not a valid executable "
254
        tr("\"%1\" is not a valid executable "
255
	  	    "or was not found in your $PATH").arg(app),
255
	  	    "or was not found in your $PATH").arg(app),
256
        tr("Select program"), tr("Cancel")) == 1) 
256
        tr("Select program"), tr("Cancel")) == 1) 
Lines 259-265 Link Here
259
      return; // cancelled
259
      return; // cancelled
260
    }
260
    }
261
261
262
    app = QFileDialog::getOpenFileName();
262
    app = TQFileDialog::getOpenFileName();
263
    if (app.isNull()) 
263
    if (app.isNull()) 
264
    {
264
    {
265
      TRACE("Disabling auto launch");
265
      TRACE("Disabling auto launch");
Lines 272-280 Link Here
272
// Called when we are just about to display the menu
272
// Called when we are just about to display the menu
273
void CustomTrayLabel::updateMenu(void)
273
void CustomTrayLabel::updateMenu(void)
274
{
274
{
275
  QString title = appClass(); // + "(" + appTitle() + ")";
275
  TQString title = appClass(); // + "(" + appTitle() + ")";
276
  mMainMenu->changeItem(mShowId, QIconSet(*pixmap()),
276
  mMainMenu->changeItem(mShowId, TQIconSet(*pixmap()),
277
      QString((isWithdrawn() ? tr("Show %1") : tr("Hide %1")).arg(title)));
277
      TQString((isWithdrawn() ? tr("Show %1") : tr("Hide %1")).arg(title)));
278
}
278
}
279
279
280
void CustomTrayLabel::mapEvent(void)
280
void CustomTrayLabel::mapEvent(void)
Lines 287-293 Link Here
287
   * the window. So we disable it for sometime and reanable.
287
   * the window. So we disable it for sometime and reanable.
288
   */
288
   */
289
    mDockWhenObscured->setOn(false);
289
    mDockWhenObscured->setOn(false);
290
    QTimer::singleShot(800, mDockWhenObscured, SLOT(toggle()));
290
    TQTimer::singleShot(800, mDockWhenObscured, SLOT(toggle()));
291
    TRACE("Turning off DWO for some time");
291
    TRACE("Turning off DWO for some time");
292
  }
292
  }
293
}
293
}
Lines 299-307 Link Here
299
    withdraw();
299
    withdraw();
300
}
300
}
301
301
302
void CustomTrayLabel::mouseReleaseEvent(QMouseEvent * ev)
302
void CustomTrayLabel::mouseReleaseEvent(TQMouseEvent * ev)
303
{  
303
{  
304
  if (ev->button() == Qt::RightButton)
304
  if (ev->button() == TQt::RightButton)
305
    mMainMenu->popup(ev->globalPos());
305
    mMainMenu->popup(ev->globalPos());
306
  else
306
  else
307
    toggleShow();
307
    toggleShow();
Lines 342-348 Link Here
342
342
343
void CustomTrayLabel::dropEvent(QDropEvent *)
343
void CustomTrayLabel::dropEvent(QDropEvent *)
344
{
344
{
345
  QMessageBox::information(NULL, "KDocker", 
345
  TQMessageBox::information(NULL, "KDocker", 
346
    tr("You cannot drop an item into the tray icon. Drop it on the window\n"
346
    tr("You cannot drop an item into the tray icon. Drop it on the window\n"
347
       "that is brought in front when you hover the item over the tray icon"));
347
       "that is brought in front when you hover the item over the tray icon"));
348
}
348
}
(-)./src/customtraylabel.h (-15 / +15 lines)
Lines 22-53 Link Here
22
#ifndef _CUSTOMTRAYLABEL_H
22
#ifndef _CUSTOMTRAYLABEL_H
23
#define _CUSTOMTRAYLABEL_H
23
#define _CUSTOMTRAYLABEL_H
24
24
25
#include <qaction.h>
25
#include <tqt3/ntqaction.h>
26
#include "qtraylabel.h"
26
#include "qtraylabel.h"
27
27
28
class QStringList;
28
class TQStringList;
29
class QPopupMenu;
29
class TQPopupMenu;
30
class QString;
30
class TQString;
31
class QSettings;
31
class TQSettings;
32
class QWidget;
32
class TQWidget;
33
class QDropEvent;
33
class QDropEvent;
34
34
35
class CustomTrayLabel : public QTrayLabel
35
class CustomTrayLabel : public QTrayLabel
36
{
36
{
37
  Q_OBJECT
37
  TQ_OBJECT
38
38
39
public:
39
public:
40
  CustomTrayLabel(Window w, QWidget* p = 0, const QString& t = QString::null);
40
  CustomTrayLabel(Window w, TQWidget* p = 0, const TQString& t = TQString::null);
41
  CustomTrayLabel(const QStringList& argv, pid_t pid, QWidget* parent = 0);
41
  CustomTrayLabel(const TQStringList& argv, pid_t pid, TQWidget* parent = 0);
42
42
43
  // Session management
43
  // Session management
44
  bool saveState(QSettings& settings);
44
  bool saveState(TQSettings& settings);
45
  bool restoreState(QSettings& settings);
45
  bool restoreState(TQSettings& settings);
46
46
47
  bool isLaunchOnStartup(void) const   { return mAutoLaunch->isOn(); }
47
  bool isLaunchOnStartup(void) const   { return mAutoLaunch->isOn(); }
48
  bool isDockWhenObscured(void) const { return mDockWhenObscured->isOn(); }
48
  bool isDockWhenObscured(void) const { return mDockWhenObscured->isOn(); }
49
  
49
  
50
  void setAppName(const QString& name);
50
  void setAppName(const TQString& name);
51
51
52
public slots:
52
public slots:
53
  // overridden to update our menu
53
  // overridden to update our menu
Lines 64-70 Link Here
64
  void mapEvent(void);
64
  void mapEvent(void);
65
  void obscureEvent(void);
65
  void obscureEvent(void);
66
  void destroyEvent(void);
66
  void destroyEvent(void);
67
  void mouseReleaseEvent(QMouseEvent * ev);
67
  void mouseReleaseEvent(TQMouseEvent * ev);
68
  bool canDockWindow(Window w);
68
  bool canDockWindow(Window w);
69
  void processDead(void);
69
  void processDead(void);
70
70
Lines 77-84 Link Here
77
private:
77
private:
78
  void installMenu();
78
  void installMenu();
79
  bool mUndockWhenDead;
79
  bool mUndockWhenDead;
80
  QPopupMenu *mOptionsMenu, *mMainMenu;
80
  TQPopupMenu *mOptionsMenu, *mMainMenu;
81
  QAction *mDockOnRestore, *mAutoLaunch, *mBalloonTimeout, *mSkipTaskbar,
81
  TQAction *mDockOnRestore, *mAutoLaunch, *mBalloonTimeout, *mSkipTaskbar,
82
          *mDockWhenMinimized, *mDockWhenObscured, *mSessionManagement;
82
          *mDockWhenMinimized, *mDockWhenObscured, *mSessionManagement;
83
  int mShowId;
83
  int mShowId;
84
};
84
};
(-)./src/kdocker.cpp (-57 / +57 lines)
Lines 19-32 Link Here
19
19
20
// $Id: kdocker.cpp,v 1.24 2005/02/04 10:25:46 cs19713 Exp $
20
// $Id: kdocker.cpp,v 1.24 2005/02/04 10:25:46 cs19713 Exp $
21
21
22
#include <qsessionmanager.h>
22
#include <tqt3/ntqsessionmanager.h>
23
#include <qdir.h>
23
#include <tqt3/ntqdir.h>
24
#include <qfile.h>
24
#include <tqt3/ntqfile.h>
25
#include <qtranslator.h>
25
#include <tqt3/ntqtranslator.h>
26
#include <qtextcodec.h>
26
#include <tqt3/ntqtextcodec.h>
27
#include <qtextstream.h>
27
#include <tqt3/ntqtextstream.h>
28
#include <qtimer.h>
28
#include <tqt3/ntqtimer.h>
29
#include <qstring.h>
29
#include <tqt3/ntqstring.h>
30
30
31
#include "trace.h"
31
#include "trace.h"
32
#include "traylabelmgr.h"
32
#include "traylabelmgr.h"
Lines 38-65 Link Here
38
#include <stdio.h>
38
#include <stdio.h>
39
#include <stdlib.h>
39
#include <stdlib.h>
40
40
41
// #define TMPFILE_PREFIX QString("/tmp/kdocker.")
41
// #define TMPFILE_PREFIX TQString("/tmp/kdocker.")
42
#define TMPFILE_PREFIX QDir::homeDirPath() + "/.kdocker."
42
#define TMPFILE_PREFIX TQDir::homeDirPath() + "/.kdocker."
43
43
44
KDocker::KDocker(int& argc, char** argv)
44
KDocker::KDocker(int& argc, char** argv)
45
  :QApplication(argc, argv), mTrayLabelMgr(0)
45
  :TQApplication(argc, argv), mTrayLabelMgr(0)
46
{
46
{
47
  INIT_TRACE();
47
  INIT_TRACE();
48
48
49
  /*
49
  /*
50
   * Load localisation strings. Most examples I have seen load QTranslator
50
   * Load localisation strings. Most examples I have seen load TQTranslator
51
   * in main(). As a result the translator object lingers around till the end
51
   * in main(). As a result the translator object lingers around till the end
52
   * of the program. I tried the same thing here and all i got was translations
52
   * of the program. I tried the same thing here and all i got was translations
53
   * for usage(). You dont want to know about the sleepless night i spent
53
   * for usage(). You dont want to know about the sleepless night i spent
54
   * trying to figure this out (yup, the source helped)
54
   * trying to figure this out (yup, the source helped)
55
   */
55
   */
56
  QTranslator *translator = new QTranslator(0);
56
  TQTranslator *translator = new TQTranslator(0);
57
  QString f = QString("kdocker_") + QTextCodec::locale();
57
  TQString f = TQString("kdocker_") + TQTextCodec::locale();
58
58
59
  if (!translator->load(f, QString(TRANSLATIONS_PATH)) &&
59
  if (!translator->load(f, TQString(TRANSLATIONS_PATH)) &&
60
      !translator->load(f, applicationDirPath() + "/i18n") &&
60
      !translator->load(f, applicationDirPath() + "/i18n") &&
61
      !translator->load(f, QDir::currentDirPath() + "/i18n")) {
61
      !translator->load(f, TQDir::currentDirPath() + "/i18n")) {
62
      qDebug("Sorry, your locale is not supported. If you are interested "
62
      tqDebug("Sorry, your locale is not supported. If you are interested "
63
             "in providing translations for your locale, contact "
63
             "in providing translations for your locale, contact "
64
             "gramakri@uiuc.edu\n");
64
             "gramakri@uiuc.edu\n");
65
  }
65
  }
Lines 83-95 Link Here
83
   * selection owner. If someone else owns it, transfer control to that
83
   * selection owner. If someone else owns it, transfer control to that
84
   * instance of KDocker
84
   * instance of KDocker
85
   */
85
   */
86
  Display *display = QPaintDevice::x11AppDisplay();
86
  Display *display = TQPaintDevice::x11AppDisplay();
87
  Atom kdocker = XInternAtom(display, "_KDOCKER_RUNNING", False);
87
  Atom kdocker = XInternAtom(display, "_KDOCKER_RUNNING", False);
88
  Window prev_instance = XGetSelectionOwner(display, kdocker);
88
  Window prev_instance = XGetSelectionOwner(display, kdocker);
89
89
90
  if (prev_instance == None)
90
  if (prev_instance == None)
91
  {
91
  {
92
    mSelectionOwner = XCreateSimpleWindow(display, qt_xrootwin(), 1, 1, 1,
92
    mSelectionOwner = XCreateSimpleWindow(display, tqt_xrootwin(), 1, 1, 1,
93
                                          1, 1, 1, 1);
93
                                          1, 1, 1, 1);
94
    XSetSelectionOwner(display, kdocker, mSelectionOwner, CurrentTime);
94
    XSetSelectionOwner(display, kdocker, mSelectionOwner, CurrentTime);
95
    TRACE("Selection owner set to 0x%x", (unsigned) mSelectionOwner);
95
    TRACE("Selection owner set to 0x%x", (unsigned) mSelectionOwner);
Lines 101-151 Link Here
101
101
102
void KDocker::printVersion(void)
102
void KDocker::printVersion(void)
103
{
103
{
104
  qDebug("Qt: %s", qVersion());
104
  tqDebug("Qt: %s", tqVersion());
105
  qDebug("KDocker: %s", KDOCKER_APP_VERSION);
105
  tqDebug("KDocker: %s", KDOCKER_APP_VERSION);
106
}
106
}
107
107
108
// Prints the CLI arguments. Does not return
108
// Prints the CLI arguments. Does not return
109
void KDocker::printUsage(char optopt)
109
void KDocker::printUsage(char optopt)
110
{
110
{
111
  if (optopt != 'h') qDebug(tr("kdocker: invalid option -- %1").arg(optopt));
111
  if (optopt != 'h') tqDebug(tr("kdocker: invalid option -- %1").arg(optopt));
112
112
113
  qDebug(tr("Usage: KDocker [options] command\n"));
113
  tqDebug(tr("Usage: KDocker [options] command\n"));
114
  qDebug(tr("Docks any application into the system tray\n"));
114
  tqDebug(tr("Docks any application into the system tray\n"));
115
  qDebug(tr("command \tCommand to execute\n"));
115
  tqDebug(tr("command \tCommand to execute\n"));
116
  qDebug(tr("Options"));
116
  tqDebug(tr("Options"));
117
  qDebug(tr("-a     \tShow author information"));
117
  tqDebug(tr("-a     \tShow author information"));
118
  qDebug(tr("-b     \tDont warn about non-normal windows (blind mode)"));
118
  tqDebug(tr("-b     \tDont warn about non-normal windows (blind mode)"));
119
  qDebug(tr("-d     \tDisable session management"));
119
  tqDebug(tr("-d     \tDisable session management"));
120
  qDebug(tr("-e     \tEnable session management"));
120
  tqDebug(tr("-e     \tEnable session management"));
121
  qDebug(tr("-f     \tDock window that has the focus(active window)"));
121
  tqDebug(tr("-f     \tDock window that has the focus(active window)"));
122
  qDebug(tr("-h     \tDisplay this help"));
122
  tqDebug(tr("-h     \tDisplay this help"));
123
  qDebug(tr("-i icon\tCustom dock Icon"));
123
  tqDebug(tr("-i icon\tCustom dock Icon"));
124
  qDebug(tr("-l     \tLaunch on startup"));
124
  tqDebug(tr("-l     \tLaunch on startup"));
125
  qDebug(tr("-m     \tKeep application window mapped (dont hide on dock)"));
125
  tqDebug(tr("-m     \tKeep application window mapped (dont hide on dock)"));
126
  qDebug(tr("-o     \tDock when obscured"));
126
  tqDebug(tr("-o     \tDock when obscured"));
127
	qDebug(tr("-p secs\tSet ballooning timeout (popup time)"));
127
	tqDebug(tr("-p secs\tSet ballooning timeout (popup time)"));
128
  qDebug(tr("-q     \tDisable ballooning title changes (quiet)"));
128
  tqDebug(tr("-q     \tDisable ballooning title changes (quiet)"));
129
  qDebug(tr("-t     \tRemove this application from the task bar"));
129
  tqDebug(tr("-t     \tRemove this application from the task bar"));
130
  qDebug(tr("-v     \tDisplay version"));
130
  tqDebug(tr("-v     \tDisplay version"));
131
  qDebug(tr("-w wid \tWindow id of the application to dock\n"));
131
  tqDebug(tr("-w wid \tWindow id of the application to dock\n"));
132
  
132
  
133
  qDebug(tr("NOTE: Use -d for all startup scripts.\n"));
133
  tqDebug(tr("NOTE: Use -d for all startup scripts.\n"));
134
134
135
  qDebug(tr("Bugs and wishes to gramakri@uiuc.edu"));
135
  tqDebug(tr("Bugs and wishes to gramakri@uiuc.edu"));
136
  qDebug(tr("Project information at http://kdocker.sourceforge.net"));
136
  tqDebug(tr("Project information at http://kdocker.sourceforge.net"));
137
}
137
}
138
138
139
void KDocker::notifyPreviousInstance(Window prevInstance)
139
void KDocker::notifyPreviousInstance(Window prevInstance)
140
{
140
{
141
  Display *display = QPaintDevice::x11AppDisplay();
141
  Display *display = TQPaintDevice::x11AppDisplay();
142
142
143
  TRACE("Notifying previous instance [%x]", (unsigned) prevInstance);
143
  TRACE("Notifying previous instance [%x]", (unsigned) prevInstance);
144
144
145
  // Dump all arguments in temporary file
145
  // Dump all arguments in temporary file
146
  QFile f(TMPFILE_PREFIX + QString().setNum(getpid()));
146
  TQFile f(TMPFILE_PREFIX + TQString().setNum(getpid()));
147
  if (!f.open(IO_WriteOnly)) return;
147
  if (!f.open(IO_WriteOnly)) return;
148
  QTextStream s(&f);
148
  TQTextStream s(&f);
149
	
149
	
150
  /*
150
  /*
151
   * Its normal to use KDocker in startup scripts. We could be getting restored
151
   * Its normal to use KDocker in startup scripts. We could be getting restored
Lines 212-222 Link Here
212
      unlink(tmp);
212
      unlink(tmp);
213
      return TRUE;
213
      return TRUE;
214
    }
214
    }
215
    QFile f(tmp);
215
    TQFile f(tmp);
216
    if (!f.open(IO_ReadOnly)) return TRUE;
216
    if (!f.open(IO_ReadOnly)) return TRUE;
217
    QTextStream s(&f);
217
    TQTextStream s(&f);
218
    QStringList argv;
218
    TQStringList argv;
219
    while (!s.atEnd()) { QString x; s >> x; argv += x; }
219
    while (!s.atEnd()) { TQString x; s >> x; argv += x; }
220
    f.close();
220
    f.close();
221
    unlink(tmp); // delete the tmp file
221
    unlink(tmp); // delete the tmp file
222
    mTrayLabelMgr->processCommand(argv);
222
    mTrayLabelMgr->processCommand(argv);
Lines 228-249 Link Here
228
/*
228
/*
229
 * XSMP Support
229
 * XSMP Support
230
 */
230
 */
231
void KDocker::saveState(QSessionManager &sm)
231
void KDocker::saveState(TQSessionManager &sm)
232
{
232
{
233
  QString sf = mTrayLabelMgr->saveSession();
233
  TQString sf = mTrayLabelMgr->saveSession();
234
234
235
  QStringList discard_command;
235
  TQStringList discard_command;
236
  discard_command << "rm" << sf;
236
  discard_command << "rm" << sf;
237
  sm.setDiscardCommand(discard_command);
237
  sm.setDiscardCommand(discard_command);
238
238
239
  sm.setRestartHint(QSessionManager::RestartIfRunning);
239
  sm.setRestartHint(TQSessionManager::RestartIfRunning);
240
  QStringList restart_command;
240
  TQStringList restart_command;
241
  restart_command << this->argv()[0]
241
  restart_command << this->argv()[0]
242
                  << "-session" << sm.sessionId();
242
                  << "-session" << sm.sessionId();
243
  sm.setRestartCommand(restart_command);
243
  sm.setRestartCommand(restart_command);
244
244
245
  TRACE("SessionFile=%s AppName=%s", sf.latin1(), this->argv()[0]);
245
  TRACE("SessionFile=%s AppName=%s", sf.latin1(), this->argv()[0]);
246
  DUMP_TRACE(QDir::homeDirPath() + "/kdocker.trace");
246
  DUMP_TRACE(TQDir::homeDirPath() + "/kdocker.trace");
247
  // sm.setRestartCommand(applicationFilePath());
247
  // sm.setRestartCommand(applicationFilePath());
248
}
248
}
249
249
(-)./src/kdocker.h (-6 / +6 lines)
Lines 22-52 Link Here
22
#ifndef _KDOCKER_H
22
#ifndef _KDOCKER_H
23
#define _KDOCKER_H
23
#define _KDOCKER_H
24
24
25
#include <qapplication.h>
25
#include <tqt3/ntqapplication.h>
26
#include <X11/Xlib.h>
26
#include <X11/Xlib.h>
27
27
28
#define KDOCKER_APP_VERSION "1.3"
28
#define KDOCKER_APP_VERSION "1.3"
29
29
30
class TrayLabelMgr;
30
class TrayLabelMgr;
31
31
32
class KDocker : public QApplication
32
class KDocker : public TQApplication
33
{
33
{
34
  Q_OBJECT
34
  TQ_OBJECT
35
35
36
public:
36
public:
37
  KDocker(int& argc, char** argv);
37
  KDocker(int& argc, char** argv);
38
38
39
  TrayLabelMgr *trayLabelMgr(void) { return mTrayLabelMgr; }
39
  TrayLabelMgr *trayLabelMgr(void) { return mTrayLabelMgr; }
40
40
41
  void dumpState(const QString &file);
41
  void dumpState(const TQString &file);
42
  void printUsage(char optopt = 'h');
42
  void printUsage(char optopt = 'h');
43
43
44
protected:
44
protected:
45
  bool x11EventFilter(XEvent * event);
45
  bool x11EventFilter(XEvent * event);
46
  void saveState(QSessionManager &sm);
46
  void saveState(TQSessionManager &sm);
47
47
48
private:
48
private:
49
  QString saveSession();
49
  TQString saveSession();
50
  bool restoreSession();
50
  bool restoreSession();
51
  void notifyPreviousInstance(Window prevInstance);
51
  void notifyPreviousInstance(Window prevInstance);
52
52
(-)./src/main.cpp (-4 / +4 lines)
Lines 24-30 Link Here
24
#include <unistd.h>
24
#include <unistd.h>
25
#include <signal.h>
25
#include <signal.h>
26
26
27
#include <qdir.h>
27
#include <tqt3/ntqdir.h>
28
#include "kdocker.h"
28
#include "kdocker.h"
29
#include "traylabelmgr.h"
29
#include "traylabelmgr.h"
30
#include "trace.h"
30
#include "trace.h"
Lines 34-45 Link Here
34
{
34
{
35
  if (sig == SIGUSR1)
35
  if (sig == SIGUSR1)
36
  {
36
  {
37
    DUMP_TRACE(QDir::homeDirPath() + "/kdocker.trace");
37
    DUMP_TRACE(TQDir::homeDirPath() + "/kdocker.trace");
38
    return;
38
    return;
39
  }
39
  }
40
  
40
  
41
  qDebug(qApp->translate("KDocker", "Caught signal %1. Cleaning up.").arg(sig));
41
  tqDebug(tqApp->translate("KDocker", "Caught signal %1. Cleaning up.").arg(sig));
42
  ((KDocker *)qApp)->trayLabelMgr()->undockAll();
42
  ((KDocker *)tqApp)->trayLabelMgr()->undockAll();
43
}
43
}
44
44
45
int main(int argc, char *argv[])
45
int main(int argc, char *argv[])
(-)./src/qtraylabel.cpp (-75 / +75 lines)
Lines 20-34 Link Here
20
// $Id: qtraylabel.cpp,v 1.30 2005/02/09 03:34:06 cs19713 Exp $
20
// $Id: qtraylabel.cpp,v 1.30 2005/02/09 03:34:06 cs19713 Exp $
21
21
22
// Include all Qt includes before X
22
// Include all Qt includes before X
23
#include <qstring.h>
23
#include <tqt3/ntqstring.h>
24
#include <qevent.h>
24
#include <tqt3/ntqevent.h>
25
#include <qpoint.h>
25
#include <tqt3/ntqpoint.h>
26
#include <qtooltip.h>
26
#include <tqt3/ntqtooltip.h>
27
#include <qtimer.h>
27
#include <tqt3/ntqtimer.h>
28
#include <qimage.h>
28
#include <tqt3/ntqimage.h>
29
#include <qpixmap.h>
29
#include <tqt3/ntqpixmap.h>
30
#include <qfileinfo.h>
30
#include <tqt3/ntqfileinfo.h>
31
#include <qapplication.h>
31
#include <tqt3/ntqapplication.h>
32
#include "trace.h"
32
#include "trace.h"
33
#include "qtraylabel.h"
33
#include "qtraylabel.h"
34
34
Lines 53-76 Link Here
53
  mDesktop = 666; // setDockedWindow would set it a saner value
53
  mDesktop = 666; // setDockedWindow would set it a saner value
54
54
55
  // Balloon's properties are set to match a Qt tool tip (see Qt source)
55
  // Balloon's properties are set to match a Qt tool tip (see Qt source)
56
  mBalloon = new QLabel(0, "balloon", WType_TopLevel | WStyle_StaysOnTop |
56
  mBalloon = new TQLabel(0, "balloon", WType_TopLevel | WStyle_StaysOnTop |
57
                                      WStyle_Customize | WStyle_NoBorder | 
57
                                      WStyle_Customize | WStyle_NoBorder | 
58
                                      WStyle_Tool | WX11BypassWM);
58
                                      WStyle_Tool | WX11BypassWM);
59
  mBalloon->setFont(QToolTip::font());
59
  mBalloon->setFont(TQToolTip::font());
60
  mBalloon->setPalette(QToolTip::palette());
60
  mBalloon->setPalette(TQToolTip::palette());
61
  mBalloon->setAlignment(Qt::AlignLeft | Qt::AlignTop);
61
  mBalloon->setAlignment(TQt::AlignLeft | TQt::AlignTop);
62
  mBalloon->setAutoMask(FALSE);
62
  mBalloon->setAutoMask(FALSE);
63
  mBalloon->setAutoResize(true);
63
  mBalloon->setAutoResize(true);
64
  setAlignment(Qt::AlignCenter);
64
  setAlignment(TQt::AlignCenter);
65
  setBackgroundMode(X11ParentRelative);
65
  setBackgroundMode(X11ParentRelative);
66
66
67
  connect(&mRealityMonitor, SIGNAL(timeout()), this, SLOT(realityCheck()));
67
  connect(&mRealityMonitor, SIGNAL(timeout()), this, SLOT(realityCheck()));
68
  setDockedWindow(mDockedWindow);
68
  setDockedWindow(mDockedWindow);
69
69
70
  sysTrayStatus(QPaintDevice::x11AppDisplay(), &mSysTray);
70
  sysTrayStatus(TQPaintDevice::x11AppDisplay(), &mSysTray);
71
  // Subscribe to system tray window notifications
71
  // Subscribe to system tray window notifications
72
  if (mSysTray != None)
72
  if (mSysTray != None)
73
    subscribe(QPaintDevice::x11AppDisplay(), mSysTray, 
73
    subscribe(TQPaintDevice::x11AppDisplay(), mSysTray, 
74
              StructureNotifyMask, true);
74
              StructureNotifyMask, true);
75
}
75
}
76
76
Lines 83-101 Link Here
83
  return temp;
83
  return temp;
84
}
84
}
85
85
86
QTrayLabel::QTrayLabel(Window w, QWidget* parent, const QString& text)
86
QTrayLabel::QTrayLabel(Window w, TQWidget* parent, const TQString& text)
87
  :QLabel(parent, text,	WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
87
  :TQLabel(parent, text,	WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
88
   mDockedWindow(w), mPid(0)
88
   mDockedWindow(w), mPid(0)
89
{
89
{
90
  initialize();
90
  initialize();
91
}
91
}
92
92
93
QTrayLabel::QTrayLabel(const QStringList& pname, pid_t pid, QWidget* parent)
93
QTrayLabel::QTrayLabel(const TQStringList& pname, pid_t pid, TQWidget* parent)
94
 :QLabel(parent, "TrayLabel", WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
94
 :TQLabel(parent, "TrayLabel", WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
95
  mDockedWindow(None), mProgName(pname), mPid(pid)
95
  mDockedWindow(None), mProgName(pname), mPid(pid)
96
{
96
{
97
  if (pname[0].at(0) != '/' && pname[0].find('/', 1) > 0) 
97
  if (pname[0].at(0) != '/' && pname[0].find('/', 1) > 0) 
98
    mProgName[0] = QFileInfo(pname[0]).absFilePath(); // convert to absolute
98
    mProgName[0] = TQFileInfo(pname[0]).absFilePath(); // convert to absolute
99
  initialize();
99
  initialize();
100
}
100
}
101
101
Lines 117-126 Link Here
117
{
117
{
118
   Window r, parent, *children;
118
   Window r, parent, *children;
119
   unsigned nchildren = 0;
119
   unsigned nchildren = 0;
120
   Display *display = QPaintDevice::x11AppDisplay();
120
   Display *display = TQPaintDevice::x11AppDisplay();
121
   QString ename = QFileInfo(mProgName[0]).fileName(); // strip out the path
121
   TQString ename = TQFileInfo(mProgName[0]).fileName(); // strip out the path
122
122
123
   XQueryTree(display, qt_xrootwin(), &r, &parent, &children, &nchildren);
123
   XQueryTree(display, tqt_xrootwin(), &r, &parent, &children, &nchildren);
124
   TRACE("%s nchildren=%i", me(), nchildren);
124
   TRACE("%s nchildren=%i", me(), nchildren);
125
   for(unsigned i=0; i<nchildren; i++)
125
   for(unsigned i=0; i<nchildren; i++)
126
   {
126
   {
Lines 148-159 Link Here
148
  if (mSysTray == None)
148
  if (mSysTray == None)
149
  {
149
  {
150
    // Check the system tray status if we were docked
150
    // Check the system tray status if we were docked
151
    if (sysTrayStatus(QPaintDevice::x11AppDisplay(), &mSysTray) 
151
    if (sysTrayStatus(TQPaintDevice::x11AppDisplay(), &mSysTray) 
152
            != SysTrayPresent) return; // no luck
152
            != SysTrayPresent) return; // no luck
153
153
154
    TRACE("%s System tray present", me());
154
    TRACE("%s System tray present", me());
155
    dock();
155
    dock();
156
    subscribe(QPaintDevice::x11AppDisplay(), mSysTray, 
156
    subscribe(TQPaintDevice::x11AppDisplay(), mSysTray, 
157
              StructureNotifyMask, true);
157
              StructureNotifyMask, true);
158
    mRealityMonitor.stop();
158
    mRealityMonitor.stop();
159
    return;
159
    return;
Lines 169-177 Link Here
169
   * scan existing client list and dock. I have never seen this happen 
169
   * scan existing client list and dock. I have never seen this happen 
170
   * but I see it likely to happen during session restoration
170
   * but I see it likely to happen during session restoration
171
   */
171
   */
172
  Display *display = QPaintDevice::x11AppDisplay();
172
  Display *display = TQPaintDevice::x11AppDisplay();
173
  XWindowAttributes attr;
173
  XWindowAttributes attr;
174
  XGetWindowAttributes(display, qt_xrootwin(), &attr);
174
  XGetWindowAttributes(display, tqt_xrootwin(), &attr);
175
175
176
  if (!(attr.your_event_mask & SubstructureNotifyMask)) 
176
  if (!(attr.your_event_mask & SubstructureNotifyMask)) 
177
  {
177
  {
Lines 197-205 Link Here
197
void QTrayLabel::showOnAllDesktops(void)
197
void QTrayLabel::showOnAllDesktops(void)
198
{
198
{
199
  TRACE("Showing on all desktops");
199
  TRACE("Showing on all desktops");
200
  Display *d = QPaintDevice::x11AppDisplay();
200
  Display *d = TQPaintDevice::x11AppDisplay();
201
  long l[5] = { -1, 0, 0, 0, 0 }; // -1 = all, 0 = Desktop1, 1 = Desktop2 ...
201
  long l[5] = { -1, 0, 0, 0, 0 }; // -1 = all, 0 = Desktop1, 1 = Desktop2 ...
202
  sendMessage(d, qt_xrootwin(), mDockedWindow, "_NET_WM_DESKTOP", 32, 
202
  sendMessage(d, tqt_xrootwin(), mDockedWindow, "_NET_WM_DESKTOP", 32, 
203
              SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
203
              SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
204
}
204
}
205
205
Lines 228-234 Link Here
228
    return;
228
    return;
229
  }
229
  }
230
230
231
  Display *display = QPaintDevice::x11AppDisplay();
231
  Display *display = TQPaintDevice::x11AppDisplay();
232
  Window wid = winId();
232
  Window wid = winId();
233
233
234
  // 1. GNOME and NET WM Specification
234
  // 1. GNOME and NET WM Specification
Lines 261-267 Link Here
261
   * working with with a delay of as little as 50ms. But since I
261
   * working with with a delay of as little as 50ms. But since I
262
   * dont understand why this delay is required, I am justifiably paranoid
262
   * dont understand why this delay is required, I am justifiably paranoid
263
   */
263
   */
264
  QTimer::singleShot(500, this, SLOT(show()));
264
  TQTimer::singleShot(500, this, SLOT(show()));
265
265
266
  // let the world know
266
  // let the world know
267
  emit docked(this);
267
  emit docked(this);
Lines 278-284 Link Here
278
{
278
{
279
  TRACE("%s stopping reality monitor", me());
279
  TRACE("%s stopping reality monitor", me());
280
  mRealityMonitor.stop();
280
  mRealityMonitor.stop();
281
  XUnmapWindow(QPaintDevice::x11AppDisplay(), winId());
281
  XUnmapWindow(TQPaintDevice::x11AppDisplay(), winId());
282
  emit undocked(this);
282
  emit undocked(this);
283
  emit undocked();
283
  emit undocked();
284
}
284
}
Lines 292-298 Link Here
292
  mWithdrawn = false;
292
  mWithdrawn = false;
293
  if (mDockedWindow == None) return;
293
  if (mDockedWindow == None) return;
294
  
294
  
295
  Display *display = QPaintDevice::x11AppDisplay();
295
  Display *display = TQPaintDevice::x11AppDisplay();
296
296
297
  if (mDesktop == -1)
297
  if (mDesktop == -1)
298
  {
298
  {
Lines 303-309 Link Here
303
       * the WM 200ms to do that. We will override that value to -1 (all
303
       * the WM 200ms to do that. We will override that value to -1 (all
304
       * desktops) on showOnAllDesktops().        
304
       * desktops) on showOnAllDesktops().        
305
       */
305
       */
306
       QTimer::singleShot(200, this, SLOT(showOnAllDesktops()));
306
       TQTimer::singleShot(200, this, SLOT(showOnAllDesktops()));
307
  }
307
  }
308
308
309
  /*
309
  /*
Lines 325-337 Link Here
325
  XSetWMNormalHints(display, mDockedWindow, &mSizeHint);
325
  XSetWMNormalHints(display, mDockedWindow, &mSizeHint);
326
  // make it the active window
326
  // make it the active window
327
  long l[5] = { None, CurrentTime, None, 0, 0 };
327
  long l[5] = { None, CurrentTime, None, 0, 0 };
328
  sendMessage(display, qt_xrootwin(), mDockedWindow, "_NET_ACTIVE_WINDOW", 32,
328
  sendMessage(display, tqt_xrootwin(), mDockedWindow, "_NET_ACTIVE_WINDOW", 32,
329
	            SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
329
	            SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
330
  // skipTaskbar modifies _NET_WM_STATE. Make sure we dont override WMs value
330
  // skipTaskbar modifies _NET_WM_STATE. Make sure we dont override WMs value
331
  QTimer::singleShot(230, this, SLOT(skipTaskbar()));
331
  TQTimer::singleShot(230, this, SLOT(skipTaskbar()));
332
  // disable docking when minized for some time (since we went to Iconic state)
332
  // disable docking when minized for some time (since we went to Iconic state)
333
  mDockWhenMinimized = !mDockWhenMinimized;
333
  mDockWhenMinimized = !mDockWhenMinimized;
334
  QTimer::singleShot(230, this, SLOT(toggleDockWhenMinimized()));
334
  TQTimer::singleShot(230, this, SLOT(toggleDockWhenMinimized()));
335
}
335
}
336
336
337
void QTrayLabel::withdraw(void)
337
void QTrayLabel::withdraw(void)
Lines 340-346 Link Here
340
  mWithdrawn = true;
340
  mWithdrawn = true;
341
  if (mDockedWindow == None) return;
341
  if (mDockedWindow == None) return;
342
342
343
  Display *display = QPaintDevice::x11AppDisplay();
343
  Display *display = TQPaintDevice::x11AppDisplay();
344
  int screen = DefaultScreen(display);
344
  int screen = DefaultScreen(display);
345
  long dummy;
345
  long dummy;
346
 
346
 
Lines 360-369 Link Here
360
  memset(&ev, 0, sizeof(ev));
360
  memset(&ev, 0, sizeof(ev));
361
  ev.type = UnmapNotify;
361
  ev.type = UnmapNotify;
362
  ev.display = display;
362
  ev.display = display;
363
  ev.event = qt_xrootwin();
363
  ev.event = tqt_xrootwin();
364
  ev.window = mDockedWindow;
364
  ev.window = mDockedWindow;
365
  ev.from_configure = false;
365
  ev.from_configure = false;
366
  XSendEvent(display, qt_xrootwin(), False, 
366
  XSendEvent(display, tqt_xrootwin(), False, 
367
             SubstructureRedirectMask|SubstructureNotifyMask, (XEvent *)&ev);
367
             SubstructureRedirectMask|SubstructureNotifyMask, (XEvent *)&ev);
368
  XSync(display, False);
368
  XSync(display, False);
369
}
369
}
Lines 380-386 Link Here
380
  unsigned long __attribute__ ((unused)) left;
380
  unsigned long __attribute__ ((unused)) left;
381
  Atom *data = NULL;
381
  Atom *data = NULL;
382
  unsigned long nitems = 0, num_states = 0;
382
  unsigned long nitems = 0, num_states = 0;
383
  Display *display = QPaintDevice::x11AppDisplay();
383
  Display *display = TQPaintDevice::x11AppDisplay();
384
384
385
  TRACE("%s", me());
385
  TRACE("%s", me());
386
  Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", True);
386
  Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", True);
Lines 439-448 Link Here
439
void QTrayLabel::close(void)
439
void QTrayLabel::close(void)
440
{
440
{
441
  TRACE("%s", me());
441
  TRACE("%s", me());
442
  Display *display = QPaintDevice::x11AppDisplay();
442
  Display *display = TQPaintDevice::x11AppDisplay();
443
  long l[5] = { 0, 0, 0, 0, 0 };
443
  long l[5] = { 0, 0, 0, 0, 0 };
444
  map();
444
  map();
445
  sendMessage(display, qt_xrootwin(), mDockedWindow, "_NET_CLOSE_WINDOW", 32,
445
  sendMessage(display, tqt_xrootwin(), mDockedWindow, "_NET_CLOSE_WINDOW", 32,
446
              SubstructureNotifyMask | SubstructureRedirectMask, 
446
              SubstructureNotifyMask | SubstructureRedirectMask, 
447
              l, sizeof(l));
447
              l, sizeof(l));
448
}
448
}
Lines 450-459 Link Here
450
/*
450
/*
451
 * Sets the tray icon. If the icon failed to load, we revert to application icon
451
 * Sets the tray icon. If the icon failed to load, we revert to application icon
452
 */
452
 */
453
void QTrayLabel::setTrayIcon(const QString& icon)
453
void QTrayLabel::setTrayIcon(const TQString& icon)
454
{
454
{
455
  mCustomIcon = icon;
455
  mCustomIcon = icon;
456
  if (QPixmap(mCustomIcon).isNull()) mCustomIcon = QString::null;
456
  if (TQPixmap(mCustomIcon).isNull()) mCustomIcon = TQString::null;
457
  TRACE("%s mCustomIcon=%s", me(), mCustomIcon.latin1());
457
  TRACE("%s mCustomIcon=%s", me(), mCustomIcon.latin1());
458
  updateIcon();
458
  updateIcon();
459
}
459
}
Lines 476-482 Link Here
476
  if (mDockedWindow == None) mRealityMonitor.start(500);
476
  if (mDockedWindow == None) mRealityMonitor.start(500);
477
  else mRealityMonitor.stop();
477
  else mRealityMonitor.stop();
478
478
479
  Display *d = QPaintDevice::x11AppDisplay();
479
  Display *d = TQPaintDevice::x11AppDisplay();
480
  
480
  
481
  // Subscribe for window or root window events
481
  // Subscribe for window or root window events
482
  if (w == None) subscribe(d, None, SubstructureNotifyMask, true);
482
  if (w == None) subscribe(d, None, SubstructureNotifyMask, true);
Lines 499-505 Link Here
499
499
500
    if (mWithdrawn) 
500
    if (mWithdrawn) 
501
      // show the window for sometime before docking
501
      // show the window for sometime before docking
502
      QTimer::singleShot(1000, this, SLOT(withdraw()));
502
      TQTimer::singleShot(1000, this, SLOT(withdraw()));
503
    else map();
503
    else map();
504
    dock();
504
    dock();
505
  }
505
  }
Lines 511-519 Link Here
511
void QTrayLabel::balloonText()
511
void QTrayLabel::balloonText()
512
{
512
{
513
  TRACE("%s BalloonText=%s ToolTipText=%s", me(),
513
  TRACE("%s BalloonText=%s ToolTipText=%s", me(),
514
        mBalloon->text().latin1(), QToolTip::textFor(this).latin1());
514
        mBalloon->text().latin1(), TQToolTip::textFor(this).latin1());
515
                                          
515
                                          
516
  if (mBalloon->text() == QToolTip::textFor(this)) return;
516
  if (mBalloon->text() == TQToolTip::textFor(this)) return;
517
#if 0 // I_GOT_NETWM_BALLOONING_TO_WORK
517
#if 0 // I_GOT_NETWM_BALLOONING_TO_WORK
518
  // if you can get NET WM ballooning to work let me know
518
  // if you can get NET WM ballooning to work let me know
519
  static int id = 1;
519
  static int id = 1;
Lines 535-552 Link Here
535
  }
535
  }
536
#else
536
#else
537
  // Manually do ballooning. See the Qt ToolTip code
537
  // Manually do ballooning. See the Qt ToolTip code
538
  QString oldText = mBalloon->text();
538
  TQString oldText = mBalloon->text();
539
  mBalloon->setText(QToolTip::textFor(this));
539
  mBalloon->setText(TQToolTip::textFor(this));
540
  if (oldText.isEmpty()) return; // dont tool tip the first time
540
  if (oldText.isEmpty()) return; // dont tool tip the first time
541
  QPoint p = mapToGlobal(QPoint(0, -1 - mBalloon->height()));
541
  TQPoint p = mapToGlobal(TQPoint(0, -1 - mBalloon->height()));
542
  if (p.x() + mBalloon->width() > QApplication::desktop()->width())
542
  if (p.x() + mBalloon->width() > TQApplication::desktop()->width())
543
    p.setX(p.x() + width() - mBalloon->width());
543
    p.setX(p.x() + width() - mBalloon->width());
544
544
545
  if (p.y() < 0) p.setY(height() + 1);
545
  if (p.y() < 0) p.setY(height() + 1);
546
546
547
  mBalloon->move(p);
547
  mBalloon->move(p);
548
  mBalloon->show();
548
  mBalloon->show();
549
  QTimer::singleShot(mBalloonTimeout, mBalloon, SLOT(hide()));
549
  TQTimer::singleShot(mBalloonTimeout, mBalloon, SLOT(hide()));
550
#endif
550
#endif
551
}
551
}
552
552
Lines 555-561 Link Here
555
 */
555
 */
556
void QTrayLabel::handleTitleChange(void)
556
void QTrayLabel::handleTitleChange(void)
557
{
557
{
558
  Display *display = QPaintDevice::x11AppDisplay();
558
  Display *display = TQPaintDevice::x11AppDisplay();
559
  char *window_name = NULL;
559
  char *window_name = NULL;
560
560
561
  XFetchName(display, mDockedWindow, &window_name);
561
  XFetchName(display, mDockedWindow, &window_name);
Lines 566-573 Link Here
566
  XClassHint ch;
566
  XClassHint ch;
567
  if (XGetClassHint(display, mDockedWindow, &ch))
567
  if (XGetClassHint(display, mDockedWindow, &ch))
568
  {
568
  {
569
    if (ch.res_class) mClass = QString(ch.res_class);
569
    if (ch.res_class) mClass = TQString(ch.res_class);
570
    else if (ch.res_name) mClass = QString(ch.res_name);
570
    else if (ch.res_name) mClass = TQString(ch.res_name);
571
571
572
    if (ch.res_class) XFree(ch.res_class);
572
    if (ch.res_class) XFree(ch.res_class);
573
    if (ch.res_name) XFree(ch.res_name);
573
    if (ch.res_name) XFree(ch.res_name);
Lines 584-592 Link Here
584
void QTrayLabel::updateTitle()
584
void QTrayLabel::updateTitle()
585
{
585
{
586
  TRACE("%s", me());
586
  TRACE("%s", me());
587
  QString text = mTitle + " [" + mClass + "]";
587
  TQString text = mTitle + " [" + mClass + "]";
588
  QToolTip::remove(this);
588
  TQToolTip::remove(this);
589
  QToolTip::add(this, text);
589
  TQToolTip::add(this, text);
590
590
591
  if (mBalloonTimeout) balloonText();
591
  if (mBalloonTimeout) balloonText();
592
}
592
}
Lines 598-604 Link Here
598
  TRACE("%s", me());
598
  TRACE("%s", me());
599
  if (mDockedWindow == None) return;
599
  if (mDockedWindow == None) return;
600
600
601
  Display *display = QPaintDevice::x11AppDisplay();
601
  Display *display = TQPaintDevice::x11AppDisplay();
602
  XWMHints *wm_hints = XGetWMHints(display, mDockedWindow);
602
  XWMHints *wm_hints = XGetWMHints(display, mDockedWindow);
603
  if (wm_hints != NULL)
603
  if (wm_hints != NULL)
604
  {
604
  {
Lines 614-626 Link Here
614
                              wm_hints->icon_mask, NULL);
614
                              wm_hints->icon_mask, NULL);
615
    XFree(wm_hints);
615
    XFree(wm_hints);
616
  }
616
  }
617
  QImage image;
617
  TQImage image;
618
  if (!window_icon) 
618
  if (!window_icon) 
619
  {
619
  {
620
    if (!image.load(QString(ICONS_PATH) + "/question.png"))
620
    if (!image.load(TQString(ICONS_PATH) + "/question.png"))
621
      image.load(qApp->applicationDirPath() + "/icons/question.png");
621
      image.load(tqApp->applicationDirPath() + "/icons/question.png");
622
  }
622
  }
623
  else image = QPixmap((const char **) window_icon).convertToImage();
623
  else image = TQPixmap((const char **) window_icon).convertToImage();
624
  if (window_icon) XpmFree(window_icon);
624
  if (window_icon) XpmFree(window_icon);
625
  mAppIcon = image.smoothScale(24, 24); // why?
625
  mAppIcon = image.smoothScale(24, 24); // why?
626
  setMinimumSize(mAppIcon.size());
626
  setMinimumSize(mAppIcon.size());
Lines 637-650 Link Here
637
  TRACE("%s", me());
637
  TRACE("%s", me());
638
  setPixmap(mCustomIcon.isEmpty() ? mAppIcon : mCustomIcon);
638
  setPixmap(mCustomIcon.isEmpty() ? mAppIcon : mCustomIcon);
639
  erase();
639
  erase();
640
  QPaintEvent pe(rect());
640
  TQPaintEvent pe(rect());
641
  paintEvent(&pe);
641
  paintEvent(&pe);
642
}
642
}
643
643
644
/*
644
/*
645
 * Mouse activity on our label. RightClick = Menu. LeftClick = Toggle Map
645
 * Mouse activity on our label. RightClick = Menu. LeftClick = Toggle Map
646
 */
646
 */
647
void QTrayLabel::mouseReleaseEvent(QMouseEvent * ev)
647
void QTrayLabel::mouseReleaseEvent(TQMouseEvent * ev)
648
{
648
{
649
  emit clicked(ev->button(), ev->globalPos());
649
  emit clicked(ev->button(), ev->globalPos());
650
}
650
}
Lines 652-658 Link Here
652
/*
652
/*
653
 * Track drag event
653
 * Track drag event
654
 */
654
 */
655
void QTrayLabel::dragEnterEvent(QDragEnterEvent *ev)
655
void QTrayLabel::dragEnterEvent(TQDragEnterEvent *ev)
656
{
656
{
657
  ev->accept(); 
657
  ev->accept(); 
658
  map();
658
  map();
Lines 702-712 Link Here
702
702
703
  TRACE("%s Will analyze window 0x%x", me(), (int)((XMapEvent *)event)->window);
703
  TRACE("%s Will analyze window 0x%x", me(), (int)((XMapEvent *)event)->window);
704
  // Check if this window is the soulmate we are looking for
704
  // Check if this window is the soulmate we are looking for
705
  Display *display = QPaintDevice::x11AppDisplay();
705
  Display *display = TQPaintDevice::x11AppDisplay();
706
  Window w = XmuClientWindow(display, ((XMapEvent *) event)->window);
706
  Window w = XmuClientWindow(display, ((XMapEvent *) event)->window);
707
  if (!isNormalWindow(display, w)) return FALSE;
707
  if (!isNormalWindow(display, w)) return FALSE;
708
  if (!analyzeWindow(display, w, mPid, 
708
  if (!analyzeWindow(display, w, mPid, 
709
         QFileInfo(mProgName[0]).fileName().latin1())) return FALSE;
709
         TQFileInfo(mProgName[0]).fileName().latin1())) return FALSE;
710
  // All right. Lets dock this baby
710
  // All right. Lets dock this baby
711
  setDockedWindow(w);
711
  setDockedWindow(w);
712
  return true;
712
  return true;
Lines 727-733 Link Here
727
727
728
void QTrayLabel::propertyChangeEvent(Atom property)
728
void QTrayLabel::propertyChangeEvent(Atom property)
729
{
729
{
730
  Display *display = QPaintDevice::x11AppDisplay();
730
  Display *display = TQPaintDevice::x11AppDisplay();
731
  static Atom WM_NAME = XInternAtom(display, "WM_NAME", True);
731
  static Atom WM_NAME = XInternAtom(display, "WM_NAME", True);
732
  static Atom WM_ICON = XInternAtom(display, "WM_ICON", True);
732
  static Atom WM_ICON = XInternAtom(display, "WM_ICON", True);
733
  static Atom WM_STATE = XInternAtom(display, "WM_STATE", True);
733
  static Atom WM_STATE = XInternAtom(display, "WM_STATE", True);
Lines 764-770 Link Here
764
}
764
}
765
765
766
// Session Management
766
// Session Management
767
bool QTrayLabel::saveState(QSettings &settings)
767
bool QTrayLabel::saveState(TQSettings &settings)
768
{
768
{
769
  TRACE("%s saving state", me());
769
  TRACE("%s saving state", me());
770
  settings.writeEntry("/Application", mProgName.join(" "));
770
  settings.writeEntry("/Application", mProgName.join(" "));
Lines 776-782 Link Here
776
  return true;
776
  return true;
777
}
777
}
778
778
779
bool QTrayLabel::restoreState(QSettings &settings)
779
bool QTrayLabel::restoreState(TQSettings &settings)
780
{
780
{
781
  TRACE("%s restoring state", me());
781
  TRACE("%s restoring state", me());
782
  mCustomIcon = settings.readEntry("/CustomIcon");
782
  mCustomIcon = settings.readEntry("/CustomIcon");
Lines 795-801 Link Here
795
   * the application really shows itself up before we do a scan (the reason
795
   * the application really shows itself up before we do a scan (the reason
796
   * why we have 2s
796
   * why we have 2s
797
   */
797
   */
798
   if (!mPid) QTimer::singleShot(2000, this, SLOT(scanClients()));
798
   if (!mPid) TQTimer::singleShot(2000, this, SLOT(scanClients()));
799
799
800
   return true;
800
   return true;
801
}
801
}
(-)./src/qtraylabel.h (-33 / +33 lines)
Lines 22-36 Link Here
22
#ifndef _QTRAYLABEL_H
22
#ifndef _QTRAYLABEL_H
23
#define _QTRAYLABEL_H
23
#define _QTRAYLABEL_H
24
24
25
#include <qlabel.h>
25
#include <tqt3/ntqlabel.h>
26
#include <qstring.h>
26
#include <tqt3/ntqstring.h>
27
#include <qstringlist.h>
27
#include <tqt3/ntqstringlist.h>
28
#include <qpixmap.h>
28
#include <tqt3/ntqpixmap.h>
29
#include <qtimer.h>
29
#include <tqt3/ntqtimer.h>
30
#include <qtextstream.h>
30
#include <tqt3/ntqtextstream.h>
31
#include <qsettings.h>
31
#include <tqt3/ntqsettings.h>
32
#include <qevent.h>
32
#include <tqt3/ntqevent.h>
33
#include <qsize.h>
33
#include <tqt3/ntqsize.h>
34
34
35
#include <X11/Xlib.h>
35
#include <X11/Xlib.h>
36
#include <X11/Xutil.h>
36
#include <X11/Xutil.h>
Lines 39-55 Link Here
39
#include <sys/types.h>
39
#include <sys/types.h>
40
#include <unistd.h>
40
#include <unistd.h>
41
41
42
class QMouseEvent;
42
class TQMouseEvent;
43
class QDragEnterEvent;
43
class TQDragEnterEvent;
44
class QPoint;
44
class TQPoint;
45
45
46
class QTrayLabel : public QLabel
46
class QTrayLabel : public TQLabel
47
{
47
{
48
  Q_OBJECT
48
  TQ_OBJECT
49
49
50
public:
50
public:
51
  QTrayLabel(Window w, QWidget* p = 0, const QString& text = QString::null);
51
  QTrayLabel(Window w, TQWidget* p = 0, const TQString& text = TQString::null);
52
  QTrayLabel(const QStringList& argv, pid_t pid, QWidget* parent = 0);
52
  QTrayLabel(const TQStringList& argv, pid_t pid, TQWidget* parent = 0);
53
  virtual ~QTrayLabel();
53
  virtual ~QTrayLabel();
54
54
55
  // Accessors
55
  // Accessors
Lines 59-76 Link Here
59
  bool isWithdrawn(void) const { return mWithdrawn; }
59
  bool isWithdrawn(void) const { return mWithdrawn; }
60
  bool isDockWhenMinimized(void) const { return mDockWhenMinimized; }
60
  bool isDockWhenMinimized(void) const { return mDockWhenMinimized; }
61
61
62
  QString appName(void) const { return mProgName[0]; }
62
  TQString appName(void) const { return mProgName[0]; }
63
  virtual void setAppName(const QString& prog) { mProgName[0] = prog; }
63
  virtual void setAppName(const TQString& prog) { mProgName[0] = prog; }
64
  QString appClass(void) const { return mClass; }
64
  TQString appClass(void) const { return mClass; }
65
  QString appTitle(void) const { return mTitle; }
65
  TQString appTitle(void) const { return mTitle; }
66
  QPixmap appIcon(void) const  { return mAppIcon;  }
66
  TQPixmap appIcon(void) const  { return mAppIcon;  }
67
67
68
  // Pass on all events through this interface
68
  // Pass on all events through this interface
69
  bool x11EventFilter(XEvent * event);
69
  bool x11EventFilter(XEvent * event);
70
70
71
  // Session Management
71
  // Session Management
72
  virtual bool saveState(QSettings& settings);
72
  virtual bool saveState(TQSettings& settings);
73
  virtual bool restoreState(QSettings& settings);
73
  virtual bool restoreState(TQSettings& settings);
74
74
75
public slots:
75
public slots:
76
  void dock(void);              // puts us in the system tray
76
  void dock(void);              // puts us in the system tray
Lines 80-86 Link Here
80
  void toggleShow(void)         // convenience slot
80
  void toggleShow(void)         // convenience slot
81
        { if (mWithdrawn) map(); else withdraw(); }
81
        { if (mWithdrawn) map(); else withdraw(); }
82
  void close(void);             // close the docked window
82
  void close(void);             // close the docked window
83
  void setTrayIcon(const QString& icon);  // sets custom icon
83
  void setTrayIcon(const TQString& icon);  // sets custom icon
84
84
85
  // and some property setters
85
  // and some property setters
86
  virtual void setSkipTaskbar(bool skip);  // skip the taskbar
86
  virtual void setSkipTaskbar(bool skip);  // skip the taskbar
Lines 91-97 Link Here
91
  void scanClients(void);       // scans existing client connections
91
  void scanClients(void);       // scans existing client connections
92
 
92
 
93
signals:
93
signals:
94
  void clicked(const ButtonState&, const QPoint&);
94
  void clicked(const ButtonState&, const TQPoint&);
95
  void docked(QTrayLabel *);   // emitted when we get docked
95
  void docked(QTrayLabel *);   // emitted when we get docked
96
  void docked(void);           // emitted when we get docked
96
  void docked(void);           // emitted when we get docked
97
  void undocked(QTrayLabel *); // emitted when we get undocked
97
  void undocked(QTrayLabel *); // emitted when we get undocked
Lines 101-108 Link Here
101
101
102
protected:
102
protected:
103
  // reimplement these event handlers in subclass as needed
103
  // reimplement these event handlers in subclass as needed
104
  virtual void mouseReleaseEvent(QMouseEvent *event);
104
  virtual void mouseReleaseEvent(TQMouseEvent *event);
105
  virtual void dragEnterEvent(QDragEnterEvent *event);
105
  virtual void dragEnterEvent(TQDragEnterEvent *event);
106
  
106
  
107
  // the events that follow are events of the docked window (NOT QTrayLabel)
107
  // the events that follow are events of the docked window (NOT QTrayLabel)
108
  virtual void updateIcon(void);   // updates the icon
108
  virtual void updateIcon(void);   // updates the icon
Lines 139-157 Link Here
139
139
140
  // Member variables
140
  // Member variables
141
  long mDesktop;      // desktop on which the window is being shown
141
  long mDesktop;      // desktop on which the window is being shown
142
  QLabel *mBalloon;		// tooltip text simulator
142
  TQLabel *mBalloon;		// tooltip text simulator
143
  QString mCustomIcon;		// CustomIcon of the docked application
143
  TQString mCustomIcon;		// CustomIcon of the docked application
144
  Window mDockedWindow;	// the window which is being docked
144
  Window mDockedWindow;	// the window which is being docked
145
	int mBalloonTimeout;
145
	int mBalloonTimeout;
146
  bool mDocked, mWithdrawn, mSkippingTaskbar;
146
  bool mDocked, mWithdrawn, mSkippingTaskbar;
147
  bool mDockWhenMinimized;
147
  bool mDockWhenMinimized;
148
148
149
  QString mTitle, mClass;	// Title and hint of mDockedWindow
149
  TQString mTitle, mClass;	// Title and hint of mDockedWindow
150
  QPixmap mAppIcon;       // The current app icon (may not be same as pixmap())
150
  TQPixmap mAppIcon;       // The current app icon (may not be same as pixmap())
151
  XSizeHints mSizeHint;		// SizeHint of mDockedWindow
151
  XSizeHints mSizeHint;		// SizeHint of mDockedWindow
152
152
153
  QTimer mRealityMonitor;  // Helps us sync up with reality
153
  TQTimer mRealityMonitor;  // Helps us sync up with reality
154
  QStringList mProgName;   // The program whose window we are docking
154
  TQStringList mProgName;   // The program whose window we are docking
155
  pid_t mPid;              // The PID of program whose window we are docking
155
  pid_t mPid;              // The PID of program whose window we are docking
156
156
157
  Window mSysTray;    // System tray window id
157
  Window mSysTray;    // System tray window id
(-)./src/trace.cpp (-6 / +6 lines)
Lines 1-7 Link Here
1
#ifdef ENABLE_TRACING
1
#ifdef ENABLE_TRACING
2
#include <qapplication.h>
2
#include <tqt3/ntqapplication.h>
3
#include <qtextedit.h>
3
#include <tqt3/ntqtextedit.h>
4
#include <qfile.h>
4
#include <tqt3/ntqfile.h>
5
#include <stdio.h>
5
#include <stdio.h>
6
6
7
static QTextEdit *tracer = NULL;
7
static QTextEdit *tracer = NULL;
Lines 20-26 Link Here
20
{
20
{
21
  if (tracer) return;     // de javu
21
  if (tracer) return;     // de javu
22
  tracer = new QTextEdit();
22
  tracer = new QTextEdit();
23
  tracer->setTextFormat(Qt::LogText);
23
  tracer->setTextFormat(TQt::LogText);
24
  tracer->setMaxLogLines(10000);
24
  tracer->setMaxLogLines(10000);
25
  tracer->resize(750, 300);
25
  tracer->resize(750, 300);
26
  qInstallMsgHandler(TRACER);
26
  qInstallMsgHandler(TRACER);
Lines 33-42 Link Here
33
33
34
void DUMP_TRACE(const char *f)
34
void DUMP_TRACE(const char *f)
35
{
35
{
36
  QFile file(f); // Write the text to a file
36
  TQFile file(f); // Write the text to a file
37
  if (file.open(IO_WriteOnly))
37
  if (file.open(IO_WriteOnly))
38
  {
38
  {
39
    QTextStream stream(&file);
39
    TQTextStream stream(&file);
40
    stream << tracer->text();
40
    stream << tracer->text();
41
  }
41
  }
42
}
42
}
(-)./src/trace.h (-2 / +2 lines)
Lines 12-18 Link Here
12
   * WARNING: fmt has to be a static string
12
   * WARNING: fmt has to be a static string
13
   */
13
   */
14
  #define TRACE(fmt,args...) \
14
  #define TRACE(fmt,args...) \
15
        do { qDebug("~%s - \t" fmt, __PRETTY_FUNCTION__, ##args); } while (0)
15
        do { tqDebug("~%s - \t" fmt, __PRETTY_FUNCTION__, ##args); } while (0)
16
16
17
  #define SHOW_TRACE_TEXT "Show Trace"
17
  #define SHOW_TRACE_TEXT "Show Trace"
18
  
18
  
Lines 21-27 Link Here
21
  #define INIT_TRACE()
21
  #define INIT_TRACE()
22
  #define TRACE(fmt, ...)
22
  #define TRACE(fmt, ...)
23
  #define SHOW_TRACE()
23
  #define SHOW_TRACE()
24
  #define SHOW_TRACE_TEXT QString::null
24
  #define SHOW_TRACE_TEXT TQString::null
25
  #define DUMP_TRACE(file)
25
  #define DUMP_TRACE(file)
26
26
27
#endif  // ENABLE_TRACING
27
#endif  // ENABLE_TRACING
(-)./src/traylabelmgr.cpp (-69 / +69 lines)
Lines 19-33 Link Here
19
19
20
// $Id: traylabelmgr.cpp,v 1.10 2005/02/09 03:38:43 cs19713 Exp $
20
// $Id: traylabelmgr.cpp,v 1.10 2005/02/09 03:38:43 cs19713 Exp $
21
21
22
#include <qdir.h>
22
#include <tqt3/ntqdir.h>
23
#include <qapplication.h>
23
#include <tqt3/ntqapplication.h>
24
#include <qmessagebox.h>
24
#include <tqt3/ntqmessagebox.h>
25
#include <qtimer.h>
25
#include <tqt3/ntqtimer.h>
26
#include <qfile.h>
26
#include <tqt3/ntqfile.h>
27
#include <qaction.h>
27
#include <tqt3/ntqaction.h>
28
#include <qpopupmenu.h>
28
#include <tqt3/ntqpopupmenu.h>
29
#include <qtextstream.h>
29
#include <tqt3/ntqtextstream.h>
30
#include <qfiledialog.h>
30
#include <tqt3/ntqfiledialog.h>
31
31
32
#include "trace.h"
32
#include "trace.h"
33
#include "traylabelmgr.h"
33
#include "traylabelmgr.h"
Lines 50-56 Link Here
50
TrayLabelMgr::TrayLabelMgr() : mReady(false), mHiddenLabelsCount(0)
50
TrayLabelMgr::TrayLabelMgr() : mReady(false), mHiddenLabelsCount(0)
51
{
51
{
52
  // Set ourselves up to be called from the application loop
52
  // Set ourselves up to be called from the application loop
53
  QTimer::singleShot(0, this, SLOT(startup()));
53
  TQTimer::singleShot(0, this, SLOT(startup()));
54
}
54
}
55
55
56
TrayLabelMgr::~TrayLabelMgr()
56
TrayLabelMgr::~TrayLabelMgr()
Lines 60-70 Link Here
60
60
61
void TrayLabelMgr::about(void)
61
void TrayLabelMgr::about(void)
62
{
62
{
63
  if (QMessageBox::information(NULL, tr("About KDocker"),
63
  if (TQMessageBox::information(NULL, tr("About KDocker"),
64
        tr("Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu)\n"
64
        tr("Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu)\n"
65
           "English translation by Girish (gramakri@uiuc.edu)\n\n"
65
           "English translation by Girish (gramakri@uiuc.edu)\n\n"
66
           "http://kdocker.sourceforge.net for updates"),
66
           "http://kdocker.sourceforge.net for updates"),
67
        QString::null, SHOW_TRACE_TEXT) == 1) SHOW_TRACE();
67
        TQString::null, SHOW_TRACE_TEXT) == 1) SHOW_TRACE();
68
}
68
}
69
69
70
void TrayLabelMgr::startup(void)
70
void TrayLabelMgr::startup(void)
Lines 76-100 Link Here
76
   * stdout is a tty) OR if we are getting restored, wait for WAIT_TIME until
76
   * stdout is a tty) OR if we are getting restored, wait for WAIT_TIME until
77
   * the system tray shows up (before informing the user)
77
   * the system tray shows up (before informing the user)
78
   */
78
   */
79
  static bool do_wait = !isatty(fileno(stdout)) || qApp->isSessionRestored();
79
  static bool do_wait = !isatty(fileno(stdout)) || tqApp->isSessionRestored();
80
80
81
  SysTrayState state = sysTrayStatus(QPaintDevice::x11AppDisplay());
81
  SysTrayState state = sysTrayStatus(TQPaintDevice::x11AppDisplay());
82
82
83
  if (state != SysTrayPresent)
83
  if (state != SysTrayPresent)
84
  {
84
  {
85
    if (wait_time-- > 0 && do_wait)
85
    if (wait_time-- > 0 && do_wait)
86
    {
86
    {
87
      TRACE("Will check sys tray status after 1 second");
87
      TRACE("Will check sys tray status after 1 second");
88
      QTimer::singleShot(1000, this, SLOT(startup()));
88
      TQTimer::singleShot(1000, this, SLOT(startup()));
89
      return;
89
      return;
90
    }
90
    }
91
91
92
    if (QMessageBox::warning(NULL, tr("KDocker"), 
92
    if (TQMessageBox::warning(NULL, tr("KDocker"), 
93
          tr(state == SysTrayAbsent ? "No system tray found"
93
          tr(state == SysTrayAbsent ? "No system tray found"
94
                                    : "System tray appears to be hidden"), 
94
                                    : "System tray appears to be hidden"), 
95
          QMessageBox::Abort, QMessageBox::Ignore) == QMessageBox::Abort)
95
          TQMessageBox::Abort, TQMessageBox::Ignore) == TQMessageBox::Abort)
96
    {
96
    {
97
        qApp->quit();
97
        tqApp->quit();
98
        return;
98
        return;
99
    }
99
    }
100
  }
100
  }
Lines 102-122 Link Here
102
  // Things are fine or user with OK with the state of system tray
102
  // Things are fine or user with OK with the state of system tray
103
  mReady = true;
103
  mReady = true;
104
  bool ok = false;
104
  bool ok = false;
105
  if (qApp->isSessionRestored()) ok = restoreSession(qApp->sessionId());
105
  if (tqApp->isSessionRestored()) ok = restoreSession(tqApp->sessionId());
106
  else ok = processCommand(qApp->argc(), qApp->argv());
106
  else ok = processCommand(tqApp->argc(), tqApp->argv());
107
  // Process the request Q from previous instances
107
  // Process the request Q from previous instances
108
108
109
  TRACE("Request queue has %i requests", mRequestQ.count());
109
  TRACE("Request queue has %i requests", mRequestQ.count());
110
  for(unsigned i=0; i < mRequestQ.count(); i++)
110
  for(unsigned i=0; i < mRequestQ.count(); i++)
111
    ok |= processCommand(mRequestQ[i]);
111
    ok |= processCommand(mRequestQ[i]);
112
  if (!ok) qApp->quit();
112
  if (!ok) tqApp->quit();
113
}
113
}
114
114
115
// Initialize a QTrayLabel after its creation
115
// Initialize a QTrayLabel after its creation
116
void TrayLabelMgr::manageTrayLabel(QTrayLabel *t)
116
void TrayLabelMgr::manageTrayLabel(QTrayLabel *t)
117
{
117
{
118
  connect(t, SIGNAL(destroyed(QObject *)), 
118
  connect(t, SIGNAL(destroyed(TQObject *)), 
119
          this, SLOT(trayLabelDestroyed(QObject *)));
119
          this, SLOT(trayLabelDestroyed(TQObject *)));
120
  connect(t, SIGNAL(undocked(QTrayLabel *)), t, SLOT(deleteLater()));
120
  connect(t, SIGNAL(undocked(QTrayLabel *)), t, SLOT(deleteLater()));
121
121
122
  // All QTrayLabels will emit this signal. We just need one of them
122
  // All QTrayLabels will emit this signal. We just need one of them
Lines 140-146 Link Here
140
void TrayLabelMgr::undockAll()
140
void TrayLabelMgr::undockAll()
141
{
141
{
142
  TRACE("Number of tray labels = %i", mTrayLabels.count());
142
  TRACE("Number of tray labels = %i", mTrayLabels.count());
143
  QPtrListIterator<QTrayLabel> it(mTrayLabels);
143
  TQPtrListIterator<QTrayLabel> it(mTrayLabels);
144
  QTrayLabel *t;
144
  QTrayLabel *t;
145
  while ((t = it.current()) != 0)
145
  while ((t = it.current()) != 0)
146
  {
146
  {
Lines 150-156 Link Here
150
}
150
}
151
151
152
// Process the command line
152
// Process the command line
153
bool TrayLabelMgr::processCommand(const QStringList& args)
153
bool TrayLabelMgr::processCommand(const TQStringList& args)
154
{
154
{
155
  if (!mReady)
155
  if (!mReady)
156
  {
156
  {
Lines 184-190 Link Here
184
  if (qstrcmp(argv[1], "-session") == 0)
184
  if (qstrcmp(argv[1], "-session") == 0)
185
  {
185
  {
186
    TRACE("Restoring session %s (new instance request)", argv[2]);
186
    TRACE("Restoring session %s (new instance request)", argv[2]);
187
    return restoreSession(QString(argv[2]));
187
    return restoreSession(TQString(argv[2]));
188
  }
188
  }
189
189
190
  int option;
190
  int option;
Lines 204-210 Link Here
204
      case '?':
204
      case '?':
205
        return false;
205
        return false;
206
      case 'a':
206
      case 'a':
207
        qDebug(tr("Girish Ramakrishnan (gramakri@uiuc.edu)"));
207
        tqDebug(tr("Girish Ramakrishnan (gramakri@uiuc.edu)"));
208
        return false;
208
        return false;
209
      case 'b':
209
      case 'b':
210
        check_normality = false;
210
        check_normality = false;
Lines 216-222 Link Here
216
        enable_sm = true;
216
        enable_sm = true;
217
        break;
217
        break;
218
      case 'f':
218
      case 'f':
219
        w = activeWindow(QPaintDevice::x11AppDisplay());
219
        w = activeWindow(TQPaintDevice::x11AppDisplay());
220
        TRACE("Active window is %i", (unsigned) w);
220
        TRACE("Active window is %i", (unsigned) w);
221
        break;
221
        break;
222
      case 'i':
222
      case 'i':
Lines 245-253 Link Here
245
          sscanf(optarg, "%x", (unsigned *) &w);
245
          sscanf(optarg, "%x", (unsigned *) &w);
246
        else
246
        else
247
          w = (Window) atoi(optarg);
247
          w = (Window) atoi(optarg);
248
          if (!isValidWindowId(QPaintDevice::x11AppDisplay(), w))
248
          if (!isValidWindowId(TQPaintDevice::x11AppDisplay(), w))
249
          {
249
          {
250
            qDebug("Window 0x%x invalid", (unsigned) w);
250
            tqDebug("Window 0x%x invalid", (unsigned) w);
251
            return false;
251
            return false;
252
          }
252
          }
253
        break;
253
        break;
Lines 279-306 Link Here
279
{
279
{
280
  if (w == None)
280
  if (w == None)
281
  {
281
  {
282
    qDebug(tr("Select the application/window to dock with button1."));
282
    tqDebug(tr("Select the application/window to dock with button1."));
283
    qDebug(tr("Click any other button to abort\n"));
283
    tqDebug(tr("Click any other button to abort\n"));
284
284
285
    const char *err = NULL;
285
    const char *err = NULL;
286
 
286
 
287
    if ((w = selectWindow(QPaintDevice::x11AppDisplay(), &err)) == None)
287
    if ((w = selectWindow(TQPaintDevice::x11AppDisplay(), &err)) == None)
288
    {
288
    {
289
      if (err) QMessageBox::critical(NULL, tr("KDocker"), tr(err));
289
      if (err) TQMessageBox::critical(NULL, tr("KDocker"), tr(err));
290
      return NULL;
290
      return NULL;
291
    }
291
    }
292
  }
292
  }
293
293
294
  if (checkNormality && !isNormalWindow(QPaintDevice::x11AppDisplay(), w))
294
  if (checkNormality && !isNormalWindow(TQPaintDevice::x11AppDisplay(), w))
295
  {
295
  {
296
    /*
296
    /*
297
     * Abort should be the only option here really. "Ignore" is provided here
297
     * Abort should be the only option here really. "Ignore" is provided here
298
     * for the curious user who wants to screw himself very badly
298
     * for the curious user who wants to screw himself very badly
299
     */
299
     */
300
    if (QMessageBox::warning(NULL, tr("KDocker"),
300
    if (TQMessageBox::warning(NULL, tr("KDocker"),
301
          tr("The window you are attempting to dock does not seem to be a"
301
          tr("The window you are attempting to dock does not seem to be a"
302
              " normal window."), QMessageBox::Abort,
302
              " normal window."), TQMessageBox::Abort,
303
          QMessageBox::Ignore) == QMessageBox::Abort)
303
          TQMessageBox::Ignore) == TQMessageBox::Abort)
304
      return NULL;
304
      return NULL;
305
  }
305
  }
306
306
Lines 308-314 Link Here
308
308
309
  TRACE("0x%x is not docked", (unsigned) w);
309
  TRACE("0x%x is not docked", (unsigned) w);
310
310
311
  QMessageBox::message(tr("KDocker"),
311
  TQMessageBox::message(tr("KDocker"),
312
    tr("This window is already docked.\n"
312
    tr("This window is already docked.\n"
313
       "Click on system tray icon to toggle docking."));
313
       "Click on system tray icon to toggle docking."));
314
  return NULL;
314
  return NULL;
Lines 316-322 Link Here
316
316
317
bool TrayLabelMgr::isWindowDocked(Window w)
317
bool TrayLabelMgr::isWindowDocked(Window w)
318
{
318
{
319
  QPtrListIterator<QTrayLabel> it(mTrayLabels);
319
  TQPtrListIterator<QTrayLabel> it(mTrayLabels);
320
  for(QTrayLabel *t; (t = it.current()); ++it)
320
  for(QTrayLabel *t; (t = it.current()); ++it)
321
    if (t->dockedWindow() == w) return true;
321
    if (t->dockedWindow() == w) return true;
322
 
322
 
Lines 350-356 Link Here
350
350
351
    if (execvp(argv[0], argv) == -1)
351
    if (execvp(argv[0], argv) == -1)
352
    {
352
    {
353
      qDebug(tr("Failed to exec [%1]: %2").arg(argv[0]).arg(strerror(errno)));
353
      tqDebug(tr("Failed to exec [%1]: %2").arg(argv[0]).arg(strerror(errno)));
354
      ::exit(0);                // will become a zombie in some systems :(
354
      ::exit(0);                // will become a zombie in some systems :(
355
      return NULL;
355
      return NULL;
356
    }
356
    }
Lines 358-374 Link Here
358
358
359
  if (pid == -1)
359
  if (pid == -1)
360
  {
360
  {
361
    QMessageBox::critical(NULL, "KDocker", 
361
    TQMessageBox::critical(NULL, "KDocker", 
362
                          tr("Failed to fork: %1").arg(strerror(errno)));
362
                          tr("Failed to fork: %1").arg(strerror(errno)));
363
    return NULL;
363
    return NULL;
364
  }
364
  }
365
365
366
  QStringList cmd_line;
366
  TQStringList cmd_line;
367
  for(int i=0;;i++)
367
  for(int i=0;;i++)
368
    if (argv[i]) cmd_line << argv[i]; else break;
368
    if (argv[i]) cmd_line << argv[i]; else break;
369
369
370
  QTrayLabel *label = new CustomTrayLabel(cmd_line, pid);
370
  QTrayLabel *label = new CustomTrayLabel(cmd_line, pid);
371
  qApp->syncX();
371
  tqApp->syncX();
372
  write(filedes[1], buf, sizeof(buf));
372
  write(filedes[1], buf, sizeof(buf));
373
  close(filedes[0]);
373
  close(filedes[0]);
374
  close(filedes[1]);
374
  close(filedes[1]);
Lines 381-387 Link Here
381
 */
381
 */
382
int TrayLabelMgr::hiddenLabelsCount(void) const
382
int TrayLabelMgr::hiddenLabelsCount(void) const
383
{
383
{
384
  QPtrListIterator<QTrayLabel> it(mTrayLabels);
384
  TQPtrListIterator<QTrayLabel> it(mTrayLabels);
385
  int count = 0;
385
  int count = 0;
386
  for(QTrayLabel *t; (t=it.current()); ++it)
386
  for(QTrayLabel *t; (t=it.current()); ++it)
387
    if (t->dockedWindow() == None) ++count;
387
    if (t->dockedWindow() == None) ++count;
Lines 394-404 Link Here
394
  return mTrayLabels.count() - hiddenLabelsCount();
394
  return mTrayLabels.count() - hiddenLabelsCount();
395
}
395
}
396
396
397
void TrayLabelMgr::trayLabelDestroyed(QObject *t)
397
void TrayLabelMgr::trayLabelDestroyed(TQObject *t)
398
{
398
{
399
  bool reconnect  = ((QObject *)mTrayLabels.getLast() == t);
399
  bool reconnect  = ((TQObject *)mTrayLabels.getLast() == t);
400
  mTrayLabels.removeRef((QTrayLabel*)t);
400
  mTrayLabels.removeRef((QTrayLabel*)t);
401
  if (mTrayLabels.isEmpty()) qApp->quit();
401
  if (mTrayLabels.isEmpty()) tqApp->quit();
402
  else if (reconnect) 
402
  else if (reconnect) 
403
  {
403
  {
404
    TRACE("Reconnecting");
404
    TRACE("Reconnecting");
Lines 415-431 Link Here
415
   * to not pop up a box when the user is logging out. So, we set ourselves
415
   * to not pop up a box when the user is logging out. So, we set ourselves
416
   * up to notify user after 3 seconds.
416
   * up to notify user after 3 seconds.
417
   */
417
   */
418
  QTimer::singleShot(3000, this, SLOT(notifySysTrayAbsence()));
418
  TQTimer::singleShot(3000, this, SLOT(notifySysTrayAbsence()));
419
}
419
}
420
420
421
void TrayLabelMgr::notifySysTrayAbsence()
421
void TrayLabelMgr::notifySysTrayAbsence()
422
{
422
{
423
  SysTrayState state = sysTrayStatus(QPaintDevice::x11AppDisplay());
423
  SysTrayState state = sysTrayStatus(TQPaintDevice::x11AppDisplay());
424
424
425
  if (state == SysTrayPresent) 
425
  if (state == SysTrayPresent) 
426
    return; // So sweet of the systray to come back so soon
426
    return; // So sweet of the systray to come back so soon
427
427
428
  if (QMessageBox::warning(NULL, tr("KDocker"), 
428
  if (TQMessageBox::warning(NULL, tr("KDocker"), 
429
                           tr("The System tray was hidden or removed"),
429
                           tr("The System tray was hidden or removed"),
430
                           tr("Undock All"), tr("Ignore")) == 0)
430
                           tr("Undock All"), tr("Ignore")) == 0)
431
    undockAll();
431
    undockAll();
Lines 434-461 Link Here
434
/*
434
/*
435
 * Session Management. Always return "true". Atleast, for now
435
 * Session Management. Always return "true". Atleast, for now
436
 */
436
 */
437
bool TrayLabelMgr::restoreSession(const QString& sessionId)
437
bool TrayLabelMgr::restoreSession(const TQString& sessionId)
438
{
438
{
439
  QString session_file = "kdocker_" + sessionId;
439
  TQString session_file = "kdocker_" + sessionId;
440
440
441
  QSettings settings;
441
  TQSettings settings;
442
  settings.beginGroup(QString("/" + session_file));
442
  settings.beginGroup(TQString("/" + session_file));
443
443
444
  for(int i = 1;; i++)
444
  for(int i = 1;; i++)
445
  {
445
  {
446
    settings.beginGroup(QString("/Instance") + QString("").setNum(i));
446
    settings.beginGroup(TQString("/Instance") + TQString("").setNum(i));
447
    QString pname = settings.readEntry("/Application");
447
    TQString pname = settings.readEntry("/Application");
448
    TRACE("Restoring Application[%s]", pname.latin1());
448
    TRACE("Restoring Application[%s]", pname.latin1());
449
    if (pname.isEmpty()) break;
449
    if (pname.isEmpty()) break;
450
    if (settings.readBoolEntry("/LaunchOnStartup"))
450
    if (settings.readBoolEntry("/LaunchOnStartup"))
451
    {
451
    {
452
      QStringList args("kdocker");
452
      TQStringList args("kdocker");
453
      args += QStringList::split(" ", pname);
453
      args += TQStringList::split(" ", pname);
454
      TRACE("Triggering AutoLaunch");
454
      TRACE("Triggering AutoLaunch");
455
      if (!processCommand(args)) continue;
455
      if (!processCommand(args)) continue;
456
    }
456
    }
457
    else 
457
    else 
458
      manageTrayLabel(new CustomTrayLabel(QStringList::split(" ", pname), 0));
458
      manageTrayLabel(new CustomTrayLabel(TQStringList::split(" ", pname), 0));
459
459
460
    QTrayLabel *tl = mTrayLabels.getFirst(); // the one that was created above
460
    QTrayLabel *tl = mTrayLabels.getFirst(); // the one that was created above
461
    tl->restoreState(settings);
461
    tl->restoreState(settings);
Lines 465-496 Link Here
465
  return true;
465
  return true;
466
}
466
}
467
467
468
QString TrayLabelMgr::saveSession(void)
468
TQString TrayLabelMgr::saveSession(void)
469
{
469
{
470
  QString session_file = "kdocker_" + qApp->sessionId();
470
  TQString session_file = "kdocker_" + tqApp->sessionId();
471
471
472
  QSettings settings;
472
  TQSettings settings;
473
  settings.beginGroup(QString("/" + session_file));
473
  settings.beginGroup(TQString("/" + session_file));
474
474
475
  TRACE("Saving session");
475
  TRACE("Saving session");
476
476
477
  QPtrListIterator <QTrayLabel> it(mTrayLabels);
477
  TQPtrListIterator <QTrayLabel> it(mTrayLabels);
478
  QTrayLabel *t;
478
  QTrayLabel *t;
479
  int i = 1;
479
  int i = 1;
480
  while ((t = it.current()) != 0)
480
  while ((t = it.current()) != 0)
481
  {
481
  {
482
    ++it;
482
    ++it;
483
    TRACE("Saving instance %i", i);
483
    TRACE("Saving instance %i", i);
484
    settings.beginGroup(QString("/Instance") + QString("").setNum(i));
484
    settings.beginGroup(TQString("/Instance") + TQString("").setNum(i));
485
    bool ok = t->saveState(settings);
485
    bool ok = t->saveState(settings);
486
    settings.endGroup();
486
    settings.endGroup();
487
    if (ok) ++i; else TRACE("Saving of instance %i was skipped", i);
487
    if (ok) ++i; else TRACE("Saving of instance %i was skipped", i);
488
  }
488
  }
489
489
490
  // Aaaaaaaaaaaaaa.........
490
  // Aaaaaaaaaaaaaa.........
491
  settings.removeEntry(QString("/Instance") + QString("").setNum(i));
491
  settings.removeEntry(TQString("/Instance") + TQString("").setNum(i));
492
492
493
  return QDir::homeDirPath() + "/.qt/" + session_file + "rc";
493
  return TQDir::homeDirPath() + "/.qt/" + session_file + "rc";
494
}
494
}
495
495
496
/*
496
/*
Lines 505-511 Link Here
505
 */
505
 */
506
bool TrayLabelMgr::x11EventFilter(XEvent *ev)
506
bool TrayLabelMgr::x11EventFilter(XEvent *ev)
507
{
507
{
508
  QPtrListIterator<QTrayLabel> it(mTrayLabels);
508
  TQPtrListIterator<QTrayLabel> it(mTrayLabels);
509
  bool ret = false;
509
  bool ret = false;
510
  
510
  
511
  // We pass on the event to all tray labels
511
  // We pass on the event to all tray labels
(-)./src/traylabelmgr.h (-13 / +13 lines)
Lines 21-49 Link Here
21
#ifndef _TRAYLABELMGR_H
21
#ifndef _TRAYLABELMGR_H
22
#define _TRAYLABELMGR_H
22
#define _TRAYLABELMGR_H
23
23
24
#include <qobject.h>
24
#include <tqt3/ntqobject.h>
25
#include <qptrlist.h>
25
#include <tqt3/ntqptrlist.h>
26
#include <qvaluelist.h>
26
#include <tqt3/ntqvaluelist.h>
27
#include <qstringlist.h>
27
#include <tqt3/ntqstringlist.h>
28
28
29
#include "customtraylabel.h"
29
#include "customtraylabel.h"
30
30
31
class CustomTrayLabel;
31
class CustomTrayLabel;
32
32
33
class TrayLabelMgr : public QObject
33
class TrayLabelMgr : public TQObject
34
{
34
{
35
  Q_OBJECT
35
  TQ_OBJECT
36
36
37
public:
37
public:
38
  static TrayLabelMgr* instance();
38
  static TrayLabelMgr* instance();
39
  static QString options(void) { return QString(mOptionString); }
39
  static TQString options(void) { return TQString(mOptionString); }
40
40
41
  ~TrayLabelMgr();
41
  ~TrayLabelMgr();
42
42
43
  QString saveSession();
43
  TQString saveSession();
44
44
45
  bool x11EventFilter(XEvent *);
45
  bool x11EventFilter(XEvent *);
46
  bool processCommand(const QStringList& argv);
46
  bool processCommand(const TQStringList& argv);
47
  int  hiddenLabelsCount(void) const;
47
  int  hiddenLabelsCount(void) const;
48
  int  dockedLabelsCount(void) const;
48
  int  dockedLabelsCount(void) const;
49
  bool isWindowDocked(Window w);
49
  bool isWindowDocked(Window w);
Lines 55-61 Link Here
55
55
56
private slots:
56
private slots:
57
  void startup();
57
  void startup();
58
  void trayLabelDestroyed(QObject *);
58
  void trayLabelDestroyed(TQObject *);
59
  void sysTrayDestroyed(void);
59
  void sysTrayDestroyed(void);
60
  void notifySysTrayAbsence();
60
  void notifySysTrayAbsence();
61
61
Lines 63-75 Link Here
63
  TrayLabelMgr();
63
  TrayLabelMgr();
64
  bool processCommand(int argc, char** argv);
64
  bool processCommand(int argc, char** argv);
65
  void manageTrayLabel(QTrayLabel *l);
65
  void manageTrayLabel(QTrayLabel *l);
66
  bool restoreSession(const QString& sessionId);
66
  bool restoreSession(const TQString& sessionId);
67
  
67
  
68
  QTrayLabel *dockApplication(char *argv[]);
68
  QTrayLabel *dockApplication(char *argv[]);
69
  QTrayLabel *selectAndDock(Window w = None, bool checkNormality = true);
69
  QTrayLabel *selectAndDock(Window w = None, bool checkNormality = true);
70
70
71
  QPtrList<QTrayLabel> mTrayLabels;
71
  TQPtrList<QTrayLabel> mTrayLabels;
72
  QValueList<QStringList> mRequestQ;
72
  TQValueList<TQStringList> mRequestQ;
73
  bool mReady;
73
  bool mReady;
74
  int mHiddenLabelsCount;
74
  int mHiddenLabelsCount;
75
  
75
  
(-)./src/util.cpp (-4 / +4 lines)
Lines 158-164 Link Here
158
 * The Grand Window Analyzer. Checks if window w has a expected pid of epid
158
 * The Grand Window Analyzer. Checks if window w has a expected pid of epid
159
 * or a expected name of ename
159
 * or a expected name of ename
160
 */
160
 */
161
bool analyzeWindow(Display *display, Window w, pid_t epid, const QString &ename)
161
bool analyzeWindow(Display *display, Window w, pid_t epid, const TQString &ename)
162
{
162
{
163
  XClassHint ch;
163
  XClassHint ch;
164
  pid_t apid = pid(display, w);
164
  pid_t apid = pid(display, w);
Lines 177-188 Link Here
177
  // lets try the program name
177
  // lets try the program name
178
  if (XGetClassHint(display, w, &ch))
178
  if (XGetClassHint(display, w, &ch))
179
  {
179
  {
180
    if (QString(ch.res_name).find(ename, 0, FALSE) != -1)
180
    if (TQString(ch.res_name).find(ename, 0, FALSE) != -1)
181
    {
181
    {
182
      TRACE("ResName [%s] matched", ch.res_name);
182
      TRACE("ResName [%s] matched", ch.res_name);
183
      this_is_our_man = true;
183
      this_is_our_man = true;
184
    }
184
    }
185
    else if (QString(ch.res_class).find(ename, 0, FALSE) != -1)
185
    else if (TQString(ch.res_class).find(ename, 0, FALSE) != -1)
186
    {
186
    {
187
      TRACE("ResClass [%s] matched", ch.res_class);
187
      TRACE("ResClass [%s] matched", ch.res_class);
188
      this_is_our_man = true;
188
      this_is_our_man = true;
Lines 192-198 Link Here
192
      // sheer desperation
192
      // sheer desperation
193
      char *wm_name = NULL;
193
      char *wm_name = NULL;
194
      XFetchName(display, w, &wm_name);
194
      XFetchName(display, w, &wm_name);
195
      if (wm_name && (QString(wm_name).find(ename, 0, FALSE) != -1))
195
      if (wm_name && (TQString(wm_name).find(ename, 0, FALSE) != -1))
196
      {
196
      {
197
        TRACE("WM_NAME [%s] matched", wm_name);
197
        TRACE("WM_NAME [%s] matched", wm_name);
198
        this_is_our_man = true;
198
        this_is_our_man = true;
(-)./src/util.h (-2 / +2 lines)
Lines 22-28 Link Here
22
#ifndef _UTIL_H
22
#ifndef _UTIL_H
23
#define _UTIL_H
23
#define _UTIL_H
24
24
25
#include <qstring.h>
25
#include <tqt3/ntqstring.h>
26
#include <X11/Xlib.h>
26
#include <X11/Xlib.h>
27
#include <sys/types.h>
27
#include <sys/types.h>
28
28
Lines 32-38 Link Here
32
extern void sendMessage(Display *display, Window to, Window w, char *type, 
32
extern void sendMessage(Display *display, Window to, Window w, char *type, 
33
                       int format, long mask, void *data, int size);
33
                       int format, long mask, void *data, int size);
34
extern bool analyzeWindow(Display *display, Window w, pid_t epid, 
34
extern bool analyzeWindow(Display *display, Window w, pid_t epid, 
35
                          const QString &ename);
35
                          const TQString &ename);
36
extern Window activeWindow(Display *display);
36
extern Window activeWindow(Display *display);
37
extern Window selectWindow(Display *display, const char **err = 0);
37
extern Window selectWindow(Display *display, const char **err = 0);
38
extern void subscribe(Display *display, Window w, long mask, bool set);
38
extern void subscribe(Display *display, Window w, long mask, bool set);

Return to bug 500