X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftitlewidget.cpp;h=e8184fabeb26483e94abadafd73bd80825bd9ae8;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=b0d2b2cdddc460f27457d3108ac5962dee5fd409;hpb=6f206f85a9c002e4e8e5f80880750739a088ec52;p=kdenlive diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index b0d2b2cd..e8184fab 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -503,8 +503,9 @@ TitleWidget::TitleWidget(const KUrl &url, const Timecode &tc, const QString &pro // scale the view so that the title widget is not too big at startup graphicsView->scale(.5, .5); - if (!url.isEmpty()) loadTitle(url); - else { + if (!url.isEmpty()) { + loadTitle(url); + } else { prepareTools(NULL); slotTextTool(); QTimer::singleShot(200, this, SLOT(slotAdjustZoom())); @@ -639,12 +640,14 @@ void TitleWidget::refreshTitleTemplates() } kDebug() << titlenamelist << titlefiles; } + void TitleWidget::templateIndexChanged(int index) { QString item = templateBox->itemData(index).toString(); if (!item.isEmpty()) { if (lastDocumentHash != QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex()) { - if (KMessageBox::questionYesNo(this, i18n("Do you really want to load a new template? Changes in this title will be lost!")) == KMessageBox::No) return; + if (KMessageBox::questionYesNo(this, i18n("Do you really want to load a new template? Changes in this title will be lost!")) == KMessageBox::No) + return; } loadTitle(item); @@ -669,9 +672,11 @@ void TitleWidget::resizeEvent(QResizeEvent * /*event*/) //slotAdjustZoom(); } //virtual -void TitleWidget::keyPressEvent(QKeyEvent *e){ +void TitleWidget::keyPressEvent(QKeyEvent *e) +{ if(e->key()!=Qt::Key_Escape && e->key()!=Qt::Key_Return && e->key()!=Qt::Key_Enter) QDialog::keyPressEvent(e); } + void TitleWidget::slotTextTool() { m_scene->setTool(TITLE_TEXT); @@ -1078,10 +1083,7 @@ void TitleWidget::selectionChanged() zUp->setEnabled(false); zDown->setEnabled(false); } - - } - } void TitleWidget::slotValueChanged(int type) @@ -1110,7 +1112,7 @@ void TitleWidget::slotValueChanged(int type) break; } - for (int k = 0; k < l.size(); k++) { + for (int k = 0; k < l.size(); ++k) { std::cout << "Type of item " << k << ": " << l.at(k)->type() << "\n"; if (l.at(k)->type() == TEXTITEM) { @@ -1618,8 +1620,7 @@ void TitleWidget::slotUpdateText() void TitleWidget::rectChanged() { QList l = graphicsView->scene()->selectedItems(); - int i; - for (i = 0; i < l.length(); ++i) { + for (int i = 0; i < l.length(); ++i) { if (l.at(i)->type() == RECTITEM && !settingUp) { QGraphicsRectItem *rec = static_cast(l.at(i)); QColor f = rectFColor->color(); @@ -1878,8 +1879,9 @@ void TitleWidget::saveTitle(KUrl url) fs->setMode(KFile::File); fs->setConfirmOverwrite(true); fs->setKeepLocation(true); - fs->exec(); - if (fs) url = fs->selectedUrl(); + if (fs->exec()) { + url = fs->selectedUrl(); + } delete fs; } if (!url.isEmpty()) {