Select a Mailbox from a list. More...
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include "mutt/lib.h"
Go to the source code of this file.
Data Structures | |
struct | Folder |
A folder/dir in the browser. More... | |
struct | FolderFile |
Browser entry representing a folder/dir. More... | |
struct | BrowserState |
State of the file/mailbox browser. More... | |
Macros | |
#define | MUTT_SEL_NO_FLAGS 0 |
No flags are set. | |
#define | MUTT_SEL_MAILBOX (1 << 0) |
Select a mailbox. | |
#define | MUTT_SEL_MULTI (1 << 1) |
Multi-selection is enabled. | |
#define | MUTT_SEL_FOLDER (1 << 2) |
Select a local directory. | |
Typedefs | |
typedef uint8_t | SelectFileFlags |
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX. | |
Enumerations | |
enum | ExpandoDataFolder { ED_FOL_DATE = 1 , ED_FOL_DATE_FORMAT , ED_FOL_DATE_STRF , ED_FOL_DESCRIPTION , ED_FOL_FILENAME , ED_FOL_FILE_GROUP , ED_FOL_FILE_MODE , ED_FOL_FILE_OWNER , ED_FOL_FILE_SIZE , ED_FOL_FLAGS , ED_FOL_FLAGS2 , ED_FOL_HARD_LINKS , ED_FOL_MESSAGE_COUNT , ED_FOL_NEWSGROUP , ED_FOL_NEW_COUNT , ED_FOL_NEW_MAIL , ED_FOL_NOTIFY , ED_FOL_NUMBER , ED_FOL_POLL , ED_FOL_TAGGED , ED_FOL_UNREAD_COUNT } |
Expando UIDs for the File Browser. More... | |
Functions | |
ARRAY_HEAD (BrowserEntryArray, struct FolderFile) | |
void | dlg_browser (struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles) |
Let the user select a file -. | |
void | mutt_browser_select_dir (const char *f) |
Remember the last directory selected. | |
void | mutt_browser_cleanup (void) |
Clean up working Buffers. | |
void | browser_sort (struct BrowserState *state) |
Sort the entries in the browser. | |
void | browser_add_folder (const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data) |
Add a folder to the browser list. | |
void | browser_highlight_default (struct BrowserState *state, struct Menu *menu) |
Decide which browser item should be highlighted. | |
int | examine_directory (struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix) |
Get list of all files/newsgroups with mask. | |
int | examine_mailboxes (struct Mailbox *m, struct Menu *menu, struct BrowserState *state) |
Get list of mailboxes/subscribed newsgroups. | |
void | init_menu (struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar) |
Set up a new menu. | |
void | init_state (struct BrowserState *state) |
Initialise a browser state. | |
bool | link_is_dir (const char *folder, const char *path) |
Does this symlink point to a directory? | |
void | destroy_state (struct BrowserState *state) |
Free the BrowserState. | |
void | dump_state (struct BrowserState *state) |
Variables | |
struct Buffer | LastDir |
Browser: previous selected directory. | |
struct Buffer | LastDirBackup |
Browser: backup copy of the current directory. | |
const struct CompleteOps | CompleteFileOps |
Auto-Completion of Files. | |
const struct CompleteOps | CompleteMailboxOps |
Auto-Completion of Files / Mailboxes. | |
Select a Mailbox from a list.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file lib.h.
typedef uint8_t SelectFileFlags |
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
enum ExpandoDataFolder |
Expando UIDs for the File Browser.
Definition at line 115 of file lib.h.
ARRAY_HEAD | ( | BrowserEntryArray | , |
struct FolderFile | |||
) |
void mutt_browser_select_dir | ( | const char * | f | ) |
Remember the last directory selected.
f | Directory name to save |
This function helps the browser to know which directory has been selected. It should be called anywhere a confirm hit is done to open a new directory/file which is a maildir/mbox.
We could check if the sort method is appropriate with this feature.
Definition at line 830 of file dlg_browser.c.
void mutt_browser_cleanup | ( | void | ) |
Clean up working Buffers.
Definition at line 159 of file dlg_browser.c.
void browser_sort | ( | struct BrowserState * | state | ) |
Sort the entries in the browser.
state | Browser state |
Call to qsort using browser_sort_helper function. Some specific sort methods are not used via NNTP.
Definition at line 186 of file sort.c.
void browser_add_folder | ( | const struct Menu * | menu, |
struct BrowserState * | state, | ||
const char * | name, | ||
const char * | desc, | ||
const struct stat * | st, | ||
struct Mailbox * | m, | ||
void * | data | ||
) |
Add a folder to the browser list.
menu | Menu to use |
state | Browser state |
name | Name of folder |
desc | Description of folder |
st | stat info for the folder |
m | Mailbox |
data | Data to associate with the folder |
Definition at line 198 of file dlg_browser.c.
void browser_highlight_default | ( | struct BrowserState * | state, |
struct Menu * | menu | ||
) |
Decide which browser item should be highlighted.
state | Browser state |
menu | Current Menu |
This function takes a menu and a state and defines the current entry that should be highlighted.
Definition at line 559 of file dlg_browser.c.
int examine_directory | ( | struct Mailbox * | m, |
struct Menu * | menu, | ||
struct BrowserState * | state, | ||
const char * | dirname, | ||
const char * | prefix | ||
) |
Get list of all files/newsgroups with mask.
m | Mailbox |
menu | Current Menu |
state | State of browser |
dirname | Directory |
prefix | Files/newsgroups must match this prefix |
0 | Success |
-1 | Error |
Definition at line 265 of file dlg_browser.c.
int examine_mailboxes | ( | struct Mailbox * | m, |
struct Menu * | menu, | ||
struct BrowserState * | state | ||
) |
Get list of mailboxes/subscribed newsgroups.
0 | Success |
-1 | Error |
Definition at line 392 of file dlg_browser.c.
void init_menu | ( | struct BrowserState * | state, |
struct Menu * | menu, | ||
struct Mailbox * | m, | ||
struct MuttWindow * | sbar | ||
) |
Set up a new menu.
state | Browser state |
menu | Current menu |
m | Mailbox |
sbar | Status bar |
Definition at line 585 of file dlg_browser.c.
void init_state | ( | struct BrowserState * | state | ) |
Initialise a browser state.
state | BrowserState to initialise |
Definition at line 248 of file dlg_browser.c.
bool link_is_dir | ( | const char * | folder, |
const char * | path | ||
) |
Does this symlink point to a directory?
folder | Folder |
path | Link name |
true | Links to a directory |
false | Otherwise |
Definition at line 172 of file dlg_browser.c.
void destroy_state | ( | struct BrowserState * | state | ) |
Free the BrowserState.
state | State to free |
Frees up the memory allocated for the local-global variables.
Definition at line 135 of file functions.c.
void dump_state | ( | struct BrowserState * | state | ) |
|
extern |
Browser: previous selected directory.
Definition at line 136 of file dlg_browser.c.
|
extern |
Browser: backup copy of the current directory.
Definition at line 138 of file dlg_browser.c.
|
extern |
Auto-Completion of Files.
Definition at line 153 of file complete.c.
|
extern |
Auto-Completion of Files / Mailboxes.
Definition at line 160 of file complete.c.