Cleanup panel related class names: The terms "sidebar"/"sidebarpage" are relicts from the KDE 3 version of Dolphin and are called "Panels" in the KDE 4 version of Dolphin. Yes, renaming classes may take more than 1 year ;-)

svn path=/trunk/KDE/kdebase/apps/; revision=911089
This commit is contained in:
Peter Penz 2009-01-14 20:14:36 +00:00
parent 307285e963
commit f37ecd6ecf
20 changed files with 212 additions and 214 deletions

View file

@ -102,27 +102,27 @@ set(dolphin_SRCS
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
@ -145,7 +145,7 @@ kde4_add_ui_files(dolphin_SRCS panels/information/newtagdialog.ui)
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

View file

@ -25,20 +25,20 @@
#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"
@ -1110,8 +1110,8 @@ void DolphinMainWindow::setupDockWidgets()
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);
@ -1119,29 +1119,29 @@ void DolphinMainWindow::setupDockWidgets()
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"
@ -1149,10 +1149,10 @@ void DolphinMainWindow::setupDockWidgets()
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);
@ -1160,12 +1160,12 @@ void DolphinMainWindow::setupDockWidgets()
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
@ -1175,20 +1175,20 @@ void DolphinMainWindow::setupDockWidgets()
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()

View file

@ -23,7 +23,7 @@
#define DOLPHIN_MAINWINDOW_H
#include "dolphinview.h"
#include "panels/sidebarpage.h"
#include "panels/panel.h"
#include <config-nepomuk.h>
@ -120,7 +120,7 @@ public slots:
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);
@ -148,7 +148,7 @@ signals:
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);

View file

@ -481,7 +481,7 @@ signals:
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);

View file

@ -38,7 +38,7 @@ class QWidget;
* @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

View file

@ -20,7 +20,7 @@
#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>

View file

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include "treeviewsidebarpage.h"
#include "folderspanel.h"
#include "dolphinmodel.h"
#include "dolphinsortfilterproxymodel.h"
@ -28,7 +28,7 @@
#include "draganddrophelper.h"
#include "folderexpander.h"
#include "renamedialog.h"
#include "sidebartreeview.h"
#include "paneltreeview.h"
#include "treeviewcontextmenu.h"
#include <kfileplacesmodel.h>
@ -44,8 +44,8 @@
#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),
@ -57,7 +57,7 @@ TreeViewSidebarPage::TreeViewSidebarPage(QWidget* parent) :
setLayoutDirection(Qt::LeftToRight);
}
TreeViewSidebarPage::~TreeViewSidebarPage()
FoldersPanel::~FoldersPanel()
{
FoldersPanelSettings::self()->writeConfig();
@ -68,12 +68,12 @@ TreeViewSidebarPage::~TreeViewSidebarPage()
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) {
@ -82,12 +82,12 @@ void TreeViewSidebarPage::setShowHiddenFiles(bool show)
}
}
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);
@ -108,30 +108,30 @@ void TreeViewSidebarPage::rename(const KFileItem& 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);
@ -152,7 +152,7 @@ void TreeViewSidebarPage::showEvent(QShowEvent* event)
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);
@ -172,12 +172,12 @@ void TreeViewSidebarPage::showEvent(QShowEvent* event)
}
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());
@ -191,7 +191,7 @@ void TreeViewSidebarPage::contextMenuEvent(QContextMenuEvent* event)
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);
@ -200,7 +200,7 @@ void TreeViewSidebarPage::updateActiveView(const QModelIndex& index)
}
}
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);
@ -212,14 +212,14 @@ void TreeViewSidebarPage::dropUrls(const QModelIndex& index, QDropEvent* event)
}
}
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);
@ -228,12 +228,12 @@ void TreeViewSidebarPage::scrollToLeaf()
}
}
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;
@ -255,7 +255,7 @@ void TreeViewSidebarPage::loadTree(const KUrl& 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);
@ -276,4 +276,4 @@ void TreeViewSidebarPage::selectLeafDirectory()
selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::ClearAndSelect);
}
#include "treeviewsidebarpage.moc"
#include "folderspanel.moc"

View file

