~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to core/utilities/importui/views/freespacetooltip.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2009-01-19
 
7
 * Description : free space widget tool tip
 
8
 *
 
9
 * Copyright (C) 2009-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 *
 
11
 * This program is free software; you can redistribute it
 
12
 * and/or modify it under the terms of the GNU General
 
13
 * Public License as published by the Free Software Foundation;
 
14
 * either version 2, or (at your option)
 
15
 * any later version.
 
16
 *
 
17
 * This program is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
 * GNU General Public License for more details.
 
21
 *
 
22
 * ============================================================ */
 
23
 
 
24
#include "freespacetooltip.h"
 
25
 
 
26
// Qt includes
 
27
 
 
28
#include <QWidget>
 
29
#include <QString>
 
30
#include <QRect>
 
31
 
 
32
namespace Digikam
 
33
{
 
34
 
 
35
class FreeSpaceToolTip::Private
 
36
{
 
37
public:
 
38
 
 
39
    Private() :
 
40
        parent(0)
 
41
    {
 
42
    }
 
43
 
 
44
    QString  tip;
 
45
 
 
46
    QWidget* parent;
 
47
};
 
48
 
 
49
FreeSpaceToolTip::FreeSpaceToolTip(QWidget* const parent)
 
50
    : DItemToolTip(), d(new Private)
 
51
{
 
52
    d->parent = parent;
 
53
}
 
54
 
 
55
FreeSpaceToolTip::~FreeSpaceToolTip()
 
56
{
 
57
    delete d;
 
58
}
 
59
 
 
60
void FreeSpaceToolTip::setToolTip(const QString& tip)
 
61
{
 
62
    d->tip = tip;
 
63
}
 
64
 
 
65
void FreeSpaceToolTip::show()
 
66
{
 
67
    updateToolTip();
 
68
    reposition();
 
69
 
 
70
    if (isHidden() && !toolTipIsEmpty())
 
71
    {
 
72
        DItemToolTip::show();
 
73
    }
 
74
}
 
75
 
 
76
QRect FreeSpaceToolTip::repositionRect()
 
77
{
 
78
    if (!d->parent)
 
79
    {
 
80
        return QRect();
 
81
    }
 
82
 
 
83
    QRect rect = d->parent->rect();
 
84
    rect.moveTopLeft(d->parent->mapToGlobal(rect.topLeft()));
 
85
    return rect;
 
86
}
 
87
 
 
88
QString FreeSpaceToolTip::tipContents()
 
89
{
 
90
    return d->tip;
 
91
}
 
92
 
 
93
}  // namespace Digikam