BrowserOpenOrSaveQuestion Class Reference
from PyKDE4.kparts import *
Namespace: KParts
Detailed Description
This class shows the dialog that asks the user whether to save a url or open a url in another application.
It also has the variant which asks "save or embed" (e.g. into konqueror).
- Since:
- 4.4
Enumerations | |
Feature | { BasicFeatures, ServiceSelection } |
Result | { Save, Open, Embed, Cancel } |
Methods | |
__init__ (self, QWidget parent, KUrl url, QString mimeType) | |
KParts.BrowserOpenOrSaveQuestion.Result | askEmbedOrSave (self, int flags=0) |
KParts.BrowserOpenOrSaveQuestion.Result | askOpenOrSave (self) |
KSharedPtr | selectedService (self) |
setFeatures (self, KParts.BrowserOpenOrSaveQuestion.Features features) | |
setSuggestedFileName (self, QString suggestedFileName) |
Method Documentation
Constructor, for all kinds of dialogs shown in this class.
- Parameters:
-
url the URL in question mimeType the mimetype of the URL
KParts.BrowserOpenOrSaveQuestion.Result askEmbedOrSave | ( | self, | ||
int | flags=0 | |||
) |
Ask the user whether to save or open a url in another application.
- Parameters:
-
parent parent widget for the dialog flags set to BrowserRun.AttachmentDisposition if suggested by the server This is used because by default text/html files are opened embedded in browsers, not saved. But if the server said "attachment", it means the user is download a file for saving it.
- Returns:
- Save, Embed or Cancel.
KParts.BrowserOpenOrSaveQuestion.Result askOpenOrSave | ( | self ) |
Ask the user whether to save or open a url in another application.
- Parameters:
-
parent parent widget for the dialog
- Returns:
- Save, Open or Cancel.
KSharedPtr |
( | self ) |
- Returns:
- the service that was selected during askOpenOrSave, if it returned Open. In all other cases (no associated application, Save or Cancel selected), this returns 0.
Requires setFeatures(BrowserOpenOrSaveQuestion.ServiceSelection).
setFeatures | ( | self, | ||
KParts.BrowserOpenOrSaveQuestion.Features | features | |||
) |
Enables the given features in the dialog
setSuggestedFileName | ( | self, | ||
QString | suggestedFileName | |||
) |
Sets the suggested filename, shown in the dialog.
- Parameters:
-
suggestedFileName optional file name suggested by the server (HTTP Content-Disposition)
Enumeration Documentation
Feature |
Set of features that should be enabled in this dialog. This allows to add features before making all applications ready for those features (e.g. applications need to read selectedService() otherwise the dialog should not show the service selection button)
- Enumerator:
-
BasicFeatures = 0 ServiceSelection = 1
Result |
- Enumerator:
-
Save Open Embed Cancel