| 1751 | } |
| 1752 | |
| 1753 | bool CPreferences::UpdateCategory( |
| 1754 | uint8 cat, |
| 1755 | const wxString& name, |
| 1756 | const CPath& path, |
| 1757 | const wxString& comment, |
| 1758 | uint32 color, |
| 1759 | uint8 prio) |
| 1760 | { |
| 1761 | Category_Struct *category = m_CatList[cat]; |
| 1762 | |
| 1763 | // return true if path is ok, false if not |
| 1764 | bool ret = true; |
| 1765 | if (!path.IsOk() || (!path.DirExists() && !CPath::MakeDir(path))) { |
| 1766 | ret = false; |
| 1767 | // keep path as it was |
| 1768 | } else if (category->path != path) { |
| 1769 | // path changed: reload shared files, adding files in the new path and removing those from the old path |
| 1770 | category->path = path; |
| 1771 | theApp->sharedfiles->Reload(); |
| 1772 | } |
| 1773 | category->title = name; |
| 1774 | category->comment = comment; |
| 1775 | category->color = color; |
| 1776 | category->prio = prio; |
| 1777 | |
| 1778 | SaveCats(); |
| 1779 | return ret; |
| 1780 | } |
| 1781 | |
| 1782 | |
| 1783 | wxString CPreferences::GetBrowser() |