diff options
| author | Peter Penz <[email protected]> | 2012-04-12 23:57:51 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-13 00:11:36 +0200 |
| commit | 31ee4085c2b2c374158fb956ac376399ff375b5a (patch) | |
| tree | 1e48eb6c8b01a044abab1a186621c47e1f7e8215 /src/dolphinviewcontainer.h | |
| parent | 2c4e59a16f0a30fb0b6d8ef6cb44efff27166416 (diff) | |
Use KMessageWidget for error- and information-messages
See http://agateau.com/2011/04/21/kde-ux-2011/ for more details.
This simplifies the statusbar in Dolphin a lot and allows to
do a proper eliding in case if status-messages are too long: In
this case a tooltip will show the whole status-message (thanks
to Wolfgang Mader for the initial patch!).
There is still missing some finetuning but the general approach
seems to work quite nice.
BUG: 249638
BUG: 245618
BUG: 146533
FIXED-IN: 4.9.0
Diffstat (limited to 'src/dolphinviewcontainer.h')
| -rw-r--r-- | src/dolphinviewcontainer.h | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index b3c48ccf9..5e98f5e94 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -33,6 +33,7 @@ #include <views/dolphinview.h> class FilterBar; +class KMessageWidget; class KUrl; class KUrlNavigator; class DolphinSearchBox; @@ -55,6 +56,13 @@ class DolphinViewContainer : public QWidget Q_OBJECT public: + enum MessageType + { + Information, + Warning, + Error + }; + DolphinViewContainer(const KUrl& url, QWidget* parent); virtual ~DolphinViewContainer(); @@ -84,6 +92,12 @@ public: DolphinSearchBox* searchBox(); /** + * Shows the message \msg with the given type non-modal above + * the view-content. + */ + void showMessage(const QString& msg, MessageType type); + + /** * Refreshes the view container to get synchronized with the (updated) Dolphin settings. */ void readSettings(); @@ -183,15 +197,6 @@ private slots: */ void showItemInfo(const KFileItem& item); - /** Shows the information \a msg inside the statusbar. */ - void showInfoMessage(const QString& msg); - - /** Shows the error message \a msg inside the statusbar. */ - void showErrorMessage(const QString& msg); - - /** Shows the "operation completed" message \a msg inside the statusbar. */ - void showOperationCompletedMessage(const QString& msg); - void closeFilterBar(); /** @@ -259,7 +264,19 @@ private slots: * Stops the loading of a directory. Is connected with the "stopPressed" signal * from the statusbar. */ - void stopLoading(); + void stopDirectoryLoading(); + + void slotStatusBarZoomLevelChanged(int zoomLevel); + + /** + * Slot that calls showMessage(msg, Error). + */ + void showErrorMessage(const QString& msg); + + /** + * Slot that calls showMessage(msg, Information). + */ + void showInfoMessage(const QString& msg); private: /** @@ -277,6 +294,7 @@ private: QVBoxLayout* m_topLayout; KUrlNavigator* m_urlNavigator; DolphinSearchBox* m_searchBox; + KMessageWidget* m_messageWidget; DolphinView* m_view; |
