org.kde.koala
Class KFileDialog
public
class
KFileDialog
extends KDialogBase
Provides a user (and developer) friendly way to
select files and directories.
The widget can be used as a drop in replacement for the
QFileDialog widget, but has greater functionality and a nicer GUI.
You will usually want to use one of the static methods
getOpenFileName(), getSaveFileName(), getOpenURL()
or for multiple files getOpenFileNames() or getOpenURLs().
The dialog has been designed to allow applications to customise it
by subclassing. It uses geometry management to ensure that subclasses
can easily add children that will be incorporated into the layout.
\image html kfiledialog.png "KDE File Dialog"
See
KFileDialogSignals for signals emitted by KFileDialog
Author: Richard J. Moore , Carsten Pfeiffer
UNKNOWN: A file selection dialog.
Constructor Summary |
protected | KFileDialog(Class dummy) |
| KFileDialog(String startDir, String filter, QWidget parent, String name, boolean modal)
Constructs a file dialog. |
| KFileDialog(String startDir, String filter, QWidget parent, String name, boolean modal, QWidget widget)
Constructs a file dialog.
|
Method Summary |
protected void | accept() |
KActionCollection | actionCollection() |
protected void | addToRecentDocuments() |
KURL | baseURL() |
KPushButton | cancelButton() |
String | className() |
void | clearFilter()
Clears any mime- or namefilter. |
String | currentFilter()
Returns the current filter as entered by the user or one of the
predefined set via setFilter(). |
protected String | currentFilterExtension()
Returns the filename extension associated with the currentFilter().
null is returned if an extension is not available or if
operationMode() ! |
String | currentMimeFilter()
The mimetype for the desired output format.
|
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | enterURL(KURL url) |
protected void | enterURL(String url) |
protected void | fileCompletion(String arg1) |
protected void | fileHighlighted(KFileItem i) |
protected void | fileSelected(KFileItem i) |
protected void | finalize() Deletes the wrapped C++ instance |
protected KURL | getCompleteURL(String arg1)
Returns the absolute version of the URL specified in locationEdit. |
static String | getExistingDirectory(String startDir, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
directory or an empty string if none was chosen. |
static String | getExistingDirectory(String startDir, QWidget parent) |
static String | getExistingDirectory(String startDir) |
static String | getExistingDirectory() |
static KURL | getExistingURL(String startDir, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
directory or an empty string if none was chosen.
|
static KURL | getExistingURL(String startDir, QWidget parent) |
static KURL | getExistingURL(String startDir) |
static KURL | getExistingURL() |
static KURL | getImageOpenURL(String startDir, QWidget parent, String caption)
Creates a modal file dialog with an image previewer and returns the
selected url or an empty string if none was chosen. |
static KURL | getImageOpenURL(String startDir, QWidget parent) |
static KURL | getImageOpenURL(String startDir) |
static KURL | getImageOpenURL() |
static String | getOpenFileName(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and return the selected
filename or an empty string if none was chosen.
|
static String | getOpenFileName(String startDir, String filter, QWidget parent) |
static String | getOpenFileName(String startDir, String filter) |
static String | getOpenFileName(String startDir) |
static String | getOpenFileName() |
static ArrayList | getOpenFileNames(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
filenames or an empty list if none was chosen.
|
static ArrayList | getOpenFileNames(String startDir, String filter, QWidget parent) |
static ArrayList | getOpenFileNames(String startDir, String filter) |
static ArrayList | getOpenFileNames(String startDir) |
static ArrayList | getOpenFileNames() |
static String | getOpenFileNameWId(String startDir, String filter, long parent_id, String caption)
Use this version only if you have no QWidget available as
parent widget. |
static KURL | getOpenURL(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
URL or an empty string if none was chosen.
|
static KURL | getOpenURL(String startDir, String filter, QWidget parent) |
static KURL | getOpenURL(String startDir, String filter) |
static KURL | getOpenURL(String startDir) |
static KURL | getOpenURL() |
static ArrayList | getOpenURLs(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
URLs or an empty list if none was chosen.
|
static ArrayList | getOpenURLs(String startDir, String filter, QWidget parent) |
static ArrayList | getOpenURLs(String startDir, String filter) |
static ArrayList | getOpenURLs(String startDir) |
static ArrayList | getOpenURLs() |
static String | getSaveFileName(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
filename or an empty string if none was chosen.
|
static String | getSaveFileName(String startDir, String filter, QWidget parent) |
static String | getSaveFileName(String startDir, String filter) |
static String | getSaveFileName(String startDir) |
static String | getSaveFileName() |
static String | getSaveFileNameWId(String dir, String filter, long parent_id, String caption)
This function accepts the window id of the parent window, instead
of QWidget. |
static KURL | getSaveURL(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
filename or an empty string if none was chosen.
|
static KURL | getSaveURL(String startDir, String filter, QWidget parent) |
static KURL | getSaveURL(String startDir, String filter) |
static KURL | getSaveURL(String startDir) |
static KURL | getSaveURL() |
static KURL | getStartURL(String startDir, StringBuffer recentDirClass)
This method implements the logic to determine the user's default directory
to be listed. |
protected void | init(String startDir, String filter, QWidget widget)
Perform basic initialization tasks. |
protected void | initGUI()
rebuild geometry management. |
protected void | initSpeedbar() |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | keepsLocation() |
protected void | keyPressEvent(QKeyEvent e)
Reimplemented to animate the cancel button. |
protected void | locationActivated(String url) |
QMetaObject | metaObject() |
int | mode()
Returns the mode of the filedialog. |
protected void | multiSelectionChanged()
called when an item is highlighted/selected in multiselection mode.
handles setting the locationEdit. |
KPushButton | okButton() |
int | operationMode() |
protected ArrayList | parseSelectedURLs() |
int | pathComboIndex() |
protected void | readConfig(KConfig arg1, String group)
Reads configuration and applies it (size, recent directories, ...) |
protected void | readConfig(KConfig arg1) |
protected void | readRecentFiles(KConfig arg1)
Reads the recent used files and inserts them into the location combobox |
protected void | saveRecentFiles(KConfig arg1)
Saves the entries from the location combobox. |
String | selectedFile()
Returns the full path of the selected file in the local filesystem.
|
ArrayList | selectedFiles()
Returns a list of all selected local files. |
KURL | selectedURL() |
ArrayList | selectedURLs() |
void | setFilter(String filter)
Sets the filter to be used to filter.
You can set more
filters for the user to select separated by '\n'. |
void | setKeepLocation(boolean keep)
Sets whether the filename/url should be kept when changing directories.
|
void | setLocationLabel(String text)
Sets the text to be displayed in front of the selection.
|
void | setMimeFilter(String[] types, String defaultType)
Sets the filter up to specify the output type. |
void | setMimeFilter(String[] types) |
void | setMode(int m)
Convenient overload of the other setMode(unsigned int) method. |
void | setOperationMode(int arg1)
Sets the operational mode of the filedialog to Saving , Opening
or Other. This will set some flags that are specific to loading
or saving files. |
void | setPreviewWidget(KPreviewWidgetBase w)
Adds a preview widget and enters the preview mode.
|
void | setSelection(String name)
Sets the file name to preselect to name
This takes absolute URLs and relative file names. |
static void | setStartDir(KURL directory)
Used by KDirSelectDialog to share the dialog's start directory. |
void | setURL(KURL url, boolean clearforward)
Sets the directory to view. |
void | setURL(KURL url) |
void | show() |
protected void | slotAutoSelectExtClicked() |
protected void | slotCancel() |
protected void | slotFilterChanged() |
protected void | slotLoadingFinished() |
protected void | slotOk() |
protected void | slotStatResult(Job job) |
KURLBar | speedBar()
Note that this method may return a null-pointer if the user configured
to not use the speed-bar. |
protected void | toggleBookmarks(boolean show) |
protected void | toggleSpeedbar(boolean arg1) |
protected ArrayList | tokenize(String line)
Parses the string "line" for files. |
KToolBar | toolBar()
Returns a pointer to the toolbar.
|
protected void | updateAutoSelectExtension()
Updates the currentFilterExtension and the availability of the
Automatically Select Extension Checkbox (visible if operationMode()
== Saving and enabled if an extension _will_ be associated with the
currentFilter(), _after_ this call). |
protected void | urlEntered(KURL arg1) |
protected void | writeConfig(KConfig arg1, String group)
Saves the current configuration |
protected void | writeConfig(KConfig arg1) |
public static final int Opening
public static final int Other
Defines some default behavior of the filedialog.
E.g. in mode
Opening
and
Saving
, the selected files/urls will
be added to the "recent documents" list. The Saving mode also implies
setKeepLocation() being set.
Other
means that no default actions are performed.
See Also: KFileDialog KFileDialog
UNKNOWN: Defines some default behavior of the filedialog.
public static final int Saving
protected KFileDialog(Class dummy)
public KFileDialog(String startDir, String filter, QWidget parent, String name, boolean modal)
Constructs a file dialog.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter A shell glob or a mime-type-filter that specifies
which files to display. parent The parent widget of this dialog name The name of this object modal Whether to create a modal dialog or not
See setFilter() for details on how to use this argument.
UNKNOWN: Constructs a file dialog.
public KFileDialog(String startDir, String filter, QWidget parent, String name, boolean modal, QWidget widget)
Constructs a file dialog.
The parameters here are identical to the first constructor except
for the addition of a QWidget parameter.
Historical note: The original version of KFileDialog did not have this extra
parameter. It was added later, and, in order to maintain binary compatibility,
it was placed in a new constructor instead of added to the original one.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter A shell glob or a mime-type-filter that specifies
which files to display.
See setFilter() for details on how to use this argument. widget A widget, or a widget of widgets, for displaying custom
data in the dialog. This can be used, for example, to
display a check box with the caption "Open as read-only".
When creating this widget, you don't need to specify a parent,
since the widget's parent will be set automatically by KFileDialog. parent The parent widget of this dialog name The name of this object modal Whether to create a modal dialog or not
UNKNOWN: Constructs a file dialog.
protected void accept()
Returns: a pointer to the action collection, holding all the used
KActions.
UNKNOWN:
protected void addToRecentDocuments()
Returns: the currently shown directory.
UNKNOWN:
Returns: a pointer to the Cancel-Button in the filedialog. You may use
it e.g. to set a custom text to it.
UNKNOWN:
public String className()
public void clearFilter()
Clears any mime- or namefilter. Does not reload the directory.
UNKNOWN: Clears any mime- or namefilter.
public String currentFilter()
Returns the current filter as entered by the user or one of the
predefined set via setFilter().
See Also: KFileDialog KFileDialog
UNKNOWN: Returns the current filter as entered by the user or one of the predefined set via setFilter().
protected String currentFilterExtension()
Returns the filename extension associated with the currentFilter().
null is returned if an extension is not available or if
operationMode() != Saving.
UNKNOWN: Returns the filename extension associated with the currentFilter().
public String currentMimeFilter()
The mimetype for the desired output format.
This is only valid if setMimeFilter() has been called
previously.
See Also: KFileDialog
UNKNOWN: The mimetype for the desired output format.
public void dispose()
Delete the wrapped C++ instance ahead of finalize()
protected void enterURL(
KURL url)
protected void enterURL(String url)
protected void fileCompletion(String arg1)
protected void finalize()
Deletes the wrapped C++ instance
protected
KURL getCompleteURL(String arg1)
Returns the absolute version of the URL specified in locationEdit.
UNKNOWN: Returns the absolute version of the URL specified in locationEdit.
public static String getExistingDirectory(String startDir, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
directory or an empty string if none was chosen.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected directory or an empty string if none was chosen.
public static String getExistingDirectory(String startDir, QWidget parent)
public static String getExistingDirectory(String startDir)
public static String getExistingDirectory()
public static
KURL getExistingURL(String startDir, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
directory or an empty string if none was chosen.
Contrary to getExistingDirectory(), this method allows the
selection of a remote directory.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected directory or an empty string if none was chosen.
public static
KURL getExistingURL(String startDir, QWidget parent)
public static
KURL getExistingURL(String startDir)
public static
KURL getExistingURL()
public static
KURL getImageOpenURL(String startDir, QWidget parent, String caption)
Creates a modal file dialog with an image previewer and returns the
selected url or an empty string if none was chosen.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog with an image previewer and returns the selected url or an empty string if none was chosen.
public static
KURL getImageOpenURL(String startDir, QWidget parent)
public static
KURL getImageOpenURL(String startDir)
public static
KURL getImageOpenURL()
public static String getOpenFileName(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and return the selected
filename or an empty string if none was chosen.
Note that with
this method the user must select an existing filename.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter This is a space separated list of shell globs.
You can set the text to be displayed for the glob, and
provide multiple globs. See setFilter() for details on
how to do this... parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and return the selected filename or an empty string if none was chosen.
public static String getOpenFileName(String startDir, String filter, QWidget parent)
public static String getOpenFileName(String startDir, String filter)
public static String getOpenFileName(String startDir)
public static String getOpenFileName()
public static ArrayList getOpenFileNames(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
filenames or an empty list if none was chosen.
Note that with
this method the user must select an existing filename.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter This is a space separated list of shell globs.
You can set the text to be displayed for the glob, and
provide multiple globs. See setFilter() for details on
how to do this... parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected filenames or an empty list if none was chosen.
public static ArrayList getOpenFileNames(String startDir, String filter, QWidget parent)
public static ArrayList getOpenFileNames(String startDir, String filter)
public static ArrayList getOpenFileNames(String startDir)
public static ArrayList getOpenFileNames()
public static String getOpenFileNameWId(String startDir, String filter, long parent_id, String caption)
Use this version only if you have no QWidget available as
parent widget. This can be the case if the parent widget is
a widget in another process or if the parent widget is a
non-Qt widget. For example, in a GTK program.
UNKNOWN: Use this version only if you have no QWidget available as parent widget.
public static
KURL getOpenURL(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
URL or an empty string if none was chosen.
Note that with
this method the user must select an existing URL.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter This is a space separated list of shell globs.
You can set the text to be displayed for the glob, and
provide multiple globs. See setFilter() for details on
how to do this... parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected URL or an empty string if none was chosen.
public static
KURL getOpenURL(String startDir, String filter, QWidget parent)
public static
KURL getOpenURL(String startDir, String filter)
public static
KURL getOpenURL(String startDir)
public static
KURL getOpenURL()
public static ArrayList getOpenURLs(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
URLs or an empty list if none was chosen.
Note that with
this method the user must select an existing filename.
Parameters: startDir This can either be
The URL of the directory to start in.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter This is a space separated list of shell globs.
You can set the text to be displayed for the glob, and
provide multiple globs. See setFilter() for details on
how to do this... parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected URLs or an empty list if none was chosen.
public static ArrayList getOpenURLs(String startDir, String filter, QWidget parent)
public static ArrayList getOpenURLs(String startDir, String filter)
public static ArrayList getOpenURLs(String startDir)
public static ArrayList getOpenURLs()
public static String getSaveFileName(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
filename or an empty string if none was chosen.
Note that with this
method the user need not select an existing filename.
Parameters: startDir This can either be
The URL of the directory to start in.
a relative path or a filename determining the
directory to start in and the file to be selected.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter This is a space separated list of shell globs.
You can set the text to be displayed for the glob, and
provide multiple globs. See setFilter() for details on
how to do this... parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected filename or an empty string if none was chosen.
public static String getSaveFileName(String startDir, String filter, QWidget parent)
public static String getSaveFileName(String startDir, String filter)
public static String getSaveFileName(String startDir)
public static String getSaveFileName()
public static String getSaveFileNameWId(String dir, String filter, long parent_id, String caption)
This function accepts the window id of the parent window, instead
of QWidget. It should be used only when necessary.
UNKNOWN: This function accepts the window id of the parent window, instead of QWidget .
public static
KURL getSaveURL(String startDir, String filter, QWidget parent, String caption)
Creates a modal file dialog and returns the selected
filename or an empty string if none was chosen.
Note that with this
method the user need not select an existing filename.
Parameters: startDir This can either be
The URL of the directory to start in.
a relative path or a filename determining the
directory to start in and the file to be selected.
null to start in the current working
directory, or the last directory where a file has been
selected.
':<keyword>' to start in the directory last used
by a filedialog in the same application that specified
the same keyword.
'.<keyword>' to start in the directory last used
by a filedialog in any application that specified the
same keyword.
filter This is a space separated list of shell globs.
You can set the text to be displayed for the glob, and
provide multiple globs. See setFilter() for details on
how to do this... parent The widget the dialog will be centered on initially. caption The name of the dialog widget.
UNKNOWN: Creates a modal file dialog and returns the selected filename or an empty string if none was chosen.
public static
KURL getSaveURL(String startDir, String filter, QWidget parent)
public static
KURL getSaveURL(String startDir, String filter)
public static
KURL getSaveURL(String startDir)
public static
KURL getSaveURL()
public static
KURL getStartURL(String startDir, StringBuffer recentDirClass)
This method implements the logic to determine the user's default directory
to be listed. E.g. the documents direcory, home directory or a recently
used directory.
Parameters: startDir A url/directory, to be used. May use the ':' and '.' syntax
as documented in the KFileDialog() constructor. recentDirClass If the ':' or '.' syntax is used, recentDirClass
will contain the string to be used later for KRecentDir.dir()
Returns: The URL that should be listed by default (e.g. by KFileDialog or
KDirSelectDialog).
UNKNOWN: This method implements the logic to determine the user's default directory to be listed.
protected void init(String startDir, String filter, QWidget widget)
Perform basic initialization tasks. Called by constructors.
UNKNOWN: Perform basic initialization tasks.
protected void initGUI()
rebuild geometry management.
UNKNOWN: rebuild geometry management.
protected void initSpeedbar()
public boolean isDisposed()
Has the wrapped C++ instance been deleted?
public boolean keepsLocation()
Returns: whether the contents of the location edit are kept when
changing directories.
UNKNOWN:
protected void keyPressEvent(QKeyEvent e)
Reimplemented to animate the cancel button.
UNKNOWN: Reimplemented to animate the cancel button.
protected void locationActivated(String url)
public QMetaObject metaObject()
public int mode()
Returns the mode of the filedialog.
See Also: KFileDialog
UNKNOWN: Returns the mode of the filedialog.
protected void multiSelectionChanged()
called when an item is highlighted/selected in multiselection mode.
handles setting the locationEdit.
UNKNOWN: called when an item is highlighted/selected in multiselection mode.
Returns: a pointer to the OK-Button in the filedialog. You may use it
e.g. to set a custom text to it.
UNKNOWN:
public int operationMode()
Returns: the current operation mode, Opening, Saving or Other. Default
is Other.
See Also: KFileDialog KFileDialog
UNKNOWN:
protected ArrayList parseSelectedURLs()
public int pathComboIndex()
Returns: the index of the path combobox so when inserting widgets into
the dialog (e.g. subclasses) they can do so without hardcoding in an index
UNKNOWN:
protected void readConfig(
KConfig arg1, String group)
Reads configuration and applies it (size, recent directories, ...)
UNKNOWN: Reads configuration and applies it (size, recent directories, .
protected void readConfig(
KConfig arg1)
protected void readRecentFiles(
KConfig arg1)
Reads the recent used files and inserts them into the location combobox
UNKNOWN: Reads the recent used files and inserts them into the location combobox
protected void saveRecentFiles(
KConfig arg1)
Saves the entries from the location combobox.
UNKNOWN: Saves the entries from the location combobox.
public String selectedFile()
Returns the full path of the selected file in the local filesystem.
(Local files only)
UNKNOWN: Returns the full path of the selected file in the local filesystem.
public ArrayList selectedFiles()
Returns a list of all selected local files.
UNKNOWN: Returns a list of all selected local files.
public
KURL selectedURL()
Returns: The selected fully qualified filename.
UNKNOWN:
public ArrayList selectedURLs()
Returns: The list of selected URLs.
UNKNOWN:
public void setFilter(String filter)
Sets the filter to be used to
filter.
You can set more
filters for the user to select separated by '\n'. Every
filter entry is defined through namefilter|text to diplay.
If no | is found in the expression, just the namefilter is
shown. Examples:
kfile.setFilter("*.cpp|C++ Source Files\n.h|Header files");
kfile.setFilter("*.cpp");
kfile.setFilter("*.cpp|Sources (.cpp)");
kfile.setFilter("*.cpp|" + i18n("Sources (.cpp)"));
kfile.setFilter("*.cpp .cc .C|C++ Source Files\n.h .H|Header files");
Note: The text to display is not parsed in any way. So, if you
want to show the suffix to select by a specific filter, you must
repeat it.
If the filter contains an unescaped '/', a mimetype-filter is assumed.
If you would like a '/' visible in your filter it can be escaped with
a '\'. You can specify multiple mimetypes like this (separated with
space):
kfile.setFilter( "image/png text/html text/plain" );
kfile.setFilter( "*.cue|CUE\\/BIN Files (.cue)" );
See Also: KFileDialog KFileDialog
UNKNOWN: Sets the filter to be used to filter.
public void setKeepLocation(boolean keep)
Sets whether the filename/url should be kept when changing directories.
This is for example useful when having a predefined filename where
the full path for that file is searched.
This is implicitly set when operationMode() is KFileDialog.Saving
getSaveFileName() and getSaveURL() set this to true by default, so that
you can type in the filename and change the directory without having
to type the name again.
UNKNOWN: Sets whether the filename/url should be kept when changing directories.
public void setLocationLabel(String text)
Sets the text to be displayed in front of the selection.
The default is "Location".
Most useful if you want to make clear what
the location is used for.
UNKNOWN: Sets the text to be displayed in front of the selection.
public void setMimeFilter(String[] types, String defaultType)
Sets the filter up to specify the output type.
Parameters: types a list of mimetypes that can be used as output format defaultType the default mimetype to use as output format, if any.
If defaultType
is set, it will be set as the current item.
Otherwise, a first item showing all the mimetypes will be created.
Typically, defaultType
should be empty for loading and set for saving.
Do not use in conjunction with setFilter()
UNKNOWN: Sets the filter up to specify the output type.
public void setMimeFilter(String[] types)
public void setMode(int m)
Convenient overload of the other setMode(unsigned int) method.
UNKNOWN: Convenient overload of the other setMode(unsigned int) method.
public void setOperationMode(int arg1)
Sets the operational mode of the filedialog to
Saving
,
Opening
or
Other.
This will set some flags that are specific to loading
or saving files. E.g. setKeepLocation() makes mostly sense for
a save-as dialog. So setOperationMode( KFileDialog.Saving ); sets
setKeepLocation for example.
The mode
Saving
, together with a default filter set via
setMimeFilter() will make the filter combobox read-only.
The default mode is
Opening.
Call this method right after instantiating KFileDialog.
See Also: KFileDialog KFileDialog
UNKNOWN: Sets the operational mode of the filedialog to Saving
, Opening
or Other.
Adds a preview widget and enters the preview mode.
In this mode the dialog is split and the right part contains your
preview widget.
Ownership is transferred to KFileDialog. You need to create the
preview-widget with "new", i.e. on the heap.
Parameters: w The widget to be used for the preview.
UNKNOWN: Adds a preview widget and enters the preview mode.
public void setSelection(String name)
Sets the file name to preselect to
name
This takes absolute URLs and relative file names.
UNKNOWN: Sets the file name to preselect to name
public static void setStartDir(
KURL directory)
Used by KDirSelectDialog to share the dialog's start directory.
UNKNOWN:
public void setURL(
KURL url, boolean clearforward)
Sets the directory to view.
Parameters: url URL to show. clearforward Indicates whether the forward queue
should be cleared.
UNKNOWN: Sets the directory to view.
public void setURL(
KURL url)
public void show()
protected void slotAutoSelectExtClicked()
protected void slotCancel()
protected void slotFilterChanged()
protected void slotLoadingFinished()
protected void slotOk()
protected void slotStatResult(
Job job)
Note that this method may return a null-pointer if the user configured
to not use the speed-bar.
Returns: the KURLBar object used as the "speed bar". You can add custom
entries to it like that:
KURLBar *urlBar = fileDialog.speedBar();
if ( urlBar )
urlBar.insertDynamicItem( someURL, i18n("The URL's description") );
See Also: KURLBar KURLBar
UNKNOWN:
protected void toggleBookmarks(boolean show)
protected void toggleSpeedbar(boolean arg1)
protected ArrayList tokenize(String line)
Parses the string "line" for files. If line doesn't contain any ", the
whole line will be interpreted as one file. If the number of " is odd,
an empty list will be returned. Otherwise, all items enclosed in " "
will be returned as correct urls.
UNKNOWN: Parses the string "line" for files.
Returns a pointer to the toolbar.
You can use this to insert custom
items into it, e.g.:
yourAction = new KAction( i18n("Your Action"), 0,
this, SLOT("yourSlot()"),
this, "action name" );
yourAction.plug( kfileDialog.toolBar() );
UNKNOWN: Returns a pointer to the toolbar.
protected void updateAutoSelectExtension()
Updates the currentFilterExtension and the availability of the
Automatically Select Extension Checkbox (visible if operationMode()
== Saving and enabled if an extension _will_ be associated with the
currentFilter(), _after_ this call). You should call this after
filterWidget.setCurrentItem().
UNKNOWN: Updates the currentFilterExtension and the availability of the Automatically Select Extension Checkbox (visible if operationMode() == Saving and enabled if an extension _will_ be associated with the currentFilter(), _after_ this call).
protected void urlEntered(
KURL arg1)
protected void writeConfig(
KConfig arg1, String group)
Saves the current configuration
UNKNOWN: Saves the current configuration
protected void writeConfig(
KConfig arg1)