summaryrefslogtreecommitdiffstats
path: root/kdeui/kmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdeui/kmainwindow.cpp')
-rw-r--r--kdeui/kmainwindow.cpp312
1 files changed, 156 insertions, 156 deletions
diff --git a/kdeui/kmainwindow.cpp b/kdeui/kmainwindow.cpp
index 119ff4a7e..94baa34e7 100644
--- a/kdeui/kmainwindow.cpp
+++ b/kdeui/kmainwindow.cpp
@@ -27,12 +27,12 @@
#include "kmainwindowiface.h"
#include "ktoolbarhandler.h"
#include "kwhatsthismanager_p.h"
-#include <qsessionmanager.h>
-#include <qobjectlist.h>
-#include <qstyle.h>
-#include <qlayout.h>
-#include <qwidgetlist.h>
-#include <qtimer.h>
+#include <tqsessionmanager.h>
+#include <tqobjectlist.h>
+#include <tqstyle.h>
+#include <tqlayout.h>
+#include <tqwidgetlist.h>
+#include <tqtimer.h>
#include <kaccel.h>
#include <kaction.h>
@@ -66,17 +66,17 @@ public:
bool autoSaveWindowSize:1;
bool care_about_geometry:1;
bool shuttingDown:1;
- QString autoSaveGroup;
+ TQString autoSaveGroup;
KAccel * kaccel;
KMainWindowInterface *m_interface;
KDEPrivate::ToolBarHandler *toolBarHandler;
- QTimer* settingsTimer;
+ TQTimer* settingsTimer;
KToggleAction *showStatusBarAction;
- QRect defaultWindowSize;
- QPtrList<QDockWindow> hiddenDockWindows;
+ TQRect defaultWindowSize;
+ TQPtrList<TQDockWindow> hiddenDockWindows;
};
-QPtrList<KMainWindow>* KMainWindow::memberList = 0L;
+TQPtrList<KMainWindow>* KMainWindow::memberList = 0L;
static bool no_query_exit = false;
static KMWSessionManaged* ksm = 0;
static KStaticDeleter<KMWSessionManaged> ksmd;
@@ -99,14 +99,14 @@ public:
KMainWindow::memberList->first()->saveGlobalProperties(config);
}
- QPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
+ TQPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
int n = 0;
for (it.toFirst(); it.current(); ++it){
n++;
it.current()->savePropertiesInternal(config, n);
}
- config->setGroup(QString::fromLatin1("Number"));
- config->writeEntry(QString::fromLatin1("NumberOfWindows"), n );
+ config->setGroup(TQString::fromLatin1("Number"));
+ config->writeEntry(TQString::fromLatin1("NumberOfWindows"), n );
return true;
}
@@ -115,14 +115,14 @@ public:
// not really a fast method but the only compatible one
if ( sm.allowsInteraction() ) {
bool canceled = false;
- QPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
+ TQPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
::no_query_exit = true;
for (it.toFirst(); it.current() && !canceled;){
KMainWindow *window = *it;
++it; // Update now, the current window might get deleted
if ( !window->testWState( Qt::WState_ForceHide ) ) {
- QCloseEvent e;
- QApplication::sendEvent( window, &e );
+ TQCloseEvent e;
+ TQApplication::sendEvent( window, &e );
canceled = !e.isAccepted();
/* Don't even think_about deleting widgets with
Qt::WDestructiveClose flag set at this point. We
@@ -133,7 +133,7 @@ public:
(possibly showing a message box "do you want to
save this or that?"). It is possible that the
session manager quits the application later
- (emitting QApplication::aboutToQuit() when this
+ (emitting TQApplication::aboutToQuit() when this
happens), but it is also possible that the user
cancels the shutdown, so the application will
continue to run.
@@ -164,14 +164,14 @@ public:
static bool being_first = true;
-KMainWindow::KMainWindow( QWidget* parent, const char *name, WFlags f )
- : QMainWindow( parent, name, f ), KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
+KMainWindow::KMainWindow( TQWidget* parent, const char *name, WFlags f )
+ : TQMainWindow( parent, name, f ), KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
{
initKMainWindow(name, 0);
}
-KMainWindow::KMainWindow( int cflags, QWidget* parent, const char *name, WFlags f )
- : QMainWindow( parent, name, f ), KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
+KMainWindow::KMainWindow( int cflags, TQWidget* parent, const char *name, WFlags f )
+ : TQMainWindow( parent, name, f ), KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )
{
initKMainWindow(name, cflags);
}
@@ -183,15 +183,15 @@ void KMainWindow::initKMainWindow(const char *name, int cflags)
mHelpMenu = 0;
kapp->setTopWidget( this );
actionCollection()->setWidget( this );
- connect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown()));
+ connect(kapp, TQT_SIGNAL(shutDown()), this, TQT_SLOT(shuttingDown()));
if( !memberList )
- memberList = new QPtrList<KMainWindow>;
+ memberList = new TQPtrList<KMainWindow>;
if ( !ksm )
ksm = ksmd.setObject(ksm, new KMWSessionManaged());
// set a unique object name. Required by session management.
- QCString objname;
- QCString s;
+ TQCString objname;
+ TQCString s;
int unusedNumber;
if ( !name )
{ // no name given
@@ -212,10 +212,10 @@ void KMainWindow::initKMainWindow(const char *name, int cflags)
unusedNumber = 0; // add numbers only when needed
}
for(;;) {
- QWidgetList* list = kapp->topLevelWidgets();
- QWidgetListIt it( *list );
+ TQWidgetList* list = kapp->topLevelWidgets();
+ TQWidgetListIt it( *list );
bool found = false;
- for( QWidget* w = it.current();
+ for( TQWidget* w = it.current();
w != NULL;
++it, w = it.current())
if( w != this && w->name() == s )
@@ -286,8 +286,8 @@ void KMainWindow::parseGeometry(bool parsewidth)
int w, h;
int m = XParseGeometry( kapp->geometryArgument().latin1(), &x, &y, (unsigned int*)&w, (unsigned int*)&h);
if (parsewidth) {
- QSize minSize = minimumSize();
- QSize maxSize = maximumSize();
+ TQSize minSize = minimumSize();
+ TQSize maxSize = maximumSize();
if ( !(m & WidthValue) )
w = width();
if ( !(m & HeightValue) )
@@ -314,14 +314,14 @@ void KMainWindow::parseGeometry(bool parsewidth)
KMainWindow::~KMainWindow()
{
delete d->settingsTimer;
- QMenuBar* mb = internalMenuBar();
+ TQMenuBar* mb = internalMenuBar();
delete mb;
delete d->m_interface;
delete d;
memberList->remove( this );
}
-KPopupMenu* KMainWindow::helpMenu( const QString &aboutAppText, bool showWhatsThis )
+KPopupMenu* KMainWindow::helpMenu( const TQString &aboutAppText, bool showWhatsThis )
{
if( !mHelpMenu ) {
if ( aboutAppText.isEmpty() )
@@ -331,8 +331,8 @@ KPopupMenu* KMainWindow::helpMenu( const QString &aboutAppText, bool showWhatsTh
if ( !mHelpMenu )
return 0;
- connect( mHelpMenu, SIGNAL( showAboutApplication() ),
- this, SLOT( showAboutApplication() ) );
+ connect( mHelpMenu, TQT_SIGNAL( showAboutApplication() ),
+ this, TQT_SLOT( showAboutApplication() ) );
}
return mHelpMenu->menu();
@@ -341,9 +341,9 @@ KPopupMenu* KMainWindow::helpMenu( const QString &aboutAppText, bool showWhatsTh
KPopupMenu* KMainWindow::customHelpMenu( bool showWhatsThis )
{
if( !mHelpMenu ) {
- mHelpMenu = new KHelpMenu( this, QString::null, showWhatsThis );
- connect( mHelpMenu, SIGNAL( showAboutApplication() ),
- this, SLOT( showAboutApplication() ) );
+ mHelpMenu = new KHelpMenu( this, TQString::null, showWhatsThis );
+ connect( mHelpMenu, TQT_SIGNAL( showAboutApplication() ),
+ this, TQT_SLOT( showAboutApplication() ) );
}
return mHelpMenu->menu();
@@ -356,33 +356,33 @@ bool KMainWindow::canBeRestored( int number )
KConfig *config = kapp->sessionConfig();
if ( !config )
return false;
- config->setGroup( QString::fromLatin1("Number") );
- int n = config->readNumEntry( QString::fromLatin1("NumberOfWindows") , 1 );
+ config->setGroup( TQString::fromLatin1("Number") );
+ int n = config->readNumEntry( TQString::fromLatin1("NumberOfWindows") , 1 );
return number >= 1 && number <= n;
}
-const QString KMainWindow::classNameOfToplevel( int number )
+const TQString KMainWindow::classNameOfToplevel( int number )
{
if ( !kapp->isRestored() )
- return QString::null;
+ return TQString::null;
KConfig *config = kapp->sessionConfig();
if ( !config )
- return QString::null;
- QString s;
+ return TQString::null;
+ TQString s;
s.setNum( number );
- s.prepend( QString::fromLatin1("WindowProperties") );
+ s.prepend( TQString::fromLatin1("WindowProperties") );
config->setGroup( s );
- if ( !config->hasKey( QString::fromLatin1("ClassName") ) )
- return QString::null;
+ if ( !config->hasKey( TQString::fromLatin1("ClassName") ) )
+ return TQString::null;
else
- return config->readEntry( QString::fromLatin1("ClassName") );
+ return config->readEntry( TQString::fromLatin1("ClassName") );
}
void KMainWindow::show()
{
- QMainWindow::show();
+ TQMainWindow::show();
- for ( QPtrListIterator<QDockWindow> it( d->hiddenDockWindows ); it.current(); ++it )
+ for ( TQPtrListIterator<TQDockWindow> it( d->hiddenDockWindows ); it.current(); ++it )
it.current()->show();
d->hiddenDockWindows.clear();
@@ -394,9 +394,9 @@ void KMainWindow::hide()
d->hiddenDockWindows.clear();
- QObjectList *list = queryList( "QDockWindow" );
- for( QObjectListIt it( *list ); it.current(); ++it ) {
- QDockWindow *dw = (QDockWindow*)it.current();
+ TQObjectList *list = queryList( "TQDockWindow" );
+ for( TQObjectListIt it( *list ); it.current(); ++it ) {
+ TQDockWindow *dw = (TQDockWindow*)it.current();
if ( dw->isTopLevel() && dw->isVisible() ) {
d->hiddenDockWindows.append( dw );
dw->hide();
@@ -405,7 +405,7 @@ void KMainWindow::hide()
delete list;
}
- QWidget::hide();
+ TQWidget::hide();
}
bool KMainWindow::restore( int number, bool show )
@@ -432,7 +432,7 @@ int KMainWindow::configureToolbars()
{
saveMainWindowSettings(KGlobal::config());
KEditToolbar dlg(actionCollection(), xmlFile(), true, this);
- connect(&dlg, SIGNAL(newToolbarConfig()), SLOT(saveNewToolbarConfig()));
+ connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_SLOT(saveNewToolbarConfig()));
return dlg.exec();
}
@@ -442,14 +442,14 @@ void KMainWindow::saveNewToolbarConfig()
applyMainWindowSettings( KGlobal::config() );
}
-void KMainWindow::setupGUI( int options, const QString & xmlfile ) {
- setupGUI(QSize(), options, xmlfile);
+void KMainWindow::setupGUI( int options, const TQString & xmlfile ) {
+ setupGUI(TQSize(), options, xmlfile);
}
-void KMainWindow::setupGUI( QSize defaultSize, int options, const QString & xmlfile ) {
+void KMainWindow::setupGUI( TQSize defaultSize, int options, const TQString & xmlfile ) {
if( options & Keys ){
KStdAction::keyBindings(guiFactory(),
- SLOT(configureShortcuts()), actionCollection());
+ TQT_SLOT(configureShortcuts()), actionCollection());
}
if( (options & StatusBar) && internalStatusBar() ){
@@ -459,7 +459,7 @@ void KMainWindow::setupGUI( QSize defaultSize, int options, const QString & xmlf
if( options & ToolBar ){
setStandardToolBarMenuEnabled( true );
KStdAction::configureToolbars(this,
- SLOT(configureToolbars() ), actionCollection());
+ TQT_SLOT(configureToolbars() ), actionCollection());
}
if( options & Create ){
@@ -488,7 +488,7 @@ void KMainWindow::setupGUI( QSize defaultSize, int options, const QString & xmlf
}
-void KMainWindow::createGUI( const QString &xmlfile, bool _conserveMemory )
+void KMainWindow::createGUI( const TQString &xmlfile, bool _conserveMemory )
{
// disabling the updates prevents unnecessary redraws
setUpdatesEnabled( false );
@@ -497,7 +497,7 @@ void KMainWindow::createGUI( const QString &xmlfile, bool _conserveMemory )
guiFactory()->removeClient( this );
// make sure to have an empty GUI
- QMenuBar* mb = internalMenuBar();
+ TQMenuBar* mb = internalMenuBar();
if ( mb )
mb->clear();
@@ -522,12 +522,12 @@ void KMainWindow::createGUI( const QString &xmlfile, bool _conserveMemory )
if ( !xmlfile.isNull() ) {
setXMLFile( xmlfile, true );
} else {
- QString auto_file(instance()->instanceName() + "ui.rc");
+ TQString auto_file(instance()->instanceName() + "ui.rc");
setXMLFile( auto_file, true );
}
// make sure we don't have any state saved already
- setXMLGUIBuildDocument( QDomDocument() );
+ setXMLGUIBuildDocument( TQDomDocument() );
// do the actual GUI building
guiFactory()->addClient( this );
@@ -548,12 +548,12 @@ void KMainWindow::createGUI( const QString &xmlfile, bool _conserveMemory )
// there's just one problem: I'm bad in finding names ;-) , so
// I skipped this ;-)
- QDomDocument doc = domDocument();
+ TQDomDocument doc = domDocument();
- for( QDomNode n = doc.documentElement().firstChild();
+ for( TQDomNode n = doc.documentElement().firstChild();
!n.isNull(); n = n.nextSibling())
{
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( e.tagName().lower() == "toolbar" )
factory_->resetContainer( e.attribute( "name" ) );
@@ -578,19 +578,19 @@ bool KMainWindow::isHelpMenuEnabled()
return d->showHelpMenu;
}
-void KMainWindow::setCaption( const QString &caption )
+void KMainWindow::setCaption( const TQString &caption )
{
setPlainCaption( kapp->makeStdCaption(caption) );
}
-void KMainWindow::setCaption( const QString &caption, bool modified )
+void KMainWindow::setCaption( const TQString &caption, bool modified )
{
setPlainCaption( kapp->makeStdCaption(caption, true, modified) );
}
-void KMainWindow::setPlainCaption( const QString &caption )
+void KMainWindow::setPlainCaption( const TQString &caption )
{
- QMainWindow::setCaption( caption );
+ TQMainWindow::setCaption( caption );
#if defined Q_WS_X11
NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 );
info.setName( caption.utf8().data() );
@@ -607,7 +607,7 @@ void KMainWindow::appHelpActivated( void )
mHelpMenu->appHelpActivated();
}
-void KMainWindow::slotStateChanged(const QString &newstate)
+void KMainWindow::slotStateChanged(const TQString &newstate)
{
stateChanged(newstate, KXMLGUIClient::StateNoReverse);
}
@@ -615,7 +615,7 @@ void KMainWindow::slotStateChanged(const QString &newstate)
/*
* Get rid of this for KDE 4.0
*/
-void KMainWindow::slotStateChanged(const QString &newstate,
+void KMainWindow::slotStateChanged(const TQString &newstate,
KXMLGUIClient::ReverseStateChange reverse)
{
stateChanged(newstate, reverse);
@@ -624,14 +624,14 @@ void KMainWindow::slotStateChanged(const QString &newstate,
/*
* Enable this for KDE 4.0
*/
-// void KMainWindow::slotStateChanged(const QString &newstate,
+// void KMainWindow::slotStateChanged(const TQString &newstate,
// bool reverse)
// {
// stateChanged(newstate,
// reverse ? KXMLGUIClient::StateReverse : KXMLGUIClient::StateNoReverse);
// }
-void KMainWindow::closeEvent ( QCloseEvent *e )
+void KMainWindow::closeEvent ( TQCloseEvent *e )
{
// Save settings if auto-save is enabled, and settings have changed
if (d->settingsDirty && d->autoSaveSettings)
@@ -641,7 +641,7 @@ void KMainWindow::closeEvent ( QCloseEvent *e )
e->accept();
int not_withdrawn = 0;
- QPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
+ TQPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
for (it.toFirst(); it.current(); ++it){
if ( !it.current()->isHidden() && it.current()->isTopLevel() && it.current() != this )
not_withdrawn++;
@@ -650,7 +650,7 @@ void KMainWindow::closeEvent ( QCloseEvent *e )
if ( !no_query_exit && not_withdrawn <= 0 ) { // last window close accepted?
if ( queryExit() && !kapp->sessionSaving() && !d->shuttingDown ) { // Yes, Quit app?
// don't call queryExit() twice
- disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown()));
+ disconnect(kapp, TQT_SIGNAL(shutDown()), this, TQT_SLOT(shuttingDown()));
d->shuttingDown = true;
kapp->deref(); // ...and quit application.
} else {
@@ -694,15 +694,15 @@ void KMainWindow::savePropertiesInternal( KConfig *config, int number )
bool oldASWS = d->autoSaveWindowSize;
d->autoSaveWindowSize = true; // make saveMainWindowSettings save the window size
- QString s;
+ TQString s;
s.setNum(number);
- s.prepend(QString::fromLatin1("WindowProperties"));
+ s.prepend(TQString::fromLatin1("WindowProperties"));
config->setGroup(s);
// store objectName, className, Width and Height for later restoring
// (Only useful for session management)
- config->writeEntry(QString::fromLatin1("ObjectName"), name());
- config->writeEntry(QString::fromLatin1("ClassName"), className());
+ config->writeEntry(TQString::fromLatin1("ObjectName"), name());
+ config->writeEntry(TQString::fromLatin1("ClassName"), className());
saveMainWindowSettings(config); // Menubar, statusbar and Toolbar settings.
@@ -713,10 +713,10 @@ void KMainWindow::savePropertiesInternal( KConfig *config, int number )
d->autoSaveWindowSize = oldASWS;
}
-void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configGroup)
+void KMainWindow::saveMainWindowSettings(KConfig *config, const TQString &configGroup)
{
kdDebug(200) << "KMainWindow::saveMainWindowSettings " << configGroup << endl;
- QString oldGroup;
+ TQString oldGroup;
if (!configGroup.isEmpty())
{
@@ -728,7 +728,7 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG
if ( d->autoSaveWindowSize )
saveWindowSize( config );
- QStatusBar* sb = internalStatusBar();
+ TQStatusBar* sb = internalStatusBar();
if (sb) {
if(!config->hasDefault("StatusBar") && !sb->isHidden() )
config->revertToDefault("StatusBar");
@@ -736,9 +736,9 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG
config->writeEntry("StatusBar", sb->isHidden() ? "Disabled" : "Enabled");
}
- QMenuBar* mb = internalMenuBar();
+ TQMenuBar* mb = internalMenuBar();
if (mb) {
- QString MenuBar = QString::fromLatin1("MenuBar");
+ TQString MenuBar = TQString::fromLatin1("MenuBar");
if(!config->hasDefault("MenuBar") && !mb->isHidden() )
config->revertToDefault("MenuBar");
else
@@ -747,15 +747,15 @@ void KMainWindow::saveMainWindowSettings(KConfig *config, const QString &configG
int n = 1; // Toolbar counter. toolbars are counted from 1,
KToolBar *toolbar = 0;
- QPtrListIterator<KToolBar> it( toolBarIterator() );
+ TQPtrListIterator<KToolBar> it( toolBarIterator() );
while ( ( toolbar = it.current() ) ) {
++it;
- QString group;
+ TQString group;
if (!configGroup.isEmpty())
{
// Give a number to the toolbar, but prefer a name if there is one,
// because there's no real guarantee on the ordering of toolbars
- group = (!::qstrcmp(toolbar->name(), "unnamed") ? QString::number(n) : QString(" ")+toolbar->name());
+ group = (!::qstrcmp(toolbar->name(), "unnamed") ? TQString::number(n) : TQString(" ")+toolbar->name());
group.prepend(" Toolbar");
group.prepend(configGroup);
}
@@ -795,9 +795,9 @@ bool KMainWindow::isStandardToolBarMenuEnabled() const
void KMainWindow::createStandardStatusBarAction(){
if(!d->showStatusBarAction){
- d->showStatusBarAction = KStdAction::showStatusbar(this, SLOT(setSettingsDirty()), actionCollection());
+ d->showStatusBarAction = KStdAction::showStatusbar(this, TQT_SLOT(setSettingsDirty()), actionCollection());
KStatusBar *sb = statusBar(); // Creates statusbar if it doesn't exist already.
- connect(d->showStatusBarAction, SIGNAL(toggled(bool)), sb, SLOT(setShown(bool)));
+ connect(d->showStatusBarAction, TQT_SIGNAL(toggled(bool)), sb, TQT_SLOT(setShown(bool)));
d->showStatusBarAction->setChecked(sb->isHidden());
}
}
@@ -808,15 +808,15 @@ bool KMainWindow::readPropertiesInternal( KConfig *config, int number )
readGlobalProperties( config );
// in order they are in toolbar list
- QString s;
+ TQString s;
s.setNum(number);
- s.prepend(QString::fromLatin1("WindowProperties"));
+ s.prepend(TQString::fromLatin1("WindowProperties"));
config->setGroup(s);
// restore the object name (window role)
- if ( config->hasKey(QString::fromLatin1("ObjectName" )) )
- setName( config->readEntry(QString::fromLatin1("ObjectName")).latin1()); // latin1 is right here
+ if ( config->hasKey(TQString::fromLatin1("ObjectName" )) )
+ setName( config->readEntry(TQString::fromLatin1("ObjectName")).latin1()); // latin1 is right here
applyMainWindowSettings(config); // Menubar, statusbar and toolbar settings.
@@ -826,12 +826,12 @@ bool KMainWindow::readPropertiesInternal( KConfig *config, int number )
return true;
}
-void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &configGroup)
+void KMainWindow::applyMainWindowSettings(KConfig *config, const TQString &configGroup)
{
return applyMainWindowSettings(config,configGroup,false);
}
-void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &configGroup,bool force)
+void KMainWindow::applyMainWindowSettings(KConfig *config, const TQString &configGroup,bool force)
{
kdDebug(200) << "KMainWindow::applyMainWindowSettings" << endl;
@@ -839,9 +839,9 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config
restoreWindowSize(config);
- QStatusBar* sb = internalStatusBar();
+ TQStatusBar* sb = internalStatusBar();
if (sb) {
- QString entry = config->readEntry("StatusBar", "Enabled");
+ TQString entry = config->readEntry("StatusBar", "Enabled");
if ( entry == "Disabled" )
sb->hide();
else
@@ -850,9 +850,9 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config
d->showStatusBarAction->setChecked(!sb->isHidden());
}
- QMenuBar* mb = internalMenuBar();
+ TQMenuBar* mb = internalMenuBar();
if (mb) {
- QString entry = config->readEntry ("MenuBar", "Enabled");
+ TQString entry = config->readEntry ("MenuBar", "Enabled");
if ( entry == "Disabled" )
mb->hide();
else
@@ -861,16 +861,16 @@ void KMainWindow::applyMainWindowSettings(KConfig *config, const QString &config
int n = 1; // Toolbar counter. toolbars are counted from 1,
KToolBar *toolbar;
- QPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator
+ TQPtrListIterator<KToolBar> it( toolBarIterator() ); // must use own iterator
for ( ; it.current(); ++it) {
toolbar= it.current();
- QString group;
+ TQString group;
if (!configGroup.isEmpty())
{
// Give a number to the toolbar, but prefer a name if there is one,
// because there's no real guarantee on the ordering of toolbars
- group = (!::qstrcmp(toolbar->name(), "unnamed") ? QString::number(n) : QString(" ")+toolbar->name());
+ group = (!::qstrcmp(toolbar->name(), "unnamed") ? TQString::number(n) : TQString(" ")+toolbar->name());
group.prepend(" Toolbar");
group.prepend(configGroup);
}
@@ -891,7 +891,7 @@ void KMainWindow::finalizeGUI( bool force )
// we call positionYourself again for each of them, but this time
// the toolbariterator should give them in the proper order.
// Both the XMLGUI and applySettings call this, hence "force" for the latter.
- QPtrListIterator<KToolBar> it( toolBarIterator() );
+ TQPtrListIterator<KToolBar> it( toolBarIterator() );
for ( ; it.current() ; ++it ) {
it.current()->positionYourself( force );
}
@@ -901,8 +901,8 @@ void KMainWindow::finalizeGUI( bool force )
void KMainWindow::saveWindowSize( KConfig * config ) const
{
- int scnum = QApplication::desktop()->screenNumber(parentWidget());
- QRect desk = QApplication::desktop()->screenGeometry(scnum);
+ int scnum = TQApplication::desktop()->screenNumber(parentWidget());
+ TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
int w, h;
#if defined Q_WS_X11
// save maximalization as desktop size + 1 in that direction
@@ -916,10 +916,10 @@ void KMainWindow::saveWindowSize( KConfig * config ) const
}
//TODO: add "Maximized" property instead "+1" hack
#endif
- QRect size( desk.width(), w, desk.height(), h );
+ TQRect size( desk.width(), w, desk.height(), h );
bool defaultSize = (size == d->defaultWindowSize);
- QString widthString = QString::fromLatin1("Width %1").arg(desk.width());
- QString heightString = QString::fromLatin1("Height %1").arg(desk.height());
+ TQString widthString = TQString::fromLatin1("Width %1").arg(desk.width());
+ TQString heightString = TQString::fromLatin1("Height %1").arg(desk.height());
if (!config->hasDefault(widthString) && defaultSize)
config->revertToDefault(widthString);
else
@@ -937,20 +937,20 @@ void KMainWindow::restoreWindowSize( KConfig * config )
parseGeometry(true);
} else {
// restore the size
- int scnum = QApplication::desktop()->screenNumber(parentWidget());
- QRect desk = QApplication::desktop()->screenGeometry(scnum);
+ int scnum = TQApplication::desktop()->screenNumber(parentWidget());
+ TQRect desk = TQApplication::desktop()->screenGeometry(scnum);
if ( d->defaultWindowSize.isNull() ) // only once
- d->defaultWindowSize = QRect(desk.width(), width(), desk.height(), height()); // store default values
- QSize size( config->readNumEntry( QString::fromLatin1("Width %1").arg(desk.width()), 0 ),
- config->readNumEntry( QString::fromLatin1("Height %1").arg(desk.height()), 0 ) );
+ d->defaultWindowSize = TQRect(desk.width(), width(), desk.height(), height()); // store default values
+ TQSize size( config->readNumEntry( TQString::fromLatin1("Width %1").arg(desk.width()), 0 ),
+ config->readNumEntry( TQString::fromLatin1("Height %1").arg(desk.height()), 0 ) );
if (size.isEmpty()) {
// try the KDE 2.0 way
- size = QSize( config->readNumEntry( QString::fromLatin1("Width"), 0 ),
- config->readNumEntry( QString::fromLatin1("Height"), 0 ) );
+ size = TQSize( config->readNumEntry( TQString::fromLatin1("Width"), 0 ),
+ config->readNumEntry( TQString::fromLatin1("Height"), 0 ) );
if (!size.isEmpty()) {
// make sure the other resolutions don't get old settings
- config->writeEntry( QString::fromLatin1("Width"), 0 );
- config->writeEntry( QString::fromLatin1("Height"), 0 );
+ config->writeEntry( TQString::fromLatin1("Width"), 0 );
+ config->writeEntry( TQString::fromLatin1("Height"), 0 );
}
}
if ( !size.isEmpty() ) {
@@ -965,7 +965,7 @@ void KMainWindow::restoreWindowSize( KConfig * config )
resize( size.width(), height());
else
resize( size );
- // QWidget::showMaximized() is both insufficient and broken
+ // TQWidget::showMaximized() is both insufficient and broken
KWin::setState( winId(), state );
#else
if (size.width() > desk.width() || size.height() > desk.height())
@@ -997,8 +997,8 @@ void KMainWindow::setSettingsDirty()
// (to compress calls and save only once, in case of multiple changes)
if ( !d->settingsTimer )
{
- d->settingsTimer = new QTimer( this );
- connect( d->settingsTimer, SIGNAL( timeout() ), SLOT( saveAutoSaveSettings() ) );
+ d->settingsTimer = new TQTimer( this );
+ connect( d->settingsTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( saveAutoSaveSettings() ) );
}
d->settingsTimer->start( 500, true );
}
@@ -1009,21 +1009,21 @@ bool KMainWindow::settingsDirty() const
return d->settingsDirty;
}
-QString KMainWindow::settingsGroup() const
+TQString KMainWindow::settingsGroup() const
{
return d->autoSaveGroup;
}
-void KMainWindow::setAutoSaveSettings( const QString & groupName, bool saveWindowSize )
+void KMainWindow::setAutoSaveSettings( const TQString & groupName, bool saveWindowSize )
{
d->autoSaveSettings = true;
d->autoSaveGroup = groupName;
d->autoSaveWindowSize = saveWindowSize;
// Get notified when the user moves a toolbar around
- disconnect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ),
- this, SLOT( setSettingsDirty() ) );
- connect( this, SIGNAL( dockWindowPositionChanged( QDockWindow * ) ),
- this, SLOT( setSettingsDirty() ) );
+ disconnect( this, TQT_SIGNAL( dockWindowPositionChanged( TQDockWindow * ) ),
+ this, TQT_SLOT( setSettingsDirty() ) );
+ connect( this, TQT_SIGNAL( dockWindowPositionChanged( TQDockWindow * ) ),
+ this, TQT_SLOT( setSettingsDirty() ) );
// Now read the previously saved settings
applyMainWindowSettings( KGlobal::config(), groupName );
@@ -1041,7 +1041,7 @@ bool KMainWindow::autoSaveSettings() const
return d->autoSaveSettings;
}
-QString KMainWindow::autoSaveGroup() const
+TQString KMainWindow::autoSaveGroup() const
{
return d->autoSaveGroup;
}
@@ -1057,7 +1057,7 @@ void KMainWindow::saveAutoSaveSettings()
d->settingsTimer->stop();
}
-void KMainWindow::resizeEvent( QResizeEvent * )
+void KMainWindow::resizeEvent( TQResizeEvent * )
{
if ( d->autoSaveWindowSize )
setSettingsDirty();
@@ -1075,7 +1075,7 @@ KMenuBar *KMainWindow::menuBar()
mb = new KMenuBar( this );
// trigger a re-layout and trigger a call to the private
// setMenuBar method.
- QMainWindow::menuBar();
+ TQMainWindow::menuBar();
}
return mb;
}
@@ -1087,7 +1087,7 @@ KStatusBar *KMainWindow::statusBar()
sb = new KStatusBar( this );
// trigger a re-layout and trigger a call to the private
// setStatusBar method.
- QMainWindow::statusBar();
+ TQMainWindow::statusBar();
}
return sb;
}
@@ -1109,7 +1109,7 @@ void KMainWindow::shuttingDown()
KMenuBar *KMainWindow::internalMenuBar()
{
- QObjectList *l = queryList( "KMenuBar", 0, false, false );
+ TQObjectList *l = queryList( "KMenuBar", 0, false, false );
if ( !l || !l->first() ) {
delete l;
return 0;
@@ -1122,7 +1122,7 @@ KMenuBar *KMainWindow::internalMenuBar()
KStatusBar *KMainWindow::internalStatusBar()
{
- QObjectList *l = queryList( "KStatusBar", 0, false, false );
+ TQObjectList *l = queryList( "KStatusBar", 0, false, false );
if ( !l || !l->first() ) {
delete l;
return 0;
@@ -1133,9 +1133,9 @@ KStatusBar *KMainWindow::internalStatusBar()
return s;
}
-void KMainWindow::childEvent( QChildEvent* e)
+void KMainWindow::childEvent( TQChildEvent* e)
{
- QMainWindow::childEvent( e );
+ TQMainWindow::childEvent( e );
}
KToolBar *KMainWindow::toolBar( const char * name )
@@ -1153,19 +1153,19 @@ KToolBar *KMainWindow::toolBar( const char * name )
return new KToolBar(this, DockTop, false, name, honor_mode ); // non-XMLGUI
}
-QPtrListIterator<KToolBar> KMainWindow::toolBarIterator()
+TQPtrListIterator<KToolBar> KMainWindow::toolBarIterator()
{
toolbarList.clear();
- QPtrList<QToolBar> lst;
- for ( int i = (int)QMainWindow::DockUnmanaged; i <= (int)DockMinimized; ++i ) {
+ TQPtrList<TQToolBar> lst;
+ for ( int i = (int)TQMainWindow::DockUnmanaged; i <= (int)DockMinimized; ++i ) {
lst = toolBars( (ToolBarDock)i );
- for ( QToolBar *tb = lst.first(); tb; tb = lst.next() ) {
+ for ( TQToolBar *tb = lst.first(); tb; tb = lst.next() ) {
if ( !tb->inherits( "KToolBar" ) )
continue;
toolbarList.append( (KToolBar*)tb );
}
}
- return QPtrListIterator<KToolBar>( toolbarList );
+ return TQPtrListIterator<KToolBar>( toolbarList );
}
KAccel * KMainWindow::accel()
@@ -1175,12 +1175,12 @@ KAccel * KMainWindow::accel()
return d->kaccel;
}
-void KMainWindow::paintEvent( QPaintEvent * pe )
+void KMainWindow::paintEvent( TQPaintEvent * pe )
{
- QMainWindow::paintEvent(pe); //Upcall to handle SH_MainWindow_SpaceBelowMenuBar rendering
+ TQMainWindow::paintEvent(pe); //Upcall to handle SH_MainWindow_SpaceBelowMenuBar rendering
}
-QSize KMainWindow::sizeForCentralWidgetSize(QSize size)
+TQSize KMainWindow::sizeForCentralWidgetSize(TQSize size)
{
KToolBar *tb = (KToolBar*)child( "mainToolBar", "KToolBar" );
if (tb && !tb->isHidden()) {
@@ -1188,16 +1188,16 @@ QSize KMainWindow::sizeForCentralWidgetSize(QSize size)
{
case KToolBar::Top:
case KToolBar::Bottom:
- size += QSize(0, tb->sizeHint().height());
+ size += TQSize(0, tb->sizeHint().height());
break;
case KToolBar::Left:
case KToolBar::Right:
- size += QSize(toolBar()->sizeHint().width(), 0);
+ size += TQSize(toolBar()->sizeHint().width(), 0);
break;
case KToolBar::Flat:
- size += QSize(0, 3+kapp->style().pixelMetric( QStyle::PM_DockWindowHandleExtent ));
+ size += TQSize(0, 3+kapp->style().pixelMetric( TQStyle::PM_DockWindowHandleExtent ));
break;
default:
@@ -1206,13 +1206,13 @@ QSize KMainWindow::sizeForCentralWidgetSize(QSize size)
}
KMenuBar *mb = internalMenuBar();
if (mb && !mb->isHidden()) {
- size += QSize(0,mb->heightForWidth(size.width()));
- if (style().styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, this))
- size += QSize( 0, dockWindowsMovable() ? 1 : 2);
+ size += TQSize(0,mb->heightForWidth(size.width()));
+ if (style().styleHint(TQStyle::SH_MainWindow_SpaceBelowMenuBar, this))
+ size += TQSize( 0, dockWindowsMovable() ? 1 : 2);
}
- QStatusBar *sb = internalStatusBar();
+ TQStatusBar *sb = internalStatusBar();
if( sb && !sb->isHidden() )
- size += QSize(0, sb->sizeHint().height());
+ size += TQSize(0, sb->sizeHint().height());
return size;
}
@@ -1222,17 +1222,17 @@ QSize KMainWindow::sizeForCentralWidgetSize(QSize size)
#warning Remove, should be in Qt
#endif
#endif
-void KMainWindow::setIcon( const QPixmap& p )
+void KMainWindow::setIcon( const TQPixmap& p )
{
- QMainWindow::setIcon( p );
+ TQMainWindow::setIcon( p );
#ifdef Q_WS_X11
// Qt3 doesn't support _NET_WM_ICON, but KApplication::setTopWidget(), which
// is used by KMainWindow, sets it
- KWin::setIcons( winId(), p, QPixmap());
+ KWin::setIcons( winId(), p, TQPixmap());
#endif
}
-QPtrList<KMainWindow>* KMainWindow::getMemberList() { return memberList; }
+TQPtrList<KMainWindow>* KMainWindow::getMemberList() { return memberList; }
// why do we support old gcc versions? using KXMLGUIBuilder::finalizeGUI;
// DF: because they compile KDE much faster :)