NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches

Tag some menu items. More...

+ Collaboration diagram for tag():

Functions

static int alias_tag (struct Menu *menu, int sel, int act)
 Tag some aliases - Implements Menu::tag() -.
 
static int query_tag (struct Menu *menu, int sel, int act)
 Tag an entry in the Query Menu - Implements Menu::tag() -.
 
static int attach_tag (struct Menu *menu, int sel, int act)
 Tag an attachment - Implements Menu::tag() -.
 
static int file_tag (struct Menu *menu, int sel, int act)
 Tag an entry in the menu - Implements Menu::tag() -.
 
static int compose_attach_tag (struct Menu *menu, int sel, int act)
 Tag an attachment - Implements Menu::tag() -.
 

Detailed Description

Tag some menu items.

Parameters
menuMenu to tag
selCurrent selection
actAction: 0 untag, 1 tag, -1 toggle
Return values
numNet change in number of tagged attachments

Function Documentation

◆ alias_tag()

static int alias_tag ( struct Menu * menu,
int sel,
int act )
static

Tag some aliases - Implements Menu::tag() -.

Definition at line 140 of file dlg_alias.c.

141{
142 const struct AliasMenuData *mdata = menu->mdata;
143 const struct AliasViewArray *ava = &mdata->ava;
144 struct AliasView *av = ARRAY_GET(ava, sel);
145
146 bool ot = av->is_tagged;
147
148 av->is_tagged = ((act >= 0) ? act : !av->is_tagged);
149
150 return av->is_tagged - ot;
151}
#define ARRAY_GET(head, idx)
Return the element at index.
Definition array.h:109
AliasView array wrapper with Pattern information -.
Definition gui.h:54
struct AliasViewArray ava
All Aliases/Queries.
Definition gui.h:55
struct Menu * menu
Menu.
Definition gui.h:58
GUI data wrapping an Alias.
Definition gui.h:38
bool is_tagged
Is it tagged?
Definition gui.h:43
void * mdata
Private data.
Definition lib.h:149
+ Here is the caller graph for this function:

◆ query_tag()

static int query_tag ( struct Menu * menu,
int sel,
int act )
static

Tag an entry in the Query Menu - Implements Menu::tag() -.

Definition at line 166 of file dlg_query.c.

167{
168 const struct AliasMenuData *mdata = menu->mdata;
169 const struct AliasViewArray *ava = &mdata->ava;
170 struct AliasView *av = ARRAY_GET(ava, sel);
171
172 bool ot = av->is_tagged;
173
174 av->is_tagged = ((act >= 0) ? act : !av->is_tagged);
175 return av->is_tagged - ot;
176}
+ Here is the caller graph for this function:

◆ attach_tag()

static int attach_tag ( struct Menu * menu,
int sel,
int act )
static

Tag an attachment - Implements Menu::tag() -.

Definition at line 153 of file dlg_attach.c.

154{
155 struct AttachPrivateData *priv = menu->mdata;
156 struct AttachCtx *actx = priv->actx;
157
158 struct Body *cur = actx->idx[actx->v2r[sel]]->body;
159 bool ot = cur->tagged;
160
161 cur->tagged = ((act >= 0) ? act : !cur->tagged);
162 return cur->tagged - ot;
163}
A set of attachments.
Definition attach.h:63
struct AttachPtr ** idx
Array of attachments.
Definition attach.h:67
short * v2r
Mapping from virtual to real attachment.
Definition attach.h:71
Private state data for Attachments.
struct Menu * menu
Current Menu.
struct AttachCtx * actx
List of all Attachments.
struct Body * body
Attachment.
Definition attach.h:36
The body of an email.
Definition body.h:36
bool tagged
This attachment is tagged.
Definition body.h:90
+ Here is the caller graph for this function:

◆ file_tag()

static int file_tag ( struct Menu * menu,
int sel,
int act )
static

Tag an entry in the menu - Implements Menu::tag() -.

Definition at line 687 of file dlg_browser.c.

688{
689 struct BrowserPrivateData *priv = menu->mdata;
690 struct BrowserEntryArray *entry = &priv->state.entry;
691 struct FolderFile *ff = ARRAY_GET(entry, sel);
692 if (S_ISDIR(ff->mode) ||
693 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)))
694 {
695 mutt_error(_("Can't attach a directory"));
696 return 0;
697 }
698
699 bool ot = ff->tagged;
700 ff->tagged = ((act >= 0) ? act : !ff->tagged);
701
702 return ff->tagged - ot;
703}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
struct Buffer LastDir
Browser: previous selected directory.
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
#define mutt_error(...)
Definition logging2.h:94
#define _(a)
Definition message.h:28
Private state data for the Browser.
struct Menu * menu
Menu.
struct BrowserState state
State containing list of files/dir/mailboxes.
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition lib.h:146
Browser entry representing a folder/dir.
Definition lib.h:79
char * name
Name of file/dir/mailbox.
Definition lib.h:87
bool tagged
Folder is tagged.
Definition lib.h:103
mode_t mode
File permissions.
Definition lib.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compose_attach_tag()

static int compose_attach_tag ( struct Menu * menu,
int sel,
int act )
static

Tag an attachment - Implements Menu::tag() -.

Definition at line 204 of file attach.c.

205{
206 struct ComposeAttachData *adata = menu->mdata;
207 struct AttachCtx *actx = adata->actx;
208 struct Body *cur = actx->idx[actx->v2r[sel]]->body;
209 bool ot = cur->tagged;
210
211 cur->tagged = ((act >= 0) ? act : !cur->tagged);
212 return cur->tagged - ot;
213}
Data to fill the Compose Attach Window.
Definition attach_data.h:33
struct Menu * menu
Menu displaying the attachments.
Definition attach_data.h:35
struct AttachCtx * actx
Set of attachments.
Definition attach_data.h:34
+ Here is the caller graph for this function: