}
}
-
void KitaBoardView::slotContextMenuRequested( QListViewItem* item, const QPoint& point, int )
{
enum {
Menu_CopyTitleAndURL,
Menu_Favorites,
Menu_DeleteLog,
+ Menu_OpenByBackground,
Menu_Property
};
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 );
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 );
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() ) {
* 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)
*
*/
/* 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 ;
}
/* 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 );
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. */
) {
if ( newView ) {
newView->showThread( datURL, jumpNum );
- showPage( newView );
+ if ( ! byBackground ) {
+ showPage( newView );
+ }
}
} else static_cast<KitaThreadView *>( currentPage() ) ->showThread( datURL, jumpNum );
}
/* 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 );
}
~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 );
KitaThreadTabWidget* setupAsMainView();
public slots:
- void slotShowThread( const KURL& datURL, bool withNewTab );
+ void slotShowThread( const KURL& datURL, bool withNewTab, bool byBackground = false );
/* Kita Navi */