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

« back to all changes in this revision

Viewing changes to utilities/slideshow/toolbar.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
{
44
44
public:
45
45
 
46
 
    ToolBarPriv()
 
46
    ToolBarPriv() :
 
47
        canHide(true),
 
48
        playBtn(0),
 
49
        stopBtn(0),
 
50
        nextBtn(0),
 
51
        prevBtn(0)
47
52
    {
48
 
        playBtn = 0;
49
 
        stopBtn = 0;
50
 
        nextBtn = 0;
51
 
        prevBtn = 0;
52
 
        canHide = true;
53
53
    }
54
54
 
55
55
    bool         canHide;
61
61
};
62
62
 
63
63
ToolBar::ToolBar(QWidget* parent)
64
 
       : QWidget(parent), d(new ToolBarPriv)
 
64
    : QWidget(parent), d(new ToolBarPriv)
65
65
{
66
66
    QHBoxLayout* lay = new QHBoxLayout();
67
67
    setLayout(lay);
122
122
void ToolBar::setPaused(bool val)
123
123
{
124
124
    if (val == isPaused())
 
125
    {
125
126
        return;
 
127
    }
126
128
 
127
129
    d->playBtn->setChecked(val);
128
130
    slotPlayBtnToggled();
146
148
void ToolBar::slotPlayBtnToggled()
147
149
{
148
150
    KIconLoader* loader = KIconLoader::global();
 
151
 
149
152
    if (d->playBtn->isChecked())
150
153
    {
151
154
        d->canHide = false;
174
177
 
175
178
void ToolBar::keyPressEvent(QKeyEvent* e)
176
179
{
177
 
    switch(e->key())
 
180
    switch (e->key())
178
181
    {
179
182
        case(Qt::Key_Space):
180
183
        {
181
184
            if (d->playBtn->isEnabled())
 
185
            {
182
186
                d->playBtn->animateClick();
 
187
            }
 
188
 
183
189
            break;
184
190
        }
185
191
        case(Qt::Key_PageUp):
186
192
        {
187
193
            if (d->prevBtn->isEnabled())
 
194
            {
188
195
                d->prevBtn->animateClick();
 
196
            }
 
197
 
189
198
            break;
190
199
        }
191
200
        case(Qt::Key_PageDown):
192
201
        {
193
202
            if (d->nextBtn->isEnabled())
 
203
            {
194
204
                d->nextBtn->animateClick();
 
205
            }
 
206
 
195
207
            break;
196
208
        }
197
209
        case(Qt::Key_Escape):
198
210
        {
199
211
            if (d->stopBtn->isEnabled())
 
212
            {
200
213
                d->stopBtn->animateClick();
 
214
            }
 
215
 
201
216
            break;
202
217
        }
203
218
        default: