OSDN Git Service

>>976, add actions
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Thu, 15 Jul 2004 15:08:54 +0000 (15:08 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Thu, 15 Jul 2004 15:08:54 +0000 (15:08 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1248 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/part/kitathreadpart.cpp
kita/src/part/kitathreadview.cpp
kita/src/part/kitathreadview.h
kita/src/part/kitathreadviewui.rc

index dcfa79f..e74dbc0 100644 (file)
@@ -74,6 +74,39 @@ void KitaThreadPart::setupActions()
                  SLOT( focusSearchCombo() ),
                  actionCollection(),
                  "threadview_find" );
+    KStdAction::findNext( m_threadview,
+                     SLOT( slotSearchNext() ),
+                     actionCollection(),
+                     "threadview_findnext");
+
+    KStdAction::findPrev( m_threadview,
+                     SLOT( slotSearchPrev() ),
+                     actionCollection(),
+                     "threadview_findprev");
+
+    new KAction( i18n( "go back anchor" ),
+                "2leftarrow",
+                Key_Backspace,
+                m_threadview,
+                SLOT( slotGobackAnchor() ),
+                actionCollection(),
+                "threadview_goback" );
+
+    new KAction( i18n( "Start" ),
+                "up",
+                Key_Home,
+                m_threadview,
+                SLOT( slotGotoHeader() ),
+                actionCollection(),
+                "threadview_gotoheader" );    
+    
+    new KAction( i18n( "End" ),
+                "down",
+                Key_End,
+                m_threadview,
+                SLOT( slotGotoFooter() ),
+                actionCollection(),
+                "threadview_gotofooter" );    
 
     new KAction( i18n( "Reload" ),
                  "reload",
index 8b4e2c4..493693b 100644 (file)
@@ -701,11 +701,39 @@ void KitaThreadView::slotSearchButton()
     /* if this is parent, then show all responses, and search */
     if ( m_viewmode == VIEWMODE_PARENT ) m_threadPart->showAll();
 
-    insertSearchCombo();
+    slotSearchPrivate( FALSE );
+}
+
+/* public slot */
+void KitaThreadView::slotSearchNext(){ slotSearchPrivate( FALSE ); }
+void KitaThreadView::slotSearchPrev(){ slotSearchPrivate( TRUE ); }
+
+/* private */
+void KitaThreadView::slotSearchPrivate( bool rev )
+{
+    if ( m_datURL.isEmpty() ) return ; /* Nothing is shown on the screen.*/
+
+    /* jump */
+    QString str = SearchCombo->currentText();
+    if( str == QString::null ) return;
+    if( str == "" ) return;
+    if( str.at( 0 ) == ':' ) return;
+    if( str.at(0) == '?' ) return;
+
+    /* if this is parent, then show all responses, and search */
+    if ( m_viewmode == VIEWMODE_PARENT ) m_threadPart->showAll();
+
+    insertSearchCombo();    
     QStringList list = parseSearchQuery( SearchCombo->currentText() );
-    m_threadPart->findText( SearchCombo->currentText(), m_revsearch );
+    m_threadPart->findText( SearchCombo->currentText(), rev );
     SearchCombo->setFocus();
 }
+
+/* public slot */
+void KitaThreadView::slotGobackAnchor(){ m_threadPart->slotGobackAnchor(); }
+void KitaThreadView::slotGotoHeader(){ m_threadPart->gotoAnchor( "header", FALSE );}
+void KitaThreadView::slotGotoFooter(){ m_threadPart->slotClickGotoFooter(); }
+
 // vim:sw=2:
 
 void KitaThreadView::slotComboActivated( int index )
index 0de0f12..9e7d667 100644 (file)
@@ -79,6 +79,11 @@ public slots:
     void slotStopLoading();        
     void focusSearchCombo();
     void slotDeleteButtonClicked();    
+    void slotSearchNext();
+    void slotSearchPrev();
+    void slotGobackAnchor();
+    void slotGotoHeader();
+    void slotGotoFooter();
     
 protected slots:
     void slotDOMNodeActivated( const DOM::Node& node );
@@ -115,6 +120,7 @@ private slots:
     void slotShowErrorDialog( const QString& input, const KURL& urlOfInput = 0 );
     void slotComboActivated( int index );
     void slotUpdateInfo();
+    void slotSearchPrivate( bool rev );    
 
 signals:
     void datURLRedirected( const KURL& newDatURL );
index a1b0c62..4ea2e47 100644 (file)
@@ -3,11 +3,17 @@
 <MenuBar>
   <Menu name="thread"><text>&amp;Thread</text>
     <Separator/>
+    <Action name="threadview_goback" />
+    <Action name="threadview_gotoheader" />
+    <Action name="threadview_gotofooter" />
+    <Separator/>
     <Action name="threadview_reload" />
     <Action name="threadview_stop" />
     <Action name="threadview_delete" />
     <Separator/>
     <Action name="threadview_find" />
+    <Action name="threadview_findnext" />
+    <Action name="threadview_findprev" />
   </Menu>
 </MenuBar>
 </kpartgui>