|
518 | 518 |
|
519 | 519 | function main:LoadSettings(ignoreBuild) |
520 | 520 | local setXML, errMsg = common.xml.LoadXMLFile(self.userPath.."Settings.xml") |
| 521 | + self:OpenOneDriveErrPopup(self.userPath.."Settings.xml") |
521 | 522 | if errMsg and errMsg:match(".*file returns nil") then |
522 | 523 | self:OpenOneDriveErrPopup(self.userPath.."Settings.xml") |
523 | 524 | return true |
@@ -1565,16 +1566,28 @@ function main:OpenNewFolderPopup(path, onClose) |
1565 | 1566 | main:OpenPopup(370, 100, "New Folder", controls, "create", "edit", "cancel") |
1566 | 1567 | end |
1567 | 1568 |
|
1568 | | ----Shows a OneDrive-specific error popup |
| 1569 | +---Shows a OneDrive-specific read error popup with a help button that opens a browser to PoB's GitHub wiki. |
1569 | 1570 | function main:OpenOneDriveErrPopup(fileName) |
1570 | | - if fileName and fileName ~= "" then |
1571 | | - fileName = "'"..fileName.."'" |
1572 | | - else |
1573 | | - fileName = "" |
1574 | | - end |
1575 | | - ConPrintf("Error: OneDrive: file unreadable: %s", fileName) |
1576 | | - self:OpenMessagePopup(" Cannot read file ", "\nMake sure OneDrive is running then restart "..APP_NAME.." and try again.\n\n"..fileName) |
| 1571 | + ConPrintf("Error: OneDrive: file unreadable: %s", fileName or "?") |
| 1572 | + fileName = fileName and "\n\n'"..fileName.."'" or "" |
| 1573 | + local title = " Cannot read file " |
| 1574 | + local msg = "\nMake sure OneDrive is running then restart "..APP_NAME.." and try again."..fileName |
| 1575 | + local url = "https://github.com/PathOfBuildingCommunity/PathOfBuilding/wiki/OneDrive" |
1577 | 1576 | self.saveSettingsOnExit = false |
| 1577 | + local controls = { } |
| 1578 | + local numMsgLines = 0 |
| 1579 | + for line in string.gmatch(msg .. "\n", "([^\n]*)\n") do |
| 1580 | + t_insert(controls, new("LabelControl", nil, {0, 20 + numMsgLines * 16, 0, 16}, line)) |
| 1581 | + numMsgLines = numMsgLines + 1 |
| 1582 | + end |
| 1583 | + controls.help = new("ButtonControl", nil, {-55, 40 + numMsgLines * 16, 80, 20}, "Help (web)", function() |
| 1584 | + OpenURL(url) |
| 1585 | + end) |
| 1586 | + controls.help.tooltipText = url |
| 1587 | + controls.close = new("ButtonControl", nil, {55, 40 + numMsgLines * 16, 80, 20}, "Ok", function() |
| 1588 | + main:ClosePopup() |
| 1589 | + end) |
| 1590 | + return self:OpenPopup(m_max(DrawStringWidth(16, "VAR", msg) + 30, 190), 70 + numMsgLines * 16, title, controls, "close") |
1578 | 1591 | end |
1579 | 1592 |
|
1580 | 1593 | function main:SetWindowTitleSubtext(subtext) |
|
0 commit comments