File/Mailbox Browser Dialog. More...
#include "config.h"
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/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 "expando.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"
#include "sort.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? | |
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) |
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 | |
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 145 of file dlg_browser.c.
void mutt_browser_cleanup | ( | void | ) |
Clean up working Buffers.
Definition at line 159 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 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 init_state | ( | struct BrowserState * | state | ) |
Initialise a browser state.
state | BrowserState to initialise |
Definition at line 248 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 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.
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 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.
|
static |
|
static |
Help Bar for the NNTP Mailbox browser dialog.
Definition at line 122 of file dlg_browser.c.
struct Buffer LastDir = { 0 } |
Browser: previous selected directory.
Definition at line 136 of file dlg_browser.c.
struct Buffer LastDirBackup = { 0 } |
Browser: backup copy of the current directory.
Definition at line 138 of file dlg_browser.c.