summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/KoMainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kofficecore/KoMainWindow.cpp')
-rw-r--r--lib/kofficecore/KoMainWindow.cpp300
1 files changed, 150 insertions, 150 deletions
diff --git a/lib/kofficecore/KoMainWindow.cpp b/lib/kofficecore/KoMainWindow.cpp
index bdcfaa6a..b78677f4 100644
--- a/lib/kofficecore/KoMainWindow.cpp
+++ b/lib/kofficecore/KoMainWindow.cpp
@@ -55,7 +55,7 @@
#include <kglobalsettings.h>
#include <ksharedptr.h>
-#include <qobjectlist.h>
+#include <tqobjectlist.h>
#include <unistd.h>
#include <stdlib.h>
@@ -63,20 +63,20 @@
class KoPartManager : public KParts::PartManager
{
public:
- KoPartManager( QWidget * parent, const char * name = 0L )
- : KParts::PartManager( parent, name )
+ KoPartManager( TQWidget * tqparent, const char * name = 0L )
+ : KParts::PartManager( tqparent, name )
{
setSelectionPolicy( KParts::PartManager::TriState );
setAllowNestedParts( true );
setIgnoreScrollBars( true );
// Allow right-click on embedded objects (without activating them)
- // But beware: this means right-click on parent, from embedded object,
- // doesn't make the parent active first...
+ // But beware: this means right-click on tqparent, from embedded object,
+ // doesn't make the tqparent active first...
setActivationButtonMask( Qt::LeftButton | Qt::MidButton );
}
- virtual bool eventFilter( QObject *obj, QEvent *ev )
+ virtual bool eventFilter( TQObject *obj, TQEvent *ev )
{
- if ( !obj->isWidgetType() || ::qt_cast<KoFrame *>( obj ) )
+ if ( !obj->isWidgetType() || ::tqqt_cast<KoFrame *>( obj ) )
return false;
return KParts::PartManager::eventFilter( obj, ev );
}
@@ -135,25 +135,25 @@ public:
KoDocument *m_rootDoc;
KoDocument *m_docToOpen;
- QPtrList<KoView> m_rootViews;
+ TQPtrList<KoView> m_rootViews;
KParts::PartManager *m_manager;
KParts::Part *m_activePart;
KoView *m_activeView;
- QLabel * statusBarLabel;
+ TQLabel * statusBarLabel;
KProgress *m_progress;
- QPtrList<KAction> m_splitViewActionList;
+ TQPtrList<KAction> m_splitViewActionList;
// This additional list is needed, because we don't plug
// the first list, when an embedded view gets activated (Werner)
- QPtrList<KAction> m_veryHackyActionList;
- QSplitter *m_splitter;
+ TQPtrList<KAction> m_veryHackyActionList;
+ TQSplitter *m_splitter;
KSelectAction *m_orientation;
KAction *m_removeView;
KoMainWindowIface *m_dcopObject;
- QPtrList <KAction> m_toolbarList;
+ TQPtrList <KAction> m_toolbarList;
bool bMainWindowGUIBuilt;
bool m_splitted;
@@ -177,7 +177,7 @@ public:
bool m_isExporting;
KURL m_lastExportURL;
- QCString m_lastExportFormat;
+ TQCString m_lastExportFormat;
int m_lastExportSpecialOutputFlag;
KSharedPtr<KoSpeaker> m_koSpeaker;
@@ -192,54 +192,54 @@ KoMainWindow::KoMainWindow( KInstance *instance, const char* name )
d->m_manager = new KoPartManager( this );
- connect( d->m_manager, SIGNAL( activePartChanged( KParts::Part * ) ),
- this, SLOT( slotActivePartChanged( KParts::Part * ) ) );
+ connect( d->m_manager, TQT_SIGNAL( activePartChanged( KParts::Part * ) ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotActivePartChanged( KParts::Part * ) ) );
if ( instance )
setInstance( instance, false ); // don't load plugins! we don't want
// the part's plugins with this shell, even though we are using the
// part's instance! (Simon)
- QString doc;
- QStringList allFiles = KGlobal::dirs()->findAllResources( "data", "koffice/koffice_shell.rc" );
+ TQString doc;
+ TQStringList allFiles = KGlobal::dirs()->findAllResources( "data", "koffice/koffice_shell.rc" );
setXMLFile( findMostRecentXMLFile( allFiles, doc ) );
setLocalXMLFile( locateLocal( "data", "koffice/koffice_shell.rc" ) );
- KStdAction::openNew( this, SLOT( slotFileNew() ), actionCollection(), "file_new" );
- KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection(), "file_open" );
- m_recent = KStdAction::openRecent( this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection() );
- d->m_paSave = KStdAction::save( this, SLOT( slotFileSave() ), actionCollection(), "file_save" );
- d->m_paSaveAs = KStdAction::saveAs( this, SLOT( slotFileSaveAs() ), actionCollection(), "file_save_as" );
- d->m_paPrint = KStdAction::print( this, SLOT( slotFilePrint() ), actionCollection(), "file_print" );
- d->m_paPrintPreview = KStdAction::printPreview( this, SLOT( slotFilePrintPreview() ), actionCollection(), "file_print_preview" );
- d->m_sendfile = KStdAction::mail( this, SLOT( slotEmailFile() ), actionCollection(), "file_send_file");
+ KStdAction::openNew( TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ), actionCollection(), "file_new" );
+ KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen() ), actionCollection(), "file_open" );
+ m_recent = KStdAction::openRecent( TQT_TQOBJECT(this), TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection() );
+ d->m_paSave = KStdAction::save( TQT_TQOBJECT(this), TQT_SLOT( slotFileSave() ), actionCollection(), "file_save" );
+ d->m_paSaveAs = KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( slotFileSaveAs() ), actionCollection(), "file_save_as" );
+ d->m_paPrint = KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT( slotFilePrint() ), actionCollection(), "file_print" );
+ d->m_paPrintPreview = KStdAction::printPreview( TQT_TQOBJECT(this), TQT_SLOT( slotFilePrintPreview() ), actionCollection(), "file_print_preview" );
+ d->m_sendfile = KStdAction::mail( TQT_TQOBJECT(this), TQT_SLOT( slotEmailFile() ), actionCollection(), "file_send_file");
- d->m_paCloseFile = KStdAction::close( this, SLOT( slotFileClose() ), actionCollection(), "file_close" );
- KStdAction::quit( this, SLOT( slotFileQuit() ), actionCollection(), "file_quit" );
+ d->m_paCloseFile = KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( slotFileClose() ), actionCollection(), "file_close" );
+ KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotFileQuit() ), actionCollection(), "file_quit" );
d->m_reloadfile = new KAction( i18n( "Reload"), 0,
- this, SLOT( slotReloadFile() ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotReloadFile() ),
actionCollection(), "file_reload_file");
d->m_versionsfile = new KAction( i18n( "Versions..."), 0,
- this, SLOT( slotVersionsFile() ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotVersionsFile() ),
actionCollection(), "file_versions_file");
d->m_importFile = new KAction( i18n( "I&mport..." ), 0, // clashing accel key :(
- this, SLOT( slotImportFile() ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotImportFile() ),
actionCollection(), "file_import_file");
d->m_exportFile = new KAction( i18n( "E&xport..." ), 0,
- this, SLOT( slotExportFile() ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotExportFile() ),
actionCollection(), "file_export_file");
/* The following entry opens the document information dialog. Since the action is named so it
intends to show data this entry should not have a trailing ellipses (...). */
d->m_paDocInfo = new KAction( i18n( "&Document Information" ), "documentinfo", 0,
- this, SLOT( slotDocumentInfo() ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotDocumentInfo() ),
actionCollection(), "file_documentinfo" );
- KStdAction::keyBindings( this, SLOT( slotConfigureKeys() ), actionCollection() );
- KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars() ), actionCollection() );
+ KStdAction::keyBindings( TQT_TQOBJECT(this), TQT_SLOT( slotConfigureKeys() ), actionCollection() );
+ KStdAction::configureToolbars( TQT_TQOBJECT(this), TQT_SLOT( slotConfigureToolbars() ), actionCollection() );
d->m_paDocInfo->setEnabled( false );
d->m_paSaveAs->setEnabled( false );
@@ -253,35 +253,35 @@ KoMainWindow::KoMainWindow( KInstance *instance, const char* name )
d->m_sendfile->setEnabled( false);
d->m_paCloseFile->setEnabled( false);
- d->m_splitter=new QSplitter(Qt::Vertical, this, "mw-splitter");
+ d->m_splitter=new TQSplitter(Qt::Vertical, this, "mw-splitter");
setCentralWidget( d->m_splitter );
// Keyboard accessibility enhancements.
new KKbdAccessExtensions(this, "mw-panelSizer");
// set up the action "list" for "Close all Views" (hacky :) (Werner)
d->m_veryHackyActionList.append(
new KAction(i18n("&Close All Views"), "fileclose",
- "ctrl+shift+w", this, SLOT(slotCloseAllViews()),
+ "ctrl+shift+w", TQT_TQOBJECT(this), TQT_SLOT(slotCloseAllViews()),
actionCollection(), "view_closeallviews") );
// set up the action list for the splitter stuff
d->m_splitViewActionList.append(new KAction(i18n("&Split View"), "view_split", 0,
- this, SLOT(slotSplitView()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotSplitView()),
actionCollection(), "view_split"));
d->m_removeView=new KAction(i18n("&Remove View"), "view_remove", 0,
- this, SLOT(slotRemoveView()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotRemoveView()),
actionCollection(), "view_rm_splitter");
d->m_splitViewActionList.append(d->m_removeView);
d->m_removeView->setEnabled(false);
- d->m_orientation=new KSelectAction(i18n("Splitter &Orientation"), "view_orientation", 0,
- this, SLOT(slotSetOrientation()),
+ d->m_orientation=new KSelectAction(i18n("Splitter &Qt::Orientation"), "view_orientation", 0,
+ TQT_TQOBJECT(this), TQT_SLOT(slotSetOrientation()),
actionCollection(), "view_splitter_orientation");
- QStringList items;
+ TQStringList items;
items << i18n("&Vertical")
<< i18n("&Horizontal");
d->m_orientation->setItems(items);
d->m_orientation->setCurrentItem(static_cast<int>(d->m_splitter->orientation()));
d->m_splitViewActionList.append(d->m_orientation);
- d->m_splitViewActionList.append(new KActionSeparator(this));
+ d->m_splitViewActionList.append(new KActionSeparator(TQT_TQOBJECT(this)));
// Load list of recent files
KConfig * config = instance ? instance->config() : KGlobal::config();
@@ -322,7 +322,7 @@ KoMainWindow::~KoMainWindow()
// safety first ;)
d->m_manager->setActivePart(0);
- if(d->m_rootViews.findRef(d->m_activeView)==-1) {
+ if(d->m_rootViews.tqfindRef(d->m_activeView)==-1) {
delete d->m_activeView;
d->m_activeView=0L;
}
@@ -357,7 +357,7 @@ void KoMainWindow::setRootDocument( KoDocument *doc )
}
//kdDebug(30003) << "KoMainWindow::setRootDocument this = " << this << " doc = " << doc << endl;
- QPtrList<KoView> oldRootViews = d->m_rootViews;
+ TQPtrList<KoView> oldRootViews = d->m_rootViews;
d->m_rootViews.clear();
KoDocument *oldRootDoc = d->m_rootDoc;
@@ -375,7 +375,7 @@ void KoMainWindow::setRootDocument( KoDocument *doc )
d->m_rootViews.current()->show();
// The addShell has been done already if using openURL
- if ( !d->m_rootDoc->shells().contains( this ) )
+ if ( !d->m_rootDoc->shells().tqcontains( this ) )
d->m_rootDoc->addShell( this );
d->m_removeView->setEnabled(false);
d->m_orientation->setEnabled(false);
@@ -417,7 +417,7 @@ void KoMainWindow::updateVersionsFileAction(KoDocument *doc)
}
-void KoMainWindow::setRootDocumentDirect( KoDocument *doc, const QPtrList<KoView> & views )
+void KoMainWindow::setRootDocumentDirect( KoDocument *doc, const TQPtrList<KoView> & views )
{
d->m_rootDoc = doc;
d->m_rootViews = views;
@@ -442,10 +442,10 @@ void KoMainWindow::addRecentURL( const KURL& url )
bool ok = true;
if ( url.isLocalFile() )
{
- QString path = url.path( -1 );
- QStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" );
- for ( QStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it )
- if ( path.contains( *it ) )
+ TQString path = url.path( -1 );
+ TQStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" );
+ for ( TQStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it )
+ if ( path.tqcontains( *it ) )
ok = false; // it's in the tmp resource
if ( ok )
KRecentDocument::add(path);
@@ -492,32 +492,32 @@ void KoMainWindow::updateCaption()
{
//kdDebug(30003) << "KoMainWindow::updateCaption()" << endl;
if ( !d->m_rootDoc )
- setCaption(QString::null);
+ setCaption(TQString());
else if ( rootDocument()->isCurrent() )
{
- QString caption;
+ TQString caption;
// Get caption from document info (title(), in about page)
if ( rootDocument()->documentInfo() )
{
- KoDocumentInfoPage * page = rootDocument()->documentInfo()->page( QString::fromLatin1("about") );
+ KoDocumentInfoPage * page = rootDocument()->documentInfo()->page( TQString::tqfromLatin1("about") );
if (page)
caption = static_cast<KoDocumentInfoAbout *>(page)->title();
}
- const QString url = rootDocument()->url().prettyURL( 0, KURL::StripFileProtocol );
+ const TQString url = rootDocument()->url().prettyURL( 0, KURL::StripFileProtocol );
if ( !caption.isEmpty() && !url.isEmpty() )
- caption = QString( "%1 - %2" ).arg( caption ).arg( url );
+ caption = TQString( "%1 - %2" ).tqarg( caption ).tqarg( url );
else if ( caption.isEmpty() )
caption = url;
setCaption( caption, rootDocument()->isModified() );
if ( !rootDocument()->url().fileName(false).isEmpty() )
- d->m_paSave->setToolTip( i18n("Save as %1").arg(rootDocument()->url().fileName(false)) );
+ d->m_paSave->setToolTip( i18n("Save as %1").tqarg(rootDocument()->url().fileName(false)) );
else
d->m_paSave->setToolTip( i18n("Save") );
}
}
-void KoMainWindow::updateCaption( QString caption, bool mod )
+void KoMainWindow::updateCaption( TQString caption, bool mod )
{
//kdDebug(30003)<<"KoMainWindow::updateCaption("<<caption<<","<<mod<<")"<<endl;
setCaption( caption, mod );
@@ -530,7 +530,7 @@ KoDocument *KoMainWindow::rootDocument() const
KoView *KoMainWindow::rootView() const
{
- if(d->m_rootViews.find(d->m_activeView)!=-1)
+ if(d->m_rootViews.tqfind(d->m_activeView)!=-1)
return d->m_activeView;
return d->m_rootViews.first();
}
@@ -544,7 +544,7 @@ bool KoMainWindow::openDocument( const KURL & url )
{
if ( !KIO::NetAccess::exists(url,true,0) )
{
- KMessageBox::error(0L, i18n("The file %1 does not exist.").arg(url.url()) );
+ KMessageBox::error(0L, i18n("The file %1 does not exist.").tqarg(url.url()) );
m_recent->removeURL(url); //remove the file from the recent-opened-file-list
saveRecentFiles();
return false;
@@ -564,7 +564,7 @@ bool KoMainWindow::openDocument( KoDocument *newdoc, const KURL & url )
setRootDocument( newdoc );
newdoc->setURL(url);
- QString mime = KMimeType::findByURL(url)->name();
+ TQString mime = KMimeType::findByURL(url)->name();
if ( mime.isEmpty() || mime == KMimeType::defaultMimeType() )
mime = newdoc->nativeFormatMimeType();
if ( url.isLocalFile() ) // workaround for kde<=3.3 kparts bug, fixed for 3.4
@@ -587,9 +587,9 @@ bool KoMainWindow::openDocumentInternal( const KURL & url, KoDocument *newdoc )
return false;
d->m_firstTime=true;
- connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- connect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted()));
- connect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & )));
+ connect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
+ connect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted()));
+ connect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & )));
newdoc->addShell( this ); // used by openURL
bool openRet = (!isImporting ()) ? newdoc->openURL(url) : newdoc->import(url);
if(!openRet)
@@ -630,12 +630,12 @@ void KoMainWindow::slotLoadCompleted()
// We had no document, set the new one
setRootDocument( newdoc );
}
- disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted()));
- disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & )));
+ disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
+ disconnect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted()));
+ disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & )));
}
-void KoMainWindow::slotLoadCanceled( const QString & errMsg )
+void KoMainWindow::slotLoadCanceled( const TQString & errMsg )
{
kdDebug(30003) << "KoMainWindow::slotLoadCanceled" << endl;
if ( !errMsg.isEmpty() ) // empty when canceled by user
@@ -643,15 +643,15 @@ void KoMainWindow::slotLoadCanceled( const QString & errMsg )
// ... can't delete the document, it's the one who emitted the signal...
KoDocument* newdoc = (KoDocument *)(sender());
- disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted()));
- disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & )));
+ disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
+ disconnect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted()));
+ disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & )));
newdoc->removeShell(this);
delete newdoc;
}
-void KoMainWindow::slotSaveCanceled( const QString &errMsg )
+void KoMainWindow::slotSaveCanceled( const TQString &errMsg )
{
kdDebug(30003) << "KoMainWindow::slotSaveCanceled" << endl;
if ( !errMsg.isEmpty() ) // empty when canceled by user
@@ -663,21 +663,21 @@ void KoMainWindow::slotSaveCompleted()
{
kdDebug(30003) << "KoMainWindow::slotSaveCompleted" << endl;
KoDocument* pDoc = (KoDocument *)(sender());
- disconnect(pDoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- disconnect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted()));
- disconnect(pDoc, SIGNAL(canceled( const QString & )),
- this, SLOT(slotSaveCanceled( const QString & )));
+ disconnect(pDoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
+ disconnect(pDoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotSaveCompleted()));
+ disconnect(pDoc, TQT_SIGNAL(canceled( const TQString & )),
+ TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanceled( const TQString & )));
}
// returns true if we should save, false otherwise.
-bool KoMainWindow::exportConfirmation( const QCString &outputFormat )
+bool KoMainWindow::exportConfirmation( const TQCString &outputFormat )
{
if (!rootDocument()->wantExportConfirmation()) return true;
KMimeType::Ptr mime = KMimeType::mimeType( outputFormat );
const bool neverHeardOfIt = ( mime->name() == KMimeType::defaultMimeType() );
- QString comment = neverHeardOfIt ?
- i18n( "%1 (unknown file type)" ).arg( outputFormat )
+ TQString comment = neverHeardOfIt ?
+ i18n( "%1 (unknown file type)" ).tqarg( outputFormat.data() )
: mime->comment();
// Warn the user
@@ -689,7 +689,7 @@ bool KoMainWindow::exportConfirmation( const QCString &outputFormat )
this,
i18n( "<qt>Saving as a %1 may result in some loss of formatting."
"<p>Do you still want to save in this format?</qt>" )
- .arg( QString( "<b>%1</b>" ).arg( comment ) ), // in case we want to remove the bold later
+ .tqarg( TQString( "<b>%1</b>" ).tqarg( comment ) ), // in case we want to remove the bold later
i18n( "Confirm Save" ),
KStdGuiItem::save (),
"NonNativeSaveConfirmation",
@@ -703,7 +703,7 @@ bool KoMainWindow::exportConfirmation( const QCString &outputFormat )
this,
i18n( "<qt>Exporting as a %1 may result in some loss of formatting."
"<p>Do you still want to export to this format?</qt>" )
- .arg( QString( "<b>%1</b>" ).arg( comment ) ), // in case we want to remove the bold later
+ .tqarg( TQString( "<b>%1</b>" ).tqarg( comment ) ), // in case we want to remove the bold later
i18n( "Confirm Export" ),
i18n ("Export"),
"NonNativeExportConfirmation", // different to the one used for Save (above)
@@ -730,20 +730,20 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
else
reset_url = false;
- connect(pDoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- connect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted()));
- connect(pDoc, SIGNAL(canceled( const QString & )),
- this, SLOT(slotSaveCanceled( const QString & )));
+ connect(pDoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
+ connect(pDoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotSaveCompleted()));
+ connect(pDoc, TQT_SIGNAL(canceled( const TQString & )),
+ TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanceled( const TQString & )));
KURL oldURL = pDoc->url();
- QString oldFile = pDoc->file();
- QCString _native_format = pDoc->nativeFormatMimeType();
- QCString oldOutputFormat = pDoc->outputMimeType();
+ TQString oldFile = pDoc->file();
+ TQCString _native_format = pDoc->nativeFormatMimeType();
+ TQCString oldOutputFormat = pDoc->outputMimeType();
int oldSpecialOutputFlag = pDoc->specialOutputFlag();
KURL suggestedURL = pDoc->url();
- QStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export, pDoc->extraNativeMimeTypes() );
- if (mimeFilter.findIndex (oldOutputFormat) < 0 && !isExporting())
+ TQStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export, pDoc->extraNativeMimeTypes() );
+ if (mimeFilter.tqfindIndex (oldOutputFormat) < 0 && !isExporting())
{
kdDebug(30003) << "KoMainWindow::saveDocument no export filter for '" << oldOutputFormat << "'" << endl;
@@ -751,13 +751,13 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
// dialog and then tries to just plain Save ---
// suggest a different filename extension (yes, we fortunately don't all live in a world of magic :))
- QString suggestedFilename = suggestedURL.fileName ();
+ TQString suggestedFilename = suggestedURL.fileName ();
if ( !suggestedFilename.isEmpty () ) // ".kwd" looks strange for a name
{
- int c = suggestedFilename.findRev ('.');
+ int c = suggestedFilename.tqfindRev ('.');
KMimeType::Ptr mime = KMimeType::mimeType( _native_format );
- QString ext = mime->property( "X-KDE-NativeExtension" ).toString();
+ TQString ext = mime->property( "X-KDE-NativeExtension" ).toString();
if (!ext.isEmpty ())
{
if (c < 0)
@@ -790,7 +790,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
bool justChangingFilterOptions = false;
KoFileDialog *dialog = new KoFileDialog( (isExporting() && !d->m_lastExportURL.isEmpty() )? d->m_lastExportURL.url () : suggestedURL.url (),
- QString::null, this, "file dialog", true);
+ TQString(), this, "file dialog", true);
if (!isExporting())
dialog->setCaption( i18n("Save Document As") );
@@ -805,12 +805,12 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
pDoc->supportedSpecialFormats() );
KURL newURL;
- QCString outputFormat = _native_format;
+ TQCString outputFormat = _native_format;
int specialOutputFlag = 0;
bool bOk;
do {
bOk=true;
- if(dialog->exec()==QDialog::Accepted) {
+ if(dialog->exec()==TQDialog::Accepted) {
newURL=dialog->selectedURL();
outputFormat=dialog->currentMimeFilter().latin1();
specialOutputFlag = dialog->specialEntrySelected();
@@ -839,7 +839,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
// adjust URL before doing checks on whether the file exists.
if ( specialOutputFlag == KoDocument::SaveAsDirectoryStore ) {
- QString fileName = newURL.fileName();
+ TQString fileName = newURL.fileName();
if ( fileName != "content.xml" ) {
newURL.addPath( "content.xml" );
}
@@ -884,7 +884,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
// (not Save As) they won't be expecting that they are
// using their File/Export settings
//
- // As a bad side-effect of this, the modified flag will not
+ // As a bad side-effect of TQT_TQOBJECT(this), the modified flag will not
// be updated and it is possible that what is currently on
// their screen is not what is stored on disk (through loss
// of formatting). But if you are dumb enough to change
@@ -979,7 +979,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent )
return ret;
}
-void KoMainWindow::closeEvent(QCloseEvent *e) {
+void KoMainWindow::closeEvent(TQCloseEvent *e) {
if(queryClose()) {
saveWindowSettings();
setRootDocument(0L);
@@ -1004,7 +1004,7 @@ void KoMainWindow::saveWindowSettings()
}
}
-void KoMainWindow::resizeEvent( QResizeEvent * e )
+void KoMainWindow::resizeEvent( TQResizeEvent * e )
{
d->m_windowSizeDirty = true;
KParts::MainWindow::resizeEvent( e );
@@ -1027,7 +1027,7 @@ bool KoMainWindow::queryClose()
// main doc + internally stored child documents
if ( d->m_rootDoc->isModified() )
{
- QString name;
+ TQString name;
if ( rootDocument()->documentInfo() )
{
name = rootDocument()->documentInfo()->title();
@@ -1039,8 +1039,8 @@ bool KoMainWindow::queryClose()
name = i18n( "Untitled" );
int res = KMessageBox::warningYesNoCancel( this,
- i18n( "<p>The document <b>'%1'</b> has been modified.</p><p>Do you want to save it?</p>" ).arg(name),
- QString::null,
+ i18n( "<p>The document <b>'%1'</b> has been modified.</p><p>Do you want to save it?</p>" ).tqarg(name),
+ TQString(),
KStdGuiItem::save(),
KStdGuiItem::discard());
@@ -1079,8 +1079,8 @@ void KoMainWindow::chooseNewDocument( int /*KoDocument::InitDocFlags*/ initDocFl
return;
//FIXME: This needs to be handled differently
- connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
- disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int)));
+ connect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
+ disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int)));
if ( ( !doc && ( initDocFlags == KoDocument::InitDocFileNew ) ) || ( doc && !doc->isEmpty() ) )
{
@@ -1108,18 +1108,18 @@ void KoMainWindow::slotFileNew()
void KoMainWindow::slotFileOpen()
{
- KFileDialog *dialog = new KFileDialog(":OpenDialog", QString::null, this, "file dialog", true);
+ KFileDialog *dialog = new KFileDialog(":OpenDialog", TQString(), this, "file dialog", true);
if (!isImporting())
dialog->setCaption( i18n("Open Document") );
else
dialog->setCaption( i18n("Import Document") );
// The few lines below need to be kept in sync with KoTemplateChooseDia::setupFileDialog
- const QStringList mimeFilter = KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(),
+ const TQStringList mimeFilter = KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(),
KoFilterManager::Import,
KoDocument::readExtraNativeMimeTypes() );
dialog->setMimeFilter( mimeFilter );
- if(dialog->exec()!=QDialog::Accepted) {
+ if(dialog->exec()!=TQDialog::Accepted) {
delete dialog;
return;
}
@@ -1194,14 +1194,14 @@ void KoMainWindow::print(bool quick) {
return;
}
- KPrinter printer( true /*, QPrinter::HighResolution*/ );
- QString title = rootView()->koDocument()->documentInfo()->title();
- QString fileName = rootView()->koDocument()->url().fileName();
+ KPrinter printer( true /*, TQPrinter::HighResolution*/ );
+ TQString title = rootView()->koDocument()->documentInfo()->title();
+ TQString fileName = rootView()->koDocument()->url().fileName();
// strip off the native extension (I don't want foobar.kwd.ps when printing into a file)
KMimeType::Ptr mime = KMimeType::mimeType( rootView()->koDocument()->outputMimeType() );
if ( mime ) {
- QString extension = mime->property( "X-KDE-NativeExtension" ).toString();
+ TQString extension = mime->property( "X-KDE-NativeExtension" ).toString();
if ( fileName.endsWith( extension ) )
fileName.truncate( fileName.length() - extension.length() );
@@ -1211,8 +1211,8 @@ void KoMainWindow::print(bool quick) {
title = fileName;
if ( title.isEmpty() ) {
// #139905 - breaks message freeze though
- //const QString programName = instance()->aboutData() ? instance()->aboutData()->programName() : instance()->instanceName();
- //title = i18n("%1 unsaved document (%2)").arg(programName).arg(KGlobal::locale()->formatDate(QDate::currentDate(), true/*short*/));
+ //const TQString programName = instance()->aboutData() ? instance()->aboutData()->programName() : instance()->instanceName();
+ //title = i18n("%1 unsaved document (%2)").tqarg(programName).tqarg(KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), true/*short*/));
}
printer.setDocName( title );
printer.setDocFileName( fileName );
@@ -1249,13 +1249,13 @@ void KoMainWindow::slotFilePrintPreview()
printer.setPreviewOnly( true );
rootView()->setupPrinter( printer );
- QString oldFileName = printer.outputFileName();
+ TQString oldFileName = printer.outputFileName();
printer.setOutputFileName( tmpFile.name() );
int oldNumCopies = printer.numCopies();
printer.setNumCopies( 1 );
// Disable kdeprint's own preview, we'd get two. This shows that KPrinter needs
// a "don't use the previous settings" mode. The current way is really too much of a hack.
- QString oldKDEPreview = printer.option( "kde-preview" );
+ TQString oldKDEPreview = printer.option( "kde-preview" );
printer.setOption( "kde-preview", "0" );
rootView()->print(printer);
@@ -1277,7 +1277,7 @@ void KoMainWindow::slotConfigureToolbars()
if (rootDocument())
saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() );
KEditToolbar edit(factory(), this);
- connect(&edit,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig()));
+ connect(&edit,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(slotNewToolbarConfig()));
(void) edit.exec();
}
@@ -1296,7 +1296,7 @@ void KoMainWindow::slotNewToolbarConfig()
d->m_veryHackyActionList);
// This one only for root views
- if(d->m_rootViews.findRef(d->m_activeView)!=-1)
+ if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1)
factory->plugActionList(d->m_activeView, "view_split",
d->m_splitViewActionList );
plugActionList( "toolbarlist", d->m_toolbarList );
@@ -1306,7 +1306,7 @@ void KoMainWindow::slotToolbarToggled( bool toggle )
{
//kdDebug(30003) << "KoMainWindow::slotToolbarToggled " << sender()->name() << " toggle=" << true << endl;
// The action (sender) and the toolbar have the same name
- KToolBar * bar = toolBar( sender()->name() );
+ KToolBar * bar = toolBar( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() );
if (bar)
{
if (toggle)
@@ -1318,18 +1318,18 @@ void KoMainWindow::slotToolbarToggled( bool toggle )
saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() );
}
else
- kdWarning(30003) << "slotToolbarToggled : Toolbar " << sender()->name() << " not found!" << endl;
+ kdWarning(30003) << "slotToolbarToggled : Toolbar " << TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() << " not found!" << endl;
}
bool KoMainWindow::toolbarIsVisible(const char *tbName)
{
- QWidget *tb = toolBar( tbName);
+ TQWidget *tb = toolBar( tbName);
return !tb->isHidden();
}
void KoMainWindow::showToolbar( const char * tbName, bool shown )
{
- QWidget * tb = toolBar( tbName );
+ TQWidget * tb = toolBar( tbName );
if ( !tb )
{
kdWarning(30003) << "KoMainWindow: toolbar " << tbName << " not found." << endl;
@@ -1341,7 +1341,7 @@ void KoMainWindow::showToolbar( const char * tbName, bool shown )
tb->hide();
// Update the action appropriately
- QPtrListIterator<KAction> it( d->m_toolbarList );
+ TQPtrListIterator<KAction> it( d->m_toolbarList );
for ( ; it.current() ; ++it )
if ( !strcmp( it.current()->name(), tbName ) )
{
@@ -1370,7 +1370,7 @@ void KoMainWindow::slotCloseAllViews() {
if(d->m_rootDoc && d->m_rootDoc->isEmbedded()) {
hide();
d->m_rootDoc->removeShell(this);
- QPtrListIterator<KoMainWindow> it(d->m_rootDoc->shells());
+ TQPtrListIterator<KoMainWindow> it(d->m_rootDoc->shells());
while (it.current()) {
it.current()->hide();
delete it.current(); // this updates the lists' current pointer and thus
@@ -1388,7 +1388,7 @@ void KoMainWindow::slotCloseAllViews() {
void KoMainWindow::slotRemoveView() {
KoView *view;
- if(d->m_rootViews.findRef(d->m_activeView)!=-1)
+ if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1)
view=d->m_rootViews.current();
else
view=d->m_rootViews.first();
@@ -1435,10 +1435,10 @@ void KoMainWindow::slotProgress(int value) {
{
// The statusbar might not even be created yet.
// So check for that first, and create it if necessary
- QObjectList *l = queryList( "QStatusBar" );
+ TQObjectList *l = queryList( "TQStatusBar" );
if ( !l || !l->first() ) {
statusBar()->show();
- QApplication::sendPostedEvents( this, QEvent::ChildInserted );
+ TQApplication::sendPostedEvents( TQT_TQOBJECT(this), TQEvent::ChildInserted );
setUpLayout();
}
delete l;
@@ -1467,7 +1467,7 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart )
// This looks very much like KParts::MainWindow::createGUI, but we have
// to reimplement it because it works with an active part, whereas we work
// with an active view _and_ an active part, depending for what.
- // Both are KXMLGUIClients, but e.g. the plugin query needs a QObject.
+ // Both are KXMLGUIClients, but e.g. the plugin query needs a TQObject.
//kdDebug(30003) << "KoMainWindow::slotActivePartChanged( Part * newPart) newPart = " << newPart << endl;
//kdDebug(30003) << "current active part is " << d->m_activePart << endl;
@@ -1484,8 +1484,8 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart )
if ( d->m_activeView )
{
KParts::GUIActivateEvent ev( false );
- QApplication::sendEvent( d->m_activePart, &ev );
- QApplication::sendEvent( d->m_activeView, &ev );
+ TQApplication::sendEvent( d->m_activePart, &ev );
+ TQApplication::sendEvent( d->m_activeView, &ev );
factory->removeClient( d->m_activeView );
@@ -1497,7 +1497,7 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart )
if ( !d->bMainWindowGUIBuilt )
{
// Load mainwindow plugins
- KParts::Plugin::loadPlugins( this, this, instance(), true );
+ KParts::Plugin::loadPlugins( TQT_TQOBJECT(this), this, instance(), true );
createShellGUI();
}
@@ -1514,25 +1514,25 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart )
factory->plugActionList(d->m_activeView, "view_closeallviews",
d->m_veryHackyActionList);
// This one only for root views
- if(d->m_rootViews.findRef(d->m_activeView)!=-1)
+ if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1)
factory->plugActionList(d->m_activeView, "view_split", d->m_splitViewActionList );
// Position and show toolbars according to user's preference
setAutoSaveSettings( newPart->instance()->instanceName(), false );
// Create and plug toolbar list for Settings menu
- //QPtrListIterator<KToolBar> it = toolBarIterator();
- QPtrList<QWidget> toolBarList = factory->containers( "ToolBar" );
- QPtrListIterator<QWidget> it( toolBarList );
+ //TQPtrListIterator<KToolBar> it = toolBarIterator();
+ TQPtrList<TQWidget> toolBarList = factory->containers( "ToolBar" );
+ TQPtrListIterator<TQWidget> it( toolBarList );
for ( ; it.current() ; ++it )
{
if ( it.current()->inherits("KToolBar") )
{
KToolBar * tb = static_cast<KToolBar *>(it.current());
- KToggleAction * act = new KToggleAction( i18n("Show %1 Toolbar").arg( tb->text() ), 0,
+ KToggleAction * act = new KToggleAction( i18n("Show %1 Toolbar").tqarg( tb->text() ), 0,
actionCollection(), tb->name() );
- act->setCheckedState(i18n("Hide %1 Toolbar").arg( tb->text() ));
- connect( act, SIGNAL( toggled( bool ) ), this, SLOT( slotToolbarToggled( bool ) ) );
+ act->setCheckedState(i18n("Hide %1 Toolbar").tqarg( tb->text() ));
+ connect( act, TQT_SIGNAL( toggled( bool ) ), TQT_TQOBJECT(this), TQT_SLOT( slotToolbarToggled( bool ) ) );
act->setChecked ( !tb->isHidden() );
d->m_toolbarList.append( act );
}
@@ -1544,8 +1544,8 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart )
// Send the GUIActivateEvent only now, since it might show/hide toolbars too
// (and this has priority over applyMainWindowSettings)
KParts::GUIActivateEvent ev( true );
- QApplication::sendEvent( d->m_activePart, &ev );
- QApplication::sendEvent( d->m_activeView, &ev );
+ TQApplication::sendEvent( d->m_activePart, &ev );
+ TQApplication::sendEvent( d->m_activeView, &ev );
}
else
{
@@ -1555,11 +1555,11 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart )
setUpdatesEnabled( true );
}
-QLabel * KoMainWindow::statusBarLabel()
+TQLabel * KoMainWindow::statusBarLabel()
{
if ( !d->statusBarLabel )
{
- d->statusBarLabel = new QLabel( statusBar() );
+ d->statusBarLabel = new TQLabel( statusBar() );
statusBar()->addWidget( d->statusBarLabel, 1, true );
}
return d->statusBarLabel;
@@ -1588,16 +1588,16 @@ void KoMainWindow::slotEmailFile()
// Subject = Document file name
// Attachment = The current file
// Message Body = The current document in HTML export? <-- This may be an option.
- QString theSubject;
- QStringList urls;
- QString fileURL;
+ TQString theSubject;
+ TQStringList urls;
+ TQString fileURL;
if (rootDocument()->url ().isEmpty () ||
rootDocument()->isModified())
{
//Save the file as a temporary file
bool const tmp_modified = rootDocument()->isModified();
KURL const tmp_url = rootDocument()->url();
- QCString const tmp_mimetype = rootDocument()->outputMimeType();
+ TQCString const tmp_mimetype = rootDocument()->outputMimeType();
KTempFile tmpfile; //TODO: The temorary file should be deleted when the mail program is closed
KURL u;
u.setPath(tmpfile.name());
@@ -1618,7 +1618,7 @@ void KoMainWindow::slotEmailFile()
else
{
fileURL = rootDocument()->url().url();
- theSubject = i18n("Document - %1").arg(rootDocument()->url().fileName(false));
+ theSubject = i18n("Document - %1").tqarg(rootDocument()->url().fileName(false));
urls.append( fileURL );
}
@@ -1626,9 +1626,9 @@ void KoMainWindow::slotEmailFile()
if (!fileURL.isEmpty())
{
- kapp->invokeMailer(QString::null, QString::null, QString::null, theSubject,
- QString::null, //body
- QString::null,
+ kapp->invokeMailer(TQString(), TQString(), TQString(), theSubject,
+ TQString(), //body
+ TQString(),
urls); // attachments
}
}