]> git.lyx.org Git - features.git/commitdiff
Get rid of idiosyncratic accelerator syntax
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Dec 2017 10:36:32 +0000 (11:36 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Dec 2017 10:37:13 +0000 (11:37 +0100)
src/frontends/qt4/GuiBibtex.cpp
src/frontends/qt4/GuiCompare.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiExternal.cpp
src/frontends/qt4/GuiGraphics.cpp
src/frontends/qt4/GuiInclude.cpp
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/LyXFileDialog.cpp

index d3c728a2a51a72105d4982119de640029267b84e..1c3917b94b6b7f36af612c587ac4646e24e530ea 100644 (file)
@@ -432,7 +432,7 @@ bool GuiBibtex::isValid()
 
 QString GuiBibtex::browseBib(QString const & in_name) const
 {
-       QString const label1 = qt_("Documents|#o#O");
+       QString const label1 = qt_("D&ocuments");
        QString const dir1 = toqstr(lyxrc.document_path);
        QStringList const filter(qt_("BibTeX Databases (*.bib)"));
        return browseRelToParent(in_name, bufferFilePath(),
@@ -442,7 +442,7 @@ QString GuiBibtex::browseBib(QString const & in_name) const
 
 QString GuiBibtex::browseBst(QString const & in_name) const
 {
-       QString const label1 = qt_("Documents|#o#O");
+       QString const label1 = qt_("D&ocuments");
        QString const dir1 = toqstr(lyxrc.document_path);
        QStringList const filter(qt_("BibTeX Styles (*.bst)"));
        return browseRelToParent(in_name, bufferFilePath(),
index 4ea7f3578440668e2a052a964f5b50d553db86f9..f7a8132577a0030aef44a97dff42db26dd86326d 100644 (file)
@@ -159,11 +159,11 @@ QString GuiCompare::browse(QString const & in_name) const
        if (lyxview().documentBufferView()) {
                QString path = bufferFilePath();
                filename = browseRelToParent(in_name, path, title, filters, false,
-                       qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+                       qt_("D&ocuments"), toqstr(lyxrc.document_path));
        } else {
                QString path = toqstr(lyxrc.document_path);
                QString rel_filename = browseRelToParent(in_name, path, title, filters, false,
-                       qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+                       qt_("D&ocuments"), toqstr(lyxrc.document_path));
                filename = makeAbsPath(rel_filename, path);
        }
        return filename;
index 53cee98e0490892eb21bde2a084cf1c1c5797804..e6217f5cb385549cb0b0660ccb8b5a02547c52c2 100644 (file)
@@ -2307,7 +2307,7 @@ void GuiDocument::updatePagestyle(string const & items, string const & sel)
 
 void GuiDocument::browseLayout()
 {
-       QString const label1 = qt_("Layouts|#o#O");
+       QString const label1 = qt_("Lay&outs");
        QString const dir1 = toqstr(lyxrc.document_path);
        QStringList const filter(qt_("LyX Layout (*.layout)"));
        QString file = browseRelToParent(QString(), bufferFilePath(),
@@ -2376,7 +2376,7 @@ void GuiDocument::browseMaster()
        QString const docpath = toqstr(support::onlyPath(buffer().absFileName()));
        QStringList const filter(qt_("LyX Files (*.lyx)"));
        QString file = browseRelToSub(old, docpath, title, filter, false,
-               qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+               qt_("D&ocuments"), toqstr(lyxrc.document_path));
 
        if (!file.isEmpty())
                latexModule->childDocLE->setText(file);
index 8215f07e607bff4f35dc104a326b0d626bc120ad..f721bd28b64cf183e88875cacd8110d078953bcb 100644 (file)
@@ -672,7 +672,7 @@ QString GuiExternal::browse(QString const & input,
        QString const bufpath = bufferFilePath();
        QStringList const filter = templateFilters(template_name);
 
-       QString const label1 = qt_("Documents|#o#O");
+       QString const label1 = qt_("D&ocuments");
        QString const dir1 = toqstr(lyxrc.document_path);
 
        return browseRelToParent(input, bufpath, title, filter, false, label1, dir1);
index d2467cdd93441f59d2de75c2e9d5d3d42ab5f123..3c6bd21376cba1497794d6d96ad8c391d954db9c 100644 (file)
@@ -789,8 +789,8 @@ QString GuiGraphics::browse(QString const & in_name) const
 
        return browseRelToParent(in_name, bufferFilePath(),
                title, fileFilters(QString()), false,
-               qt_("Clipart|#C#c"), toqstr(clipdir),
-               qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+               qt_("&Clipart"), toqstr(clipdir),
+               qt_("D&ocuments"), toqstr(lyxrc.document_path));
 }
 
 
index 3e184cd3529ce146bc777f593be6c5ece4495819..4cae710d618a805eab1239be9794593129bec487 100644 (file)
@@ -327,7 +327,7 @@ QString GuiInclude::browse(QString const & in_name, Type in_type) const
        QString const docpath = toqstr(support::onlyPath(buffer().absFileName()));
 
        return browseRelToParent(in_name, docpath, title, filters, false,
-               qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+               qt_("D&ocuments"), toqstr(lyxrc.document_path));
 }
 
 
index c73114949bef9a8ddce3faf220b021e76048d05b..1474cb37f922fe5c0b8c803e531043e429fde131 100644 (file)
@@ -138,11 +138,11 @@ QString browseLibFile(QString const & dir,
        QStringList const & filters)
 {
        // FIXME UNICODE
-       QString const label1 = qt_("System files|#S#s");
+       QString const label1 = qt_("&System files");
        QString const dir1 =
                toqstr(addName(package().system_support().absFileName(), fromqstr(dir)));
 
-       QString const label2 = qt_("User files|#U#u");
+       QString const label2 = qt_("&User files");
        QString const dir2 =
                toqstr(addName(package().user_support().absFileName(), fromqstr(dir)));
 
index 2aee2735d3cb6d07946c5a1f5e4dcc31f5b77b39..78fe8af1ff28ae64d5235761e7da3b90179c6c5a 100644 (file)
@@ -2193,8 +2193,8 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
 static FileName selectTemplateFile()
 {
        FileDialog dlg(qt_("Select template file"));
-       dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
-       dlg.setButton2(qt_("Templates|#T#t"), toqstr(lyxrc.template_path));
+       dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
+       dlg.setButton2(qt_("&Templates"), toqstr(lyxrc.template_path));
 
        FileDialog::Result result = dlg.open(toqstr(lyxrc.template_path),
                                 QStringList(qt_("LyX Documents (*.lyx)")));
@@ -2250,8 +2250,8 @@ void GuiView::openDocument(string const & fname)
 
        if (fname.empty()) {
                FileDialog dlg(qt_("Select document to open"));
-               dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
-               dlg.setButton2(qt_("Examples|#E#e"), toqstr(lyxrc.example_path));
+               dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
+               dlg.setButton2(qt_("&Examples"), toqstr(lyxrc.example_path));
 
                QStringList const filter(qt_("LyX Documents (*.lyx)"));
                FileDialog::Result result =
@@ -2388,8 +2388,8 @@ void GuiView::importDocument(string const & argument)
                        theFormats().prettyName(format));
 
                FileDialog dlg(toqstr(text));
-               dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
-               dlg.setButton2(qt_("Examples|#E#e"), toqstr(lyxrc.example_path));
+               dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
+               dlg.setButton2(qt_("&Examples"), toqstr(lyxrc.example_path));
 
                docstring filter = theFormats().prettyName(format);
                filter += " (*.{";
@@ -2521,8 +2521,8 @@ void GuiView::insertLyXFile(docstring const & fname)
 
                // FIXME UNICODE
                FileDialog dlg(qt_("Select LyX document to insert"));
-               dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
-               dlg.setButton2(qt_("Examples|#E#e"), toqstr(lyxrc.example_path));
+               dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
+               dlg.setButton2(qt_("&Examples"), toqstr(lyxrc.example_path));
 
                FileDialog::Result result = dlg.open(toqstr(initpath),
                                         QStringList(qt_("LyX Documents (*.lyx)")));
@@ -2561,8 +2561,8 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname, RenameKind kin
                // No argument? Ask user through dialog.
                // FIXME UNICODE
                FileDialog dlg(qt_("Choose a filename to save document as"));
-               dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
-               dlg.setButton2(qt_("Templates|#T#t"), toqstr(lyxrc.template_path));
+               dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
+               dlg.setButton2(qt_("&Templates"), toqstr(lyxrc.template_path));
 
                if (!isLyXFileName(fname.absFileName()))
                        fname.changeExtension(".lyx");
@@ -2679,7 +2679,7 @@ bool GuiView::exportBufferAs(Buffer & b, docstring const & iformat)
        FileName fname = b.fileName();
 
        FileDialog dlg(qt_("Choose a filename to export the document as"));
-       dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+       dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
 
        QStringList types;
        QString const anyformat = qt_("Guess from extension (*.*)");
index e218fcfc0c7dd43a70813aa30a73c856731a1b82..adaa1b792ae44b3667693cc1ea359750363773ca 100644 (file)
@@ -25,21 +25,6 @@ using namespace lyx::support;
 
 namespace lyx {
 
-/// return the Qt form of the label
-static QString getLabel(QString const & qstr)
-{
-       // FIXME UNICODE (or "qt-ify")
-       string str = fromqstr(qstr);
-       string label;
-       string sc = split(str, label, '|');
-       if (sc.length() < 2)
-               return toqstr(label);
-       size_t pos = label.find(sc[1]);
-       if (pos != string::npos)
-               label.insert(pos, 1, '&');
-       return toqstr(label);
-}
-
 
 LyXFileDialog::LyXFileDialog(QString const & title,
                             QString const & path,
@@ -60,7 +45,7 @@ LyXFileDialog::LyXFileDialog(QString const & title,
                b1_dir_ = b1.second;
                QToolButton * tb = new QToolButton(this);
                connect(tb, SIGNAL(clicked()), this, SLOT(button1Clicked()));
-               tb->setText(getLabel(b1.first));
+               tb->setText(b1.first);
                layout.at(0)->addWidget(tb);
        }
 
@@ -68,7 +53,7 @@ LyXFileDialog::LyXFileDialog(QString const & title,
                b2_dir_ = b2.second;
                QToolButton * tb = new QToolButton(this);
                connect(tb, SIGNAL(clicked()), this, SLOT(button2Clicked()));
-               tb->setText(getLabel(b2.first));
+               tb->setText(b2.first);
                layout.at(0)->addWidget(tb);
        }
 }