# this is where the XML-GUI resource file goes
rcdir = $(kde_datadir)/kita
-rc_DATA = kitaui.rc kitathreadtabwidgetui.rc
+rc_DATA = kitaui.rc
dummy.cpp:
echo > dummy.cpp
<property name="caption">
<string>Form1</string>
</property>
- <widget class="KTextEdit">
+ <vbox>
<property name="name">
- <cstring>asciiArtText</cstring>
+ <cstring>unnamed</cstring>
</property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>10</y>
- <width>240</width>
- <height>190</height>
- </rect>
- </property>
- </widget>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>showAACheckBox</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>210</y>
- <width>288</width>
- <height>18</height>
- </rect>
- </property>
- <property name="text">
- <string>show AA (for KDE 3.1.x)</string>
- </property>
- </widget>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>asciiArtText</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showAACheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>show AA (for KDE 3.1.x)</string>
+ </property>
+ </widget>
+ </vbox>
</widget>
+<customwidgets>
+</customwidgets>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>ktextedit.h</includehint>
<property name="caption">
<string>Form2</string>
</property>
- <widget class="QLabel">
+ <vbox>
<property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>70</width>
- <height>20</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>Plain</enum>
- </property>
- <property name="text">
- <string>from:</string>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel2</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>70</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>to:</string>
- </property>
- </widget>
- <widget class="QLineEdit">
- <property name="name">
- <cstring>toURLLine</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>90</x>
- <y>50</y>
- <width>280</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>http://</string>
- </property>
- </widget>
- <widget class="QLineEdit">
- <property name="name">
- <cstring>fromURLLine</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>90</x>
- <y>20</y>
- <width>280</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>http://</string>
- </property>
- </widget>
- <widget class="QPushButton">
- <property name="name">
- <cstring>replaceButton</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>260</x>
- <y>80</y>
- <width>115</width>
- <height>27</height>
- </rect>
- </property>
- <property name="text">
- <string>replace</string>
- </property>
- </widget>
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>65</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>replaceButton</cstring>
+ </property>
+ <property name="text">
+ <string>replace</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>toURLLine</cstring>
+ </property>
+ <property name="text">
+ <string>http://</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>fromURLLine</cstring>
+ </property>
+ <property name="text">
+ <string>http://</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>to:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>from:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
</widget>
<tabstops>
<tabstop>fromURLLine</tabstop>
#include <kaction.h>
#include <kstdaction.h>
#include <kshortcut.h>
-#include <qlayout.h>
+#include <kaboutdata.h>
+#include <kparts/partmanager.h>
KitaMainWindow::KitaMainWindow()
- : KDockMainWindow( 0, "Kita" ),
+ : KParts::DockMainWindow( 0, "Kita" ),
m_printer( 0 )
{
// accept dnd
SLOT( changeStatusbar( const QString& ) ) );
connect( signalCollection, SIGNAL( openBoardRequested( const QString&, bool ) ),
- m_subjectTab, SLOT( loadBoard( const QString&, bool ) ) );
+ SLOT( switchSubjectView( const QString&, bool ) ) );
connect( signalCollection, SIGNAL( openBoardRequested( const QString&, bool ) ),
- SLOT( openBoardRequested( const QString&, bool ) ) );
+ m_subjectTab, SLOT( loadBoard( const QString&, bool ) ) );
+
+ connect( m_subjectTab, SIGNAL( showThreadRequested( const QString&, bool ) ),
+ SLOT( switchThreadView( const QString&, bool ) ) );
connect( m_subjectTab, SIGNAL( showThreadRequested( const QString&, bool ) ),
m_threadTab, SLOT( showThread( const QString&, bool ) ) );
connect( m_threadTab, SIGNAL( sigHideSubject() ),
SLOT( hideSubject() ) );
+ connect( m_threadTab->manager(), SIGNAL( activePartChanged( KParts::Part* ) ),
+ SLOT( createGUI( KParts::Part* ) ) );
+
connect( m_boardView, SIGNAL( sigShowSubject() ),
SLOT( showSubject() ) );
actionCollection(),
"window_toggle_view" );
+ // action for subjecttabwidget
+ new KAction( i18n( "Close Current Thread Tab" ),
+ KStdAccel::close(),
+ m_threadTab,
+ SLOT( closeCurrentTab() ),
+ actionCollection(),
+ "threadtab_closetab" );
+ new KAction( i18n( "&Reload subject list"),
+ KStdAccel::reload(),
+ m_subjectTab,
+ SLOT( reloadSubjectList() ),
+ actionCollection(),
+ "threadlist_reload" );
- createGUI();
- factory()->addClient(m_threadTab);
+ m_threadTab->manager()->addManagedTopLevelWidget( m_mainDock );
+ setXMLFile( "kitaui.rc" );
+ createGUI( m_threadTab->manager()->activePart() );
}
void KitaMainWindow::slotURLLine()
void KitaMainWindow::optionsConfigureKeys()
{
- KKeyDialog::configureKeys( actionCollection(), "kitaui.rc" );
+ KKeyDialog dlg( TRUE, this);
+ QPtrList<KXMLGUIClient> actList = guiFactory()->clients();
+ for ( QPtrListIterator<KXMLGUIClient> act( actList ) ; act.current() ; ++act )
+ {
+ const KAboutData *dat = (*act)->instance()->aboutData();
+ dlg.insert( (*act)->actionCollection(),dat->programName() );
+ }
+ dlg.configure();
}
void KitaMainWindow::optionsConfigureToolbars()
connect( this, SIGNAL( kitaIsActive() ),
Kita::SignalCollection::getInstance(), SIGNAL( kitaIsActive() ) );
- QLayout *ql = static_cast<QWidget*>( m_mainDock ) ->layout();
- ql->setResizeMode( QLayout::FreeResize );
-
+ setView( m_mainDock );
+ setMainDockWidget( m_mainDock );
m_subjectDock = createDockWidget( "subject", 0L, 0L, i18n( "subject" ), i18n( "subject" ) );
m_subjectTab = new KitaSubjectTabWidget( m_subjectDock );
connect( m_boardDock, SIGNAL( headerCloseButtonClicked() ), SLOT( closeBoardView() ) );
connect( m_boardDock, SIGNAL( iMBeingClosed() ), SLOT( closeBoardView() ) );
- setView( m_mainDock );
- setMainDockWidget( m_mainDock );
-
m_boardDock->manualDock( m_mainDock, KDockWidget::DockLeft, 20 );
m_subjectDock->manualDock( m_mainDock, KDockWidget::DockTop, 30 );
}
}
-void KitaMainWindow::openBoardRequested( const QString& datURL, bool newTab)
+void KitaMainWindow::switchSubjectView( const QString& datURL, bool newTab)
{
if ( m_subjectListAction->isChecked() )
m_subjectDock->makeDockVisible();
}
+void KitaMainWindow::switchThreadView( const QString& datURL, bool newtab )
+{
+ m_mainDock->makeDockVisible();
+}
+
void KitaMainWindow::slotThread( const Kita::Thread* thread )
{
setCaption( thread->name() + QString( " (%1)" ).arg( thread->resNum() ) );
- m_mainDock->makeDockVisible();
}
void KitaMainWindow::slotEditCopy()
#endif
#include <kapplication.h>
-#include <kdockwidget.h>
+#include <kparts/dockmainwindow.h>
class KPrinter;
class KToggleAction;
namespace KParts
{
class URLArgs;
+ class Part;
}
namespace Kita
* @version $APP_VERSION
*/
-class KitaMainWindow : public KDockMainWindow
+class KitaMainWindow : public KParts::DockMainWindow
{
Q_OBJECT
public:
void setUrl( const KURL& url );
void bookmark( const QString& datURL, bool on );
void slotThread( const Kita::Thread* thread );
- void openBoardRequested( const QString& datURL, bool newTab);
void slotIsKitaActive();
+ void switchSubjectView( const QString& datURL, bool newTab);
+ void switchThreadView( const QString&, bool );
private:
KitaThreadTabWidget* m_threadTab;
<property name="caption">
<string>Form1</string>
</property>
- <vbox>
+ <grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <widget class="QLayoutWidget" row="0" column="0">
<property name="name">
- <cstring>layout3</cstring>
+ <cstring>layout1</cstring>
</property>
- <hbox>
+ <grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <widget class="KColorButton" row="0" column="1">
<property name="name">
- <cstring>layout1</cstring>
+ <cstring>popupColorButton</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>popupLabel</cstring>
+ </property>
+ <property name="text">
+ <string>popup text</string>
</property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="KColorButton" row="0" column="1">
- <property name="name">
- <cstring>popupColorButton</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- </widget>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>popupLabel</cstring>
- </property>
- <property name="text">
- <string>popup text</string>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>popupBackgroundLabel</cstring>
- </property>
- <property name="text">
- <string>popup background</string>
- </property>
- </widget>
- <widget class="KColorButton" row="1" column="1">
- <property name="name">
- <cstring>popupBackgroundColorButton</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- </widget>
- </grid>
</widget>
- <spacer>
+ <widget class="QLabel" row="1" column="0">
<property name="name">
- <cstring>spacer1</cstring>
+ <cstring>popupBackgroundLabel</cstring>
</property>
- <property name="orientation">
- <enum>Horizontal</enum>
+ <property name="text">
+ <string>popup background</string>
</property>
- <property name="sizeType">
- <enum>Expanding</enum>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>popupBackgroundColorButton</cstring>
</property>
- <property name="sizeHint">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
+ <property name="text">
+ <string></string>
</property>
- </spacer>
- </hbox>
+ </widget>
+ </grid>
</widget>
- <spacer>
+ <spacer row="0" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>374</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="0">
<property name="name">
<cstring>spacer2</cstring>
</property>
</size>
</property>
</spacer>
- </vbox>
+ </grid>
</widget>
+<customwidgets>
+</customwidgets>
<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
</UI>
<property name="caption">
<string>Form1</string>
</property>
- <vbox>
+ <grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <spacer row="0" column="1">
<property name="name">
- <cstring>layout9</cstring>
+ <cstring>spacer2</cstring>
</property>
- <hbox>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>365</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <widget class="QPushButton" row="0" column="1">
<property name="name">
- <cstring>layout6</cstring>
+ <cstring>fontButton</cstring>
+ </property>
+ <property name="text">
+ <string>set font</string>
</property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>fontLabel</cstring>
- </property>
- <property name="text">
- <string>set list font</string>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>threadFontLabel</cstring>
- </property>
- <property name="text">
- <string>set thread font</string>
- </property>
- </widget>
- </vbox>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="QLabel" row="0" column="0">
<property name="name">
- <cstring>layout5</cstring>
+ <cstring>fontLabel</cstring>
+ </property>
+ <property name="text">
+ <string>set list font</string>
</property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QPushButton">
- <property name="name">
- <cstring>fontButton</cstring>
- </property>
- <property name="text">
- <string>set font</string>
- </property>
- </widget>
- <widget class="QPushButton">
- <property name="name">
- <cstring>threadFontButton</cstring>
- </property>
- <property name="text">
- <string>set font</string>
- </property>
- </widget>
- </vbox>
</widget>
- <spacer>
+ <widget class="QPushButton" row="1" column="1">
<property name="name">
- <cstring>spacer2</cstring>
+ <cstring>threadFontButton</cstring>
</property>
- <property name="orientation">
- <enum>Horizontal</enum>
+ <property name="text">
+ <string>set font</string>
</property>
- <property name="sizeType">
- <enum>Expanding</enum>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>threadFontLabel</cstring>
</property>
- <property name="sizeHint">
- <size>
- <width>424</width>
- <height>20</height>
- </size>
+ <property name="text">
+ <string>set thread font</string>
</property>
- </spacer>
- </hbox>
+ </widget>
+ </grid>
</widget>
- <spacer>
+ <spacer row="1" column="0">
<property name="name">
<cstring>spacer3</cstring>
</property>
</size>
</property>
</spacer>
- </vbox>
+ </grid>
</widget>
<layoutdefaults spacing="6" margin="11"/>
</UI>
m_latestView = static_cast<KitaSubjectView *>( currentPage() );
}
+void KitaSubjectTabWidget::reloadSubjectList()
+{
+ if ( !m_latestView )
+ m_latestView->reloadSubject();
+}
+
Kita::SubjectTabBar::SubjectTabBar( QWidget* parent, const char* name )
: QTabBar( parent, name )
{}
public slots:
void loadBoard( const QString&, bool withNewTab = false );
void updateThread( const Kita::Thread* );
+ void reloadSubjectList();
private:
FavoriteListView* m_favoriteList;
connect( subjectList, SIGNAL( returnPressed( QListViewItem* ) ),
SLOT( loadThread( QListViewItem* ) ) );
connect( ReloadButton, SIGNAL( clicked() ),
- SLOT( slotReloadButton() ) );
+ SLOT( reloadSubject() ) );
}
KitaSubjectView::~KitaSubjectView()
{}
void KitaSubjectView::reloadSubject()
-{}
+{
+ if ( ! m_boardURL.isEmpty() ) {
+ loadBoard( m_boardURL );
+ }
+}
const QString KitaSubjectView::boardURL()
{
break;
}
}
-
-void KitaSubjectView::slotReloadButton()
-{
- if ( ! m_boardURL.isEmpty() ) {
- loadBoard( m_boardURL );
- }
-}
private slots:
void loadThread( QListViewItem* item );
void slotContextMenuRequested( QListViewItem*, const QPoint&, int );
- void slotReloadButton();
signals:
void loadBoardCompleted( const KURL& );
#include <qapplication.h>
#include <qmessagebox.h>
#include <qregexp.h>
-
-#include <kxmlguifactory.h>
-#include <kxmlguiclient.h>
-#include <kaction.h>
-#include <kstdaccel.h>
-#include <kstdaction.h>
+#include <qptrlist.h>
#include "libkita/kita_misc.h"
#include "libkita/parsemisc.h"
connect( tabBar(), SIGNAL( deleteMenuSelected( KitaThreadView* ) ),
SLOT( deleteView( KitaThreadView* ) ) );
- KGlobal::locale() ->insertCatalogue( "kitapart" );
+ m_manager = new KParts::PartManager( topLevelWidget(), this, "KitaPartManager" );
+
KitaThreadView* view = createView();
if ( view ) {
connect( this, SIGNAL( currentChanged ( QWidget * ) ),
SLOT( slotCurrentChanged ( QWidget * ) ) );
- setupActions();
}
KitaThreadTabWidget::~KitaThreadTabWidget()
{}
-
-/*-------------------------------*/
-/* setup actions */
-/*
- Child's actions are added in
- slotCurrentChanged later. */ /* private */
-void KitaThreadTabWidget::setupActions(){
-
- setXMLFile("kitathreadtabwidgetui.rc");
-
- new KAction( i18n( "Close Current Thread Tab" ),
- KStdAccel::close(),
- this,
- SLOT( closeCurrentTab() ),
- actionCollection(),
- "threadtab_closetab" );
-
- m_oldXmlClient = NULL;
-}
-
-
void KitaThreadTabWidget::showThread( const QString& datURL, bool withNewTab )
{
QString refstr;
KitaThreadView * newView = createView();
if ( newView ) {
- addTab( newView, Kita::unescape( thread->name().left( MAX_TABLABEL_LEN ) ) );
+ addTab( newView, getTabLabel( thread->name() ) );
connectSignals( newView );
newView->showThread( thread );
showPage( newView );
static_cast<KitaThreadView *>( currentPage() ) ->showThread( thread );
}
- setTabLabel( currentPage(), Kita::unescape( thread->name().left( MAX_TABLABEL_LEN ) )
- + QString( " (%1)" ).arg( thread->resNum() ) );
+ setTabLabel( currentPage(), QString( "%1 (%2)" ).arg( getTabLabel( thread->name() ) ).arg( thread->resNum() ) );
setTabToolTip( currentPage(), thread->name() );
}
KitaThreadPart* part = static_cast<KitaThreadPart *>( factory->create( this, "thread", "KitaThreadPart" ) );
KitaThreadView* view = static_cast<KitaThreadView *>( part->widget() );
+ m_manager->addPart( part );
+
return view;
}
return 0;
}
+KParts::Part* KitaThreadTabWidget::findPartFromView( QWidget* view )
+{
+ KParts::Part *p;
+ QPtrListIterator<KParts::Part> it( *( m_manager->parts() ) );
+ while ( ( p = (*it) ) != NULL )
+ {
+ if ( p->widget() == view ) return p;
+ ++it;
+ }
+ return NULL;
+}
+
void KitaThreadTabWidget::deleteView( KitaThreadView* view )
{
kdDebug() << "deleteView(" << static_cast<void*>( view ) << ")" << endl;
- factory()->removeClient( view );
- m_oldXmlClient = NULL;
-
removePage( view );
m_viewList.remove( view );
+
+ m_manager->removePart( findPartFromView( view ) );
delete view;
if ( count() == 0 ) {
void KitaThreadTabWidget::slotCurrentChanged( QWidget * w )
{
KitaThreadView* view = static_cast<KitaThreadView *>( w );
- if(m_oldXmlClient) factory()->removeClient(m_oldXmlClient);
- factory()->addClient(view);
view->showStatusBar( "" );
- m_oldXmlClient = view;
+ m_manager->setActivePart( findPartFromView( view ) );
+}
+
+const QString KitaThreadTabWidget::getTabLabel( const QString &name )
+{
+ QString threadTitle = Kita::unescape( name );
+ QString title = ( threadTitle.length() > MAX_TABLABEL_LEN ) ? threadTitle.left( MAX_TABLABEL_LEN ) + "..." : threadTitle;
+ return title;
}
void KitaThreadTabWidget::slotThread( const Kita::Thread* thread )
{
KitaThreadView * view = findView( thread->url() );
- if ( view ) {
- setTabLabel( currentPage(), Kita::unescape( thread->name().left( MAX_TABLABEL_LEN ) ) + QString( " (%1)" ).arg( thread->resNum() ) );
- }
+ if ( view )
+ setTabLabel( currentPage(), QString( "%1 (%2)" ).arg( getTabLabel( thread->name() ) ).arg( thread->resNum() ) );
}
#include <qtabwidget.h>
#include <qtabbar.h>
#include <kparts/browserextension.h>
-#include <kxmlguiclient.h>
+#include <kparts/partmanager.h>
class KitaThreadPart;
class KitaThreadView;
/**
@author Hideki Ikemoto
*/
-class KitaThreadTabWidget : public QTabWidget , public KXMLGUIClient
+class KitaThreadTabWidget : public QTabWidget
{
Q_OBJECT
- KXMLGUIClient * m_oldXmlClient;
+ KParts::PartManager *m_manager;
public:
KitaThreadTabWidget( QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
~KitaThreadTabWidget();
+ KParts::Part* findPartFromView( QWidget* );
+ KParts::PartManager* manager() { return m_manager; }
public slots:
void showThread( const QString& datURL, bool withNewTab );
void closeCurrentTab();
private:
- void setupActions();
void connectSignals( KitaThreadView* );
KitaThreadView* createView();
QPtrList<KitaThreadView> m_viewList;
KitaThreadView* findView( const QString& threadURL );
+ const QString getTabLabel( const QString &name );
private slots:
void slotThread( const Kita::Thread* );
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="kita" version="2">
+<kpartgui name="kita" version="3">
<MenuBar>
- <!--<Menu name="custom"><text>C&ustom</text>
- <Action name="custom_action" />
- </Menu>-->
<Menu name="file"><text>&File</text>
<Action name="load_board_list" />
</Menu>
<Menu name="view"><text>&View</text>
- <Action name="reload" />
+ <Action name="threadlist_reload" />
+ </Menu>
+ <Menu name="thread"><text>&Thread</text>
+ <Action name="threadtab_closetab" />
</Menu>
<Menu name="window"><text>&Window</text>
<Action name="window_show_board_list" />
<Action name="window_show_subject_list" />
<Action name="window_toggle_view" />
<Action name="reset_win" />
- <Action name="close_tab" />
</Menu>
</MenuBar>
<ToolBar name="mainToolBar">
touch rc.cpp
# this is where the XML-GUI resource file goes
-rcdir = $(kde_datadir)/kita
+rcdir = $(kde_datadir)/kitapart
rc_DATA = kitathreadviewui.rc
#include <kio/job.h>
#include <khtml_part.h>
+#include <kglobal.h>
+#include <kaction.h>
+#include <kstdaccel.h>
+#include <kstdaction.h>
#include "kitahtmlpart.h"
#include "libkita/board.h"
, m_threadview( 0 )
, m_extension( 0 )
{
+ KGlobal::locale() ->insertCatalogue( "kitapart" );
+
m_threadview = new KitaThreadView( parentWidget ); // auto delete
setInstance( KitaThreadFactory::instance() );
setWidget( m_threadview );
+ setupActions();
+
m_threadview->show();
}
}
}
+void KitaThreadPart::setupActions()
+{
+ if ( !m_threadview ) return;
+ setXMLFile("kitathreadviewui.rc");
+
+ new KAction( i18n( "Find" ),
+ "find",
+ KStdAccel::find(),
+ m_threadview,
+ SLOT( focusSearchCombo() ),
+ actionCollection(),
+ "threadview_find" );
+
+ new KAction( i18n( "Reload" ),
+ "reload",
+ KStdAccel::reload(),
+ m_threadview,
+ SLOT( slotReloadButton() ),
+ actionCollection(),
+ "threadview_reload" );
+
+ new KAction(i18n("Stop"),
+ "stop",
+ Key_Escape,
+ m_threadview,
+ SLOT(slotStopLoading()),
+ actionCollection(),
+ "threadview_stop");
+}
+
KParts::BrowserExtension* KitaThreadPart::browserExtension() const
{
return m_extension;
virtual ~KitaThreadPart();
static KAboutData * createAboutData(); //needed by GenericFactory
+ void setupActions();
KParts::BrowserExtension *browserExtension() const;
#include <qsimplerichtext.h>
#include <qpopupmenu.h>
-#include <kxmlguifactory.h>
-#include <kaction.h>
-#include <kstdaccel.h>
-#include <kstdaction.h>
-
#include "kitahtmlpart.h"
#include "kitawritedialog.h"
#include "kita2ch.h"
"Á´ÀÕǤ¤òÉ餦¤³¤È¤ò¾µÂú¤·¤Æ½ñ¤¹þ¤ß¤Þ¤¹¤«\n";
KitaThreadView::KitaThreadView( QWidget* parent, const char* name )
- : KitaThreadViewBase( parent, name )
- , KXMLGUIClient()
- , m_popup( 0 )
+ : KitaThreadViewBase( parent, name ), m_popup( 0 )
{
m_thread = new Kita::NullThread();
m_threadPart = new KitaHTMLPart( threadFrame );
connect( this, SIGNAL( openBoardRequested( const QString&, bool ) ),
signalCollection, SIGNAL( openBoardRequested( const QString&, bool ) ) );
- setupActions();
-
m_viewmode = VIEWMODE_PARENT;
m_rescode = 200;
m_serverTime = 0;
}
}
-
-/*---------------*/
-/* setup actions */ /* private */
-void KitaThreadView::setupActions(){
-
- setXMLFile("kitathreadviewui.rc");
-
- new KAction( i18n( "Find" ),
- "find",
- KStdAccel::find(),
- this,
- SLOT( focusSearchCombo() ),
- actionCollection(),
- "threadview_find" );
-
- new KAction( i18n( "Reload" ),
- "reload",
- KStdAccel::reload(),
- this,
- SLOT( slotReloadButton() ),
- actionCollection(),
- "threadview_reload" );
-
- new KAction(i18n("Stop"),
- "stop",
- Key_Escape,
- this,
- SLOT(slotStopLoading()),
- actionCollection(),
- "threadview_stop");
-}
-
-
const QString KitaThreadView::threadName() const
{
return m_thread->name();
#include <kparts/browserextension.h>
#include <dom/html_base.h>
-#include <kxmlguiclient.h>
#include <qtextbrowser.h>
#include <ktextbrowser.h>
* @author Hideki Ikemoto <ikemo@users.sourceforge.jp>
**/
-class KitaThreadView : public KitaThreadViewBase, public KXMLGUIClient
+class KitaThreadView : public KitaThreadViewBase
{
Q_OBJECT
bool m_online;
bool m_firstReceive;
- void setupActions();
-
void updateScreen();
void updateInfo();
<property name="caption">
<string>Form1</string>
</property>
+ <property name="focusPolicy">
+ <enum>ClickFocus</enum>
+ </property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
this, SLOT( slotCurrentChanged ( QWidget * ) ) );
m_preview = new KitaThreadView( qtw );
- qtw->addTab( m_preview, "preview" );
+ qtw->addTab( m_preview, i18n( "preview" ) );
m_preview->setupEx( m_thread , 0, VIEWMODE_PREVIEW );
}
</property>
<widget class="QLayoutWidget">
<property name="name">
- <cstring>layout8</cstring>
+ <cstring>layout20</cstring>
</property>
- <hbox>
+ <grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <widget class="KSqueezedTextLabel" row="1" column="1">
<property name="name">
- <cstring>layout6</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Board Name:</string>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1_2</cstring>
- </property>
- <property name="text">
- <string>Thread Name:</string>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1_2_2</cstring>
- </property>
- <property name="text">
- <string>Thread URL:</string>
- </property>
- </widget>
- </vbox>
+ <cstring>threadNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>thread name</string>
+ </property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="KSqueezedTextLabel" row="0" column="1">
<property name="name">
- <cstring>layout7</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="KSqueezedTextLabel">
- <property name="name">
- <cstring>boardNameLabel</cstring>
- </property>
- <property name="text">
- <string>board name</string>
- </property>
- </widget>
- <widget class="KSqueezedTextLabel">
- <property name="name">
- <cstring>threadNameLabel</cstring>
- </property>
- <property name="text">
- <string>thread name</string>
- </property>
- </widget>
- <widget class="KSqueezedTextLabel">
- <property name="name">
- <cstring>threadURLLabel</cstring>
- </property>
- <property name="text">
- <string>thread url</string>
- </property>
- </widget>
- </vbox>
+ <cstring>boardNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>board name</string>
+ </property>
</widget>
- </hbox>
+ <widget class="KSqueezedTextLabel" row="2" column="1">
+ <property name="name">
+ <cstring>threadURLLabel</cstring>
+ </property>
+ <property name="text">
+ <string>thread url</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Thread URL:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Board Name:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Thread Name:</string>
+ </property>
+ </widget>
+ </grid>
</widget>
<widget class="QLayoutWidget">
<property name="name">
</widget>
</hbox>
</widget>
- <widget class="QTabWidget">
+ <widget class="QTabWidget">
<property name="name">
<cstring>qtw</cstring>
</property>
- <widget class="QTextEdit">
- <property name="name">
- <cstring>bodyText</cstring>
- </property>
- <attribute name="title">
- <string>body</string>
- </attribute>
- </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>bodyText</cstring>
+ </property>
+ <attribute name="title">
+ <string>body</string>
+ </attribute>
+ </widget>
</widget>
<widget class="QLayoutWidget">
<property name="name">
</widget>
</vbox>
</widget>
+<customwidgets>
+</customwidgets>
<connections>
<connection>
<sender>buttonOk</sender>
<receiver>KitaWriteDialogBase</receiver>
<slot>sageBoxToggled(bool)</slot>
</connection>
- <connection>
- <sender>faceCombo</sender>
- <signal>activated(const QString&)</signal>
- <receiver>bodyText</receiver>
- <slot>insert(const QString&)</slot>
- </connection>
</connections>
<includes>
<include location="local" impldecl="in implementation">kitawritedialogbase.ui.h</include>
</property>
<widget class="QLayoutWidget">
<property name="name">
- <cstring>layout4</cstring>
+ <cstring>layout3</cstring>
</property>
- <hbox>
+ <vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>useTabCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Use new tab when opening the thread(board).</string>
+ </property>
+ </widget>
<widget class="QLayoutWidget">
<property name="name">
- <cstring>layout3</cstring>
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>MarkLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Mark new thread to made:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>MarkTimespinBox</cstring>
+ </property>
+ <property name="prefix">
+ <string>within </string>
+ </property>
+ <property name="suffix">
+ <string> hour</string>
+ </property>
+ <property name="specialValueText">
+ <string>after last access</string>
+ </property>
+ <property name="maxValue">
+ <number>24</number>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ <property name="value">
+ <number>24</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="title">
+ <string>Thread</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>this option affects from the next thread.</string>
+ </property>
+ </widget>
<widget class="QCheckBox">
<property name="name">
- <cstring>useTabCheckBox</cstring>
+ <cstring>showMailCheckBox</cstring>
</property>
<property name="text">
- <string>Use new tab when opening the thread(board).</string>
+ <string>Show mail address in the thread.</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
- <cstring>layout2</cstring>
+ <cstring>layout13</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>afterShowNumSpin</cstring>
+ </property>
+ <property name="prefix">
+ <string>Display </string>
+ </property>
+ <property name="suffix">
+ <string> res</string>
+ </property>
+ <property name="specialValueText">
+ <string>Display all res</string>
+ </property>
+ <property name="maxValue">
+ <number>1000</number>
+ </property>
+ <property name="lineStep">
+ <number>50</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ </widget>
<widget class="QLabel">
<property name="name">
- <cstring>MarkLabel</cstring>
+ <cstring>textLabel3</cstring>
</property>
<property name="text">
- <string>Mark new thread to made:</string>
+ <string>from the last read response.</string>
</property>
</widget>
<spacer>
<property name="name">
- <cstring>spacer6</cstring>
+ <cstring>spacer11_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeHint">
<size>
- <width>20</width>
+ <width>40</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget class="QSpinBox">
- <property name="name">
- <cstring>MarkTimespinBox</cstring>
- </property>
- <property name="prefix">
- <string>within </string>
- </property>
- <property name="suffix">
- <string> hour</string>
- </property>
- <property name="specialValueText">
- <string>after last access</string>
- </property>
- <property name="maxValue">
- <number>24</number>
- </property>
- <property name="minValue">
- <number>0</number>
- </property>
- <property name="value">
- <number>24</number>
- </property>
- <property name="toolTip" stdset="0">
- <string></string>
- </property>
- </widget>
</hbox>
</widget>
- <widget class="QButtonGroup">
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>viewGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Views</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
<property name="name">
- <cstring>buttonGroup3</cstring>
+ <cstring>twoPaneRadio</cstring>
</property>
- <property name="title">
- <string>Thread</string>
+ <property name="text">
+ <string>(pseudo) Two pane</string>
</property>
- <widget class="QCheckBox">
- <property name="name">
- <cstring>showMailCheckBox</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>30</x>
- <y>40</y>
- <width>193</width>
- <height>19</height>
- </rect>
- </property>
- <property name="text">
- <string>Show mail address in the thread.</string>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>270</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>this option affects from the next thread.</string>
- </property>
- </widget>
- <widget class="QSpinBox">
- <property name="name">
- <cstring>afterShowNumSpin</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>11</x>
- <y>71</y>
- <width>105</width>
- <height>19</height>
- </rect>
- </property>
- <property name="prefix">
- <string>Display </string>
- </property>
- <property name="suffix">
- <string> res</string>
- </property>
- <property name="specialValueText">
- <string>Display all res</string>
- </property>
- <property name="maxValue">
- <number>1000</number>
- </property>
- <property name="lineStep">
- <number>50</number>
- </property>
- <property name="value">
- <number>100</number>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel3</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>122</x>
- <y>71</y>
- <width>160</width>
- <height>19</height>
- </rect>
- </property>
- <property name="text">
- <string>from the last read response.</string>
- </property>
- </widget>
- </widget>
- <widget class="QButtonGroup">
- <property name="name">
- <cstring>viewGroup</cstring>
+ <property name="checked">
+ <bool>true</bool>
</property>
- <property name="title">
- <string>Views</string>
+ <property name="buttonGroupId">
+ <number>0</number>
</property>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>threePaneRadio</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>50</y>
- <width>80</width>
- <height>19</height>
- </rect>
- </property>
- <property name="text">
- <string>Three pane</string>
- </property>
- <property name="buttonGroupId">
- <number>1</number>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>twoPaneRadio</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>20</y>
- <width>120</width>
- <height>19</height>
- </rect>
- </property>
- <property name="text">
- <string>(pseudo) Two pane</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="buttonGroupId">
- <number>0</number>
- </property>
- </widget>
</widget>
- <widget class="QButtonGroup">
+ <widget class="QRadioButton">
<property name="name">
- <cstring>orderGroup</cstring>
+ <cstring>threePaneRadio</cstring>
</property>
- <property name="title">
- <string>When open the board</string>
+ <property name="text">
+ <string>Three pane</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>1</number>
</property>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>numOrderRadio</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>50</y>
- <width>185</width>
- <height>19</height>
- </rect>
- </property>
- <property name="text">
- <string>Show thread in numerical order</string>
- </property>
- <property name="buttonGroupId">
- <number>1</number>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>unreadFirstRadio</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>20</y>
- <width>250</width>
- <height>19</height>
- </rect>
- </property>
- <property name="text">
- <string>Show unread thread first</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="buttonGroupId">
- <number>0</number>
- </property>
- </widget>
</widget>
</vbox>
</widget>
- <spacer>
+ <widget class="QButtonGroup">
<property name="name">
- <cstring>spacer11</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
+ <cstring>orderGroup</cstring>
</property>
- <property name="sizeType">
- <enum>Expanding</enum>
+ <property name="title">
+ <string>When open the board</string>
</property>
- <property name="sizeHint">
- <size>
- <width>279</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </hbox>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>unreadFirstRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Show unread thread first</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>0</number>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>numOrderRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Show thread in numerical order</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>1</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
</widget>
<spacer>
<property name="name">