]> cloud.milkyroute.net Git - dolphin.git/blob - src/infosidebarpage.cpp
Fixed some minor coding guidelines issues (getFoo() -> foo(), ...) to be aligned...
[dolphin.git] / src / infosidebarpage.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * *
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. *
8 * *
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. *
13 * *
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 ***************************************************************************/
19
20 #include "infosidebarpage.h"
21 #include <assert.h>
22
23 #include <qlayout.h>
24 #include <qpixmap.h>
25 #include <qlabel.h>
26 #include <qtimer.h>
27 #include <qpushbutton.h>
28
29 #include <q3popupmenu.h>
30 #include <qpainter.h>
31 #include <qfontmetrics.h>
32 #include <Q3ValueList>
33 #include <QEvent>
34 #include <QInputDialog>
35
36 #include <kbookmarkmanager.h>
37 #include <klocale.h>
38 #include <kstandarddirs.h>
39 #include <kio/previewjob.h>
40 #include <kfileitem.h>
41 #include <kdialog.h>
42 #include <kglobalsettings.h>
43 #include <kfilemetainfo.h>
44 #include <kvbox.h>
45 #include <kseparator.h>
46
47 #include "dolphinmainwindow.h"
48 #include "dolphinapplication.h"
49 #include "pixmapviewer.h"
50 #include "dolphinsettings.h"
51 #include "metadataloader.h"
52
53 InfoSidebarPage::InfoSidebarPage(DolphinMainWindow* mainWindow, QWidget* parent) :
54 SidebarPage(mainWindow, parent),
55 m_multipleSelection(false),
56 m_pendingPreview(false),
57 m_timer(0),
58 m_preview(0),
59 m_name(0),
60 m_infos(0),
61 m_metadata(DolphinApplication::app()->metadataLoader())
62 {
63 const int spacing = KDialog::spacingHint();
64
65 m_timer = new QTimer(this);
66 connect(m_timer, SIGNAL(timeout()),
67 this, SLOT(slotTimeout()));
68
69 QVBoxLayout* layout = new QVBoxLayout;
70 layout->setSpacing(spacing);
71
72 // preview
73 m_preview = new PixmapViewer(this);
74 m_preview->setMinimumWidth(K3Icon::SizeEnormous);
75 m_preview->setFixedHeight(K3Icon::SizeEnormous);
76
77 // name
78 m_name = new QLabel(this);
79 m_name->setTextFormat(Qt::RichText);
80 m_name->setAlignment(m_name->alignment() | Qt::AlignHCenter);
81 QFontMetrics fontMetrics(m_name->font());
82 m_name->setMinimumHeight(fontMetrics.height() * 3);
83 m_name->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
84
85 KSeparator* sep1 = new KSeparator(this);
86
87 // general information
88 m_infos = new QLabel(this);
89 m_infos->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
90 m_infos->setTextFormat(Qt::RichText);
91
92 KSeparator* sep2 = new KSeparator(this);
93
94 // annotation
95 KSeparator* sep3 = 0;
96 if (m_metadata->storageUp()) {
97 m_annotationLabel = new QLabel(this);
98 m_annotationLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
99 m_annotationLabel->setTextFormat(Qt::RichText);
100 m_annotationLabel->setWordWrap(true);
101 m_annotationButton = new QPushButton("", this);
102 m_annotationButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
103 connect(m_annotationButton, SIGNAL(released()), this, SLOT(changeAnnotation()));
104 sep3 = new KSeparator(this);
105 }
106
107 // actions
108 m_actionBox = new KVBox(this);
109 m_actionBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
110
111 // Add a dummy widget with no restriction regarding a vertical resizing.
112 // This assures that information is always top aligned.
113 QWidget* dummy = new QWidget(this);
114
115 layout->addItem(new QSpacerItem(spacing, spacing, QSizePolicy::Preferred, QSizePolicy::Fixed));
116 layout->addWidget(m_preview);
117 layout->addWidget(m_name);
118 layout->addWidget(sep1);
119 layout->addWidget(m_infos);
120 layout->addWidget(sep2);
121 if (m_metadata->storageUp()) {
122 layout->addWidget(m_annotationLabel);
123 layout->addWidget(m_annotationButton);
124 layout->addWidget(sep3);
125 }
126 layout->addWidget(m_actionBox);
127 layout->addWidget(dummy);
128 setLayout(layout);
129 connect(mainWindow, SIGNAL(selectionChanged()),
130 this, SLOT(showItemInfo()));
131
132 connectToActiveView();
133 }
134
135 InfoSidebarPage::~InfoSidebarPage()
136 {
137 }
138
139 void InfoSidebarPage::activeViewChanged()
140 {
141 connectToActiveView();
142 }
143
144 void InfoSidebarPage::requestDelayedItemInfo(const KUrl& url)
145 {
146 cancelRequest();
147
148 if (!url.isEmpty() && !m_multipleSelection) {
149 m_urlCandidate = url;
150 m_timer->setSingleShot(true);
151 m_timer->start(300);
152 }
153 }
154
155 void InfoSidebarPage::requestItemInfo(const KUrl& url)
156 {
157 cancelRequest();
158
159 if (!url.isEmpty() && !m_multipleSelection) {
160 m_shownUrl = url;
161 showItemInfo();
162 }
163 }
164
165 void InfoSidebarPage::showItemInfo()
166 {
167 cancelRequest();
168
169 m_multipleSelection = false;
170
171 // show the preview...
172 DolphinView* view = mainWindow()->activeView();
173 const KFileItemList selectedItems = view->selectedItems();
174 KUrl file;
175 if (selectedItems.count() > 1) {
176 m_multipleSelection = true;
177 } else if(selectedItems.count() == 0) {
178 file = m_shownUrl;
179 } else {
180 file = selectedItems[0]->url();
181 }
182 if (m_multipleSelection) {
183 KIconLoader iconLoader;
184 QPixmap icon = iconLoader.loadIcon("exec",
185 K3Icon::NoGroup,
186 K3Icon::SizeEnormous);
187 m_preview->setPixmap(icon);
188 m_name->setText(i18n("%1 items selected",selectedItems.count()));
189 }
190 else if (!applyBookmark(file)) {
191 // try to get a preview pixmap from the item...
192 KUrl::List list;
193 list.append(file);
194
195 m_pendingPreview = true;
196 m_preview->setPixmap(QPixmap());
197
198 KIO::PreviewJob* job = KIO::filePreview(list,
199 m_preview->width(),
200 K3Icon::SizeEnormous,
201 0,
202 0,
203 true,
204 false);
205 job->setIgnoreMaximumSize(true);
206
207 connect(job, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
208 this, SLOT(gotPreview(const KFileItem*, const QPixmap&)));
209 connect(job, SIGNAL(failed(const KFileItem*)),
210 this, SLOT(slotPreviewFailed(const KFileItem*)));
211
212 QString text("<b>");
213 text.append(file.fileName());
214 text.append("</b>");
215 m_name->setText(text);
216 }
217
218 createMetaInfo();
219 insertActions();
220 }
221
222 void InfoSidebarPage::slotTimeout()
223 {
224 m_shownUrl = m_urlCandidate;
225 showItemInfo();
226 }
227
228 void InfoSidebarPage::slotPreviewFailed(const KFileItem* item)
229 {
230 m_pendingPreview = false;
231 if (!applyBookmark(item->url())) {
232 m_preview->setPixmap(item->pixmap(K3Icon::SizeEnormous));
233 }
234 }
235
236 void InfoSidebarPage::gotPreview(const KFileItem* /* item */,
237 const QPixmap& pixmap)
238 {
239 if (m_pendingPreview) {
240 m_preview->setPixmap(pixmap);
241 m_pendingPreview = false;
242 }
243 }
244
245 void InfoSidebarPage::startService(int index)
246 {
247 DolphinView* view = mainWindow()->activeView();
248 if (view->hasSelection()) {
249 KUrl::List selectedUrls = view->selectedUrls();
250 KDEDesktopMimeType::executeService(selectedUrls, m_actionsVector[index]);
251 }
252 else {
253 KDEDesktopMimeType::executeService(m_shownUrl, m_actionsVector[index]);
254 }
255 }
256
257 void InfoSidebarPage::connectToActiveView()
258 {
259 cancelRequest();
260
261 DolphinView* view = mainWindow()->activeView();
262 connect(view, SIGNAL(requestItemInfo(const KUrl&)),
263 this, SLOT(requestDelayedItemInfo(const KUrl&)));
264 connect(view, SIGNAL(urlChanged(const KUrl&)),
265 this, SLOT(requestItemInfo(const KUrl&)));
266
267 m_shownUrl = view->url();
268 showItemInfo();
269 }
270
271 bool InfoSidebarPage::applyBookmark(const KUrl& url)
272 {
273 KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
274 KBookmark bookmark = root.first();
275 while (!bookmark.isNull()) {
276 if (url.equals(bookmark.url(), KUrl::CompareWithoutTrailingSlash)) {
277 QString text("<b>");
278 text.append(bookmark.text());
279 text.append("</b>");
280 m_name->setText(text);
281
282 KIconLoader iconLoader;
283 QPixmap icon = iconLoader.loadIcon(bookmark.icon(),
284 K3Icon::NoGroup,
285 K3Icon::SizeEnormous);
286 m_preview->setPixmap(icon);
287 return true;
288 }
289 bookmark = root.next(bookmark);
290 }
291
292 return false;
293 }
294
295 void InfoSidebarPage::cancelRequest()
296 {
297 m_timer->stop();
298 m_pendingPreview = false;
299 }
300
301 void InfoSidebarPage::createMetaInfo()
302 {
303 beginInfoLines();
304 DolphinView* view = mainWindow()->activeView();
305 if (!view->hasSelection()) {
306 KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
307 fileItem.refresh();
308
309 if (fileItem.isDir()) {
310 addInfoLine(i18n("Type:"), i18n("Directory"));
311 }
312 showAnnotation(m_shownUrl);
313 }
314 else if (view->selectedItems().count() == 1) {
315 KFileItem* fileItem = view->selectedItems()[0];
316 addInfoLine(i18n("Type:"), fileItem->mimeComment());
317
318 QString sizeText(KIO::convertSize(fileItem->size()));
319 addInfoLine(i18n("Size:"), sizeText);
320 addInfoLine(i18n("Modified:"), fileItem->timeString());
321
322 const KFileMetaInfo& metaInfo = fileItem->metaInfo();
323 if (metaInfo.isValid()) {
324 QStringList keys = metaInfo.supportedKeys();
325 for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) {
326 if (showMetaInfo(*it)) {
327 KFileMetaInfoItem metaInfoItem = metaInfo.item(*it);
328 addInfoLine(*it, metaInfoItem.value().toString());
329 }
330 }
331 }
332 showAnnotation(fileItem->url());
333 }
334 else {
335 showAnnotations(view->selectedItems().urlList());
336 unsigned long int totSize = 0;
337 foreach(KFileItem* item, view->selectedItems()) {
338 totSize += item->size(); //FIXME what to do with directories ? (same with the one-item-selected-code), item->size() does not return the size of the content : not very instinctive for users
339 }
340 addInfoLine(i18n("Total size:"), KIO::convertSize(totSize));
341 }
342 endInfoLines();
343 }
344
345 void InfoSidebarPage::beginInfoLines()
346 {
347 m_infoLines = QString("");
348 }
349
350 void InfoSidebarPage::endInfoLines()
351 {
352 m_infos->setText(m_infoLines);
353 }
354
355 bool InfoSidebarPage::showMetaInfo(const QString& key) const
356 {
357 // sorted list of keys, where it's data should be shown
358 static const char* keys[] = {
359 "Album",
360 "Artist",
361 "Author",
362 "Bitrate",
363 "Date",
364 "Dimensions",
365 "Genre",
366 "Length",
367 "Lines",
368 "Pages",
369 "Title",
370 "Words"
371 };
372
373 // do a binary search for the key...
374 int top = 0;
375 int bottom = sizeof(keys) / sizeof(char*) - 1;
376 while (top < bottom) {
377 const int middle = (top + bottom) / 2;
378 const int result = key.compare(keys[middle]);
379 if (result < 0) {
380 bottom = middle - 1;
381 }
382 else if (result > 0) {
383 top = middle + 1;
384 }
385 else {
386 return true;
387 }
388 }
389
390 return false;
391 }
392
393 void InfoSidebarPage::addInfoLine(const QString& labelText, const QString& infoText)
394 {
395 if (!m_infoLines.isEmpty())
396 m_infoLines += "<br/>";
397 m_infoLines += QString("<b>%1</b> %2").arg(labelText).arg(infoText);
398 }
399
400 void InfoSidebarPage::insertActions()
401 {
402 // delete all existing action widgets
403 // TODO: just use children() from QObject...
404 Q3PtrListIterator<QWidget> deleteIter(m_actionWidgets);
405 QWidget* widget = 0;
406 while ((widget = deleteIter.current()) != 0) {
407 widget->close();
408 widget->deleteLater();
409 ++deleteIter;
410 }
411
412 m_actionWidgets.clear();
413 m_actionsVector.clear();
414
415 int actionsIndex = 0;
416
417 // The algorithm for searching the available actions works on a list
418 // of KFileItems. If no selection is given, a temporary KFileItem
419 // by the given Url 'url' is created and added to the list.
420 KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
421 KFileItemList itemList = mainWindow()->activeView()->selectedItems();
422 if (itemList.isEmpty()) {
423 fileItem.refresh();
424 itemList.append(&fileItem);
425 }
426
427 // 'itemList' contains now all KFileItems, where an item information should be shown.
428 // TODO: the following algorithm is quite equal to DolphinContextMenu::insertActionItems().
429 // It's open yet whether they should be merged or whether they have to work slightly different.
430 QStringList dirs = KGlobal::dirs()->findDirs("data", "dolphin/servicemenus/");
431 for (QStringList::ConstIterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) {
432 QDir dir(*dirIt);
433 QStringList entries = dir.entryList(QStringList("*.desktop"), QDir::Files);
434
435 for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
436 KConfigGroup cfg(KSharedConfig::openConfig( *dirIt + *entryIt, KConfig::OnlyLocal ), "Desktop Entry" );
437 if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
438 const QStringList types = cfg.readEntry("ServiceTypes", QStringList(), ',');
439 for (QStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
440 // check whether the mime type is equal or whether the
441 // mimegroup (e. g. image/*) is supported
442
443 bool insert = false;
444 if ((*it) == "all/allfiles") {
445 // The service type is valid for all files, but not for directories.
446 // Check whether the selected items only consist of files...
447 QListIterator<KFileItem*> mimeIt(itemList);
448 insert = true;
449 while (insert && mimeIt.hasNext()) {
450 KFileItem* item = mimeIt.next();
451 insert = !item->isDir();
452 }
453 }
454
455 if (!insert) {
456 // Check whether the MIME types of all selected files match
457 // to the mimetype of the service action. As soon as one MIME
458 // type does not match, no service menu is shown at all.
459 QListIterator<KFileItem*> mimeIt(itemList);
460 insert = true;
461 while (insert && mimeIt.hasNext()) {
462 KFileItem* item = mimeIt.next();
463 const QString mimeType(item->mimetype());
464 const QString mimeGroup(mimeType.left(mimeType.indexOf('/')));
465
466 insert = (*it == mimeType) ||
467 ((*it).right(1) == "*") &&
468 ((*it).left((*it).indexOf('/')) == mimeGroup);
469 }
470 }
471
472 if (insert) {
473 const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
474 Q3PopupMenu* popup = 0;
475 if (!submenuName.isEmpty()) {
476 // create a sub menu containing all actions
477 popup = new Q3PopupMenu();
478 connect(popup, SIGNAL(activated(int)),
479 this, SLOT(startService(int)));
480
481 QPushButton* button = new QPushButton(submenuName, m_actionBox);
482 button->setFlat(true);
483 button->setMenu(popup);
484 button->show();
485 m_actionWidgets.append(button);
486 }
487
488 Q3ValueList<KDEDesktopMimeType::Service> userServices =
489 KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
490
491 // iterate through all actions and add them to a widget
492 Q3ValueList<KDEDesktopMimeType::Service>::Iterator serviceIt;
493 for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
494 KDEDesktopMimeType::Service service = (*serviceIt);
495 if (popup == 0) {
496 ServiceButton* button = new ServiceButton(KIcon(service.m_strIcon),
497 service.m_strName,
498 m_actionBox,
499 actionsIndex);
500 connect(button, SIGNAL(requestServiceStart(int)),
501 this, SLOT(startService(int)));
502 m_actionWidgets.append(button);
503 button->show();
504 }
505 else {
506 popup->insertItem(KIcon(service.m_strIcon), service.m_strName, actionsIndex);
507 }
508
509 m_actionsVector.append(service);
510 ++actionsIndex;
511 }
512 }
513 }
514 }
515 }
516 }
517 }
518
519 void InfoSidebarPage::showAnnotation(const KUrl& file)
520 {
521 if(m_metadata->storageUp()) {
522 QString text = m_metadata->annotation(file);
523 if (!text.isEmpty()) {
524 m_annotationLabel->show();
525 m_annotationLabel->setText(QString("<b>%1</b> :<br/>%2").arg(i18n("Annotation")).arg(text));
526 m_annotationButton->setText(i18n("Change annotation"));
527 } else {
528 m_annotationLabel->hide();
529 m_annotationButton->setText(i18n("Annotate file"));
530 }
531 }
532 }
533
534 void InfoSidebarPage::showAnnotations(const KUrl::List& files)
535 {
536 if (m_metadata->storageUp()) {
537 bool hasAnnotation = false;
538 unsigned int annotateNum = 0;
539 QString firsts = QString("<b>%1 :</b><br/>").arg(i18n("Annotations"));
540 foreach (KUrl file, files) {
541 QString annotation = m_metadata->annotation(file);
542 if (!annotation.isEmpty()) {
543 hasAnnotation = true;
544 if (annotateNum < 3) {
545 // don't show more than 3 annotations
546 firsts += m_annotationLabel->fontMetrics().elidedText(QString("<b>%1</b> : %2<br/>").arg(file.fileName()).arg(annotation), Qt::ElideRight, width());//FIXME not really the good method, does not handle resizing ...
547 annotateNum++;
548 }
549 }
550 }
551 if (hasAnnotation) {
552 m_annotationLabel->show();
553 m_annotationLabel->setText(firsts);
554 }
555 else {
556 m_annotationLabel->hide();
557 }
558 m_annotationButton->setText(hasAnnotation ? i18n("Change annotations") : i18n("Annotate files"));
559 }
560 }
561
562 void InfoSidebarPage::changeAnnotation()
563 {
564 bool ok = false;
565 KUrl::List files(mainWindow()->activeView()->selectedItems().urlList());
566 QString name, old;
567 if (files.isEmpty()) {
568 files << m_shownUrl;
569 }
570 else if (files.count() == 1) {
571 name = files[0].url();
572 old = m_metadata->annotation(files[0]);
573 }
574 else {
575 name = QString("%1 files").arg(files.count());
576 old = QString();
577 }
578 QString text = QInputDialog::getText(this, "Annotate", QString("Set annotation for %1").arg(name), QLineEdit::Normal, old, &ok);//FIXME temporary, must move to a real dialog
579 if(ok) {
580 foreach(KUrl file, files) {
581 m_metadata->setAnnotation(file, text);
582 }
583 showAnnotation(files[0]);
584 }
585 }
586
587 ServiceButton::ServiceButton(const QIcon& icon,
588 const QString& text,
589 QWidget* parent,
590 int index) :
591 QPushButton(icon, text, parent),
592 m_hover(false),
593 m_index(index)
594 {
595 setEraseColor(palette().brush(QPalette::Background).color());
596 setFocusPolicy(Qt::NoFocus);
597 connect(this, SIGNAL(released()),
598 this, SLOT(slotReleased()));
599 }
600
601 ServiceButton::~ServiceButton()
602 {
603 }
604
605 void ServiceButton::paintEvent(QPaintEvent* event)
606 {
607 Q_UNUSED(event);
608 QPainter painter(this);
609 const int buttonWidth = width();
610 const int buttonHeight = height();
611
612 QColor backgroundColor;
613 QColor foregroundColor;
614 if (m_hover) {
615 backgroundColor = KGlobalSettings::highlightColor();
616 foregroundColor = KGlobalSettings::highlightedTextColor();
617 }
618 else {
619 backgroundColor = palette().brush(QPalette::Background).color();
620 foregroundColor = KGlobalSettings::buttonTextColor();
621 }
622
623 // draw button background
624 painter.setPen(Qt::NoPen);
625 painter.setBrush(backgroundColor);
626 painter.drawRect(0, 0, buttonWidth, buttonHeight);
627
628 const int spacing = KDialog::spacingHint();
629
630 // draw icon
631 int x = spacing;
632 const int y = (buttonHeight - K3Icon::SizeSmall) / 2;
633 const QIcon &set = icon();
634 if (!set.isNull()) {
635 painter.drawPixmap(x, y, set.pixmap(QIcon::Small, QIcon::Normal));
636 }
637 x += K3Icon::SizeSmall + spacing;
638
639 // draw text
640 painter.setPen(foregroundColor);
641
642 const int textWidth = buttonWidth - x;
643 QFontMetrics fontMetrics(font());
644 const bool clipped = fontMetrics.width(text()) >= textWidth;
645 //const int align = clipped ? Qt::AlignVCenter : Qt::AlignCenter;
646 painter.drawText(QRect(x, 0, textWidth, buttonHeight), Qt::AlignVCenter, text());
647
648 if (clipped) {
649 // Blend the right area of the text with the background, as the
650 // text is clipped.
651 // TODO #1: use alpha blending in Qt4 instead of drawing the text that often
652 // TODO #2: same code as in UrlNavigatorButton::drawButton() -> provide helper class?
653 const int blendSteps = 16;
654
655 QColor blendColor(backgroundColor);
656 const int redInc = (foregroundColor.red() - backgroundColor.red()) / blendSteps;
657 const int greenInc = (foregroundColor.green() - backgroundColor.green()) / blendSteps;
658 const int blueInc = (foregroundColor.blue() - backgroundColor.blue()) / blendSteps;
659 for (int i = 0; i < blendSteps; ++i) {
660 painter.setClipRect(QRect(x + textWidth - i, 0, 1, buttonHeight));
661 painter.setPen(blendColor);
662 painter.drawText(QRect(x, 0, textWidth, buttonHeight), Qt::AlignVCenter, text());
663
664 blendColor.setRgb(blendColor.red() + redInc,
665 blendColor.green() + greenInc,
666 blendColor.blue() + blueInc);
667 }
668 }
669 }
670
671 void ServiceButton::enterEvent(QEvent* event)
672 {
673 QPushButton::enterEvent(event);
674 m_hover = true;
675 update();
676 }
677
678 void ServiceButton::leaveEvent(QEvent* event)
679 {
680 QPushButton::leaveEvent(event);
681 m_hover = false;
682 update();
683 }
684
685 void ServiceButton::slotReleased()
686 {
687 emit requestServiceStart(m_index);
688 }
689
690 #include "infosidebarpage.moc"