mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
BranchList:
*FilenameSuffix -> *FileNameSuffix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34244 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
88635c7e77
commit
e5ce07206c
@ -78,13 +78,13 @@ bool Branch::setSelected(bool b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Branch::hasFilenameSuffix() const
|
bool Branch::hasFileNameSuffix() const
|
||||||
{
|
{
|
||||||
return filenameSuffix_;
|
return filenameSuffix_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Branch::setFilenameSuffix(bool b)
|
void Branch::setFileNameSuffix(bool b)
|
||||||
{
|
{
|
||||||
filenameSuffix_ = b;
|
filenameSuffix_ = b;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ bool BranchList::add(docstring const & s)
|
|||||||
Branch br;
|
Branch br;
|
||||||
br.setBranch(name);
|
br.setBranch(name);
|
||||||
br.setSelected(false);
|
br.setSelected(false);
|
||||||
br.setFilenameSuffix(false);
|
br.setFileNameSuffix(false);
|
||||||
list.push_back(br);
|
list.push_back(br);
|
||||||
}
|
}
|
||||||
if (j == docstring::npos)
|
if (j == docstring::npos)
|
||||||
@ -188,12 +188,12 @@ bool BranchList::rename(docstring const & oldname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring BranchList::getFilenameSuffix() const
|
docstring BranchList::getFileNameSuffix() const
|
||||||
{
|
{
|
||||||
docstring result;
|
docstring result;
|
||||||
List::const_iterator it = list.begin();
|
List::const_iterator it = list.begin();
|
||||||
for (; it != list.end(); ++it) {
|
for (; it != list.end(); ++it) {
|
||||||
if (it->isSelected() && it->hasFilenameSuffix())
|
if (it->isSelected() && it->hasFileNameSuffix())
|
||||||
result += "-" + it->branch();
|
result += "-" + it->branch();
|
||||||
}
|
}
|
||||||
return support::subst(result, from_ascii("/"), from_ascii("_"));
|
return support::subst(result, from_ascii("/"), from_ascii("_"));
|
||||||
|
@ -56,9 +56,9 @@ public:
|
|||||||
/** If true, the branch name will be appended
|
/** If true, the branch name will be appended
|
||||||
* to the output file name.
|
* to the output file name.
|
||||||
*/
|
*/
|
||||||
bool hasFilenameSuffix() const;
|
bool hasFileNameSuffix() const;
|
||||||
/// Select/deselect filename suffix property.
|
/// Select/deselect filename suffix property.
|
||||||
void setFilenameSuffix(bool);
|
void setFileNameSuffix(bool);
|
||||||
///
|
///
|
||||||
RGBColor const & color() const;
|
RGBColor const & color() const;
|
||||||
///
|
///
|
||||||
@ -120,7 +120,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool rename(docstring const &, docstring const &, bool const merge = false);
|
bool rename(docstring const &, docstring const &, bool const merge = false);
|
||||||
/// get the complete filename suffix
|
/// get the complete filename suffix
|
||||||
docstring getFilenameSuffix() const;
|
docstring getFileNameSuffix() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
|
@ -553,7 +553,7 @@ string Buffer::latexName(bool const no_path) const
|
|||||||
FileName Buffer::Impl::exportFileName() const
|
FileName Buffer::Impl::exportFileName() const
|
||||||
{
|
{
|
||||||
docstring const branch_suffix =
|
docstring const branch_suffix =
|
||||||
params.branchlist().getFilenameSuffix();
|
params.branchlist().getFileNameSuffix();
|
||||||
if (branch_suffix.empty())
|
if (branch_suffix.empty())
|
||||||
return filename;
|
return filename;
|
||||||
|
|
||||||
|
@ -671,7 +671,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
|
|||||||
if (tok == "\\filename_suffix") {
|
if (tok == "\\filename_suffix") {
|
||||||
lex.next();
|
lex.next();
|
||||||
if (branch_ptr)
|
if (branch_ptr)
|
||||||
branch_ptr->setFilenameSuffix(lex.getInteger());
|
branch_ptr->setFileNameSuffix(lex.getInteger());
|
||||||
}
|
}
|
||||||
if (tok == "\\color") {
|
if (tok == "\\color") {
|
||||||
lex.eatLine();
|
lex.eatLine();
|
||||||
@ -945,7 +945,7 @@ void BufferParams::writeFile(ostream & os) const
|
|||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
os << "\\branch " << to_utf8(it->branch())
|
os << "\\branch " << to_utf8(it->branch())
|
||||||
<< "\n\\selected " << it->isSelected()
|
<< "\n\\selected " << it->isSelected()
|
||||||
<< "\n\\filename_suffix " << it->hasFilenameSuffix()
|
<< "\n\\filename_suffix " << it->hasFileNameSuffix()
|
||||||
<< "\n\\color " << lyx::X11hexname(it->color())
|
<< "\n\\color " << lyx::X11hexname(it->color())
|
||||||
<< "\n\\end_branch"
|
<< "\n\\end_branch"
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
@ -104,7 +104,7 @@ void GuiBranches::updateView()
|
|||||||
coloritem.fill(itemcolor);
|
coloritem.fill(itemcolor);
|
||||||
newItem->setIcon(2, QIcon(coloritem));
|
newItem->setIcon(2, QIcon(coloritem));
|
||||||
}
|
}
|
||||||
newItem->setText(3, it->hasFilenameSuffix() ? qt_("Yes") : qt_("No"));
|
newItem->setText(3, it->hasFileNameSuffix() ? qt_("Yes") : qt_("No"));
|
||||||
// restore selected branch
|
// restore selected branch
|
||||||
if (bname == sel_branch) {
|
if (bname == sel_branch) {
|
||||||
branchesTW->setCurrentItem(newItem);
|
branchesTW->setCurrentItem(newItem);
|
||||||
@ -287,7 +287,7 @@ void GuiBranches::toggleSuffix(QTreeWidgetItem * item)
|
|||||||
|
|
||||||
Branch * branch = branchlist_.find(qstring_to_ucs4(sel_branch));
|
Branch * branch = branchlist_.find(qstring_to_ucs4(sel_branch));
|
||||||
if (branch) {
|
if (branch) {
|
||||||
branch->setFilenameSuffix(!branch->hasFilenameSuffix());
|
branch->setFileNameSuffix(!branch->hasFileNameSuffix());
|
||||||
newBranchLE->clear();
|
newBranchLE->clear();
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user