kio Library API Documentation

KPropertiesDialog Class Reference

The main properties dialog class. More...

#include <kpropertiesdialog.h>

Inheritance diagram for KPropertiesDialog:

KDialogBase KDialog QDialog List of all members.

Public Slots

virtual void slotOk ()
virtual void slotCancel ()

Signals

void propertiesClosed ()
void applied ()
void canceled ()
void saveAs (const KURL &oldUrl, KURL &newUrl)

Public Methods

 KPropertiesDialog (KFileItem *item, QWidget *parent=0L, const char *name=0L, bool modal=false, bool autoShow=true)
 KPropertiesDialog (KFileItemList _items, QWidget *parent=0L, const char *name=0L, bool modal=false, bool autoShow=true)
 KPropertiesDialog (const KURL &_url, mode_t _mode, QWidget *parent=0L, const char *name=0L, bool modal=false, bool autoShow=true) KDE_DEPRECATED
 KPropertiesDialog (const KURL &_url, QWidget *parent=0L, const char *name=0L, bool modal=false, bool autoShow=true)
 KPropertiesDialog (const KURL &_tempUrl, const KURL &_currentDir, const QString &_defaultName, QWidget *parent=0L, const char *name=0L, bool modal=false, bool autoShow=true)
 KPropertiesDialog (const QString &title, QWidget *parent=0L, const char *name=0L, bool modal=false)
virtual ~KPropertiesDialog ()
void insertPlugin (KPropsDlgPlugin *plugin)
const KURLkurl () const
KFileItemitem ()
KFileItemList items () const
KDE_DEPRECATED KDialogBasedialog ()
KDE_DEPRECATED const KDialogBasedialog () const
const KURLcurrentDir () const
const QStringdefaultName () const
void updateUrl (const KURL &_newUrl)
void rename (const QString &_name)
void abortApplying ()
void showFileSharingPage ()
void setFileNameReadOnly (bool ro)

Static Public Methods

bool canDisplay (KFileItemList _items)

Protected Methods

virtual void virtual_hook (int id, void *data)

Detailed Description

The main properties dialog class.

A Properties Dialog is a dialog which displays various information about a particular file or URL, or several ones. This main class holds various related classes, which are instantiated in the form of tab entries in the tabbed dialog that this class provides. The various tabs themselves will let the user view or change information about the file or URL.

This class must be created with (void)new KPropertiesDialog(...) It will take care of deleting itself.

Definition at line 65 of file kpropertiesdialog.h.


Constructor & Destructor Documentation

KPropertiesDialog::KPropertiesDialog KFileItem   item,
QWidget   parent = 0L,
const char *    name = 0L,
bool    modal = false,
bool    autoShow = true
 

Brings up a Properties dialog.

Normal constructor for file-manager-like applications. Normally you will use this method rather than the one below.

Parameters:
item  file item whose properties should be displayed.
parent  is the parent of the dialog widget.
name  is the internal name.
modal  tells the dialog whether it should be modal.
autoShow  tells the dialog whethr it should show itself automatically.

Definition at line 144 of file kpropertiesdialog.cpp.

References QPtrList< KFileItem >::append(), KIO::decodeFileName(), KURL::isEmpty(), and KFileItem::url().

KPropertiesDialog::KPropertiesDialog KFileItemList    _items,
QWidget   parent = 0L,
const char *    name = 0L,
bool    modal = false,
bool    autoShow = true
 

Brings up a Properties dialog.

Normal constructor for file-manager-like applications.

Parameters:
_items  list of file items whose properties should be displayed.
parent  is the parent of the dialog widget.
name  is the internal name.
modal  tells the dialog whether it should be modal.
autoShow  tells the dialog whethr it should show itself automatically.

Definition at line 172 of file kpropertiesdialog.cpp.

References QPtrList< KFileItem >::append(), QPtrListIterator< KFileItem >::current(), KIO::decodeFileName(), QPtrList< KFileItem >::first(), KURL::isEmpty(), and QPtrList< KFileItem >::isEmpty().

KPropertiesDialog::KPropertiesDialog const KURL   _url,
mode_t    _mode,
QWidget   parent = 0L,
const char *    name = 0L,
bool    modal = false,
bool    autoShow = true
 

Deprecated:
Brings up a Properties dialog. Convenience constructor for non-file-manager applications.
Parameters:
_url  the URL whose properties should be displayed
_mode  unused.
parent  is the parent of the dialog widget.
name  is the internal name.
modal  tells the dialog whether it should be modal.
autoShow  tells the dialog whethr it should show itself automatically.

Definition at line 195 of file kpropertiesdialog.cpp.

