#include "libkita/favoriteboards.h"
#include "kitathreadtabwidget.h"
#include "kitasubjecttabwidget.h"
-#include "kitanavi.h"
#include "libkita/favoritethreads.h"
#include "libkita/kita_misc.h"
m_boardDock->manualDock( m_mainDock, KDockWidget::DockLeft, 20 );
m_subjectDock->manualDock( m_mainDock, KDockWidget::DockTop, 30 );
-
- /* setup kitanavi */
- KitaNavi::createKitaNavi(this,m_threadTab);
}
void KitaMainWindow::closeSubjectView()
static SignalCollection* getInstance();
signals:
- void openURLRequest( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs() );
void writeSucceeded();
void bookmarked( const QString& datURL, bool on );
void favoritesUpdated();
/* to : KitaThreadTabWidget */
void updateThreadTab( const KURL& url );
void closeThreadTab( const KURL& url );
- void closeCurrentThreadTab();
/* to : KitaMainWindow */
+ void openURLRequest( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs() );
void setMainURLLine( const KURL& url );
void setMainCaption( const QString& captionStr );
void setMainStatusbar( const QString& statusStr );
- /* from: KitaMainWindow, KitaNavi, KitaWriteDialog */
- /* to : KitaHTMLPart */
+ /* from: KitaDockWidgetBase, KitaWriteDialog */
+ /* to : KitaHTMLPart */
void windowDeactivated();
void kitaIsActive();
- /* from: KitaHTMLPart */
- /* to : KitaMainWindow, KitaNavi, KitaWriteDialog */
- /* see also KitaHTMLPart::slotOnURL */
+ /* from: KitaHTMLPart */
+ /* to : KitaDockWidgetBase, KitaWriteDialog */
+ /* see also KitaHTMLPart::slotOnURL */
void isKitaActive();
/* to : KitaHTMLPart */
void redrawHTMLPart( const KURL& url, bool force );
void redrawAllHTMLPart( bool force );
void setFontOfHTMLPart();
+
+ /* to : KitaThreadDock */
+ void showKitaNavi( const KURL& , int , int );
+ void showKitaNaviByID( const KURL& , QString );
+ void showKitaNaviByWord( const KURL& , QString);
+ void showKitaNaviByName( const KURL& , QString);
+ void showKitaNaviResTree( const KURL&, int );
+ void showKitaNaviRevResTree( const KURL&, int );
};
}
#include "kitahtmlpart.h"
#include "kitahtmlview.h"
#include "kitadomtree.h"
-#include "kitanavi.h"
#include "libkita/kitaconfig.h"
#include "libkita/datmanager.h"
/* goto anchor */
connect( view(), SIGNAL( pushDown() ), SLOT( slotClickTugi100() ));
+
+ /* kitanavi */
+ connect( this, SIGNAL( showKitaNavi( const KURL& , int , int )),
+ signalCollection, SIGNAL( showKitaNavi( const KURL& , int , int )));
+ connect( this, SIGNAL( showKitaNaviByID( const KURL& , QString )),
+ signalCollection, SIGNAL( showKitaNaviByID( const KURL& , QString )));
+ connect( this, SIGNAL( showKitaNaviByWord( const KURL& , QString)),
+ signalCollection, SIGNAL( showKitaNaviByWord( const KURL& , QString)));
+ connect( this, SIGNAL( showKitaNaviByName( const KURL& , QString)),
+ signalCollection, SIGNAL( showKitaNaviByName( const KURL& , QString)));
+ connect( this, SIGNAL( showKitaNaviResTree( const KURL&, int )),
+ signalCollection, SIGNAL( showKitaNaviResTree( const KURL&, int )));
+ connect( this, SIGNAL( showKitaNaviRevResTree( const KURL&, int )),
+ signalCollection, SIGNAL( showKitaNaviRevResTree( const KURL&, int )));
}
break;
case ID_Extract:
- KitaNavi::showKitaNaviByWord( m_datURL, selectedText() );
+ emit showKitaNaviByWord( m_datURL, selectedText() );
break;
case ID_Search_Google:
if ( !refNum ) return ;
- if( m_pushctrl || m_pushmidbt ) KitaNavi::showKitaNavi( m_datURL, refNum, refNum2 );
+ if( m_pushctrl || m_pushmidbt ) emit showKitaNavi( m_datURL, refNum, refNum2 );
else if( ( m_mode == HTMLPART_MODE_KHTML || m_mode == HTMLPART_MODE_POPUP )
|| ( m_mode == HTMLPART_MODE_NAVI && !m_domtree->isResShown( refNum ) ) )
{
/* open kitanavi */
else if( m_pushctrl | m_pushmidbt )
{
- KitaNavi::showKitaNaviResTree(m_datURL,resNum);
+ emit showKitaNaviResTree(m_datURL,resNum);
return;
}
case WRITEMENU_SHOWNAVI:
- KitaNavi::showKitaNavi( m_datURL, resNum, resNum);
+ emit showKitaNavi( m_datURL, resNum, resNum);
break;
case WRITEMENU_RESTREE:
- KitaNavi::showKitaNaviResTree( m_datURL, resNum);
+ emit showKitaNaviResTree( m_datURL, resNum);
break;
case WRITEMENU_REVERSERESTREE:
- KitaNavi::showKitaNaviRevResTree( m_datURL, resNum );
+ emit showKitaNaviRevResTree( m_datURL, resNum );
break;
case WRITEMENU_EXTRACTNAME:
- KitaNavi::showKitaNaviByName( m_datURL, namestr );
+ emit showKitaNaviByName( m_datURL, namestr );
break;
case WRITEMENU_ABONENAME:
}
/* open kitanavi when user pushed Ctrl+Left or Mid button. */
- else if( m_pushctrl | m_pushmidbt ) KitaNavi::showKitaNaviByID( m_datURL, strid );
+ else if( m_pushctrl | m_pushmidbt ) emit showKitaNaviByID( m_datURL, strid );
else
{
{
case IDMENU_EXTRACT:
- KitaNavi::showKitaNaviByID( m_datURL, strid );
+ emit showKitaNaviByID( m_datURL, strid );
break;
case IDMENU_ABONE:
/* res popup */
void hideChildPopup();
void isKitaActive();
+
+ /* kita navi */
+ void showKitaNavi( const KURL& , int , int );
+ void showKitaNaviByID( const KURL& , QString );
+ void showKitaNaviByWord( const KURL& , QString);
+ void showKitaNaviByName( const KURL& , QString);
+ void showKitaNaviResTree( const KURL&, int );
+ void showKitaNaviRevResTree( const KURL&, int );
};
emit completed();
}
-void KitaThreadPart::guiActivateEvent ( KParts::GUIActivateEvent* event )
+void KitaThreadPart::partActivateEvent ( KParts::PartActivateEvent* event )
{
- //KParts::ReadOnlyPart::guiActivateEvent( event );
if ( event->activated() )
{
- m_threadview->showStatusBar( QString::null );
+ m_threadview->setFocus();
}
}
protected:
virtual bool openFile() { return false; };
- virtual void guiActivateEvent ( KParts::GUIActivateEvent *event );
+ virtual void partActivateEvent ( KParts::PartActivateEvent *event );
protected slots:
void slotOpenURLResult();
#include "kitahtmlpart.h"
#include "kitawritedialog.h"
#include "kita2ch.h"
-#include "kitanavi.h"
#include "libkita/kitaconfig.h"
#include "libkita/kita-utf8.h"
connect( this, SIGNAL( closeThreadTab( const KURL& ) ),
signalCollection, SIGNAL( closeThreadTab( const KURL& ) ));
- m_viewmode = VIEWMODE_PARENT;
+ /* Kita Navi */
+ connect( this, SIGNAL( showKitaNaviByWord( const KURL& , QString)),
+ signalCollection, SIGNAL( showKitaNaviByWord( const KURL& , QString)));
+
+ m_viewmode = VIEWMODE_MAINVIEW;
m_rescode = 200;
m_serverTime = 0;
m_datURL = QString::null;
+
}
KitaThreadView::~KitaThreadView()
return Kita::DatManager::threadURL( m_datURL );
}
+const KURL KitaThreadView::datURL() const
+{
+ return m_datURL;
+}
+
void KitaThreadView::slotDOMNodeActivated( const DOM::Node& node )
{
{ //process Anchor tags. Anchor tags not proccessed here cause 'emit KParts::BrowserExtention::openURLRequest()'
if ( ! SearchCombo->hasFocus() ) {
SearchCombo->setFocus();
} else {
- m_threadPart->view()->setFocus();
+ setFocus();
}
}
+/* public slot */ /* virtual */
+void KitaThreadView::setFocus()
+{
+ showStatusBar( QString::null );
+ m_threadPart->view()->setFocus();
+}
+
namespace Kita
{
void KitaThreadView::showThread( const KURL& datURL, int num )
{
/* If this widget is not parent, then do nothing. */
- if ( m_viewmode != VIEWMODE_PARENT ) return ;
-
+ if ( m_viewmode != VIEWMODE_MAINVIEW ) return ;
+
if ( topLevelWidget() ->isMinimized() ) topLevelWidget() ->showNormal();
topLevelWidget() ->raise();
setActiveWindow();
/* setup */
- setup( datURL, VIEWMODE_PARENT );
+ setup( datURL, VIEWMODE_MAINVIEW );
/* get log from cahce */
m_rescode = 200;
{
int totalNum = 0, datSize = 0;;
bool broken = FALSE;
+ QString captionStr = QString::null;
QString infostr = QString::null;
QString errstr = QString::null;
int kokoyonNum = Kita::DatManager::getKokoyonNum(m_datURL);
switch( m_viewmode )
{
- case VIEWMODE_PARENT:
+ case VIEWMODE_MAINVIEW:
+ if ( !m_datURL.isEmpty() ){
totalNum = Kita::DatManager::getReadNum(m_datURL);
broken = Kita::DatManager::isBroken(m_datURL);
datSize = Kita::DatManager::getDatSize(m_datURL);
errstr = QString( "Error %1" ).arg( m_rescode );
if ( broken ) info += " This thread is broken.";
- /* show status bar */
+ /* show status bar,caption, url */
infostr = Kita::DatManager::threadName( m_datURL ) +
QString( " [Total: %1 New: %2] %3 k" ).arg( totalNum ).arg( totalNum - kokoyonNum ).arg( datSize / 1024 )
+ info + " " + errstr;
+ captionStr = Kita::DatManager::thread_name( m_datURL )
+ + QString( " (%1)" ).arg( Kita::DatManager::getReadNum( m_datURL ) );
+ }
+
+ emit setMainCaption( captionStr );
emit setMainStatusbar( infostr );
emit setMainURLLine( Kita::DatManager::threadURL( m_datURL ) );
+ QString( " (%1)" )
.arg( Kita::DatManager::getReadNum(m_datURL) ),
Kita::DatManager::thread_boardURL( m_datURL ) );
- emit setMainURLLine( Kita::DatManager::thread_url(m_datURL) );
updateButton();
gotoCombo->clear();
emit updateSubjectTab( m_datURL );
emit updateThreadTab( m_datURL );
- QString captionStr = Kita::DatManager::thread_name( m_datURL )
- + QString( " (%1)" ).arg( Kita::DatManager::getReadNum( m_datURL ) );
- emit setMainCaption( captionStr );
showStatusBar( "" );
emit showThreadCompleted(); /* to KitaThreadPart */
else if(str.at(0) == '?')
{
QString query = str.mid(1);
- KitaNavi::showKitaNaviByWord(m_datURL,query);
+ emit showKitaNaviByWord( m_datURL, query );
return;
}
/* if this is parent, then show all responses, and search */
- if ( m_viewmode == VIEWMODE_PARENT ) m_threadPart->showAll();
+ if ( m_viewmode == VIEWMODE_MAINVIEW ) m_threadPart->showAll();
slotSearchPrivate( FALSE );
}
if( str.at(0) == '?' ) return;
/* if this is parent, then show all responses, and search */
- if ( m_viewmode == VIEWMODE_PARENT ) m_threadPart->showAll();
+ if ( m_viewmode == VIEWMODE_MAINVIEW ) m_threadPart->showAll();
insertSearchCombo();
QStringList list = parseSearchQuery( SearchCombo->currentText() );
if( m_datURL.isEmpty() ) return;
int rescode = Kita::DatManager::getResponseCode( m_datURL );
- int readNum = Kita::DatManager::getReadNum( m_datURL );
if( ( rescode != 200 && rescode != 206)
|| FavoriteThreads::getInstance()->contains( m_datURL.prettyURL() ) ) {
if( QMessageBox::warning( this,
/* mode , m_viewmode uses them. */
enum{
- VIEWMODE_PARENT,
+ VIEWMODE_MAINVIEW,
VIEWMODE_KITANAVI
};
~KitaThreadView();
const QString threadName() const;
const KURL threadURL() const;
+ const KURL datURL() const;
void setup( const KURL& datURL, int mode );
void showStatusBar( QString info );
void domApplyChange( QString lbstr, QString hstr, QString fstr, QString anchor, QString cmbstr );
public slots:
+ virtual void setFocus();
+
void subjectlinkClicked(const QString& URL );
void subjectlinkMClicked( const QString &URL );
void showThread( const KURL& datURL, int num );
void openBoardRequested( const QString& URL, bool useTab );
void showThreadCompleted(); /* to KitaThreadPart */
void closeThreadTab( const KURL& url );
+
+ /* kita navi */
+ void showKitaNaviByWord( const KURL& , QString);
};
namespace Kita