commands: move ManageMailboxes to Tab Actions
parent
c06c3f5893
commit
f63ce388f7
|
@ -847,7 +847,7 @@ Alternatives(&[to_stream!(One(Literal("add-attachment")), One(Filepath)), to_str
|
|||
fn manage_mailboxes(input: &[u8]) -> IResult<&[u8], Action> {
|
||||
let (input, _) = tag("manage-mailboxes")(input.trim())?;
|
||||
let (input, _) = eof(input)?;
|
||||
Ok((input, ManageMailboxes))
|
||||
Ok((input, Tab(ManageMailboxes)))
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
|
@ -61,6 +61,7 @@ pub enum TabAction {
|
|||
Close,
|
||||
Kill(Uuid),
|
||||
New(Option<Box<dyn Component>>),
|
||||
ManageMailboxes,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -120,7 +121,6 @@ pub enum Action {
|
|||
PrintEnv(String),
|
||||
Compose(ComposeAction),
|
||||
Mailbox(AccountName, MailboxOperation),
|
||||
ManageMailboxes,
|
||||
AccountAction(AccountName, AccountAction),
|
||||
PrintSetting(String),
|
||||
ReloadConfiguration,
|
||||
|
@ -130,26 +130,13 @@ pub enum Action {
|
|||
|
||||
impl Action {
|
||||
pub fn needs_confirmation(&self) -> bool {
|
||||
match self {
|
||||
Action::Listing(ListingAction::Delete) => true,
|
||||
Action::Listing(_) => false,
|
||||
Action::ViewMailbox(_) => false,
|
||||
Action::Sort(_, _) => false,
|
||||
Action::SubSort(_, _) => false,
|
||||
Action::Tab(_) => false,
|
||||
Action::MailingListAction(_) => true,
|
||||
Action::View(_) => false,
|
||||
Action::SetEnv(_, _) => false,
|
||||
Action::PrintEnv(_) => false,
|
||||
Action::Compose(_) => false,
|
||||
Action::Mailbox(_, _) => true,
|
||||
Action::AccountAction(_, _) => false,
|
||||
Action::PrintSetting(_) => false,
|
||||
Action::ToggleMouse => false,
|
||||
Action::ManageMailboxes => false,
|
||||
Action::Quit => true,
|
||||
Action::ReloadConfiguration => false,
|
||||
}
|
||||
matches!(
|
||||
self,
|
||||
Action::Listing(ListingAction::Delete)
|
||||
| Action::MailingListAction(_)
|
||||
| Action::Mailbox(_, _)
|
||||
| Action::Quit
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1881,7 +1881,7 @@ impl Component for Listing {
|
|||
.push_back(UIEvent::Action(Tab(New(Some(Box::new(composer))))));
|
||||
return true;
|
||||
}
|
||||
UIEvent::Action(Action::ManageMailboxes) => {
|
||||
UIEvent::Action(Action::Tab(ManageMailboxes)) => {
|
||||
let account_pos = self.cursor_pos.0;
|
||||
let mgr = MailboxManager::new(context, account_pos);
|
||||
context
|
||||
|
|
Loading…
Reference in New Issue