|
519 | 519 | function main:LoadSettings(ignoreBuild) |
520 | 520 | local setXML, errMsg = common.xml.LoadXMLFile(self.userPath.."Settings.xml") |
521 | 521 | if errMsg and errMsg:match(".*file returns nil") then |
522 | | - ConPrintf("Error: '%s'", errMsg) |
523 | | - main:OpenMessagePopup("Cannot read file", '\nMake sure OneDrive is running then restart PoB and try again.\n\n"'..errMsg..'"') |
524 | | - self.saveSettingsOnExit = false |
| 522 | + self:OpenOneDriveErrPopup(self.userPath.."Settings.xml") |
525 | 523 | return true |
526 | 524 | elseif errMsg and not errMsg:match(".*No such file or directory") then |
527 | 525 | ConPrintf("Error: '%s'", errMsg) |
|
665 | 663 | function main:LoadSharedItems() |
666 | 664 | local setXML, errMsg = common.xml.LoadXMLFile(self.userPath.."Settings.xml") |
667 | 665 | if errMsg and errMsg:match(".*file returns nil") then |
668 | | - ConPrintf("Error: '%s'", errMsg) |
669 | | - main:OpenMessagePopup("Cannot read file", '\nMake sure OneDrive is running then restart PoB and try again.\n\n"'..errMsg..'"') |
670 | | - self.saveSettingsOnExit = false |
| 666 | + self:OpenOneDriveErrPopup(self.userPath.."Settings.xml") |
671 | 667 | return true |
672 | 668 | elseif errMsg and not errMsg:match(".*No such file or directory") then |
673 | 669 | ConPrintf("Error: '%s'", errMsg) |
@@ -1569,6 +1565,18 @@ function main:OpenNewFolderPopup(path, onClose) |
1569 | 1565 | main:OpenPopup(370, 100, "New Folder", controls, "create", "edit", "cancel") |
1570 | 1566 | end |
1571 | 1567 |
|
| 1568 | +---Shows a OneDrive-specific error popup |
| 1569 | +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) |
| 1577 | + self.saveSettingsOnExit = false |
| 1578 | +end |
| 1579 | + |
1572 | 1580 | function main:SetWindowTitleSubtext(subtext) |
1573 | 1581 | if not subtext or not self.showTitlebarName then |
1574 | 1582 | SetWindowTitle(APP_NAME) |
|
0 commit comments