added tr for strings

This commit is contained in:
lostjared
2017-02-11 11:38:08 -08:00
parent 450c563be2
commit 452b57f18e
2 changed files with 26 additions and 26 deletions

View File

@@ -200,7 +200,7 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
generate_map(); generate_map();
setGeometry(100, 100, 800, 600); setGeometry(100, 100, 800, 600);
setFixedSize(800, 600); setFixedSize(800, 600);
setWindowTitle("Acid Cam v2 - Qt"); setWindowTitle(tr("Acid Cam v2 - Qt"));
createControls(); createControls();
createMenu(); createMenu();
@@ -237,10 +237,10 @@ void AC_MainWindow::createControls() {
filters->addItem(filter_n.c_str()); filters->addItem(filter_n.c_str());
} }
btn_add = new QPushButton("Add", this); btn_add = new QPushButton(tr("Add"), this);
btn_remove = new QPushButton("Remove", this); btn_remove = new QPushButton(tr("Remove"), this);
btn_moveup = new QPushButton("Move Up", this); btn_moveup = new QPushButton(tr("Move Up"), this);
btn_movedown = new QPushButton("Move Down", this); btn_movedown = new QPushButton(tr("Move Down"), this);
btn_add->setGeometry(10, 215, 100, 20); btn_add->setGeometry(10, 215, 100, 20);
btn_remove->setGeometry(400, 215, 100, 20); btn_remove->setGeometry(400, 215, 100, 20);
@@ -256,14 +256,14 @@ void AC_MainWindow::createControls() {
log_text->setGeometry(10, 250, 780,310); log_text->setGeometry(10, 250, 780,310);
log_text->setReadOnly(true); log_text->setReadOnly(true);
QString text = "Acid Cam Filters v"; QString text = tr("Acid Cam Filters v");
text += ac::version.c_str(); text += ac::version.c_str();
text += " loaded.\n"; text += " loaded.\n";
log_text->setText(text); log_text->setText(text);
filters->setCurrentRow(0); filters->setCurrentRow(0);
chk_negate = new QCheckBox("Negate", this); chk_negate = new QCheckBox(tr("Negate"), this);
chk_negate->setGeometry(120,215,100, 20); chk_negate->setGeometry(120,215,100, 20);
chk_negate->setCheckState(Qt::Unchecked); chk_negate->setCheckState(Qt::Unchecked);
@@ -271,10 +271,10 @@ void AC_MainWindow::createControls() {
combo_rgb = new QComboBox(this); combo_rgb = new QComboBox(this);
combo_rgb->setGeometry(200,215, 190, 25); combo_rgb->setGeometry(200,215, 190, 25);
combo_rgb->addItem("RGB"); combo_rgb->addItem(tr("RGB"));
combo_rgb->addItem("BGR"); combo_rgb->addItem(tr("BGR"));
combo_rgb->addItem("BRG"); combo_rgb->addItem(tr("BRG"));
combo_rgb->addItem("GRB"); combo_rgb->addItem(tr("GRB"));
setWindowIcon(QPixmap(":/images/icon.png")); setWindowIcon(QPixmap(":/images/icon.png"));
@@ -333,7 +333,7 @@ void AC_MainWindow::createMenu() {
connect(combo_rgb, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_SetIndex(int))); connect(combo_rgb, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_SetIndex(int)));
controls_pause->setCheckable(true); controls_pause->setCheckable(true);
controls_pause->setText("Pause"); controls_pause->setText(tr("Pause"));
controls_pause->setChecked(false); controls_pause->setChecked(false);
help_about = new QAction(tr("About"), this); help_about = new QAction(tr("About"), this);
@@ -801,7 +801,7 @@ void AC_MainWindow::updateFrame(QImage img) {
m = localtime(&t); m = localtime(&t);
std::ostringstream time_stream; std::ostringstream time_stream;
time_stream << "-" << (m->tm_year + 1900) << "." << (m->tm_mon + 1) << "." << m->tm_mday << "_" << m->tm_hour << "." << m->tm_min << "." << m->tm_sec << "_"; time_stream << "-" << (m->tm_year + 1900) << "." << (m->tm_mon + 1) << "." << m->tm_mday << "_" << m->tm_hour << "." << m->tm_min << "." << m->tm_sec << "_";
stream << output_directory << "/" << "AC.Snapshot." << time_stream.str().c_str() << "." << ++index << ".png"; stream << output_directory << "/" << "AC2.Snapshot." << time_stream.str().c_str() << "." << ++index << ".png";
cv::imwrite(text.toStdString(), mat); cv::imwrite(text.toStdString(), mat);
QString total; QString total;
QTextStream stream_total(&total); QTextStream stream_total(&total);

View File

@@ -5,20 +5,20 @@
CaptureCamera::CaptureCamera(QWidget *parent) : QDialog(parent) { CaptureCamera::CaptureCamera(QWidget *parent) : QDialog(parent) {
setGeometry(100, 100, 290, 120); setGeometry(100, 100, 290, 120);
setFixedSize(290, 120); setFixedSize(290, 120);
setWindowTitle("Capture from Webcam"); setWindowTitle(tr("Capture from Webcam"));
setWindowIcon(QPixmap(":/images/icon.png")); setWindowIcon(QPixmap(":/images/icon.png"));
createControls(); createControls();
} }
void CaptureCamera::createControls() { void CaptureCamera::createControls() {
QLabel *res = new QLabel("Resolution: ", this); QLabel *res = new QLabel(tr("Resolution: "), this);
res->setGeometry(10, 10, 75, 20); res->setGeometry(10, 10, 75, 20);
combo_res = new QComboBox(this); combo_res = new QComboBox(this);
combo_res->setGeometry(85, 10, 200, 25); combo_res->setGeometry(85, 10, 200, 25);
combo_res->addItem("640x480 (SD)"); combo_res->addItem("640x480 (SD)");
combo_res->addItem("1280x720 (HD)"); combo_res->addItem("1280x720 (HD)");
combo_res->addItem("1920x1080 (Full HD)"); combo_res->addItem("1920x1080 (Full HD)");
QLabel *dev = new QLabel("Device: ", this); QLabel *dev = new QLabel(tr("Device: "), this);
dev->setGeometry(10, 35, 50, 20); dev->setGeometry(10, 35, 50, 20);
combo_device = new QComboBox(this); combo_device = new QComboBox(this);
combo_device->setGeometry(85, 35, 200, 25); combo_device->setGeometry(85, 35, 200, 25);
@@ -28,14 +28,14 @@ void CaptureCamera::createControls() {
stream << i; stream << i;
combo_device->addItem(*stream.string()); combo_device->addItem(*stream.string());
} }
btn_select = new QPushButton("Save Directory", this); btn_select = new QPushButton(tr("Save Directory"), this);
btn_select->setGeometry(10, 65, 100, 20); btn_select->setGeometry(10, 65, 100, 20);
output_dir = new QLineEdit("", this); output_dir = new QLineEdit("", this);
output_dir->setGeometry(110, 65, 175, 20); output_dir->setGeometry(110, 65, 175, 20);
output_dir->setReadOnly(true); output_dir->setReadOnly(true);
chk_record = new QCheckBox("Record", this); chk_record = new QCheckBox(tr("Record"), this);
chk_record->setGeometry(10, 95, 100, 20); chk_record->setGeometry(10, 95, 100, 20);
btn_start = new QPushButton("Start", this); btn_start = new QPushButton(tr("Start"), this);
btn_start->setGeometry(185, 95, 100, 20); btn_start->setGeometry(185, 95, 100, 20);
connect(btn_start, SIGNAL(clicked()), this, SLOT(btn_Start())); connect(btn_start, SIGNAL(clicked()), this, SLOT(btn_Start()));
connect(btn_select, SIGNAL(clicked()), this, SLOT(btn_Select())); connect(btn_select, SIGNAL(clicked()), this, SLOT(btn_Select()));
@@ -60,7 +60,7 @@ void CaptureCamera::btn_Start() {
hide(); hide();
} else { } else {
QMessageBox::information(this, "Could not open Capture device", "Make sure you Webcam is pluged in. If you have more than one Webcam use the proper device index."); QMessageBox::information(this, tr("Could not open Capture device"), tr("Make sure you Webcam is pluged in. If you have more than one Webcam use the proper device index."));
} }
} else { } else {
QMessageBox::information(this, tr("Error could not open device"), tr("Could not open capture device")); QMessageBox::information(this, tr("Error could not open device"), tr("Could not open capture device"));
@@ -70,25 +70,25 @@ void CaptureCamera::btn_Start() {
CaptureVideo::CaptureVideo(QWidget *parent) : QDialog(parent) { CaptureVideo::CaptureVideo(QWidget *parent) : QDialog(parent) {
setGeometry(100, 100, 330, 100); setGeometry(100, 100, 330, 100);
setFixedSize(330, 100); setFixedSize(330, 100);
setWindowTitle(("Capture from Video")); setWindowTitle(tr("Capture from Video"));
setWindowIcon(QPixmap(":/images/icon.png")); setWindowIcon(QPixmap(":/images/icon.png"));
createControls(); createControls();
} }
void CaptureVideo::createControls() { void CaptureVideo::createControls() {
btn_setedit = new QPushButton("Source File", this); btn_setedit = new QPushButton(tr("Source File"), this);
btn_setedit->setGeometry(10, 10, 110, 20); btn_setedit->setGeometry(10, 10, 110, 20);
edit_src = new QLineEdit(this); edit_src = new QLineEdit(this);
edit_src->setGeometry(120, 10, 200, 20); edit_src->setGeometry(120, 10, 200, 20);
edit_src->setReadOnly(true); edit_src->setReadOnly(true);
btn_setout = new QPushButton("Set Output", this); btn_setout = new QPushButton(tr("Set Output"), this);
btn_setout->setGeometry(10, 30, 110, 20); btn_setout->setGeometry(10, 30, 110, 20);
edit_outdir = new QLineEdit(this); edit_outdir = new QLineEdit(this);
edit_outdir->setGeometry(120, 30, 200, 20); edit_outdir->setGeometry(120, 30, 200, 20);
edit_outdir->setReadOnly(true); edit_outdir->setReadOnly(true);
btn_start = new QPushButton("Start", this); btn_start = new QPushButton(tr("Start"), this);
btn_start->setGeometry(10, 60, 100, 20); btn_start->setGeometry(10, 60, 100, 20);
chk_record = new QCheckBox("Record", this); chk_record = new QCheckBox(tr("Record"), this);
chk_record->setGeometry(110, 60, 100, 20); chk_record->setGeometry(110, 60, 100, 20);
connect(btn_setedit, SIGNAL(clicked()), this, SLOT(btn_SetSourceFile())); connect(btn_setedit, SIGNAL(clicked()), this, SLOT(btn_SetSourceFile()));
@@ -107,7 +107,7 @@ void CaptureVideo::btn_SetSourceFile() {
} }
void CaptureVideo::btn_SetOutputDir() { void CaptureVideo::btn_SetOutputDir() {
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), "/home",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); QString dir = QFileDialog::getExistingDirectory(this, tr("Set Output Directory"), "/home",QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if(dir != "") if(dir != "")
edit_outdir->setText(dir); edit_outdir->setText(dir);
} }