1
/* This file is part of the KDE project
2
Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
3
Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
4
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
5
Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
6
Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Library General Public
10
License version 2 as published by the Free Software Foundation.
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public License
18
along with this library; see the file COPYING.LIB. If not, write to
19
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
Boston, MA 02111-1307, USA.
24
#include "fileselector_part.h"
25
#include "fileselector_widget.h"
26
#include "kactionselector.h"
27
#include "kbookmarkhandler.h"
30
#include <kdevmainwindow.h>
31
#include <kdevpartcontroller.h>
34
#include <qtoolbutton.h>
40
#include <qwhatsthis.h>
41
#include <qapplication.h>
43
#include <qscrollbar.h>
45
#include <qgroupbox.h>
46
#include <qcheckbox.h>
48
#include <qdockarea.h>
51
#include <ktexteditor/document.h>
53
#include <kmainwindow.h>
54
#include <kapplication.h>
55
#include <kiconloader.h>
56
#include <kurlcombobox.h>
57
#include <kurlcompletion.h>
58
#include <kprotocolinfo.h>
61
#include <kcombobox.h>
63
#include <kmessagebox.h>
64
#include <ktoolbarbutton.h>
66
#include <kpopupmenu.h>
68
#include <kio/netaccess.h>
74
// from kfiledialog.cpp - avoid qt warning in STDERR (~/.xsessionerrors)
75
static void silenceQToolBar(QtMsgType, const char *)
79
KDevFileSelectorToolBar::KDevFileSelectorToolBar(QWidget *parent)
80
: KToolBar( parent, "KDev FileSelector Toolbar", true )
85
KDevFileSelectorToolBar::~KDevFileSelectorToolBar()
88
void KDevFileSelectorToolBar::setMovingEnabled( bool)
90
KToolBar::setMovingEnabled(false);
94
KDevFileSelectorToolBarParent::KDevFileSelectorToolBarParent(QWidget *parent)
95
:QFrame(parent),m_tb(0)
97
KDevFileSelectorToolBarParent::~KDevFileSelectorToolBarParent()
99
void KDevFileSelectorToolBarParent::setToolBar(KDevFileSelectorToolBar *tb)
104
void KDevFileSelectorToolBarParent::resizeEvent ( QResizeEvent * )
108
setMinimumHeight(m_tb->sizeHint().height());
109
m_tb->resize(width(),height());
114
//BEGIN Constructor/destructor
116
KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *mainWindow,
117
KDevPartController *partController,
118
QWidget * parent, const char * name )
119
: QWidget(parent, name),
122
partController(partController)
124
mActionCollection = new KActionCollection( this );
126
QVBoxLayout* lo = new QVBoxLayout(this);
128
QtMsgHandler oldHandler = qInstallMsgHandler( silenceQToolBar );
130
KDevFileSelectorToolBarParent *tbp=new KDevFileSelectorToolBarParent(this);
131
toolbar = new KDevFileSelectorToolBar(tbp);
132
tbp->setToolBar(toolbar);
134
toolbar->setMovingEnabled(false);
135
toolbar->setFlat(true);
136
qInstallMsgHandler( oldHandler );
138
cmbPath = new KURLComboBox( KURLComboBox::Directories, true, this, "path combo" );
139
cmbPath->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
140
KURLCompletion* cmpl = new KURLCompletion(KURLCompletion::DirCompletion);
141
cmbPath->setCompletionObject( cmpl );
142
lo->addWidget(cmbPath);
143
cmbPath->listBox()->installEventFilter( this );
145
dir = new KDevDirOperator(m_part, KURL(), this, "operator");
146
dir->setView(KFile::/*Simple*/Detail);
148
KActionCollection *coll = dir->actionCollection();
149
// some shortcuts of diroperator that clashes with KDev
150
coll->action( "delete" )->setShortcut( KShortcut( ALT + Key_Delete ) );
151
coll->action( "reload" )->setShortcut( KShortcut( ALT + Key_F5 ) );
152
coll->action( "back" )->setShortcut( KShortcut( ALT + SHIFT + Key_Left ) );
153
coll->action( "forward" )->setShortcut( KShortcut( ALT + SHIFT + Key_Right ) );
154
// some consistency - reset up for dir too
155
coll->action( "up" )->setShortcut( KShortcut( ALT + SHIFT + Key_Up ) );
156
coll->action( "home" )->setShortcut( KShortcut( CTRL + ALT + Key_Home ) );
159
lo->setStretchFactor(dir, 2);
162
KActionMenu *acmBookmarks = new KActionMenu( i18n("Bookmarks"), "bookmark",
163
mActionCollection, "bookmarks" );
164
acmBookmarks->setDelayed( false );
166
bookmarkHandler = new KBookmarkHandler( this, acmBookmarks->popupMenu() );
168
QHBox* filterBox = new QHBox(this);
170
btnFilter = new QToolButton( filterBox );
171
btnFilter->setIconSet( SmallIconSet("filter" ) );
172
btnFilter->setToggleButton( true );
173
filter = new KHistoryCombo( true, filterBox, "filter");
174
filter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
175
filterBox->setStretchFactor(filter, 2);
176
connect( btnFilter, SIGNAL( clicked() ), this, SLOT( btnFilterClick() ) );
177
lo->addWidget(filterBox);
179
connect( filter, SIGNAL( activated(const QString&) ),
180
SLOT( slotFilterChange(const QString&) ) );
182
connect( filter, SIGNAL( textChanged(const QString&) ),
183
SLOT( slotFilterChange(const QString&) ) );
184
connect( filter, SIGNAL( returnPressed(const QString&) ),
185
filter, SLOT( addToHistory(const QString&) ) );
187
// kaction for the dir sync method
188
acSyncDir = new KAction( i18n("Current Document Directory"), "dirsynch", 0,
189
this, SLOT( setActiveDocumentDir() ), mActionCollection, "sync_dir" );
190
toolbar->setIconText( KToolBar::IconOnly );
191
toolbar->setIconSize( 16 );
192
toolbar->setEnableContextMenu( false );
194
connect( cmbPath, SIGNAL( urlActivated( const KURL& )),
195
this, SLOT( cmbPathActivated( const KURL& ) ));
196
connect( cmbPath, SIGNAL( returnPressed( const QString& )),
197
this, SLOT( cmbPathReturnPressed( const QString& ) ));
198
connect(dir, SIGNAL(urlEntered(const KURL&)),
199
this, SLOT(dirUrlEntered(const KURL&)) );
201
connect(dir, SIGNAL(finishedLoading()),
202
this, SLOT(dirFinishedLoading()) );
204
// enable dir sync button if current doc has a valid URL
205
connect ( partController, SIGNAL(activePartChanged(KParts::Part*) ),
206
this, SLOT(viewChanged() ) );
208
// Connect the bookmark handler
209
connect( bookmarkHandler, SIGNAL( openURL( const QString& )),
210
this, SLOT( setDir( const QString& ) ) );
212
waitingUrl = QString::null;
217
i18n("<p>Here you can enter a path for a directory to display."
218
"<p>To go to a directory previously entered, press the arrow on "
219
"the right and choose one. <p>The entry has directory "
220
"completion. Right-click to choose how completion should behave.") );
223
i18n("<p>Here you can enter a name filter to limit which files are displayed."
224
"<p>To clear the filter, toggle off the filter button to the left."
225
"<p>To reapply the last filter used, toggle on the filter button." ) );
228
i18n("<p>This button clears the name filter when toggled off, or "
229
"reapplies the last filter used when toggled on.") );
232
KDevFileSelector::~KDevFileSelector()
234
writeConfig( m_part->instance()->config(), "fileselector" );
236
//END Constroctor/Destrctor
238
//BEGIN Public Methods
240
void KDevFileSelector::readConfig(KConfig *config, const QString & name)
242
dir->readConfig(config, name + ":dir");
243
dir->setView( KFile::Default );
245
config->setGroup( name );
247
// set up the toolbar
248
setupToolbar( config );
250
cmbPath->setMaxItems( config->readNumEntry( "pathcombo history len", 9 ) );
251
cmbPath->setURLs( config->readPathListEntry("dir history") );
252
// if we restore history
253
if ( config->readBoolEntry( "restore location", true ) || kapp->isRestored() )
255
QString loc( config->readPathEntry( "location" ) );
256
if ( ! loc.isEmpty() )
259
QTimer::singleShot(0, this, SLOT(initialDirChangeHack()));
263
// else is automatic, as cmpPath->setURL is called when a location is entered.
265
filter->setMaxCount( config->readNumEntry( "filter history len", 9 ) );
266
filter->setHistoryItems( config->readListEntry("filter history"), true );
267
lastFilter = config->readEntry( "last filter" );
269
if ( config->readBoolEntry( "restore last filter", true ) || kapp->isRestored() )
270
flt = config->readEntry("current filter");
271
filter->lineEdit()->setText( flt );
272
slotFilterChange( flt );
274
autoSyncEvents = config->readNumEntry( "AutoSyncEvents", 0 );
275
// connect events as needed
276
/// @todo - solve startup problem: no need to set location for each doc opened!
277
if ( autoSyncEvents & DocumentChanged )
278
connect( partController, SIGNAL( viewChanged() ), this, SLOT( autoSync() ) );
280
if ( autoSyncEvents & DocumentOpened )
281
connect( partController, SIGNAL( partAdded(KParts::Part*) ),
282
this, SLOT( autoSync(KParts::Part*) ) );
286
void KDevFileSelector::initialDirChangeHack()
288
setDir( waitingDir );
291
void KDevFileSelector::setupToolbar( KConfig *config )
294
QStringList tbactions = config->readListEntry( "toolbar actions", ',' );
295
if ( tbactions.isEmpty() )
297
// resonable collection for default toolbar
298
tbactions << "up" << "back" << "forward" << "home" <<
299
"short view" << "detailed view" <<
300
"bookmarks" << "sync_dir";
303
for ( QStringList::Iterator it=tbactions.begin(); it != tbactions.end(); ++it )
305
if ( *it == "bookmarks" || *it == "sync_dir" )
306
ac = mActionCollection->action( (*it).latin1() );
308
ac = dir->actionCollection()->action( (*it).latin1() );
314
void KDevFileSelector::writeConfig(KConfig *config, const QString & name)
316
dir->writeConfig(config,name + ":dir");
318
config->setGroup( name );
319
config->writeEntry( "pathcombo history len", cmbPath->maxItems() );
321
for (int i = 0; i < cmbPath->count(); i++)
323
l.append( cmbPath->text( i ) );
325
config->writePathEntry( "dir history", l );
326
config->writePathEntry( "location", cmbPath->currentText() );
328
config->writeEntry( "filter history len", filter->maxCount() );
329
config->writeEntry( "filter history", filter->historyItems() );
330
config->writeEntry( "current filter", filter->currentText() );
331
config->writeEntry( "last filter", lastFilter );
332
config->writeEntry( "AutoSyncEvents", autoSyncEvents );
335
void KDevFileSelector::setView(KFile::FileView view)
344
void KDevFileSelector::slotFilterChange( const QString & nf )
346
QToolTip::remove( btnFilter );
347
QString f = nf.stripWhiteSpace();
348
bool empty = f.isEmpty() || f == "*";
352
filter->lineEdit()->setText( QString::null );
355
QString( i18n("Apply last filter (\"%1\")") ).arg( lastFilter ) );
359
if ( !f.startsWith( "*" ) )
361
if ( !f.endsWith( "*" ) )
363
dir->setNameFilter( f );
366
( btnFilter, i18n("Clear filter") );
368
btnFilter->setOn( !empty );
370
// this will be never true after the filter has been used;)
371
btnFilter->setEnabled( !( empty && lastFilter.isEmpty() ) );
374
void KDevFileSelector::setDir( KURL u )
376
dir->setURL(u, true);
381
//BEGIN Private Slots
383
void KDevFileSelector::cmbPathActivated( const KURL& u )
385
cmbPathReturnPressed( u.url() );
388
void KDevFileSelector::cmbPathReturnPressed( const QString& u )
390
QStringList urls = cmbPath->urls();
393
cmbPath->setURLs( urls, KURLComboBox::RemoveBottom );
395
dir->setURL( KURL(u), true );
398
void KDevFileSelector::dirUrlEntered( const KURL& u )
400
cmbPath->setURL( u );
403
void KDevFileSelector::dirFinishedLoading()
408
When the button in the filter box toggles:
410
If the name filer is anything but "" or "*", reset it.
414
void KDevFileSelector::btnFilterClick()
416
if ( !btnFilter->isOn() )
418
slotFilterChange( QString::null );
422
filter->lineEdit()->setText( lastFilter );
423
slotFilterChange( lastFilter );
428
void KDevFileSelector::autoSync()
430
kdDebug()<<"KDevFileSelector::autoSync()"<<endl;
434
setActiveDocumentDir();
435
waitingUrl = QString::null;
437
// else set waiting url
440
KURL u = activeDocumentUrl();
442
waitingUrl = u.directory();
446
void KDevFileSelector::autoSync( KParts::Part *part )
448
KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
452
// as above, but using document url.
453
kdDebug()<<"KDevFileSelector::autoSync( KTextEditor::Document )"<<endl;
454
KURL u ( doc->url() );
457
waitingUrl = QString::null;
462
setDir( u.directory() );
463
waitingUrl = QString::null;
467
waitingUrl = u.directory();
470
/// \FIXME crash on shutdown
471
void KDevFileSelector::setActiveDocumentDir()
473
//kdDebug()<<"KDevFileSelector::setActiveDocumentDir()"<<endl;
474
KURL u = activeDocumentUrl();
479
void KDevFileSelector::viewChanged()
481
/// @todo make sure the button is disabled if the directory is unreadable, eg
482
/// the document URL has protocol http
483
acSyncDir->setEnabled( ! activeDocumentUrl().directory().isEmpty() );
490
void KDevFileSelector::focusInEvent( QFocusEvent * )
495
void KDevFileSelector::showEvent( QShowEvent * )
498
if ( autoSyncEvents & GotVisible )
500
kdDebug()<<"syncing fs on show"<<endl;
501
setActiveDocumentDir();
502
waitingUrl = QString::null;
504
// else, if we have a waiting URL set it
505
else if ( ! waitingUrl.isEmpty() )
507
setDir( waitingUrl );
508
waitingUrl = QString::null;
512
bool KDevFileSelector::eventFilter( QObject* o, QEvent *e )
515
This is rather unfortunate, but:
516
QComboBox does not support setting the size of the listbox to something
517
resonable. Even using listbox->setVariableWidth() does not yeld a
518
satisfying result, something is wrong with the handling of the sizehint.
519
And the popup is rather useless, if the paths are only partly visible.
521
QListBox *lb = cmbPath->listBox();
522
if ( o == lb && e->type() == QEvent::Show )
525
= lb->height() < lb->contentsHeight() ? lb->verticalScrollBar()->width() : 0;
526
int w = QMIN( mainwin->main()->width(), lb->contentsWidth() + add );
527
lb->resize( w, lb->height() );
528
/// @todo - move the listbox to a suitable place if nessecary
529
/// @todo - decide if it is worth caching the size while untill the contents
532
/// @todo - same thing for the completion popup?
533
return QWidget::eventFilter( o, e );
540
QListboxItem that can store and return a string,
541
used for the toolbar action selector.
543
class ActionLBItem : public QListBoxPixmap
546
ActionLBItem( QListBox *lb=0,
547
const QPixmap &pm = QPixmap(),
548
const QString &text=QString::null,
549
const QString &str=QString::null ) :
550
QListBoxPixmap( lb, pm, text ),
562
KURL KDevFileSelector::activeDocumentUrl( )
564
KParts::ReadOnlyPart * part = dynamic_cast<KParts::ReadOnlyPart*>( partController->activePart() );
574
//BEGIN KFSConfigPage
575
////////////////////////////////////////////////////////////////////////////////
576
// KFSConfigPage implementation
577
////////////////////////////////////////////////////////////////////////////////
578
KFSConfigPage::KFSConfigPage( QWidget *parent, const char *name, KDevFileSelector *kfs )
579
: QWidget( parent, name ),
583
QVBoxLayout *lo = new QVBoxLayout( this );
584
int spacing = KDialog::spacingHint();
585
lo->setSpacing( spacing );
587
// Toolbar - a lot for a little...
588
QGroupBox *gbToolbar = new QGroupBox( 1, Qt::Vertical, i18n("Toolbar"), this );
589
acSel = new KActionSelector( gbToolbar );
590
acSel->setAvailableLabel( i18n("A&vailable actions:") );
591
acSel->setSelectedLabel( i18n("S&elected actions:") );
592
lo->addWidget( gbToolbar );
593
connect( acSel, SIGNAL( added( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
594
connect( acSel, SIGNAL( removed( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
595
connect( acSel, SIGNAL( movedUp( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
596
connect( acSel, SIGNAL( movedDown( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
599
QGroupBox *gbSync = new QGroupBox( 1, Qt::Horizontal, i18n("Auto Synchronization"), this );
600
cbSyncActive = new QCheckBox( i18n("When a docu&ment becomes active"), gbSync );
601
cbSyncOpen = new QCheckBox( i18n("When a document is o&pened"), gbSync );
602
cbSyncShow = new QCheckBox( i18n("When the file selector becomes visible"), gbSync );
603
lo->addWidget( gbSync );
604
connect( cbSyncActive, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
605
connect( cbSyncOpen, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
606
connect( cbSyncShow, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
609
QHBox *hbPathHist = new QHBox ( this );
610
QLabel *lbPathHist = new QLabel( i18n("Remember &locations:"), hbPathHist );
611
sbPathHistLength = new QSpinBox( hbPathHist );
612
lbPathHist->setBuddy( sbPathHistLength );
613
lo->addWidget( hbPathHist );
614
connect( sbPathHistLength, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
616
QHBox *hbFilterHist = new QHBox ( this );
617
QLabel *lbFilterHist = new QLabel( i18n("Remember &filters:"), hbFilterHist );
618
sbFilterHistLength = new QSpinBox( hbFilterHist );
619
lbFilterHist->setBuddy( sbFilterHistLength );
620
lo->addWidget( hbFilterHist );
621
connect( sbFilterHistLength, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
624
QGroupBox *gbSession = new QGroupBox( 1, Qt::Horizontal, i18n("Session"), this );
625
cbSesLocation = new QCheckBox( i18n("Restore loca&tion"), gbSession );
626
cbSesFilter = new QCheckBox( i18n("Restore last f&ilter"), gbSession );
627
lo->addWidget( gbSession );
628
connect( cbSesLocation, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
629
connect( cbSesFilter, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
636
QWhatsThis::add( lbAvailableActions, i18n(
637
"<p>Available actions for the toolbar. To add an action, select it here "
638
"and press the add (<strong>-></strong>) button" ) );
639
QWhatsThis::add( lbUsedActions, i18n(
640
"<p>Actions used in the toolbar. To remove an action, select it and "
641
"press the remove (<strong><-</strong>) button."
642
"<p>To change the order of the actions, use the Up and Down buttons to "
643
"move the selected action.") );
646
"<p>Decides how many locations to keep in the history of the location "
649
( lbPathHist, lhwt );
651
( sbPathHistLength, lhwt );
653
"<p>Decides how many filters to keep in the history of the filter "
656
( lbFilterHist, fhwt );
658
( sbFilterHistLength, fhwt );
660
"<p>These options allow you to have the File Selector automatically "
661
"change location to the directory of the active document on certain "
663
"<p>Auto synchronization is <em>lazy</em>, meaning it will not take "
664
"effect until the file selector is visible."
665
"<p>None of these are enabled by default, but you can always sync the "
666
"location by pressing the sync button in the toolbar.") );
670
( cbSesLocation, i18n(
671
"<p>If this option is enabled (default), the location will be restored "
672
"when you start KDev.<p><strong>Note</strong> that if the session is "
673
"handled by the KDE session manager, the location is always restored.") );
676
"<p>If this option is enabled (default), the current filter will be "
677
"restored when you start KDev.<p><strong>Note</strong> that if the "
678
"session is handled by the KDE session manager, the filter is always "
680
"<p><strong>Note</strong> that some of the autosync settings may "
681
"override the restored location if on.") );
687
void KFSConfigPage::apply()
689
KConfig *config = fileSelector->m_part->instance()->config();
690
config->setGroup( "fileselector" );
693
QListBoxItem *item = acSel->selectedListBox()->firstItem();
697
aItem = (ActionLBItem*)item;
700
l << aItem->idstring();
704
config->writeEntry( "toolbar actions", l );
705
fileSelector->setupToolbar( config );
708
if ( cbSyncActive->isChecked() )
709
s |= KDevFileSelector::DocumentChanged;
710
if ( cbSyncOpen->isChecked() )
711
s |= KDevFileSelector::DocumentOpened;
712
if ( cbSyncShow->isChecked() )
713
s |= KDevFileSelector::GotVisible;
714
fileSelector->autoSyncEvents = s;
716
disconnect( fileSelector->partController, 0, fileSelector, SLOT( autoSync() ) );
717
disconnect( fileSelector->partController, 0,
718
fileSelector, SLOT( autoSync( KParts::Part *) ) );
719
if ( s & KDevFileSelector::DocumentChanged )
720
connect( fileSelector->partController, SIGNAL( viewChanged() ),
721
fileSelector, SLOT( autoSync() ) );
722
if ( s & KDevFileSelector::DocumentOpened )
723
connect( fileSelector->partController,
724
SIGNAL( partAdded(KParts::Part *) ),
725
fileSelector, SLOT( autoSync(KParts::Part *) ) );
728
fileSelector->cmbPath->setMaxItems( sbPathHistLength->value() );
729
fileSelector->filter->setMaxCount( sbFilterHistLength->value() );
730
// session - theese are read/written directly to the app config,
731
// as they are not needed during operation.
732
config->writeEntry( "restore location", cbSesLocation->isChecked() );
733
config->writeEntry( "restore last filter", cbSesFilter->isChecked() );
736
void KFSConfigPage::reload()
738
// hmm, what is this supposed to do, actually??
742
void KFSConfigPage::init()
744
KConfig *config = fileSelector->m_part->instance()->config();
745
config->setGroup( "fileselector" );
747
QStringList l = config->readListEntry( "toolbar actions", ',' );
748
if ( l.isEmpty() ) // default toolbar
749
l << "up" << "back" << "forward" << "home" <<
750
"short view" << "detailed view" <<
751
"bookmarks" << "sync_dir";
753
// actions from diroperator + two of our own
754
QStringList allActions;
755
allActions << "up" << "back" << "forward" << "home" <<
756
"reload" << "mkdir" << "delete" <<
757
"short view" << "detailed view" /*<< "view menu" <<
758
"show hidden" << "properties"*/ <<
759
"bookmarks" << "sync_dir";
760
QRegExp re("&(?=[^&])");
763
for ( QStringList::Iterator it=allActions.begin(); it != allActions.end(); ++it )
765
lb = l.contains( *it ) ? acSel->selectedListBox() : acSel->availableListBox();
766
if ( *it == "bookmarks" || *it == "sync_dir" )
767
ac = fileSelector->actionCollection()->action( (*it).latin1() );
769
ac = fileSelector->dirOperator()->actionCollection()->action( (*it).latin1() );
771
new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().replace( re, "" ), *it );
775
int s = fileSelector->autoSyncEvents;
776
cbSyncActive->setChecked( s & KDevFileSelector::DocumentChanged );
777
cbSyncOpen->setChecked( s & KDevFileSelector::DocumentOpened );
778
cbSyncShow->setChecked( s & KDevFileSelector::GotVisible );
780
sbPathHistLength->setValue( fileSelector->cmbPath->maxItems() );
781
sbFilterHistLength->setValue( fileSelector->filter->maxCount() );
783
cbSesLocation->setChecked( config->readBoolEntry( "restore location", true ) );
784
cbSesFilter->setChecked( config->readBoolEntry( "restore last filter", true ) );
787
void KFSConfigPage::slotChanged()
794
//BEGIN KDevDirOperator
796
void KDevDirOperator::activatedMenu( const KFileItem *fi, const QPoint & pos )
799
updateSelectionDependentActions();
801
KActionMenu * am = dynamic_cast<KActionMenu*>(actionCollection()->action("popupMenu"));
804
KPopupMenu *popup = am->popupMenu();
806
popup->insertSeparator();
807
m_part->newFileAction()->plug(popup);
811
FileContext context( KURL::List(fi->url()));
812
if ( (m_part) && (m_part->core()))
813
m_part->core()->fillContextMenu(popup, &context);
819
//END KDevDirOperator
821
#include "fileselector_widget.moc"