connect( m_boardList, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ),
SLOT( slotContextMenuRequested( QListViewItem*, const QPoint&, int ) ) );
connect( Kita::FavoriteBoards::getInstance(), SIGNAL( changed() ), SLOT( refreshFavoriteBoards() ) );
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
connect( SearchCombo, SIGNAL( textChanged( const QString& ) ),
SLOT( filter( const QString& ) ) );
}
private:
void loadExtBoard();
bool downloadBoardList();
-
-signals:
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
};
#endif
connect( view(), SIGNAL( horizontalSliderReleased() ), SLOT( slotHSliderReleased() ) );
connect( signalCollection, SIGNAL( windowDeactivated() ), SLOT( slotHideChildPopup() ) );
-
- /* click */
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
}
if ( !m_domtree ) return FALSE;
if ( m_mode != HTMLPART_MODE_MAINPART ) {
/* If this is not MainPart, then open MainPart. */
- emit openURLRequestExt( m_datURL );
+ ViewMediator::getInstance()->openURL( m_datURL );
return FALSE;
}
}
/* right click */
- emit openURLRequestExt( urlin );
+ ViewMediator::getInstance()->openURL( urlin );
return ;
}
if ( !refNum ) return ;
if ( m_mode == HTMLPART_MODE_POPUP ) {
- emit openURLRequestExt( urlin );
+ ViewMediator::getInstance()->openURL( urlin );
} else {
gotoAnchor( QString().setNum( refNum ), TRUE );
}
signals:
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
void mousePressed(); /* to KitaThreadView */
/* cache */
/* private */
void KitaTabWidgetBase::connectSignals()
{
- /* connect signals */
- Kita::SignalCollection * signalCollection = Kita::SignalCollection::getInstance();
-
connect( this, SIGNAL( currentChanged ( QWidget * ) ),
SLOT( slotCurrentChanged ( QWidget * ) ) );
-
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
}
void slotCloseRightTab( int idx = -1 );
void slotCloseLeftTab( int idx = -1 );
void slotCloseAllTab();
-
-signals:
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
};
static SignalCollection* getInstance();
signals:
- /**
- *
- * @param url URL to open.
- * @param args arguments of URL. @see KParts::URLArgs
- * @param mimetype MIME Type to open.
- * "text/html" : open url with web browser.
- * 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)
- *
- */
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
-
- /*--------------------------------*/
-
/* from: KitaDockWidgetBase */
/* to : KitaHTMLPart */
/* see also KitaHTMLPart::slotOnURL */
// allow the view to change the statusbar and caption
Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
- connect( signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- SLOT( slotOpenURLRequestExt( const KURL&, const QString ) ) );
-
connect( m_urlLine, SIGNAL( returnPressed() ),
SLOT( slotURLLine() ) );
}
}
-/* open url */
-/*
- If mimetype == "text/html", open url with web browser.
- if mimetype == QString::null, use KIO::NetAccess::mimetype to decide mime type of url.
-
-*/ /* public slot */
-void KitaMainWindow::slotOpenURLRequestExt( const KURL& url, const QString mimetype )
-{
- /* open url with web browser, etc. */
- if ( mimetype != QString::null ) {
- KRun::runURL( url, mimetype );
- return ;
- }
-
- /* open thread with new thread tab */
- if ( Kita::DatManager::isThreadEnrolled( url ) ) {
- m_threadTab->slotShowMainThread( url );
- return ;
- }
-
- QString url_mimetype = KIO::NetAccess::mimetype( url , this );
- KRun::runURL( url, url_mimetype );
-}
-
void KitaMainWindow::slotSetMainStatusbar( const QString& statusStr )
{
// display the text on the statusbar
void slotCheckSubjectToggleAction( bool check );
void slotCheckWriteToggleAction( bool check );
void slotEditCopy();
- void slotOpenURLRequestExt( const KURL& url, const QString mimetype = QString::null );
void slotURLLine();
private:
connect( view(), SIGNAL( horizontalSliderReleased() ), SLOT( slotHSliderReleased() ) );
connect( signalCollection, SIGNAL( windowDeactivated() ), SLOT( slotHideChildPopup() ) );
-
- /* click */
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
}
void KitaPreviewPart::createHTMLDocument()
/* If this is not anchor, then */
/* emit openURLRequest and return */
if ( datURL.host() != m_datURL.host() || datURL.path() != m_datURL.path() ) {
- emit openURLRequestExt( urlin );
+ ViewMediator::getInstance()->openURL( urlin );
return ;
}
if ( !refNum ) return ;
- emit openURLRequestExt( urlin );
+ ViewMediator::getInstance()->openURL( urlin );
}
void KitaPreviewPart::slotDeletePopup()
void slotOnURL( const QString& url );
signals:
-
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
void mousePressed(); /* to KitaThreadView */
};
SLOT( slotHideButton( bool ) ) );
connect( subjectList, SIGNAL( mouseButtonClicked( int, QListViewItem*, const QPoint&, int ) ),
SLOT( slotMouseButtonClicked( int, QListViewItem* ) ) );
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- Kita::SignalCollection::getInstance(), SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
}
ThreadListView::~ThreadListView()
private slots:
void slotSearchButton();
- signals:
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
};
}
connect( closeButton, SIGNAL( clicked() ),
SLOT( slotCloseButton() ) );
- Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
-
m_viewmode = VIEWMODE_MAINVIEW;
m_rescode = 200;
m_serverTime = 0;
signals:
void popupMenu( KXMLGUIClient*, const QPoint&, const KURL&, const QString&, mode_t );
void showThreadCompleted(); /* to KitaThreadPart */
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
};
#endif
***************************************************************************/
#include "viewmediator.h"
+#include "libkita/datmanager.h"
+
+#include <kio/netaccess.h>
+#include <krun.h>
+
ViewMediator* ViewMediator::instance = 0;
ViewMediator::ViewMediator()
m_favoriteListView->refresh();
}
+
+void ViewMediator::openURL( const KURL& url )
+{
+ // open thread.
+ if ( Kita::DatManager::isThreadEnrolled( url ) ) {
+ m_threadTabWidget->slotShowMainThread( url );
+ return;
+ }
+
+ QString mimetype = KIO::NetAccess::mimetype( url , m_threadTabWidget );
+ KRun::runURL( url, mimetype );
+}
void updateThreadView( const KURL& datURL );
void changeWriteTab( const KURL& datURL );
void updateFavoriteListView();
+ void openURL( const KURL& url );
};
#endif
connect( buttonCancel, SIGNAL( clicked() ),
SLOT( slotCancel() ) );
- connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
- signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
-
connect( faceCombo, SIGNAL( activated( const QString& ) ),
bodyText, SLOT( insert( const QString& ) ) );
protected slots:
bool slotBodyTextChanged();
-signals:
-
- void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
};
#endif