summaryrefslogtreecommitdiffstats
path: root/src/kchmmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kchmmainwindow.cpp')
-rw-r--r--src/kchmmainwindow.cpp328
1 files changed, 164 insertions, 164 deletions
diff --git a/src/kchmmainwindow.cpp b/src/kchmmainwindow.cpp
index 13417f1..9246961 100644
--- a/src/kchmmainwindow.cpp
+++ b/src/kchmmainwindow.cpp
@@ -28,8 +28,8 @@
#include "kde-qt.h"
-#include <qaccel.h>
-#include <qevent.h>
+#include <tqaccel.h>
+#include <tqevent.h>
#include "libchmfile.h"
#include "libchmfileimpl.h"
@@ -82,9 +82,9 @@ KCHMMainWindow::KCHMMainWindow()
m_currentSettings = new KCHMSettings;
- // Create the initial layout - a splitter with tab window in left, and text browser in right
- m_windowSplitter = new QSplitter(this);
- m_tabWidget = new KQTabWidget( m_windowSplitter );
+ // Create the initial tqlayout - a splitter with tab window in left, and text browser in right
+ m_windowSplitter = new TQSplitter(this);
+ m_tabWidget = new KTQTabWidget( m_windowSplitter );
m_viewWindowMgr = new KCHMViewWindowMgr( m_windowSplitter );
m_bookmarkWindow = new KCHMBookmarkWindow (m_tabWidget);
@@ -96,7 +96,7 @@ KCHMMainWindow::KCHMMainWindow()
setCentralWidget( m_windowSplitter );
- QValueList<int> sizes;
+ TQValueList<int> sizes;
sizes.push_back (SPLT_X_SIZE);
sizes.push_back (WND_X_SIZE - SPLT_X_SIZE);
m_windowSplitter->setSizes (sizes);
@@ -108,13 +108,13 @@ KCHMMainWindow::KCHMMainWindow()
m_useShortAutotest = false;
#endif /* defined (ENABLE_AUTOTEST_SUPPORT) */
- QAccel * accel = new QAccel( this );
- accel->connectItem ( accel->insertItem ( Key_F11 ), this, SLOT ( slotToggleFullScreenMode() ) );
- accel->connectItem ( accel->insertItem ( CTRL + Key_1), this, SLOT ( slotActivateContentTab() ) );
- accel->connectItem ( accel->insertItem ( CTRL + Key_2), this, SLOT ( slotActivateIndexTab() ) );
- accel->connectItem ( accel->insertItem ( CTRL + Key_3), this, SLOT ( slotActivateSearchTab() ) );
- accel->connectItem ( accel->insertItem ( CTRL + Key_4), this, SLOT ( slotActivateBookmarkTab() ) );
- accel->connectItem ( accel->insertItem ( Key_F3 ), m_searchToolbar, SLOT ( onBtnNextSearchResult() ) );
+ TQAccel * accel = new TQAccel( this );
+ accel->connectItem ( accel->insertItem ( Key_F11 ), this, TQT_SLOT ( slotToggleFullScreenMode() ) );
+ accel->connectItem ( accel->insertItem ( CTRL + Key_1), this, TQT_SLOT ( slotActivateContentTab() ) );
+ accel->connectItem ( accel->insertItem ( CTRL + Key_2), this, TQT_SLOT ( slotActivateIndexTab() ) );
+ accel->connectItem ( accel->insertItem ( CTRL + Key_3), this, TQT_SLOT ( slotActivateSearchTab() ) );
+ accel->connectItem ( accel->insertItem ( CTRL + Key_4), this, TQT_SLOT ( slotActivateBookmarkTab() ) );
+ accel->connectItem ( accel->insertItem ( Key_F3 ), m_searchToolbar, TQT_SLOT ( onBtnNextSearchResult() ) );
statusBar()->show();
setIcon( *gIconStorage.getApplicationIcon() );
@@ -136,9 +136,9 @@ KCHMMainWindow::~KCHMMainWindow()
void KCHMMainWindow::slotOpenMenuItemActivated()
{
#if defined (USE_KDE)
- QString fn = KFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("*.chm|Compressed Help Manual (*.chm)"), this);
+ TQString fn = KFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("*.chm|Compressed Help Manual (*.chm)"), this);
#else
- QString fn = QFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("Compressed Help Manual (*.chm)"), this);
+ TQString fn = TQFileDialog::getOpenFileName( appConfig.m_lastOpenedDir, i18n("Compressed Help Manual (*.chm)"), this);
#endif
if ( !fn.isEmpty() )
@@ -153,7 +153,7 @@ void KCHMMainWindow::slotOpenMenuItemActivated()
}
-bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page )
+bool KCHMMainWindow::loadChmFile ( const TQString &fileName, bool call_open_page )
{
LCHMFile * new_chmfile = new LCHMFile();
@@ -172,12 +172,12 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
showInStatusBar( tr("Detected chm file charset: %1") . arg(m_chmFile->currentEncoding()->language) );
// Make the file name absolute; we'll need it later
- QDir qd;
+ TQDir qd;
qd.setPath (fileName);
m_chmFilename = qd.absPath();
- // Qt's 'dirname' does not work well
- QFileInfo qf ( m_chmFilename );
+ // TQt's 'dirname' does not work well
+ TQFileInfo qf ( m_chmFilename );
appConfig.m_lastOpenedDir = qf.dirPath(true);
// Order the tabulations
@@ -202,9 +202,9 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
showOrHideIndexWindow( m_tabIndexPage );
showOrHideSearchWindow( m_tabSearchPage );
- m_bookmarkWindow->invalidate();
- m_navToolbar->updateIconStatus( false, false );
- m_viewWindowMgr->invalidate();
+ m_bookmarkWindow->tqinvalidate();
+ m_navToolbar->updateIcontqStatus( false, false );
+ m_viewWindowMgr->tqinvalidate();
refreshCurrentBrowser();
if ( m_currentSettings->loadSettings (fileName) )
@@ -232,7 +232,7 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
}
// Restore the main window size
- QValueList<int> sizes;
+ TQValueList<int> sizes;
sizes.push_back( m_currentSettings->m_window_size_splitter );
sizes.push_back( m_currentSettings->m_window_size_x - m_currentSettings->m_window_size_splitter );
@@ -255,17 +255,17 @@ bool KCHMMainWindow::loadChmFile ( const QString &fileName, bool call_open_page
}
else
{
- QMessageBox mbox(
+ TQMessageBox mbox(
i18n("%1 - failed to load the chm file") . arg(APP_NAME),
i18n("Unable to load the chm file %1") . arg(fileName),
- QMessageBox::Critical,
- QMessageBox::Ok,
- QMessageBox::NoButton,
- QMessageBox::NoButton);
+ TQMessageBox::Critical,
+ TQMessageBox::Ok,
+ TQMessageBox::NoButton,
+ TQMessageBox::NoButton);
mbox.exec();
statusBar()->message(
- i18n("Could not load file %1").arg(fileName),
+ i18n("Could not load file %1").tqarg(fileName),
2000 );
delete new_chmfile;
return false;
@@ -281,44 +281,44 @@ void KCHMMainWindow::slotPrintMenuItemActivated()
void KCHMMainWindow::slotAboutMenuItemActivated()
{
- QString caption = i18n( "About %1" ) . arg(APP_NAME);
- QString text = m_aboutDlgMenuText;
+ TQString caption = i18n( "About %1" ) . arg(APP_NAME);
+ TQString text = m_aboutDlgMenuText;
// It is quite funny that the argument order differs
#if defined (USE_KDE)
KMessageBox::about( this, text, caption );
#else
- QMessageBox::about( this, caption, text );
+ TQMessageBox::about( this, caption, text );
#endif
}
void KCHMMainWindow::slotAboutQtMenuItemActivated()
{
- QMessageBox::aboutQt( this, APP_NAME);
+ TQMessageBox::aboutTQt( this, APP_NAME);
}
void KCHMMainWindow::refreshCurrentBrowser( )
{
- QString title = m_chmFile->title();
+ TQString title = m_chmFile->title();
if ( !title )
title = APP_NAME;
// KDE adds application name automatically, so we don't need it here
#if !defined (USE_KDE)
else
- title = (QString) APP_NAME + " - " + title;
+ title = (TQString) APP_NAME + " - " + title;
#endif
setCaption ( title );
- currentBrowser()->invalidate();
+ currentBrowser()->tqinvalidate();
if ( m_contentsWindow )
m_contentsWindow->refillTableOfContents();
}
-void KCHMMainWindow::slotOnTreeClicked( QListViewItem * item )
+void KCHMMainWindow::slotOnTreeClicked( TQListViewItem * item )
{
bool unused;
@@ -330,7 +330,7 @@ void KCHMMainWindow::slotOnTreeClicked( QListViewItem * item )
}
-void KCHMMainWindow::slotLinkClicked ( const QString & link, bool& follow_link )
+void KCHMMainWindow::slotLinkClicked ( const TQString & link, bool& follow_link )
{
if ( link.isEmpty() )
return;
@@ -351,9 +351,9 @@ void KCHMMainWindow::slotLinkClicked ( const QString & link, bool& follow_link )
}
-bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
+bool KCHMMainWindow::openPage( const TQString & srcurl, unsigned int flags )
{
- QString p1, p2, url = srcurl;
+ TQString p1, p2, url = srcurl;
if ( url == "/" )
url = m_chmFile->homeUrl();
@@ -366,11 +366,11 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
break;
case KCHMConfig::ACTION_ASK_USER:
- if ( QMessageBox::question(this,
+ if ( TQMessageBox::question(this,
i18n("%1 - remote link clicked - %2") . arg(APP_NAME) . arg(p1),
- i18n("A remote link %1 will start the external program to open it.\n\nDo you want to continue?").arg( url ),
+ i18n("A remote link %1 will start the external program to open it.\n\nDo you want to continue?").tqarg( url ),
i18n("&Yes"), i18n("&No"),
- QString::null, 0, 1 ) )
+ TQString(), 0, 1 ) )
return false;
// no break! should continue to open.
@@ -380,7 +380,7 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
#if defined (USE_KDE)
new KRun ( url );
#else
- run_process( appConfig.m_QtBrowserPath, url );
+ run_process( appConfig.m_TQtBrowserPath, url );
#endif
}
break;
@@ -389,10 +389,10 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
return false; // do not change the current page.
}
- // Filter the URLs which do not need to be opened at all by Qt version
+ // Filter the URLs which do not need to be opened at all by TQt version
if ( LCHMUrlFactory::isJavascriptURL (url) )
{
- QMessageBox::information( this,
+ TQMessageBox::information( this,
i18n( "%1 - JavsScript link clicked") . arg(APP_NAME),
i18n( "You have clicked a JavaScript link.\nTo prevent security-related issues JavaScript URLs are disabled in CHM files.") );
@@ -401,23 +401,23 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
if ( LCHMUrlFactory::isNewChmURL (url, p1, p2) && p1 != m_chmFilename )
{
- if ( QMessageBox::question( this,
+ if ( TQMessageBox::question( this,
i18n( "%1 - link to a new CHM file clicked"). arg(APP_NAME),
- i18n( "You have clicked a link, which leads to a new CHM file %1.\nThe current file will be closed.\n\nDo you want to continue?").arg( p1 ),
+ i18n( "You have clicked a link, which leads to a new CHM file %1.\nThe current file will be closed.\n\nDo you want to continue?").tqarg( p1 ),
i18n( "&Yes" ), i18n( "&No" ),
- QString::null, 0, 1 ) )
+ TQString(), 0, 1 ) )
return false;
// Because chm file always contain relative link, and current filename is not changed,
// we need to form a new path
- QFileInfo qfi( m_chmFilename );
- QString newfilename = qfi.dirPath(true) + "/" + p1;
+ TQFileInfo qfi( m_chmFilename );
+ TQString newfilename = qfi.dirPath(true) + "/" + p1;
- QStringList event_args;
+ TQStringList event_args;
event_args.push_back( newfilename );
event_args.push_back( p2 ); // url
- qApp->postEvent( this, new KCHMUserEvent( "loadAndOpen", event_args ) );
+ tqApp->postEvent( this, new KCHMUserEvent( "loadAndOpen", event_args ) );
return false;
}
@@ -427,7 +427,7 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
// Store current page and position to add it to history if we change it
int hist_scrollpos = currentBrowser()->getScrollbarPosition();
- QString hist_url = currentBrowser()->getOpenedPage();
+ TQString hist_url = currentBrowser()->getOpenedPage();
if ( vwnd->openUrl (url) )
{
@@ -443,7 +443,7 @@ bool KCHMMainWindow::openPage( const QString & srcurl, unsigned int flags )
}
-void KCHMMainWindow::showEvent( QShowEvent * )
+void KCHMMainWindow::showEvent( TQShowEvent * )
{
if ( !m_FirstTimeShow )
return;
@@ -465,61 +465,61 @@ void KCHMMainWindow::showEvent( QShowEvent * )
void KCHMMainWindow::setupToolbarsAndMenu( )
{
// Create a 'file' toolbar
- QToolBar * toolbar = new QToolBar(this);
+ TQToolBar * toolbar = new TQToolBar(this);
toolbar->setLabel( i18n( "File Operations") );
- QPixmap iconFileOpen (*gIconStorage.getToolbarPixmap(KCHMIconStorage::fileopen));
- QToolButton * fileOpen = new QToolButton (iconFileOpen,
+ TQPixmap iconFileOpen (*gIconStorage.getToolbarPixmap(KCHMIconStorage::fileopen));
+ TQToolButton * fileOpen = new TQToolButton (iconFileOpen,
i18n( "Open File" ),
- QString::null,
+ TQString(),
this,
- SLOT( slotOpenMenuItemActivated() ),
+ TQT_SLOT( slotOpenMenuItemActivated() ),
toolbar);
- QString fileOpenText = i18n( "Click this button to open an existing chm file." );
- QWhatsThis::add( fileOpen, fileOpenText );
+ TQString fileOpenText = i18n( "Click this button to open an existing chm file." );
+ TQWhatsThis::add( fileOpen, fileOpenText );
- QPixmap iconFilePrint (*gIconStorage.getToolbarPixmap(KCHMIconStorage::print));
- QToolButton * filePrint = new QToolButton (iconFilePrint,
+ TQPixmap iconFilePrint (*gIconStorage.getToolbarPixmap(KCHMIconStorage::print));
+ TQToolButton * filePrint = new TQToolButton (iconFilePrint,
i18n( "Print File" ),
- QString::null,
+ TQString(),
this,
- SLOT( slotPrintMenuItemActivated() ),
+ TQT_SLOT( slotPrintMenuItemActivated() ),
toolbar);
- QString filePrintText = i18n( "Click this button to print the current page");
- QWhatsThis::add( filePrint, filePrintText );
+ TQString filePrintText = i18n( "Click this button to print the current page");
+ TQWhatsThis::add( filePrint, filePrintText );
// Setup the menu
- KQPopupMenu * file = new KQPopupMenu( this );
+ KTQPopupMenu * file = new KTQPopupMenu( this );
menuBar()->insertItem( i18n( "&File"), file );
int id;
- id = file->insertItem ( iconFileOpen, i18n( "&Open..."), this, SLOT( slotOpenMenuItemActivated() ), CTRL+Key_O );
- file->setWhatsThis( id, fileOpenText );
+ id = file->insertItem ( iconFileOpen, i18n( "&Open..."), this, TQT_SLOT( slotOpenMenuItemActivated() ), CTRL+Key_O );
+ file->TQMenuData::setWhatsThis( id, fileOpenText );
- id = file->insertItem( iconFilePrint, i18n( "&Print..."), this, SLOT( slotPrintMenuItemActivated() ), CTRL+Key_P );
- file->setWhatsThis( id, filePrintText );
+ id = file->insertItem( iconFilePrint, i18n( "&Print..."), this, TQT_SLOT( slotPrintMenuItemActivated() ), CTRL+Key_P );
+ file->TQMenuData::setWhatsThis( id, filePrintText );
- file->insertSeparator();
- id = file->insertItem ( i18n( "E&xtract CHM content..."), this, SLOT( slotExtractCHM() ) );
- file->setWhatsThis( id, i18n( "Click this button to extract the whole CHM file content into a specific directory") );
+ file->insertSeparator();
+ id = file->insertItem ( i18n( "E&xtract CHM content..."), this, TQT_SLOT( slotExtractCHM() ) );
+ file->TQMenuData::setWhatsThis( id, i18n( "Click this button to extract the whole CHM file content into a specific directory") );
file->insertSeparator();
- m_menuHistory = new KQPopupMenu( file );
- connect ( m_menuHistory, SIGNAL( activated(int) ), this, SLOT ( slotHistoryMenuItemActivated(int) ));
+ m_menuHistory = new KTQPopupMenu( file );
+ connect ( m_menuHistory, TQT_SIGNAL( activated(int) ), this, TQT_SLOT ( slotHistoryMenuItemActivated(int) ));
file->insertItem( i18n( "&Recent files"), m_menuHistory );
file->insertSeparator();
- file->insertItem( i18n( "&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q );
+ file->insertItem( i18n( "&Quit"), tqApp, TQT_SLOT( closeAllWindows() ), CTRL+Key_Q );
- KQPopupMenu * menu_edit = new KQPopupMenu( this );
+ KTQPopupMenu * menu_edit = new KTQPopupMenu( this );
menuBar()->insertItem( i18n( "&Edit"), menu_edit );
- menu_edit->insertItem ( i18n( "&Copy"), this, SLOT( slotBrowserCopy()), CTRL+Key_C );
- menu_edit->insertItem ( i18n( "&Select all"), this, SLOT( slotBrowserSelectAll()), CTRL+Key_A );
+ menu_edit->insertItem ( i18n( "&Copy"), this, TQT_SLOT( slotBrowserCopy()), CTRL+Key_C );
+ menu_edit->insertItem ( i18n( "&Select all"), this, TQT_SLOT( slotBrowserSelectAll()), CTRL+Key_A );
menu_edit->insertSeparator();
@@ -535,18 +535,18 @@ void KCHMMainWindow::setupToolbarsAndMenu( )
// m_viewWindowMgr creates 'Window' menu
m_viewWindowMgr->createMenu( this );
- KQPopupMenu * settings = new KQPopupMenu( this );
+ KTQPopupMenu * settings = new KTQPopupMenu( this );
menuBar()->insertItem( i18n( "&Settings"), settings );
- settings->insertItem( i18n( "&Change settings..."), this, SLOT( slotChangeSettingsMenuItemActivated() ));
+ settings->insertItem( i18n( "&Change settings..."), this, TQT_SLOT( slotChangeSettingsMenuItemActivated() ));
#if defined(USE_KDE)
- QPopupMenu *help = helpMenu( m_aboutDlgMenuText );
+ TQPopupMenu *help = helpMenu( m_aboutDlgMenuText );
#else
- KQPopupMenu * help = new KQPopupMenu( this );
- help->insertItem( i18n( "&About"), this, SLOT( slotAboutMenuItemActivated() ), Key_F1 );
- help->insertItem( i18n( "About &Qt"), this, SLOT( slotAboutQtMenuItemActivated() ));
+ KTQPopupMenu * help = new KTQPopupMenu( this );
+ help->insertItem( i18n( "&About"), this, TQT_SLOT( slotAboutMenuItemActivated() ), Key_F1 );
+ help->insertItem( i18n( "About &TQt"), this, TQT_SLOT( slotAboutQtMenuItemActivated() ));
help->insertSeparator();
- help->insertItem( i18n( "What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1 );
+ help->insertItem( i18n( "What's &This"), this, TQT_SLOT(whatsThis()), SHIFT+Key_F1 );
#endif
menuBar()->insertItem( i18n( "&Help"), help );
@@ -563,9 +563,9 @@ void KCHMMainWindow::setTextEncoding( const LCHMTextEncoding * encoding )
m_chmFile->setCurrentEncoding( encoding );
m_searchToolbar->setChosenEncodingInMenu( encoding );
- // Because updateView() will call view->invalidate(), which clears the view->getOpenedPage(),
+ // Because updateView() will call view->tqinvalidate(), which clears the view->getOpenedPage(),
// we have to make a copy of it.
- QString url = currentBrowser()->getOpenedPage();
+ TQString url = currentBrowser()->getOpenedPage();
// Regenerate the content and index trees
refreshCurrentBrowser();
@@ -600,7 +600,7 @@ void KCHMMainWindow::closeChmFile( )
}
-void KCHMMainWindow::closeEvent ( QCloseEvent * e )
+void KCHMMainWindow::closeEvent ( TQCloseEvent * e )
{
// Save the settings if we have something opened
if ( m_chmFile )
@@ -610,13 +610,13 @@ void KCHMMainWindow::closeEvent ( QCloseEvent * e )
m_chmFile = 0;
}
- QMainWindow::closeEvent ( e );
+ TQMainWindow::closeEvent ( e );
}
bool KCHMMainWindow::parseCmdLineArgs( )
{
- QString filename = QString::null, search_query = QString::null;
- QString search_index = QString::null, search_bookmark = QString::null;
+ TQString filename = TQString(), search_query = TQString();
+ TQString search_index = TQString(), search_bookmark = TQString();
bool do_autotest = false;
#if defined (USE_KDE)
@@ -634,44 +634,44 @@ bool KCHMMainWindow::parseCmdLineArgs( )
if ( args->count() > 0 )
filename = args->arg(0);
#else
- // argv[0] in Qt is still a program name
- for ( int i = 1; i < qApp->argc(); i++ )
+ // argv[0] in TQt is still a program name
+ for ( int i = 1; i < tqApp->argc(); i++ )
{
- if ( !strcmp (qApp->argv()[i], "--autotestmode") )
+ if ( !strcmp (tqApp->argv()[i], "--autotestmode") )
do_autotest = m_useShortAutotest = true;
- else if ( !strcmp (qApp->argv()[i], "--shortautotestmode") )
+ else if ( !strcmp (tqApp->argv()[i], "--shortautotestmode") )
do_autotest = true;
- else if ( !strcmp (qApp->argv()[i], "--search") )
- search_query = qApp->argv()[++i];
- else if ( !strcmp (qApp->argv()[i], "--sindex") )
- search_index = qApp->argv()[++i];
- else if ( !strcmp (qApp->argv()[i], "-h") || !strcmp (qApp->argv()[i], "--help") )
+ else if ( !strcmp (tqApp->argv()[i], "--search") )
+ search_query = tqApp->argv()[++i];
+ else if ( !strcmp (tqApp->argv()[i], "--sindex") )
+ search_index = tqApp->argv()[++i];
+ else if ( !strcmp (tqApp->argv()[i], "-h") || !strcmp (tqApp->argv()[i], "--help") )
{
- fprintf (stderr, "Usage: %s [chmfile]\n", qApp->argv()[0]);
+ fprintf (stderr, "Usage: %s [chmfile]\n", tqApp->argv()[0]);
exit (1);
}
else
- filename = qApp->argv()[i];
+ filename = tqApp->argv()[i];
}
#endif
if ( !filename.isEmpty() )
{
- if ( !loadChmFile( QString::fromLocal8Bit( filename )) )
+ if ( !loadChmFile( TQString::fromLocal8Bit( filename )) )
return true; // skip the latest checks, but do not exit from the program
if ( !search_index.isEmpty() )
{
- QStringList event_args;
+ TQStringList event_args;
event_args.push_back( search_index );
- qApp->postEvent( this, new KCHMUserEvent( "findInIndex", event_args ) );
+ tqApp->postEvent( this, new KCHMUserEvent( "findInIndex", event_args ) );
}
if ( !search_query.isEmpty() )
{
- QStringList event_args;
+ TQStringList event_args;
event_args.push_back( search_query );
- qApp->postEvent( this, new KCHMUserEvent( "searchQuery", event_args ) );
+ tqApp->postEvent( this, new KCHMUserEvent( "searchQuery", event_args ) );
}
if ( do_autotest )
@@ -729,9 +729,9 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
dlg.m_groupKDEsettings->setEnabled ( false );
#endif
- dlg.m_qtBrowserPath->setText ( appConfig.m_QtBrowserPath );
- dlg.m_radioUseQtextBrowser->setChecked ( appConfig.m_kdeUseQTextBrowser );
- dlg.m_radioUseKHTMLPart->setChecked ( !appConfig.m_kdeUseQTextBrowser );
+ dlg.m_qtBrowserPath->setText ( appConfig.m_TQtBrowserPath );
+ dlg.m_radioUseQtextBrowser->setChecked ( appConfig.m_kdeUseTQTextBrowser );
+ dlg.m_radioUseKHTMLPart->setChecked ( !appConfig.m_kdeUseTQTextBrowser );
dlg.m_enableJS->setChecked ( appConfig.m_kdeEnableJS );
dlg.m_enablePlugins->setChecked ( appConfig.m_kdeEnablePlugins );
@@ -750,7 +750,7 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
dlg.m_labelUseSearchEngineInternal->setBuddy( dlg.m_useSearchEngineInternal );
dlg.m_labelUseSearchEngineNew->setBuddy( dlg.m_useSearchEngineNew );
- if ( dlg.exec() == QDialog::Accepted )
+ if ( dlg.exec() == TQDialog::Accepted )
{
appConfig.m_LoadLatestFileOnStartup = dlg.m_radioOnBeginOpenLast->isChecked();
appConfig.m_HistorySize = dlg.m_historySize->value();
@@ -770,7 +770,7 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
else
appConfig.m_onNewChmClick = KCHMConfig::ACTION_DONT_OPEN;
- appConfig.m_QtBrowserPath = dlg.m_qtBrowserPath->text();
+ appConfig.m_TQtBrowserPath = dlg.m_qtBrowserPath->text();
// Check the changes
bool need_restart = false;
@@ -799,24 +799,24 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
appConfig.m_kdeEnableRefresh = dlg.m_enableRefresh->isChecked();
}
- if ( appConfig.m_kdeUseQTextBrowser != dlg.m_radioUseQtextBrowser->isChecked() )
+ if ( appConfig.m_kdeUseTQTextBrowser != dlg.m_radioUseQtextBrowser->isChecked() )
{
need_restart = true;
- appConfig.m_kdeUseQTextBrowser = dlg.m_radioUseQtextBrowser->isChecked();
+ appConfig.m_kdeUseTQTextBrowser = dlg.m_radioUseQtextBrowser->isChecked();
}
if ( dlg.m_useSearchEngineNew->isChecked()
&& appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_CHM )
{
appConfig.m_useSearchEngine = KCHMConfig::SEARCH_USE_MINE;
- m_searchWindow->invalidate();
+ m_searchWindow->tqinvalidate();
}
if ( dlg.m_useSearchEngineInternal->isChecked()
&& appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
{
appConfig.m_useSearchEngine = KCHMConfig::SEARCH_USE_CHM;
- m_searchWindow->invalidate();
+ m_searchWindow->tqinvalidate();
}
appConfig.m_advExternalEditorPath = dlg.m_advExternalProgramName->text();
@@ -826,7 +826,7 @@ void KCHMMainWindow::slotChangeSettingsMenuItemActivated()
appConfig.save();
if ( need_restart )
- QMessageBox::information(
+ TQMessageBox::information(
this,
APP_NAME,
i18n( "Changing browser view options or search engine used\n"
@@ -840,8 +840,8 @@ void KCHMMainWindow::setupSignals( )
#if defined(HAVE_SIGACTION)
struct sigaction sa;
memset ((char *)&sa, 0, sizeof(sa));
- sigemptyset (&sa.sa_mask);
- sigaddset (&sa.sa_mask, SIGCHLD);
+ sigemptyset (&sa.sa_tqmask);
+ sigaddset (&sa.sa_tqmask, SIGCHLD);
#ifdef SA_RESTART
sa.sa_flags = SA_RESTART;
@@ -859,7 +859,7 @@ void KCHMMainWindow::slotHistoryMenuItemActivated( int item )
if ( item < 0 || item >= (signed) appConfig.m_History.size() )
qFatal ("KCHMMainWindow::slotHistoryMenuItemActivated: bad history menu id %d", item);
- QString filename = appConfig.m_History[item];
+ TQString filename = appConfig.m_History[item];
// remove it, so it will be added again at the history top, and will not shitf anything.
// appConfig.m_History.remove ( appConfig.m_History.begin() + item);
@@ -916,14 +916,14 @@ void KCHMMainWindow::showOrHideContextWindow( int tabindex )
// Handle clicking on m_contentsWindow element
connect( m_contentsWindow,
- SIGNAL( clicked( QListViewItem* ) ),
+ TQT_SIGNAL( clicked( TQListViewItem* ) ),
this,
- SLOT( slotOnTreeClicked( QListViewItem* ) ) );
+ TQT_SLOT( slotOnTreeClicked( TQListViewItem* ) ) );
connect( m_contentsWindow,
- SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ),
+ TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ),
this,
- SLOT( slotOnTreeDoubleClicked ( QListViewItem *, const QPoint &, int ) ) );
+ TQT_SLOT( slotOnTreeDoubleClicked ( TQListViewItem *, const TQPoint &, int ) ) );
m_tabWidget->insertTab (m_contentsWindow, i18n( "Contents" ), tabindex);
}
@@ -932,7 +932,7 @@ void KCHMMainWindow::showOrHideContextWindow( int tabindex )
void KCHMMainWindow::showOrHideIndexWindow( int tabindex )
{
- // Test whether to show/invalidate the index window
+ // Test whether to show/tqinvalidate the index window
if ( tabindex == -1 )
{
if ( m_indexWindow )
@@ -950,7 +950,7 @@ void KCHMMainWindow::showOrHideIndexWindow( int tabindex )
m_tabWidget->insertTab (m_indexWindow, i18n( "Index" ), tabindex);
}
else
- m_indexWindow->invalidate();
+ m_indexWindow->tqinvalidate();
}
}
@@ -973,7 +973,7 @@ void KCHMMainWindow::showOrHideSearchWindow( int tabindex )
m_tabWidget->insertTab (m_searchWindow, i18n( "Search" ), tabindex);
}
else
- m_searchWindow->invalidate();
+ m_searchWindow->tqinvalidate();
}
}
@@ -1028,10 +1028,10 @@ void KCHMMainWindow::slotLocateInContentWindow( )
if ( treeitem )
{
- KCHMIndTocItem * itemparent = treeitem;
+ KCHMIndTocItem * itemtqparent = treeitem;
- while ( (itemparent = (KCHMIndTocItem*) itemparent->parent()) != 0 )
- itemparent->setOpen(true);
+ while ( (itemtqparent = (KCHMIndTocItem*) itemtqparent->tqparent()) != 0 )
+ itemtqparent->setOpen(true);
m_contentsWindow->setCurrentItem (treeitem);
m_contentsWindow->ensureItemVisible (treeitem);
@@ -1043,16 +1043,16 @@ void KCHMMainWindow::slotLocateInContentWindow( )
void KCHMMainWindow::slotExtractCHM( )
{
- QStringList files;
+ TQStringList files;
#if defined (USE_KDE)
- QString outdir = KFileDialog::getExistingDirectory (
- QString::null,
+ TQString outdir = KFileDialog::getExistingDirectory (
+ TQString(),
this,
i18n("Choose a directory to store CHM content") );
#else
- QString outdir = QFileDialog::getExistingDirectory (
- QString::null,
+ TQString outdir = TQFileDialog::getExistingDirectory (
+ TQString(),
this,
0,
i18n("Choose a directory to store CHM content"),
@@ -1068,7 +1068,7 @@ void KCHMMainWindow::slotExtractCHM( )
if ( !m_chmFile || !m_chmFile->enumerateFiles( &files ) )
return;
- KQProgressModalDialog progress( i18n("Extracting CHM content"), i18n("Extracting files..."), i18n("Abort"), files.size(), this );
+ KTQProgressModalDialog progress( i18n("Extracting CHM content"), i18n("Extracting files..."), i18n("Abort"), files.size(), this );
for ( unsigned int i = 0; i < files.size(); i++ )
{
@@ -1076,25 +1076,25 @@ void KCHMMainWindow::slotExtractCHM( )
if ( (i % 3) == 0 )
{
- qApp->processEvents();
+ tqApp->processEvents();
if ( progress.wasCancelled() )
break;
}
// Extract the file
- QByteArray buf;
+ TQByteArray buf;
if ( m_chmFile->getFileContentAsBinary( &buf, files[i] ) )
{
// Split filename to get the list of subdirectories
- QStringList dirs = QStringList::split( '/', files[i] );
+ TQStringList dirs = TQStringList::split( '/', files[i] );
// Walk through the list of subdirectories, and create them if needed
// dirlevel is used to detect extra .. and prevent overwriting files
// outside the directory (like creating the file images/../../../../../etc/passwd
unsigned int i, dirlevel = 0;
- QStringList dirlist;
+ TQStringList dirlist;
for ( i = 0; i < dirs.size() - 1; i++ )
{
@@ -1111,7 +1111,7 @@ void KCHMMainWindow::slotExtractCHM( )
{
dirlist.push_back( dirs[i] );
- QDir dir ( outdir + dirlist.join( "/" ) );
+ TQDir dir ( outdir + dirlist.join( "/" ) );
if ( !dir.exists() )
{
if ( !dir.mkdir( dir.path() ) )
@@ -1120,8 +1120,8 @@ void KCHMMainWindow::slotExtractCHM( )
}
}
- QString filename = outdir + dirlist.join( "/" ) + "/" + dirs[i];
- QFile wf( filename );
+ TQString filename = outdir + dirlist.join( "/" ) + "/" + dirs[i];
+ TQFile wf( filename );
if ( !wf.open( IO_WriteOnly ) )
{
qWarning( "Could not write file %s\n", filename.ascii() );
@@ -1158,7 +1158,7 @@ void KCHMMainWindow::slotBrowserChanged( KCHMViewWindow * newbrowser )
locateInContentTree( newbrowser->getOpenedPage() );
}
-void KCHMMainWindow::locateInContentTree( const QString & url )
+void KCHMMainWindow::locateInContentTree( const TQString & url )
{
if ( !m_contentsWindow )
return;
@@ -1167,31 +1167,31 @@ void KCHMMainWindow::locateInContentTree( const QString & url )
if ( treeitem )
{
- KCHMIndTocItem * itemparent = treeitem;
- while ( (itemparent = (KCHMIndTocItem*) itemparent->parent()) != 0 )
- itemparent->setOpen(true);
+ KCHMIndTocItem * itemtqparent = treeitem;
+ while ( (itemtqparent = (KCHMIndTocItem*) itemtqparent->tqparent()) != 0 )
+ itemtqparent->setOpen(true);
m_contentsWindow->setCurrentItem (treeitem);
m_contentsWindow->ensureItemVisible (treeitem);
}
}
-void KCHMMainWindow::slotOnTreeDoubleClicked( QListViewItem * item, const QPoint &, int )
+void KCHMMainWindow::slotOnTreeDoubleClicked( TQListViewItem * item, const TQPoint &, int )
{
- // Open/close only existing item which have children
+ // Open/close only existing item which have tqchildren
if ( !item || item->childCount() == 0 )
return;
item->setOpen( !item->isOpen() );
- item->repaint();
+ item->tqrepaint();
}
-bool KCHMMainWindow::event( QEvent * e )
+bool KCHMMainWindow::event( TQEvent * e )
{
- if ( e->type() == QEvent::User )
+ if ( e->type() == TQEvent::User )
return handleUserEvent( (KCHMUserEvent*) e );
- return QWidget::event( e );
+ return TQWidget::event( e );
}
bool KCHMMainWindow::handleUserEvent( const KCHMUserEvent * event )
@@ -1201,8 +1201,8 @@ bool KCHMMainWindow::handleUserEvent( const KCHMUserEvent * event )
if ( event->m_args.size() != 1 && event->m_args.size() != 2 )
qFatal("handleUserEvent: event loadAndOpen must receive 1 or 2 args");
- QString chmfile = event->m_args[0];
- QString openurl = event->m_args.size() > 1 ? event->m_args[1] : "/";
+ TQString chmfile = event->m_args[0];
+ TQString openurl = event->m_args.size() > 1 ? event->m_args[1] : "/";
return loadChmFile( chmfile, false ) && openPage( openurl );
}
@@ -1254,13 +1254,13 @@ void KCHMMainWindow::runAutoTest()
case STATE_INITIAL:
if ( m_contentsWindow && !m_useShortAutotest )
{
- m_autotestlistiterator = QListViewItemIterator (m_contentsWindow);
+ m_autotestlistiterator = TQListViewItemIterator (m_contentsWindow);
m_autoteststate = STATE_CONTENTS_OPENNEXTPAGE;
}
else
m_autoteststate = STATE_OPEN_INDEX;
- QTimer::singleShot (500, this, SLOT(runAutoTest()) );
+ TQTimer::singleShot (500, this, TQT_SLOT(runAutoTest()) );
break; // allow to finish the initialization sequence
case STATE_CONTENTS_OPENNEXTPAGE:
@@ -1272,7 +1272,7 @@ void KCHMMainWindow::runAutoTest()
else
m_autoteststate = STATE_OPEN_INDEX;
- QTimer::singleShot (50, this, SLOT(runAutoTest()) );
+ TQTimer::singleShot (50, this, TQT_SLOT(runAutoTest()) );
break;
case STATE_OPEN_INDEX:
@@ -1280,11 +1280,11 @@ void KCHMMainWindow::runAutoTest()
m_tabWidget->setCurrentPage (1);
m_autoteststate = STATE_SHUTDOWN;
- QTimer::singleShot (500, this, SLOT(runAutoTest()) );
+ TQTimer::singleShot (500, this, TQT_SLOT(runAutoTest()) );
break;
case STATE_SHUTDOWN:
- qApp->quit();
+ tqApp->quit();
break;
default: