summaryrefslogtreecommitdiffstats
path: root/koshell/koshell_shell.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /koshell/koshell_shell.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'koshell/koshell_shell.cc')
-rw-r--r--koshell/koshell_shell.cc128
1 files changed, 64 insertions, 64 deletions
diff --git a/koshell/koshell_shell.cc b/koshell/koshell_shell.cc
index 0160f1e1..079988a8 100644
--- a/koshell/koshell_shell.cc
+++ b/koshell/koshell_shell.cc
@@ -20,11 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qcursor.h>
-#include <qsplitter.h>
-#include <qiconview.h>
-#include <qlabel.h>
-#include <qvbox.h>
+#include <tqcursor.h>
+#include <tqsplitter.h>
+#include <tqiconview.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
#include <assert.h>
@@ -62,34 +62,34 @@ KoShellWindow::KoShellWindow()
{
m_activePage = m_lstPages.end();
- m_pLayout = new QSplitter( centralWidget() );
+ m_pLayout = new TQSplitter( centralWidget() );
// Setup the sidebar
m_pSidebar = new IconSidePane( m_pLayout );
- m_pSidebar->setSizePolicy( QSizePolicy( QSizePolicy::Maximum,
- QSizePolicy::Preferred ) );
+ m_pSidebar->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Maximum,
+ TQSizePolicy::Preferred ) );
m_pSidebar->setActionCollection( actionCollection() );
- m_grpFile = m_pSidebar->insertGroup(i18n("Components"), false, this, SLOT( slotSidebar_Part(int )));
- m_grpDocuments = m_pSidebar->insertGroup(i18n("Documents"), true, this, SLOT(slotSidebar_Document(int)));
- m_pLayout->setResizeMode(m_pSidebar,QSplitter::FollowSizeHint);
+ m_grpFile = m_pSidebar->insertGroup(i18n("Components"), false, TQT_TQOBJECT(this), TQT_SLOT( slotSidebar_Part(int )));
+ m_grpDocuments = m_pSidebar->insertGroup(i18n("Documents"), true, TQT_TQOBJECT(this), TQT_SLOT(slotSidebar_Document(int)));
+ m_pLayout->setResizeMode(m_pSidebar,TQSplitter::FollowSizeHint);
// Setup the tabbar
m_pFrame = new KTabWidget( m_pLayout );
- m_pFrame->setSizePolicy( QSizePolicy( QSizePolicy::Minimum,
- QSizePolicy::Preferred ) );
+ m_pFrame->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum,
+ TQSizePolicy::Preferred ) );
m_pFrame->setTabPosition( KTabWidget::Bottom );
- m_tabCloseButton = new QToolButton( m_pFrame );
- connect( m_tabCloseButton, SIGNAL( clicked() ),
- this, SLOT( slotFileClose() ) );
+ m_tabCloseButton = new TQToolButton( m_pFrame );
+ connect( m_tabCloseButton, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( slotFileClose() ) );
m_tabCloseButton->setIconSet( SmallIconSet( "tab_remove" ) );
m_tabCloseButton->adjustSize();
- QToolTip::add(m_tabCloseButton, i18n("Close"));
+ TQToolTip::add(m_tabCloseButton, i18n("Close"));
m_pFrame->setCornerWidget( m_tabCloseButton, BottomRight );
m_tabCloseButton->hide();
- QValueList<KoDocumentEntry> lstComponents = KoDocumentEntry::query(false,QString());
- QValueList<KoDocumentEntry>::Iterator it = lstComponents.begin();
+ TQValueList<KoDocumentEntry> lstComponents = KoDocumentEntry::query(false,TQString());
+ TQValueList<KoDocumentEntry>::Iterator it = lstComponents.begin();
int id = 0;
// Get all available components
for( ; it != lstComponents.end(); ++it )
@@ -107,17 +107,17 @@ KoShellWindow::KoShellWindow()
m_mapComponents[ id++ ] = *it;
}
- QValueList<int> list;
+ TQValueList<int> list;
list.append( KoShellSettings::sidebarWidth() );
list.append( this->width() - KoShellSettings::sidebarWidth() );
m_pLayout->setSizes( list );
- connect( this, SIGNAL( documentSaved() ),
- this, SLOT( slotNewDocumentName() ) );
+ connect( this, TQT_SIGNAL( documentSaved() ),
+ this, TQT_SLOT( slotNewDocumentName() ) );
- connect( m_pFrame, SIGNAL( currentChanged( QWidget* ) ),
- this, SLOT( slotUpdatePart( QWidget* ) ) );
- connect( m_pFrame, SIGNAL( contextMenu(QWidget * ,const QPoint &)), this, SLOT( tab_contextMenu(QWidget * ,const QPoint &)) );
+ connect( m_pFrame, TQT_SIGNAL( currentChanged( TQWidget* ) ),
+ this, TQT_SLOT( slotUpdatePart( TQWidget* ) ) );
+ connect( m_pFrame, TQT_SIGNAL( contextMenu(TQWidget * ,const TQPoint &)), this, TQT_SLOT( tab_contextMenu(TQWidget * ,const TQPoint &)) );
m_client = new KoShellGUIClient( this );
createShellGUI();
@@ -133,7 +133,7 @@ KoShellWindow::~KoShellWindow()
partManager()->setActivePart(0);
// Destroy all documents - queryClose has made sure we saved them first
- QValueList<Page>::ConstIterator it = m_lstPages.begin();
+ TQValueList<Page>::ConstIterator it = m_lstPages.begin();
for (; it != m_lstPages.end(); ++it )
{
(*it).m_pDoc->removeShell( this );
@@ -143,7 +143,7 @@ KoShellWindow::~KoShellWindow()
}
m_lstPages.clear();
- setRootDocumentDirect( 0L, QPtrList<KoView>() ); // prevent our parent destructor from doing stupid things
+ setRootDocumentDirect( 0L, TQPtrList<KoView>() ); // prevent our tqparent destructor from doing stupid things
saveSettings(); // Now save our settings before exiting
}
@@ -158,7 +158,7 @@ bool KoShellWindow::openDocumentInternal( const KURL &url, KoDocument* )
/*if (!KIO::NetAccess::exists(url,true,0) )
{
- KMessageBox::error(0L, i18n("The file %1 doesn't exist.").arg(url.url()) );
+ KMessageBox::error(0L, i18n("The file %1 doesn't exist.").tqarg(url.url()) );
recentAction()->removeURL(url); //remove the file from the recent-opened-file-list
saveRecentFiles();
return false;
@@ -174,8 +174,8 @@ bool KoShellWindow::openDocumentInternal( const KURL &url, KoDocument* )
tmpFile = new KTempFile;
KoFilterManager *manager = new KoFilterManager( url.path() );
- QCString mimetype; // an empty mimetype means, that the "nearest"
- KoFilter::ConversionStatus status = manager->exp0rt( tmpFile->name(), mimetype ); // KOffice part will be chosen
+ TQCString mimetype; // an empty mimetype means, that the "nearest"
+ KoFilter::ConversiontqStatus status = manager->exp0rt( tmpFile->name(), mimetype ); // KOffice part will be chosen
delete manager;
if ( status != KoFilter::OK || mimetype.isEmpty() ) {
@@ -208,9 +208,9 @@ bool KoShellWindow::openDocumentInternal( const KURL &url, KoDocument* )
return false;
}
- connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- connect(newdoc, SIGNAL(completed()), this, SLOT(slotKSLoadCompleted()));
- connect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotKSLoadCanceled( const QString & )));
+ connect(newdoc, TQT_SIGNAL(sigProgress(int)), this, TQT_SLOT(slotProgress(int)));
+ connect(newdoc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotKSLoadCompleted()));
+ connect(newdoc, TQT_SIGNAL(canceled( const TQString & )), this, TQT_SLOT(slotKSLoadCanceled( const TQString & )));
newdoc->addShell( this ); // used by openURL
bool openRet = (!isImporting ()) ? newdoc->openURL(tmpUrl) : newdoc->import(tmpUrl);
if ( !openRet )
@@ -255,7 +255,7 @@ bool KoShellWindow::openDocumentInternal( const KURL &url, KoDocument* )
return true;
}
-void KoShellWindow::slotSidebarItemClicked( QIconViewItem *item )
+void KoShellWindow::slotSidebarItemClicked( TQIconViewItem *item )
{
//kdDebug() << "slotSidebarItemClicked called!" << endl;
if( item != 0 )
@@ -292,27 +292,27 @@ void KoShellWindow::slotKSLoadCompleted()
partManager()->addPart( newdoc, false );
setRootDocument( newdoc );
- disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotKSLoadCompleted()));
- disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotKSLoadCanceled( const QString & )));
+ disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), this, TQT_SLOT(slotProgress(int)));
+ disconnect(newdoc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotKSLoadCompleted()));
+ disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), this, TQT_SLOT(slotKSLoadCanceled( const TQString & )));
}
-void KoShellWindow::slotKSLoadCanceled( const QString & errMsg )
+void KoShellWindow::slotKSLoadCanceled( const TQString & errMsg )
{
KMessageBox::error( this, errMsg );
// ... can't delete the document, it's the one who emitted the signal...
// ###### FIXME: This can be done in 3.0 with deleteLater, I assume (Werner)
KoDocument* newdoc = (KoDocument *)(sender());
- disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotKSLoadCompleted()));
- disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotKSLoadCanceled( const QString & )));
+ disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), this, TQT_SLOT(slotProgress(int)));
+ disconnect(newdoc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotKSLoadCompleted()));
+ disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), this, TQT_SLOT(slotKSLoadCanceled( const TQString & )));
}
void KoShellWindow::saveAll()
{
KoView *currentView = (*m_activePage).m_pView;
- for (QValueList<Page>::iterator it=m_lstPages.begin(); it != m_lstPages.end(); ++it)
+ for (TQValueList<Page>::iterator it=m_lstPages.begin(); it != m_lstPages.end(); ++it)
{
if ( (*it).m_pDoc->isModified() )
{
@@ -335,11 +335,11 @@ void KoShellWindow::setRootDocument( KoDocument * doc )
if ( doc )
{
- if ( !doc->shells().contains( this ) )
+ if ( !doc->shells().tqcontains( this ) )
doc->addShell( this );
KoView *v = doc->createView(this);
- QPtrList<KoView> views;
+ TQPtrList<KoView> views;
views.append(v);
setRootDocumentDirect( doc, views );
@@ -362,7 +362,7 @@ void KoShellWindow::setRootDocument( KoDocument * doc )
mnuSaveAll->setEnabled(true);
} else
{
- setRootDocumentDirect( 0L, QPtrList<KoView>() );
+ setRootDocumentDirect( 0L, TQPtrList<KoView>() );
m_activePage = m_lstPages.end();
KoMainWindow::updateCaption();
}
@@ -379,14 +379,14 @@ void KoShellWindow::updateCaption()
KoMainWindow::updateCaption();
// Let's take this opportunity for setting a correct name for the icon
// in koolbar
- QValueList<Page>::Iterator it = m_lstPages.begin();
+ TQValueList<Page>::Iterator it = m_lstPages.begin();
for( ; it != m_lstPages.end() ; ++it )
{
if ( (*it).m_pDoc == rootDocument() )
{
//kdDebug() << "updateCaption called for " << rootDocument() << endl;
// Get caption from document info (title(), in about page)
- QString name;
+ TQString name;
if ( rootDocument()->documentInfo() )
{
name = rootDocument()->documentInfo()->title();
@@ -415,7 +415,7 @@ void KoShellWindow::updateCaption()
void KoShellWindow::slotSidebar_Part(int _item)
{
//kdDebug() << "Component part choosed:" << _item << endl;
- kapp->setOverrideCursor( QCursor(Qt::WaitCursor) );
+ kapp->setOverrideCursor( TQCursor(TQt::WaitCursor) );
m_documentEntry = m_mapComponents[ _item ];
kdDebug() << m_documentEntry.service() << endl;
kdDebug() << m_documentEntry.name() << endl;
@@ -441,7 +441,7 @@ void KoShellWindow::slotSidebar_Document(int _item)
(*m_activePage).m_id == _item )
return;
- QValueList<Page>::Iterator it = m_lstPages.begin();
+ TQValueList<Page>::Iterator it = m_lstPages.begin();
while( it != m_lstPages.end() )
{
if ( (*it).m_id == _item )
@@ -467,12 +467,12 @@ void KoShellWindow::slotShowSidebar()
}
}
-void KoShellWindow::slotUpdatePart( QWidget* widget )
+void KoShellWindow::slotUpdatePart( TQWidget* widget )
{
KoView* v = dynamic_cast<KoView*>(widget);
if ( v != 0 )
{
- QValueList<Page>::Iterator it = m_lstPages.begin();
+ TQValueList<Page>::Iterator it = m_lstPages.begin();
for( ; it != m_lstPages.end(); ++it )
{
if( (*it).m_pView == v )
@@ -481,7 +481,7 @@ void KoShellWindow::slotUpdatePart( QWidget* widget )
}
}
-void KoShellWindow::switchToPage( QValueList<Page>::Iterator it )
+void KoShellWindow::switchToPage( TQValueList<Page>::Iterator it )
{
// Select new active page (view)
m_activePage = it;
@@ -491,7 +491,7 @@ void KoShellWindow::switchToPage( QValueList<Page>::Iterator it )
// Make it active (GUI etc.)
partManager()->setActivePart( (*m_activePage).m_pDoc, v );
// Change current document
- QPtrList<KoView> views;
+ TQPtrList<KoView> views;
views.append(v);
setRootDocumentDirect( (*m_activePage).m_pDoc, views );
// Select the item in the sidebar
@@ -503,7 +503,7 @@ void KoShellWindow::switchToPage( QValueList<Page>::Iterator it )
v->setFocus();
partSpecificHelpAction->setEnabled(true);
- partSpecificHelpAction->setText(i18n("%1 Handbook").arg((*m_activePage).m_pDoc->instance()->aboutData()->programName()));
+ partSpecificHelpAction->setText(i18n("%1 Handbook").tqarg((*m_activePage).m_pDoc->instance()->aboutData()->programName()));
}
void KoShellWindow::slotFileNew()
@@ -527,7 +527,7 @@ void KoShellWindow::slotFileNew()
void KoShellWindow::slotFileOpen()
{
- KFileDialog *dialog=new KFileDialog(QString::null, QString::null, 0L, "file dialog", true);
+ KFileDialog *dialog=new KFileDialog(TQString(), TQString(), 0L, "file dialog", true);
if (!isImporting())
dialog->setCaption( i18n("Open Document") );
else
@@ -535,7 +535,7 @@ void KoShellWindow::slotFileOpen()
dialog->setMimeFilter( KoFilterManager::mimeFilter() );
KURL url;
- if(dialog->exec()==QDialog::Accepted) {
+ if(dialog->exec()==TQDialog::Accepted) {
url=dialog->selectedURL();
recentAction()->addURL( url );
if ( url.isLocalFile() )
@@ -616,7 +616,7 @@ void KoShellWindow::closeDocument()
bool KoShellWindow::queryClose()
{
// Save current doc and views
- QPtrList<KoView> currentViews;
+ TQPtrList<KoView> currentViews;
KoDocument * currentDoc = 0L;
bool ok = true;
if (m_activePage != m_lstPages.end())
@@ -626,12 +626,12 @@ bool KoShellWindow::queryClose()
// This one is called by slotFileQuit and by the X button.
// We have to check for unsaved docs...
- QValueList<Page>::Iterator it = m_lstPages.begin();
+ TQValueList<Page>::Iterator it = m_lstPages.begin();
for( ; it != m_lstPages.end(); ++it )
{
// This is quite a HACK
// We should ask ourselves, to get a better dialog box
- setRootDocumentDirect( (*it).m_pDoc, QPtrList<KoView>() );
+ setRootDocumentDirect( (*it).m_pDoc, TQPtrList<KoView>() );
// Test if we can close this doc
if ( !KoMainWindow::queryClose() )
{
@@ -661,13 +661,13 @@ void KoShellWindow::saveSettings()
KoShellSettings::writeConfig();
}
-QString KoShellWindow::configFile() const
+TQString KoShellWindow::configFile() const
{
//return readConfigFile( locate( "data", "koshell/koshell_shell.rc" ) );
- return QString::null; // use UI standards only for now
+ return TQString(); // use UI standards only for now
}
-void KoShellWindow::tab_contextMenu(QWidget * w,const QPoint &p)
+void KoShellWindow::tab_contextMenu(TQWidget * w,const TQPoint &p)
{
KPopupMenu menu;
KIconLoader il;
@@ -729,9 +729,9 @@ void KoShellWindow::showPartSpecificHelp()
KoShellGUIClient::KoShellGUIClient( KoShellWindow *window ) : KXMLGUIClient()
{
setXMLFile( "koshellui.rc", true, true );
- window->mnuSaveAll = new KAction( i18n("Save All"), 0, window, SLOT( saveAll() ), actionCollection(), "save_all" );
+ window->mnuSaveAll = new KAction( i18n("Save All"), 0, TQT_TQOBJECT(window), TQT_SLOT( saveAll() ), actionCollection(), "save_all" );
window->mnuSaveAll->setEnabled(false);
- window->partSpecificHelpAction = new KAction(i18n("Part Handbook"), "contents", 0, window, SLOT(showPartSpecificHelp()),
+ window->partSpecificHelpAction = new KAction(i18n("Part Handbook"), "contents", 0, TQT_TQOBJECT(window), TQT_SLOT(showPartSpecificHelp()),
actionCollection(), "partSpecificHelp");
window->partSpecificHelpAction->setEnabled(false);
}