summaryrefslogtreecommitdiffstats
path: root/superkaramba/src/karamba.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'superkaramba/src/karamba.cpp')
-rw-r--r--superkaramba/src/karamba.cpp119
1 files changed, 59 insertions, 60 deletions
diff --git a/superkaramba/src/karamba.cpp b/superkaramba/src/karamba.cpp
index 19b30b5..d4a74f7 100644
--- a/superkaramba/src/karamba.cpp
+++ b/superkaramba/src/karamba.cpp
@@ -77,7 +77,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
if(!m_theme.set(url))
{
setFixedSize(0, 0);
- TQTimer::singleShot(100, this, TQT_SLOT(killWidget()));
+ TQTimer::singleShot(100, this, TQ_SLOT(killWidget()));
return;
}
// Add self to list of open themes
@@ -93,8 +93,8 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
setName(qName.ascii());
KDirWatch *dirWatch = KDirWatch::self();
- connect(dirWatch, TQT_SIGNAL( dirty( const TQString & ) ),
- TQT_SLOT( slotFileChanged( const TQString & ) ) );
+ connect(dirWatch, TQ_SIGNAL( dirty( const TQString & ) ),
+ TQ_SLOT( slotFileChanged( const TQString & ) ) );
if(!dirWatch->contains(m_theme.file()))
dirWatch->addFile(m_theme.file());
@@ -132,7 +132,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
if(m_theme.pythonModuleExists())
{
kdDebug() << "Loading python module: " << m_theme.pythonModule() << endl;
- TQTimer::singleShot(0, this, TQT_SLOT(initPythonInterface()));
+ TQTimer::singleShot(0, this, TQ_SLOT(initPythonInterface()));
}
widgetMask = 0;
@@ -142,22 +142,22 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
kWinModule = new KWinModule();
desktop = 0;
- connect( kWinModule,TQT_SIGNAL(currentDesktopChanged(int)), this,
- TQT_SLOT(currentDesktopChanged(int)) );
- connect( kapp, TQT_SIGNAL(backgroundChanged(int)), this,
- TQT_SLOT(currentWallpaperChanged(int)));
+ connect( kWinModule,TQ_SIGNAL(currentDesktopChanged(int)), this,
+ TQ_SLOT(currentDesktopChanged(int)) );
+ connect( kapp, TQ_SIGNAL(backgroundChanged(int)), this,
+ TQ_SLOT(currentWallpaperChanged(int)));
// Setup of the Task Manager Callbacks
- connect(&taskManager, TQT_SIGNAL(activeTaskChanged(Task*)), this,
- TQT_SLOT(activeTaskChanged(Task*)) );
- connect(&taskManager, TQT_SIGNAL(taskAdded(Task*)), this,
- TQT_SLOT(taskAdded(Task*)) );
- connect(&taskManager, TQT_SIGNAL(taskRemoved(Task*)), this,
- TQT_SLOT(taskRemoved(Task*)) );
- connect(&taskManager, TQT_SIGNAL(startupAdded(Startup*)), this,
- TQT_SLOT(startupAdded(Startup*)) );
- connect(&taskManager, TQT_SIGNAL(startupRemoved(Startup*)), this,
- TQT_SLOT(startupRemoved(Startup*)) );
+ connect(&taskManager, TQ_SIGNAL(activeTaskChanged(Task*)), this,
+ TQ_SLOT(activeTaskChanged(Task*)) );
+ connect(&taskManager, TQ_SIGNAL(taskAdded(Task*)), this,
+ TQ_SLOT(taskAdded(Task*)) );
+ connect(&taskManager, TQ_SIGNAL(taskRemoved(Task*)), this,
+ TQ_SLOT(taskRemoved(Task*)) );
+ connect(&taskManager, TQ_SIGNAL(startupAdded(Startup*)), this,
+ TQ_SLOT(startupAdded(Startup*)) );
+ connect(&taskManager, TQ_SIGNAL(startupRemoved(Startup*)), this,
+ TQ_SLOT(startupRemoved(Startup*)) );
themeConfMenu = new TDEPopupMenu( this);
themeConfMenu -> setCheckable(true);
@@ -170,8 +170,8 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
toDesktopMenu = new TDEPopupMenu (this);
toDesktopMenu -> setCheckable(true);
mid = toDesktopMenu -> insertItem (i18n("&All Desktops"),
- dslot = new DesktopChangeSlot(TQT_TQOBJECT(this),0),
- TQT_SLOT(receive()));
+ dslot = new DesktopChangeSlot(this,0),
+ TQ_SLOT(receive()));
dslot->setMenuId(mid);
toDesktopMenu -> insertSeparator();
@@ -181,7 +181,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
name += ('0' + ndesktop);
mid = toDesktopMenu -> insertItem (name,
- dslot = new DesktopChangeSlot(TQT_TQOBJECT(this), ndesktop), TQT_SLOT(receive()));
+ dslot = new DesktopChangeSlot(this, ndesktop), TQ_SLOT(receive()));
dslot->setMenuId(mid);
}
@@ -193,11 +193,11 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
menuAccColl = new TDEActionCollection( this );
kpop->insertItem( SmallIconSet("reload"),i18n("Update"), this,
- TQT_SLOT(updateSensors()), Key_F5 );
+ TQ_SLOT(updateSensors()), Key_F5 );
toggleLocked = new TDEToggleAction ( i18n("Toggle &Locked Position"),
SmallIconSet("locked"),
- CTRL+Key_L, TQT_TQOBJECT(this),
- TQT_SLOT( slotToggleLocked() ),
+ CTRL+Key_L, this,
+ TQ_SLOT( slotToggleLocked() ),
accColl, "Locked position" );
accColl->insert(toggleLocked);
toggleLocked -> setChecked(true);
@@ -205,8 +205,8 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
toggleLocked->plug(kpop);
toggleFastTransforms = new TDEToggleAction(i18n("Use &Fast Image Scaling"),
- CTRL+Key_F, TQT_TQOBJECT(this),
- TQT_SLOT( slotToggleFastTransforms() ),
+ CTRL+Key_F, this,
+ TQ_SLOT( slotToggleFastTransforms() ),
accColl, "Fast transformations");
accColl->insert(toggleFastTransforms);
@@ -221,9 +221,9 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
kpop->insertItem(i18n("To Des&ktop"), toDesktopMenu);
kpop->insertItem( SmallIconSet("reload3"),i18n("&Reload Theme"),this,
- TQT_SLOT(reloadConfig()), CTRL+Key_R );
+ TQ_SLOT(reloadConfig()), CTRL+Key_R );
kpop->insertItem( SmallIconSet("window-close"),i18n("&Close This Theme"), this,
- TQT_SLOT(killWidget()), CTRL+Key_C );
+ TQ_SLOT(killWidget()), CTRL+Key_C );
if(!SuperKarambaSettings::showSysTray())
showMenuExtension();
@@ -262,7 +262,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
if( !parseConfig() )
{
setFixedSize(0,0);
- TQTimer::singleShot( 100, this, TQT_SLOT(killWidget()) );
+ TQTimer::singleShot( 100, this, TQ_SLOT(killWidget()) );
tqWarning("Could not read config file.");
}
else
@@ -310,11 +310,11 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance,
move(xpos, ypos);
}
- haveUpdated = 0;
+ haveUpdated = false;
this->setMouseTracking(true);
- setFocusPolicy(TQ_StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
}
karamba::~karamba()
@@ -605,7 +605,7 @@ bool karamba::parseConfig()
if (!tiptext.isEmpty())
tmp->setTooltip(tiptext);
- connect(tmp, TQT_SIGNAL(pixmapLoaded()), this, TQT_SLOT(externalStep()));
+ connect(tmp, TQ_SIGNAL(pixmapLoaded()), this, TQ_SLOT(externalStep()));
setSensor(lineParser, (Meter*) tmp );
meterList->append (tmp );
imageList->append (tmp );
@@ -790,12 +790,12 @@ void karamba::start()
{
m_sysTimer = new TQTimer(this);
- connect(m_sysTimer, TQT_SIGNAL(timeout()), TQT_SLOT(step()));
+ connect(m_sysTimer, TQ_SIGNAL(timeout()), TQ_SLOT(step()));
m_sysTimer->start(m_interval);
//Start the widget running
- TQTimer::singleShot( 0, this, TQT_SLOT(step()) );
+ TQTimer::singleShot( 0, this, TQ_SLOT(step()) );
if( !(onTop || managed) )
lowerTimer.start();
@@ -1015,7 +1015,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter)
int interval = lineParser.getInt("INTERVAL");
interval = (interval == 0)?5000:interval;
sensor = ( sensorMap["DISK"] = new DiskSensor( interval ) );
- connect( sensor, TQT_SIGNAL(initComplete()), this, TQT_SLOT(externalStep()) );
+ connect( sensor, TQ_SIGNAL(initComplete()), this, TQ_SLOT(externalStep()) );
sensorList->append( sensor );
}
// meter->setMax( ((DiskSensor*)sensor)->getTotalSpace(mntPt)/1024 );
@@ -1216,7 +1216,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter)
if (sensor != 0)
{
- TQTimer::singleShot( 0, sensor, TQT_SLOT(update()) );
+ TQTimer::singleShot( 0, sensor, TQ_SLOT(update()) );
sensor->start();
}
}
@@ -1294,11 +1294,11 @@ void karamba::meterClicked(TQMouseEvent* e, Meter* meter)
{
int button = 0;
- if( e->button() == Qt::LeftButton )
+ if( e->button() == TQt::LeftButton )
button = 1;
- else if( e->button() == Qt::MidButton )
+ else if( e->button() == TQt::MidButton )
button = 2;
- else if( e->button() == Qt::RightButton )
+ else if( e->button() == TQt::RightButton )
button = 3;
if (RichTextLabel* richText = dynamic_cast<RichTextLabel*>(meter))
@@ -1351,11 +1351,11 @@ void karamba::passClick(TQMouseEvent *e)
{
int button = 0;
- if( e->button() == Qt::LeftButton )
+ if( e->button() == TQt::LeftButton )
button = 1;
- else if( e->button() == Qt::MidButton )
+ else if( e->button() == TQt::MidButton )
button = 2;
- else if( e->button() == Qt::RightButton )
+ else if( e->button() == TQt::RightButton )
button = 3;
pythonIface->widgetClicked(this, e->x(), e->y(), button);
@@ -1416,7 +1416,7 @@ void karamba::management_popup( void )
void karamba::mousePressEvent( TQMouseEvent *e )
{
//tqDebug("karamba::mousePressEvent");
- if( e->button() == Qt::RightButton && !want_right_button )
+ if( e->button() == TQt::RightButton && !want_right_button )
{
management_popup();
}
@@ -1512,14 +1512,14 @@ void karamba::mouseMoveEvent( TQMouseEvent *e )
//Modified by Ryan Nickell (p0z3r@mail.com) 03/16/2004
// This will work now, but only when you move at least
// one pixel in any direction with your mouse.
- //if( e->button() == Qt::LeftButton )
- if( e->state() == Qt::LeftButton)
+ //if( e->button() == TQt::LeftButton )
+ if( e->state() == TQt::LeftButton)
button = 1;
- //else if( e->button() == Qt::MidButton )
- else if( e->state() == Qt::MidButton )
+ //else if( e->button() == TQt::MidButton )
+ else if( e->state() == TQt::MidButton )
button = 2;
- //else if( e->button() == Qt::RightButton )
- else if( e->state() == Qt::RightButton )
+ //else if( e->button() == TQt::RightButton )
+ else if( e->state() == TQt::RightButton )
button = 3;
pythonIface->widgetMouseMoved(this, e->x(), e->y(), button);
@@ -1560,7 +1560,7 @@ void karamba::updateSensors()
((Sensor*) *it)->update();
++it;
}
- TQTimer::singleShot( 500, this, TQT_SLOT(step()) );
+ TQTimer::singleShot( 500, this, TQ_SLOT(step()) );
}
void karamba::updateBackground(TDESharedPixmap* kpm)
@@ -1691,14 +1691,13 @@ void karamba::step()
if (pythonIface && pythonIface->isExtensionLoaded())
{
- if (haveUpdated == 0)
+ if (!haveUpdated)
pythonIface->initWidget(this);
else
pythonIface->widgetUpdated(this);
}
- if (haveUpdated == 0)
- haveUpdated = 1;
+ haveUpdated = true;
}
void karamba::widgetClosed()
@@ -1779,16 +1778,16 @@ void karamba::addMenuConfigOption(TQString key, TQString name)
//tqDebug("karamba::addMenuConfigOption");
kpop -> setItemEnabled(THEMECONF, true);
- SignalBridge* action = new SignalBridge(TQT_TQOBJECT(this), key, menuAccColl);
+ SignalBridge* action = new SignalBridge(this, key, menuAccColl);
TDEToggleAction* confItem = new TDEToggleAction (name, TDEShortcut::null(),
- action, TQT_SLOT(receive()),
+ action, TQ_SLOT(receive()),
menuAccColl, key.ascii());
confItem -> setName(key.ascii());
menuAccColl -> insert(confItem);
- connect(action, TQT_SIGNAL( enabled(TQString, bool) ),
- this, TQT_SLOT( slotToggleConfigOption(TQString, bool) ));
+ connect(action, TQ_SIGNAL( enabled(TQString, bool) ),
+ this, TQ_SLOT( slotToggleConfigOption(TQString, bool) ));
config -> setGroup("config menu");
confItem -> setChecked(config -> readBoolEntry(key));
@@ -2035,16 +2034,16 @@ void karamba::showMenuExtension()
trayMenuToggleId = kglobal->insertItem(SmallIconSet("superkaramba"),
i18n("Show System Tray Icon"), this,
- TQT_SLOT(slotToggleSystemTray()),
+ TQ_SLOT(slotToggleSystemTray()),
CTRL+Key_S);
trayMenuThemeId = kglobal->insertItem(SmallIconSet("knewstuff"),
i18n("&Manage Themes..."), this,
- TQT_SLOT(slotShowTheme()), CTRL+Key_M);
+ TQ_SLOT(slotShowTheme()), CTRL+Key_M);
trayMenuQuitId = kglobal->insertItem(SmallIconSet("system-log-out"),
i18n("&Quit SuperKaramba"), this,
- TQT_SLOT(slotQuit()), CTRL+Key_Q);
+ TQ_SLOT(slotQuit()), CTRL+Key_Q);
kglobal->polish();