File/Mailbox Browser Dialog. More...
#include "config.h"
#include <dirent.h>
#include <errno.h>
#include <grp.h>
#include <limits.h>
#include <locale.h>
#include <pwd.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "menu/lib.h"
#include "format_flags.h"
#include "functions.h"
#include "globals.h"
#include "keymap.h"
#include "mutt_logging.h"
#include "mutt_mailbox.h"
#include "muttlib.h"
#include "mx.h"
#include "opcodes.h"
#include "private_data.h"
#include "imap/lib.h"
#include "nntp/lib.h"
#include "nntp/adata.h"
#include "nntp/mdata.h"
Go to the source code of this file.
Functions | |
static void | init_lastdir (void) |
Initialise the browser directories. More... | |
void | mutt_browser_cleanup (void) |
Clean up working Buffers. More... | |
bool | link_is_dir (const char *folder, const char *path) |
Does this symlink point to a directory? More... | |
static const char * | folder_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags) |
Format a string for the folder browser - Implements format_t -. More... | |
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. More... | |
void | init_state (struct BrowserState *state, struct Menu *menu) |
Initialise a browser state. More... | |
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. More... | |
int | examine_mailboxes (struct Mailbox *m, struct Menu *menu, struct BrowserState *state) |
Get list of mailboxes/subscribed newsgroups. More... | |
static int | select_file_search (struct Menu *menu, regex_t *rx, int line) |
Menu search callback for matching files - Implements Menu::search() -. More... | |
static void | folder_make_entry (struct Menu *menu, char *buf, size_t buflen, int line) |
Format a menu item for the folder browser - Implements Menu::make_entry() -. More... | |
void | browser_highlight_default (struct BrowserState *state, struct Menu *menu) |
Decide which browser item should be highlighted. More... | |
void | init_menu (struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar) |
Set up a new menu. More... | |
static int | file_tag (struct Menu *menu, int sel, int act) |
Tag an entry in the menu - Implements Menu::tag() -. More... | |
static int | browser_config_observer (struct NotifyCallback *nc) |
Notification that a Config Variable has changed - Implements observer_t -. More... | |
static int | browser_window_observer (struct NotifyCallback *nc) |
Notification that a Window has changed - Implements observer_t -. More... | |
void | mutt_browser_select_dir (const char *f) |
Remember the last directory selected. More... | |
void | mutt_buffer_select_file (struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles) |
Let the user select a file. More... | |
void | mutt_select_file (char *file, size_t filelen, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles) |
Let the user select a file. More... | |
Variables | |
static const struct Mapping | FolderHelp [] |
Help Bar for the File/Dir/Mailbox browser dialog. More... | |
static const struct Mapping | FolderNewsHelp [] |
Help Bar for the NNTP Mailbox browser dialog. More... | |
struct Buffer | LastDir = { 0 } |
struct Buffer | LastDirBackup = { 0 } |
File/Mailbox Browser Dialog.
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 browser.c.
|
static |
Initialise the browser directories.
These keep track of where the browser used to be looking.
Definition at line 144 of file browser.c.
void mutt_browser_cleanup | ( | void | ) |
Clean up working Buffers.
Definition at line 158 of file 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 171 of file browser.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 542 of file browser.c.
void init_state | ( | struct BrowserState * | state, |
struct Menu * | menu | ||
) |
Initialise a browser state.
state | BrowserState to initialise |
menu | Current menu |
Definition at line 595 of file 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 619 of file 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 747 of file 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 911 of file 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 937 of file browser.c.
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 1132 of file browser.c.
void mutt_buffer_select_file | ( | struct Buffer * | file, |
SelectFileFlags | flags, | ||
struct Mailbox * | m, | ||
char *** | files, | ||
int * | numfiles | ||
) |
Let the user select a file.
[in] | file | Buffer for the result |
[in] | flags | Flags, see SelectFileFlags |
[in] | m | Mailbox |
[out] | files | Array of selected files |
[out] | numfiles | Number of selected files |
Definition at line 1152 of file browser.c.
void mutt_select_file | ( | char * | file, |
size_t | filelen, | ||
SelectFileFlags | flags, | ||
struct Mailbox * | m, | ||
char *** | files, | ||
int * | numfiles | ||
) |
Let the user select a file.
[in] | file | Buffer for the result |
[in] | filelen | Length of buffer |
[in] | flags | Flags, see SelectFileFlags |
[in] | m | Mailbox |
[out] | files | Array of selected files |
[out] | numfiles | Number of selected files |
Definition at line 1436 of file browser.c.
|
static |
|
static |
Help Bar for the NNTP Mailbox browser dialog.