20 #include "kpreviewprops.h"
24 #include <tdefilemetapreview.h>
25 #include <tdeglobalsettings.h>
26 #include <tdelocale.h>
28 class KPreviewPropsPlugin::KPreviewPropsPluginPrivate
31 KPreviewPropsPluginPrivate() {}
32 ~KPreviewPropsPluginPrivate() {}
38 d =
new KPreviewPropsPluginPrivate;
40 if (properties->items().count()>1)
46 void KPreviewPropsPlugin::createLayout()
49 TQFrame* topframe =
properties->addPage(i18n(
"P&review"));
50 topframe->setFrameStyle(TQFrame::NoFrame);
52 TQVBoxLayout* tmp =
new TQVBoxLayout(topframe, 0, 0);
54 preview =
new KFileMetaPreview(topframe);
56 tmp->addWidget(preview) ;
57 connect(
properties, TQ_SIGNAL( aboutToShowPage( TQWidget * ) ), TQ_SLOT( aboutToShowPage( TQWidget* ) ) );
60 KPreviewPropsPlugin::~KPreviewPropsPlugin()
67 if ( _items.count() != 1)
69 if( !TDEGlobalSettings::showFilePreview(_items.first()->url()))
71 KMimeType::Ptr mt = KMimeType::findByURL( _items.first()->url() );
72 if ( mt->inherits(
"inode/directory") || mt->name() ==
"application/octet-stream" )
80 void KPreviewPropsPlugin::aboutToShowPage( TQWidget* widget )
82 if ( widget != preview->parent() )
85 disconnect(
properties, TQ_SIGNAL( aboutToShowPage( TQWidget * ) ),
this, TQ_SLOT( aboutToShowPage( TQWidget* ) ) );
89 #include "kpreviewprops.moc"
static bool supports(KFileItemList _items)
Tests whether a preview for the first item should be shown.
The main properties dialog class.
A Plugin in the Properties dialog This is an abstract class.
KPropertiesDialog * properties
Pointer to the dialog.