References QPtrList< KFileItem >::append(), KIO::decodeFileName(), and KIO::NetAccess::stat().

KPropertiesDialog::KPropertiesDialog const KURL   _url,
QWidget   parent = 0L,
const char *    name = 0L,
bool    modal = false,
bool    autoShow = true
 

Brings up a Properties dialog.

Convenience constructor for non-file-manager applications.

Parameters:
_url  the URL whose properties should be displayed
parent  is the parent of the dialog widget.
name  is the internal name.
modal  tells the dialog whether it should be modal. IMPORTANT: This constructor, together with modal=true, leads to a grave display bug (due to KIO::stat() being run before the dialog has all the necessary information). Do not use this combination for now. For local files with a known mimetype, simply create a KFileItem and pass it to the other constructor.
autoShow  tells the dialog whethr it should show itself automatically.

Definition at line 215 of file kpropertiesdialog.cpp.

References QPtrList< KFileItem >::append(), KIO::decodeFileName(), and KIO::NetAccess::stat().

KPropertiesDialog::KPropertiesDialog const KURL   _tempUrl,
const KURL   _currentDir,
const QString   _defaultName,
QWidget   parent = 0L,
const char *    name = 0L,
bool    modal = false,
bool    autoShow = true
 

Creates a properties dialog for a new .desktop file (whose name is not known yet), based on a template.

Special constructor for "File / New" in file-manager applications.

Parameters:
_tempUrl  template used for reading only
_currentDir  directory where the file will be written to
_defaultName  something to put in the name field, like mimetype.desktop
parent  is the parent of the dialog widget.
name  is the internal name.
modal  tells the dialog whether it should be modal.
autoShow  tells the dialog whethr it should show itself automatically.

Definition at line 234 of file kpropertiesdialog.cpp.

References QPtrList< KFileItem >::append(), KIO::decodeFileName(), and KURL::isEmpty().

KPropertiesDialog::KPropertiesDialog const QString   title,
QWidget   parent = 0L,
const char *    name = 0L,
bool    modal = false
 

Creates an empty properties dialog (for applications that want use a standard dialog, but for things not doable via the plugin-mechanism).

Parameters:
title  is the string display as the "filename" in the caption of the dialog.
parent  is the parent of the dialog widget.
name  is the internal name.
modal  tells the dialog whether it should be modal.

Definition at line 161 of file kpropertiesdialog.cpp.

KPropertiesDialog::~KPropertiesDialog   [virtual]
 

Cleans up the properties dialog and frees any associated resources, including the dialog itself.

Note that when a properties dialog is closed it cleans up and deletes itself.

Definition at line 305 of file kpropertiesdialog.cpp.

References QPtrList< KPropsDlgPlugin >::clear().


Member Function Documentation

bool KPropertiesDialog::canDisplay KFileItemList    _items [static]
 

Returns:
whether there are any property pages available for the given file items

Definition at line 319 of file kpropertiesdialog.cpp.

References KFileMetaPropsPlugin::supports(), KFilePermissionsPropsPlugin::supports(), and KFilePropsPlugin::supports().

void KPropertiesDialog::insertPlugin KPropsDlgPlugin   plugin
 

Adds a "3rd party" properties plugin to the dialog.

Useful for extending the properties mechanism.

To create a new plugin type, inherit from the base class KPropsPlugin and implement all the methods. If you define a service .desktop file for your plugin, you do not need to call insertPlugin().

Parameters:
plugin  is a pointer to the PropsPlugin. The Properties dialog will do destruction for you. The KPropsPlugin MUST have been created with the KPropertiesDialog as its parent.
See also:
KPropsDlgPlugin

Definition at line 311 of file kpropertiesdialog.cpp.

References QPtrList< KPropsDlgPlugin >::append().

const KURL& KPropertiesDialog::kurl   const [inline]
 

Returns:
a parsed URL. Valid only if dialog shown for one file/url.

Definition at line 203 of file kpropertiesdialog.h.

Referenced by KApplicationPropsPlugin::applyChanges(), KExecPropsPlugin::applyChanges(), KDesktopPropsPlugin::applyChanges(), KDevicePropsPlugin::applyChanges(), KBindingPropsPlugin::applyChanges(), KURLPropsPlugin::applyChanges(), KFilePropsPlugin::applyChanges(), KApplicationPropsPlugin::KApplicationPropsPlugin(), KFileMetaPropsPlugin::KFileMetaPropsPlugin(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), KFilePropsPlugin::KFilePropsPlugin(), and KURLPropsPlugin::KURLPropsPlugin().

KFileItem* KPropertiesDialog::item   [inline]
 

