📄 mainfolder.c
字号:
VItemListC& slist = This->folderVBox->SelItems(); FolderListC& flist = ishApp->folderPrefs->OpenFolders(); unsigned count = flist.size(); for (int i=0; i<count; i++) { FolderC *fp = flist[i]; if ( slist.includes(fp->icon) ) fp->Rescan(); } // End for each user folder This->pub->BusyCursor(False);} // End DoFolderReadSel/*--------------------------------------------------------------- * Callback to handle folder-read-all */voidMainWinP::DoFolderReadAll(Widget, MainWinP*, XtPointer){ u_int count; int i; ishApp->Broadcast("");//// Read the in-box// ishApp->systemFolder->Rescan();//// Loop through the user folders// count = ishApp->folderPrefs->OpenFolders().size(); for (i=0; i<count; i++) { FolderC *folder = ishApp->folderPrefs->OpenFolders()[i]; folder->Rescan(); }} // End DoFolderReadAll/*--------------------------------------------------------------- * Callback to handle folder-close-current */voidMainWinP::DoFolderCloseCur(Widget, MainWinP *This, XtPointer){ FolderListC folders; folders.append(This->pub->curFolder);//// Check for saving changes// switch ( This->SaveQuery(&folders) ) { case (QUERY_YES): if ( !This->pub->curFolder->Save() ) return; break; case (QUERY_NO): break; case (QUERY_CANCEL): case (QUERY_NONE): return; } This->pub->BusyCursor(True);//// Close any open reading windows// unsigned count = ishApp->readWinList.size(); for (int i=0; i<count; i++) { ReadWinC *readWin = (ReadWinC*)*ishApp->readWinList[i]; readWin->Hide(); }//// Delete folder// ishApp->folderPrefs->RemoveFolder(This->pub->curFolder); delete This->pub->curFolder; This->pub->curFolder = NULL;//// Switch to the in-box// This->pub->ActivateSystemFolder(); This->folderVBox->Refresh(); This->pub->BusyCursor(False);} // End DoFolderCloseCur/*--------------------------------------------------------------- * Callback to handle folder-close-popup */voidMainWinP::DoFolderPUClose(Widget, MainWinP *This, XtPointer){ if ( !This->pub->popupOnSelected && !This->pub->popupFolder ) return;//// Build list of folders// FolderListC folders; if ( This->pub->popupOnSelected ) { VItemListC& slist = This->folderVBox->SelItems(); FolderListC& flist = ishApp->folderPrefs->OpenFolders(); unsigned count = flist.size(); for (int i=0; i<count; i++) { FolderC *fp = flist[i]; if ( slist.includes(fp->icon) ) folders.add(fp); } } else folders.add(This->pub->popupFolder);//// Check for saving changes// Boolean saveChanges = True; switch ( This->SaveQuery(&folders) ) { case (QUERY_YES): saveChanges = True; break; case (QUERY_NO): saveChanges = False; break; case (QUERY_CANCEL): case (QUERY_NONE): return; } This->pub->BusyCursor(True);//// If the current folder will be closed, close any open reading windows// if ( folders.includes(This->pub->curFolder) ) { unsigned count = ishApp->readWinList.size(); for (int i=0; i<count; i++) { ReadWinC *readWin = (ReadWinC*)*ishApp->readWinList[i]; readWin->Hide(); } This->pub->curFolder = NULL; }//// Delete folder(s)// unsigned count = folders.size(); for (int i=0; i<count; i++) { FolderC *fp = folders[i]; ishApp->folderPrefs->RemoveFolder(fp); if ( saveChanges && fp->writable && fp->Changed() ) fp->Save(); delete fp; }//// Reset variables// This->pub->popupFolder = NULL; This->pub->curMsgList->removeAll();//// If the current folder was closed, switch to the in-box.// if ( !This->pub->curFolder ) This->pub->ActivateSystemFolder(); This->folderVBox->Refresh(); This->pub->BusyCursor(False);} // End DoFolderPUClose/*--------------------------------------------------------------- * Callback to handle folder-close-selected */voidMainWinP::DoFolderCloseSel(Widget, MainWinP *This, XtPointer){ VItemListC list = This->folderVBox->SelItems();//// Build list of folders// FolderListC folders; FolderListC& flist = ishApp->folderPrefs->OpenFolders(); unsigned count = flist.size(); int i; for (i=count-1; i>=0; i--) { FolderC *folder = flist[i]; if ( list.includes(folder->icon) ) folders.append(folder); }//// Check for saving changes// Boolean saveChanges = True; switch ( This->SaveQuery(&folders) ) { case (QUERY_YES): saveChanges = True; break; case (QUERY_NO): saveChanges = False; break; case (QUERY_CANCEL): case (QUERY_NONE): return; } This->pub->BusyCursor(True);//// If the current folder will be closed, close any open reading windows// if ( folders.includes(This->pub->curFolder) ) { unsigned count = ishApp->readWinList.size(); for (i=0; i<count; i++) { ReadWinC *readWin = (ReadWinC*)*ishApp->readWinList[i]; readWin->Hide(); } This->pub->curFolder = NULL; }//// Delete requested folders// count = folders.size(); for (i=0; i<count; i++) { FolderC *fp = folders[i]; ishApp->folderPrefs->RemoveFolder(fp); if ( saveChanges && fp->writable && fp->Changed() ) fp->Save(); delete fp; }//// If the current folder was closed, switch to the in-box.// if ( !This->pub->curFolder ) This->pub->ActivateSystemFolder(); This->folderVBox->Refresh(); This->pub->BusyCursor(False);} // End DoFolderCloseSel/*--------------------------------------------------------------- * Callback to handle folder-close-all */voidMainWinP::DoFolderCloseAll(Widget, MainWinP *This, XtPointer){//// Check for saving changes// Boolean saveChanges = True; switch ( This->SaveQuery(&ishApp->folderPrefs->OpenFolders()) ) { case (QUERY_YES): saveChanges = True; break; case (QUERY_NO): saveChanges = False; break; case (QUERY_CANCEL): case (QUERY_NONE): return; } This->pub->BusyCursor(True); FolderListC& flist = ishApp->folderPrefs->OpenFolders();//// If the current folder will be closed, close any open reading windows// if ( flist.includes(This->pub->curFolder) ) { unsigned count = ishApp->readWinList.size(); for (int i=0; i<count; i++) { ReadWinC *readWin = (ReadWinC*)*ishApp->readWinList[i]; readWin->Hide(); } This->pub->curFolder = NULL; }//// Close requested folders// u_int count = flist.size(); for (int i=count-1; i>=0; i--) { FolderC *fp = flist[i]; ishApp->folderPrefs->RemoveFolder(fp); if ( saveChanges && fp->writable && fp->Changed() ) fp->Save(); delete fp; }//// If the current folder was closed, switch to the in-box.// if ( !This->pub->curFolder ) This->pub->ActivateSystemFolder(); This->folderVBox->Refresh(); This->pub->BusyCursor(False);} // End DoFolderCloseAll/*--------------------------------------------------------------- * Callback to handle folder-delete */voidMainWinP::DoFolderDelCur(Widget, MainWinP *This, XtPointer){ ishApp->Broadcast(""); This->delFolderList->removeAll(); This->delFolderList->add(This->pub->curFolder); This->DeleteFolders();}voidMainWinP::DoFolderPUDel(Widget, MainWinP *This, XtPointer){ if ( This->pub->popupOnSelected ) { DoFolderDelSel(NULL, This, NULL); return; } if ( !This->pub->popupFolder ) return; This->pub->BusyCursor(True); ishApp->Broadcast(""); This->delFolderList->removeAll(); This->delFolderList->add(This->pub->popupFolder); This->DeleteFolders(); This->pub->BusyCursor(False);} // End DoFolderPUDel/*--------------------------------------------------------------- * Callback to handle folder-delete-selected */voidMainWinP::DoFolderDelSel(Widget, MainWinP *This, XtPointer){ This->pub->BusyCursor(True); ishApp->Broadcast(""); This->delFolderList->removeAll();//// Delete folder or folders// VItemListC& slist = This->folderVBox->SelItems(); FolderListC& flist = ishApp->folderPrefs->OpenFolders(); unsigned count = flist.size(); for (int i=0; i<count; i++) { FolderC *fp = flist[i]; if ( slist.includes(fp->icon) ) This->delFolderList->add(fp); } This->DeleteFolders(); This->pub->BusyCursor(False);} // End DoFolderDelSel/*--------------------------------------------------------------- * Callback to handle folder-delete-all */voidMainWinP::DoFolderDelAll(Widget, MainWinP *This, XtPointer){ ishApp->Broadcast(""); *This->delFolderList = ishApp->folderPrefs->OpenFolders(); This->DeleteFolders();} // End DoFolderDelAll/*--------------------------------------------------------------- * Method to confirm folder deletion */voidMainWinP::DeleteFolders(){ if ( !ishApp->confPrefs->confirmDeleteFolder ) { FinishFolderDel(NULL, this, NULL); return; }//// Build verification dialog if necessary// static Widget delWin = NULL; if ( !delWin ) { WArgList args; args.DialogStyle(XmDIALOG_FULL_APPLICATION_MODAL); if ( ishApp->questionPM ) args.SymbolPixmap(ishApp->questionPM); delWin = XmCreateQuestionDialog(*pub, "deleteFolderWin", ARGS); XtUnmanageChild(XmMessageBoxGetChild(delWin, XmDIALOG_HELP_BUTTON)); XtAddCallback(delWin, XmNokCallback, (XtCallbackProc)FinishFolderDel, this); } // End if delete window not yet created//// Prepare message// StringC msg = get_string(delWin, "messageString", "Really delete these folders:\n\n");//// Add folder names to the message// while ( !msg.EndsWith("\n\n") ) msg += '\n'; u_int count = delFolderList->size(); for (int i=0; i<count; i++) { FolderC *folder = (*delFolderList)[i]; if ( folder->isInBox ) continue; if ( i > 0 ) msg += '\n'; msg += folder->abbrev; } WXmString wstr(msg); XtVaSetValues(delWin, XmNmessageString, (XmString)wstr, NULL);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -