Changeset View
Changeset View
Standalone View
Standalone View
Viewer/ViewerWidget.cpp
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | 129 | { | |||
---|---|---|---|---|---|
147 | m_popup->addAction( action ); | 147 | m_popup->addAction( action ); | ||
148 | 148 | | |||
149 | m_setStackHead = m_actions->addAction( QString::fromLatin1("viewer-set-stack-head"), this, SLOT(slotSetStackHead()) ); | 149 | m_setStackHead = m_actions->addAction( QString::fromLatin1("viewer-set-stack-head"), this, SLOT(slotSetStackHead()) ); | ||
150 | m_setStackHead->setText( i18nc("@action:inmenu","Set as First Image in Stack") ); | 150 | m_setStackHead->setText( i18nc("@action:inmenu","Set as First Image in Stack") ); | ||
151 | m_setStackHead->setShortcut( Qt::CTRL+Qt::Key_4 ); | 151 | m_setStackHead->setShortcut( Qt::CTRL+Qt::Key_4 ); | ||
152 | m_popup->addAction( m_setStackHead ); | 152 | m_popup->addAction( m_setStackHead ); | ||
153 | 153 | | |||
154 | m_showExifViewer = m_actions->addAction( QString::fromLatin1("viewer-show-exif-viewer"), this, SLOT(showExifViewer()) ); | 154 | m_showExifViewer = m_actions->addAction( QString::fromLatin1("viewer-show-exif-viewer"), this, SLOT(showExifViewer()) ); | ||
155 | m_showExifViewer->setText( i18nc("@action:inmenu","Show EXIF Viewer") ); | 155 | m_showExifViewer->setText( i18nc("@action:inmenu","Show Exif Viewer") ); | ||
156 | m_popup->addAction( m_showExifViewer ); | 156 | m_popup->addAction( m_showExifViewer ); | ||
157 | 157 | | |||
158 | m_copyTo = m_actions->addAction( QString::fromLatin1("viewer-copy-to"), this, SLOT(copyTo()) ); | 158 | m_copyTo = m_actions->addAction( QString::fromLatin1("viewer-copy-to"), this, SLOT(copyTo()) ); | ||
159 | m_copyTo->setText( i18nc("@action:inmenu","Copy image to...") ); | 159 | m_copyTo->setText( i18nc("@action:inmenu","Copy image to...") ); | ||
160 | m_copyTo->setShortcut( Qt::Key_F7 ); | 160 | m_copyTo->setShortcut( Qt::Key_F7 ); | ||
161 | m_popup->addAction( m_copyTo ); | 161 | m_popup->addAction( m_copyTo ); | ||
162 | 162 | | |||
163 | if ( m_type == ViewerWindow ) { | 163 | if ( m_type == ViewerWindow ) { | ||
▲ Show 20 Lines • Show All 322 Lines • ▼ Show 20 Line(s) | 431 | { | |||
486 | if ( m_display == m_textDisplay ) | 486 | if ( m_display == m_textDisplay ) | ||
487 | updateInfoBox(); | 487 | updateInfoBox(); | ||
488 | 488 | | |||
489 | // Add all tagged areas | 489 | // Add all tagged areas | ||
490 | addTaggedAreas(); | 490 | addTaggedAreas(); | ||
491 | } | 491 | } | ||
492 | 492 | | |||
493 | void Viewer::ViewerWidget::setCaptionWithDetail( const QString& detail ) { | 493 | void Viewer::ViewerWidget::setCaptionWithDetail( const QString& detail ) { | ||
494 | setWindowTitle( QString::fromLatin1( "KPhotoAlbum - %1 %2" ) | 494 | setWindowTitle(i18nc("@title:window %1 is the filename, %2 it's detail info", "%1 %2", | ||
495 | .arg( currentInfo()->fileName().absolute() ) | 495 | currentInfo()->fileName().absolute(), | ||
496 | .arg( detail ) ); | 496 | detail)); | ||
497 | } | 497 | } | ||
498 | 498 | | |||
499 | void Viewer::ViewerWidget::contextMenuEvent( QContextMenuEvent * e ) | 499 | void Viewer::ViewerWidget::contextMenuEvent( QContextMenuEvent * e ) | ||
500 | { | 500 | { | ||
501 | if ( m_videoDisplay ) { | 501 | if ( m_videoDisplay ) { | ||
502 | if ( m_videoDisplay->isPaused() ) | 502 | if ( m_videoDisplay->isPaused() ) | ||
503 | m_playPause->setText(i18nc("@action:inmenu Start video playback","Play")); | 503 | m_playPause->setText(i18nc("@action:inmenu Start video playback","Play")); | ||
504 | else | 504 | else | ||
▲ Show 20 Lines • Show All 1007 Lines • ▼ Show 20 Line(s) | |||||
1512 | { | 1512 | { | ||
1513 | QUrl src = QUrl::fromLocalFile(currentInfo()->fileName().absolute()); | 1513 | QUrl src = QUrl::fromLocalFile(currentInfo()->fileName().absolute()); | ||
1514 | if (m_lastCopyToTarget.isNull()) { | 1514 | if (m_lastCopyToTarget.isNull()) { | ||
1515 | // get directory of src file | 1515 | // get directory of src file | ||
1516 | m_lastCopyToTarget = QFileInfo(src.path()).path(); | 1516 | m_lastCopyToTarget = QFileInfo(src.path()).path(); | ||
1517 | } | 1517 | } | ||
1518 | 1518 | | |||
1519 | QFileDialog dialog( this ); | 1519 | QFileDialog dialog( this ); | ||
1520 | dialog.setWindowTitle( i18nc("@title:window", "Copy image to...") ); | 1520 | dialog.setWindowTitle(i18nc("@title:window", "Copy Image to...")); | ||
1521 | // use directory of src as start-location: | 1521 | // use directory of src as start-location: | ||
1522 | dialog.setDirectory(m_lastCopyToTarget); | 1522 | dialog.setDirectory(m_lastCopyToTarget); | ||
1523 | dialog.selectFile(src.fileName()); | 1523 | dialog.selectFile(src.fileName()); | ||
1524 | dialog.setAcceptMode(QFileDialog::AcceptSave); | 1524 | dialog.setAcceptMode(QFileDialog::AcceptSave); | ||
1525 | dialog.setLabelText(QFileDialog::Accept, i18nc("@action:button", "Copy")); | 1525 | dialog.setLabelText(QFileDialog::Accept, i18nc("@action:button", "Copy")); | ||
1526 | 1526 | | |||
1527 | if (dialog.exec()) { | 1527 | if (dialog.exec()) { | ||
1528 | QUrl dst = dialog.selectedUrls().first(); | 1528 | QUrl dst = dialog.selectedUrls().first(); | ||
1529 | KIO::CopyJob *job = KIO::copy(src, dst); | 1529 | KIO::CopyJob *job = KIO::copy(src, dst); | ||
1530 | connect(job, &KIO::CopyJob::finished, job, &QObject::deleteLater); | 1530 | connect(job, &KIO::CopyJob::finished, job, &QObject::deleteLater); | ||
1531 | // get directory of dst file | 1531 | // get directory of dst file | ||
1532 | m_lastCopyToTarget = QFileInfo(dst.path()).path(); | 1532 | m_lastCopyToTarget = QFileInfo(dst.path()).path(); | ||
1533 | } | 1533 | } | ||
1534 | } | 1534 | } | ||
1535 | 1535 | | |||
1536 | // vi:expandtab:tabstop=4 shiftwidth=4: | 1536 | // vi:expandtab:tabstop=4 shiftwidth=4: |