org.kde.koala
public class KDirOperator extends QWidget
KDirOperator op = new KDirOperator( KURL( "file:/home/gis" ), this ); // some signals you might be interested in connect(op, SIGNAL("urlEntered(KURL)"), SLOT("urlEntered(KURL)")); connect(op, SIGNAL("fileHighlighted(const KFileItem )"), SLOT("fileHighlighted(const KFileItem )")); connect(op, SIGNAL("fileSelected(const KFileItem )"), SLOT("fileSelected(const KFileItem )")); connect(op, SIGNAL("finishedLoading()"), SLOT("slotLoadingFinished()")); op.readConfig( KGlobal.config(), "Your KDiroperator ConfigGroup" ); op.setView(KFile.Default);This will create a childwidget of 'this' showing the directory contents of /home/gis in the default-view. The view is determined by the readConfig() call, which will read the KDirOperator settings, the user left your program with (and which you saved with op.writeConfig()). See KDirOperatorSignals for signals emitted by KDirOperator
UNKNOWN: A widget for displaying files and browsing directories.
Field Summary | |
---|---|
static int | AllActions |
static int | FileActions |
static int | NavActions |
static int | SortActions
The various action types. |
static int | ViewActions |
Constructor Summary | |
---|---|
protected | KDirOperator(Class dummy) |
KDirOperator(KURL urlName, QWidget parent, String name)
Constructs the KDirOperator with no initial view. | |
KDirOperator(KURL urlName, QWidget parent) | |
KDirOperator(KURL urlName) | |
KDirOperator() |
Method Summary | |
---|---|
KActionCollection | actionCollection()
an accessor to a collection of all available Actions. |
protected void | activatedMenu(KFileItem arg1, QPoint pos)
Called upon right-click to activate the popupmenu. |
void | back()
Goes one step back in the history and opens that url. |
void | cdUp()
Goes one directory up from the current url. |
protected boolean | checkPreviewSupport()
Checks if there support from KIO.PreviewJob for the currently
shown files, taking mimeFilter() and nameFilter() into account
Enables/disables the preview-action accordingly. |
String | className() |
void | clearFilter()
Clears both the namefilter and mimetype filter, so that all files and
directories will be shown. |
void | clearHistory()
Clears the forward and backward history. |
boolean | close(boolean alsoDelete) |
void | closeLoading()
Stops loading immediately. |
KCompletion | completionObject() |
protected KFileViewInterface | createView(QWidget parent, int view)
A view factory for creating predefined fileviews. |
DeleteJob | del(ArrayList items, boolean ask, boolean showProgress)
Starts and returns a KIO.DeleteJob to delete the given items. |
DeleteJob | del(ArrayList items, boolean ask) |
DeleteJob | del(ArrayList items) |
DeleteJob | del(ArrayList items, QWidget parent, boolean ask, boolean showProgress)
Starts and returns a KIO.DeleteJob to delete the given items. |
DeleteJob | del(ArrayList items, QWidget parent, boolean ask) |
DeleteJob | del(ArrayList items, QWidget parent) |
void | deleteSelected()
Deletes the currently selected files/directories. |
KCompletion | dirCompletionObject() |
boolean | dirHighlighting()
Default is false. |
KDirLister | dirLister() |
boolean | dirOnlyMode() |
static boolean | dirOnlyMode(int mode) |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | finalize() Deletes the wrapped C++ instance |
void | forward()
Goes one step forward in the history and opens that url. |
protected void | highlightFile(KFileItem i)
Emits fileHighlighted( i ) |
void | home()
Enters the home directory. |
protected void | insertNewFiles(ArrayList newone)
Adds a new list of KFileItems to the view
(coming from KDirLister) |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isRoot() |
boolean | isSelected(KFileItem item) |
protected void | itemDeleted(KFileItem arg1)
Removes the given KFileItem item from the view (usually called from
KDirLister). |
String | makeCompletion(String arg1)
Tries to complete the given string (only completes files). |
String | makeDirCompletion(String arg1)
Tries to complete the given string (only completes directores). |
QMetaObject | metaObject() |
ArrayList | mimeFilter() |
boolean | mkdir(String directory, boolean enterDirectory)
Creates the given directory/url. |
boolean | mkdir(String directory) |
void | mkdir()
Opens a dialog to create a new directory. |
int | mode() |
String | nameFilter() |
int | numDirs() |
int | numFiles() |
boolean | onlyDoubleClickSelectsFiles() |
protected void | pathChanged()
Called after setURL() to load the directory, update the history,
etc. |
protected void | prepareCompletionObjects()
Synchronizes the completion objects with the entries of the
currently listed url.
|
KProgress | progressBar() |
void | readConfig(KConfig arg1, String group)
Reads the default settings for a view, i.e. the default KFile.FileView.
|
void | readConfig(KConfig arg1) |
void | rereadDir()
Re-reads the current url. |
protected void | resetCursor()
Restores the normal cursor after showing the busy-cursor. |
protected void | resizeEvent(QResizeEvent arg1) |
protected void | selectDir(KFileItem item)
Enters the directory specified by the given item. |
ArrayList | selectedItems() |
protected void | selectFile(KFileItem item)
Emits fileSelected( item ) |
void | setAcceptDrops(boolean b)
Reimplemented - allow dropping of files if b is true |
void | setCurrentItem(String filename)
Clears the current selection and attempts to set filename
the current file. filename is just the name, no path or url. |
protected void | setDirLister(KDirLister lister)
Sets a custom KDirLister to list directories. |
void | setDropOptions(int options)
Sets the options for dropping files. |
void | setEnableDirHighlighting(boolean enable)
When going up in the directory hierarchy, KDirOperator can highlight
the directory that was just left.
|
void | setMimeFilter(String[] mimetypes)
Sets a list of mimetypes as filter. |
void | setMode(int m)
Sets the listing/selection mode for the views, an OR'ed combination of
|
void | setNameFilter(String filter)
Sets a filter like "*.cpp .h .o". |
void | setOnlyDoubleClickSelectsFiles(boolean enable)
This is a KFileDialog specific hack: we want to select directories with
single click, but not files. |
void | setPreviewWidget(QWidget w)
Sets a preview-widget to be shown next to the file-view.
|
void | setShowHiddenFiles(boolean s)
Enables/disables showing hidden files. |
void | setSorting(int arg1)
Sets the way to sort files and directories. |
protected void | setupActions()
Sets up all the actions. |
void | setupMenu(int whichActions)
Sets up the action menu. |
protected void | setupMenu()
Sets up the context-menu with all the necessary actions. |
void | setURL(KURL url, boolean clearforward)
Sets a new url to list. |
void | setView(KFileViewInterface view)
Sets a new KFileView to be used for showing and browsing files.
|
void | setView(int view)
Sets one of the predefined fileviews |
void | setViewConfig(KConfig config, String group)
Sets the config object and the to be used group in KDirOperator. |
boolean | showHiddenFiles() |
protected void | slotCompletionMatch(String match)
Tries to make the given match as current item in the view and emits
completion( match ) |
protected void | sortByDate()
Changes sorting to sort by date |
protected void | sortByName()
Changes sorting to sort by name |
protected void | sortBySize()
Changes sorting to sort by size |
int | sorting() |
protected void | sortReversed()
Changes sorting to reverse sorting |
protected void | toggleDirsFirst()
Toggles showing directories first / having them sorted like files. |
protected void | toggleIgnoreCase()
Toggles case sensitive / case insensitive sorting |
CopyJob | trash(ArrayList items, QWidget parent, boolean ask, boolean showProgress)
Starts and returns a KIO.CopyJob to trash the given items. |
CopyJob | trash(ArrayList items, QWidget parent, boolean ask) |
CopyJob | trash(ArrayList items, QWidget parent) |
void | trashSelected(int arg1, int arg2)
Trashes the currently selected files/directories. |
void | updateDir()
to update the view after changing the settings |
void | updateSelectionDependentActions()
Enables/disables actions that are selection dependent. |
protected void | updateSortActions()
Updates the sorting-related actions to comply with the current sorting |
protected void | updateViewActions()
Updates the view-related actions to comply with the current
KFile.FileView |
KURL | url() |
KFileViewInterface | view() |
KConfig | viewConfig()
Returns the KConfig object used for saving and restoring view's
configuration. |
String | viewConfigGroup()
Returns the group name used for saving and restoring view's
configuration. |
QWidget | viewWidget()
Returns the widget of the current view. null if there is no view/widget.
|
void | writeConfig(KConfig arg1, String group)
Saves the current settings like sorting, simple or detailed view. |
void | writeConfig(KConfig arg1) |
UNKNOWN: The various action types.
UNKNOWN: Constructs the KDirOperator with no initial view.
actionCollection().action( "up" ).plug( someToolBar );to add a button into a toolbar, which makes the dirOperator change to its parent directory.
Returns: all available Actions
UNKNOWN: an accessor to a collection of all available Actions.
UNKNOWN: Called upon right-click to activate the popupmenu.
UNKNOWN: Goes one step back in the history and opens that url.
UNKNOWN: Goes one directory up from the current url.
UNKNOWN: Checks if there support from KIO.PreviewJob for the currently shown files, taking mimeFilter() and nameFilter() into account Enables/disables the preview-action accordingly.
See Also: KDirOperator KDirOperator
UNKNOWN: Clears both the namefilter and mimetype filter, so that all files and directories will be shown.
UNKNOWN: Clears the forward and backward history.
UNKNOWN: Stops loading immediately.
Returns: a KCompletion object, containing all filenames and directories of the current directory/URL. You can use it to insert it into a KLineEdit or KComboBox Note: it will only contain files, after prepareCompletionObjects() has been called. It will be implicitly called from makeCompletion() or makeDirCompletion()
UNKNOWN:
Parameters: parent is the QWidget to be set as parent view is the predefined view to be set, note: this can be several ones OR:ed together.
Returns: the created KFileView
See Also: KFileView KCombiView KFileDetailView KFileIconView KFilePreview KFile KDirOperator
UNKNOWN: A view factory for creating predefined fileviews.
items.
Parameters: items the list of items to be deleted ask specifies whether a confirmation dialog should be shown showProgress passed to the DeleteJob to show a progress dialog
UNKNOWN: Starts and returns a KIO.DeleteJob to delete the given items.
items.
Parameters: items the list of items to be deleted parent the parent widget used for the confirmation dialog ask specifies whether a confirmation dialog should be shown showProgress passed to the DeleteJob to show a progress dialog
UNKNOWN: Starts and returns a KIO.DeleteJob to delete the given items.
UNKNOWN: Deletes the currently selected files/directories.
Returns: a KCompletion object, containing only all directories of the current directory/URL. You can use it to insert it into a KLineEdit or KComboBox Note: it will only contain directories, after prepareCompletionObjects() has been called. It will be implicitly called from makeCompletion() or makeDirCompletion()
UNKNOWN:
Returns: whether the last directory will be made the current item when going up in the directory hierarchy.
UNKNOWN:
Returns: the object listing the directory
UNKNOWN:
Returns: true if we are in directory-only mode, that is, no files are shown.
UNKNOWN:
UNKNOWN: Goes one step forward in the history and opens that url.
UNKNOWN: Emits fileHighlighted( i )
UNKNOWN: Enters the home directory.
UNKNOWN: Adds a new list of KFileItems to the view (coming from KDirLister)
Returns: true if we are displaying the root directory of the current url
UNKNOWN:
Returns: true if item
is currently selected, or false otherwise.
UNKNOWN:
UNKNOWN: Removes the given KFileItem item from the view (usually called from KDirLister).
UNKNOWN: Tries to complete the given string (only completes files).
UNKNOWN: Tries to complete the given string (only completes directores).
Returns: the current mime filter.
UNKNOWN:
Returns: true if the directory could be created.
UNKNOWN: Creates the given directory/url.
UNKNOWN: Opens a dialog to create a new directory.
Returns: the listing/selection mode.
UNKNOWN:
Returns: the number of directories in the currently listed url. Returns 0 if there is no view.
UNKNOWN:
Returns: the number of files in the currently listed url. Returns 0 if there is no view.
UNKNOWN:
Returns: whether files (not directories) should only be select()ed by double-clicks.
See Also: KDirOperator
UNKNOWN:
UNKNOWN: Called after setURL() to load the directory, update the history, etc.
UNKNOWN: Synchronizes the completion objects with the entries of the currently listed url.
Returns: the progress widget, that is shown during directory listing. You can for example reparent() it to put it into a statusbar.
UNKNOWN:
setView( KFile.Default )to apply it.
See Also: KDirOperator KDirOperator KDirOperator
UNKNOWN: Reads the default settings for a view, i.
UNKNOWN: Re-reads the current url.
UNKNOWN: Restores the normal cursor after showing the busy-cursor.
item.
UNKNOWN: Enters the directory specified by the given item.
Returns: a list of all currently selected items. If there is no view, then 0L is returned.
UNKNOWN:
UNKNOWN: Emits fileSelected( item )
b
is trueParameters: b true if the widget should allow dropping of files
UNKNOWN: Reimplemented - allow dropping of files if b
is true
filename
the current file. filename is just the name, no path or url.UNKNOWN: Clears the current selection and attempts to set filename
the current file.
UNKNOWN: Sets a custom KDirLister to list directories.
See Also: KFileView
UNKNOWN: Sets the options for dropping files.
UNKNOWN: When going up in the directory hierarchy, KDirOperator can highlight the directory that was just left.
ArrayList filter; filter << "text/html" << "image/png" << "inode/directory"; dirOperator.setMimefilter( filter );Node: Without the mimetype inode/directory, only files would be shown. Call updateDir() to apply it.
See Also: KDirLister KDirOperator
UNKNOWN: Sets a list of mimetypes as filter.
UNKNOWN: Sets the listing/selection mode for the views, an OR'ed combination of
See Also: KDirLister KDirOperator
UNKNOWN: Sets a filter like " .
UNKNOWN: This is a KFileDialog specific hack: we want to select directories with single click, but not files.
w
is transferred to KDirOperator, so don't
delete it yourself!UNKNOWN: Sets a preview-widget to be shown next to the file-view.
UNKNOWN: Enables/disables showing hidden files.
UNKNOWN: Sets the way to sort files and directories.
UNKNOWN: Sets up all the actions.
Parameters: whichActions is an value of OR'd ActionTypes that controls which actions to show in the action menu
UNKNOWN: Sets up the action menu.
UNKNOWN: Sets up the context-menu with all the necessary actions.
Parameters: clearforward specifies whether the "forward" history should be cleared. url the URL to set
UNKNOWN: Sets a new url to list.
See Also: KFileView KFileIconView KFileDetailView KCombiView KDirOperator
UNKNOWN: Sets a new KFileView to be used for showing and browsing files.
See Also: KFile
UNKNOWN: Sets one of the predefined fileviews
See Also: KDirOperator KDirOperator
UNKNOWN: Sets the config object and the to be used group in KDirOperator.
Returns: true when hidden files are shown or false otherwise.
UNKNOWN:
match
as current item in the view and emits
completion( match )UNKNOWN: Tries to make the given match
as current item in the view and emits completion( match )
UNKNOWN: Changes sorting to sort by date
UNKNOWN: Changes sorting to sort by name
UNKNOWN: Changes sorting to sort by size
Returns: the current way of sorting files and directories
UNKNOWN:
UNKNOWN: Changes sorting to reverse sorting
UNKNOWN: Toggles showing directories first / having them sorted like files.
UNKNOWN: Toggles case sensitive / case insensitive sorting
items.
Parameters: items the list of items to be trashed parent the parent widget used for the confirmation dialog ask specifies whether a confirmation dialog should be shown showProgress passed to the CopyJob to show a progress dialog
UNKNOWN: Starts and returns a KIO.CopyJob to trash the given items.
UNKNOWN: Trashes the currently selected files/directories.
UNKNOWN: to update the view after changing the settings
UNKNOWN: Enables/disables actions that are selection dependent.
See Also: KDirOperator
UNKNOWN: Updates the sorting-related actions to comply with the current sorting
UNKNOWN: Updates the view-related actions to comply with the current KFile.FileView
Returns: the current url
UNKNOWN:
Returns: the KConfig object used for saving and restoring view's configuration.
UNKNOWN: Returns the KConfig object used for saving and restoring view's configuration.
Returns: the group name used for saving and restoring view's configuration.
UNKNOWN: Returns the group name used for saving and restoring view's configuration.
UNKNOWN: Returns the widget of the current view.
See Also: KDirOperator KDirOperator
UNKNOWN: Saves the current settings like sorting, simple or detailed view.