#include <sidebarpage.h>
-#include <qpushbutton.h>
-#include <QPixmap>
-#include <QEvent>
-#include <QLabel>
-#include <QList>
+#include <QtGui/QPushButton>
+#include <QtGui/QPixmap>
+#include <QtCore/QEvent>
+#include <QtGui/QLabel>
+#include <QtCore/QList>
#include <kurl.h>
#include <kmimetype.h>
-#include <kdedesktopmimetype.h>
+#include <kdesktopfileactions.h>
#include <kvbox.h>
-namespace KIO {
+namespace KIO
+{
class Job;
}
class KFileItem;
class QLabel;
class KVBox;
-class Q3Grid;
class PixmapViewer;
class MetaDataWidget;
/**
- * @brief Prototype for a information sidebar.
- *
- * Will be exchanged in future releases by pluggable sidebar pages...
+ * @brief Sidebar for showing meta information of one ore more selected items.
*/
class InfoSidebarPage : public SidebarPage
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit InfoSidebarPage(DolphinMainWindow* mainWindow, QWidget* parent = 0);
+ explicit InfoSidebarPage(QWidget* parent = 0);
virtual ~InfoSidebarPage();
+public slots:
+ virtual void setUrl(const KUrl& url);
+ virtual void setSelection(const KFileItemList& selection);
+
protected:
- /** @see SidebarPage::activeViewChanged() */
- virtual void activeViewChanged();
+ /** @see QWidget::showEvent() */
+ virtual void showEvent(QShowEvent* event);
private slots:
/**
*/
void requestDelayedItemInfo(const KUrl& url);
- /**
- * Does a request of information for the item of the given Url and
- * provides default actions.
- *
- * @see InfoSidebarPage::showItemInfo()
- */
- void requestItemInfo(const KUrl& url);
-
/**
* Shows the information for the item of the Url which has been provided by
* InfoSidebarPage::requestItemInfo() and provides default actions.
* Is invoked if no preview is available for the item. In this
* case the icon will be shown.
*/
- void slotPreviewFailed(const KFileItem* item);
+ void showIcon(const KFileItem& item);
/**
* Is invoked if a preview is available for the item. The preview
* \a pixmap is shown inside the info page.
*/
- void gotPreview(const KFileItem* item, const QPixmap& pixmap);
-
- /**
- * Starts the service of m_actionsVector with the index \index on
- * the shown Url (or the selected items if available).
- */
- void startService(int index);
+ void showPreview(const KFileItem& item, const QPixmap& pixmap);
private:
- /**
- * Connects to signals from the currently active Dolphin view to get
- * informed about highlighting changes.
- */
- void connectToActiveView();
-
/**
* Checks whether the an Url is repesented by a bookmark. If yes,
* then the bookmark icon and name are shown instead of a preview.
*/
bool showMetaInfo(const QString& key) const;
- /**
- * Inserts the available actions to the info page for the given item.
- */
- void insertActions();
-
+private:
bool m_multipleSelection;
bool m_pendingPreview;
QTimer* m_timer;
QString m_infoLines;
QLabel* m_infos;
- KVBox* m_actionBox;
- QVector<KDEDesktopMimeType::Service> m_actionsVector;
-
MetaDataWidget* m_metadataWidget;
};
-// TODO #1: move to SidebarPage?
-// TODO #2: quite same button from the optical point of view as UrlNavigatorButton
-// -> provide helper class or common base class
-class ServiceButton : public QPushButton
-{
- Q_OBJECT
-
-public:
- ServiceButton(const QIcon& icon,
- const QString& text,
- QWidget* parent,
- int index);
- virtual ~ServiceButton();
-
-signals:
- void requestServiceStart(int index);
-
-protected:
- virtual void paintEvent(QPaintEvent* event);
- virtual void enterEvent(QEvent* event);
- virtual void leaveEvent(QEvent* event);
-
-private slots:
- void slotReleased();
-
-private:
- bool m_hover;
- int m_index;
-};
-
#endif // INFOSIDEBARPAGE_H