Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/animation/timeline_insert_keyframe_dialog.cpp
- This file was added.
1 | #include "timeline_insert_keyframe_dialog.h" | ||||
---|---|---|---|---|---|
2 | | ||||
3 | #include <QLabel> | ||||
4 | #include <QSpinBox> | ||||
5 | #include <QDialogButtonBox> | ||||
6 | #include <QVBoxLayout> | ||||
7 | #include <QFormLayout> | ||||
8 | #include <klocalizedstring.h> | ||||
9 | | ||||
10 | TimelineInsertKeyframeDialog::TimelineInsertKeyframeDialog(QWidget *parent) : | ||||
11 | QDialog(parent) | ||||
12 | { | ||||
13 | setWindowTitle(i18nc("@title:window","Insert Keyframes")); | ||||
14 | setModal(true); | ||||
15 | setLayout(new QVBoxLayout(this)); | ||||
16 | | ||||
17 | frameCountSpinbox.setMinimum(1); | ||||
18 | frameCountSpinbox.setValue(1); | ||||
19 | | ||||
20 | frameTimingSpinbox.setMinimum(1); | ||||
21 | frameTimingSpinbox.setValue(1); | ||||
22 | | ||||
23 | QWidget *formsWidget = new QWidget(); | ||||
24 | QFormLayout *formLayout = new QFormLayout(); | ||||
25 | formsWidget->setLayout( formLayout ); | ||||
26 | layout()->addWidget(formsWidget); | ||||
27 | | ||||
28 | QDialogButtonBox *buttonbox = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); | ||||
29 | layout()->addWidget(buttonbox); | ||||
30 | | ||||
31 | formLayout->addRow(QString(i18nc("@label:spinbox", "Number of frames:")), &frameCountSpinbox); | ||||
32 | formLayout->addRow(QString(i18nc("@label:spinbox", "Frame timing:")), &frameTimingSpinbox); | ||||
33 | | ||||
34 | connect(buttonbox, SIGNAL(accepted()), this, SLOT(accept())); | ||||
35 | connect(buttonbox, SIGNAL(rejected()), this, SLOT(reject())); | ||||
36 | } | ||||
37 | | ||||
38 | bool TimelineInsertKeyframeDialog::promptUserSettings(int &out_count, int &out_timing){ | ||||
39 | if(exec() == QDialog::Accepted){ | ||||
40 | out_count = frameCountSpinbox.value(); | ||||
41 | out_timing = frameTimingSpinbox.value(); | ||||
42 | return true; | ||||
43 | } | ||||
44 | return false; | ||||
45 | } |