accounts.rs: move to crate root
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>pull/299/head
parent
dd4d0b7972
commit
b673af02ac
|
@ -52,10 +52,10 @@ use melib::{
|
|||
};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use super::{AccountConf, FileMailboxConf};
|
||||
#[cfg(feature = "sqlite3")]
|
||||
use crate::command::actions::AccountAction;
|
||||
use crate::{
|
||||
conf::{AccountConf, FileMailboxConf},
|
||||
jobs::{JobId, JoinHandle},
|
||||
types::UIEvent::{self, EnvelopeRemove, EnvelopeRename, EnvelopeUpdate, Notification},
|
||||
MainLoopHandler, StatusEvent, ThreadEvent,
|
|
@ -48,9 +48,6 @@ pub mod shortcuts;
|
|||
mod listing;
|
||||
pub mod terminal;
|
||||
mod themes;
|
||||
pub use themes::*;
|
||||
|
||||
pub mod accounts;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
env,
|
||||
|
@ -67,8 +64,9 @@ use melib::{
|
|||
};
|
||||
use pager::PagerSettings;
|
||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||
pub use themes::*;
|
||||
|
||||
pub use self::{accounts::Account, composing::*, pgp::*, shortcuts::*, tags::*};
|
||||
pub use self::{composing::*, pgp::*, shortcuts::*, tags::*};
|
||||
use self::{
|
||||
default_vals::*, listing::ListingSettings, notifications::NotificationsSettings,
|
||||
terminal::TerminalSettings,
|
||||
|
|
|
@ -97,7 +97,7 @@ pub mod svg;
|
|||
#[macro_use]
|
||||
pub mod conf;
|
||||
pub use crate::conf::{
|
||||
Account, DotAddressable, IndexStyle, SearchBackend, Settings, Shortcuts, ThemeAttribute,
|
||||
DotAddressable, IndexStyle, SearchBackend, Settings, Shortcuts, ThemeAttribute,
|
||||
};
|
||||
|
||||
#[cfg(feature = "sqlite3")]
|
||||
|
@ -105,3 +105,6 @@ pub mod sqlite3;
|
|||
|
||||
pub mod jobs;
|
||||
pub mod mailcap;
|
||||
|
||||
pub mod accounts;
|
||||
pub use self::accounts::Account;
|
||||
|
|
|
@ -37,7 +37,7 @@ use melib::{
|
|||
use nix::sys::wait::WaitStatus;
|
||||
|
||||
use super::*;
|
||||
use crate::{conf::accounts::JobRequest, jobs::JoinHandle, terminal::embed::EmbedTerminal};
|
||||
use crate::{accounts::JobRequest, jobs::JoinHandle, terminal::embed::EmbedTerminal};
|
||||
|
||||
#[cfg(feature = "gpgme")]
|
||||
pub mod gpg;
|
||||
|
|
|
@ -35,7 +35,9 @@ use smallvec::SmallVec;
|
|||
|
||||
use super::*;
|
||||
use crate::{
|
||||
components::ExtendShortcutsMaps, conf::accounts::JobRequest, types::segment_tree::SegmentTree,
|
||||
accounts::{JobRequest, MailboxStatus},
|
||||
components::ExtendShortcutsMaps,
|
||||
types::segment_tree::SegmentTree,
|
||||
};
|
||||
|
||||
// [ref:TODO]: emoji_text_presentation_selector should be printed along with the chars
|
||||
|
@ -2327,7 +2329,6 @@ impl Component for Listing {
|
|||
};
|
||||
|
||||
let account = &context.accounts[self.cursor_pos.account];
|
||||
use crate::conf::accounts::MailboxStatus;
|
||||
match account[&mailbox_hash].status {
|
||||
MailboxStatus::Available | MailboxStatus::Parsing(_, _) => {
|
||||
let (unseen, total) = account[&mailbox_hash]
|
||||
|
@ -2610,7 +2611,7 @@ impl Listing {
|
|||
{
|
||||
if mailboxes[&mailbox_hash].is_subscribed() {
|
||||
match context.accounts[self.accounts[aidx].index][&mailbox_hash].status {
|
||||
crate::conf::accounts::MailboxStatus::Failed(_) => {
|
||||
MailboxStatus::Failed(_) => {
|
||||
lines.push(Line {
|
||||
collapsed,
|
||||
depth,
|
||||
|
|
|
@ -104,7 +104,7 @@ impl Component for AccountStatus {
|
|||
|
||||
for (job_id, req) in a.active_jobs.iter() {
|
||||
width = self.content.size().0;
|
||||
use crate::conf::accounts::JobRequest;
|
||||
use crate::accounts::JobRequest;
|
||||
let (x, y) = write_string_to_grid(
|
||||
&format!("{} {}", req, job_id),
|
||||
&mut self.content,
|
||||
|
|
|
@ -34,7 +34,7 @@ use melib::{
|
|||
use smallvec::SmallVec;
|
||||
|
||||
use super::*;
|
||||
use crate::{conf::accounts::JobRequest, jobs::JobId};
|
||||
use crate::{accounts::JobRequest, jobs::JobId};
|
||||
|
||||
mod utils;
|
||||
pub use utils::*;
|
||||
|
@ -559,7 +559,7 @@ impl Component for MailView {
|
|||
};
|
||||
context.accounts[&account_hash].insert_job(
|
||||
handle.job_id,
|
||||
crate::conf::accounts::JobRequest::Generic {
|
||||
JobRequest::Generic {
|
||||
name: "fetch envelope".into(),
|
||||
handle,
|
||||
on_finish: Some(CallbackFn(Box::new(move |context: &mut Context| {
|
||||
|
|
|
@ -24,7 +24,7 @@ use indexmap::IndexMap;
|
|||
use melib::backends::AccountHash;
|
||||
|
||||
use super::*;
|
||||
use crate::{conf::accounts::MailboxEntry, melib::text_processing::TextProcessing};
|
||||
use crate::{accounts::MailboxEntry, melib::text_processing::TextProcessing};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
enum MailboxAction {
|
||||
|
|
|
@ -926,7 +926,7 @@ impl State {
|
|||
.spawn_blocking("sqlite3::index".into(), job);
|
||||
self.context.accounts[account_index].active_jobs.insert(
|
||||
handle.job_id,
|
||||
crate::conf::accounts::JobRequest::Generic {
|
||||
crate::accounts::JobRequest::Generic {
|
||||
name: "Message index rebuild".into(),
|
||||
handle,
|
||||
on_finish: None,
|
||||
|
|
Loading…
Reference in New Issue