dolphinstatusbar.cpp
dolphindirlister.cpp
dolphincontextmenu.cpp
- panels/places/dolphinfileplacesview.cpp
+ panels/places/placespanel.cpp
settings/dolphinsettingsdialog.cpp
filterbar.cpp
settings/generalsettingspage.cpp
settings/generalviewsettingspage.cpp
settings/iconsizegroupbox.cpp
settings/iconsviewsettingspage.cpp
- panels/information/infosidebarpage.cpp
+ panels/information/informationpanel.cpp
panels/folders/ktreeview.cpp
main.cpp
panels/information/metadatawidget.cpp
panels/information/metatextlabel.cpp
pixmapviewer.cpp
settings/settingspagebase.cpp
- panels/sidebarpage.cpp
+ panels/panel.cpp
settings/startupsettingspage.cpp
statusbarspaceinfo.cpp
statusbarmessagelabel.cpp
panels/folders/treeviewcontextmenu.cpp
- panels/folders/treeviewsidebarpage.cpp
- panels/folders/sidebartreeview.cpp
+ panels/folders/folderspanel.cpp
+ panels/folders/paneltreeview.cpp
settings/viewsettingspage.cpp
settings/viewsettingspagebase.cpp
zoomlevelinfo.cpp
endif(Nepomuk_FOUND)
if(NOT WIN32)
- set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalsidebarpage.cpp)
+ set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp)
endif(NOT WIN32)
qt4_add_dbus_adaptor(dolphin_SRCS
#include <config-nepomuk.h>
#include "dolphinapplication.h"
-#include "panels/places/dolphinfileplacesview.h"
#include "dolphinnewmenu.h"
#include "settings/dolphinsettings.h"
#include "settings/dolphinsettingsdialog.h"
#include "dolphinstatusbar.h"
#include "dolphinviewcontainer.h"
-#include "panels/information/infosidebarpage.h"
+#include "panels/folders/folderspanel.h"
+#include "panels/places/placespanel.h"
+#include "panels/information/informationpanel.h"
#include "panels/information/metadatawidget.h"
#include "mainwindowadaptor.h"
-#include "panels/folders/treeviewsidebarpage.h"
#include "viewproperties.h"
#ifndef Q_OS_WIN
-#include "panels/terminal/terminalsidebarpage.h"
+#include "panels/terminal/terminalpanel.h"
#endif
#include "dolphin_generalsettings.h"
QDockWidget* infoDock = new QDockWidget(i18nc("@title:window", "Information"));
infoDock->setObjectName("infoDock");
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- SidebarPage* infoWidget = new InfoSidebarPage(infoDock);
- infoDock->setWidget(infoWidget);
+ Panel* infoPanel = new InformationPanel(infoDock);
+ infoDock->setWidget(infoPanel);
infoDock->toggleViewAction()->setText(i18nc("@title:window", "Information"));
infoDock->toggleViewAction()->setShortcut(Qt::Key_F11);
addDockWidget(Qt::RightDockWidgetArea, infoDock);
connect(this, SIGNAL(urlChanged(KUrl)),
- infoWidget, SLOT(setUrl(KUrl)));
+ infoPanel, SLOT(setUrl(KUrl)));
connect(this, SIGNAL(selectionChanged(KFileItemList)),
- infoWidget, SLOT(setSelection(KFileItemList)));
+ infoPanel, SLOT(setSelection(KFileItemList)));
connect(this, SIGNAL(requestItemInfo(KFileItem)),
- infoWidget, SLOT(requestDelayedItemInfo(KFileItem)));
+ infoPanel, SLOT(requestDelayedItemInfo(KFileItem)));
// setup "Tree View"
- QDockWidget* treeViewDock = new QDockWidget(i18nc("@title:window", "Folders"));
- treeViewDock->setObjectName("treeViewDock");
- treeViewDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- TreeViewSidebarPage* treeWidget = new TreeViewSidebarPage(treeViewDock);
- treeViewDock->setWidget(treeWidget);
+ QDockWidget* foldersDock = new QDockWidget(i18nc("@title:window", "Folders"));
+ foldersDock->setObjectName("foldersDock");
+ foldersDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+ FoldersPanel* foldersPanel = new FoldersPanel(foldersDock);
+ foldersDock->setWidget(foldersPanel);
- treeViewDock->toggleViewAction()->setText(i18nc("@title:window", "Folders"));
- treeViewDock->toggleViewAction()->setShortcut(Qt::Key_F7);
- actionCollection()->addAction("show_folders_panel", treeViewDock->toggleViewAction());
+ foldersDock->toggleViewAction()->setText(i18nc("@title:window", "Folders"));
+ foldersDock->toggleViewAction()->setShortcut(Qt::Key_F7);
+ actionCollection()->addAction("show_folders_panel", foldersDock->toggleViewAction());
- addDockWidget(Qt::LeftDockWidgetArea, treeViewDock);
+ addDockWidget(Qt::LeftDockWidgetArea, foldersDock);
connect(this, SIGNAL(urlChanged(KUrl)),
- treeWidget, SLOT(setUrl(KUrl)));
- connect(treeWidget, SIGNAL(changeUrl(KUrl, Qt::MouseButtons)),
+ foldersPanel, SLOT(setUrl(KUrl)));
+ connect(foldersPanel, SIGNAL(changeUrl(KUrl, Qt::MouseButtons)),
this, SLOT(handlePlacesClick(KUrl, Qt::MouseButtons)));
- connect(treeWidget, SIGNAL(changeSelection(KFileItemList)),
+ connect(foldersPanel, SIGNAL(changeSelection(KFileItemList)),
this, SLOT(changeSelection(KFileItemList)));
// setup "Terminal"
QDockWidget* terminalDock = new QDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
terminalDock->setObjectName("terminalDock");
terminalDock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
- SidebarPage* terminalWidget = new TerminalSidebarPage(terminalDock);
- terminalDock->setWidget(terminalWidget);
+ Panel* terminalPanel = new TerminalPanel(terminalDock);
+ terminalDock->setWidget(terminalPanel);
- connect(terminalWidget, SIGNAL(hideTerminalSidebarPage()), terminalDock, SLOT(hide()));
+ connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
terminalDock->toggleViewAction()->setText(i18nc("@title:window Shell terminal", "Terminal"));
terminalDock->toggleViewAction()->setShortcut(Qt::Key_F4);
addDockWidget(Qt::BottomDockWidgetArea, terminalDock);
connect(this, SIGNAL(urlChanged(KUrl)),
- terminalWidget, SLOT(setUrl(KUrl)));
+ terminalPanel, SLOT(setUrl(KUrl)));
#endif
const bool firstRun = DolphinSettings::instance().generalSettings()->firstRun();
if (firstRun) {
- treeViewDock->hide();
+ foldersDock->hide();
#ifndef Q_OS_WIN
terminalDock->hide();
#endif
placesDock->setObjectName("placesDock");
placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- DolphinFilePlacesView* placesView = new DolphinFilePlacesView(placesDock);
- placesDock->setWidget(placesView);
- placesView->setModel(DolphinSettings::instance().placesModel());
- placesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ PlacesPanel* placesPanel = new PlacesPanel(placesDock);
+ placesDock->setWidget(placesPanel);
+ placesPanel->setModel(DolphinSettings::instance().placesModel());
+ placesPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
placesDock->toggleViewAction()->setText(i18nc("@title:window", "Places"));
placesDock->toggleViewAction()->setShortcut(Qt::Key_F9);
actionCollection()->addAction("show_places_panel", placesDock->toggleViewAction());
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
- connect(placesView, SIGNAL(urlChanged(KUrl, Qt::MouseButtons)),
+ connect(placesPanel, SIGNAL(urlChanged(KUrl, Qt::MouseButtons)),
this, SLOT(handlePlacesClick(KUrl, Qt::MouseButtons)));
connect(this, SIGNAL(urlChanged(KUrl)),
- placesView, SLOT(setUrl(KUrl)));
+ placesPanel, SLOT(setUrl(KUrl)));
}
void DolphinMainWindow::updateEditActions()
#define DOLPHIN_MAINWINDOW_H
#include "dolphinview.h"
-#include "panels/sidebarpage.h"
+#include "panels/panel.h"
#include <config-nepomuk.h>
int getId() const;
/**
- * Inform all affected dolphin components (sidebars, views) of an URL
+ * Inform all affected dolphin components (panels, views) of an URL
* change.
*/
void changeUrl(const KUrl& url);
void urlChanged(const KUrl& url);
/**
- * Is emitted if information of an item is requested to be shown e. g. in the sidebar.
+ * Is emitted if information of an item is requested to be shown e. g. in the panel.
* If item is null, no item information request is pending.
*/
void requestItemInfo(const KFileItem& item);
void zoomLevelChanged(int level);
/**
- * Is emitted if information of an item is requested to be shown e. g. in the sidebar.
+ * Is emitted if information of an item is requested to be shown e. g. in the panel.
* If item is null, no item information request is pending.
*/
void requestItemInfo(const KFileItem& item);
* @brief Helper class for having a common drag and drop behavior.
*
* The class is used by DolphinIconsView, DolphinDetailsView,
- * DolphinColumnView and SidebarTreeView to have a consistent
+ * DolphinColumnView and PanelTreeView to have a consistent
* drag and drop behavior between all views.
*/
class LIBDOLPHINPRIVATE_EXPORT DragAndDropHelper : public QObject
#ifndef FOLDEREXPANDER_H
#define FOLDEREXPANDER_H
-// Needs to be exported as treesidebarpage uses it.
+// Needs to be exported as FoldersPanel uses it.
#include "libdolphin_export.h"
#include <QObject>
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "treeviewsidebarpage.h"
+#include "folderspanel.h"
#include "dolphinmodel.h"
#include "dolphinsortfilterproxymodel.h"
#include "draganddrophelper.h"
#include "folderexpander.h"
#include "renamedialog.h"
-#include "sidebartreeview.h"
+#include "paneltreeview.h"
#include "treeviewcontextmenu.h"
#include <kfileplacesmodel.h>
#include <QScrollBar>
#include <QTimer>
-TreeViewSidebarPage::TreeViewSidebarPage(QWidget* parent) :
- SidebarPage(parent),
+FoldersPanel::FoldersPanel(QWidget* parent) :
+ Panel(parent),
m_setLeafVisible(false),
m_mouseButtons(Qt::NoButton),
m_dirLister(0),
setLayoutDirection(Qt::LeftToRight);
}
-TreeViewSidebarPage::~TreeViewSidebarPage()
+FoldersPanel::~FoldersPanel()
{
FoldersPanelSettings::self()->writeConfig();
m_dirLister = 0; // deleted by m_dolphinModel
}
-QSize TreeViewSidebarPage::sizeHint() const
+QSize FoldersPanel::sizeHint() const
{
return QSize(200, 400);
}
-void TreeViewSidebarPage::setShowHiddenFiles(bool show)
+void FoldersPanel::setShowHiddenFiles(bool show)
{
FoldersPanelSettings::setShowHiddenFiles(show);
if (m_dirLister != 0) {
}
}
-bool TreeViewSidebarPage::showHiddenFiles() const
+bool FoldersPanel::showHiddenFiles() const
{
return FoldersPanelSettings::showHiddenFiles();
}
-void TreeViewSidebarPage::rename(const KFileItem& item)
+void FoldersPanel::rename(const KFileItem& item)
{
if (DolphinSettings::instance().generalSettings()->renameInline()) {
const QModelIndex dirIndex = m_dolphinModel->indexForItem(item);
}
}
-void TreeViewSidebarPage::setUrl(const KUrl& url)
+void FoldersPanel::setUrl(const KUrl& url)
{
- if (!url.isValid() || (url == SidebarPage::url())) {
+ if (!url.isValid() || (url == Panel::url())) {
return;
}
- SidebarPage::setUrl(url);
+ Panel::setUrl(url);
if (m_dirLister != 0) {
m_setLeafVisible = true;
loadTree(url);
}
}
-void TreeViewSidebarPage::showEvent(QShowEvent* event)
+void FoldersPanel::showEvent(QShowEvent* event)
{
if (event->spontaneous()) {
- SidebarPage::showEvent(event);
+ Panel::showEvent(event);
return;
}
if (m_dirLister == 0) {
// Postpone the creating of the dir lister to the first show event.
// This assures that no performance and memory overhead is given when the TreeView is not
- // used at all (see TreeViewSidebarPage::setUrl()).
+ // used at all (see FoldersPanel::setUrl()).
m_dirLister = new KDirLister();
m_dirLister->setDirOnlyMode(true);
m_dirLister->setAutoUpdate(true);
m_proxyModel->setSourceModel(m_dolphinModel);
Q_ASSERT(m_treeView == 0);
- m_treeView = new SidebarTreeView(this);
+ m_treeView = new PanelTreeView(this);
m_treeView->setModel(m_proxyModel);
m_proxyModel->setSorting(DolphinView::SortByName);
m_proxyModel->setSortOrder(Qt::AscendingOrder);
}
loadTree(url());
- SidebarPage::showEvent(event);
+ Panel::showEvent(event);
}
-void TreeViewSidebarPage::contextMenuEvent(QContextMenuEvent* event)
+void FoldersPanel::contextMenuEvent(QContextMenuEvent* event)
{
- SidebarPage::contextMenuEvent(event);
+ Panel::contextMenuEvent(event);
KFileItem item;
const QModelIndex index = m_treeView->indexAt(event->pos());
contextMenu.open();
}
-void TreeViewSidebarPage::updateActiveView(const QModelIndex& index)
+void FoldersPanel::updateActiveView(const QModelIndex& index)
{
const QModelIndex dirIndex = m_proxyModel->mapToSource(index);
const KFileItem item = m_dolphinModel->itemForIndex(dirIndex);
}
}
-void TreeViewSidebarPage::dropUrls(const QModelIndex& index, QDropEvent* event)
+void FoldersPanel::dropUrls(const QModelIndex& index, QDropEvent* event)
{
if (index.isValid()) {
const QModelIndex dirIndex = m_proxyModel->mapToSource(index);
}
}
-void TreeViewSidebarPage::expandToDir(const QModelIndex& index)
+void FoldersPanel::expandToDir(const QModelIndex& index)
{
m_treeView->setExpanded(index, true);
selectLeafDirectory();
m_treeView->resizeColumnToContents(DolphinModel::Name);
}
-void TreeViewSidebarPage::scrollToLeaf()
+void FoldersPanel::scrollToLeaf()
{
const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_leafDir);
const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
}
}
-void TreeViewSidebarPage::updateMouseButtons()
+void FoldersPanel::updateMouseButtons()
{
m_mouseButtons = QApplication::mouseButtons();
}
-void TreeViewSidebarPage::loadTree(const KUrl& url)
+void FoldersPanel::loadTree(const KUrl& url)
{
Q_ASSERT(m_dirLister != 0);
m_leafDir = url;
m_dolphinModel->expandToUrl(m_leafDir);
}
-void TreeViewSidebarPage::selectLeafDirectory()
+void FoldersPanel::selectLeafDirectory()
{
const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_leafDir);
const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::ClearAndSelect);
}
-#include "treeviewsidebarpage.moc"
+#include "folderspanel.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef TREEVIEWSIDEBARPAGE_H
-#define TREEVIEWSIDEBARPAGE_H
+#ifndef FOLDERSPANEL_H
+#define FOLDERSPANEL_H
#include <kurl.h>
-#include <panels/sidebarpage.h>
+#include <panels/panel.h>
class KDirLister;
class DolphinModel;
class DolphinSortFilterProxyModel;
-class SidebarTreeView;
+class PanelTreeView;
class QModelIndex;
/**
* The tree view is always synchronized with the currently active view
* from the main window.
*/
-class TreeViewSidebarPage : public SidebarPage
+class FoldersPanel : public Panel
{
Q_OBJECT
public:
- TreeViewSidebarPage(QWidget* parent = 0);
- virtual ~TreeViewSidebarPage();
+ FoldersPanel(QWidget* parent = 0);
+ virtual ~FoldersPanel();
/** @see QWidget::sizeHint() */
virtual QSize sizeHint() const;
void changeUrl(const KUrl& url, Qt::MouseButtons buttons);
/**
- * This signal is emitted when the sidebar requests a change in the
+ * This signal is emitted when the panel requests a change in the
* current selection. The file-management view recieving this signal is
* not required to select all listed files, limiting the selection to
* e.g. the current folder. The new selection will be reported via the
/**
* Selects the current leaf directory m_leafDir and assures
* that the directory is visible if the leaf has been set by
- * TreeViewSidebarPage::setUrl().
+ * FoldersPanel::setUrl().
*/
void selectLeafDirectory();
KDirLister* m_dirLister;
DolphinModel* m_dolphinModel;
DolphinSortFilterProxyModel* m_proxyModel;
- SidebarTreeView* m_treeView;
+ PanelTreeView* m_treeView;
KUrl m_leafDir;
};
-#endif // TREEVIEWSIDEBARPAGE_H
+#endif // FOLDERSPANEL_H
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "sidebartreeview.h"
+#include "paneltreeview.h"
#include "dolphincontroller.h"
#include "dolphinmodel.h"
#include <QHeaderView>
#include <QScrollBar>
-SidebarTreeView::SidebarTreeView(QWidget* parent) :
+PanelTreeView::PanelTreeView(QWidget* parent) :
KTreeView(parent)
{
setAcceptDrops(true);
setItemDelegate(delegate);
}
-SidebarTreeView::~SidebarTreeView()
+PanelTreeView::~PanelTreeView()
{
}
-bool SidebarTreeView::event(QEvent* event)
+bool PanelTreeView::event(QEvent* event)
{
switch (event->type()) {
case QEvent::Polish:
hideColumn(DolphinModel::Tags);
header()->hide();
break;
-
+
case QEvent::Show:
// TODO: The opening/closing animation of subtrees flickers in combination with the
- // sidebar when using the Oxygen style. As workaround the animation is turned off:
+ // panel when using the Oxygen style. As workaround the animation is turned off:
setAnimated(false);
break;
-
+
case QEvent::UpdateRequest:
// a wheel movement will scroll 1 item
if (model()->rowCount() > 0) {
verticalScrollBar()->setSingleStep(sizeHintForRow(0) / 3);
}
break;
-
+
default:
break;
}
return KTreeView::event(event);
}
-void SidebarTreeView::startDrag(Qt::DropActions supportedActions)
+void PanelTreeView::startDrag(Qt::DropActions supportedActions)
{
DragAndDropHelper::instance().startDrag(this, supportedActions);
}
-void SidebarTreeView::dragEnterEvent(QDragEnterEvent* event)
+void PanelTreeView::dragEnterEvent(QDragEnterEvent* event)
{
KTreeView::dragEnterEvent(event);
if (event->mimeData()->hasUrls()) {
}
}
-void SidebarTreeView::dragLeaveEvent(QDragLeaveEvent* event)
+void PanelTreeView::dragLeaveEvent(QDragLeaveEvent* event)
{
KTreeView::dragLeaveEvent(event);
setDirtyRegion(m_dropRect);
}
-void SidebarTreeView::dragMoveEvent(QDragMoveEvent* event)
+void PanelTreeView::dragMoveEvent(QDragMoveEvent* event)
{
KTreeView::dragMoveEvent(event);
}
}
-void SidebarTreeView::dropEvent(QDropEvent* event)
+void PanelTreeView::dropEvent(QDropEvent* event)
{
const QModelIndex index = indexAt(event->pos());
if (index.isValid()) {
KTreeView::dropEvent(event);
}
-#include "sidebartreeview.moc"
+#include "paneltreeview.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef SIDEBARTREEVIEW_H
-#define SIDEBARTREEVIEW_H
+#ifndef PANELTREEVIEW_H
+#define PANELTREEVIEW_H
#include <kurl.h>
#include <panels/folders/ktreeview.h>
/**
- * @brief Tree view widget which is used for the sidebar panel.
+ * @brief Tree view widget which is used for the folders panel.
*
- * @see TreeViewSidebarPage
+ * @see FoldersPanel
*/
-class SidebarTreeView : public KTreeView
+class PanelTreeView : public KTreeView
{
Q_OBJECT
public:
- explicit SidebarTreeView(QWidget* parent = 0);
- virtual ~SidebarTreeView();
+ explicit PanelTreeView(QWidget* parent = 0);
+ virtual ~PanelTreeView();
signals:
/**
#include <klocale.h>
#include <kpropertiesdialog.h>
-#include "treeviewsidebarpage.h"
+#include "folderspanel.h"
#include <QtGui/QApplication>
#include <QtGui/QClipboard>
-TreeViewContextMenu::TreeViewContextMenu(TreeViewSidebarPage* parent,
+TreeViewContextMenu::TreeViewContextMenu(FoldersPanel* parent,
const KFileItem& fileInfo) :
QObject(parent),
m_parent(parent),
#include <QtCore/QObject>
#include <KFileItem>
-class TreeViewSidebarPage;
+class FoldersPanel;
/**
* @brief Represents the context menu which appears when doing a right
public:
/**
- * @parent Pointer to the treeview sidebar page the context menu
+ * @parent Pointer to the folders panel the context menu
* belongs to.
* @fileInfo Pointer to the file item the context menu
* is applied. If 0 is passed, the context menu
* is above the viewport.
*/
- TreeViewContextMenu(TreeViewSidebarPage* parent,
+ TreeViewContextMenu(FoldersPanel* parent,
const KFileItem& fileInfo);
virtual ~TreeViewContextMenu();
void populateMimeData(QMimeData* mimeData, bool cut);
private:
- TreeViewSidebarPage* m_parent;
+ FoldersPanel* m_parent;
KFileItem m_fileInfo;
};
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "infosidebarpage.h"
+#include "informationpanel.h"
#include <config-nepomuk.h>
#include "metatextlabel.h"
#include "pixmapviewer.h"
-InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
- SidebarPage(parent),
+InformationPanel::InformationPanel(QWidget* parent) :
+ Panel(parent),
m_initialized(false),
m_pendingPreview(false),
m_infoTimer(0),
{
}
-InfoSidebarPage::~InfoSidebarPage()
+InformationPanel::~InformationPanel()
{
}
-QSize InfoSidebarPage::sizeHint() const
+QSize InformationPanel::sizeHint() const
{
- QSize size = SidebarPage::sizeHint();
+ QSize size = Panel::sizeHint();
size.setWidth(minimumSizeHint().width());
return size;
}
-void InfoSidebarPage::setUrl(const KUrl& url)
+void InformationPanel::setUrl(const KUrl& url)
{
- SidebarPage::setUrl(url);
+ Panel::setUrl(url);
if (url.isValid() && !isEqualToShownUrl(url)) {
if (isVisible()) {
cancelRequest();
}
}
-void InfoSidebarPage::setSelection(const KFileItemList& selection)
+void InformationPanel::setSelection(const KFileItemList& selection)
{
if (!isVisible()) {
return;
}
}
-void InfoSidebarPage::requestDelayedItemInfo(const KFileItem& item)
+void InformationPanel::requestDelayedItemInfo(const KFileItem& item)
{
if (!isVisible()) {
return;
}
}
-void InfoSidebarPage::showEvent(QShowEvent* event)
+void InformationPanel::showEvent(QShowEvent* event)
{
- SidebarPage::showEvent(event);
+ Panel::showEvent(event);
if (!event->spontaneous()) {
if (!m_initialized) {
// do a delayed initialization so that no performance
}
}
-void InfoSidebarPage::resizeEvent(QResizeEvent* event)
+void InformationPanel::resizeEvent(QResizeEvent* event)
{
if (isVisible()) {
// If the text inside the name label or the info label cannot
// get wrapped, then the maximum width of the label is increased
- // so that the width of the information sidebar gets increased.
+ // so that the width of the information panel gets increased.
// To prevent this, the maximum width is adjusted to
- // the current width of the sidebar.
+ // the current width of the panel.
const int maxWidth = event->size().width() - KDialog::spacingHint() * 4;
m_nameLabel->setMaximumWidth(maxWidth);
m_infoTimer->start();
}
- SidebarPage::resizeEvent(event);
+ Panel::resizeEvent(event);
}
-void InfoSidebarPage::showItemInfo()
+void InformationPanel::showItemInfo()
{
if (!isVisible()) {
return;
showMetaInfo();
}
-void InfoSidebarPage::slotInfoTimeout()
+void InformationPanel::slotInfoTimeout()
{
m_shownUrl = m_urlCandidate;
showItemInfo();
}
-void InfoSidebarPage::markOutdatedPreview()
+void InformationPanel::markOutdatedPreview()
{
KIconEffect iconEffect;
QPixmap disabledPixmap = iconEffect.apply(m_preview->pixmap(),
m_preview->setPixmap(disabledPixmap);
}
-void InfoSidebarPage::showIcon(const KFileItem& item)
+void InformationPanel::showIcon(const KFileItem& item)
{
m_outdatedPreviewTimer->stop();
m_pendingPreview = false;
}
}
-void InfoSidebarPage::showPreview(const KFileItem& item,
+void InformationPanel::showPreview(const KFileItem& item,
const QPixmap& pixmap)
{
m_outdatedPreviewTimer->stop();
}
}
-void InfoSidebarPage::slotFileRenamed(const QString& source, const QString& dest)
+void InformationPanel::slotFileRenamed(const QString& source, const QString& dest)
{
if (m_shownUrl == KUrl(source)) {
// the currently shown file has been renamed, hence update the item information
}
}
-void InfoSidebarPage::slotFilesAdded(const QString& directory)
+void InformationPanel::slotFilesAdded(const QString& directory)
{
if (m_shownUrl == KUrl(directory)) {
// If the 'trash' icon changes because the trash has been emptied or got filled,
}
}
-void InfoSidebarPage::slotFilesChanged(const QStringList& files)
+void InformationPanel::slotFilesChanged(const QStringList& files)
{
foreach (const QString& fileName, files) {
if (m_shownUrl == KUrl(fileName)) {
}
}
-void InfoSidebarPage::slotFilesRemoved(const QStringList& files)
+void InformationPanel::slotFilesRemoved(const QStringList& files)
{
foreach (const QString& fileName, files) {
if (m_shownUrl == KUrl(fileName)) {
}
}
-void InfoSidebarPage::slotEnteredDirectory(const QString& directory)
+void InformationPanel::slotEnteredDirectory(const QString& directory)
{
if (m_shownUrl == KUrl(directory)) {
KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory));
}
}
-void InfoSidebarPage::slotLeftDirectory(const QString& directory)
+void InformationPanel::slotLeftDirectory(const QString& directory)
{
if (m_shownUrl == KUrl(directory)) {
// The signal 'leftDirectory' is also emitted when a media
}
}
-bool InfoSidebarPage::applyPlace(const KUrl& url)
+bool InformationPanel::applyPlace(const KUrl& url)
{
KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
int count = placesModel->rowCount();
return false;
}
-void InfoSidebarPage::cancelRequest()
+void InformationPanel::cancelRequest()
{
m_infoTimer->stop();
}
-void InfoSidebarPage::showMetaInfo()
+void InformationPanel::showMetaInfo()
{
m_metaTextLabel->clear();
}
}
-bool InfoSidebarPage::convertMetaInfo(const QString& key, QString& text) const
+bool InformationPanel::convertMetaInfo(const QString& key, QString& text) const
{
struct MetaKey {
const char* key;
return false;
}
-KFileItem InfoSidebarPage::fileItem() const
+KFileItem InformationPanel::fileItem() const
{
if (!m_fileItem.isNull()) {
return m_fileItem;
return item;
}
-bool InfoSidebarPage::showMultipleSelectionInfo() const
+bool InformationPanel::showMultipleSelectionInfo() const
{
return m_fileItem.isNull() && (m_selection.count() > 1);
}
-bool InfoSidebarPage::isEqualToShownUrl(const KUrl& url) const
+bool InformationPanel::isEqualToShownUrl(const KUrl& url) const
{
return m_shownUrl.equals(url, KUrl::CompareWithoutTrailingSlash);
}
-void InfoSidebarPage::setNameLabelText(const QString& text)
+void InformationPanel::setNameLabelText(const QString& text)
{
QTextOption textOption;
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
m_nameLabel->setText(wrappedText);
}
-void InfoSidebarPage::init()
+void InformationPanel::init()
{
const int spacing = KDialog::spacingHint();
m_initialized = true;
}
-#include "infosidebarpage.moc"
+#include "informationpanel.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef INFOSIDEBARPAGE_H
-#define INFOSIDEBARPAGE_H
+#ifndef INFORMATIONPANEL_H
+#define INFORMATIONPANEL_H
-#include <panels/sidebarpage.h>
+#include <panels/panel.h>
#include <QtGui/QPushButton>
#include <QtGui/QPixmap>
class MetaTextLabel;
/**
- * @brief Sidebar for showing meta information of one ore more selected items.
+ * @brief Panel for showing meta information of one ore more selected items.
*/
-class InfoSidebarPage : public SidebarPage
+class InformationPanel : public Panel
{
Q_OBJECT
public:
- explicit InfoSidebarPage(QWidget* parent = 0);
- virtual ~InfoSidebarPage();
+ explicit InformationPanel(QWidget* parent = 0);
+ virtual ~InformationPanel();
/** @see QWidget::sizeHint() */
virtual QSize sizeHint() const;
public slots:
- /** @see SidebarPage::setUrl() */
+ /** @see Panel::setUrl() */
virtual void setUrl(const KUrl& url);
/**
- * This is invoked to inform the sidebar that the user has selected a new
+ * This is invoked to inform the panel that the user has selected a new
* set of items.
*/
void setSelection(const KFileItemList& selection);
/**
* Does a delayed request of information for the item \a item.
- * If within this delay InfoSidebarPage::setUrl() or InfoSidebarPage::setSelection()
+ * If within this delay InformationPanel::setUrl() or InformationPanel::setSelection()
* are invoked, then the request will be skipped. Requesting a delayed item information
* makes sense when hovering items.
*/
private slots:
/**
* Shows the information for the item of the URL which has been provided by
- * InfoSidebarPage::requestItemInfo() and provides default actions.
+ * InformationPanel::requestItemInfo() and provides default actions.
*/
void showItemInfo();
/**
* Triggered if the request for item information has timed out.
- * @see InfoSidebarPage::requestDelayedItemInfo()
+ * @see InformationPanel::requestDelayedItemInfo()
*/
void slotInfoTimeout();
/**
* Returns the item for file where the preview and meta information
- * should be received, if InfoSidebarPage::showMultipleSelectionInfo()
+ * should be received, if InformationPanel::showMultipleSelectionInfo()
* returns false.
*/
KFileItem fileItem() const;
* m_selection. If true is returned, it is assured that
* m_selection.count() > 1. If false is returned, the meta
* information should be shown for the file
- * InfosidebarPage::fileUrl();
+ * InformationPanel::fileUrl();
*/
bool showMultipleSelectionInfo() const;
MetaTextLabel* m_metaTextLabel;
};
-#endif // INFOSIDEBARPAGE_H
+#endif // INFORMATIONPANEL_H
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "sidebarpage.h"
+#include "panel.h"
#include <QtGui/QWidget>
#include <kfileitem.h>
#include <kurl.h>
-SidebarPage::SidebarPage(QWidget* parent) :
+Panel::Panel(QWidget* parent) :
QWidget(parent),
m_url(KUrl())
{
}
-SidebarPage::~SidebarPage()
+Panel::~Panel()
{
}
-const KUrl& SidebarPage::url() const
+const KUrl& Panel::url() const
{
return m_url;
}
-void SidebarPage::setUrl(const KUrl& url)
+void Panel::setUrl(const KUrl& url)
{
m_url = url;
}
-#include "sidebarpage.moc"
+#include "panel.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef _SIDEBARPAGE_H_
-#define _SIDEBARPAGE_H_
+#ifndef PANEL_H
+#define PANEL_H
#include <QtGui/QWidget>
#include <kurl.h>
#include <kfileitem.h>
/**
- * @brief Base widget for all pages that can be embedded into the Sidebar.
+ * @brief Base widget for all panels that can be docked on the window borders.
*/
-class SidebarPage : public QWidget
+class Panel : public QWidget
{
Q_OBJECT
public:
- explicit SidebarPage(QWidget* parent = 0);
- virtual ~SidebarPage();
+ explicit Panel(QWidget* parent = 0);
+ virtual ~Panel();
/** Returns the current set URL of the active Dolphin view. */
const KUrl& url() const;
KUrl m_url;
};
-#endif // _SIDEBARPAGE_H_
+#endif // PANEL_H
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "dolphinfileplacesview.h"
+#include "placespanel.h"
#include "draganddrophelper.h"
#include <kfileitem.h>
#include <konq_operations.h>
-DolphinFilePlacesView::DolphinFilePlacesView(QWidget* parent) :
+PlacesPanel::PlacesPanel(QWidget* parent) :
KFilePlacesView(parent),
m_mouseButtons(Qt::NoButton)
{
this, SLOT(emitExtendedUrlChangedSignal(const KUrl&)));
}
-DolphinFilePlacesView::~DolphinFilePlacesView()
+PlacesPanel::~PlacesPanel()
{
}
-void DolphinFilePlacesView::mousePressEvent(QMouseEvent* event)
+void PlacesPanel::mousePressEvent(QMouseEvent* event)
{
m_mouseButtons = event->buttons();
KFilePlacesView::mousePressEvent(event);
}
-void DolphinFilePlacesView::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent)
+void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent)
{
DragAndDropHelper::instance().dropUrls(KFileItem(), dest, event, parent);
}
-void DolphinFilePlacesView::emitExtendedUrlChangedSignal(const KUrl& url)
+void PlacesPanel::emitExtendedUrlChangedSignal(const KUrl& url)
{
emit urlChanged(url, m_mouseButtons);
}
-#include "dolphinfileplacesview.moc"
+#include "placespanel.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef DOLPHINFILEPLACESVIEW_H
-#define DOLPHINFILEPLACESVIEW_H
+#ifndef PLACESPANEL_H
+#define PLACESPANEL_H
#include <kfileplacesview.h>
/**
- * @brief Combines bookmarks and mounted devices as list which is
- * embedded as panel.
+ * @brief Combines bookmarks and mounted devices as list.
*/
-class DolphinFilePlacesView : public KFilePlacesView
+class PlacesPanel : public KFilePlacesView
{
Q_OBJECT
public:
- DolphinFilePlacesView(QWidget* parent);
- virtual ~DolphinFilePlacesView();
+ PlacesPanel(QWidget* parent);
+ virtual ~PlacesPanel();
signals:
void urlChanged(const KUrl& url, Qt::MouseButtons buttons);
Qt::MouseButtons m_mouseButtons;
};
-#endif // DOLPHINFILEPLACESVIEW_H
+#endif // PLACESPANEL_H
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "terminalsidebarpage.h"
+#include "terminalpanel.h"
#include <klibloader.h>
#include <kde_terminal_interface.h>
#include <QBoxLayout>
#include <QShowEvent>
-TerminalSidebarPage::TerminalSidebarPage(QWidget* parent) :
- SidebarPage(parent),
+TerminalPanel::TerminalPanel(QWidget* parent) :
+ Panel(parent),
m_layout(0),
m_terminal(0),
m_terminalWidget(0)
m_layout->setMargin(0);
}
-TerminalSidebarPage::~TerminalSidebarPage()
+TerminalPanel::~TerminalPanel()
{
}
-QSize TerminalSidebarPage::sizeHint() const
+QSize TerminalPanel::sizeHint() const
{
- QSize size = SidebarPage::sizeHint();
+ QSize size = Panel::sizeHint();
size.setHeight(200);
return size;
}
-void TerminalSidebarPage::setUrl(const KUrl& url)
+void TerminalPanel::setUrl(const KUrl& url)
{
- if (!url.isValid() || (url == SidebarPage::url())) {
+ if (!url.isValid() || (url == Panel::url())) {
return;
}
- SidebarPage::setUrl(url);
+ Panel::setUrl(url);
if ((m_terminal != 0) && isVisible() && url.isLocalFile()) {
m_terminal->sendInput("cd " + KShell::quoteArg(url.path()) + '\n');
}
}
-void TerminalSidebarPage::terminalExited()
+void TerminalPanel::terminalExited()
{
- emit hideTerminalSidebarPage();
-
+ emit hideTerminalPanel();
m_terminal = 0;
}
-void TerminalSidebarPage::showEvent(QShowEvent* event)
+void TerminalPanel::showEvent(QShowEvent* event)
{
if (event->spontaneous()) {
- SidebarPage::showEvent(event);
+ Panel::showEvent(event);
return;
}
m_terminalWidget->setFocus();
}
- SidebarPage::showEvent(event);
+ Panel::showEvent(event);
}
-#include "terminalsidebarpage.moc"
+#include "terminalpanel.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef TERMINALSIDEBARPAGE_H
-#define TERMINALSIDEBARPAGE_H
+#ifndef TERMINALPANEL_H
+#define TERMINALPANEL_H
-#include <panels/sidebarpage.h>
+#include <panels/panel.h>
class TerminalInterface;
class QVBoxLayout;
* @brief Shows the terminal which is synchronized with the URL of the
* active view.
*/
-class TerminalSidebarPage : public SidebarPage
+class TerminalPanel : public Panel
{
Q_OBJECT
public:
- TerminalSidebarPage(QWidget* parent = 0);
- virtual ~TerminalSidebarPage();
+ TerminalPanel(QWidget* parent = 0);
+ virtual ~TerminalPanel();
/** @see QWidget::sizeHint() */
virtual QSize sizeHint() const;
public slots:
- /** @see SidebarPage::setUrl(). */
+ /** @see Panel::setUrl(). */
virtual void setUrl(const KUrl& url);
void terminalExited();
signals:
- void hideTerminalSidebarPage();
+ void hideTerminalPanel();
protected:
/** @see QWidget::showEvent() */
QWidget* m_terminalWidget;
};
-#endif // TERMINALSIDEBARPAGE_H
+#endif // TERMINALPANEL_H