@ -17,17 +17,17 @@
* 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;
/**
@ -37,13 +37,13 @@ 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;
@ -60,7 +60,7 @@ signals:
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
@ -118,7 +118,7 @@ private:
/**
* 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();
@ -128,8 +128,8 @@ private:
KDirLister* m_dirLister;
DolphinModel* m_dolphinModel;
DolphinSortFilterProxyModel* m_proxyModel;
SidebarTreeView* m_treeView;
PanelTreeView* m_treeView;
KUrl m_leafDir;
};
#endif // TREEVIEWSIDEBARPAGE_H
#endif // FOLDERSPANEL_H

View file

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include "sidebartreeview.h"
#include "paneltreeview.h"
#include "dolphincontroller.h"
#include "dolphinmodel.h"
@ -29,7 +29,7 @@
#include <QHeaderView>
#include <QScrollBar>
SidebarTreeView::SidebarTreeView(QWidget* parent) :
PanelTreeView::PanelTreeView(QWidget* parent) :
KTreeView(parent)
{
setAcceptDrops(true);
@ -60,11 +60,11 @@ SidebarTreeView::SidebarTreeView(QWidget* parent) :
setItemDelegate(delegate);
}
SidebarTreeView::~SidebarTreeView()
PanelTreeView::~PanelTreeView()
{
}
bool SidebarTreeView::event(QEvent* event)
bool PanelTreeView::event(QEvent* event)
{
switch (event->type()) {
case QEvent::Polish:
@ -79,20 +79,20 @@ bool SidebarTreeView::event(QEvent* event)
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;
}
@ -100,12 +100,12 @@ bool SidebarTreeView::event(QEvent* event)
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()) {
@ -113,13 +113,13 @@ void SidebarTreeView::dragEnterEvent(QDragEnterEvent* event)
}
}
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);
@ -135,7 +135,7 @@ void SidebarTreeView::dragMoveEvent(QDragMoveEvent* event)
}
}
void SidebarTreeView::dropEvent(QDropEvent* event)
void PanelTreeView::dropEvent(QDropEvent* event)
{
const QModelIndex index = indexAt(event->pos());
if (index.isValid()) {
@ -144,4 +144,4 @@ void SidebarTreeView::dropEvent(QDropEvent* event)
KTreeView::dropEvent(event);
}
#include "sidebartreeview.moc"
#include "paneltreeview.moc"

View file

@ -17,24 +17,24 @@
* 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:
/**

View file

@ -32,12 +32,12 @@
#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),

View file

@ -23,7 +23,7 @@
#include <QtCore/QObject>
#include <KFileItem>
class TreeViewSidebarPage;
class FoldersPanel;
/**
* @brief Represents the context menu which appears when doing a right
@ -35,13 +35,13 @@ class TreeViewContextMenu : public QObject
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();
@ -81,7 +81,7 @@ private:
void populateMimeData(QMimeData* mimeData, bool cut);
private:
TreeViewSidebarPage* m_parent;
FoldersPanel* m_parent;
KFileItem m_fileInfo;
};

View file

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include "infosidebarpage.h"
#include "informationpanel.h"
#include <config-nepomuk.h>
@ -50,8 +50,8 @@
#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),
@ -67,20 +67,20 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
{
}
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();
@ -92,7 +92,7 @@ void InfoSidebarPage::setUrl(const KUrl& url)
}
}
void InfoSidebarPage::setSelection(const KFileItemList& selection)
void InformationPanel::setSelection(const KFileItemList& selection)
{
if (!isVisible()) {
return;
@ -122,7 +122,7 @@ void InfoSidebarPage::setSelection(const KFileItemList& selection)
}
}
void InfoSidebarPage::requestDelayedItemInfo(const KFileItem& item)
void InformationPanel::requestDelayedItemInfo(const KFileItem& item)
{
if (!isVisible()) {
return;
@ -148,9 +148,9 @@ void InfoSidebarPage::requestDelayedItemInfo(const KFileItem& item)
}
}
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
@ -162,14 +162,14 @@ void InfoSidebarPage::showEvent(QShowEvent* event)
}
}
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);
@ -179,10 +179,10 @@ void InfoSidebarPage::resizeEvent(QResizeEvent* event)
m_infoTimer->start();
}
SidebarPage::resizeEvent(event);
Panel::resizeEvent(event);
}
void InfoSidebarPage::showItemInfo()
void InformationPanel::showItemInfo()
{
if (!isVisible()) {
return;
@ -230,13 +230,13 @@ void InfoSidebarPage::showItemInfo()
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(),
@ -245,7 +245,7 @@ void InfoSidebarPage::markOutdatedPreview()
m_preview->setPixmap(disabledPixmap);
}
void InfoSidebarPage::showIcon(const KFileItem& item)
void InformationPanel::showIcon(const KFileItem& item)
{
m_outdatedPreviewTimer->stop();
m_pendingPreview = false;
@ -254,7 +254,7 @@ void InfoSidebarPage::showIcon(const KFileItem& item)
}
}
void InfoSidebarPage::showPreview(const KFileItem& item,
void InformationPanel::showPreview(const KFileItem& item,
const QPixmap& pixmap)
{
m_outdatedPreviewTimer->stop();
@ -266,7 +266,7 @@ void InfoSidebarPage::showPreview(const KFileItem& item,
}
}
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
@ -276,7 +276,7 @@ void InfoSidebarPage::slotFileRenamed(const QString& source, const QString& dest
}
}
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,
@ -286,7 +286,7 @@ void InfoSidebarPage::slotFilesAdded(const QString& directory)
}
}
void InfoSidebarPage::slotFilesChanged(const QStringList& files)
void InformationPanel::slotFilesChanged(const QStringList& files)
{
foreach (const QString& fileName, files) {
if (m_shownUrl == KUrl(fileName)) {
@ -296,7 +296,7 @@ void InfoSidebarPage::slotFilesChanged(const QStringList& files)
}
}
void InfoSidebarPage::slotFilesRemoved(const QStringList& files)
void InformationPanel::slotFilesRemoved(const QStringList& files)
{
foreach (const QString& fileName, files) {
if (m_shownUrl == KUrl(fileName)) {
@ -309,7 +309,7 @@ void InfoSidebarPage::slotFilesRemoved(const QStringList& files)
}
}
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));
@ -317,7 +317,7 @@ void InfoSidebarPage::slotEnteredDirectory(const QString& 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
@ -329,7 +329,7 @@ void InfoSidebarPage::slotLeftDirectory(const QString& directory)
}
}
bool InfoSidebarPage::applyPlace(const KUrl& url)
bool InformationPanel::applyPlace(const KUrl& url)
{
KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
int count = placesModel->rowCount();
@ -347,12 +347,12 @@ bool InfoSidebarPage::applyPlace(const KUrl& url)
return false;
}
void InfoSidebarPage::cancelRequest()
void InformationPanel::cancelRequest()
{
m_infoTimer->stop();
}
void InfoSidebarPage::showMetaInfo()
void InformationPanel::showMetaInfo()
{
m_metaTextLabel->clear();
@ -416,7 +416,7 @@ void InfoSidebarPage::showMetaInfo()
}
}
bool InfoSidebarPage::convertMetaInfo(const QString& key, QString& text) const
bool InformationPanel::convertMetaInfo(const QString& key, QString& text) const
{
struct MetaKey {
const char* key;
@ -455,7 +455,7 @@ bool InfoSidebarPage::convertMetaInfo(const QString& key, QString& text) const
return false;
}
KFileItem InfoSidebarPage::fileItem() const
KFileItem InformationPanel::fileItem() const
{
if (!m_fileItem.isNull()) {
return m_fileItem;
@ -473,17 +473,17 @@ KFileItem InfoSidebarPage::fileItem() const
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);
@ -512,7 +512,7 @@ void InfoSidebarPage::setNameLabelText(const QString& text)
m_nameLabel->setText(wrappedText);
}
void InfoSidebarPage::init()
void InformationPanel::init()
{
const int spacing = KDialog::spacingHint();
@ -584,4 +584,4 @@ void InfoSidebarPage::init()
m_initialized = true;
}
#include "infosidebarpage.moc"
#include "informationpanel.moc"

View file

@ -17,10 +17,10 @@
* 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>
@ -42,32 +42,32 @@ class MetaDataWidget;
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.
*/
@ -83,13 +83,13 @@ protected:
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();
@ -145,7 +145,7 @@ private:
/**
* 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;
@ -156,7 +156,7 @@ private:
* 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;
@ -191,4 +191,4 @@ private:
MetaTextLabel* m_metaTextLabel;
};
#endif // INFOSIDEBARPAGE_H
#endif // INFORMATIONPANEL_H

View file

@ -18,29 +18,29 @@
* 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"

View file

@ -18,23 +18,23 @@
* 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;
@ -50,4 +50,4 @@ private:
KUrl m_url;
};
#endif // _SIDEBARPAGE_H_
#endif // PANEL_H

View file

@ -17,12 +17,12 @@
* 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)
{
@ -33,24 +33,24 @@ DolphinFilePlacesView::DolphinFilePlacesView(QWidget* parent) :
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"

View file

@ -17,22 +17,21 @@
* 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);
@ -48,4 +47,4 @@ private:
Qt::MouseButtons m_mouseButtons;
};
#endif // DOLPHINFILEPLACESVIEW_H
#endif // PLACESPANEL_H

View file

@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include "terminalsidebarpage.h"
#include "terminalpanel.h"
#include <klibloader.h>
#include <kde_terminal_interface.h>
@ -27,8 +27,8 @@
#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)
@ -37,40 +37,39 @@ TerminalSidebarPage::TerminalSidebarPage(QWidget* parent) :
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;
}
@ -91,7 +90,7 @@ void TerminalSidebarPage::showEvent(QShowEvent* event)
m_terminalWidget->setFocus();
}
SidebarPage::showEvent(event);
Panel::showEvent(event);
}
#include "terminalsidebarpage.moc"
#include "terminalpanel.moc"

View file

@ -17,10 +17,10 @@
* 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;
@ -30,24 +30,24 @@ class QWidget;
* @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() */
@ -59,4 +59,4 @@ private:
QWidget* m_terminalWidget;
};
#endif // TERMINALSIDEBARPAGE_H
#endif // TERMINALPANEL_H