connect( signalCollection, SIGNAL( setMainURLLine( const KURL& ) ),
SLOT( setUrl( const KURL& ) ) );
- connect( signalCollection, SIGNAL( openBoardRequested( const QString&, bool ) ),
- SLOT( switchSubjectView( const QString&, bool ) ) );
+ connect( signalCollection, SIGNAL( switchSubjectView() ),
+ SLOT( slotSwitchSubjectView() ));
+ connect( this, SIGNAL( switchSubjectView() ),
+ signalCollection, SIGNAL( switchSubjectView() ));
+
connect( m_subjectTab, SIGNAL( showThreadRequested( const QString&, bool ) ),
SLOT( switchThreadView( const QString&, bool ) ) );
connect( signalCollection, SIGNAL( writeSucceeded() ),
SLOT( slotWriteSucceeded() ) );
- connect( m_threadTab, SIGNAL( sigHideSubject() ),
- SLOT( hideSubject() ) );
-
connect( m_threadTab->manager(), SIGNAL( activePartChanged( KParts::Part* ) ),
SLOT( createGUI( KParts::Part* ) ) );
- connect( m_boardView, SIGNAL( sigShowSubject() ),
- SLOT( showSubject() ) );
-
connect( m_subjectTab, SIGNAL( loadBoardCompleted( const KURL& ) ),
SLOT( setUrl( const KURL& ) ) );
config->writeEntry( "ThreadFont", KitaConfig::threadFont() );
config->writeEntry( "ShowMailAddress", KitaConfig::showMailAddress() );
config->writeEntry( "MarkTime", KitaConfig::MarkTime() );
- config->writeEntry( "ViewMode", KitaConfig::viewMode() );
config->writeEntry( "SortOrder", KitaConfig::sortOrder() );
config->writeEntry( "AlwaysUseTab", KitaConfig::alwaysUseTab() );
config->writeEntry( "ShowAA", KitaConfig::showAA() );
m_subjectDock->manualDock( m_mainDock, KDockWidget::DockTop, 30 );
}
-void KitaMainWindow::hideSubject()
-{
- if ( KitaConfig::viewMode() != KitaConfig::View_2pane ) return ;
- if ( !m_subjectDock->isDockBackPossible() )
- if ( m_subjectDock->mayBeHide() )
- m_subjectListAction->activate();
-}
-
-void KitaMainWindow::showSubject()
-{
- if ( KitaConfig::viewMode() != KitaConfig::View_2pane ) return ;
- if ( m_subjectDock->mayBeShow() )
- m_subjectListAction->activate();
-}
void KitaMainWindow::windowToggleView()
{
//FIXME: m_subjectDock->dockSite() & KDockWidget::DockCenter != 0 °Ê³°¤Î¤È¤¤Ï¤É¤¦¤¹¤ë¡©
kdDebug() << "Do toggle" << endl;
- if ( !m_subjectListAction->isChecked() || (m_subjectDock->dockSite() & KDockWidget::DockCenter == 0) ) return;
- KDockWidget *w = m_subjectDock->isVisible() ? m_mainDock : m_subjectDock;
+ if ( !m_subjectListAction->isChecked() ) return;
+ if( !m_subjectDock->isVisible()
+ || !m_subjectDock->isActiveWindow() ) emit switchSubjectView();
+ else{
+ KDockWidget *w = m_mainDock;
kdDebug() << QString( "toggle target: %1" ).arg( w->name() ) << endl;
w->makeDockVisible();
w->getWidget()->setFocus();
+ }
}
void KitaMainWindow::windowMenuAboutToShow()
}
}
-void KitaMainWindow::switchSubjectView( const QString&, bool )
+void KitaMainWindow::slotSwitchSubjectView()
{
if ( m_subjectListAction->isChecked() )
m_subjectDock->makeDockVisible();
void settingsMenuAboutToShow();
void slotEditCopy();
void resetWindows();
- void hideSubject();
- void showSubject();
void closeSubjectView();
void closeBoardView();
void bookmark( const QString& datURL, bool on );
void slotSetMainCaption( const QString& captionStr );
void slotIsKitaActive();
- void switchSubjectView( const QString&, bool );
+ void slotSwitchSubjectView();
void switchThreadView( const QString&, bool );
private:
void isKitaActive();
void kitaIsActive();
void favoritesUpdated();
+ void switchSubjectView();
};
#endif // _KITA_H_
SLOT( deleteView( KitaSubjectView* ) ) );
connect( signalCollection, SIGNAL( openBoardRequested( const QString&, bool ) ),
SLOT( loadBoard( const QString&, bool ) ) );
+ connect( this, SIGNAL( switchSubjectView() ),
+ signalCollection, SIGNAL( switchSubjectView() ) );
+ connect( signalCollection, SIGNAL( switchSubjectView() ),
+ SLOT( slotSwitchSubjectView() ));
}
KitaSubjectTabWidget::~KitaSubjectTabWidget()
void KitaSubjectTabWidget::loadBoard( const QString& boardURL, bool withNewTab )
{
+ emit switchSubjectView();
KitaSubjectView * view = findView( boardURL );
QString boardName = Kita::Board::getName( boardURL );
if ( view )
showPage( m_latestView );
}
+/* private slot */
+void KitaSubjectTabWidget::slotSwitchSubjectView()
+{
+ m_latestView->setFocusList();
+}
+
void KitaSubjectTabWidget::connectSignals( Kita::ThreadListView* view )
{
connect( view, SIGNAL( showThreadRequested( const QString&, bool ) ),
else
{
m_latestView = static_cast<KitaSubjectView*>( widget );
+ m_latestView->setFocusList();
}
}
private slots:
void slotCurrentChanged( QWidget* widget );
void deleteView( KitaSubjectView* view );
+ void slotSwitchSubjectView();
signals:
void showThreadRequested( const QString&, bool withNewTab );
void loadBoardCompleted( const KURL& );
+ void switchSubjectView();
};
namespace Kita
UpdateKindLabel();
}
+/* public */
+void KitaSubjectView::setFocusList()
+{
+ setActiveWindow();
+ topLevelWidget()->raise();
+ subjectList->setFocus();
+}
+
+
void KitaSubjectView::UpdateKindLabel()
{
QString fmtstr;
~KitaSubjectView();
const QString boardURL();
const QString boardName();
+ void setFocusList();
public slots:
void reloadSubject();
}
if( num == 0 ) num = Kita::DatManager::getKokoyonNum( datURL );
- emit sigHideSubject();
-
KitaThreadView * view = findView( Kita::DatManager::threadURL( datURL ) );
if ( view ) {
setCurrentPage( indexOf( view ) );
signalCollection, SIGNAL( setMainStatusbar( const QString& ) ) );
connect( this, SIGNAL( setMainCaption( const QString& ) ),
signalCollection, SIGNAL( setMainCaption( const QString& ) ) );
+ connect( this, SIGNAL( switchSubjectView() ),
+ signalCollection, SIGNAL( switchSubjectView() ));
connect( signalCollection, SIGNAL( updateThreadTab( const KURL& ) ),
this, SLOT( slotUpdateThreadTab( const KURL& ) ) );
connect( signalCollection, SIGNAL( closeCurrentThreadTab() ),
showPage( view );
emit setMainStatusbar( "" );
emit setMainCaption( "" );
+ emit switchSubjectView();
}
}
}
signals:
void setMainStatusbar( const QString& );
void setMainCaption( const QString& );
- void sigHideSubject();
+ void switchSubjectView();
};
class KitaThreadTabBar : public QTabBar
void openURLRequest( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs() );
void writeSucceeded();
void bookmarked( const QString& datURL, bool on );
- void openBoardRequested( const QString& boardURL, bool withNewTab );
void favoritesUpdated();
+ /* to: KitaMainWindow, KitaSubjectTabWidget */
+ void switchSubjectView();
+
+ /* to : KitaSubjectTabWidget */
+ void openBoardRequested( const QString& boardURL, bool withNewTab );
+
/* to : KitaSubjectView, FavoriteListView */
void updateSubjectTab( const KURL& url );