resdat.anclist.clear();
resdat.checkAbone = FALSE;
resdat.abone = FALSE;
+ resdat.isResponsed = FALSE;
}
/* get subject */
if( num == 1 ) parseDat( num );
+ /* search all responses which are responsed by this line. */
+ if( KitaConfig::checkResponsed() ){
+
+ if ( parseDat( num ) && !checkAbonePrivate( num ) ){ /* parse line here to get AncList */
+
+ const int maxRange = 10;
+
+ AncList& anclist = m_resDatVec[ num ].anclist;
+ for ( AncList::iterator it = anclist.begin(); it != anclist.end(); ++it ) {
+
+ int fromNum = ( *it ).from;
+ int toNum = QMIN( num - 1, ( *it ).to );
+ if( toNum - fromNum +1 > maxRange ) continue;
+
+ for( int i = fromNum; i <= toNum; ++i ){
+
+ if( !checkAbonePrivate( i ) ) m_resDatVec[ i ].isResponsed = TRUE;
+ }
+ }
+ }
+ }
+
return TRUE;
}
/* public */
+const bool DatInfo::isResponsed( int num ) const
+{
+ return m_resDatVec[ num ].isResponsed;
+}
+
+
+/* public */
bool DatInfo::isResValid( int num )
{
QMutexLocker locker( &m_mutex );
bool checkAbone; /* Is abone checked ? */
bool abone;
+
+ /* Is this res responsed by other one? */
+ bool isResponsed;
};
typedef QValueVector<RESDAT> ResDatVec;
int getDatSize();
/* several informations */
+ const bool isResponsed ( int num ) const;
bool isResValid( int num );
bool isBroken();
bool isResBroken( int num );
m_partMimeList( KitaConfig::defaultPartMimeList() ),
m_userID( KitaConfig::defaultUserID() ),
m_password( KitaConfig::defaultPassword() ),
+ m_checkResponsed( KitaConfig::defaultCheckResponsed() ),
m_autoLogin( KitaConfig::defaultAutoLogin() )
{}
config->writeEntry( "UseStyleSheet", KitaConfig::useStyleSheet() );
config->writeEntry( "PartMimeList", KitaConfig::partMimeList() );
config->writeEntry( "AboneChain", KitaConfig::aboneChain() );
+ config->writeEntry( "CheckResponsed", KitaConfig::checkResponsed() );
config->setGroup( "Color" );
config->writeEntry( "Thread", KitaConfig::threadColor() );
KitaConfig::setUseKitaNavi( config->readBoolEntry( "UseKitaNavi", KitaConfig::defaultUseKitaNavi() ) );
KitaConfig::setUseStyleSheet( config->readBoolEntry( "UseStyleSheet", KitaConfig::defaultUseStyleSheet() ) );
KitaConfig::setAboneChain( config->readBoolEntry( "AboneChain", KitaConfig::defaultAboneChain() ) );
+ KitaConfig::setCheckResponsed( config->readBoolEntry( "CheckResponsed", KitaConfig::defaultCheckResponsed() ) );
{
// MIME list
QStringList mimeList = config->readListEntry( "PartMimeList" );
"body,\n"
"body.pop {\n"
"}\n"
+
+ "a.coloredLink:link\n"
+ "{\n"
+ " color: magenta;"
+ "}\n"
"div.res_title,\n"
"div.pop_res_title {\n"
QString m_userID;
QString m_password;
bool m_autoLogin;
+ bool m_checkResponsed;
KitaConfig();
virtual ~KitaConfig();
static bool autoLogin() { return getInstance() ->m_autoLogin; }
static void setAutoLogin( bool value ) { getInstance() ->m_autoLogin = value; }
static bool defaultAutoLogin() { return false; }
+
+ static bool checkResponsed() { return getInstance() ->m_checkResponsed; }
+ static void setCheckResponsed( bool value ) { getInstance() ->m_checkResponsed = value; }
+ static bool defaultCheckResponsed() { return true; }
};
#endif
m_bodyElm.resize( m_bufLng );
m_resshown.resize( m_bufLng, FALSE );
m_resStatus.resize( m_bufLng, KITA_HTML_NOTPARSED );
+ m_coloredNum.resize( m_bufLng, FALSE );
}
/* cleate elements */
}
+/* change color of number of the res which is responsed. */
+/* See also KitaDomTree::changeColorOfNumber() ,
+ DatInfo::copyOneLineToResDat(),
+ and DatInfo::collectResponsedRes(). */ /* public */
+void KitaDomTree::changeColorOfAllResponsedNumber()
+{
+ for( int i = 1; i <= m_bottomNum; ++i ){
+
+ if( m_resshown[ i ] && m_datInfo->isResponsed( i ) ) changeColorOfNumber( i );
+ }
+}
+
+
+
/*-----------------------------------------------------------------*/
/* public information */
m_mae100 = rootnode;
}
+
+/* change color of number */
+/*
+ specify color like this: "a.coloredLink:link{ color: red; }" */ /* private */
+
+void KitaDomTree::changeColorOfNumber( int num )
+{
+ if ( ! m_datInfo ) return ;
+ if ( m_hdoc == NULL ) return ;
+ if ( m_coloredNum[ num ] ) return;
+ if ( !m_resshown[ num ] ) return;
+
+ m_coloredNum[ num ] = TRUE;
+ DOM::Node node = m_titleElm[ num ];
+ node = node.firstChild();
+ while( node.nodeName().string() != "a" ) node = node.firstChild(); /* table tag is used. */
+
+ static_cast< DOM::HTMLElement> ( node ).setAttribute( "class", "coloredLink" );
+}
int m_headerMaxNum;
QValueVector < bool > m_resshown; /* the res is shown */
QValueVector < int > m_resStatus; /* return val of DatInfo::getHTML(). See datinfo.h */
+ QValueVector < bool > m_coloredNum; /* colored number */
/* DOM elements */
DOM::HTMLDocument m_hdoc; /* root node of document*/
bool createResElement( int num );
bool appendRes( int num );
void redraw( bool force );
+ void changeColorOfAllResponsedNumber();
/* information */
void createKokoyon();
void createTugi100();
void createMae100();
+ void changeColorOfNumber( int num );
};
m_domtree->appendFooterAndHeader();
}
+ /* change color of number of the res which is responsed. */
+ if ( m_mode == HTMLPART_MODE_MAINPART || m_mode == HTMLPART_MODE_NAVI ) {
+
+ if( KitaConfig::checkResponsed() ) m_domtree->changeColorOfAllResponsedNumber();
+ }
+
/*----------------------------*/
/* update display */