summaryrefslogtreecommitdiffstats
path: root/kommander/editor/workspace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/workspace.cpp')
-rw-r--r--kommander/editor/workspace.cpp192
1 files changed, 96 insertions, 96 deletions
diff --git a/kommander/editor/workspace.cpp b/kommander/editor/workspace.cpp
index c5c6420e..90f0891d 100644
--- a/kommander/editor/workspace.cpp
+++ b/kommander/editor/workspace.cpp
@@ -18,8 +18,8 @@
**
**********************************************************************/
-#include <qvariant.h> // HP-UX compiler needs this here
-#include <qlistview.h>
+#include <tqvariant.h> // HP-UX compiler needs this here
+#include <tqlistview.h>
#include "workspace.h"
#include "formwindow.h"
#include "mainwindow.h"
@@ -34,15 +34,15 @@
#endif
#include "formfile.h"
-#include <qheader.h>
-#include <qfileinfo.h>
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qobjectlist.h>
-#include <qworkspace.h>
-#include <qpopupmenu.h>
-#include <qtextstream.h>
+#include <tqheader.h>
+#include <tqfileinfo.h>
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqobjectlist.h>
+#include <tqworkspace.h>
+#include <tqpopupmenu.h>
+#include <tqtextstream.h>
#include "qcompletionedit.h"
#include <kurldrag.h>
@@ -97,16 +97,16 @@ static const char * const file_xpm[]={
".bbbbbbbbbbbc###",
"ccccccccccccc###"};
-static QPixmap *folderPixmap = 0;
-static QPixmap *filePixmap = 0;
-static QPixmap* formPixmap = 0;
+static TQPixmap *folderPixmap = 0;
+static TQPixmap *filePixmap = 0;
+static TQPixmap* formPixmap = 0;
#ifndef KOMMANDER
-WorkspaceItem::WorkspaceItem( QListView *parent, Project* p )
+WorkspaceItem::WorkspaceItem( TQListView *parent, Project* p )
#else
-WorkspaceItem::WorkspaceItem( QListView *parent )
+WorkspaceItem::WorkspaceItem( TQListView *parent )
#endif
- : QListViewItem( parent )
+ : TQListViewItem( parent )
{
init();
#ifndef KOMMANDER
@@ -118,8 +118,8 @@ WorkspaceItem::WorkspaceItem( QListView *parent )
}
#ifndef KOMMANDER
-WorkspaceItem::WorkspaceItem( QListViewItem *parent, SourceFile* sf )
- : QListViewItem( parent )
+WorkspaceItem::WorkspaceItem( TQListViewItem *parent, SourceFile* sf )
+ : TQListViewItem( parent )
{
init();
sourceFile = sf;
@@ -128,15 +128,15 @@ WorkspaceItem::WorkspaceItem( QListViewItem *parent, SourceFile* sf )
}
#endif
-WorkspaceItem::WorkspaceItem( QListViewItem *parent, FormFile* ff, Type type )
- : QListViewItem( parent )
+WorkspaceItem::WorkspaceItem( TQListViewItem *parent, FormFile* ff, Type type )
+ : TQListViewItem( parent )
{
init();
formFile = ff;
t = type;
if ( type == FormFileType ) {
setPixmap( 0, *formPixmap );
- QObject::connect( ff, SIGNAL( somethingChanged(FormFile*) ), listView(), SLOT( update(FormFile*) ) );
+ TQObject::connect( ff, TQT_SIGNAL( somethingChanged(FormFile*) ), listView(), TQT_SLOT( update(FormFile*) ) );
#ifndef KOMMANDER
if ( formFile->supportsCodeFile() )
(void) new WorkspaceItem( this, formFile, FormSourceType );
@@ -146,15 +146,15 @@ WorkspaceItem::WorkspaceItem( QListViewItem *parent, FormFile* ff, Type type )
}
}
-WorkspaceItem::WorkspaceItem( QListView *parent, FormFile* ff, Type type )
- : QListViewItem( parent )
+WorkspaceItem::WorkspaceItem( TQListView *parent, FormFile* ff, Type type )
+ : TQListViewItem( parent )
{
init();
formFile = ff;
t = type;
if ( type == FormFileType ) {
setPixmap( 0, *formPixmap );
- QObject::connect( ff, SIGNAL( somethingChanged(FormFile*) ), listView(), SLOT( update(FormFile*) ) );
+ TQObject::connect( ff, TQT_SIGNAL( somethingChanged(FormFile*) ), listView(), TQT_SLOT( update(FormFile*) ) );
#ifndef KOMMANDER
if ( formFile->supportsCodeFile() )
(void) new WorkspaceItem( this, formFile, FormSourceType );
@@ -176,32 +176,32 @@ void WorkspaceItem::init()
formFile = 0;
}
-void WorkspaceItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
+void WorkspaceItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
{
- QColorGroup g( cg );
- g.setColor( QColorGroup::Base, backgroundColor() );
- g.setColor( QColorGroup::Foreground, Qt::black );
+ TQColorGroup g( cg );
+ g.setColor( TQColorGroup::Base, backgroundColor() );
+ g.setColor( TQColorGroup::Foreground, Qt::black );
#ifndef KOMMANDER
if ( type() == FormSourceType && !formFile->hasFormCode() ) {
- g.setColor( QColorGroup::Text, listView()->palette().disabled().color( QColorGroup::Text) );
- g.setColor( QColorGroup::HighlightedText, listView()->palette().disabled().color( QColorGroup::Text) );
+ g.setColor( TQColorGroup::Text, listView()->palette().disabled().color( TQColorGroup::Text) );
+ g.setColor( TQColorGroup::HighlightedText, listView()->palette().disabled().color( TQColorGroup::Text) );
} else {
#endif
- g.setColor( QColorGroup::Text, Qt::black );
+ g.setColor( TQColorGroup::Text, Qt::black );
#ifndef KOMMANDER
}
#endif
p->save();
if ( isModified() ) {
- QFont f = p->font();
+ TQFont f = p->font();
f.setBold( true );
p->setFont( f );
}
- QListViewItem::paintCell( p, g, column, width, align );
- p->setPen( QPen( cg.dark(), 1 ) );
+ TQListViewItem::paintCell( p, g, column, width, align );
+ p->setPen( TQPen( cg.dark(), 1 ) );
if ( column == 0 )
p->drawLine( 0, 0, 0, height() - 1 );
if ( listView()->firstChild() != this ) {
@@ -215,10 +215,10 @@ void WorkspaceItem::paintCell( QPainter *p, const QColorGroup &cg, int column, i
p->restore();
}
-QString WorkspaceItem::text( int column ) const
+TQString WorkspaceItem::text( int column ) const
{
if ( column != 0 )
- return QListViewItem::text( column );
+ return TQListViewItem::text( column );
switch( t ) {
#ifndef KOMMANDER
case ProjectType:
@@ -236,10 +236,10 @@ QString WorkspaceItem::text( int column ) const
#endif
}
- return QString::null; // shut up compiler
+ return TQString::null; // shut up compiler
}
-void WorkspaceItem::fillCompletionList( QStringList& completion )
+void WorkspaceItem::fillCompletionList( TQStringList& completion )
{
switch( t ) {
case ProjectType:
@@ -259,7 +259,7 @@ void WorkspaceItem::fillCompletionList( QStringList& completion )
}
}
-bool WorkspaceItem::checkCompletion( const QString& completion )
+bool WorkspaceItem::checkCompletion( const TQString& completion )
{
switch( t ) {
case ProjectType:
@@ -297,9 +297,9 @@ bool WorkspaceItem::isModified() const
#endif
}
-QString WorkspaceItem::key( int column, bool ) const
+TQString WorkspaceItem::key( int column, bool ) const
{
- QString key = text( column );
+ TQString key = text( column );
if ( t == FormFileType )
key.prepend( "0" );
else
@@ -307,7 +307,7 @@ QString WorkspaceItem::key( int column, bool ) const
return key;
}
-QColor WorkspaceItem::backgroundColor()
+TQColor WorkspaceItem::backgroundColor()
{
bool b = useOddColor;
if ( t == FormSourceType && parent() )
@@ -318,18 +318,18 @@ QColor WorkspaceItem::backgroundColor()
void WorkspaceItem::setOpen( bool b )
{
- QListViewItem::setOpen( b );
+ TQListViewItem::setOpen( b );
autoOpen = false;
}
void WorkspaceItem::setAutoOpen( bool b )
{
- QListViewItem::setOpen( b );
+ TQListViewItem::setOpen( b );
autoOpen = b;
}
-Workspace::Workspace( QWidget *parent, MainWindow *mw )
- : QListView( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
+Workspace::Workspace( TQWidget *parent, MainWindow *mw )
+ : TQListView( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
WStyle_Tool | WStyle_MinMax | WStyle_SysMenu ), mainWindow( mw ),
#ifndef KOMMANDER
project( 0 ), completionDirty( false )
@@ -345,22 +345,22 @@ Workspace::Workspace( QWidget *parent, MainWindow *mw )
header()->setStretchEnabled( true );
header()->hide();
setSorting( 0 );
- setResizePolicy( QScrollView::Manual );
+ setResizePolicy( TQScrollView::Manual );
#ifndef KOMMANDER
setIcon( PixmapChooser::loadPixmap( "logo" ) );
#endif
- QPalette p( palette() );
- p.setColor( QColorGroup::Base, QColor( *backColor2 ) );
+ TQPalette p( palette() );
+ p.setColor( TQColorGroup::Base, TQColor( *backColor2 ) );
(void)*selectedBack; // hack
setPalette( p );
addColumn( i18n("Files" ) );
setAllColumnsShowFocus( true );
- connect( this, SIGNAL( mouseButtonClicked( int, QListViewItem *, const QPoint &, int ) ),
- this, SLOT( itemClicked( int, QListViewItem *, const QPoint& ) ) ),
- connect( this, SIGNAL( doubleClicked( QListViewItem * ) ),
- this, SLOT( itemDoubleClicked( QListViewItem * ) ) ),
- connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint &, int ) ),
- this, SLOT( rmbClicked( QListViewItem *, const QPoint& ) ) ),
+ connect( this, TQT_SIGNAL( mouseButtonClicked( int, TQListViewItem *, const TQPoint &, int ) ),
+ this, TQT_SLOT( itemClicked( int, TQListViewItem *, const TQPoint& ) ) ),
+ connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ),
+ this, TQT_SLOT( itemDoubleClicked( TQListViewItem * ) ) ),
+ connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint &, int ) ),
+ this, TQT_SLOT( rmbClicked( TQListViewItem *, const TQPoint& ) ) ),
setHScrollBarMode( AlwaysOff );
setVScrollBarMode( AlwaysOn );
viewport()->setAcceptDrops( true );
@@ -368,9 +368,9 @@ Workspace::Workspace( QWidget *parent, MainWindow *mw )
setColumnWidthMode( 1, Manual );
if ( !folderPixmap ) {
- folderPixmap = new QPixmap( folderxpm );
- filePixmap = new QPixmap( file_xpm );
- formPixmap = new QPixmap( PixmapChooser::loadPixmap( "form.xpm", PixmapChooser::Mini ) );
+ folderPixmap = new TQPixmap( folderxpm );
+ filePixmap = new TQPixmap( file_xpm );
+ formPixmap = new TQPixmap( PixmapChooser::loadPixmap( "form.xpm", PixmapChooser::Mini ) );
}
#ifdef KOMMANDER
@@ -380,7 +380,7 @@ Workspace::Workspace( QWidget *parent, MainWindow *mw )
#ifndef KOMMANDER
-void Workspace::projectDestroyed( QObject* o )
+void Workspace::projectDestroyed( TQObject* o )
{
if ( o == project ) {
project = 0;
@@ -395,19 +395,19 @@ void Workspace::setCurrentProject( Project *pro )
if ( project == pro )
return;
if ( project ) {
- disconnect( project, SIGNAL( sourceFileAdded(SourceFile*) ), this, SLOT( sourceFileAdded(SourceFile*) ) );
- disconnect( project, SIGNAL( sourceFileRemoved(SourceFile*) ), this, SLOT( sourceFileRemoved(SourceFile*) ) );
- disconnect( project, SIGNAL( formFileAdded(FormFile*) ), this, SLOT( formFileAdded(FormFile*) ) );
- disconnect( project, SIGNAL( formFileRemoved(FormFile*) ), this, SLOT( formFileRemoved(FormFile*) ) );
- disconnect( project, SIGNAL( projectModified() ), this, SLOT( update() ) );
+ disconnect( project, TQT_SIGNAL( sourceFileAdded(SourceFile*) ), this, TQT_SLOT( sourceFileAdded(SourceFile*) ) );
+ disconnect( project, TQT_SIGNAL( sourceFileRemoved(SourceFile*) ), this, TQT_SLOT( sourceFileRemoved(SourceFile*) ) );
+ disconnect( project, TQT_SIGNAL( formFileAdded(FormFile*) ), this, TQT_SLOT( formFileAdded(FormFile*) ) );
+ disconnect( project, TQT_SIGNAL( formFileRemoved(FormFile*) ), this, TQT_SLOT( formFileRemoved(FormFile*) ) );
+ disconnect( project, TQT_SIGNAL( projectModified() ), this, TQT_SLOT( update() ) );
}
project = pro;
- connect( project, SIGNAL( sourceFileAdded(SourceFile*) ), this, SLOT( sourceFileAdded(SourceFile*) ) );
- connect( project, SIGNAL( sourceFileRemoved(SourceFile*) ), this, SLOT( sourceFileRemoved(SourceFile*) ) );
- connect( project, SIGNAL( formFileAdded(FormFile*) ), this, SLOT( formFileAdded(FormFile*) ) );
- connect( project, SIGNAL( formFileRemoved(FormFile*) ), this, SLOT( formFileRemoved(FormFile*) ) );
- connect( project, SIGNAL( destroyed(QObject*) ), this, SLOT( projectDestroyed(QObject*) ) );
- connect( project, SIGNAL( projectModified() ), this, SLOT( update() ) );
+ connect( project, TQT_SIGNAL( sourceFileAdded(SourceFile*) ), this, TQT_SLOT( sourceFileAdded(SourceFile*) ) );
+ connect( project, TQT_SIGNAL( sourceFileRemoved(SourceFile*) ), this, TQT_SLOT( sourceFileRemoved(SourceFile*) ) );
+ connect( project, TQT_SIGNAL( formFileAdded(FormFile*) ), this, TQT_SLOT( formFileAdded(FormFile*) ) );
+ connect( project, TQT_SIGNAL( formFileRemoved(FormFile*) ), this, TQT_SLOT( formFileRemoved(FormFile*) ) );
+ connect( project, TQT_SIGNAL( destroyed(TQObject*) ), this, TQT_SLOT( projectDestroyed(TQObject*) ) );
+ connect( project, TQT_SIGNAL( projectModified() ), this, TQT_SLOT( update() ) );
clear();
if ( bufferEdit )
@@ -417,13 +417,13 @@ void Workspace::setCurrentProject( Project *pro )
projectItem->setOpen( true );
- for ( QPtrListIterator<SourceFile> sources = project->sourceFiles();
+ for ( TQPtrListIterator<SourceFile> sources = project->sourceFiles();
sources.current(); ++sources ) {
SourceFile* f = sources.current();
(void) new WorkspaceItem( projectItem, f );
}
- for ( QPtrListIterator<FormFile> forms = project->formFiles();
+ for ( TQPtrListIterator<FormFile> forms = project->formFiles();
forms.current(); ++forms ) {
FormFile* f = forms.current();
(void) new WorkspaceItem( projectItem, f );
@@ -483,7 +483,7 @@ void Workspace::update()
void Workspace::update( FormFile* ff )
{
- QListViewItem* i = findItem( ff );
+ TQListViewItem* i = findItem( ff );
if ( i ) {
i->repaint();
if ( (i = i->firstChild()) )
@@ -534,7 +534,7 @@ void Workspace::activeEditorChanged( SourceEditor *se )
WorkspaceItem *Workspace::findItem( FormFile* ff)
{
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
for ( ; it.current(); ++it ) {
if ( ( (WorkspaceItem*)it.current() )->formFile == ff )
return (WorkspaceItem*)it.current();
@@ -545,7 +545,7 @@ WorkspaceItem *Workspace::findItem( FormFile* ff)
#ifndef KOMMANDER
WorkspaceItem *Workspace::findItem( SourceFile *sf )
{
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
for ( ; it.current(); ++it ) {
if ( ( (WorkspaceItem*)it.current() )->sourceFile == sf )
return (WorkspaceItem*)it.current();
@@ -556,7 +556,7 @@ WorkspaceItem *Workspace::findItem( SourceFile *sf )
void Workspace::closeAutoOpenItems()
{
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
for ( ; it.current(); ++it ) {
WorkspaceItem* i = (WorkspaceItem*) it.current();
WorkspaceItem* ip = (WorkspaceItem*) i->parent();
@@ -570,18 +570,18 @@ void Workspace::closeAutoOpenItems()
}
-void Workspace::closeEvent( QCloseEvent *e )
+void Workspace::closeEvent( TQCloseEvent *e )
{
e->accept();
}
-void Workspace::itemDoubleClicked( QListViewItem *i )
+void Workspace::itemDoubleClicked( TQListViewItem *i )
{
if ( ( (WorkspaceItem*)i)->type()== WorkspaceItem::ProjectType )
i->setOpen( true );
}
-void Workspace::itemClicked( int button, QListViewItem *i, const QPoint& )
+void Workspace::itemClicked( int button, TQListViewItem *i, const TQPoint& )
{
if ( !i || button != LeftButton )
return;
@@ -610,7 +610,7 @@ void Workspace::itemClicked( int button, QListViewItem *i, const QPoint& )
#endif
}
-void Workspace::contentsDropEvent( QDropEvent *e )
+void Workspace::contentsDropEvent( TQDropEvent *e )
{
if (!KURLDrag::canDecode(e))
{
@@ -627,12 +627,12 @@ void Workspace::contentsDropEvent( QDropEvent *e )
{
if (!(*it).isLocalFile())
continue;
- QString fn = (*it).path();
+ TQString fn = (*it).path();
mainWindow->fileOpen(fn);
}
}
-void Workspace::contentsDragEnterEvent( QDragEnterEvent *e )
+void Workspace::contentsDragEnterEvent( TQDragEnterEvent *e )
{
if ( !KURLDrag::canDecode( e ) )
e->ignore();
@@ -640,7 +640,7 @@ void Workspace::contentsDragEnterEvent( QDragEnterEvent *e )
e->accept();
}
-void Workspace::contentsDragMoveEvent( QDragMoveEvent *e )
+void Workspace::contentsDragMoveEvent( TQDragMoveEvent *e )
{
if ( !KURLDrag::canDecode( e ) )
e->ignore();
@@ -648,13 +648,13 @@ void Workspace::contentsDragMoveEvent( QDragMoveEvent *e )
e->accept();
}
-void Workspace::rmbClicked( QListViewItem *i, const QPoint& pos )
+void Workspace::rmbClicked( TQListViewItem *i, const TQPoint& pos )
{
if ( !i )
return;
WorkspaceItem* wi = (WorkspaceItem*)i;
enum { OPEN_SOURCE, REMOVE_SOURCE, OPEN_FORM, REMOVE_FORM, OPEN_FORM_SOURCE };
- QPopupMenu menu( this );
+ TQPopupMenu menu( this );
switch ( wi->type() ) {
#ifndef KOMMANDER
case WorkspaceItem::SourceFileType:
@@ -717,19 +717,19 @@ void Workspace::rmbClicked( QListViewItem *i, const QPoint& pos )
}
}
-bool Workspace::eventFilter( QObject *o, QEvent * e )
+bool Workspace::eventFilter( TQObject *o, TQEvent * e )
{
// Reggie, on what type of events do we have to execute updateBufferEdit()
- if ( o ==bufferEdit && e->type() != QEvent::ChildRemoved )
+ if ( o ==bufferEdit && e->type() != TQEvent::ChildRemoved )
updateBufferEdit();
- return QListView::eventFilter( o, e );
+ return TQListView::eventFilter( o, e );
}
void Workspace::setBufferEdit( QCompletionEdit *edit )
{
bufferEdit = edit;
- connect( bufferEdit, SIGNAL( chosen( const QString & ) ),
- this, SLOT( bufferChosen( const QString & ) ) );
+ connect( bufferEdit, TQT_SIGNAL( chosen( const TQString & ) ),
+ this, TQT_SLOT( bufferChosen( const TQString & ) ) );
bufferEdit->installEventFilter( this );
}
@@ -739,7 +739,7 @@ void Workspace::updateBufferEdit()
return;
completionDirty = false;
#ifndef KOMMANDER
- QStringList completion = MainWindow::self->projectFileNames();
+ TQStringList completion = MainWindow::self->projectFileNames();
while ( it.current() ) {
( (WorkspaceItem*)it.current())->fillCompletionList( completion );
++it;
@@ -749,7 +749,7 @@ void Workspace::updateBufferEdit()
#endif
}
-void Workspace::bufferChosen( const QString &buffer )
+void Workspace::bufferChosen( const TQString &buffer )
{
if ( bufferEdit )
bufferEdit->setText( "" );
@@ -761,10 +761,10 @@ void Workspace::bufferChosen( const QString &buffer )
}
#endif
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
while ( it.current() ) {
if ( ( (WorkspaceItem*)it.current())->checkCompletion( buffer ) ) {
- itemClicked( LeftButton, it.current(), QPoint() );
+ itemClicked( LeftButton, it.current(), TQPoint() );
break;
}
++it;
@@ -773,7 +773,7 @@ void Workspace::bufferChosen( const QString &buffer )
void Workspace::updateColors()
{
- QListViewItem* i = firstChild();
+ TQListViewItem* i = firstChild();
if ( i )
i = i->firstChild();
bool b = true;