summaryrefslogtreecommitdiffstats
path: root/tdeio/tdefile/tdefiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeio/tdefile/tdefiledialog.cpp')
-rw-r--r--tdeio/tdefile/tdefiledialog.cpp127
1 files changed, 63 insertions, 64 deletions
diff --git a/tdeio/tdefile/tdefiledialog.cpp b/tdeio/tdefile/tdefiledialog.cpp
index 0f3f69943..60c017459 100644
--- a/tdeio/tdefile/tdefiledialog.cpp
+++ b/tdeio/tdefile/tdefiledialog.cpp
@@ -1,4 +1,3 @@
-// -*- c++ -*-
/* This file is part of the KDE libraries
Copyright (C) 1997, 1998 Richard Moore <rich@kde.org>
1998 Stephan Kulow <coolo@kde.org>
@@ -66,7 +65,7 @@
#include <kpushbutton.h>
#include <tderecentdirs.h>
#include <kshell.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <kstdguiitem.h>
#include <kstaticdeleter.h>
#include <tdetoolbar.h>
@@ -89,7 +88,7 @@
#include <tdefilespeedbar.h>
#include <tdefilebookmarkhandler.h>
-#ifdef Q_WS_X11
+#ifdef TQ_WS_X11
#include <X11/Xlib.h>
#include <fixx11h.h>
#endif
@@ -530,7 +529,7 @@ void KFileDialog::slotOk()
return;
}
- if (!kapp->authorizeURLAction("open", KURL(), d->url))
+ if (!tdeApp->authorizeURLAction("open", KURL(), d->url))
{
TQString msg = TDEIO::buildErrorString(TDEIO::ERR_ACCESS_DENIED, d->url.prettyURL());
KMessageBox::error( d->mainWidget, msg);
@@ -548,7 +547,7 @@ void KFileDialog::slotOk()
for ( KURL::List::ConstIterator it = list.begin();
it != list.end(); ++it )
{
- if (!kapp->authorizeURLAction("open", KURL(), *it))
+ if (!tdeApp->authorizeURLAction("open", KURL(), *it))
{
TQString msg = TDEIO::buildErrorString(TDEIO::ERR_ACCESS_DENIED, (*it).prettyURL());
KMessageBox::error( d->mainWidget, msg);
@@ -562,8 +561,8 @@ void KFileDialog::slotOk()
job->setWindow (topLevelWidget());
TDEIO::Scheduler::scheduleJob( job );
d->statJobs.append( job );
- connect( job, TQT_SIGNAL( result(TDEIO::Job *) ),
- TQT_SLOT( slotStatResult( TDEIO::Job *) ));
+ connect( job, TQ_SIGNAL( result(TDEIO::Job *) ),
+ TQ_SLOT( slotStatResult( TDEIO::Job *) ));
}
return;
}
@@ -571,7 +570,7 @@ void KFileDialog::slotOk()
job = TDEIO::stat(d->url,!d->url.isLocalFile());
job->setWindow (topLevelWidget());
d->statJobs.append( job );
- connect(job, TQT_SIGNAL(result(TDEIO::Job*)), TQT_SLOT(slotStatResult(TDEIO::Job*)));
+ connect(job, TQ_SIGNAL(result(TDEIO::Job*)), TQ_SLOT(slotStatResult(TDEIO::Job*)));
}
@@ -771,11 +770,11 @@ void KFileDialog::setLocationText( const TQString& text )
// setCurrentItem() will cause textChanged() being emitted,
// so slotLocationChanged() will be called. Make sure we don't clear
// the KDirOperator's view-selection in there
- disconnect( locationEdit, TQT_SIGNAL( textChanged( const TQString& ) ),
- this, TQT_SLOT( slotLocationChanged( const TQString& ) ) );
+ disconnect( locationEdit, TQ_SIGNAL( textChanged( const TQString& ) ),
+ this, TQ_SLOT( slotLocationChanged( const TQString& ) ) );
locationEdit->setCurrentItem( 0 );
- connect( locationEdit, TQT_SIGNAL( textChanged( const TQString& ) ),
- TQT_SLOT( slotLocationChanged( const TQString& )) );
+ connect( locationEdit, TQ_SIGNAL( textChanged( const TQString& ) ),
+ TQ_SLOT( slotLocationChanged( const TQString& )) );
locationEdit->setEditText( text );
// don't change selection when user has clicked on an item
@@ -828,17 +827,17 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
d->okButton = new KPushButton( KStdGuiItem::ok(), d->mainWidget );
d->okButton->setDefault( true );
d->cancelButton = new KPushButton(KStdGuiItem::cancel(), d->mainWidget);
- connect( d->okButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOk() ));
- connect( d->cancelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotCancel() ));
+ connect( d->okButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotOk() ));
+ connect( d->cancelButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotCancel() ));
d->customWidget = widget;
d->autoSelectExtCheckBox = 0; // delayed loading
d->autoSelectExtChecked = false;
d->urlBar = 0; // delayed loading
- TQtMsgHandler oldHandler = tqInstallMsgHandler( silenceQToolBar );
+ TQtMsgHandler oldHandler = qInstallMsgHandler( silenceQToolBar );
toolbar = new TDEToolBar( d->mainWidget, "KFileDialog::toolbar", true);
toolbar->setFlat(true);
- tqInstallMsgHandler( oldHandler );
+ qInstallMsgHandler( oldHandler );
d->pathCombo = new KURLComboBox( KURLComboBox::Directories, true,
toolbar, "path combo" );
@@ -897,14 +896,14 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
ops = new KDirOperator(d->url, d->mainWidget, "KFileDialog::ops");
ops->setOnlyDoubleClickSelectsFiles( true );
- connect(ops, TQT_SIGNAL(urlEntered(const KURL&)),
- TQT_SLOT(urlEntered(const KURL&)));
- connect(ops, TQT_SIGNAL(fileHighlighted(const KFileItem *)),
- TQT_SLOT(fileHighlighted(const KFileItem *)));
- connect(ops, TQT_SIGNAL(fileSelected(const KFileItem *)),
- TQT_SLOT(fileSelected(const KFileItem *)));
- connect(ops, TQT_SIGNAL(finishedLoading()),
- TQT_SLOT(slotLoadingFinished()));
+ connect(ops, TQ_SIGNAL(urlEntered(const KURL&)),
+ TQ_SLOT(urlEntered(const KURL&)));
+ connect(ops, TQ_SIGNAL(fileHighlighted(const KFileItem *)),
+ TQ_SLOT(fileHighlighted(const KFileItem *)));
+ connect(ops, TQ_SIGNAL(fileSelected(const KFileItem *)),
+ TQ_SLOT(fileSelected(const KFileItem *)));
+ connect(ops, TQ_SIGNAL(finishedLoading()),
+ TQ_SLOT(slotLoadingFinished()));
ops->setupMenu(KDirOperator::SortActions |
KDirOperator::FileActions |
@@ -929,16 +928,16 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
TDEToggleAction *showSidebarAction =
new TDEToggleAction(i18n("Show Quick Access Navigation Panel"), Key_F9, coll,"toggleSpeedbar");
showSidebarAction->setCheckedState(i18n("Hide Quick Access Navigation Panel"));
- connect( showSidebarAction, TQT_SIGNAL( toggled( bool ) ),
- TQT_SLOT( toggleSpeedbar( bool )) );
+ connect( showSidebarAction, TQ_SIGNAL( toggled( bool ) ),
+ TQ_SLOT( toggleSpeedbar( bool )) );
TDEToggleAction *showBookmarksAction =
new TDEToggleAction(i18n("Show Bookmarks"), 0, coll, "toggleBookmarks");
showBookmarksAction->setCheckedState(i18n("Hide Bookmarks"));
- connect( showBookmarksAction, TQT_SIGNAL( toggled( bool ) ),
- TQT_SLOT( toggleBookmarks( bool )) );
+ connect( showBookmarksAction, TQ_SIGNAL( toggled( bool ) ),
+ TQ_SLOT( toggleBookmarks( bool )) );
- TDEActionMenu *menu = new TDEActionMenu( i18n("Configure"), "configure", TQT_TQOBJECT(this), "extra menu" );
+ TDEActionMenu *menu = new TDEActionMenu( i18n("Configure"), "configure", this, "extra menu" );
menu->setWhatsThis(i18n("<qt>This is the configuration menu for the file dialog. "
"Various options can be accessed from this menu including: <ul>"
"<li>how files are sorted in the list</li>"
@@ -964,12 +963,12 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
menu->insert( coll->action( "separate dirs" ));
menu->setDelayed( false );
- connect( menu->popupMenu(), TQT_SIGNAL( aboutToShow() ),
- ops, TQT_SLOT( updateSelectionDependentActions() ));
+ connect( menu->popupMenu(), TQ_SIGNAL( aboutToShow() ),
+ ops, TQ_SLOT( updateSelectionDependentActions() ));
menu->plug( toolbar );
//Insert a separator.
- TDEToolBarSeparator* spacerWidget = new TDEToolBarSeparator(Qt::Horizontal, false /*no line*/,
+ TDEToolBarSeparator* spacerWidget = new TDEToolBarSeparator(TQt::Horizontal, false /*no line*/,
toolbar);
d->m_pathComboIndex = toolbar->insertWidget(-1, -1, spacerWidget);
toolbar->insertWidget(PATH_COMBO, 0, d->pathCombo);
@@ -985,12 +984,12 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
d->pathCombo->setCompletionObject( pathCompletionObj );
d->pathCombo->setAutoDeleteCompletionObject( true );
- connect( d->pathCombo, TQT_SIGNAL( urlActivated( const KURL& )),
- this, TQT_SLOT( enterURL( const KURL& ) ));
- connect( d->pathCombo, TQT_SIGNAL( returnPressed( const TQString& )),
- this, TQT_SLOT( enterURL( const TQString& ) ));
- connect( d->pathCombo, TQT_SIGNAL( activated( const TQString& )),
- this, TQT_SLOT( enterURL( const TQString& ) ));
+ connect( d->pathCombo, TQ_SIGNAL( urlActivated( const KURL& )),
+ this, TQ_SLOT( enterURL( const KURL& ) ));
+ connect( d->pathCombo, TQ_SIGNAL( returnPressed( const TQString& )),
+ this, TQ_SLOT( enterURL( const TQString& ) ));
+ connect( d->pathCombo, TQ_SIGNAL( activated( const TQString& )),
+ this, TQ_SLOT( enterURL( const TQString& ) ));
TQString whatsThisText;
@@ -999,8 +998,8 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
locationEdit = new KURLComboBox(KURLComboBox::Files, true,
d->mainWidget, "LocationEdit");
locationEdit->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed));
- connect( locationEdit, TQT_SIGNAL( textChanged( const TQString& ) ),
- TQT_SLOT( slotLocationChanged( const TQString& )) );
+ connect( locationEdit, TQ_SIGNAL( textChanged( const TQString& ) ),
+ TQ_SLOT( slotLocationChanged( const TQString& )) );
updateLocationWhatsThis ();
d->locationLabel->setBuddy(locationEdit);
@@ -1012,13 +1011,13 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
fileCompletionObj->setDir( dir );
locationEdit->setCompletionObject( fileCompletionObj );
locationEdit->setAutoDeleteCompletionObject( true );
- connect( fileCompletionObj, TQT_SIGNAL( match( const TQString& ) ),
- TQT_SLOT( fileCompletion( const TQString& )) );
+ connect( fileCompletionObj, TQ_SIGNAL( match( const TQString& ) ),
+ TQ_SLOT( fileCompletion( const TQString& )) );
- connect( locationEdit, TQT_SIGNAL( returnPressed() ),
- this, TQT_SLOT( slotOk()));
- connect(locationEdit, TQT_SIGNAL( activated( const TQString& )),
- this, TQT_SLOT( locationActivated( const TQString& ) ));
+ connect( locationEdit, TQ_SIGNAL( returnPressed() ),
+ this, TQ_SLOT( slotOk()));
+ connect(locationEdit, TQ_SIGNAL( activated( const TQString& )),
+ this, TQ_SLOT( locationActivated( const TQString& ) ));
// the Filter label/edit
whatsThisText = i18n("<qt>This is the filter to apply to the file list. "
@@ -1035,12 +1034,12 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
TQWhatsThis::add(filterWidget, whatsThisText);
setFilter(filter);
d->filterLabel->setBuddy(filterWidget);
- connect(filterWidget, TQT_SIGNAL(filterChanged()), TQT_SLOT(slotFilterChanged()));
+ connect(filterWidget, TQ_SIGNAL(filterChanged()), TQ_SLOT(slotFilterChanged()));
// the Automatically Select Extension checkbox
// (the text, visibility etc. is set in updateAutoSelectExtension(), which is called by readConfig())
d->autoSelectExtCheckBox = new TQCheckBox (d->mainWidget);
- connect(d->autoSelectExtCheckBox, TQT_SIGNAL(clicked()), TQT_SLOT(slotAutoSelectExtClicked()));
+ connect(d->autoSelectExtCheckBox, TQ_SIGNAL(clicked()), TQ_SLOT(slotAutoSelectExtClicked()));
initGUI(); // activate GM
@@ -1057,8 +1056,8 @@ void KFileDialog::init(const TQString& startDir, const TQString& filter, TQWidge
void KFileDialog::initSpeedbar()
{
d->urlBar = new KFileSpeedBar( d->mainWidget, "url bar" );
- connect( d->urlBar, TQT_SIGNAL( activated( const KURL& )),
- TQT_SLOT( enterURL( const KURL& )) );
+ connect( d->urlBar, TQ_SIGNAL( activated( const KURL& )),
+ TQ_SLOT( enterURL( const KURL& )) );
// need to set the current url of the urlbar manually (not via urlEntered()
// here, because the initial url of KDirOperator might be the same as the
@@ -1084,17 +1083,17 @@ void KFileDialog::initGUI()
TQGridLayout* lafBox= new TQGridLayout(2, 3, KDialog::spacingHint());
- lafBox->addWidget(d->locationLabel, 0, 0, Qt::AlignVCenter);
- lafBox->addWidget(locationEdit, 0, 1, Qt::AlignVCenter);
- lafBox->addWidget(d->okButton, 0, 2, Qt::AlignVCenter);
+ lafBox->addWidget(d->locationLabel, 0, 0, TQt::AlignVCenter);
+ lafBox->addWidget(locationEdit, 0, 1, TQt::AlignVCenter);
+ lafBox->addWidget(d->okButton, 0, 2, TQt::AlignVCenter);
- lafBox->addWidget(d->filterLabel, 1, 0, Qt::AlignVCenter);
- lafBox->addWidget(filterWidget, 1, 1, Qt::AlignVCenter);
- lafBox->addWidget(d->cancelButton, 1, 2, Qt::AlignVCenter);
+ lafBox->addWidget(d->filterLabel, 1, 0, TQt::AlignVCenter);
+ lafBox->addWidget(filterWidget, 1, 1, TQt::AlignVCenter);
+ lafBox->addWidget(d->cancelButton, 1, 2, TQt::AlignVCenter);
lafBox->setColStretch(1, 4);
- vbox->addLayout(TQT_TQLAYOUT(lafBox), 0);
+ vbox->addLayout(lafBox, 0);
vbox->addSpacing(3);
// add the Automatically Select Extension checkbox
@@ -1337,9 +1336,9 @@ TQString KFileDialog::getOpenFileNameWId(const TQString& startDir,
const TQString& filter,
WId parent_id, const TQString& caption)
{
- TQWidget* parent = TQT_TQWIDGET(TQWidget::find( parent_id ));
+ TQWidget* parent = TQWidget::find( parent_id );
KFileDialog dlg(startDir, filter, parent, "filedialog", true);
-#ifdef Q_WS_X11
+#ifdef TQ_WS_X11
if( parent == NULL && parent_id != 0 )
XSetTransientForHint( tqt_xdisplay(), dlg.winId(), parent_id );
#else
@@ -1414,7 +1413,7 @@ TQString KFileDialog::getExistingDirectory(const TQString& startDir,
TQWidget *parent,
const TQString& caption)
{
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
return TQFileDialog::getExistingDirectory(startDir, parent, "getExistingDirectory",
caption, true, true);
#else
@@ -1619,9 +1618,9 @@ TQString KFileDialog::getSaveFileNameWId(const TQString& dir, const TQString& fi
const TQString& caption)
{
bool specialDir = dir.at(0) == ':';
- TQWidget* parent = TQT_TQWIDGET(TQWidget::find( parent_id ));
+ TQWidget* parent = TQWidget::find( parent_id );
KFileDialog dlg( specialDir ? dir : TQString::null, filter, parent, "filedialog", true);
-#ifdef Q_WS_X11
+#ifdef TQ_WS_X11
if( parent == NULL && parent_id != 0 )
XSetTransientForHint(tqt_xdisplay(), dlg.winId(), parent_id);
#else
@@ -2264,8 +2263,8 @@ void KFileDialog::toggleBookmarks(bool show)
}
d->bookmarkHandler = new KFileBookmarkHandler( this );
- connect( d->bookmarkHandler, TQT_SIGNAL( openURL( const TQString& )),
- TQT_SLOT( enterURL( const TQString& )));
+ connect( d->bookmarkHandler, TQ_SIGNAL( openURL( const TQString& )),
+ TQ_SLOT( enterURL( const TQString& )));
toolbar->insertButton(TQString::fromLatin1("bookmark"),
(int)HOTLIST_BUTTON, true,