merged with slight code cleanup

This commit is contained in:
itsmattkc
2019-01-12 13:55:53 +11:00
53 changed files with 659 additions and 484 deletions
+11 -1
View File
@@ -14,7 +14,17 @@ AboutDialog::AboutDialog(QWidget *parent) :
layout->setSpacing(20);
setLayout(layout);
QLabel* label = new QLabel("<html><head/><body><p><img src=\":/icons/olive-splash.png\"/></p><p><a href=\"https://www.olivevideoeditor.org/\"><span style=\" text-decoration: underline; color:#007af4;\">https://www.olivevideoeditor.org/</span></a></p><p>Olive is a non-linear video editor. This software is free and protected by the GNU GPL.</p><p>Olive Team is obliged to inform users that Olive source code is available for download from its website.</p><p>Olive uses (at least) the following libraries in accordance with the GNU GPL/LGPL:</p><p>Qt, FFmpeg, libass, libfreetype, libmp3lame, libopenjpeg, libopus, libtheora, libtwolame, libvpx, libwavpack, libwebp, libx264, libx265, lzma, bzlib, zlib, libvidstab, libvorbis.</p></body></html>");
QLabel* label =
new QLabel("<html><head/><body>"
"<p><img src=\":/icons/olive-splash.png\"/></p>"
"<p><a href=\"https://www.olivevideoeditor.org/\">"
"<span style=\" text-decoration: underline; color:#007af4;\">"
"https://www.olivevideoeditor.org/"
"</span></a></p><p>"
+ tr("Olive is a non-linear video editor. This software is free and protected by the GNU GPL.")
+ "</p><p>"
+ tr("Olive Team is obliged to inform users that Olive source code is available for download from its website.")
+ "</p></body></html>");
label->setAlignment(Qt::AlignCenter);
label->setWordWrap(true);
layout->addWidget(label);
+1 -1
View File
@@ -23,7 +23,7 @@ ActionSearch::ActionSearch(QWidget *parent) :
QFont entry_field_font = entry_field->font();
entry_field_font.setPointSize(qRound(entry_field_font.pointSize()*1.2));
entry_field->setFont(entry_field_font);
entry_field->setPlaceholderText("Search for action...");
entry_field->setPlaceholderText(tr("Search for action..."));
connect(entry_field, SIGNAL(textChanged(const QString&)), this, SLOT(search_update(const QString &)));
connect(entry_field, SIGNAL(returnPressed()), this, SLOT(perform_action()));
connect(entry_field, SIGNAL(moveSelectionUp()), this, SLOT(move_selection_up()));
+1 -1
View File
@@ -8,7 +8,7 @@
DebugDialog* debug_dialog = nullptr;
DebugDialog::DebugDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle("Debug Log");
setWindowTitle(tr("Debug Log"));
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
+14 -3
View File
@@ -7,7 +7,7 @@
DemoNotice::DemoNotice(QWidget *parent) :
QDialog(parent)
{
setWindowTitle("Welcome to Olive!");
setWindowTitle(tr("Welcome to Olive!"));
setMaximumWidth(600);
QVBoxLayout* vlayout = new QVBoxLayout();
@@ -17,10 +17,21 @@ DemoNotice::DemoNotice(QWidget *parent) :
layout->setMargin(10);
layout->setSpacing(20);
QLabel* icon = new QLabel("<html><head/><body><p><img src=\":/icons/olive-splash.png\"/></p></body></html>");
QLabel* icon = new QLabel("<html><head/><body>"
"<p><img src=\":/icons/olive-splash.png\"/></p>"
"</body></html>");
layout->addWidget(icon);
QLabel* text = new QLabel("<html><head/><body><p><span style=\" font-size:14pt;\">Welcome to Olive!</span></p><p>Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.</p><p>This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at <a href=\"https://olivevideoeditor.org/\"><span style=\" text-decoration: underline; color:#007af4;\">www.olivevideoeditor.org</span></a></p><p>Thank you for trying Olive and we hope you enjoy it!</p></body></html>");
QLabel* text = new QLabel("<html><head/><body><p>"
"<span style=\" font-size:14pt;\">"
+ tr("Welcome to Olive!")
+ "</span></p><p>"
+ tr("Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.")
+ "</p><p>"
+ tr("This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at %1").arg("<a href=\"https://olivevideoeditor.org/\"><span style=\" text-decoration: underline; color:#007af4;\">www.olivevideoeditor.org</span></a>")
+ "</p><p>"
+ tr("Thank you for trying Olive and we hope you enjoy it!")
+ "</p></body></html>");
text->setWordWrap(true);
layout->addWidget(text);
+57 -34
View File
@@ -57,7 +57,7 @@ enum ExportFormats {
ExportDialog::ExportDialog(QWidget *parent) :
QDialog(parent)
{
setWindowTitle("Export \"" + sequence->name + "\"");
setWindowTitle(tr("Export \"%1\"").arg(sequence->name));
setup_ui();
rangeCombobox->setCurrentIndex(0);
@@ -320,7 +320,12 @@ void ExportDialog::format_changed(int index)
void ExportDialog::render_thread_finished() {
if (progressBar->value() < 100 && !cancelled) {
QMessageBox::critical(this, "Export Failed", "Export failed - " + export_error, QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Export Failed"),
tr("Export failed - %1").arg(export_error),
QMessageBox::Ok
);
}
prep_ui_for_render(false);
panel_sequence_viewer->viewer_widget->makeCurrent();
@@ -337,7 +342,12 @@ void ExportDialog::prep_ui_for_render(bool r) {
void ExportDialog::export_action() {
if (widthSpinbox->value()%2 == 1 || heightSpinbox->value()%2 == 1) {
QMessageBox::critical(this, "Invalid dimensions", "Export width and height must both be even numbers/divisible by 2.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Invalid dimensions"),
tr("Export width and height must both be even numbers/divisible by 2."),
QMessageBox::Ok
);
return;
}
@@ -389,7 +399,12 @@ void ExportDialog::export_action() {
break;
default:
qCritical() << "Invalid codec selection for an image sequence";
QMessageBox::critical(this, "Invalid codec", "Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Invalid codec"),
tr("Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers."),
QMessageBox::Ok
);
return;
}
break;
@@ -454,10 +469,20 @@ void ExportDialog::export_action() {
break;
default:
qCritical() << "Invalid format - this is a bug, please inform the developers";
QMessageBox::critical(this, "Invalid format", "Couldn't determine output format. This is a bug, please contact the developers.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Invalid format"),
tr("Couldn't determine output format. This is a bug, please contact the developers."),
QMessageBox::Ok
);
return;
}
QString filename = QFileDialog::getSaveFileName(this, "Export Media", "", format_strings[formatCombobox->currentIndex()] + " (*." + ext + ")");
QString filename = QFileDialog::getSaveFileName(
this,
tr("Export Media"),
"",
format_strings[formatCombobox->currentIndex()] + " (*." + ext + ")"
);
if (!filename.isEmpty()) {
if (!filename.endsWith("." + ext, Qt::CaseInsensitive)) {
filename += "." + ext;
@@ -540,11 +565,11 @@ void ExportDialog::vcodec_changed(int index) {
compressionTypeCombobox->clear();
if ((format_vcodecs.size() > 0 && format_vcodecs.at(index) == AV_CODEC_ID_H264)) {
compressionTypeCombobox->setEnabled(true);
compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)", COMPRESSION_TYPE_CFR);
compressionTypeCombobox->addItem(tr("Quality-based (Constant Rate Factor)"), COMPRESSION_TYPE_CFR);
// compressionTypeCombobox->addItem("File size-based (Two-Pass)", COMPRESSION_TYPE_TARGETSIZE);
// compressionTypeCombobox->addItem("Average bitrate (Two-Pass)", COMPRESSION_TYPE_TARGETBR);
} else {
compressionTypeCombobox->addItem("Constant Bitrate", COMPRESSION_TYPE_CBR);
compressionTypeCombobox->addItem(tr("Constant Bitrate"), COMPRESSION_TYPE_CBR);
compressionTypeCombobox->setCurrentIndex(0);
compressionTypeCombobox->setEnabled(false);
}
@@ -557,17 +582,17 @@ void ExportDialog::comp_type_changed(int) {
switch (compressionTypeCombobox->currentData().toInt()) {
case COMPRESSION_TYPE_CBR:
case COMPRESSION_TYPE_TARGETBR:
videoBitrateLabel->setText("Bitrate (Mbps):");
videoBitrateLabel->setText(tr("Bitrate (Mbps):"));
videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * sequence->height) - 4.5)));
break;
case COMPRESSION_TYPE_CFR:
videoBitrateLabel->setText("Quality (CRF):");
videoBitrateLabel->setText(tr("Quality (CRF):"));
videobitrateSpinbox->setValue(36);
videobitrateSpinbox->setMaximum(51);
videobitrateSpinbox->setToolTip("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible");
videobitrateSpinbox->setToolTip(tr("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible"));
break;
case COMPRESSION_TYPE_TARGETSIZE:
videoBitrateLabel->setText("Target File Size (MB):");
videoBitrateLabel->setText(tr("Target File Size (MB):"));
videobitrateSpinbox->setValue(100);
break;
}
@@ -576,59 +601,57 @@ void ExportDialog::comp_type_changed(int) {
void ExportDialog::setup_ui() {
QVBoxLayout* verticalLayout = new QVBoxLayout(this);
QHBoxLayout* horizontalLayout = new QHBoxLayout();
QHBoxLayout* format_layout = new QHBoxLayout();
horizontalLayout->addWidget(new QLabel("Format:"));
format_layout->addWidget(new QLabel(tr("Format:")));
formatCombobox = new QComboBox(this);
horizontalLayout->addWidget(formatCombobox);
format_layout->addWidget(formatCombobox);
verticalLayout->addLayout(horizontalLayout);
verticalLayout->addLayout(format_layout);
QHBoxLayout* horizontalLayout_4 = new QHBoxLayout();
QHBoxLayout* range_layout = new QHBoxLayout();
horizontalLayout_4->addWidget(new QLabel("Range:"));
range_layout->addWidget(new QLabel(tr("Range:")));
rangeCombobox = new QComboBox(this);
rangeCombobox->addItem("Entire Sequence");
rangeCombobox->addItem("In to Out");
rangeCombobox->addItem(tr("Entire Sequence"));
rangeCombobox->addItem(tr("In to Out"));
horizontalLayout_4->addWidget(rangeCombobox);
range_layout->addWidget(rangeCombobox);
verticalLayout->addLayout(horizontalLayout_4);
verticalLayout->addLayout(range_layout);
videoGroupbox = new QGroupBox(this);
videoGroupbox->setTitle("Video");
videoGroupbox->setTitle(tr("Video"));
videoGroupbox->setFlat(false);
videoGroupbox->setCheckable(true);
QGridLayout* videoGridLayout = new QGridLayout(videoGroupbox);
videoGridLayout->addWidget(new QLabel("Codec:"), 0, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1);
vcodecCombobox = new QComboBox(videoGroupbox);
videoGridLayout->addWidget(vcodecCombobox, 0, 1, 1, 1);
videoGridLayout->addWidget(new QLabel("Width:"), 1, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Width:")), 1, 0, 1, 1);
widthSpinbox = new QSpinBox(videoGroupbox);
widthSpinbox->setMaximum(16777216);
videoGridLayout->addWidget(widthSpinbox, 1, 1, 1, 1);
videoGridLayout->addWidget(new QLabel("Height:"), 2, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Height:")), 2, 0, 1, 1);
heightSpinbox = new QSpinBox(videoGroupbox);
heightSpinbox->setMaximum(16777216);
videoGridLayout->addWidget(heightSpinbox, 2, 1, 1, 1);
videoGridLayout->addWidget(new QLabel("Frame Rate:"), 3, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Frame Rate:")), 3, 0, 1, 1);
framerateSpinbox = new QDoubleSpinBox(videoGroupbox);
framerateSpinbox->setMaximum(60);
framerateSpinbox->setValue(0);
videoGridLayout->addWidget(framerateSpinbox, 3, 1, 1, 1);
videoGridLayout->addWidget(new QLabel("Compression Type:"), 4, 0, 1, 1);
compressionTypeCombobox = new QComboBox(videoGroupbox);
compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)");
compressionTypeCombobox->addItem("File size-based (Two-Pass)");
videoGridLayout->addWidget(new QLabel(tr("Compression Type:")), 4, 0, 1, 1);
compressionTypeCombobox = new QComboBox(videoGroupbox);
videoGridLayout->addWidget(compressionTypeCombobox, 4, 1, 1, 1);
videoBitrateLabel = new QLabel(videoGroupbox);
@@ -646,17 +669,17 @@ void ExportDialog::setup_ui() {
QGridLayout* audioGridLayout = new QGridLayout(audioGroupbox);
audioGridLayout->addWidget(new QLabel("Codec:"), 0, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1);
acodecCombobox = new QComboBox(audioGroupbox);
audioGridLayout->addWidget(acodecCombobox, 0, 1, 1, 1);
audioGridLayout->addWidget(new QLabel("Sampling Rate:"), 1, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Sampling Rate:")), 1, 0, 1, 1);
samplingRateSpinbox = new QSpinBox(audioGroupbox);
samplingRateSpinbox->setMaximum(96000);
samplingRateSpinbox->setValue(0);
audioGridLayout->addWidget(samplingRateSpinbox, 1, 1, 1, 1);
audioGridLayout->addWidget(new QLabel("Bitrate (Kbps/CBR):"), 3, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Bitrate (Kbps/CBR):")), 3, 0, 1, 1);
audiobitrateSpinbox = new QSpinBox(audioGroupbox);
audiobitrateSpinbox->setMaximum(320);
audiobitrateSpinbox->setValue(256);
+3 -3
View File
@@ -14,19 +14,19 @@
#include "mainwindow.h"
LoadDialog::LoadDialog(QWidget *parent, bool autorecovery) : QDialog(parent) {
setWindowTitle("Loading...");
setWindowTitle(tr("Loading..."));
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
layout->addWidget(new QLabel("Loading '" + project_url.mid(project_url.lastIndexOf('/')+1) + "'..."));
layout->addWidget(new QLabel(tr("Loading '%1'...").arg(project_url.mid(project_url.lastIndexOf('/')+1))));
bar = new QProgressBar();
bar->setValue(0);
layout->addWidget(bar);
cancel_button = new QPushButton("Cancel");
cancel_button = new QPushButton(tr("Cancel"));
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(cancel()));
hboxLayout = new QHBoxLayout();
+31 -10
View File
@@ -19,7 +19,7 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
QDialog(parent),
item(i)
{
setWindowTitle("\"" + i->get_name() + "\" Properties");
setWindowTitle(tr("\"%1\" Properties").arg(i->get_name()));
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QGridLayout* grid = new QGridLayout();
@@ -29,13 +29,21 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
Footage* f = item->to_footage();
grid->addWidget(new QLabel("Tracks:"), row, 0, 1, 2);
grid->addWidget(new QLabel(tr("Tracks:")), row, 0, 1, 2);
row++;
track_list = new QListWidget();
for (int i=0;i<f->video_tracks.size();i++) {
const FootageStream& fs = f->video_tracks.at(i);
QListWidgetItem* item = new QListWidgetItem("Video " + QString::number(fs.file_index) + ": " + QString::number(fs.video_width) + "x" + QString::number(fs.video_height) + " " + QString::number(fs.video_frame_rate) + "FPS");
QListWidgetItem* item = new QListWidgetItem(
tr("Video %1: %2x%3 %4FPS").arg(
QString::number(fs.file_index),
QString::number(fs.video_width),
QString::number(fs.video_height),
QString::number(fs.video_frame_rate)
)
);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked);
item->setData(Qt::UserRole+1, fs.file_index);
@@ -43,7 +51,13 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
}
for (int i=0;i<f->audio_tracks.size();i++) {
const FootageStream& fs = f->audio_tracks.at(i);
QListWidgetItem* item = new QListWidgetItem("Audio " + QString::number(fs.file_index) + ": " + QString::number(fs.audio_frequency) + "Hz " + QString::number(fs.audio_channels) + " channels");
QListWidgetItem* item = new QListWidgetItem(
tr("Audio %1: %2Hz %3 channels").arg(
QString::number(fs.file_index),
QString::number(fs.audio_frequency),
QString::number(fs.audio_channels)
)
);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked);
item->setData(Qt::UserRole+1, fs.file_index);
@@ -55,7 +69,7 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
if (f->video_tracks.size() > 0) {
// frame conforming
if (!f->video_tracks.at(0).infinite_length) {
grid->addWidget(new QLabel("Conform to Frame Rate:"), row, 0);
grid->addWidget(new QLabel(tr("Conform to Frame Rate:")), row, 0);
conform_fr = new QDoubleSpinBox();
conform_fr->setMinimum(0.01);
conform_fr->setValue(f->video_tracks.at(0).video_frame_rate * f->speed);
@@ -65,22 +79,29 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
row++;
// deinterlacing mode
interlacing_box = new QComboBox();
interlacing_box->addItem("Auto (" + get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing) + ")");
interlacing_box = new QComboBox();
interlacing_box->addItem(
tr("Auto (%1)").arg(
get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing)
)
);
interlacing_box->addItem(get_interlacing_name(VIDEO_PROGRESSIVE));
interlacing_box->addItem(get_interlacing_name(VIDEO_TOP_FIELD_FIRST));
interlacing_box->addItem(get_interlacing_name(VIDEO_BOTTOM_FIELD_FIRST));
interlacing_box->setCurrentIndex((f->video_tracks.at(0).video_auto_interlacing == f->video_tracks.at(0).video_interlacing) ? 0 : f->video_tracks.at(0).video_interlacing + 1);
interlacing_box->setCurrentIndex(
(f->video_tracks.at(0).video_auto_interlacing == f->video_tracks.at(0).video_interlacing)
? 0
: f->video_tracks.at(0).video_interlacing + 1);
grid->addWidget(new QLabel("Interlacing:"), row, 0);
grid->addWidget(new QLabel(tr("Interlacing:")), row, 0);
grid->addWidget(interlacing_box, row, 1);
row++;
}
name_box = new QLineEdit(item->get_name());
grid->addWidget(new QLabel("Name:"), row, 0);
grid->addWidget(new QLabel(tr("Name:")), row, 0);
grid->addWidget(name_box, row, 1);
row++;
+70 -70
View File
@@ -31,7 +31,7 @@ NewSequenceDialog::NewSequenceDialog(QWidget *parent, Media *existing) :
if (existing != nullptr) {
existing_sequence = existing->to_sequence();
setWindowTitle("Editing \"" + existing_sequence->name + "\"");
setWindowTitle(tr("Editing \"%1\"").arg(existing_sequence->name));
width_numeric->setValue(existing_sequence->width);
height_numeric->setValue(existing_sequence->height);
@@ -42,7 +42,7 @@ NewSequenceDialog::NewSequenceDialog(QWidget *parent, Media *existing) :
break;
}
}
sequence_name_edit->setText(existing_sequence->name);
sequence_name_edit->setText(existing_sequence->name);
for (int i=0;i<audio_frequency_combobox->count();i++) {
if (audio_frequency_combobox->itemData(i) == existing_sequence->audio_frequency) {
audio_frequency_combobox->setCurrentIndex(i);
@@ -51,7 +51,7 @@ NewSequenceDialog::NewSequenceDialog(QWidget *parent, Media *existing) :
}
} else {
existing_sequence = nullptr;
setWindowTitle("New Sequence");
setWindowTitle(tr("New Sequence"));
}
}
@@ -59,14 +59,14 @@ NewSequenceDialog::~NewSequenceDialog()
{}
void NewSequenceDialog::set_sequence_name(const QString& s) {
sequence_name_edit->setText(s);
sequence_name_edit->setText(s);
}
void NewSequenceDialog::create() {
if (existing_sequence == nullptr) {
Sequence* s = new Sequence();
s->name = sequence_name_edit->text();
s->name = sequence_name_edit->text();
s->width = width_numeric->value();
s->height = height_numeric->value();
s->frame_rate = frame_rate_combobox->currentData().toDouble();
@@ -82,7 +82,7 @@ void NewSequenceDialog::create() {
double multiplier = frame_rate_combobox->currentData().toDouble() / existing_sequence->frame_rate;
EditSequenceCommand* esc = new EditSequenceCommand(existing_item, existing_sequence);
esc->name = sequence_name_edit->text();
esc->name = sequence_name_edit->text();
esc->width = width_numeric->value();
esc->height = height_numeric->value();
esc->frame_rate = frame_rate_combobox->currentData().toDouble();
@@ -154,85 +154,85 @@ void NewSequenceDialog::setup_ui() {
QWidget* widget = new QWidget(this);
QHBoxLayout* preset_layout = new QHBoxLayout(widget);
preset_layout->setContentsMargins(0, 0, 0, 0);
QHBoxLayout* preset_layout = new QHBoxLayout(widget);
preset_layout->setContentsMargins(0, 0, 0, 0);
preset_layout->addWidget(new QLabel("Preset:"));
preset_layout->addWidget(new QLabel(tr("Preset:")));
preset_combobox = new QComboBox(widget);
preset_combobox->addItem("Film 4K");
preset_combobox->addItem("TV 4K (Ultra HD/2160p)");
preset_combobox->addItem("1080p");
preset_combobox->addItem("720p");
preset_combobox->addItem("480p");
preset_combobox->addItem("360p");
preset_combobox->addItem("240p");
preset_combobox->addItem("144p");
preset_combobox->addItem("NTSC (480i)");
preset_combobox->addItem("PAL (576i)");
preset_combobox->addItem("Custom");
preset_combobox->addItem(tr("Film 4K"));
preset_combobox->addItem(tr("TV 4K (Ultra HD/2160p)"));
preset_combobox->addItem(tr("1080p"));
preset_combobox->addItem(tr("720p"));
preset_combobox->addItem(tr("480p"));
preset_combobox->addItem(tr("360p"));
preset_combobox->addItem(tr("240p"));
preset_combobox->addItem(tr("144p"));
preset_combobox->addItem(tr("NTSC (480i)"));
preset_combobox->addItem(tr("PAL (576i)"));
preset_combobox->addItem(tr("Custom"));
preset_combobox->setCurrentIndex(2);
preset_layout->addWidget(preset_combobox);
preset_layout->addWidget(preset_combobox);
verticalLayout->addWidget(widget);
QGroupBox* videoGroupBox = new QGroupBox(this);
videoGroupBox->setTitle("Video");
QGroupBox* videoGroupBox = new QGroupBox(this);
videoGroupBox->setTitle(tr("Video"));
QGridLayout* videoLayout = new QGridLayout(videoGroupBox);
QGridLayout* videoLayout = new QGridLayout(videoGroupBox);
videoLayout->addWidget(new QLabel("Width:"), 0, 0, 1, 1);
width_numeric = new QSpinBox(videoGroupBox);
width_numeric->setMaximum(9999);
width_numeric->setValue(1920);
videoLayout->addWidget(width_numeric, 0, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Width:")), 0, 0, 1, 1);
width_numeric = new QSpinBox(videoGroupBox);
width_numeric->setMaximum(9999);
width_numeric->setValue(1920);
videoLayout->addWidget(width_numeric, 0, 2, 1, 2);
videoLayout->addWidget(new QLabel("Height:"), 1, 0, 1, 2);
height_numeric = new QSpinBox(videoGroupBox);
videoLayout->addWidget(new QLabel(tr("Height:")), 1, 0, 1, 2);
height_numeric = new QSpinBox(videoGroupBox);
height_numeric->setMaximum(9999);
height_numeric->setValue(1080);
videoLayout->addWidget(height_numeric, 1, 2, 1, 2);
videoLayout->addWidget(height_numeric, 1, 2, 1, 2);
videoLayout->addWidget(new QLabel("Frame Rate:"), 2, 0, 1, 1);
frame_rate_combobox = new QComboBox(videoGroupBox);
frame_rate_combobox->addItem("10 FPS", 10.0);
frame_rate_combobox->addItem("12.5 FPS", 12.5);
frame_rate_combobox->addItem("15 FPS", 15.0);
frame_rate_combobox->addItem("23.976 FPS", 23.976);
frame_rate_combobox->addItem("24 FPS", 24.0);
frame_rate_combobox->addItem("25 FPS", 25.0);
frame_rate_combobox->addItem("29.97 FPS", 29.97);
frame_rate_combobox->addItem("30 FPS", 30.0);
frame_rate_combobox->addItem("50 FPS", 50.0);
frame_rate_combobox->addItem("59.94 FPS", 59.94);
frame_rate_combobox->addItem("60 FPS", 60.0);
frame_rate_combobox->setCurrentIndex(6);
videoLayout->addWidget(frame_rate_combobox, 2, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Frame Rate:")), 2, 0, 1, 1);
frame_rate_combobox = new QComboBox(videoGroupBox);
frame_rate_combobox->addItem("10 FPS", 10.0);
frame_rate_combobox->addItem("12.5 FPS", 12.5);
frame_rate_combobox->addItem("15 FPS", 15.0);
frame_rate_combobox->addItem("23.976 FPS", 23.976);
frame_rate_combobox->addItem("24 FPS", 24.0);
frame_rate_combobox->addItem("25 FPS", 25.0);
frame_rate_combobox->addItem("29.97 FPS", 29.97);
frame_rate_combobox->addItem("30 FPS", 30.0);
frame_rate_combobox->addItem("50 FPS", 50.0);
frame_rate_combobox->addItem("59.94 FPS", 59.94);
frame_rate_combobox->addItem("60 FPS", 60.0);
frame_rate_combobox->setCurrentIndex(6);
videoLayout->addWidget(frame_rate_combobox, 2, 2, 1, 2);
videoLayout->addWidget(new QLabel("Pixel Aspect Ratio:"), 4, 0, 1, 1);
par_combobox = new QComboBox(videoGroupBox);
par_combobox->addItem("Square Pixels (1.0)");
videoLayout->addWidget(par_combobox, 4, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Pixel Aspect Ratio:")), 4, 0, 1, 1);
par_combobox = new QComboBox(videoGroupBox);
par_combobox->addItem(tr("Square Pixels (1.0)"));
videoLayout->addWidget(par_combobox, 4, 2, 1, 2);
videoLayout->addWidget(new QLabel("Interlacing:"), 6, 0, 1, 1);
interlacing_combobox = new QComboBox(videoGroupBox);
interlacing_combobox->addItem("None (Progressive)");
videoLayout->addWidget(new QLabel(tr("Interlacing:")), 6, 0, 1, 1);
interlacing_combobox = new QComboBox(videoGroupBox);
interlacing_combobox->addItem(tr("None (Progressive)"));
// interlacing_combobox->addItem("Upper Field First");
// interlacing_combobox->addItem("Lower Field First");
videoLayout->addWidget(interlacing_combobox, 6, 2, 1, 2);
videoLayout->addWidget(interlacing_combobox, 6, 2, 1, 2);
verticalLayout->addWidget(videoGroupBox);
verticalLayout->addWidget(videoGroupBox);
QGroupBox* audioGroupBox = new QGroupBox(this);
audioGroupBox->setTitle("Audio");
QGroupBox* audioGroupBox = new QGroupBox(this);
audioGroupBox->setTitle(tr("Audio"));
QGridLayout* audioLayout = new QGridLayout(audioGroupBox);
QGridLayout* audioLayout = new QGridLayout(audioGroupBox);
audioLayout->addWidget(new QLabel("Sample Rate: "), 0, 0, 1, 1);
audioLayout->addWidget(new QLabel(tr("Sample Rate: ")), 0, 0, 1, 1);
audio_frequency_combobox = new QComboBox(audioGroupBox);
audio_frequency_combobox = new QComboBox(audioGroupBox);
audio_frequency_combobox->addItem("22050 Hz", 22050);
audio_frequency_combobox->addItem("24000 Hz", 24000);
audio_frequency_combobox->addItem("32000 Hz", 32000);
@@ -242,21 +242,21 @@ void NewSequenceDialog::setup_ui() {
audio_frequency_combobox->addItem("96000 Hz", 96000);
audio_frequency_combobox->setCurrentIndex(4);
audioLayout->addWidget(audio_frequency_combobox, 0, 1, 1, 1);
audioLayout->addWidget(audio_frequency_combobox, 0, 1, 1, 1);
verticalLayout->addWidget(audioGroupBox);
verticalLayout->addWidget(audioGroupBox);
QWidget* nameWidget = new QWidget(this);
QHBoxLayout* nameLayout = new QHBoxLayout(nameWidget);
nameLayout->setContentsMargins(0, 0, 0, 0);
QWidget* nameWidget = new QWidget(this);
QHBoxLayout* nameLayout = new QHBoxLayout(nameWidget);
nameLayout->setContentsMargins(0, 0, 0, 0);
nameLayout->addWidget(new QLabel("Name:"));
nameLayout->addWidget(new QLabel("Name:"));
sequence_name_edit = new QLineEdit(nameWidget);
sequence_name_edit = new QLineEdit(nameWidget);
nameLayout->addWidget(sequence_name_edit);
nameLayout->addWidget(sequence_name_edit);
verticalLayout->addWidget(nameWidget);
verticalLayout->addWidget(nameWidget);
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
buttonBox->setOrientation(Qt::Horizontal);
+50 -39
View File
@@ -54,7 +54,7 @@ QString KeySequenceEditor::export_shortcut() {
PreferencesDialog::PreferencesDialog(QWidget *parent) :
QDialog(parent)
{
setWindowTitle("Preferences");
setWindowTitle(tr("Preferences"));
setup_ui();
accurateSeekButton->setChecked(!config.fast_seeking);
@@ -110,7 +110,11 @@ void PreferencesDialog::setup_kbd_shortcuts(QMenuBar* menubar) {
void PreferencesDialog::save() {
if (!custom_css_fn->text().isEmpty() && !QFileInfo::exists(custom_css_fn->text())) {
QMessageBox::critical(this, "Invalid CSS File", "CSS file '" + custom_css_fn->text() + "' does not exist.");
QMessageBox::critical(
this,
tr("Invalid CSS File"),
tr("CSS file '%1' does not exist.").arg(custom_css_fn->text())
);
return;
}
@@ -142,7 +146,11 @@ void PreferencesDialog::reset_default_shortcut() {
}
void PreferencesDialog::reset_all_shortcuts() {
if (QMessageBox::question(this, "Confirm Reset All Shortcuts", "Are you sure you wish to reset all keyboard shortcuts to their defaults?", QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
if (QMessageBox::question(
this,
tr("Confirm Reset All Shortcuts"),
tr("Are you sure you wish to reset all keyboard shortcuts to their defaults?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
for (int i=0;i<key_shortcut_fields.size();i++) {
key_shortcut_fields.at(i)->reset_to_default();
}
@@ -191,7 +199,7 @@ bool PreferencesDialog::refine_shortcut_list(const QString &s, QTreeWidgetItem*
}
void PreferencesDialog::load_shortcut_file() {
QString fn = QFileDialog::getOpenFileName(this, "Import Keyboard Shortcuts");
QString fn = QFileDialog::getOpenFileName(this, tr("Import Keyboard Shortcuts"));
if (!fn.isEmpty()) {
QFile f(fn);
if (f.exists() && f.open(QFile::ReadOnly)) {
@@ -206,21 +214,24 @@ void PreferencesDialog::load_shortcut_file() {
while (index < ba.size() && ba.at(index) != '\n') {
ks.append(ba.at(index));
index++;
}
dout << "set" << key_shortcut_fields.at(i)->action_name() << "to" << ks;
}
key_shortcut_fields.at(i)->setKeySequence(ks);
} else {
key_shortcut_fields.at(i)->reset_to_default();
}
}
} else {
QMessageBox::critical(this, "Error saving shortcuts", "Failed to open file for reading");
QMessageBox::critical(
this,
tr("Error saving shortcuts"),
tr("Failed to open file for reading")
);
}
}
}
void PreferencesDialog::save_shortcut_file() {
QString fn = QFileDialog::getSaveFileName(this, "Export Keyboard Shortcuts");
QString fn = QFileDialog::getSaveFileName(this, tr("Export Keyboard Shortcuts"));
if (!fn.isEmpty()) {
QFile f(fn);
if (f.open(QFile::WriteOnly)) {
@@ -233,16 +244,16 @@ void PreferencesDialog::save_shortcut_file() {
start = false;
}
}
QMessageBox::information(this, "Export Shortcuts", "Shortcuts exported successfully");
QMessageBox::information(this, tr("Export Shortcuts"), tr("Shortcuts exported successfully"));
f.close();
} else {
QMessageBox::critical(this, "Error saving shortcuts", "Failed to open file for writing");
QMessageBox::critical(this, tr("Error saving shortcuts"), tr("Failed to open file for writing"));
}
}
}
void PreferencesDialog::browse_css_file() {
QString fn = QFileDialog::getOpenFileName(this, "Browse for CSS file");
QString fn = QFileDialog::getOpenFileName(this, tr("Browse for CSS file"));
if (!fn.isEmpty()) {
custom_css_fn->setText(fn);
}
@@ -255,120 +266,120 @@ void PreferencesDialog::setup_ui() {
QTabWidget* general_tab = new QTabWidget();
QGridLayout* general_layout = new QGridLayout(general_tab);
general_layout->addWidget(new QLabel("Custom CSS:"), 0, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Custom CSS:")), 0, 0, 1, 1);
custom_css_fn = new QLineEdit(general_tab);
custom_css_fn->setText(config.css_path);
general_layout->addWidget(custom_css_fn, 0, 1, 1, 1);
QPushButton* custom_css_browse = new QPushButton("Browse", general_tab);
QPushButton* custom_css_browse = new QPushButton(tr("Browse"), general_tab);
connect(custom_css_browse, SIGNAL(clicked(bool)), this, SLOT(browse_css_file()));
general_layout->addWidget(custom_css_browse, 0, 2, 1, 1);
general_layout->addWidget(new QLabel("Image sequence formats:"), 1, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Image sequence formats:")), 1, 0, 1, 1);
imgSeqFormatEdit = new QLineEdit(general_tab);
general_layout->addWidget(imgSeqFormatEdit, 1, 1, 1, 2);
general_layout->addWidget(new QLabel("Audio Recording:"), 2, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Audio Recording:")), 2, 0, 1, 1);
recordingComboBox = new QComboBox(general_tab);
recordingComboBox->addItem("Mono");
recordingComboBox->addItem("Stereo");
recordingComboBox->addItem(tr("Mono"));
recordingComboBox->addItem(tr("Stereo"));
general_layout->addWidget(recordingComboBox, 2, 1, 1, 2);
tabWidget->addTab(general_tab, "General");
tabWidget->addTab(general_tab, tr("General"));
QWidget* behavior_tab = new QWidget();
tabWidget->addTab(behavior_tab, "Behavior");
tabWidget->addTab(behavior_tab, tr("Behavior"));
// Playback
QWidget* playback_tab = new QWidget();
QVBoxLayout* playback_tab_layout = new QVBoxLayout(playback_tab);
// Playback -> Disable Multithreading on Images
disable_img_multithread = new QCheckBox("Disable Multithreading on Images");
disable_img_multithread = new QCheckBox(tr("Disable Multithreading on Images"));
disable_img_multithread->setChecked(config.disable_multithreading_for_images);
playback_tab_layout->addWidget(disable_img_multithread);
// Playback -> Seeking
QGroupBox* seeking_group = new QGroupBox(playback_tab);
seeking_group->setTitle("Seeking");
seeking_group->setTitle(tr("Seeking"));
QVBoxLayout* seeking_group_layout = new QVBoxLayout(seeking_group);
accurateSeekButton = new QRadioButton(seeking_group);
accurateSeekButton->setText("Accurate Seeking\nAlways show the correct frame (visual may pause briefly as correct frame is retrieved)");
accurateSeekButton->setText(tr("Accurate Seeking\nAlways show the correct frame (visual may pause briefly as correct frame is retrieved)"));
seeking_group_layout->addWidget(accurateSeekButton);
fastSeekButton = new QRadioButton(seeking_group);
fastSeekButton->setText("Fast Seeking\nSeek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export)");
fastSeekButton->setText(tr("Fast Seeking\nSeek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export)"));
seeking_group_layout->addWidget(fastSeekButton);
playback_tab_layout->addWidget(seeking_group);
// Playback -> Memory Usage
QGroupBox* memory_usage_group = new QGroupBox(playback_tab);
memory_usage_group->setTitle("Memory Usage");
memory_usage_group->setTitle(tr("Memory Usage"));
QGridLayout* memory_usage_layout = new QGridLayout(memory_usage_group);
memory_usage_layout->addWidget(new QLabel("Upcoming Frame Queue:"), 0, 0);
memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:")), 0, 0);
upcoming_queue_spinbox = new QDoubleSpinBox();
upcoming_queue_spinbox->setValue(config.upcoming_queue_size);
memory_usage_layout->addWidget(upcoming_queue_spinbox, 0, 1);
upcoming_queue_type = new QComboBox();
upcoming_queue_type->addItem("frames");
upcoming_queue_type->addItem("seconds");
upcoming_queue_type->addItem(tr("frames"));
upcoming_queue_type->addItem(tr("seconds"));
upcoming_queue_type->setCurrentIndex(config.upcoming_queue_type);
memory_usage_layout->addWidget(upcoming_queue_type, 0, 2);
memory_usage_layout->addWidget(new QLabel("Previous Frame Queue:"), 1, 0);
memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:")), 1, 0);
previous_queue_spinbox = new QDoubleSpinBox();
previous_queue_spinbox->setValue(config.previous_queue_size);
memory_usage_layout->addWidget(previous_queue_spinbox, 1, 1);
previous_queue_type = new QComboBox();
previous_queue_type->addItem("frames");
previous_queue_type->addItem("seconds");
previous_queue_type->addItem(tr("frames"));
previous_queue_type->addItem(tr("seconds"));
previous_queue_type->setCurrentIndex(config.previous_queue_type);
memory_usage_layout->addWidget(previous_queue_type, 1, 2);
playback_tab_layout->addWidget(memory_usage_group);
tabWidget->addTab(playback_tab, "Playback");
tabWidget->addTab(playback_tab, tr("Playback"));
QWidget* shortcut_tab = new QWidget();
QVBoxLayout* shortcut_layout = new QVBoxLayout(shortcut_tab);
QLineEdit* key_search_line = new QLineEdit();
key_search_line->setPlaceholderText("Search for action or shortcut");
key_search_line->setPlaceholderText(tr("Search for action or shortcut"));
connect(key_search_line, SIGNAL(textChanged(const QString &)), this, SLOT(refine_shortcut_list(const QString &)));
shortcut_layout->addWidget(key_search_line);
keyboard_tree = new QTreeWidget();
QTreeWidgetItem* tree_header = keyboard_tree->headerItem();
tree_header->setText(0, "Action");
tree_header->setText(1, "Shortcut");
tree_header->setText(0, tr("Action"));
tree_header->setText(1, tr("Shortcut"));
shortcut_layout->addWidget(keyboard_tree);
QHBoxLayout* reset_shortcut_layout = new QHBoxLayout();
QPushButton* import_shortcut_button = new QPushButton("Import");
QPushButton* import_shortcut_button = new QPushButton(tr("Import"));
reset_shortcut_layout->addWidget(import_shortcut_button);
connect(import_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(load_shortcut_file()));
QPushButton* export_shortcut_button = new QPushButton("Export");
QPushButton* export_shortcut_button = new QPushButton(tr("Export"));
reset_shortcut_layout->addWidget(export_shortcut_button);
connect(export_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(save_shortcut_file()));
reset_shortcut_layout->addStretch();
QPushButton* reset_selected_shortcut_button = new QPushButton("Reset Selected");
QPushButton* reset_selected_shortcut_button = new QPushButton(tr("Reset Selected"));
reset_shortcut_layout->addWidget(reset_selected_shortcut_button);
connect(reset_selected_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_default_shortcut()));
QPushButton* reset_all_shortcut_button = new QPushButton("Reset All");
QPushButton* reset_all_shortcut_button = new QPushButton(tr("Reset All"));
reset_shortcut_layout->addWidget(reset_all_shortcut_button);
connect(reset_all_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_all_shortcuts()));
shortcut_layout->addLayout(reset_shortcut_layout);
tabWidget->addTab(shortcut_tab, "Keyboard");
tabWidget->addTab(shortcut_tab, tr("Keyboard"));
verticalLayout->addWidget(tabWidget);
+29 -9
View File
@@ -23,19 +23,19 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
QDialog(parent),
media(old_media)
{
setWindowTitle("Replace clips using \"" + old_media->get_name() + "\"");
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
resize(300, 400);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(new QLabel("Select which media you want to replace this media's clips with:"));
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:")));
tree = new QTreeView();
layout->addWidget(tree);
use_same_media_in_points = new QCheckBox("Keep the same media in-points");
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"));
use_same_media_in_points->setChecked(true);
layout->addWidget(use_same_media_in_points);
@@ -43,11 +43,11 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
buttons->addStretch();
QPushButton* replace_button = new QPushButton("Replace");
QPushButton* replace_button = new QPushButton(tr("Replace"));
connect(replace_button, SIGNAL(clicked(bool)), this, SLOT(replace()));
buttons->addWidget(replace_button);
QPushButton* cancel_button = new QPushButton("Cancel");
QPushButton* cancel_button = new QPushButton(tr("Cancel"));
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(close()));
buttons->addWidget(cancel_button);
@@ -63,16 +63,36 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
void ReplaceClipMediaDialog::replace() {
QModelIndexList selected_items = tree->selectionModel()->selectedRows();
if (selected_items.size() != 1) {
QMessageBox::critical(this, "No media selected", "Please select a media to replace with or click 'Cancel'.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("No media selected"),
tr("Please select a media to replace with or click 'Cancel'."),
QMessageBox::Ok
);
} else {
Media* new_item = static_cast<Media*>(selected_items.at(0).internalPointer());
if (media == new_item) {
QMessageBox::critical(this, "Same media selected", "You selected the same media that you're replacing. Please select a different one or click 'Cancel'.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Same media selected"),
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
QMessageBox::Ok
);
} else if (new_item->get_type() == MEDIA_TYPE_FOLDER) {
QMessageBox::critical(this, "Folder selected", "You cannot replace footage with a folder.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Folder selected"),
tr("You cannot replace footage with a folder."),
QMessageBox::Ok
);
} else {
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && sequence == new_item->to_sequence()) {
QMessageBox::critical(this, "Active sequence selected", "You cannot insert a sequence into itself.", QMessageBox::Ok);
QMessageBox::critical(
this,
tr("Active sequence selected"),
tr("You cannot insert a sequence into itself."),
QMessageBox::Ok
);
} else {
ReplaceClipMediaCommand* rcmc = new ReplaceClipMediaCommand(
media,
+8 -6
View File
@@ -19,25 +19,27 @@
#include "project/media.h"
SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(tr("Speed/Duration"));
QVBoxLayout* main_layout = new QVBoxLayout();
setLayout(main_layout);
QGridLayout* grid = new QGridLayout();
grid->setSpacing(6);
grid->addWidget(new QLabel("Speed:"), 0, 0);
grid->addWidget(new QLabel(tr("Speed:")), 0, 0);
percent = new LabelSlider();
percent->decimal_places = 2;
percent->set_display_type(LABELSLIDER_PERCENT);
percent->set_default_value(1);
grid->addWidget(percent, 0, 1);
grid->addWidget(new QLabel("Frame Rate:"), 1, 0);
grid->addWidget(new QLabel(tr("Frame Rate:")), 1, 0);
frame_rate = new LabelSlider();
frame_rate->decimal_places = 3;
grid->addWidget(frame_rate, 1, 1);
grid->addWidget(new QLabel("Duration:"), 2, 0);
grid->addWidget(new QLabel(tr("Duration:")), 2, 0);
duration = new LabelSlider();
duration->set_display_type(LABELSLIDER_FRAMENUMBER);
duration->set_frame_rate(sequence->frame_rate);
@@ -45,9 +47,9 @@ SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) {
main_layout->addLayout(grid);
reverse = new QCheckBox("Reverse");
maintain_pitch = new QCheckBox("Maintain Audio Pitch");
ripple = new QCheckBox("Ripple Changes");
reverse = new QCheckBox(tr("Reverse"));
maintain_pitch = new QCheckBox(tr("Maintain Audio Pitch"));
ripple = new QCheckBox(tr("Ripple Changes"));
main_layout->addWidget(reverse);
main_layout->addWidget(maintain_pitch);
+1 -1
View File
@@ -7,7 +7,7 @@
TextEditDialog::TextEditDialog(QWidget *parent, const QString &s) :
QDialog(parent)
{
setWindowTitle("Edit Text");
setWindowTitle(tr("Edit Text"));
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
+2 -2
View File
@@ -4,12 +4,12 @@
#include <QtMath>
AudioNoiseEffect::AudioNoiseEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
amount_val = add_row("Amount")->add_field(EFFECT_FIELD_DOUBLE, "amount");
amount_val = add_row(tr("Amount"))->add_field(EFFECT_FIELD_DOUBLE, "amount");
amount_val->set_double_minimum_value(0);
amount_val->set_double_maximum_value(100);
amount_val->set_double_default_value(20);
mix_val = add_row("Mix")->add_field(EFFECT_FIELD_BOOL, "mix");
mix_val = add_row(tr("Mix"))->add_field(EFFECT_FIELD_BOOL, "mix");
mix_val->set_bool_value(true);
srand(QDateTime::currentMSecsSinceEpoch());
+5 -5
View File
@@ -8,23 +8,23 @@ CornerPinEffect::CornerPinEffect(Clip *c, const EffectMeta *em) : Effect(c, em)
enable_coords = true;
enable_shader = true;
EffectRow* top_left = add_row("Top Left");
EffectRow* top_left = add_row(tr("Top Left"));
top_left_x = top_left->add_field(EFFECT_FIELD_DOUBLE, "topleftx");
top_left_y = top_left->add_field(EFFECT_FIELD_DOUBLE, "toplefty");
EffectRow* top_right = add_row("Top Right");
EffectRow* top_right = add_row(tr("Top Right"));
top_right_x = top_right->add_field(EFFECT_FIELD_DOUBLE, "toprightx");
top_right_y = top_right->add_field(EFFECT_FIELD_DOUBLE, "toprighty");
EffectRow* bottom_left = add_row("Bottom Left");
EffectRow* bottom_left = add_row(tr("Bottom Left"));
bottom_left_x = bottom_left->add_field(EFFECT_FIELD_DOUBLE, "bottomleftx");
bottom_left_y = bottom_left->add_field(EFFECT_FIELD_DOUBLE, "bottomlefty");
EffectRow* bottom_right = add_row("Bottom Right");
EffectRow* bottom_right = add_row(tr("Bottom Right"));
bottom_right_x = bottom_right->add_field(EFFECT_FIELD_DOUBLE, "bottomrightx");
bottom_right_y = bottom_right->add_field(EFFECT_FIELD_DOUBLE, "bottomrighty");
perspective = add_row("Perspective")->add_field(EFFECT_FIELD_BOOL, "perspective");
perspective = add_row(tr("Perspective"))->add_field(EFFECT_FIELD_BOOL, "perspective");
perspective->set_bool_value(true);
top_left_gizmo = add_gizmo(GIZMO_TYPE_DOT);
+3 -3
View File
@@ -4,10 +4,10 @@
#define FILL_TYPE_RIGHT 1
FillLeftRightEffect::FillLeftRightEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
EffectRow* type_row = add_row("Type");
EffectRow* type_row = add_row(tr("Type"));
fill_type = type_row->add_field(EFFECT_FIELD_COMBO, "type");
fill_type->add_combo_item("Fill Left with Right", FILL_TYPE_LEFT);
fill_type->add_combo_item("Fill Right with Left", FILL_TYPE_RIGHT);
fill_type->add_combo_item(tr("Fill Left with Right"), FILL_TYPE_LEFT);
fill_type->add_combo_item(tr("Fill Right with Left"), FILL_TYPE_RIGHT);
}
void FillLeftRightEffect::process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int) {
+1 -1
View File
@@ -9,7 +9,7 @@
#include "ui/collapsiblewidget.h"
PanEffect::PanEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
EffectRow* pan_row = add_row("Pan");
EffectRow* pan_row = add_row(tr("Pan"));
pan_val = pan_row->add_field(EFFECT_FIELD_DOUBLE, "pan");
pan_val->set_double_minimum_value(-100);
pan_val->set_double_maximum_value(100);
+3 -3
View File
@@ -16,15 +16,15 @@
ShakeEffect::ShakeEffect(Clip *c, const EffectMeta *em) : Effect(c, em) {
enable_coords = true;
EffectRow* intensity_row = add_row("Intensity");
EffectRow* intensity_row = add_row(tr("Intensity"));
intensity_val = intensity_row->add_field(EFFECT_FIELD_DOUBLE, "intensity");
intensity_val->set_double_minimum_value(0);
EffectRow* rotation_row = add_row("Rotation");
EffectRow* rotation_row = add_row(tr("Rotation"));
rotation_val = rotation_row->add_field(EFFECT_FIELD_DOUBLE, "rotation");
rotation_val->set_double_minimum_value(0);
EffectRow* frequency_row = add_row("Frequency");
EffectRow* frequency_row = add_row(tr("Frequency"));
frequency_val = frequency_row->add_field(EFFECT_FIELD_DOUBLE, "frequency");
frequency_val->set_double_minimum_value(0);
+7 -7
View File
@@ -21,20 +21,20 @@
SolidEffect::SolidEffect(Clip* c, const EffectMeta* em) : Effect(c, em) {
enable_superimpose = true;
solid_type = add_row("Type")->add_field(EFFECT_FIELD_COMBO, "type");
solid_type->add_combo_item("Solid Color", SOLID_TYPE_COLOR);
solid_type->add_combo_item("SMPTE Bars", SOLID_TYPE_BARS);
solid_type->add_combo_item("Checkerboard", SOLID_TYPE_CHECKERBOARD);
solid_type = add_row(tr("Type"))->add_field(EFFECT_FIELD_COMBO, "type");
solid_type->add_combo_item(tr("Solid Color"), SOLID_TYPE_COLOR);
solid_type->add_combo_item(tr("SMPTE Bars"), SOLID_TYPE_BARS);
solid_type->add_combo_item(tr("Checkerboard"), SOLID_TYPE_CHECKERBOARD);
opacity_field = add_row("Opacity")->add_field(EFFECT_FIELD_DOUBLE, "opacity");
opacity_field = add_row(tr("Opacity"))->add_field(EFFECT_FIELD_DOUBLE, "opacity");
opacity_field->set_double_minimum_value(0);
opacity_field->set_double_maximum_value(100);
opacity_field->set_double_default_value(100);
solid_color_field = add_row("Color")->add_field(EFFECT_FIELD_COLOR, "color");
solid_color_field = add_row(tr("Color"))->add_field(EFFECT_FIELD_COLOR, "color");
solid_color_field->set_color_value(Qt::red);
checkerboard_size_field = add_row("Checkerboard Size")->add_field(EFFECT_FIELD_DOUBLE, "checker_size");
checkerboard_size_field = add_row(tr("Checkerboard Size"))->add_field(EFFECT_FIELD_DOUBLE, "checker_size");
checkerboard_size_field->set_double_minimum_value(1);
checkerboard_size_field->set_double_default_value(10);
+23 -23
View File
@@ -29,49 +29,49 @@ TextEffect::TextEffect(Clip *c, const EffectMeta* em) :
enable_superimpose = true;
//enable_shader = true;
text_val = add_row("Text")->add_field(EFFECT_FIELD_STRING, "text", 2);
text_val = add_row(tr("Text"))->add_field(EFFECT_FIELD_STRING, "text", 2);
QTextEdit* text_widget = static_cast<QTextEdit*>(text_val->ui_element);
text_widget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(text_widget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(text_edit_menu()));
set_font_combobox = add_row("Font")->add_field(EFFECT_FIELD_FONT, "font", 2);
set_font_combobox = add_row(tr("Font"))->add_field(EFFECT_FIELD_FONT, "font", 2);
size_val = add_row("Size")->add_field(EFFECT_FIELD_DOUBLE, "size", 2);
size_val = add_row(tr("Size"))->add_field(EFFECT_FIELD_DOUBLE, "size", 2);
size_val->set_double_minimum_value(0);
set_color_button = add_row("Color")->add_field(EFFECT_FIELD_COLOR, "color", 2);
set_color_button = add_row(tr("Color"))->add_field(EFFECT_FIELD_COLOR, "color", 2);
EffectRow* alignment_row = add_row("Alignment");
EffectRow* alignment_row = add_row(tr("Alignment"));
halign_field = alignment_row->add_field(EFFECT_FIELD_COMBO, "halign");
halign_field->add_combo_item("Left", Qt::AlignLeft);
halign_field->add_combo_item("Center", Qt::AlignHCenter);
halign_field->add_combo_item("Right", Qt::AlignRight);
halign_field->add_combo_item("Justify", Qt::AlignJustify);
halign_field->add_combo_item(tr("Left"), Qt::AlignLeft);
halign_field->add_combo_item(tr("Center"), Qt::AlignHCenter);
halign_field->add_combo_item(tr("Right"), Qt::AlignRight);
halign_field->add_combo_item(tr("Justify"), Qt::AlignJustify);
valign_field = alignment_row->add_field(EFFECT_FIELD_COMBO, "valign");
valign_field->add_combo_item("Top", Qt::AlignTop);
valign_field->add_combo_item("Center", Qt::AlignVCenter);
valign_field->add_combo_item("Bottom", Qt::AlignBottom);
valign_field->add_combo_item(tr("Top"), Qt::AlignTop);
valign_field->add_combo_item(tr("Center"), Qt::AlignVCenter);
valign_field->add_combo_item(tr("Bottom"), Qt::AlignBottom);
word_wrap_field = add_row("Word Wrap")->add_field(EFFECT_FIELD_BOOL, "wordwrap", 2);
word_wrap_field = add_row(tr("Word Wrap"))->add_field(EFFECT_FIELD_BOOL, "wordwrap", 2);
outline_bool = add_row("Outline")->add_field(EFFECT_FIELD_BOOL, "outline", 2);
outline_color = add_row("Outline Color")->add_field(EFFECT_FIELD_COLOR, "outlinecolor", 2);
outline_width = add_row("Outline Width")->add_field(EFFECT_FIELD_DOUBLE, "outlinewidth", 2);
outline_bool = add_row(tr("Outline"))->add_field(EFFECT_FIELD_BOOL, "outline", 2);
outline_color = add_row(tr("Outline Color"))->add_field(EFFECT_FIELD_COLOR, "outlinecolor", 2);
outline_width = add_row(tr("Outline Width"))->add_field(EFFECT_FIELD_DOUBLE, "outlinewidth", 2);
outline_width->set_double_minimum_value(0);
shadow_bool = add_row("Shadow")->add_field(EFFECT_FIELD_BOOL, "shadow", 2);
shadow_color = add_row("Shadow Color")->add_field(EFFECT_FIELD_COLOR, "shadowcolor", 2);
shadow_distance = add_row("Shadow Distance")->add_field(EFFECT_FIELD_DOUBLE, "shadowdistance", 2);
shadow_bool = add_row(tr("Shadow"))->add_field(EFFECT_FIELD_BOOL, "shadow", 2);
shadow_color = add_row(tr("Shadow Color"))->add_field(EFFECT_FIELD_COLOR, "shadowcolor", 2);
shadow_distance = add_row(tr("Shadow Distance"))->add_field(EFFECT_FIELD_DOUBLE, "shadowdistance", 2);
shadow_distance->set_double_minimum_value(0);
shadow_softness = add_row("Shadow Softness")->add_field(EFFECT_FIELD_DOUBLE, "shadowsoftness", 2);
shadow_softness = add_row(tr("Shadow Softness"))->add_field(EFFECT_FIELD_DOUBLE, "shadowsoftness", 2);
shadow_softness->set_double_minimum_value(0);
shadow_opacity = add_row("Shadow Opacity")->add_field(EFFECT_FIELD_DOUBLE, "shadowopacity", 2);
shadow_opacity = add_row(tr("Shadow Opacity"))->add_field(EFFECT_FIELD_DOUBLE, "shadowopacity", 2);
shadow_opacity->set_double_minimum_value(0);
shadow_opacity->set_double_maximum_value(100);
size_val->set_double_default_value(48);
text_val->set_string_value("Sample Text");
text_val->set_string_value(tr("Sample Text"));
halign_field->set_combo_index(1);
valign_field->set_combo_index(1);
word_wrap_field->set_bool_value(true);
@@ -217,7 +217,7 @@ void TextEffect::shadow_enable(bool e) {
void TextEffect::text_edit_menu() {
QMenu menu;
menu.addAction("&Edit Text", this, SLOT(open_text_edit()));
menu.addAction(tr("&Edit Text"), this, SLOT(open_text_edit()));
menu.exec(QCursor::pos());
}
+9 -9
View File
@@ -29,33 +29,33 @@ TimecodeEffect::TimecodeEffect(Clip *c, const EffectMeta* em) :
enable_always_update = true;
enable_superimpose = true;
EffectRow* tc_row = add_row("Timecode");
EffectRow* tc_row = add_row(tr("Timecode"));
tc_select = tc_row->add_field(EFFECT_FIELD_COMBO, "tc_selector");
tc_select->add_combo_item("Sequence", true);
tc_select->add_combo_item("Media", false);
tc_select->add_combo_item(tr("Sequence"), true);
tc_select->add_combo_item(tr("Media"), false);
tc_select->set_combo_index(0);
scale_val = add_row("Scale")->add_field(EFFECT_FIELD_DOUBLE, "scale", 2);
scale_val = add_row(tr("Scale"))->add_field(EFFECT_FIELD_DOUBLE, "scale", 2);
scale_val->set_double_minimum_value(1);
scale_val->set_double_default_value(100);
scale_val->set_double_maximum_value(1000);
color_val = add_row("Color")->add_field(EFFECT_FIELD_COLOR, "color", 2);
color_val = add_row(tr("Color"))->add_field(EFFECT_FIELD_COLOR, "color", 2);
color_val->set_color_value(Qt::white);
color_bg_val = add_row("Background Color")->add_field(EFFECT_FIELD_COLOR, "bgcolor", 2);
color_bg_val = add_row(tr("Background Color"))->add_field(EFFECT_FIELD_COLOR, "bgcolor", 2);
color_bg_val->set_color_value(Qt::black);
bg_alpha = add_row("Background Opacity")->add_field(EFFECT_FIELD_DOUBLE, "bgalpha", 2);
bg_alpha = add_row(tr("Background Opacity"))->add_field(EFFECT_FIELD_DOUBLE, "bgalpha", 2);
bg_alpha->set_double_minimum_value(0);
bg_alpha->set_double_maximum_value(100);
bg_alpha->set_double_default_value(50);
EffectRow* offset = add_row("Offset");
EffectRow* offset = add_row(tr("Offset"));
offset_x_val = offset->add_field(EFFECT_FIELD_DOUBLE, "offsetx");
offset_y_val = offset->add_field(EFFECT_FIELD_DOUBLE, "offsety");
prepend_text = add_row("Prepend")->add_field(EFFECT_FIELD_STRING, "prepend", 2);
prepend_text = add_row(tr("Prepend"))->add_field(EFFECT_FIELD_STRING, "prepend", 2);
}
+4 -4
View File
@@ -9,20 +9,20 @@
#include "debug.h"
ToneEffect::ToneEffect(Clip* c, const EffectMeta *em) : Effect(c, em), sinX(INT_MIN) {
type_val = add_row("Type")->add_field(EFFECT_FIELD_COMBO, "type");
type_val = add_row(tr("Type"))->add_field(EFFECT_FIELD_COMBO, "type");
type_val->add_combo_item("Sine", TONE_TYPE_SINE);
freq_val = add_row("Frequency")->add_field(EFFECT_FIELD_DOUBLE, "frequency");
freq_val = add_row(tr("Frequency"))->add_field(EFFECT_FIELD_DOUBLE, "frequency");
freq_val->set_double_minimum_value(20);
freq_val->set_double_maximum_value(20000);
freq_val->set_double_default_value(1000);
amount_val = add_row("Amount")->add_field(EFFECT_FIELD_DOUBLE, "amount");
amount_val = add_row(tr("Amount"))->add_field(EFFECT_FIELD_DOUBLE, "amount");
amount_val->set_double_minimum_value(0);
amount_val->set_double_maximum_value(100);
amount_val->set_double_default_value(25);
mix_val = add_row("Mix")->add_field(EFFECT_FIELD_BOOL, "mix");
mix_val = add_row(tr("Mix"))->add_field(EFFECT_FIELD_BOOL, "mix");
mix_val->set_bool_value(true);
}
+11 -11
View File
@@ -31,11 +31,11 @@
TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em) {
enable_coords = true;
EffectRow* position_row = add_row("Position");
EffectRow* position_row = add_row(tr("Position"));
position_x = position_row->add_field(EFFECT_FIELD_DOUBLE, "posx"); // position X
position_y = position_row->add_field(EFFECT_FIELD_DOUBLE, "posy"); // position Y
EffectRow* scale_row = add_row("Scale");
EffectRow* scale_row = add_row(tr("Scale"));
scale_x = scale_row->add_field(EFFECT_FIELD_DOUBLE, "scalex"); // scale X (and Y is uniform scale is selected)
scale_x->set_double_minimum_value(0);
scale_x->set_double_maximum_value(3000);
@@ -43,27 +43,27 @@ TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em)
scale_y->set_double_minimum_value(0);
scale_y->set_double_maximum_value(3000);
EffectRow* uniform_scale_row = add_row("Uniform Scale");
EffectRow* uniform_scale_row = add_row(tr("Uniform Scale"));
uniform_scale_field = uniform_scale_row->add_field(EFFECT_FIELD_BOOL, "uniformscale"); // uniform scale option
EffectRow* rotation_row = add_row("Rotation");
EffectRow* rotation_row = add_row(tr("Rotation"));
rotation = rotation_row->add_field(EFFECT_FIELD_DOUBLE, "rotation");
EffectRow* anchor_point_row = add_row("Anchor Point");
EffectRow* anchor_point_row = add_row(tr("Anchor Point"));
anchor_x_box = anchor_point_row->add_field(EFFECT_FIELD_DOUBLE, "anchorx"); // anchor point X
anchor_y_box = anchor_point_row->add_field(EFFECT_FIELD_DOUBLE, "anchory"); // anchor point Y
EffectRow* opacity_row = add_row("Opacity");
EffectRow* opacity_row = add_row(tr("Opacity"));
opacity = opacity_row->add_field(EFFECT_FIELD_DOUBLE, "opacity"); // opacity
opacity->set_double_minimum_value(0);
opacity->set_double_maximum_value(100);
EffectRow* blend_mode_row = add_row("Blend Mode");
EffectRow* blend_mode_row = add_row(tr("Blend Mode"));
blend_mode_box = blend_mode_row->add_field(EFFECT_FIELD_COMBO, "blendmode"); // blend mode
blend_mode_box->add_combo_item("Normal", BLEND_MODE_NORMAL);
blend_mode_box->add_combo_item("Overlay", BLEND_MODE_OVERLAY);
blend_mode_box->add_combo_item("Screen", BLEND_MODE_SCREEN);
blend_mode_box->add_combo_item("Multiply", BLEND_MODE_MULTIPLY);
blend_mode_box->add_combo_item(tr("Normal"), BLEND_MODE_NORMAL);
blend_mode_box->add_combo_item(tr("Overlay"), BLEND_MODE_OVERLAY);
blend_mode_box->add_combo_item(tr("Screen"), BLEND_MODE_SCREEN);
blend_mode_box->add_combo_item(tr("Multiply"), BLEND_MODE_MULTIPLY);
// set up gizmos
top_left_gizmo = add_gizmo(GIZMO_TYPE_DOT);
+2 -2
View File
@@ -11,11 +11,11 @@ VoidEffect::VoidEffect(Clip *c, const QString& n) : Effect(c, nullptr) {
name = n;
QString display_name;
if (n.isEmpty()) {
display_name = "(unknown)";
display_name = tr("(unknown)");
} else {
display_name = n;
}
EffectRow* row = add_row("Missing Effect", false, false);
EffectRow* row = add_row(tr("Missing Effect"), false, false);
row->add_widget(new QLabel(display_name));
container->setText(display_name);
}
+1 -1
View File
@@ -9,7 +9,7 @@
#include "ui/collapsiblewidget.h"
VolumeEffect::VolumeEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
EffectRow* volume_row = add_row("Volume");
EffectRow* volume_row = add_row(tr("Volume"));
volume_val = volume_row->add_field(EFFECT_FIELD_DOUBLE, "volume");
volume_val->set_double_minimum_value(0);
+9 -9
View File
@@ -60,15 +60,15 @@ void VSTHostWin::loadPlugin() {
if(modulePtr == nullptr) {
DWORD dll_err = GetLastError();
qCritical() << "Failed to load VST" << dll_fn_w << "-" << dll_err;
QString msg_err = "Failed to load VST plugin \"" + dll_fn + "\": " + QString::number(dll_err);
QString msg_err = tr("Failed to load VST plugin \"%1\": %2").arg(dll_fn, QString::number(dll_err));
if (dll_err == 193) {
#ifdef _WIN64
msg_err += "\n\nNOTE: You can't load 32-bit VST plugins into a 64-bit build of Olive. Please find a 64-bit version of this plugin or switch to a 32-bit build of Olive.";
msg_err += "\n\n" + tr("NOTE: You can't load 32-bit VST plugins into a 64-bit build of Olive. Please find a 64-bit version of this plugin or switch to a 32-bit build of Olive.");
#elif _WIN32
msg_err += "\n\nNOTE: You can't load 64-bit VST plugins into a 32-bit build of Olive. Please find a 32-bit version of this plugin or switch to a 64-bit build of Olive.";
msg_err += "\n\n" + tr("NOTE: You can't load 64-bit VST plugins into a 32-bit build of Olive. Please find a 32-bit version of this plugin or switch to a 64-bit build of Olive.");
#endif
}
QMessageBox::critical(mainWindow, "Error loading VST plugin", msg_err);
QMessageBox::critical(mainWindow, tr("Error loading VST plugin"), msg_err);
return;
}
@@ -92,7 +92,7 @@ bool VSTHostWin::configurePluginCallbacks() {
// real VST plugin, or is otherwise corrupt.
if(plugin->magic != kEffectMagic) {
qCritical() << "Plugin's magic number is bad";
QMessageBox::critical(mainWindow, "VST Error", "Plugin's magic number is invalid");
QMessageBox::critical(mainWindow, tr("VST Error"), tr("Plugin's magic number is invalid"));
return false;
}
@@ -161,18 +161,18 @@ VSTHostWin::VSTHostWin(Clip* c, const EffectMeta *em) : Effect(c, em) {
initializeIO();
file_field = add_row("Plugin", true, false)->add_field(EFFECT_FIELD_FILE, "filename", true);
file_field = add_row(tr("Plugin"), true, false)->add_field(EFFECT_FIELD_FILE, "filename");
connect(file_field, SIGNAL(changed()), this, SLOT(change_plugin()));
EffectRow* interface_row = add_row("Interface", false, false);
show_interface_btn = new QPushButton("Show");
EffectRow* interface_row = add_row(tr("Interface"), false, false);
show_interface_btn = new QPushButton(tr("Show"));
show_interface_btn->setCheckable(true);
show_interface_btn->setEnabled(false);
connect(show_interface_btn, SIGNAL(toggled(bool)), this, SLOT(show_interface(bool)));
interface_row->add_widget(show_interface_btn);
dialog = new QDialog(mainWindow);
dialog->setWindowTitle("VST Plugin");
dialog->setWindowTitle(tr("VST Plugin"));
dialog->setAttribute(Qt::WA_NativeWindow, true);
dialog->setWindowFlags(dialog->windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
connect(dialog, SIGNAL(finished(int)), this, SLOT(uncheck_show_button()));
+18 -18
View File
@@ -49,7 +49,7 @@ bool ExportThread::encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx,
ret = avcodec_send_frame(codec_ctx, frame);
if (ret < 0) {
qCritical() << "Failed to send frame to encoder." << ret;
ed->export_error = "failed to send frame to encoder (" + QString::number(ret) + ")";
ed->export_error = tr("failed to send frame to encoder (%1)").arg(QString::number(ret));
return false;
}
@@ -60,7 +60,7 @@ bool ExportThread::encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx,
} else if (ret < 0) {
if (ret != AVERROR_EOF) {
qCritical() << "Failed to receive packet from encoder." << ret;
ed->export_error = "failed to receive packet from encoder (" + QString::number(ret) + ")";
ed->export_error = tr("failed to receive packet from encoder (%1)").arg(QString::number(ret));
}
return false;
}
@@ -81,7 +81,7 @@ bool ExportThread::setupVideo() {
vcodec = avcodec_find_encoder((enum AVCodecID) video_codec);
if (!vcodec) {
qCritical() << "Could not find video encoder";
ed->export_error = "could not video encoder for " + QString::number(video_codec);
ed->export_error = tr("could not video encoder for %1").arg(QString::number(video_codec));
return false;
}
@@ -90,7 +90,7 @@ bool ExportThread::setupVideo() {
video_stream->id = 0;
if (!video_stream) {
qCritical() << "Could not allocate video stream";
ed->export_error = "could not allocate video stream";
ed->export_error = tr("could not allocate video stream");
return false;
}
@@ -99,7 +99,7 @@ bool ExportThread::setupVideo() {
vcodec_ctx = avcodec_alloc_context3(vcodec);
if (!vcodec_ctx) {
qCritical() << "Could not allocate video encoding context";
ed->export_error = "could not allocate video encoding context";
ed->export_error = tr("could not allocate video encoding context");
return false;
}
@@ -136,7 +136,7 @@ bool ExportThread::setupVideo() {
ret = avcodec_open2(vcodec_ctx, vcodec, nullptr);
if (ret < 0) {
qCritical() << "Could not open output video encoder." << ret;
ed->export_error = "could not open output video encoder (" + QString::number(ret) + ")";
ed->export_error = tr("could not open output video encoder (%1)").arg(QString::number(ret));
return false;
}
@@ -144,7 +144,7 @@ bool ExportThread::setupVideo() {
ret = avcodec_parameters_from_context(video_stream->codecpar, vcodec_ctx);
if (ret < 0) {
qCritical() << "Could not copy video encoder parameters to output stream." << ret;
ed->export_error = "could not copy video encoder parameters to output stream (" + QString::number(ret) + ")";
ed->export_error = tr("could not copy video encoder parameters to output stream (%1)").arg(QString::number(ret));
return false;
}
@@ -188,7 +188,7 @@ bool ExportThread::setupAudio() {
acodec = avcodec_find_encoder(static_cast<AVCodecID>(audio_codec));
if (!acodec) {
qCritical() << "Could not find audio encoder";
ed->export_error = "could not audio encoder for " + QString::number(audio_codec);
ed->export_error = tr("could not audio encoder for %1").arg(QString::number(audio_codec));
return false;
}
@@ -197,7 +197,7 @@ bool ExportThread::setupAudio() {
audio_stream->id = 1;
if (!audio_stream) {
qCritical() << "Could not allocate audio stream";
ed->export_error = "could not allocate audio stream";
ed->export_error = tr("could not allocate audio stream");
return false;
}
@@ -206,7 +206,7 @@ bool ExportThread::setupAudio() {
acodec_ctx = avcodec_alloc_context3(acodec);
if (!acodec_ctx) {
qCritical() << "Could not find allocate audio encoding context";
ed->export_error = "could not allocate audio encoding context";
ed->export_error = tr("could not allocate audio encoding context");
return false;
}
@@ -231,7 +231,7 @@ bool ExportThread::setupAudio() {
ret = avcodec_open2(acodec_ctx, acodec, nullptr);
if (ret < 0) {
qCritical() << "Could not open output audio encoder." << ret;
ed->export_error = "could not open output audio encoder (" + QString::number(ret) + ")";
ed->export_error = tr("could not open output audio encoder (%1)").arg(QString::number(ret));
return false;
}
@@ -239,7 +239,7 @@ bool ExportThread::setupAudio() {
ret = avcodec_parameters_from_context(audio_stream->codecpar, acodec_ctx);
if (ret < 0) {
qCritical() << "Could not copy audio encoder parameters to output stream." << ret;
ed->export_error = "could not copy audio encoder parameters to output stream (" + QString::number(ret) + ")";
ed->export_error = tr("could not copy audio encoder parameters to output stream (%1)").arg(QString::number(ret));
return false;
}
@@ -269,7 +269,7 @@ bool ExportThread::setupAudio() {
ret = av_frame_get_buffer(audio_frame, 0);
if (ret < 0) {
qCritical() << "Could not allocate audio buffer." << ret;
ed->export_error = "could not allocate audio buffer (" + QString::number(ret) + ")";
ed->export_error = tr("could not allocate audio buffer (%1)").arg(QString::number(ret));
return false;
}
aframe_bytes = av_samples_get_buffer_size(nullptr, audio_frame->channels, audio_frame->nb_samples, static_cast<AVSampleFormat>(audio_frame->format), 0);
@@ -291,7 +291,7 @@ bool ExportThread::setupContainer() {
avformat_alloc_output_context2(&fmt_ctx, nullptr, nullptr, c_filename);
if (!fmt_ctx) {
qCritical() << "Could not create output context";
ed->export_error = "could not create output format context";
ed->export_error = tr("could not create output format context");
return false;
}
@@ -300,7 +300,7 @@ bool ExportThread::setupContainer() {
ret = avio_open(&fmt_ctx->pb, c_filename, AVIO_FLAG_WRITE);
if (ret < 0) {
qCritical() << "Could not open output file." << ret;
ed->export_error = "could not open output file (" + QString::number(ret) + ")";
ed->export_error = tr("could not open output file (%1)").arg(QString::number(ret));
return false;
}
@@ -312,7 +312,7 @@ void ExportThread::run() {
if (!panel_sequence_viewer->viewer_widget->context()->makeCurrent(&surface)) {
qCritical() << "Make current failed";
ed->export_error = "could not make OpenGL context current";
ed->export_error = tr("could not make OpenGL context current");
return;
}
@@ -331,7 +331,7 @@ void ExportThread::run() {
ret = avformat_write_header(fmt_ctx, nullptr);
if (ret < 0) {
qCritical() << "Could not write output file header." << ret;
ed->export_error = "could not write output file header (" + QString::number(ret) + ")";
ed->export_error = tr("could not write output file header (%1)").arg(QString::number(ret));
continueEncode = false;
}
}
@@ -440,7 +440,7 @@ void ExportThread::run() {
ret = av_write_trailer(fmt_ctx);
if (ret < 0) {
qCritical() << "Could not write output file trailer." << ret;
ed->export_error = "could not write output file trailer (" + QString::number(ret) + ")";
ed->export_error = tr("could not write output file trailer (%1)").arg(QString::number(ret));
continueEncode = false;
}
+20 -5
View File
@@ -153,7 +153,12 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
if (type == LOAD_TYPE_VERSION) {
int proj_version = stream.readElementText().toInt();
if (proj_version < MIN_SAVE_VERSION && proj_version > SAVE_VERSION) {
if (QMessageBox::warning(mainWindow, "Version Mismatch", "This project was saved in a different version of Olive and may not be fully compatible with this version. Would you like to attempt loading it anyway?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) {
if (QMessageBox::warning(
mainWindow,
tr("Version Mismatch"),
tr("This project was saved in a different version of Olive and may not be fully compatible with this version. Would you like to attempt loading it anyway?"),
QMessageBox::Yes,
QMessageBox::No) == QMessageBox::No) {
show_err = false;
return false;
}
@@ -439,7 +444,11 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
if (!found) {
correct_clip->linked.removeAt(j);
j--;
if (QMessageBox::warning(mainWindow, "Invalid Clip Link", "This project contains an invalid clip link. It may be corrupt. Would you like to continue loading it?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) {
if (QMessageBox::warning(mainWindow,
tr("Invalid Clip Link"),
tr("This project contains an invalid clip link. It may be corrupt. Would you like to continue loading it?"),
QMessageBox::Yes,
QMessageBox::No) == QMessageBox::No) {
delete s;
return false;
}
@@ -592,7 +601,7 @@ void LoadThread::run() {
xml_error = false;
if (show_err) emit error();
} else if (stream.hasError()) {
error_str = stream.errorString() + " - Line: " + QString::number(stream.lineNumber()) + " Col:" + QString::number(stream.columnNumber());
error_str = tr("%1 - Line: %2 Col: %3").arg(stream.errorString(), QString::number(stream.lineNumber()), QString::number(stream.columnNumber()));
xml_error = true;
emit error();
cont = false;
@@ -632,9 +641,15 @@ void LoadThread::cancel() {
void LoadThread::error_func() {
if (xml_error) {
qCritical() << "Error parsing XML." << error_str;
QMessageBox::critical(mainWindow, "XML Parsing Error", "Couldn't load '" + project_url + "'. " + error_str, QMessageBox::Ok);
QMessageBox::critical(mainWindow,
tr("XML Parsing Error"),
tr("Couldn't load '%1'. %2").arg(project_url, error_str),
QMessageBox::Ok);
} else {
QMessageBox::critical(mainWindow, "Project Load Error", "Error loading project: " + error_str, QMessageBox::Ok);
QMessageBox::critical(mainWindow,
tr("Project Load Error"),
tr("Error loading project: %1").arg(error_str),
QMessageBox::Ok);
}
}
+2 -2
View File
@@ -435,14 +435,14 @@ void PreviewGenerator::run() {
if(errCode != 0) {
char err[1024];
av_strerror(errCode, err, 1024);
errorStr = "Could not open file - " + QString(err);
errorStr = tr("Could not open file - %1").arg(err);
error = true;
} else {
errCode = avformat_find_stream_info(fmt_ctx, nullptr);
if (errCode < 0) {
char err[1024];
av_strerror(errCode, err, 1024);
errorStr = "Could not find stream information - " + QString(err);
errorStr = tr("Could not find stream information - %1").arg(err);
error = true;
} else {
av_dump_format(fmt_ctx, 0, filename, 0);
+14 -14
View File
@@ -107,7 +107,7 @@ MainWindow::MainWindow(QWidget *parent, const QString &an) :
// set up style?
qApp->setStyle(QStyleFactory::create("Fusion"));
setStyleSheet(DEFAULT_CSS);
setStyleSheet(DEFAULT_CSS);
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
@@ -199,10 +199,10 @@ MainWindow::MainWindow(QWidget *parent, const QString &an) :
if (QFileInfo::exists(config_fn)) {
config.load(config_fn);
if (!config.css_path.isEmpty()) {
load_css_from_file(config.css_path);
}
}
if (!config.css_path.isEmpty()) {
load_css_from_file(config.css_path);
}
}
}
alloc_panels(this);
@@ -335,18 +335,18 @@ void MainWindow::save_shortcuts(const QString& fn) {
shortcut_file_io.close();
} else {
qCritical() << "Failed to save shortcut file";
}
}
}
void MainWindow::load_css_from_file(const QString &fn) {
QFile css_file(fn);
if (css_file.exists() && css_file.open(QFile::ReadOnly)) {
setStyleSheet(css_file.readAll());
css_file.close();
} else {
// set default stylesheet
setStyleSheet(DEFAULT_CSS);
}
QFile css_file(fn);
if (css_file.exists() && css_file.open(QFile::ReadOnly)) {
setStyleSheet(css_file.readAll());
css_file.close();
} else {
// set default stylesheet
setStyleSheet(DEFAULT_CSS);
}
}
void MainWindow::show_about() {
+2
View File
@@ -27,6 +27,8 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
QMAKE_CXXFLAGS += -std=c++11 -Wextra -Wshadow -Wnon-virtual-dtor -pedantic
# Tries to get the current Git short hash
system("which git") {
GITHASHVAR = $$system(git --git-dir $$PWD/.git --work-tree $$PWD log -1 --format=%h)
+8 -8
View File
@@ -34,7 +34,7 @@ EffectControls::EffectControls(QWidget *parent) :
QDockWidget(parent),
multiple(false),
zoom(1),
panel_name("Effects: "),
panel_name(tr("Effects: ")),
mode(TA_NO_TRANSITION)
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
@@ -303,7 +303,7 @@ void EffectControls::setup_ui() {
QPushButton* btnAddVideoEffect = new QPushButton(veHeader);
btnAddVideoEffect->setIcon(QIcon(":/icons/add-effect.png"));
btnAddVideoEffect->setToolTip("Add Video Effect");
btnAddVideoEffect->setToolTip(tr("Add Video Effect"));
veHeaderLayout->addWidget(btnAddVideoEffect);
connect(btnAddVideoEffect, SIGNAL(clicked(bool)), this, SLOT(video_effect_click()));
@@ -314,14 +314,14 @@ void EffectControls::setup_ui() {
font.setPointSize(9);
lblVideoEffects->setFont(font);
lblVideoEffects->setAlignment(Qt::AlignCenter);
lblVideoEffects->setText("VIDEO EFFECTS");
lblVideoEffects->setText(tr("VIDEO EFFECTS"));
veHeaderLayout->addWidget(lblVideoEffects);
veHeaderLayout->addStretch();
QPushButton* btnAddVideoTransition = new QPushButton(veHeader);
btnAddVideoTransition->setIcon(QIcon(":/icons/add-transition.png"));
btnAddVideoTransition->setToolTip("Add Video Transition");
btnAddVideoTransition->setToolTip(tr("Add Video Transition"));
connect(btnAddVideoTransition, SIGNAL(clicked(bool)), this, SLOT(video_transition_click()));
veHeaderLayout->addWidget(btnAddVideoTransition);
@@ -351,7 +351,7 @@ void EffectControls::setup_ui() {
QPushButton* btnAddAudioEffect = new QPushButton(aeHeader);
btnAddAudioEffect->setIcon(QIcon(":/icons/add-effect.png"));
btnAddAudioEffect->setToolTip("Add Audio Effect");
btnAddAudioEffect->setToolTip(tr("Add Audio Effect"));
connect(btnAddAudioEffect, SIGNAL(clicked(bool)), this, SLOT(audio_effect_click()));
aeHeaderLayout->addWidget(btnAddAudioEffect);
@@ -360,14 +360,14 @@ void EffectControls::setup_ui() {
QLabel* lblAudioEffects = new QLabel(aeHeader);
lblAudioEffects->setFont(font);
lblAudioEffects->setAlignment(Qt::AlignCenter);
lblAudioEffects->setText("AUDIO EFFECTS");
lblAudioEffects->setText(tr("AUDIO EFFECTS"));
aeHeaderLayout->addWidget(lblAudioEffects);
aeHeaderLayout->addStretch();
QPushButton* btnAddAudioTransition = new QPushButton(aeHeader);
btnAddAudioTransition->setIcon(QIcon(":/icons/add-transition.png"));
btnAddAudioTransition->setToolTip("Add Audio Transition");
btnAddAudioTransition->setToolTip(tr("Add Audio Transition"));
connect(btnAddAudioTransition, SIGNAL(clicked(bool)), this, SLOT(audio_transition_click()));
aeHeaderLayout->addWidget(btnAddAudioTransition);
@@ -384,7 +384,7 @@ void EffectControls::setup_ui() {
lblMultipleClipsSelected = new QLabel(effects_area);
lblMultipleClipsSelected->setAlignment(Qt::AlignCenter);
lblMultipleClipsSelected->setText("(Multiple clips selected)");
lblMultipleClipsSelected->setText(tr("(Multiple clips selected)"));
effects_area_layout->addWidget(lblMultipleClipsSelected);
effects_area_layout->addStretch();
+4 -4
View File
@@ -20,7 +20,7 @@
GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setWindowTitle("Graph Editor");
setWindowTitle(tr("Graph Editor"));
resize(720, 480);
QWidget* main_widget = new QWidget();
@@ -58,13 +58,13 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
left_tool_layout->addWidget(keyframe_nav);
left_tool_layout->addStretch();
linear_button = new QPushButton("Linear");
linear_button = new QPushButton(tr("Linear"));
linear_button->setProperty("type", KEYFRAME_TYPE_LINEAR);
linear_button->setCheckable(true);
bezier_button = new QPushButton("Bezier");
bezier_button = new QPushButton(tr("Bezier"));
bezier_button->setProperty("type", KEYFRAME_TYPE_BEZIER);
bezier_button->setCheckable(true);
hold_button = new QPushButton("Hold");
hold_button = new QPushButton(tr("Hold"));
hold_button->setProperty("type", KEYFRAME_TYPE_HOLD);
hold_button->setCheckable(true);
+33 -12
View File
@@ -177,7 +177,7 @@ Project::Project(QWidget *parent) :
connect(icon_view, SIGNAL(changed_root()), this, SLOT(set_up_dir_enabled()));
//retranslateUi(Project);
setWindowTitle(QApplication::translate("Project", "Project", nullptr));
setWindowTitle(tr("Project"));
update_view_type();
}
@@ -187,7 +187,7 @@ Project::~Project() {
}
QString Project::get_next_sequence_name(QString start) {
if (start.isEmpty()) start = "Sequence";
if (start.isEmpty()) start = tr("Sequence");
int n = 1;
bool found = true;
@@ -305,7 +305,11 @@ void Project::replace_selected_file() {
void Project::replace_media(Media* item, QString filename) {
if (filename.isEmpty()) {
filename = QFileDialog::getOpenFileName(this, "Replace '" + item->get_name() + "'", "", "All Files (*)");
filename = QFileDialog::getOpenFileName(
this,
tr("Replace '%1'").arg(item->get_name()),
"",
tr("All Files") + " (*)");
}
if (!filename.isEmpty()) {
ReplaceMediaCommand* rmc = new ReplaceMediaCommand(item, filename);
@@ -315,13 +319,19 @@ void Project::replace_media(Media* item, QString filename) {
void Project::replace_clip_media() {
if (sequence == nullptr) {
QMessageBox::critical(this, "No active sequence", "No sequence is active, please open the sequence you want to replace clips from.", QMessageBox::Ok);
QMessageBox::critical(this,
tr("No active sequence"),
tr("No sequence is active, please open the sequence you want to replace clips from."),
QMessageBox::Ok);
} else {
QModelIndexList selected_items = get_current_selected();
if (selected_items.size() == 1) {
Media* item = item_to_media(selected_items.at(0));
if (item->get_type() == MEDIA_TYPE_SEQUENCE && sequence == item->to_sequence()) {
QMessageBox::critical(this, "Active sequence selected", "You cannot insert a sequence into itself, so no clips of this media would be in this sequence.", QMessageBox::Ok);
QMessageBox::critical(this,
tr("Active sequence selected"),
tr("You cannot insert a sequence into itself, so no clips of this media would be in this sequence."),
QMessageBox::Ok);
} else {
ReplaceClipMediaDialog dialog(this, item);
dialog.exec();
@@ -350,7 +360,11 @@ void Project::open_properties() {
default:
{
// fall back to renaming
QString new_name = QInputDialog::getText(this, "Rename '" + item->get_name() + "'", "Enter new name:", QLineEdit::Normal, item->get_name());
QString new_name = QInputDialog::getText(this,
tr("Rename '%1'").arg(item->get_name()),
tr("Enter new name:"),
QLineEdit::Normal,
item->get_name());
if (!new_name.isEmpty()) {
MediaRename* mr = new MediaRename(item, new_name);
undo_stack.push(mr);
@@ -467,11 +481,11 @@ void Project::delete_selected_media() {
if (!confirm_delete) {
// we found a reference, so we know we'll need to ask if the user wants to delete it
QMessageBox confirm(this);
confirm.setWindowTitle("Delete media in use?");
confirm.setText("The media '" + media->name + "' is currently used in '" + s->name + "'. Deleting it will remove all instances in the sequence. Are you sure you want to do this?");
confirm.setWindowTitle(tr("Delete media in use?"));
confirm.setText(tr("The media '%1' is currently used in '%2'. Deleting it will remove all instances in the sequence. Are you sure you want to do this?").arg(media->name, s->name));
QAbstractButton* yes_button = confirm.addButton(QMessageBox::Yes);
QAbstractButton* skip_button = nullptr;
if (items.size() > 1) skip_button = confirm.addButton("Skip", QMessageBox::NoRole);
if (items.size() > 1) skip_button = confirm.addButton(tr("Skip"), QMessageBox::NoRole);
QAbstractButton* abort_button = confirm.addButton(QMessageBox::Cancel);
confirm.exec();
if (confirm.clickedButton() == yes_button) {
@@ -694,7 +708,11 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
}
if (!found) {
image_sequence_urls.append(new_filename);
if (QMessageBox::question(this, "Image sequence detected", "The file '" + file + "' appears to be part of an image sequence. Would you like to import it as such?", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) {
if (QMessageBox::question(this,
tr("Image sequence detected"),
tr("The file '%1' appears to be part of an image sequence. Would you like to import it as such?").arg(file),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes) == QMessageBox::Yes) {
file = new_filename;
image_sequence_importassequence.append(true);
} else {
@@ -797,7 +815,7 @@ bool Project::reveal_media(Media *media, QModelIndex parent) {
}
void Project::import_dialog() {
QFileDialog fd(this, "Import media...", "", "All Files (*)");
QFileDialog fd(this, tr("Import media..."), "", tr("All Files") + " (*)");
fd.setFileMode(QFileDialog::ExistingFiles);
if (fd.exec()) {
@@ -808,7 +826,10 @@ void Project::import_dialog() {
void Project::delete_clips_using_selected_media() {
if (sequence == nullptr) {
QMessageBox::critical(this, "No active sequence", "No sequence is active, please open the sequence you want to delete clips from.", QMessageBox::Ok);
QMessageBox::critical(this,
tr("No active sequence"),
tr("No sequence is active, please open the sequence you want to delete clips from."),
QMessageBox::Ok);
} else {
ComboAction* ca = new ComboAction();
bool deleted = false;
+36 -30
View File
@@ -397,10 +397,11 @@ void Timeline::update_sequence() {
addButton->setEnabled(!null_sequence);
headers->setEnabled(!null_sequence);
QString title = tr("Timeline: ");
if (null_sequence) {
setWindowTitle("Timeline: <none>");
setWindowTitle(title + tr("<none>"));
} else {
setWindowTitle("Timeline: " + sequence->name);
setWindowTitle(title + sequence->name);
update_ui(false);
}
}
@@ -1007,15 +1008,15 @@ void Timeline::paste(bool insert) {
}
if (found >= 0 && ask_conflict) {
QMessageBox box(this);
box.setWindowTitle("Effect already exists");
box.setText("Clip '" + c->name + "' already contains a '" + e->meta->name + "' effect. Would you like to replace it with the pasted one or add it as a separate effect?");
box.setWindowTitle(tr("Effect already exists"));
box.setText(tr("Clip '%1' already contains a '%2' effect. Would you like to replace it with the pasted one or add it as a separate effect?").arg(c->name, e->meta->name));
box.setIcon(QMessageBox::Icon::Question);
box.addButton("Add", QMessageBox::YesRole);
QPushButton* replace_button = box.addButton("Replace", QMessageBox::NoRole);
QPushButton* skip_button = box.addButton("Skip", QMessageBox::RejectRole);
box.addButton(tr("Add"), QMessageBox::YesRole);
QPushButton* replace_button = box.addButton(tr("Replace"), QMessageBox::NoRole);
QPushButton* skip_button = box.addButton(tr("Skip"), QMessageBox::RejectRole);
QCheckBox* future_box = new QCheckBox("Do this for all conflicts found");
QCheckBox* future_box = new QCheckBox(tr("Do this for all conflicts found"));
box.setCheckBox(future_box);
box.exec();
@@ -1389,8 +1390,8 @@ void Timeline::set_marker() {
if (!add_marker) {
QInputDialog d(this);
d.setWindowTitle("Set Marker");
d.setLabelText("Set marker name:");
d.setWindowTitle(tr("Set Marker"));
d.setLabelText(tr("Set marker name:"));
d.setInputMode(QInputDialog::TextInput);
add_marker = (d.exec() == QDialog::Accepted);
marker_name = d.textValue();
@@ -1478,29 +1479,29 @@ void Timeline::add_btn_click() {
QMenu add_menu(this);
QAction* titleMenuItem = new QAction(&add_menu);
titleMenuItem->setText("Title...");
titleMenuItem->setText(tr("Title..."));
titleMenuItem->setData(ADD_OBJ_TITLE);
add_menu.addAction(titleMenuItem);
QAction* solidMenuItem = new QAction(&add_menu);
solidMenuItem->setText("Solid Color...");
solidMenuItem->setText(tr("Solid Color..."));
solidMenuItem->setData(ADD_OBJ_SOLID);
add_menu.addAction(solidMenuItem);
QAction* barsMenuItem = new QAction(&add_menu);
barsMenuItem->setText("Bars...");
barsMenuItem->setText(tr("Bars..."));
barsMenuItem->setData(ADD_OBJ_BARS);
add_menu.addAction(barsMenuItem);
add_menu.addSeparator();
QAction* toneMenuItem = new QAction(&add_menu);
toneMenuItem->setText("Tone...");
toneMenuItem->setText(tr("Tone..."));
toneMenuItem->setData(ADD_OBJ_TONE);
add_menu.addAction(toneMenuItem);
QAction* noiseMenuItem = new QAction(&add_menu);
noiseMenuItem->setText("Noise...");
noiseMenuItem->setText(tr("Noise..."));
noiseMenuItem->setData(ADD_OBJ_NOISE);
add_menu.addAction(noiseMenuItem);
@@ -1522,11 +1523,16 @@ void Timeline::setScroll(int s) {
void Timeline::record_btn_click() {
if (project_url.isEmpty()) {
QMessageBox::critical(this, "Unsaved Project", "You must save this project before you can record audio in it.", QMessageBox::Ok);
QMessageBox::critical(this,
tr("Unsaved Project"),
tr("You must save this project before you can record audio in it."),
QMessageBox::Ok);
} else {
creating = true;
creating_object = ADD_OBJ_AUDIO;
mainWindow->statusBar()->showMessage("Click on the timeline where you want to start recording (drag to limit the recording to a certain timeframe)", 10000);
mainWindow->statusBar()->showMessage(
tr("Click on the timeline where you want to start recording (drag to limit the recording to a certain timeframe)"),
10000);
}
}
@@ -1605,7 +1611,7 @@ void Timeline::setup_ui() {
arrow_icon.addFile(QStringLiteral(":/icons/arrow-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
toolArrowButton->setIcon(arrow_icon);
toolArrowButton->setCheckable(true);
toolArrowButton->setToolTip("Pointer Tool (V)");
toolArrowButton->setToolTip(tr("Pointer Tool") + " (V)");
toolArrowButton->setProperty("tool", TIMELINE_TOOL_POINTER);
connect(toolArrowButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolArrowButton);
@@ -1616,7 +1622,7 @@ void Timeline::setup_ui() {
icon1.addFile(QStringLiteral(":/icons/beam-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
toolEditButton->setIcon(icon1);
toolEditButton->setCheckable(true);
toolEditButton->setToolTip("Edit Tool (X)");
toolEditButton->setToolTip(tr("Edit Tool") + " (X)");
toolEditButton->setProperty("tool", TIMELINE_TOOL_EDIT);
connect(toolEditButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolEditButton);
@@ -1627,7 +1633,7 @@ void Timeline::setup_ui() {
icon2.addFile(QStringLiteral(":/icons/ripple-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
toolRippleButton->setIcon(icon2);
toolRippleButton->setCheckable(true);
toolRippleButton->setToolTip("Ripple Tool (B)");
toolRippleButton->setToolTip(tr("Ripple Tool") + " (B)");
toolRippleButton->setProperty("tool", TIMELINE_TOOL_RIPPLE);
connect(toolRippleButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolRippleButton);
@@ -1638,7 +1644,7 @@ void Timeline::setup_ui() {
icon4.addFile(QStringLiteral(":/icons/razor-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
toolRazorButton->setIcon(icon4);
toolRazorButton->setCheckable(true);
toolRazorButton->setToolTip("Razor Tool (C)");
toolRazorButton->setToolTip(tr("Razor Tool") + " (C)");
toolRazorButton->setProperty("tool", TIMELINE_TOOL_RAZOR);
connect(toolRazorButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolRazorButton);
@@ -1649,7 +1655,7 @@ void Timeline::setup_ui() {
icon5.addFile(QStringLiteral(":/icons/slip-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
toolSlipButton->setIcon(icon5);
toolSlipButton->setCheckable(true);
toolSlipButton->setToolTip("Slip Tool (Y)");
toolSlipButton->setToolTip(tr("Slip Tool") + " (Y)");
toolSlipButton->setProperty("tool", TIMELINE_TOOL_SLIP);
connect(toolSlipButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolSlipButton);
@@ -1660,7 +1666,7 @@ void Timeline::setup_ui() {
icon6.addFile(QStringLiteral(":/icons/slide-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
toolSlideButton->setIcon(icon6);
toolSlideButton->setCheckable(true);
toolSlideButton->setToolTip("Slide Tool (U)");
toolSlideButton->setToolTip(tr("Slide Tool") + " (U)");
toolSlideButton->setProperty("tool", TIMELINE_TOOL_SLIDE);
connect(toolSlideButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolSlideButton);
@@ -1671,7 +1677,7 @@ void Timeline::setup_ui() {
icon7.addFile(QStringLiteral(":/icons/hand-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
toolHandButton->setIcon(icon7);
toolHandButton->setCheckable(true);
toolHandButton->setToolTip("Hand Tool (H)");
toolHandButton->setToolTip(tr("Hand Tool") + " (H)");
toolHandButton->setProperty("tool", TIMELINE_TOOL_HAND);
connect(toolHandButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
tool_buttons_layout->addWidget(toolHandButton);
@@ -1682,7 +1688,7 @@ void Timeline::setup_ui() {
icon8.addFile(QStringLiteral(":/icons/transition-tool-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
toolTransitionButton->setIcon(icon8);
toolTransitionButton->setCheckable(true);
toolTransitionButton->setToolTip("Transition Tool (T)");
toolTransitionButton->setToolTip(tr("Transition Tool") + " (T)");
connect(toolTransitionButton, SIGNAL(clicked(bool)), this, SLOT(transition_tool_click()));
tool_buttons_layout->addWidget(toolTransitionButton);
@@ -1693,7 +1699,7 @@ void Timeline::setup_ui() {
snappingButton->setIcon(icon9);
snappingButton->setCheckable(true);
snappingButton->setChecked(true);
snappingButton->setToolTip("Snapping (S)");
snappingButton->setToolTip(tr("Snapping") + " (S)");
connect(snappingButton, SIGNAL(toggled(bool)), this, SLOT(snapping_clicked(bool)));
tool_buttons_layout->addWidget(snappingButton);
@@ -1702,7 +1708,7 @@ void Timeline::setup_ui() {
icon10.addFile(QStringLiteral(":/icons/zoomin.png"), QSize(), QIcon::Normal, QIcon::On);
icon10.addFile(QStringLiteral(":/icons/zoomin-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
zoomInButton->setIcon(icon10);
zoomInButton->setToolTip("Zoom In (=)");
zoomInButton->setToolTip(tr("Zoom In") + " (=)");
connect(zoomInButton, SIGNAL(clicked(bool)), this, SLOT(zoom_in()));
tool_buttons_layout->addWidget(zoomInButton);
@@ -1711,7 +1717,7 @@ void Timeline::setup_ui() {
icon11.addFile(QStringLiteral(":/icons/zoomout.png"), QSize(), QIcon::Normal, QIcon::On);
icon11.addFile(QStringLiteral(":/icons/zoomout-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
zoomOutButton->setIcon(icon11);
zoomOutButton->setToolTip("Zoom Out (-)");
zoomOutButton->setToolTip(tr("Zoom Out") + " (-)");
connect(zoomOutButton, SIGNAL(clicked(bool)), this, SLOT(zoom_out()));
tool_buttons_layout->addWidget(zoomOutButton);
@@ -1720,7 +1726,7 @@ void Timeline::setup_ui() {
icon12.addFile(QStringLiteral(":/icons/record.png"), QSize(), QIcon::Normal, QIcon::On);
icon12.addFile(QStringLiteral(":/icons/record-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
recordButton->setIcon(icon12);
recordButton->setToolTip("Record audio");
recordButton->setToolTip(tr("Record audio"));
connect(recordButton, SIGNAL(clicked(bool)), this, SLOT(record_btn_click()));
tool_buttons_layout->addWidget(recordButton);
@@ -1730,7 +1736,7 @@ void Timeline::setup_ui() {
icon13.addFile(QStringLiteral(":/icons/add-button.png"), QSize(), QIcon::Normal, QIcon::On);
icon13.addFile(QStringLiteral(":/icons/add-button-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
addButton->setIcon(icon13);
addButton->setToolTip("Add title, solid, bars, etc.");
addButton->setToolTip(tr("Add title, solid, bars, etc."));
connect(addButton, SIGNAL(clicked()), this, SLOT(add_btn_click()));
tool_buttons_layout->addWidget(addButton);
+2 -2
View File
@@ -44,7 +44,7 @@ Viewer::Viewer(QWidget *parent) :
seq(nullptr),
created_sequence(false),
cue_recording_internal(false),
panel_name("Viewer: "),
panel_name(tr("Viewer: ")),
minimum_zoom(1.0)
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
@@ -785,7 +785,7 @@ void Viewer::set_sequence(bool main, Sequence *s) {
update_playhead_timecode(0);
update_end_timecode();
setWindowTitle(panel_name + "(none)");
setWindowTitle(panel_name + tr("(none)"));
}
update_header_zoom();
+2 -2
View File
@@ -292,7 +292,7 @@ bool start_recording() {
return false;
}
QString audio_path = project_url + " Audio";
QString audio_path = project_url + " " + QCoreApplication::translate("Audio", "Audio");
QDir audio_dir(audio_path);
if (!audio_dir.exists() && !audio_dir.mkpath(".")) {
qCritical() << "Failed to create audio directory";
@@ -303,7 +303,7 @@ bool start_recording() {
int file_number = 0;
do {
file_number++;
audio_filename = audio_path + "/Recording " + QString::number(file_number) + ".wav";
audio_filename = audio_path + "/" + QCoreApplication::translate("Audio", "Recording") + " " + QString::number(file_number) + ".wav";
} while (QFile(audio_filename).exists());
output_recording.setFileName(audio_filename);
+3 -2
View File
@@ -746,10 +746,11 @@ void open_clip_worker(Clip* clip) {
}
/* stabilization code */
bool stabilize = false;
/*bool stabilize = false;
if (stabilize) {
AVFilterContext* stab_filter;
int stab_ret = avfilter_graph_create_filter(&stab_filter, avfilter_get_by_name("vidstabtransform"), "vidstab", "input=/media/matt/Home/samples/transforms.trf", nullptr, clip->filter_graph);
if (stab_ret < 0) {
char err[100];
av_strerror(stab_ret, err, sizeof(err));
@@ -757,7 +758,7 @@ void open_clip_worker(Clip* clip) {
avfilter_link(last_filter, 0, stab_filter, 0);
last_filter = stab_filter;
}
}
}*/
enum AVPixelFormat valid_pix_fmts[] = {
AV_PIX_FMT_RGB24,
+8 -5
View File
@@ -43,6 +43,7 @@
#include <QPainter>
#include <QtMath>
#include <QMenu>
#include <QApplication>
bool shaders_are_enabled = true;
QVector<EffectMeta> effects;
@@ -71,7 +72,9 @@ Effect* create_effect(Clip* c, const EffectMeta* em) {
}
} else {
qCritical() << "Invalid effect data";
QMessageBox::critical(mainWindow, "Invalid effect", "No candidate for effect '" + em->name + "'. This effect may be corrupt. Try reinstalling it or Olive.");
QMessageBox::critical(mainWindow,
QCoreApplication::translate("Effect", "Invalid effect"),
QCoreApplication::translate("Effect", "No candidate for effect '%1'. This effect may be corrupt. Try reinstalling it or Olive.").arg(em->name));
}
return nullptr;
}
@@ -86,7 +89,7 @@ const EffectMeta* get_internal_meta(int internal_id, int type) {
}
void load_internal_effects() {
qWarning() << "Shaders are disabled, some effects may be nonfunctional";
if (!shaders_are_enabled) qWarning() << "Shaders are disabled, some effects may be nonfunctional";
EffectMeta em;
@@ -545,18 +548,18 @@ void Effect::show_context_menu(const QPoint& pos) {
int index = get_index_in_clip();
if (index > 0) {
QAction* move_up = menu.addAction("Move &Up");
QAction* move_up = menu.addAction(tr("Move &Up"));
connect(move_up, SIGNAL(triggered(bool)), this, SLOT(move_up()));
}
if (index < parent_clip->effects.size() - 1) {
QAction* move_down = menu.addAction("Move &Down");
QAction* move_down = menu.addAction(tr("Move &Down"));
connect(move_down, SIGNAL(triggered(bool)), this, SLOT(move_down()));
}
menu.addSeparator();
QAction* del_action = menu.addAction("D&elete");
QAction* del_action = menu.addAction(tr("D&elete"));
connect(del_action, SIGNAL(triggered(bool)), this, SLOT(delete_self()));
menu.exec(container->title_bar->mapToGlobal(pos));
+21 -21
View File
@@ -5,8 +5,8 @@
#define GIZMO_TYPE_POLY 1
#define GIZMO_TYPE_TARGET 2
#define GIZMO_DOT_SIZE 2.5F
#define GIZMO_TARGET_SIZE 5.0F
#define GIZMO_DOT_SIZE 2.5
#define GIZMO_TARGET_SIZE 5.0
#include <QString>
#include <QRect>
@@ -19,32 +19,32 @@ class EffectField;
class EffectGizmo
{
public:
EffectGizmo(int type);
EffectGizmo(int type);
QVector<QPoint> world_pos;
QVector<QPoint> screen_pos;
QVector<QPoint> world_pos;
QVector<QPoint> screen_pos;
EffectField* x_field1;
double x_field_multi1;
EffectField* y_field1;
double y_field_multi1;
EffectField* x_field2;
double x_field_multi2;
EffectField* y_field2;
double y_field_multi2;
EffectField* x_field1;
double x_field_multi1;
EffectField* y_field1;
double y_field_multi1;
EffectField* x_field2;
double x_field_multi2;
EffectField* y_field2;
double y_field_multi2;
void set_previous_value();
void set_previous_value();
QColor color;
int get_point_count();
QColor color;
int get_point_count();
int get_type();
int get_type();
int get_cursor();
void set_cursor(int c);
int get_cursor();
void set_cursor(int c);
private:
int type;
int cursor;
int type;
int cursor;
};
#endif // EFFECTGIZMO_H
+4 -1
View File
@@ -64,7 +64,10 @@ void EffectRow::set_keyframe_enabled(bool enabled) {
set_keyframe_now(ca);
undo_stack.push(ca);
} else {
if (QMessageBox::question(panel_effect_controls, "Disable Keyframes", "Disabling keyframes will delete all current keyframes. Are you sure you want to do this?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
if (QMessageBox::question(panel_effect_controls,
tr("Disable Keyframes"),
tr("Disabling keyframes will delete all current keyframes. Are you sure you want to do this?"),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
// clear
ComboAction* ca = new ComboAction();
for (int i=0;i<fieldCount();i++) {
+35 -24
View File
@@ -9,6 +9,7 @@
#include "projectmodel.h"
#include <QPainter>
#include <QCoreApplication>
#include "debug.h"
@@ -19,18 +20,18 @@ extern "C" {
QString get_interlacing_name(int interlacing) {
switch (interlacing) {
case VIDEO_PROGRESSIVE: return "None (Progressive)";
case VIDEO_TOP_FIELD_FIRST: return "Top Field First";
case VIDEO_BOTTOM_FIELD_FIRST: return "Bottom Field First";
default: return "Invalid";
case VIDEO_PROGRESSIVE: return QCoreApplication::translate("InterlacingName", "None (Progressive)");
case VIDEO_TOP_FIELD_FIRST: return QCoreApplication::translate("InterlacingName", "Top Field First");
case VIDEO_BOTTOM_FIELD_FIRST: return QCoreApplication::translate("InterlacingName", "Bottom Field First");
default: return QCoreApplication::translate("InterlacingName", "Invalid");
}
}
QString get_channel_layout_name(int channels, uint64_t layout) {
switch (channels) {
case 0: return "Invalid";
case 1: return "Mono";
case 2: return "Stereo";
case 0: return QCoreApplication::translate("ChannelLayoutName", "Invalid");
case 1: return QCoreApplication::translate("ChannelLayoutName", "Mono");
case 2: return QCoreApplication::translate("ChannelLayoutName", "Stereo");
default: {
char buf[50];
av_get_channel_layout_string(buf, sizeof(buf), channels, layout);
@@ -76,7 +77,7 @@ void Media::set_sequence(Sequence *s) {
}
void Media::set_folder() {
if (folder_name.isEmpty()) folder_name = "New Folder";
if (folder_name.isEmpty()) folder_name = QCoreApplication::translate("Media", "New Folder");
set_icon(QIcon(":/icons/folder.png"));
type = MEDIA_TYPE_FOLDER;
object = nullptr;
@@ -95,11 +96,11 @@ void Media::update_tooltip(const QString& error) {
case MEDIA_TYPE_FOOTAGE:
{
Footage* f = to_footage();
tooltip = "Name: " + f->name + "\nFilename: " + f->url + "\n";
tooltip = QCoreApplication::translate("Media", "Name:") + " " + f->name + "\n" + QCoreApplication::translate("Media", "Filename:") + " " + f->url + "\n";
if (error.isEmpty()) {
if (f->video_tracks.size() > 0) {
tooltip += "Video Dimensions: ";
tooltip += QCoreApplication::translate("Media", "Video Dimensions:") + " ";
for (int i=0;i<f->video_tracks.size();i++) {
if (i > 0) {
tooltip += ", ";
@@ -109,7 +110,7 @@ void Media::update_tooltip(const QString& error) {
tooltip += "\n";
if (!f->video_tracks.at(0).infinite_length) {
tooltip += "Frame Rate: ";
tooltip += QCoreApplication::translate("Media", "Frame Rate:") + " ";
for (int i=0;i<f->video_tracks.size();i++) {
if (i > 0) {
tooltip += ", ";
@@ -117,14 +118,16 @@ void Media::update_tooltip(const QString& error) {
if (f->video_tracks.at(i).video_interlacing == VIDEO_PROGRESSIVE) {
tooltip += QString::number(f->video_tracks.at(i).video_frame_rate * f->speed);
} else {
tooltip += QString::number(f->video_tracks.at(i).video_frame_rate * f->speed * 2);
tooltip += " fields (" + QString::number(f->video_tracks.at(i).video_frame_rate * f->speed) + " frames)";
tooltip += QCoreApplication::translate("Media", "%1 fields (%2 frames)").arg(
QString::number(f->video_tracks.at(i).video_frame_rate * f->speed * 2),
QString::number(f->video_tracks.at(i).video_frame_rate * f->speed)
);
}
}
tooltip += "\n";
}
tooltip += "Interlacing: ";
tooltip += QCoreApplication::translate("Media", "Interlacing:") + " ";
for (int i=0;i<f->video_tracks.size();i++) {
if (i > 0) {
tooltip += ", ";
@@ -136,7 +139,7 @@ void Media::update_tooltip(const QString& error) {
if (f->audio_tracks.size() > 0) {
tooltip += "\n";
tooltip += "Audio Frequency: ";
tooltip += QCoreApplication::translate("Media", "Audio Frequency:") + " ";
for (int i=0;i<f->audio_tracks.size();i++) {
if (i > 0) {
tooltip += ", ";
@@ -145,7 +148,7 @@ void Media::update_tooltip(const QString& error) {
}
tooltip += "\n";
tooltip += "Audio Channels: ";
tooltip += QCoreApplication::translate("Media", "Audio Channels:") + " ";
for (int i=0;i<f->audio_tracks.size();i++) {
if (i > 0) {
tooltip += ", ";
@@ -162,11 +165,19 @@ void Media::update_tooltip(const QString& error) {
case MEDIA_TYPE_SEQUENCE:
{
Sequence* s = to_sequence();
tooltip = "Name: " + s->name
+ "\nVideo Dimensions: " + QString::number(s->width) + "x" + QString::number(s->height)
+ "\nFrame Rate: " + QString::number(s->frame_rate)
+ "\nAudio Frequency: " + QString::number(s->audio_frequency)
+ "\nAudio Layout: " + get_channel_layout_name(av_get_channel_layout_nb_channels(s->audio_layout), s->audio_layout);
tooltip = QCoreApplication::translate("Media", "Name: %1"
"\nVideo Dimensions: %2x%3"
"\nFrame Rate: %4"
"\nAudio Frequency: %5"
"\nAudio Layout: %6").arg(
s->name,
QString::number(s->width),
QString::number(s->height),
QString::number(s->frame_rate),
QString::number(s->audio_frequency),
get_channel_layout_name(av_get_channel_layout_nb_channels(s->audio_layout), s->audio_layout)
);
}
break;
}
@@ -268,9 +279,9 @@ QVariant Media::data(int column, int role) {
break;
case Qt::DisplayRole:
switch (column) {
case 0: return (root) ? "Name" : get_name();
case 0: return (root) ? QCoreApplication::translate("Media", "Name") : get_name();
case 1:
if (root) return "Duration";
if (root) return QCoreApplication::translate("Media", "Duration");
if (get_type() == MEDIA_TYPE_SEQUENCE) {
Sequence* s = to_sequence();
return frame_to_timecode(s->getEndFrame(), config.timecode_view, s->frame_rate);
@@ -287,7 +298,7 @@ QVariant Media::data(int column, int role) {
}
break;
case 2:
if (root) return "Rate";
if (root) return QCoreApplication::translate("Media", "Rate");
if (get_type() == MEDIA_TYPE_SEQUENCE) return QString::number(get_frame_rate()) + " FPS";
if (get_type() == MEDIA_TYPE_FOOTAGE) {
Footage* f = to_footage();
+3 -1
View File
@@ -3,6 +3,8 @@
#include "clip.h"
#include "transition.h"
#include <QCoreApplication>
#include "debug.h"
Sequence::Sequence() :
@@ -24,7 +26,7 @@ Sequence::~Sequence() {
Sequence* Sequence::copy() {
Sequence* s = new Sequence();
s->name = name + " (copy)";
s->name = QCoreApplication::translate("Sequence", "%1 (copy)").arg(name);
s->width = width;
s->height = height;
s->frame_rate = frame_rate;
+20 -16
View File
@@ -49,10 +49,10 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it
selected_items = items;
QAction* import_action = menu.addAction("Import...");
QAction* import_action = menu.addAction(tr("Import..."));
QObject::connect(import_action, SIGNAL(triggered(bool)), project_parent, SLOT(import_dialog()));
QMenu* new_menu = menu.addMenu("New");
QMenu* new_menu = menu.addMenu(tr("New"));
mainWindow->make_new_menu(new_menu);
if (items.size() > 0) {
@@ -62,20 +62,20 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it
// replace footage
int type = m->get_type();
if (type == MEDIA_TYPE_FOOTAGE) {
QAction* replace_action = menu.addAction("Replace/Relink Media");
QAction* replace_action = menu.addAction(tr("Replace/Relink Media"));
QObject::connect(replace_action, SIGNAL(triggered(bool)), project_parent, SLOT(replace_selected_file()));
#if defined(Q_OS_WIN)
QAction* reveal_in_explorer = menu.addAction("Reveal in Explorer");
QAction* reveal_in_explorer = menu.addAction(tr("Reveal in Explorer"));
#elif defined(Q_OS_MAC)
QAction* reveal_in_explorer = menu.addAction("Reveal in Finder");
QAction* reveal_in_explorer = menu.addAction(tr("Reveal in Finder"));
#else
QAction* reveal_in_explorer = menu.addAction("Reveal in File Manager");
QAction* reveal_in_explorer = menu.addAction(tr("Reveal in File Manager"));
#endif
QObject::connect(reveal_in_explorer, SIGNAL(triggered(bool)), this, SLOT(reveal_in_browser()));
}
if (type != MEDIA_TYPE_FOLDER) {
QAction* replace_clip_media = menu.addAction("Replace Clips Using This Media");
QAction* replace_clip_media = menu.addAction(tr("Replace Clips Using This Media"));
QObject::connect(replace_clip_media, SIGNAL(triggered(bool)), project_parent, SLOT(replace_clip_media()));
}
}
@@ -93,41 +93,41 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it
}
// create sequence from
QAction* create_seq_from = menu.addAction("Create Sequence With This Media");
QAction* create_seq_from = menu.addAction(tr("Create Sequence With This Media"));
QObject::connect(create_seq_from, SIGNAL(triggered(bool)), this, SLOT(create_seq_from_selected()));
// ONLY sequences are selected
if (all_sequences) {
// ONLY sequences are selected
QAction* duplicate_action = menu.addAction("Duplicate");
QAction* duplicate_action = menu.addAction(tr("Duplicate"));
QObject::connect(duplicate_action, SIGNAL(triggered(bool)), project_parent, SLOT(duplicate_selected()));
}
// ONLY footage is selected
if (all_footage) {
QAction* delete_footage_from_sequences = menu.addAction("Delete All Clips Using This Media");
QAction* delete_footage_from_sequences = menu.addAction(tr("Delete All Clips Using This Media"));
QObject::connect(delete_footage_from_sequences, SIGNAL(triggered(bool)), project_parent, SLOT(delete_clips_using_selected_media()));
}
// delete media
QAction* delete_action = menu.addAction("Delete");
QAction* delete_action = menu.addAction(tr("Delete"));
QObject::connect(delete_action, SIGNAL(triggered(bool)), project_parent, SLOT(delete_selected_media()));
if (items.size() == 1) {
QAction* properties_action = menu.addAction("Properties...");
QAction* properties_action = menu.addAction(tr("Properties..."));
QObject::connect(properties_action, SIGNAL(triggered(bool)), project_parent, SLOT(open_properties()));
}
}
menu.addSeparator();
QAction* tree_view_action = menu.addAction("Tree View");
QAction* tree_view_action = menu.addAction(tr("Tree View"));
connect(tree_view_action, SIGNAL(triggered(bool)), project_parent, SLOT(set_tree_view()));
QAction* icon_view_action = menu.addAction("Icon View");
QAction* icon_view_action = menu.addAction(tr("Icon View"));
connect(icon_view_action, SIGNAL(triggered(bool)), project_parent, SLOT(set_icon_view()));
QAction* toolbar_action = menu.addAction("Show Toolbar");
QAction* toolbar_action = menu.addAction(tr("Show Toolbar"));
toolbar_action->setCheckable(true);
toolbar_action->setChecked(project_parent->toolbar_widget->isVisible());
connect(toolbar_action, SIGNAL(triggered(bool)), project_parent->toolbar_widget, SLOT(setVisible(bool)));
@@ -183,7 +183,11 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn
&& m->get_type() == MEDIA_TYPE_FOOTAGE
&& !QFileInfo(paths.at(0)).isDir()
&& config.drop_on_media_to_replace
&& QMessageBox::question(parent, "Replace Media", "You dropped a file onto '" + m->get_name() + "'. Would you like to replace it with the dropped file?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
&& QMessageBox::question(
parent,
tr("Replace Media"),
tr("You dropped a file onto '%1'. Would you like to replace it with the dropped file?").arg(m->get_name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
replace = true;
project_parent->replace_media(m, paths.at(0));
}
+6 -2
View File
@@ -19,12 +19,13 @@
#include "panels/timeline.h"
#include <QMessageBox>
#include <QCoreApplication>
Transition::Transition(Clip* c, Clip* s, const EffectMeta* em) :
Effect(c, em), secondary_clip(s),
length(30)
{
length_field = add_row("Length:", false)->add_field(EFFECT_FIELD_DOUBLE, "length");
length_field = add_row(tr("Length:"), false)->add_field(EFFECT_FIELD_DOUBLE, "length");
connect(length_field, SIGNAL(changed()), this, SLOT(set_length_from_slider()));
length_field->set_double_default_value(30);
length_field->set_double_minimum_value(0);
@@ -74,7 +75,10 @@ Transition* get_transition_from_meta(Clip* c, Clip* s, const EffectMeta* em) {
}
} else {
qCritical() << "Invalid transition data";
QMessageBox::critical(mainWindow, "Invalid transition", "No candidate for transition '" + em->name + "'. This transition may be corrupt. Try reinstalling it or Olive.");
QMessageBox::critical(mainWindow,
QCoreApplication::translate("transition", "Invalid transition"),
QCoreApplication::translate("transition", "No candidate for transition '%1'. This transition may be corrupt. Try reinstalling it or Olive.").arg(em->name)
);
}
return nullptr;
}
+1 -1
View File
@@ -33,7 +33,7 @@ CollapsibleWidget::CollapsibleWidget(QWidget* parent) : QWidget(parent) {
collapse_button = new QPushButton();
collapse_button->setIconSize(QSize(8, 8));
collapse_button->setStyleSheet("QPushButton { border: none; }");
setText("<untitled>");
setText(tr("<untitled>"));
title_bar_layout->addWidget(collapse_button);
title_bar_layout->addWidget(enabled_check);
title_bar_layout->addWidget(header);
+14 -14
View File
@@ -5,18 +5,18 @@
#include <QColorDialog>
ColorButton::ColorButton(QWidget *parent)
: QPushButton(parent), color(Qt::white) {
set_button_color();
connect(this, SIGNAL(clicked(bool)), this, SLOT(open_dialog()));
: QPushButton(parent), color(Qt::white) {
set_button_color();
connect(this, SIGNAL(clicked(bool)), this, SLOT(open_dialog()));
}
QColor ColorButton::get_color() {
return color;
return color;
}
void ColorButton::set_color(QColor c) {
previousColor = color;
color = c;
color = c;
set_button_color();
}
@@ -25,27 +25,27 @@ const QColor &ColorButton::getPreviousValue() {
}
void ColorButton::set_button_color() {
QPalette pal = palette();
pal.setColor(QPalette::Button, color);
setPalette(pal);
QPalette pal = palette();
pal.setColor(QPalette::Button, color);
setPalette(pal);
}
void ColorButton::open_dialog() {
QColor new_color = QColorDialog::getColor(color, nullptr, "Set Color");
QColor new_color = QColorDialog::getColor(color, nullptr, tr("Set Color"));
if (new_color.isValid() && color != new_color) {
set_color(new_color);
set_button_color();
set_button_color();
emit color_changed();
}
}
}
ColorCommand::ColorCommand(ColorButton* s, QColor o, QColor n)
: sender(s), old_color(o), new_color(n) {}
: sender(s), old_color(o), new_color(n) {}
void ColorCommand::undo() {
sender->set_color(old_color);
sender->set_color(old_color);
}
void ColorCommand::redo() {
sender->set_color(new_color);
sender->set_color(new_color);
}
+1 -1
View File
@@ -35,7 +35,7 @@ void EmbeddedFileChooser::setFilename(const QString &s) {
}
void EmbeddedFileChooser::update_label() {
QString l = "<html>File: ";
QString l = "<html>" + tr("File:") + " ";
if (filename.isEmpty()) {
l += "(none)";
} else {
+3 -3
View File
@@ -58,14 +58,14 @@ GraphView::GraphView(QWidget* parent) :
void GraphView::show_context_menu(const QPoint& pos) {
QMenu menu(this);
QAction* zoom_to_selection = menu.addAction("Zoom to Selection");
QAction* zoom_to_selection = menu.addAction(tr("Zoom to Selection"));
if (selected_keys.size() == 0 || row == nullptr) {
zoom_to_selection->setEnabled(false);
} else {
connect(zoom_to_selection, SIGNAL(triggered(bool)), this, SLOT(set_view_to_selection()));
}
QAction* zoom_to_all = menu.addAction("Zoom to Show All");
QAction* zoom_to_all = menu.addAction(tr("Zoom to Show All"));
if (row == nullptr) {
zoom_to_all->setEnabled(false);
} else {
@@ -74,7 +74,7 @@ void GraphView::show_context_menu(const QPoint& pos) {
menu.addSeparator();
QAction* reset_action = menu.addAction("Reset View");
QAction* reset_action = menu.addAction(tr("Reset View"));
if (row == nullptr) {
reset_action->setEnabled(false);
} else {
+1 -1
View File
@@ -53,7 +53,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent) : QWidget(parent) {
keyframe_enable->setMaximumSize(button_size);
keyframe_enable->setIconSize(clock_size);
keyframe_enable->setCheckable(true);
keyframe_enable->setToolTip("Enable Keyframes");
keyframe_enable->setToolTip(tr("Enable Keyframes"));
connect(keyframe_enable, SIGNAL(clicked(bool)), this, SIGNAL(keyframe_enabled_changed(bool)));
connect(keyframe_enable, SIGNAL(toggled(bool)), this, SLOT(keyframe_ui_enabled(bool)));
connect(keyframe_enable, SIGNAL(clicked(bool)), this, SIGNAL(clicked()));
+3 -3
View File
@@ -50,11 +50,11 @@ void KeyframeView::show_context_menu(const QPoint& pos) {
if (selected_fields.size() > 0) {
QMenu menu(this);
QAction* linear = menu.addAction("Linear");
QAction* linear = menu.addAction(tr("Linear"));
linear->setData(KEYFRAME_TYPE_LINEAR);
QAction* bezier = menu.addAction("Bezier");
QAction* bezier = menu.addAction(tr("Bezier"));
bezier->setData(KEYFRAME_TYPE_BEZIER);
QAction* hold = menu.addAction("Hold");
QAction* hold = menu.addAction(tr("Hold"));
hold->setData(KEYFRAME_TYPE_HOLD);
menu.addSeparator();
menu.addAction("Graph Editor");
+4 -4
View File
@@ -147,8 +147,8 @@ void LabelSlider::mouseReleaseEvent(QMouseEvent*) {
if (display_type == LABELSLIDER_FRAMENUMBER) {
QString s = QInputDialog::getText(
this,
"Set Value",
"New value:",
tr("Set Value"),
tr("New value:"),
QLineEdit::Normal,
valueToString(internal_value)
);
@@ -158,8 +158,8 @@ void LabelSlider::mouseReleaseEvent(QMouseEvent*) {
bool ok;
d = QInputDialog::getDouble(
this,
"Set Value",
"New value:",
tr("Set Value"),
tr("New value:"),
(display_type == LABELSLIDER_PERCENT) ? internal_value * 100 : internal_value,
(min_enabled) ? min_value : INT_MIN,
(max_enabled) ? max_value : INT_MAX,
+15 -13
View File
@@ -221,10 +221,12 @@ void TimelineWidget::tooltip_timer_timeout() {
Clip* c = sequence->clips.at(tooltip_clip);
if (c != nullptr) {
QToolTip::showText(QCursor::pos(),
c->name
+ "\nStart: " + frame_to_timecode(c->timeline_in, config.timecode_view, sequence->frame_rate)
+ "\nEnd: " + frame_to_timecode(c->timeline_out, config.timecode_view, sequence->frame_rate)
+ "\nDuration: " + frame_to_timecode(c->getLength(), config.timecode_view, sequence->frame_rate));
tr("%1\nStart: %2\nEnd: %3\nDuration: %4").arg(
c->name,
frame_to_timecode(c->timeline_in, config.timecode_view, sequence->frame_rate),
frame_to_timecode(c->timeline_out, config.timecode_view, sequence->frame_rate),
frame_to_timecode(c->getLength(), config.timecode_view, sequence->frame_rate)
));
}
}
}
@@ -241,8 +243,8 @@ void TimelineWidget::rename_clip() {
}
if (selected_clips.size() > 0) {
QString s = QInputDialog::getText(this,
(selected_clips.size() == 1) ? "Rename '" + selected_clips.at(0)->name + "'" : "Rename multiple clips",
"Enter a new name for this clip:",
(selected_clips.size() == 1) ? tr("Rename '%1'").arg(selected_clips.at(0)->name) : tr("Rename multiple clips"),
tr("Enter a new name for this clip:"),
QLineEdit::Normal,
selected_clips.at(0)->name
);
@@ -275,7 +277,7 @@ void TimelineWidget::open_sequence_properties() {
return;
}
}
QMessageBox::critical(this, "Error", "Couldn't locate media wrapper for sequence.");
QMessageBox::critical(this, tr("Error"), tr("Couldn't locate media wrapper for sequence."));
}
bool same_sign(int a, int b) {
@@ -827,27 +829,27 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
switch (panel_timeline->creating_object) {
case ADD_OBJ_TITLE:
c->name = "Title";
c->name = tr("Title");
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TEXT, EFFECT_TYPE_EFFECT)));
break;
case ADD_OBJ_SOLID:
c->name = "Solid Color";
c->name = tr("Solid Color");
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_SOLID, EFFECT_TYPE_EFFECT)));
break;
case ADD_OBJ_BARS:
{
c->name = "Bars";
c->name = tr("Bars");
Effect* e = create_effect(c, get_internal_meta(EFFECT_INTERNAL_SOLID, EFFECT_TYPE_EFFECT));
e->row(0)->field(0)->set_combo_index(1);
c->effects.append(e);
}
break;
case ADD_OBJ_TONE:
c->name = "Tone";
c->name = tr("Tone");
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TONE, EFFECT_TYPE_EFFECT)));
break;
case ADD_OBJ_NOISE:
c->name = "Noise";
c->name = tr("Noise");
c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_NOISE, EFFECT_TYPE_EFFECT)));
break;
}
@@ -1575,7 +1577,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
}
if (g != nullptr) {
tip += " Duration: ";
tip += " " + tr("Duration:") + " ";
long len = (g->old_out-g->old_in);
if (panel_timeline->trim_in_point) {
len -= frame_diff;
+20 -17
View File
@@ -48,10 +48,10 @@ ViewerWidget::ViewerWidget(QWidget *parent) :
QOpenGLWidget(parent),
default_fbo(nullptr),
waveform(false),
dragging(false),
selected_gizmo(nullptr),
waveform_zoom(1.0),
waveform_scroll(0)
waveform_scroll(0),
dragging(false),
selected_gizmo(nullptr)
{
setMouseTracking(true);
setFocusPolicy(Qt::ClickFocus);
@@ -87,14 +87,14 @@ void ViewerWidget::set_waveform_scroll(int s) {
void ViewerWidget::show_context_menu() {
QMenu menu(this);
QAction* save_frame_as_image = menu.addAction("Save Frame as Image...");
QAction* save_frame_as_image = menu.addAction(tr("Save Frame as Image..."));
connect(save_frame_as_image, SIGNAL(triggered(bool)), this, SLOT(save_frame()));
QAction* show_fullscreen_action = menu.addAction("Show Fullscreen");
QAction* show_fullscreen_action = menu.addAction(tr("Show Fullscreen"));
connect(show_fullscreen_action, SIGNAL(triggered()), this, SLOT(show_fullscreen()));
QMenu zoom_menu("Zoom");
QAction* fit_zoom = zoom_menu.addAction("Fit");
QMenu zoom_menu(tr("Zoom"));
QAction* fit_zoom = zoom_menu.addAction(tr("Fit"));
connect(fit_zoom, SIGNAL(triggered(bool)), this, SLOT(set_fit_zoom()));
zoom_menu.addAction("10%")->setData(0.1);
zoom_menu.addAction("25%")->setData(0.25);
@@ -104,13 +104,13 @@ void ViewerWidget::show_context_menu() {
zoom_menu.addAction("150%")->setData(1.5);
zoom_menu.addAction("200%")->setData(2.0);
zoom_menu.addAction("400%")->setData(4.0);
QAction* custom_zoom = zoom_menu.addAction("Custom");
QAction* custom_zoom = zoom_menu.addAction(tr("Custom"));
connect(custom_zoom, SIGNAL(triggered(bool)), this, SLOT(set_custom_zoom()));
connect(&zoom_menu, SIGNAL(triggered(QAction*)), this, SLOT(set_menu_zoom(QAction*)));
menu.addMenu(&zoom_menu);
if (!viewer->is_main_sequence()) {
menu.addAction("Close Media", viewer, SLOT(close_media()));
menu.addAction(tr("Close Media"), viewer, SLOT(close_media()));
}
menu.exec(QCursor::pos());
@@ -120,7 +120,7 @@ void ViewerWidget::save_frame() {
QFileDialog fd(this);
fd.setAcceptMode(QFileDialog::AcceptSave);
fd.setFileMode(QFileDialog::AnyFile);
fd.setWindowTitle("Save Frame");
fd.setWindowTitle(tr("Save Frame"));
fd.setNameFilter("Portable Network Graphic (*.png);;JPEG (*.jpg);;Windows Bitmap (*.bmp);;Portable Pixmap (*.ppm);;X11 Bitmap (*.xbm);;X11 Pixmap (*.xpm)");
if (fd.exec()) {
@@ -159,7 +159,10 @@ void ViewerWidget::set_fit_zoom() {
void ViewerWidget::set_custom_zoom() {
bool ok;
double d = QInputDialog::getDouble(this, "Viewer Zoom", "Set Custom Zoom Value:", container->zoom*100, 0, 2147483647, 2, &ok);
double d = QInputDialog::getDouble(this,
tr("Viewer Zoom"),
tr("Set Custom Zoom Value:"),
container->zoom*100, 0, 2147483647, 2, &ok);
if (ok) {
container->fit = false;
container->zoom = d*0.01;
@@ -205,7 +208,7 @@ void ViewerWidget::seek_from_click(int x) {
EffectGizmo* ViewerWidget::get_gizmo_from_mouse(int x, int y) {
if (gizmos != nullptr) {
double multiplier = (double) viewer->seq->width / (double) width();
double multiplier = double(viewer->seq->width) / double(width());
QPoint mouse_pos(qRound(x*multiplier), qRound(y*multiplier));
int dot_size = 2 * qRound(GIZMO_DOT_SIZE * multiplier);
int target_size = 2 * qRound(GIZMO_TARGET_SIZE * multiplier);
@@ -243,7 +246,7 @@ EffectGizmo* ViewerWidget::get_gizmo_from_mouse(int x, int y) {
void ViewerWidget::move_gizmos(QMouseEvent *event, bool done) {
if (selected_gizmo != nullptr) {
double multiplier = (double) viewer->seq->width / (double) width();
double multiplier = double(viewer->seq->width) / double(width());
int x_movement = (event->pos().x() - drag_start_x)*multiplier;
int y_movement = (event->pos().y() - drag_start_y)*multiplier;
@@ -431,9 +434,9 @@ void ViewerWidget::process_effect(Clip* c, Effect* e, double timecode, GLTexture
if (e->enable_coords) {
e->process_coords(timecode, coords, data);
}
if ((e->enable_shader && shaders_are_enabled) || e->enable_superimpose) {
if ((e->enable_shader && shaders_are_enabled) || e->enable_superimpose) {
e->startEffect();
if ((e->enable_shader && shaders_are_enabled) && e->is_glsl_linked()) {
if ((e->enable_shader && shaders_are_enabled) && e->is_glsl_linked()) {
e->process_shader(timecode, coords);
composite_texture = draw_clip(c->fbo[fbo_switcher], composite_texture, true);
fbo_switcher = !fbo_switcher;
@@ -635,8 +638,8 @@ GLuint ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio)
// set up autoscale
if (c->autoscale && (video_width != s->width && video_height != s->height)) {
float width_multiplier = (float) s->width / (float) video_width;
float height_multiplier = (float) s->height / (float) video_height;
float width_multiplier = float(s->width) / float(video_width);
float height_multiplier = float(s->height) / float(video_height);
float scale_multiplier = qMin(width_multiplier, height_multiplier);
glScalef(scale_multiplier, scale_multiplier, 1);
}