]>
cloud.milkyroute.net Git - dolphin.git/blob - src/dolphincontroller.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "dolphincontroller.h"
24 DolphinController::DolphinController(DolphinView
* dolphinView
) :
26 m_showHiddenFiles(false),
28 m_zoomInPossible(false),
29 m_zoomOutPossible(false),
30 //m_additionalInfoCount(0),
32 m_dolphinView(dolphinView
)
36 DolphinController::~DolphinController()
40 void DolphinController::setUrl(const KUrl
& url
)
48 void DolphinController::triggerUrlChangeRequest(const KUrl
& url
)
51 emit
requestUrlChange(url
);
55 void DolphinController::triggerContextMenuRequest(const QPoint
& pos
)
58 emit
requestContextMenu(pos
);
61 void DolphinController::requestActivation()
66 void DolphinController::indicateDroppedUrls(const KUrl::List
& urls
,
68 const KFileItem
& destItem
,
71 emit
urlsDropped(urls
, destPath
, destItem
, source
);
75 void DolphinController::indicateSortingChange(DolphinView::Sorting sorting
)
77 emit
sortingChanged(sorting
);
80 void DolphinController::indicateSortOrderChange(Qt::SortOrder order
)
82 emit
sortOrderChanged(order
);
85 void DolphinController::indicateAdditionalInfoChange(const KFileItemDelegate::InformationList
& info
)
87 emit
additionalInfoChanged(info
);
90 void DolphinController::setShowHiddenFiles(bool show
)
92 if (m_showHiddenFiles
!= show
) {
93 m_showHiddenFiles
= show
;
94 emit
showHiddenFilesChanged(show
);
98 void DolphinController::setShowPreview(bool show
)
100 if (m_showPreview
!= show
) {
101 m_showPreview
= show
;
102 emit
showPreviewChanged(show
);
106 /*void DolphinController::setAdditionalInfoCount(int count)
108 if (m_additionalInfoCount != count) {
109 m_additionalInfoCount = count;
110 emit additionalInfoCountChanged(count);
114 void DolphinController::indicateActivationChange(bool active
)
116 emit
activationChanged(active
);
119 void DolphinController::triggerZoomIn()
124 void DolphinController::triggerZoomOut()
129 void DolphinController::drawHoverIndication(QWidget
* widget
,
133 QPainter
painter(widget
);
135 QBrush
blendedBrush(brush
);
136 QColor color
= blendedBrush
.color();
138 blendedBrush
.setColor(color
);
140 const int radius
= 10;
141 QPainterPath
path(QPointF(bounds
.left(), bounds
.top() + radius
));
142 path
.quadTo(bounds
.left(), bounds
.top(), bounds
.left() + radius
, bounds
.top());
143 path
.lineTo(bounds
.right() - radius
, bounds
.top());
144 path
.quadTo(bounds
.right(), bounds
.top(), bounds
.right(), bounds
.top() + radius
);
145 path
.lineTo(bounds
.right(), bounds
.bottom() - radius
);
146 path
.quadTo(bounds
.right(), bounds
.bottom(), bounds
.right() - radius
, bounds
.bottom());
147 path
.lineTo(bounds
.left() + radius
, bounds
.bottom());
148 path
.quadTo(bounds
.left(), bounds
.bottom(), bounds
.left(), bounds
.bottom() - radius
);
151 painter
.setRenderHint(QPainter::Antialiasing
);
152 painter
.fillPath(path
, blendedBrush
);
156 void DolphinController::triggerItem(const KFileItem
& item
)
158 emit
itemTriggered(item
);
161 void DolphinController::emitItemEntered(const KFileItem
& item
)
163 emit
itemEntered(item
);
166 void DolphinController::emitViewportEntered()
168 emit
viewportEntered();
171 #include "dolphincontroller.moc"