Returns:
the file item for which the dialog is shown Warning, it returns the first item of the list. This means, use this only if you are sure the dialog is used for a single item.

Definition at line 211 of file kpropertiesdialog.h.

References QPtrList< KFileItem >::first().

Referenced by KFileMetaPropsPlugin::KFileMetaPropsPlugin(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), and KFilePropsPlugin::KFilePropsPlugin().

KFileItemList KPropertiesDialog::items   const [inline]
 

Returns:
the items for which the dialog is shown

Definition at line 216 of file kpropertiesdialog.h.

Referenced by KFilePermissionsPropsPlugin::applyChanges(), KFileSharePropsPlugin::applyChanges(), KFileMetaPropsPlugin::KFileMetaPropsPlugin(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), KFilePropsPlugin::KFilePropsPlugin(), and KFilePropsPlugin::postApplyChanges().

KDE_DEPRECATED KDialogBase* KPropertiesDialog::dialog   [inline]
 

Returns:
a pointer to the dialog
Deprecated:
the class directly inherits from KDialogBase, so use this instead

Definition at line 222 of file kpropertiesdialog.h.

const KURL& KPropertiesDialog::currentDir   const [inline]
 

If we are building this dialog from a template,.

Returns:
the current directory QString::null means no template used

Definition at line 230 of file kpropertiesdialog.h.

Referenced by KFilePropsPlugin::KFilePropsPlugin().

const QString& KPropertiesDialog::defaultName   const [inline]
 

If we are building this dialog from a template,.

Returns:
the default name (see 3rd constructor) QString::null means no template used

Definition at line 237 of file kpropertiesdialog.h.

Referenced by KFilePropsPlugin::KFilePropsPlugin().

void KPropertiesDialog::updateUrl const KURL   _newUrl
 

Updates the item url (either called by rename or because a global apps/mimelnk desktop file is being saved) Can only be called if the dialog applies to a single file/URL.

Parameters:
_newUrl  the new URL

Definition at line 479 of file kpropertiesdialog.cpp.

References QPtrList< KFileItem >::count(), QPtrListIterator::current(), QPtrList< KFileItem >::first(), KURL::isEmpty(), saveAs(), and KURL::url().

Referenced by rename().

void KPropertiesDialog::rename const QString   _name
 

see FilePropsPlugin::applyChanges Can only be called if the dialog applies to a single file/URL.

Parameters:
_name  new filename, encoded.

Definition at line 503 of file kpropertiesdialog.cpp.

References KURL::addPath(), QString::at(), QPtrList< KFileItem >::count(), KURL::isEmpty(), QString::length(), KURL::setFileName(), QString::truncate(), updateUrl(), and KURL::url().

Referenced by KFilePropsPlugin::applyChanges().

void KPropertiesDialog::abortApplying  
 

To abort applying changes.

Definition at line 526 of file kpropertiesdialog.cpp.

Referenced by KFilePropsPlugin::applyChanges().

void KPropertiesDialog::showFileSharingPage  
 

Since:
3.1.

Definition at line 272 of file kpropertiesdialog.cpp.

References QPtrList< KPropsDlgPlugin >::first(), QPtrList< KPropsDlgPlugin >::next(), KFileSharePropsPlugin::page(), KDialogBase::pageIndex(), and KDialogBase::showPage().

void KPropertiesDialog::setFileNameReadOnly bool    ro
 

Call this to make the filename lineedit readonly, to prevent the user from renaming the file.

Since:
3.2

Definition at line 287 of file kpropertiesdialog.cpp.

References QPtrList< KPropsDlgPlugin >::first(), QPtrList< KPropsDlgPlugin >::next(), and KFilePropsPlugin::setFileNameReadOnly().

void KPropertiesDialog::slotOk   [virtual, slot]
 

Called when the user presses 'Ok'.

Reimplemented from KDialogBase.

Definition at line 331 of file kpropertiesdialog.cpp.

References QDialog::accept(), KPropsDlgPlugin::applyChanges(), QObject::className(), QPtrList< KPropsDlgPlugin >::first(), KPropsDlgPlugin::isDirty(), QPtrList< KPropsDlgPlugin >::next(), KFilePropsPlugin::postApplyChanges(), propertiesClosed(), and KPropsDlgPlugin::setDirty().

void KPropertiesDialog::propertiesClosed   [signal]
 

Emitted when we have finished with the properties (be it Apply or Cancel).

Referenced by slotOk().

void KPropertiesDialog::saveAs const KURL   oldUrl,
KURL   newUrl
[signal]
 

Emitted before changes to oldUrl are saved as newUrl.

The receiver may change newUrl to point to an alternative save location.

Referenced by updateUrl().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun May 16 22:03:33 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003