Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ void Catalog::HeaderData::ParseDict()
// Parse extended information:
SourceCodeCharset = GetHeader("X-Poedit-SourceCharset");
BasePath = GetHeader("X-Poedit-Basepath");
PotFile = GetHeader("X-Poedit-Potfile");

Keywords.Clear();
wxString kwlist = GetHeader("X-Poedit-KeywordsList");
Expand Down Expand Up @@ -955,6 +956,8 @@ Catalog::Catalog()
{
m_isOk = true;
m_header.BasePath = wxEmptyString;
m_header.PotFile = wxEmptyString;

for(int i = BOOKMARK_0; i < BOOKMARK_LAST; i++)
{
m_header.Bookmarks[i] = -1;
Expand Down Expand Up @@ -1676,6 +1679,16 @@ bool Catalog::Update(ProgressInfo *progress, bool summary, bool *cancelledByUser
return false;
}

wxString pot_file = m_header.PotFile;
if (!pot_file.empty())
{
if (!wxIsAbsolutePath(pot_file))
pot_file = path + "/" + pot_file;

return UpdateFromPOT(pot_file, summary, cancelledByUser);
}


wxSetWorkingDirectory(path);
}

Expand Down
1 change: 1 addition & 0 deletions src/catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ class Catalog
wxArrayString SearchPaths, Keywords;
int Bookmarks[BOOKMARK_LAST];
wxString BasePath;
wxString PotFile;

wxString Comment;

Expand Down
2 changes: 1 addition & 1 deletion src/edframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,7 @@ void PoeditFrame::UpdateMenu()
editable && m_catalog->HasDeletedItems());

const bool doupdate = hasCatalog &&
!m_catalog->Header().SearchPaths.empty();
(!m_catalog->Header().SearchPaths.empty() || !m_catalog->Header().PotFile.empty());
toolbar->EnableTool(XRCID("menu_update"), doupdate);
menubar->Enable(XRCID("menu_update"), doupdate);

Expand Down