Fixed titles of file dialogs.

This commit is contained in:
Matthias Koefferlein 2020-01-28 23:45:40 +01:00
parent 925b7c2f33
commit cc37ecfd17
8 changed files with 25 additions and 25 deletions

View File

@ -2826,7 +2826,7 @@ MainWindow::cm_save_layer_props ()
if (current_view ()) {
std::string fn;
if (mp_lprops_fdia->get_save (fn)) {
if (mp_lprops_fdia->get_save (fn, tl::to_string (QObject::tr ("Save Layer Properties File")))) {
current_view ()->save_layer_props (fn);
}
} else {
@ -2899,7 +2899,7 @@ MainWindow::cm_load_layer_props ()
if (current_view ()) {
std::string fn;
if (mp_lprops_fdia->get_open (fn)) {
if (mp_lprops_fdia->get_open (fn, tl::to_string (QObject::tr ("Load Layer Properties File")))) {
int target_cv_index = -2;
@ -2973,7 +2973,7 @@ MainWindow::cm_save_session ()
QMessageBox::Cancel) == QMessageBox::Ok) {
std::string fn = m_current_session;
if (mp_session_fdia->get_save (fn)) {
if (mp_session_fdia->get_save (fn, tl::to_string (QObject::tr ("Save Session File")))) {
save_session (fn);
}
@ -2988,7 +2988,7 @@ MainWindow::cm_restore_session ()
BEGIN_PROTECTED
std::string fn = m_current_session;
if (mp_session_fdia->get_open (fn)) {
if (mp_session_fdia->get_open (fn, tl::to_string (QObject::tr ("Load Session File")))) {
std::string df_list;
int dirty_layouts = dirty_files (df_list);
@ -3024,7 +3024,7 @@ MainWindow::cm_save_bookmarks ()
if (current_view ()) {
std::string fn;
if (mp_bookmarks_fdia->get_save (fn)) {
if (mp_bookmarks_fdia->get_save (fn, tl::to_string (QObject::tr ("Save Bookmarks File")))) {
current_view ()->bookmarks ().save (fn);
}
} else {
@ -3041,7 +3041,7 @@ MainWindow::cm_load_bookmarks ()
if (current_view ()) {
std::string fn;
if (mp_bookmarks_fdia->get_open (fn)) {
if (mp_bookmarks_fdia->get_open (fn, tl::to_string (QObject::tr ("Load Bookmarks File")))) {
BookmarkList bookmarks;
bookmarks.load (fn);
current_view ()->bookmarks (bookmarks);
@ -3111,7 +3111,7 @@ MainWindow::cm_screenshot ()
if (current_view ()) {
std::string fn;
if (mp_screenshot_fdia->get_save (fn)) {
if (mp_screenshot_fdia->get_save (fn, tl::to_string (QObject::tr ("Save Screenshot")))) {
current_view ()->save_screenshot (fn);
}
} else {
@ -3141,7 +3141,7 @@ MainWindow::cm_save_current_cell_as ()
std::string suffix = tl::to_string (file_info.suffix ());
std::string fn = std::string (cv->layout ().cell_name (path.back ())) + "." + suffix;
if (mp_layout_fdia->get_save (fn)) {
if (mp_layout_fdia->get_save (fn, tl::to_string (QObject::tr ("Save Layout File")))) {
db::SaveLayoutOptions options (cv->save_options ());
options.set_dbu (cv->layout ().dbu ());
@ -3217,7 +3217,7 @@ MainWindow::do_save (bool as)
fn = cv->filename ();
if (! (as || fn.empty ()) || mp_layout_fdia->get_save (fn, tl::to_string (tr ("Layout '%1'").arg (tl::to_qstring (cv->name ()))))) {
if (! (as || fn.empty ()) || mp_layout_fdia->get_save (fn, tl::to_string (tr ("Save Layout '%1'").arg (tl::to_qstring (cv->name ()))))) {
// Here are the options we are going to take:
// - if the layout's save options are valid we take the options from there, otherwise we take the options from the technology
@ -3267,7 +3267,7 @@ MainWindow::cm_save_all ()
const lay::CellView &cv = view (view_index)->cellview (cv_index);
std::string fn = cv->filename ();
if (! fn.empty () || mp_layout_fdia->get_save (fn, tl::to_string (tr ("Layout '%1'").arg (tl::to_qstring (cv->name ()))))) {
if (! fn.empty () || mp_layout_fdia->get_save (fn, tl::to_string (tr ("Save Layout '%1'").arg (tl::to_qstring (cv->name ()))))) {
db::SaveLayoutOptions options (cv->save_options ());
options.set_dbu (cv->layout ().dbu ());
@ -4270,7 +4270,7 @@ MainWindow::open (int mode)
BEGIN_PROTECTED
static std::vector<std::string> files;
if (! mp_layout_fdia->get_open (files)) {
if (! mp_layout_fdia->get_open (files, std::string (), tl::to_string (QObject::tr ("Open Layout Files")))) {
return;
}

View File

@ -93,7 +93,7 @@ FileDialog::get_open (std::string &fp, const std::string &title)
file_name = m_dir.absolutePath ();
}
QString f = QFileDialog::getOpenFileName (QApplication::activeWindow (), QObject::tr ("Load ") + (title.empty () ? m_title : tl::to_qstring (title)), file_name, m_filters, &m_sel_filter);
QString f = QFileDialog::getOpenFileName (QApplication::activeWindow (), (title.empty () ? m_title : tl::to_qstring (title)), file_name, m_filters, &m_sel_filter);
if (! f.isEmpty ()) {
fp = tl::to_string (f);
@ -158,7 +158,7 @@ FileDialog::get_open (std::vector<std::string> &fp, const std::string &dir, cons
m_dir = fi.absolutePath ();
}
QStringList files = QFileDialog::getOpenFileNames (QApplication::activeWindow (), QObject::tr ("Open ") + (title.empty () ? m_title : tl::to_qstring (title)), m_dir.absolutePath (), m_filters, &m_sel_filter);
QStringList files = QFileDialog::getOpenFileNames (QApplication::activeWindow (), (title.empty () ? m_title : tl::to_qstring (title)), m_dir.absolutePath (), m_filters, &m_sel_filter);
if (! files.isEmpty ()) {
fp.clear ();
@ -244,7 +244,7 @@ FileDialog::get_save (std::string &fp, const std::string &title)
file_name = m_dir.absolutePath ();
}
QString f = QFileDialog::getSaveFileName (QApplication::activeWindow (), QObject::tr ("Save ") + (title.empty () ? m_title : tl::to_qstring (title)), file_name, m_filters, &m_sel_filter);
QString f = QFileDialog::getSaveFileName (QApplication::activeWindow (), (title.empty () ? m_title : tl::to_qstring (title)), file_name, m_filters, &m_sel_filter);
if (! f.isEmpty ()) {
fp = tl::to_string (f);

View File

@ -919,7 +919,7 @@ LayoutViewConfigPage5::browse_clicked ()
{
std::string fn = tl::to_string (mp_ui->lyp_file_le->text ());
lay::FileDialog file_dialog (this,
tl::to_string (QObject::tr ("Layer Properties File")),
tl::to_string (QObject::tr ("Select Layer Properties File")),
tl::to_string (QObject::tr ("Layer properties files (*.lyp);;All files (*)")),
"lyp");

View File

@ -449,7 +449,7 @@ BEGIN_PROTECTED
#endif
// prepare and open the file dialog
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Netlist/LVS Database File")), fmts);
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Load Netlist/LVS Database File")), fmts);
if (open_dialog.get_open (m_open_filename)) {
tl::log << tl::to_string (QObject::tr ("Loading file: ")) << m_open_filename;

View File

@ -371,7 +371,7 @@ BEGIN_PROTECTED
if (rdb) {
// prepare and open the file dialog
lay::FileDialog save_dialog (this, tl::to_string (QObject::tr ("Marker Database File")), "KLayout RDB files (*.lyrdb)");
lay::FileDialog save_dialog (this, tl::to_string (QObject::tr ("Save Marker Database File")), "KLayout RDB files (*.lyrdb)");
std::string fn (rdb->filename ());
if (save_dialog.get_save (fn)) {
@ -418,7 +418,7 @@ BEGIN_PROTECTED
}
// prepare and open the file dialog
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Marker Database File")), fmts);
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Load Marker Database File")), fmts);
if (open_dialog.get_open (m_open_filename)) {
std::auto_ptr <rdb::Database> db (new rdb::Database ());

View File

@ -112,7 +112,7 @@ public:
} else if (symbol == "db::import_gerber_open") {
// Get the name of the file to open
lay::FileDialog open_dialog (QApplication::activeWindow (), tl::to_string (QObject::tr ("Gerber Import Project File")), tl::to_string (QObject::tr ("PCB project file (*.pcb);;All files (*)")));
lay::FileDialog open_dialog (QApplication::activeWindow (), tl::to_string (QObject::tr ("Open Gerber Import Project File")), tl::to_string (QObject::tr ("PCB project file (*.pcb);;All files (*)")));
std::string fn = data.current_file;
if (! open_dialog.get_open (fn)) {
return true;

View File

@ -97,7 +97,7 @@ GerberImportDialogFileColumnEditorWidget::browse_clicked ()
}
std::string new_file (tl::to_string (file.absoluteFilePath ()));
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("PCB data file")), tl::to_string (QObject::tr ("All files (*)")));
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Load PCB data file")), tl::to_string (QObject::tr ("All files (*)")));
if (open_dialog.get_open (new_file)) {
set_filename (new_file);
}
@ -370,7 +370,7 @@ BEGIN_PROTECTED
commit_page ();
// Get the name of the file to save
lay::FileDialog save_dialog (this, tl::to_string (QObject::tr ("Gerber Import Project File")), tl::to_string (QObject::tr ("PCB project file (*.pcb);;All files (*)")));
lay::FileDialog save_dialog (this, tl::to_string (QObject::tr ("Load Gerber Import Project File")), tl::to_string (QObject::tr ("PCB project file (*.pcb);;All files (*)")));
std::string fn = mp_data->current_file;
if (save_dialog.get_save (fn)) {
mp_data->save (fn);
@ -392,7 +392,7 @@ GerberImportDialog::open_clicked ()
BEGIN_PROTECTED
// Get the name of the file to open
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Gerber Import Project File")), tl::to_string (QObject::tr ("PCB project file (*.pcb);;All files (*)")));
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Load Gerber Import Project File")), tl::to_string (QObject::tr ("PCB project file (*.pcb);;All files (*)")));
std::string fn = mp_data->current_file;
if (open_dialog.get_open (fn)) {
@ -412,7 +412,7 @@ void
GerberImportDialog::browse_layer_properties_file ()
{
std::string file = tl::to_string (mp_ui->layer_properties_file_le->text ());
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Layer Properties File")), tl::to_string (QObject::tr ("Layer properties files (*.lyp);;All files (*)")));
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Load Layer Properties File")), tl::to_string (QObject::tr ("Layer properties files (*.lyp);;All files (*)")));
if (open_dialog.get_open (file)) {
QDir base_dir (tl::to_qstring (mp_data->base_dir));
mp_ui->layer_properties_file_le->setText (base_dir.relativeFilePath (tl::to_qstring (file)));
@ -665,7 +665,7 @@ GerberImportDialog::add_free_file ()
std::vector <std::string> new_files;
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("PCB data file")), tl::to_string (QObject::tr ("All files (*)")));
lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Load PCB data file")), tl::to_string (QObject::tr ("All files (*)")));
if (open_dialog.get_open (new_files, mp_data->base_dir)) {
std::sort (new_files.begin (), new_files.end ());

View File

@ -225,7 +225,7 @@ StreamImportDialog::browse_filename ()
if (! files.isEmpty ()) {
file = files.front ();
}
files = QFileDialog::getOpenFileNames (this, QObject::tr ("File To Import"), file, QObject::tr ("All files (*)"));
files = QFileDialog::getOpenFileNames (this, QObject::tr ("Select Files To Import"), file, QObject::tr ("All files (*)"));
if (! files.isEmpty ()) {
mp_ui->files_te->setPlainText (files.join (QString::fromUtf8 ("\n")));
}