OSDN Git Service

open with background
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 1 May 2005 16:23:32 +0000 (16:23 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 1 May 2005 16:23:32 +0000 (16:23 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1717 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/board/boardview.cpp
kita/src/board/threadlistview.cpp
kita/src/libkita/signalcollection.h
kita/src/mainwindow.cpp
kita/src/thread/threadtabwidget.cpp
kita/src/thread/threadtabwidget.h

index ab6aab4..f9177f5 100644 (file)
@@ -350,7 +350,6 @@ void KitaBoardView::updateListViewItem( QListViewItem* item, Kita::Thread* threa
     }
 }
 
-
 void KitaBoardView::slotContextMenuRequested( QListViewItem* item, const QPoint& point, int )
 {
     enum {
@@ -360,6 +359,7 @@ void KitaBoardView::slotContextMenuRequested( QListViewItem* item, const QPoint&
         Menu_CopyTitleAndURL,
         Menu_Favorites,
         Menu_DeleteLog,
+        Menu_OpenByBackground,
         Menu_Property
     };
 
@@ -386,6 +386,7 @@ void KitaBoardView::slotContextMenuRequested( QListViewItem* item, const QPoint&
         popup.insertSeparator();
         popup.insertItem( i18n( "Delete Log" ), Menu_DeleteLog );
     }
+    popup.insertItem( i18n( "Open by background" ), Menu_OpenByBackground );
 
     popup.insertSeparator();
     popup.insertItem( i18n( "Property" ), Menu_Property );
@@ -418,6 +419,9 @@ void KitaBoardView::slotContextMenuRequested( QListViewItem* item, const QPoint&
     case Menu_DeleteLog:
         deleteLog( threadURL );
         break;
+    case Menu_OpenByBackground:
+        emit openURLRequestExt( datURL, KParts::URLArgs(), "kita_open_2chthread", 2 );
+        break;
     case Menu_Property: {
             // FIXME: memory leak
             Kita::ThreadProperty* propertyWidget = new Kita::ThreadProperty( 0 );
index d4b6d2e..20db35a 100644 (file)
@@ -184,7 +184,7 @@ void ThreadListView::slotMouseButtonClicked( int button, QListViewItem* item )
 
     switch ( button ) {
     case MidButton:
-        emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
+        emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 2 );
         break;
     case LeftButton:
         if ( KitaConfig::alwaysUseTab() ) {
index 1ed0a59..83b4d06 100644 (file)
@@ -47,6 +47,7 @@ namespace Kita
          *     QString::null : use KIO::NetAccess::mimetype to decide mime type of url.
          * @param usr1
          *     1: open with tab(board, thread), image viewer is not hidden.
+         *     2: open by background(thread).
          * @param usrUrl1 dat's URL(image viewer only)
          *
          */
index 550dab4..c648344 100644 (file)
@@ -817,8 +817,9 @@ void KitaMainWindow::slotOpenURLRequestExt(
     /* open 2ch thread */
     /* if usr1 == 1, open the thread with new tab. */
     if ( mimetype == "kita_open_2chthread" ) {
-        bool withNewTab = ( usr1 == 1 );
-        m_threadDock->slotShowThread( url, withNewTab );
+        bool withNewTab = ( usr1 == 1 || usr1 == 2 );
+        bool byBackground = ( usr1 == 2 );
+        m_threadDock->slotShowThread( url, withNewTab, byBackground );
         return ;
     }
 
index 71e1b84..c32baa4 100644 (file)
@@ -57,7 +57,7 @@ KitaThreadTabWidget::~KitaThreadTabWidget() {}
 
 
 /* show "Main thread" view */  /* public slots */
-void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab )
+void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab, bool byBackground )
 {
     QString refstr;
     KURL datURL = Kita::ParseMisc::parseURL( url, refstr );
@@ -88,6 +88,7 @@ void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab )
         else view->slotReloadButton( jumpNum );
 
     } else if ( withNewTab
+                || byBackground
                 || currentView == NULL           /* Current page is not KitaThreadView. */
                 || viewMode != VIEWMODE_MAINVIEW /* Current page is KitaThreadView, but not Main View. */
               ) {
@@ -96,7 +97,9 @@ void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab )
 
         if ( newView ) {
             newView->showThread( datURL, jumpNum );
-            showPage( newView );
+            if ( ! byBackground ) {
+                showPage( newView );
+            }
         }
     } else static_cast<KitaThreadView *>( currentPage() ) ->showThread( datURL, jumpNum );
 
@@ -759,11 +762,11 @@ KitaThreadTabWidget* KitaThreadDock::setupAsMainView()
 }
 
 /* public slot */
-void KitaThreadDock::slotShowThread( const KURL& url, bool withNewTab )
+void KitaThreadDock::slotShowThread( const KURL& url, bool withNewTab, bool byBackground )
 {
     showDock();
 
-    if ( m_threadTab ) m_threadTab->slotShowMainThread( url, withNewTab );
+    if ( m_threadTab ) m_threadTab->slotShowMainThread( url, withNewTab, byBackground );
 }
 
 
index 1a86c12..8b68b4d 100644 (file)
@@ -49,7 +49,7 @@ public:
     ~KitaThreadTabWidget();
 
 public slots:
-    void slotShowMainThread( const KURL& datURL, bool withNewTab );
+    void slotShowMainThread( const KURL& datURL, bool withNewTab, bool byBackground );
     void slotShowKitaNavi( int mode, const KURL& datURL, const QString& query, int startnum, int endnum );
     void slotCloseThreadTab( const KURL& url );
 
@@ -131,7 +131,7 @@ public:
     KitaThreadTabWidget* setupAsMainView();
 
 public slots:
-    void slotShowThread( const KURL& datURL, bool withNewTab );
+    void slotShowThread( const KURL& datURL, bool withNewTab, bool byBackground = false );
 
 
     /* Kita Navi */