summaryrefslogtreecommitdiff
path: root/library/fileselector.cpp
Unidiff
Diffstat (limited to 'library/fileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/fileselector.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/fileselector.cpp b/library/fileselector.cpp
index 7c29aba..93fb429 100644
--- a/library/fileselector.cpp
+++ b/library/fileselector.cpp
@@ -287,77 +287,77 @@ FileSelector::FileSelector( const QString &f, QWidget *parent, const char *name,
287 d = new FileSelectorPrivate(); 287 d = new FileSelectorPrivate();
288 d->newDocItem = 0; 288 d->newDocItem = 0;
289 d->showNew = newVisible; 289 d->showNew = newVisible;
290 d->catId = -2; // All files 290 d->catId = -2; // All files
291 291
292 d->toolbar = new QHBox( this ); 292 d->toolbar = new QHBox( this );
293 d->toolbar->setBackgroundMode( PaletteButton ); // same colour as toolbars 293 d->toolbar->setBackgroundMode( PaletteButton ); // same colour as toolbars
294 d->toolbar->setSpacing( 0 ); 294 d->toolbar->setSpacing( 0 );
295 d->toolbar->hide(); 295 d->toolbar->hide();
296 296
297 QWidget *spacer = new QWidget( d->toolbar ); 297 QWidget *spacer = new QWidget( d->toolbar );
298 spacer->setBackgroundMode( PaletteButton ); 298 spacer->setBackgroundMode( PaletteButton );
299 299
300 QToolButton *tb = new QToolButton( d->toolbar ); 300 QToolButton *tb = new QToolButton( d->toolbar );
301 tb->setPixmap( Resource::loadPixmap( "close" ) ); 301 tb->setPixmap( Resource::loadPixmap( "close" ) );
302 connect( tb, SIGNAL( clicked() ), this, SIGNAL( closeMe() ) ); 302 connect( tb, SIGNAL( clicked() ), this, SIGNAL( closeMe() ) );
303 buttonClose = tb; 303 buttonClose = tb;
304 tb->setFixedSize( 18, 20 ); // tb->sizeHint() ); 304 tb->setFixedSize( 18, 20 ); // tb->sizeHint() );
305 tb->setAutoRaise( TRUE ); 305 tb->setAutoRaise( TRUE );
306 QToolTip::add( tb, tr( "Close the File Selector" ) ); 306 QToolTip::add( tb, tr( "Close the File Selector" ) );
307 QPEMenuToolFocusManager::manager()->addWidget( tb ); 307 QPEMenuToolFocusManager::manager()->addWidget( tb );
308 308
309 view = new FileSelectorView( this, "fileview" ); 309 view = new FileSelectorView( this, "fileview" );
310 QPEApplication::setStylusOperation( view->viewport(), QPEApplication::RightOnHold ); 310 QPEApplication::setStylusOperation( view->viewport(), QPEApplication::RightOnHold );
311 connect( view, SIGNAL( mouseButtonClicked( int, QListViewItem *, const QPoint &, int ) ), 311 connect( view, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),
312 this, SLOT( fileClicked( int, QListViewItem *, const QPoint &, int ) ) ); 312 this, SLOT( fileClicked(int,QListViewItem*,const QPoint&,int) ) );
313 connect( view, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint &, int ) ), 313 connect( view, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),
314 this, SLOT( filePressed( int, QListViewItem *, const QPoint &, int ) ) ); 314 this, SLOT( filePressed(int,QListViewItem*,const QPoint&,int) ) );
315 connect( view, SIGNAL( returnPressed( QListViewItem * ) ), 315 connect( view, SIGNAL( returnPressed(QListViewItem*) ),
316 this, SLOT( fileClicked( QListViewItem * ) ) ); 316 this, SLOT( fileClicked(QListViewItem*) ) );
317 317
318 QHBox *hb = new QHBox( this ); 318 QHBox *hb = new QHBox( this );
319 319
320 d->typeCombo = new TypeCombo( hb ); 320 d->typeCombo = new TypeCombo( hb );
321 connect( d->typeCombo, SIGNAL(selected(const QString&)), 321 connect( d->typeCombo, SIGNAL(selected(const QString&)),
322 this, SLOT(typeSelected(const QString&)) ); 322 this, SLOT(typeSelected(const QString&)) );
323 QWhatsThis::add( d->typeCombo, tr("Show documents of this type") ); 323 QWhatsThis::add( d->typeCombo, tr("Show documents of this type") );
324 324
325 Categories c; 325 Categories c;
326 c.load(categoryFileName()); 326 c.load(categoryFileName());
327 QArray<int> vl( 0 ); 327 QArray<int> vl( 0 );
328 d->catSelect = new CategorySelect( hb ); 328 d->catSelect = new CategorySelect( hb );
329 d->catSelect->setRemoveCategoryEdit( TRUE ); 329 d->catSelect->setRemoveCategoryEdit( TRUE );
330 d->catSelect->setCategories( vl, "Document View", tr("Document View") ); 330 d->catSelect->setCategories( vl, "Document View", tr("Document View") );
331 d->catSelect->setAllCategories( TRUE ); 331 d->catSelect->setAllCategories( TRUE );
332 connect( d->catSelect, SIGNAL(signalSelected(int)), this, SLOT(catSelected(int)) ); 332 connect( d->catSelect, SIGNAL(signalSelected(int)), this, SLOT(catSelected(int)) );
333 QWhatsThis::add( d->catSelect, tr("Show documents in this category") ); 333 QWhatsThis::add( d->catSelect, tr("Show documents in this category") );
334 334
335 setCloseVisible( closeVisible ); 335 setCloseVisible( closeVisible );
336 336
337 QCopChannel *channel = new QCopChannel( "QPE/Card", this ); 337 QCopChannel *channel = new QCopChannel( "QPE/Card", this );
338 connect( channel, SIGNAL(received(const QCString &, const QByteArray &)), 338 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
339 this, SLOT(cardMessage( const QCString &, const QByteArray &)) ); 339 this, SLOT(cardMessage(const QCString&,const QByteArray&)) );
340 340
341 reread(); 341 reread();
342 updateWhatsThis(); 342 updateWhatsThis();
343} 343}
344 344
345/*! 345/*!
346 Destroys the widget. 346 Destroys the widget.
347*/ 347*/
348FileSelector::~FileSelector() 348FileSelector::~FileSelector()
349{ 349{
350 delete d; 350 delete d;
351} 351}
352 352
353/*! 353/*!
354 Returns the number of files in the view. If this is zero, an editor 354 Returns the number of files in the view. If this is zero, an editor
355 application might bypass the selector and immediately start with 355 application might bypass the selector and immediately start with
356 a "new" document. 356 a "new" document.
357*/ 357*/
358int FileSelector::fileCount() 358int FileSelector::fileCount()
359{ 359{
360 return d->files.children().count();; 360 return d->files.children().count();;
361} 361}
362 362
363/*! 363/*!