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 <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 "expando/lib.h"
#include "imap/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "nntp/lib.h"
#include "functions.h"
#include "globals.h"
#include "mutt_logging.h"
#include "mutt_mailbox.h"
#include "muttlib.h"
#include "mx.h"
#include "nntp/adata.h"
#include "nntp/mdata.h"
#include "private_data.h"
Go to the source code of this file.
Functions | |
static void | init_lastdir (void) |
Initialise the browser directories. | |
void | mutt_browser_cleanup (void) |
Clean up working Buffers. | |
bool | link_is_dir (const char *folder, const char *path) |
Does this symlink point to a directory? | |
long | folder_date_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Last modified (strftime) - Implements ExpandoRenderData::get_number() -. | |
void | folder_date (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Last modified (strftime) - Implements ExpandoRenderData::get_string() -. | |
void | folder_space (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Fixed whitespace - Implements ExpandoRenderData::get_string() -. | |
long | folder_a_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Alert for new mail - Implements ExpandoRenderData::get_number() -. | |
long | folder_C_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Index number - Implements ExpandoRenderData::get_number() -. | |
long | folder_d_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Last modified - Implements ExpandoRenderData::get_number() -. | |
void | folder_d (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Last modified - Implements ExpandoRenderData::get_string() -. | |
long | folder_D_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Last modified ($date_format) - Implements ExpandoRenderData::get_number() -. | |
void | folder_D (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Last modified ($date_format) - Implements ExpandoRenderData::get_string() -. | |
void | folder_f (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Filename - Implements ExpandoRenderData::get_string() -. | |
void | folder_F (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: File permissions - Implements ExpandoRenderData::get_string() -. | |
void | folder_g (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Group name - Implements ExpandoRenderData::get_string() -. | |
void | folder_i (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Description - Implements ExpandoRenderData::get_string() -. | |
long | folder_l_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Hard links - Implements ExpandoRenderData::get_number() -. | |
void | folder_l (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Hard links - Implements ExpandoRenderData::get_string() -. | |
long | folder_m_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Number of messages - Implements ExpandoRenderData::get_number() -. | |
void | folder_m (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Number of messages - Implements ExpandoRenderData::get_string() -. | |
long | folder_n_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Number of unread messages - Implements ExpandoRenderData::get_number() -. | |
void | folder_n (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Number of unread messages - Implements ExpandoRenderData::get_string() -. | |
long | folder_N_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: New mail flag - Implements ExpandoRenderData::get_number() -. | |
void | folder_N (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: New mail flag - Implements ExpandoRenderData::get_string() -. | |
long | folder_p_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Poll for new mail - Implements ExpandoRenderData::get_number() -. | |
long | folder_s_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Size in bytes - Implements ExpandoRenderData::get_number() -. | |
void | folder_s (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Size in bytes - Implements ExpandoRenderData::get_string() -. | |
long | folder_t_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Browser: Is Tagged - Implements ExpandoRenderData::get_number() -. | |
void | folder_t (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Is Tagged - Implements ExpandoRenderData::get_string() -. | |
void | folder_u (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Browser: Owner name - Implements ExpandoRenderData::get_string() -. | |
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 | init_state (struct BrowserState *state, struct Menu *menu) |
Initialise a browser state. | |
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. | |
int | examine_mailboxes (struct Mailbox *m, struct Menu *menu, struct BrowserState *state) |
Get list of mailboxes/subscribed newsgroups. | |
static int | select_file_search (struct Menu *menu, regex_t *rx, int line) |
Menu search callback for matching files - Implements Menu::search() -. | |
static int | folder_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf) |
Format a Folder for the Menu - Implements Menu::make_entry() -. | |
void | browser_highlight_default (struct BrowserState *state, struct Menu *menu) |
Decide which browser item should be highlighted. | |
void | init_menu (struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar) |
Set up a new menu. | |
static int | file_tag (struct Menu *menu, int sel, int act) |
Tag an entry in the menu - Implements Menu::tag() -. | |
static int | browser_config_observer (struct NotifyCallback *nc) |
Notification that a Config Variable has changed - Implements observer_t -. | |
static int | browser_mailbox_observer (struct NotifyCallback *nc) |
Notification that a Mailbox has changed - Implements observer_t -. | |
static int | browser_window_observer (struct NotifyCallback *nc) |
Notification that a Window has changed - Implements observer_t -. | |
void | mutt_browser_select_dir (const char *f) |
Remember the last directory selected. | |
void | dlg_browser (struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles) |
Let the user select a file -. | |
Variables | |
const struct ExpandoRenderData | FolderRenderData [] |
Callbacks for Browser Expandos. | |
const struct ExpandoRenderData | GroupIndexRenderData [] |
Callbacks for Nntp Browser Expandos. | |
static const struct Mapping | FolderHelp [] |
Help Bar for the File/Dir/Mailbox browser dialog. | |
static const struct Mapping | FolderNewsHelp [] |
Help Bar for the NNTP Mailbox browser dialog. | |
struct Buffer | LastDir = { 0 } |
Browser: previous selected directory. | |
struct Buffer | LastDirBackup = { 0 } |
Browser: backup copy of the current directory. | |
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 dlg_browser.c.
|
static |
Initialise the browser directories.
These keep track of where the browser used to be looking.
Definition at line 148 of file dlg_browser.c.
void mutt_browser_cleanup | ( | void | ) |
Clean up working Buffers.
Definition at line 162 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 175 of file dlg_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 632 of file dlg_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 683 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 706 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 833 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 997 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 1023 of file dlg_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 1267 of file dlg_browser.c.
const struct ExpandoRenderData FolderRenderData |
Callbacks for Browser Expandos.
Definition at line 109 of file dlg_browser.c.
const struct ExpandoRenderData GroupIndexRenderData |
Callbacks for Nntp Browser Expandos.
Definition at line 110 of file dlg_browser.c.
|
static |
|
static |
Help Bar for the NNTP Mailbox browser dialog.
Definition at line 125 of file dlg_browser.c.
struct Buffer LastDir = { 0 } |
Browser: previous selected directory.
Definition at line 139 of file dlg_browser.c.
struct Buffer LastDirBackup = { 0 } |
Browser: backup copy of the current directory.
Definition at line 141 of file dlg_browser.c.