~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to utilities/advancedrename/common/tooltipcreator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-08-26 19:25:16 UTC
  • mfrom: (1.2.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100826192516-mkbdww0h5v2x4yoy
Tags: 2:1.4.0-0ubuntu1
* New upstream bugfix release (LP: #626751)
* Install the file NEWS as upstream changelog because "ChangeLog" is
  too verbose.
* Don't copy the desktop .pot file to imageplugins, not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
// KDE includes
31
31
 
32
32
#include <klocale.h>
 
33
#include <kiconloader.h>
33
34
 
34
35
// Local includes
35
36
 
49
50
    return m_instance;
50
51
}
51
52
 
 
53
QString TooltipCreator::additionalInformation()
 
54
{
 
55
    QStringList infoItems;
 
56
    infoItems << i18n("Modifiers can be applied to every renaming option.");
 
57
    infoItems << i18n("It is possible to assign multiple modifiers to an option, "
 
58
                      "they are applied in the order you assign them.");
 
59
    infoItems << i18n("Be sure to use the quick access buttons: They might provide "
 
60
                      "additional information about renaming and modifier options.");
 
61
 
 
62
    QString information;
 
63
 
 
64
    information += "<div style='margin-top:20px;'";
 
65
 
 
66
    information += tableStart(90);
 
67
    information += "<tr><td style='vertical-align:top;'><img src='" + getInfoIconResourceName() + "' /></td>";
 
68
    information += "<td><ol>";
 
69
    foreach (const QString& infoItem, infoItems)
 
70
    {
 
71
        information += "<li>" + infoItem + "</li>";
 
72
 
 
73
    }
 
74
    information += "</ol></td></tr>";
 
75
    information += tableEnd();
 
76
 
 
77
    information += "</div>";
 
78
 
 
79
    return information;
 
80
}
 
81
 
 
82
QString TooltipCreator::getInfoIconResourceName()
 
83
{
 
84
    return QString("mydata://info.png");
 
85
}
 
86
 
 
87
QPixmap TooltipCreator::getInfoIcon()
 
88
{
 
89
    return SmallIcon("lighttable", KIconLoader::SizeMedium);
 
90
}
 
91
 
52
92
QString TooltipCreator::tooltip(Parser* parser)
53
93
{
54
94
    if (!parser)
67
107
 
68
108
    if (!parser->modifiers().isEmpty())
69
109
    {
70
 
        tooltip += i18n("<p><i>Modifiers can be applied to every renaming option. <br/>"
71
 
                        "It is possible to assign multiple modifiers to an option, "
72
 
                        "they are applied in the order you assign them.</i></p>");
 
110
        tooltip += additionalInformation();
73
111
    }
74
112
 
75
113
    tooltip += "</body>";
78
116
    return tooltip;
79
117
}
80
118
 
 
119
QString TooltipCreator::tableStart(int width)
 
120
{
 
121
    QString w = QString::number(width) + "%";
 
122
    return QString("<table width=\"%1\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">").arg(w);
 
123
}
 
124
 
81
125
QString TooltipCreator::tableStart()
82
126
{
83
 
    return QString("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">");
 
127
    return tableStart(100);
84
128
}
85
129
 
86
130
QString TooltipCreator::tableEnd()