diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-04-13 20:44:02 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-04-13 20:44:02 -0700 |
commit | f5c958ad73db696e473aaa35e144f4c9d8ae24de (patch) | |
tree | ef693cc0bbcaea533d007132897c32a7f9e8ea98 /qt-ui/mainwindow.cpp | |
parent | 14e133321f4ac2cff9eb0b84ba9687e5d42e3e46 (diff) | |
download | subsurface-f5c958ad73db696e473aaa35e144f4c9d8ae24de.tar.gz |
Add Qtr_ macros that uses gettext in a tr() compatible manner
This should wrap gettext nicely and replace the "_()" macros we use in C
code.
Also added comments to the top of all the new files.
Suggested-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index fdc823d9c..d1cde044a 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -1,3 +1,10 @@ +/* + * mainwindow.cpp + * + * classes for the main UI window in Subsurface + */ + +#include "common.h" #include "mainwindow.h" #include "ui_mainwindow.h" @@ -53,7 +60,7 @@ void MainWindow::on_actionNew_triggered() void MainWindow::on_actionOpen_triggered() { - QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::homePath(), filter()); + QString filename = QFileDialog::getOpenFileName(this, Qtr_("Open File"), QDir::homePath(), filter()); if (filename.isEmpty()){ return; } @@ -283,10 +290,10 @@ QString MainWindow::filter() bool MainWindow::askSaveChanges() { - QString message = ! existing_filename ? tr("You have unsaved changes\nWould you like to save those before closing the datafile?") - : tr("You have unsaved changes to file: %1 \nWould you like to save those before closing the datafile?").arg(existing_filename); + QString message = ! existing_filename ? Qtr_("You have unsaved changes\nWould you like to save those before closing the datafile?") + : Qtr_("You have unsaved changes to file: %1 \nWould you like to save those before closing the datafile?").arg(existing_filename); - if (QMessageBox::question(this, tr("Save Changes?"), message) == QMessageBox::Ok){ + if (QMessageBox::question(this, Qtr_("Save Changes?"), message) == QMessageBox::Ok){ // WARNING: Port. // file_save(NULL,NULL); return true; |