quickMenuGo: try/catch block

This commit is contained in:
Andrew Dolgov 2006-03-30 07:27:03 +01:00
parent 8a414837ec
commit bb3423cf99
1 changed files with 48 additions and 46 deletions

View File

@ -487,56 +487,58 @@ function quickMenuChange() {
} }
function quickMenuGo(opid) { function quickMenuGo(opid) {
try {
if (opid == "qmcPrefs") {
gotoPreferences();
}
if (opid == "qmcPrefs") { if (opid == "qmcSearch") {
gotoPreferences(); displayDlg("search", getActiveFeedId());
}
if (opid == "qmcSearch") {
displayDlg("search", getActiveFeedId());
return;
}
if (opid == "qmcAddFeed") {
displayDlg("quickAddFeed");
return;
}
if (opid == "qmcRemoveFeed") {
var actid = getActiveFeedId();
if (!actid) {
notify("Please select some feed first.");
return; return;
} }
if (confirm("Remove current feed?")) { if (opid == "qmcAddFeed") {
qfdDelete(actid); displayDlg("quickAddFeed");
return;
} }
return; if (opid == "qmcRemoveFeed") {
} var actid = getActiveFeedId();
if (opid == "qmcUpdateFeeds") { if (!actid) {
scheduleFeedUpdate(true); notify("Please select some feed first.");
return; return;
} }
if (opid == "qmcCatchupAll") { if (confirm("Remove current feed?")) {
catchupAllFeeds(); qfdDelete(actid);
return; }
}
if (opid == "qmcShowOnlyUnread") { return;
toggleDispRead(); }
return;
}
if (opid == "qmcAddFilter") { if (opid == "qmcUpdateFeeds") {
displayDlg("quickAddFilter", getActiveFeedId()); scheduleFeedUpdate(true);
} return;
}
if (opid == "qmcCatchupAll") {
catchupAllFeeds();
return;
}
if (opid == "qmcShowOnlyUnread") {
toggleDispRead();
return;
}
if (opid == "qmcAddFilter") {
displayDlg("quickAddFilter", getActiveFeedId());
}
} catch (e) {
exception_error("quickMenuGo", e);
}
} }
function qafAdd() { function qafAdd() {