#include <klistview.h>
#include <kiconloader.h>
#include <klocale.h>
+#include <kpopupmenu.h>
#include "kitasubjectview.h"
#include "favoritelistview.h"
subjectList->setColumnWidth(Row_Subject, 400);
subjectList->setColumnWidthMode(Row_Subject, QListView::Manual);
- connect(subjectList, SIGNAL(clicked(QListViewItem*)), SLOT(loadThread(QListViewItem*)));
connect( SearchButton, SIGNAL( clicked() ), SLOT( slotSearchButton() ) );
connect( SearchCombo, SIGNAL( activated(int) ), SLOT( slotSearchButton() ) );
connect(this, SIGNAL(signalSubjectListClicked(QListViewItem*)), subjectList, SIGNAL(clicked(QListViewItem*)));
connect( m_subjectTab, SIGNAL( currentChanged(QWidget*) ), SLOT( slotCurrentChanged(QWidget*) ) );
connect( m_favoriteListView, SIGNAL( signalShowThread( const Kita::Thread& ) ),
SIGNAL( signalShowThread( const Kita::Thread& ) ) );
+ connect( subjectList, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ),
+ SLOT( slotContextMenuRequested( QListViewItem*, const QPoint&, int ) ) );
+ connect( subjectList, SIGNAL( mouseButtonClicked( int, QListViewItem*, const QPoint&, int ) ),
+ SLOT( loadThread( int, QListViewItem* ) ) );
}
KitaSubjectView::~KitaSubjectView()
{
}
-void KitaSubjectView::loadThread(QListViewItem* item)
+void KitaSubjectView::loadThread( int button, QListViewItem* item )
{
if( ! item ) return;
m_favoriteListView->update();
}
}
+
+void KitaSubjectView::slotContextMenuRequested( QListViewItem* item, const QPoint& point, int )
+{
+ if( item == 0 ) {
+ return;
+ }
+
+ KPopupMenu popup( 0 );
+ popup.insertItem( i18n("Open with Browser"), 0 );
+
+ switch( popup.exec( point ) ) {
+ case 0:
+ break;
+ default:
+ break;
+ }
+}
+
public slots:
void reloadSubject();
- void loadThread( QListViewItem* item );
void loadBoard( const Kita::Board& board );
void setFont( const QFont& font );
void updateThread( const Kita::Thread& thread );
+private slots:
+ void loadThread( int, QListViewItem* item );
private: // Private attributes
QPtrList<Kita::Thread> m_threadList;
void slotSearchButton();
void slotCurrentChanged(QWidget* widget);
void slotHideButton(bool on);
+ void slotContextMenuRequested( QListViewItem*, const QPoint&, int );
signals:
void loadBoardCompleted(const KURL&);