From 2b57a50b6cbd67a38d985dde0d2fd589a1b8ec19 Mon Sep 17 00:00:00 2001 From: ikemo Date: Sun, 23 May 2004 09:00:28 +0000 Subject: [PATCH] >>808 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1101 56b19765-1e22-0410-a548-a0f45d66c51a --- ChangeLog | 7 + kita/src/aboneprefbase.ui | 157 +++++++------- kita/src/favoritelistview.cpp | 2 + kita/src/kita.cpp | 9 +- kita/src/kitaboardviewbase.ui | 3 + kita/src/kitafontprefbase.ui | 112 +++++----- kita/src/kitasubjectview.cpp | 28 +++ kita/src/kitasubjectview.h | 2 + kita/src/kitathreadtabwidget.cpp | 2 + kita/src/kitathreadtabwidget.h | 1 + kita/src/part/kitathreadview.cpp | 85 +++++++- kita/src/part/kitathreadview.h | 22 +- kita/src/part/kitathreadviewbase.ui | 28 +-- kita/src/pref.cpp | 57 ++---- kita/src/pref.h | 7 +- kita/src/threadlistviewbase.ui | 22 ++ kita/src/uiprefbase.ui | 397 ++++++++++++++++-------------------- 17 files changed, 498 insertions(+), 443 deletions(-) diff --git a/ChangeLog b/ChangeLog index 875eb40..5dc3772 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-05-23 Hideki Ikemoto + + * show unread/read/new thread num. + * open board when click the board name of the label. + * change font pref. + thanks to Toshihiko Okada + 2004-05-22 Hideki Ikemoto * refactoring. >>787>>800 diff --git a/kita/src/aboneprefbase.ui b/kita/src/aboneprefbase.ui index 9e38f71..9321c26 100644 --- a/kita/src/aboneprefbase.ui +++ b/kita/src/aboneprefbase.ui @@ -15,93 +15,80 @@ Form1 - + - wordLabel + unnamed - - - 210 - 10 - 44 - 14 - - - - NG word - - - - - nameLabel - - - - 110 - 10 - 29 - 14 - - - - Name - - - - - idLabel - - - - 10 - 10 - 11 - 14 - - - - ID - - - - - wordAboneText - - - - 210 - 30 - 90 - 170 - - - - - - nameAboneText - - - - 110 - 30 - 90 - 170 - - - - - - idAboneText - - - - 10 - 30 - 86 - 170 - - - + + + layout8 + + + + unnamed + + + + idLabel + + + ID + + + + + idAboneText + + + + + + + layout6 + + + + unnamed + + + + wordLabel + + + NG word + + + + + wordAboneText + + + + + + + layout7 + + + + unnamed + + + + nameLabel + + + Name + + + + + nameAboneText + + + + + diff --git a/kita/src/favoritelistview.cpp b/kita/src/favoritelistview.cpp index 2206b96..2c20db4 100644 --- a/kita/src/favoritelistview.cpp +++ b/kita/src/favoritelistview.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,7 @@ FavoriteListView::FavoriteListView( QWidget* parent, const char* name ) subjectList->addColumn( i18n( "Board" ) ); ReloadButton->hide(); + KindLabel->hide(); connect( subjectList, SIGNAL( returnPressed( QListViewItem* ) ), SLOT( loadThread( QListViewItem* ) ) ); diff --git a/kita/src/kita.cpp b/kita/src/kita.cpp index 13e8e20..bd34566 100644 --- a/kita/src/kita.cpp +++ b/kita/src/kita.cpp @@ -105,6 +105,9 @@ KitaMainWindow::KitaMainWindow() connect( m_subjectTab, SIGNAL( showThreadRequested( const QString&, bool ) ), m_threadTab, SLOT( showThread( const QString&, bool ) ) ); + connect( m_threadTab, SIGNAL( openBoardRequested( const QString&, bool ) ), + m_subjectTab, SLOT( loadBoard( const QString&, bool ) ) ); + connect( m_threadTab, SIGNAL( thread( const Kita::Thread* ) ), m_subjectTab, SLOT( updateThread( const Kita::Thread* ) ) ); @@ -511,7 +514,7 @@ void KitaMainWindow::changeCaption( const QString& text ) void KitaMainWindow::setupView() { - m_mainDock = createDockWidget( "main", 0L, 0L, i18n( "main" ) ); + m_mainDock = createDockWidget( "main", 0L, 0L, i18n( "main" ), i18n( "main" ) ); m_threadTab = new KitaThreadTabWidget( m_mainDock ); m_mainDock->setWidget( m_threadTab ); m_mainDock->setDockSite( KDockWidget::DockFullSite ); @@ -522,12 +525,12 @@ void KitaMainWindow::setupView() ql->setResizeMode( QLayout::FreeResize ); - m_subjectDock = createDockWidget( "subject", 0L, 0L, i18n( "subject" ) ); + m_subjectDock = createDockWidget( "subject", 0L, 0L, i18n( "subject" ), i18n( "subject" ) ); m_subjectTab = new KitaSubjectTabWidget( m_subjectDock ); m_subjectDock->setWidget( m_subjectTab ); m_subjectDock->setDockSite( KDockWidget::DockNone ); - m_boardDock = createDockWidget( "board", 0L, 0L, i18n( "board" ) ); + m_boardDock = createDockWidget( "board", 0L, 0L, i18n( "board" ), i18n( "board" ) ); m_boardView = new KitaBoardView( m_boardDock ); m_boardDock->setWidget( m_boardView ); m_boardDock->setDockSite( KDockWidget::DockNone ); diff --git a/kita/src/kitaboardviewbase.ui b/kita/src/kitaboardviewbase.ui index 1c7dff3..ecd74ae 100644 --- a/kita/src/kitaboardviewbase.ui +++ b/kita/src/kitaboardviewbase.ui @@ -32,6 +32,9 @@ true + + true + diff --git a/kita/src/kitafontprefbase.ui b/kita/src/kitafontprefbase.ui index 62cae68..ba1b2d8 100644 --- a/kita/src/kitafontprefbase.ui +++ b/kita/src/kitafontprefbase.ui @@ -21,82 +21,48 @@ - layout9 + layout8 - + unnamed - + - layout6 + fontLabel + + + set list font - - - unnamed - - - - fontLabel - - - set list font - - - - - threadFontLabel - - - set thread font - - - - + - layout5 + threadFontLabel + + + set thread font - - - unnamed - - - - fontButton - - - set font - - - - - threadFontButton - - - set font - - - - + - spacer2 + FontRequester + + + list - - Horizontal + + - - Expanding + + + + ThreadFontRequester - - - 424 - 20 - + + thread - - + + @@ -117,5 +83,29 @@ + + + + + ThreadFontRequester + fontSelected(const QFont&) + KitaFontPrefBase + ThreadFontSelected(const QFont&) + + + FontRequester + fontSelected(const QFont&) + KitaFontPrefBase + FontSelected(const QFont&) + + + + ThreadFontSelected(const QFont&) + FontSelected(const QFont&) + + + kfontrequester.h + kfontrequester.h + diff --git a/kita/src/kitasubjectview.cpp b/kita/src/kitasubjectview.cpp index fa30f25..fa6f512 100644 --- a/kita/src/kitasubjectview.cpp +++ b/kita/src/kitasubjectview.cpp @@ -19,6 +19,7 @@ #include #include #include +#include // kdelibs/kio #include @@ -43,6 +44,7 @@ KitaSubjectView::KitaSubjectView( QWidget* parent, const char* name ) : Kita::ThreadListView( parent, name ) + , m_unreadNum( 0 ), m_readNum( 0 ), m_newNum( 0 ) { connect( subjectList, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), SLOT( slotContextMenuRequested( QListViewItem*, const QPoint&, int ) ) ); @@ -114,6 +116,9 @@ void KitaSubjectView::loadBoard( const QString& boardURL ) } m_boardURL = boardURL; + m_unreadNum = 0; + m_readNum = 0; + m_newNum = 0; KitaThreadInfo* cache = KitaThreadInfo::getInstance(); QPtrList threadList = Kita::Board::getThreadList( boardURL ); @@ -145,15 +150,18 @@ void KitaSubjectView::loadBoard( const QString& boardURL ) if ( readNum > 0 && resNum != readNum ) { // ̤Æɤ¢¤ê item->setPixmap( Col_Mark, SmallIcon( "unread" ) ); + m_unreadNum++; item->setText( Col_MarkOrder, QString::number( ts_hasunread ) ); } else if ( readNum > 0 ) { // ´ûÆÉ item->setPixmap( Col_Mark, SmallIcon( "read" ) ); + m_readNum++; //if( readNum > 1000) item->setText( Col_MarkOrder, "0" ); //else item->setText( Col_MarkOrder, "3" ); item->setText( Col_MarkOrder, QString::number( ( readNum > 1000 ) ? ts_readed : ts_read ) ); } else if ( since.secsTo( currentdat ) < 3600 * KitaConfig::MarkTime() ) { item->setPixmap( Col_Mark, SmallIcon( "newthread" ) ); + m_newNum++; item->setText( Col_MarkOrder, QString::number( ts_new ) ); } else { item->setText( Col_MarkOrder, QString::number( ts_normal ) ); @@ -178,6 +186,16 @@ void KitaSubjectView::loadBoard( const QString& boardURL ) } subjectList->setFocus(); + UpdateKindLabel(); +} + +void KitaSubjectView::UpdateKindLabel() +{ + QString fmtstr; + fmtstr += QString( "%1" ).arg( m_unreadNum ); + fmtstr += QString( "/%1" ).arg( m_readNum ); + fmtstr += QString( "/%1" ).arg( m_newNum ); + KindLabel->setText( fmtstr ); } void KitaSubjectView::setFont( const QFont& font ) @@ -195,17 +213,27 @@ void KitaSubjectView::updateThread( const Kita::Thread* updated_thread ) item->setText( Col_Read, QString( "%1" ).arg( readNum, 4 ) ); item->setText( Col_Unread, readNum > 0 && resNum != readNum ? QString( "%1" ).arg( resNum - readNum, 4 ) : QString( "" ) ); + switch ( item->text( Col_MarkOrder ).toInt() ) { + case ts_readed : + case ts_read : m_readNum--; break; + case ts_new : m_newNum--; break; + case ts_hasunread : m_unreadNum--; break; + } + if ( readNum > 0 && resNum != readNum ) { // ̤Æɤ¢¤ê item->setPixmap( Col_Mark, SmallIcon( "unread" ) ); + m_unreadNum++; item->setText( Col_MarkOrder, QString::number( ts_hasunread ) ); } else if ( readNum > 0 ) { // ´ûÆÉ item->setPixmap( Col_Mark, SmallIcon( "read" ) ); + m_readNum++; item->setText( Col_MarkOrder, QString::number( ts_read ) ); } else { item->setText( Col_MarkOrder, QString::number( ts_normal ) ); } + UpdateKindLabel(); } } } diff --git a/kita/src/kitasubjectview.h b/kita/src/kitasubjectview.h index bab109d..e42d57d 100644 --- a/kita/src/kitasubjectview.h +++ b/kita/src/kitasubjectview.h @@ -41,6 +41,8 @@ public slots: private: QString m_boardURL; + int m_unreadNum, m_readNum, m_newNum; + void UpdateKindLabel(); private slots: void loadThread( QListViewItem* item ); diff --git a/kita/src/kitathreadtabwidget.cpp b/kita/src/kitathreadtabwidget.cpp index 2b375ec..d3cc8d3 100644 --- a/kita/src/kitathreadtabwidget.cpp +++ b/kita/src/kitathreadtabwidget.cpp @@ -119,6 +119,8 @@ void KitaThreadTabWidget::connectSignals( KitaThreadView* view ) this, SIGNAL( showThreadCompleted( const KURL& ) ) ); connect( view, SIGNAL( thread( const Kita::Thread* ) ), this, SLOT( slotThread( const Kita::Thread* ) ) ); + connect( view, SIGNAL( openBoardRequested( const QString&, bool ) ), + this, SIGNAL( openBoardRequested( const QString&, bool ) ) ); } KitaThreadView* KitaThreadTabWidget::findView( const QString& threadURL ) diff --git a/kita/src/kitathreadtabwidget.h b/kita/src/kitathreadtabwidget.h index 091d38d..e61f102 100644 --- a/kita/src/kitathreadtabwidget.h +++ b/kita/src/kitathreadtabwidget.h @@ -61,6 +61,7 @@ signals: void bookmarked( const QString& datURL, bool on ); void showThreadCompleted( const KURL& threadUrl ); void sigHideSubject(); + void openBoardRequested( const QString& url, bool useTab ); }; class KitaThreadTabBar : public QTabBar diff --git a/kita/src/part/kitathreadview.cpp b/kita/src/part/kitathreadview.cpp index 16c9acd..3f09630 100644 --- a/kita/src/part/kitathreadview.cpp +++ b/kita/src/part/kitathreadview.cpp @@ -20,7 +20,8 @@ #include #include #include - +#include +#include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include "kitahtmlpart.h" #include "kitawritedialog.h" @@ -72,6 +74,14 @@ KitaThreadView::KitaThreadView( QWidget* parent, const char* name ) aLayout->addWidget( m_threadPart->view() ); { + subjectLabel = new Kita::KitaSubjectLabel( Subjectframe ); + QHBoxLayout* LBox = new QHBoxLayout( Subjectframe ); + LBox->addWidget( subjectLabel ); + connect( subjectLabel, SIGNAL( urlClick( const QString& ) ), + SLOT( subjectlinkClicked( const QString& ) ) ); + } + + { SearchButton->setPixmap( SmallIcon( "find" ) ); HighLightButton->setPixmap( SmallIcon( "idea" ) ); ReloadButton->setPixmap( SmallIcon( "reload" ) ); @@ -167,19 +177,25 @@ void KitaThreadView::slotDOMNodeActivated( const DOM::Node& node ) } // end of Anchor tags. } -void KitaThreadView::setSubjectLabel( const QString& boardName, const QString& threadName ) +void KitaThreadView::setSubjectLabel( const QString& boardName, const QString& threadName, const QString boardURL ) { QString disp; if ( boardName.isEmpty() ) { disp = threadName; } else { - disp = QString( "[%1] %2" ).arg( boardName ).arg( threadName ); + disp = QString( "[%2] %3" ).arg( boardURL ).arg( boardName ).arg( threadName ); } - disp.truncate( MAX_LABEL_LENGTH ); + //disp.truncate( MAX_LABEL_LENGTH ); subjectLabel->setText( disp ); } +void KitaThreadView::subjectlinkClicked(const QString& URL ) +{ + kdDebug() << QString("Jump board: \"%1\"").arg(URL) << endl; + emit openBoardRequested( URL, KitaConfig::alwaysUseTab() ); +} + void KitaThreadView::updateButton() { writeButton->setEnabled( true ); @@ -340,6 +356,59 @@ void KitaThreadView::focusSearchCombo() namespace Kita { + KitaSubjectLabel::KitaSubjectLabel(QWidget* parent, const char * name ) + : KTextBrowser(parent, name) + { + setTextFormat(Qt::RichText); + setVScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(QScrollView::AlwaysOff); + setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + setNotifyClick( TRUE ); + setFrameStyle(QFrame::NoFrame); + paletteChanged(); + if (kapp) + { + connect(kapp, SIGNAL(kdisplayPaletteChanged()), + this, SLOT(paletteChanged())); + } + } + + void KitaSubjectLabel::paletteChanged() + { + QPalette p = kapp ? kapp->palette() : palette(); + p.setBrush(QColorGroup::Base, p.brush(QPalette::Normal, QColorGroup::Background)); + p.setColor(QColorGroup::Text, p.color(QPalette::Normal, QColorGroup::Foreground)); + setPalette(p); + } + + QSize KitaSubjectLabel::minimumSizeHint() const + { + QSize ms = minimumSize(); + if ((ms.width() > 0) && (ms.height() > 0)) + return ms; + + int w = 400; + if (ms.width() > 0) + w = ms.width(); + + QString txt = text(); + QSimpleRichText rt(txt, font()); + rt.setWidth(w - 2*frameWidth() - 10); + w = 10 + rt.widthUsed() + 2*frameWidth(); + if (w < ms.width()) + w = ms.width(); + int h = rt.height() + 2*frameWidth(); + if ( h < ms.height()) + h = ms.height(); + + return QSize(w, h); + } + + QSize KitaSubjectLabel::sizeHint() const + { + return minimumSizeHint(); + } + PopupTextBrowser::PopupTextBrowser( QFrame* frame ) : QTextBrowser( frame ) { @@ -427,8 +496,9 @@ void KitaThreadView::setupEx( const Kita::Thread* thread, int serverTime, int mo /* If curreent mode is VIEWMODE_PREVIEW , hide buttons */ if ( m_viewmode == VIEWMODE_PREVIEW ) { - KitaThreadViewBaseLayout->remove( subjectLabel ); - KitaThreadViewBaseLayout->removeItem( layout2 ); + QLayout* Base = layout(); + Base->remove( Subjectframe ); + Base->removeItem( layout2 ); } /* m_serverTime is used for writing */ @@ -961,7 +1031,8 @@ void KitaThreadView::updateInfo(){ setSubjectLabel(Kita::DatManager::thread_boardName(m_datURL), Kita::DatManager::thread_name(m_datURL) + QString( " (%1)" ) - .arg( Kita::DatManager::getMaxResNumber(m_datURL) ) ); + .arg( Kita::DatManager::getMaxResNumber(m_datURL) ), + Kita::DatManager::thread_boardURL( m_datURL ) ); emit showThreadCompleted( Kita::DatManager::thread_url(m_datURL) ); m_domtree->findTextInit(); updateButton(); diff --git a/kita/src/part/kitathreadview.h b/kita/src/part/kitathreadview.h index 140cf8a..87d790a 100644 --- a/kita/src/part/kitathreadview.h +++ b/kita/src/part/kitathreadview.h @@ -17,6 +17,7 @@ #include #include +#include #include "kita2ch.h" #include "libkita/thread.h" @@ -32,6 +33,7 @@ template class QValueStack; namespace Kita { class Access; + class KitaSubjectLabel; class PopupTextBrowser; class ResPopup; } @@ -81,6 +83,7 @@ public: void domApplyChange( QString lbstr, QString hstr, QString fstr, QString anchor, QString cmbstr ); public slots: + void subjectlinkClicked(const QString& URL ); void showThread( const Kita::Thread* thread ); void setFont( const QFont& font ); void slotReloadButton(); @@ -100,6 +103,7 @@ private: // Private attributes KitaHTMLPart* m_threadPart; Kita::PostInfo m_postInfo; Kita::ResPopup* m_popup; + Kita::KitaSubjectLabel* subjectLabel; KitaDomTree* m_domtree; bool m_revsearch; @@ -123,7 +127,7 @@ private: // Private attributes void showPopup( QString innerHTML, QString imgfile ); void insertSearchCombo(); - void setSubjectLabel( const QString& boardName, const QString& threadName ); + void setSubjectLabel( const QString& boardName, const QString& threadName, const QString boardURL ); KitaWriteDialog* openDialog( const Kita::PostInfo& info ); QStringList parseSearchQuery( const QString& input ) const; void updateButton(); @@ -158,10 +162,26 @@ signals: void thread( const Kita::Thread* ); void writeSucceeded(); void bookmarked( const QString& datURL, bool on ); + void openBoardRequested( const QString& URL, bool useTab ); }; namespace Kita { + // reimplement KActiveLabel based KTextBrowser + class KitaSubjectLabel : public KTextBrowser + { + + Q_OBJECT + + public: + KitaSubjectLabel( QWidget *parent, const char * name = 0 ); + + QSize minimumSizeHint() const; + QSize sizeHint() const; + private slots: + void paletteChanged(); + }; + class PopupTextBrowser : public QTextBrowser { public: diff --git a/kita/src/part/kitathreadviewbase.ui b/kita/src/part/kitathreadviewbase.ui index 87ec7ef..a266acb 100644 --- a/kita/src/part/kitathreadviewbase.ui +++ b/kita/src/part/kitathreadviewbase.ui @@ -25,39 +25,24 @@ 0 - + - subjectLabel + Subjectframe - 5 - 5 + 1 + 1 0 0 - - - 0 - 16 - - - Box + NoFrame Raised - - 0 - - - - - - WordBreak|AlignVCenter - @@ -217,5 +202,8 @@ 789c5dd2c972e2301006e03b4fe1821b35e5d8b22ddb353507c8be40c84e32350759928110083b81d4bcfbb8bb2530031cfcfddd965bc24775a7db6939f5a3ca7c211603e9c8be983975b51c8d36bffffcfaae547dee143f1e387ef547a5ea3ad2697f8e355cbf14d7b5d06732c0d21930125ef101fac4288d047006e4cc56b7868997003d601c70c5b13944669ef4b17949b4d573621cc501f0de50c519300226bba56e88b6b96198124f89894ff74e81696887bc23fa898f433e13139586c01152dae63550ec9ac744e631ac0aa4b4d577a2ad6ac39038374c580a7c23a64ae07327c04cd9e7f68132b27c25865e887f4a40b4a7d1210a9de15209316342023951b24c019f2c6504944865b7b021da993f76c4997b8692784d0c427a55164015d9ea3131f0a8fa85d491e20c7845cc384da5887648465442e190b786c517f809d4dcbe84b9a1597948e43ef1c430a2b3aa1125a7edc7869a38d811c758118b0d231f0db5e6c02e7237e4255133aa360d05b16568ee6d0373ae758ebc20e64ce30633641e2621cefc402cead8ec963e3591c9ff32a5f35eff301bbc0f3ffaa3834c8d3f7b93e9ac9cd5e6c3457f345b96b2d5fa6b33996e1bcd7d562c7f5c74355c7797adc6271bb8b1b9cf6aebbc78e2f614ae4d86734dcfcedd7d767179755d74dd344b59ab7ddbb99bdd9b01287b787c7a7e59bae5acfbfae6f9ac79900561c44b0781599c948fcbadfefd59f907bcf223f7 + + subjectlinkClicked(const QString&) + diff --git a/kita/src/pref.cpp b/kita/src/pref.cpp index b8c010a..d21306d 100644 --- a/kita/src/pref.cpp +++ b/kita/src/pref.cpp @@ -16,8 +16,10 @@ #include #include #include +#include #include +#include #include #include #include @@ -42,7 +44,7 @@ KitaPreferences::KitaPreferences() // this is the base class for your preferences dialog. it is now // a Treelist dialog.. but there are a number of other // possibilities (including Tab, Swallow, and just Plain) - QFrame * fontFrame = addPage( i18n( "Font" ), i18n( "Font" ) ); + QVBox * fontFrame = addVBoxPage( i18n( "Font" ), i18n( "Font" ) ); m_fontPage = new KitaFontPrefPage( fontFrame ); connect( m_fontPage, SIGNAL( fontChanged( const QFont& ) ), @@ -51,19 +53,19 @@ KitaPreferences::KitaPreferences() connect( m_fontPage, SIGNAL( threadFontChanged( const QFont& ) ), SIGNAL( threadFontChanged( const QFont& ) ) ); - QFrame * colorFrame = addPage( i18n( "Color" ), i18n( "Color" ) ); + QVBox * colorFrame = addVBoxPage( i18n( "Color" ), i18n( "Color" ) ); m_colorPage = new KitaColorPrefPage( colorFrame ); - QFrame * asciiArtFrame = addPage( i18n( "AsciiArt" ), i18n( "AsciiArt" ) ); + QVBox * asciiArtFrame = addVBoxPage( i18n( "AsciiArt" ), i18n( "AsciiArt" ) ); m_asciiArtPage = new Kita::AsciiArtPrefPage( asciiArtFrame ); - QFrame * uiFrame = addPage( i18n( "User Interface" ), i18n( "User Interface" ) ); + QVBox * uiFrame = addVBoxPage( i18n( "User Interface" ), i18n( "User Interface" ) ); m_uiPage = new Kita::UIPrefPage( uiFrame ); - QFrame * aboneFrame = addPage( i18n( "Abone" ), i18n( "Abone" ) ); + QVBox * aboneFrame = addVBoxPage( i18n( "Abone" ), i18n( "Abone" ) ); m_abonePage = new Kita::AbonePrefPage( aboneFrame ); - QFrame * debugFrame = addPage( i18n( "Debug" ), i18n( "Debug" ) ); + QVBox * debugFrame = addVBoxPage( i18n( "Debug" ), i18n( "Debug" ) ); m_debugPage = new DebugPrefPage( debugFrame ); connect( m_fontPage, SIGNAL( changed() ), SLOT( slotChanged() ) ); @@ -113,56 +115,29 @@ void KitaPreferences::slotChanged() KitaFontPrefPage::KitaFontPrefPage( QWidget* parent ) : KitaFontPrefBase( parent ) { - connect( fontButton, SIGNAL( clicked() ), SLOT( slotFontButtonClicked() ) ); - - connect( threadFontButton, SIGNAL( clicked() ), - SLOT( slotThreadFontButtonClicked() ) ); - - updateButtons(); + FontRequester->setFont( KitaConfig::font() ); + ThreadFontRequester->setFont( KitaConfig::threadFont() ); } void KitaFontPrefPage::apply() { - QFont font = fontButton->font(); + QFont font = FontRequester->font(); KitaConfig::setFont( font ); emit fontChanged( font ); - QFont threadFont = threadFontButton->font(); + QFont threadFont = ThreadFontRequester->font(); KitaConfig::setThreadFont( threadFont ); emit threadFontChanged( threadFont ); } -void KitaFontPrefPage::slotFontButtonClicked() -{ - QFont font = fontButton->font(); - - if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted ) { - fontButton->setText( font.family() + " " + QString::number( font.pointSize() ) ); - fontButton->setFont( font ); - emit changed(); - } -} - -void KitaFontPrefPage::slotThreadFontButtonClicked() +void KitaFontPrefPage::FontSelected(const QFont&) { - QFont threadFont = threadFontButton->font(); - - if ( KFontDialog::getFont( threadFont, false, this ) == QDialog::Accepted ) { - threadFontButton->setText( threadFont.family() + " " + QString::number( threadFont.pointSize() ) ); - threadFontButton->setFont( threadFont ); - emit changed(); - } + emit changed(); } -void KitaFontPrefPage::updateButtons() +void KitaFontPrefPage::ThreadFontSelected(const QFont&) { - QFont font = KitaConfig::font(); - fontButton->setText( font.family() + " " + QString::number( font.pointSize() ) ); - fontButton->setFont( font ); - - QFont threadFont = KitaConfig::threadFont(); - threadFontButton->setText( threadFont.family() + " " + QString::number( threadFont.pointSize() ) ); - threadFontButton->setFont( threadFont ); + emit changed(); } KitaColorPrefPage::KitaColorPrefPage( QWidget *parent ) diff --git a/kita/src/pref.h b/kita/src/pref.h index 33035d6..ec4a9d1 100644 --- a/kita/src/pref.h +++ b/kita/src/pref.h @@ -70,11 +70,8 @@ public: void apply(); public slots: - void slotFontButtonClicked(); - void slotThreadFontButtonClicked(); - -private: - void updateButtons(); + void FontSelected(const QFont&); + void ThreadFontSelected(const QFont&); signals: void fontChanged( const QFont& ); diff --git a/kita/src/threadlistviewbase.ui b/kita/src/threadlistviewbase.ui index 6133efc..829aa2b 100644 --- a/kita/src/threadlistviewbase.ui +++ b/kita/src/threadlistviewbase.ui @@ -97,6 +97,28 @@ reload board + + + KindLabel + + + + 5 + 5 + 0 + 0 + + + + AlignVCenter|AlignLeft + + + 5 + + + unread/read/new threads + + spacer1 diff --git a/kita/src/uiprefbase.ui b/kita/src/uiprefbase.ui index bfc5ced..c41f92b 100644 --- a/kita/src/uiprefbase.ui +++ b/kita/src/uiprefbase.ui @@ -15,272 +15,229 @@ Form1 - + unnamed - + - layout5 + spacer2 + + + Vertical + + + Expanding + + + + 30 + 180 + + + + + + layout4 - + unnamed + + + useTabCheckBox + + + Use new tab when opening the thread(board). + + - layout4 + layout2 - + unnamed - + - useTabCheckBox + MarkLabel - Use new tab when opening the thread(board). + Mark new thread to made: - + - layout2 - - - - unnamed - - - - MarkLabel - - - Mark new thread to made: - - - - - spacer6 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - MarkTimespinBox - - - within - - - hour - - - after last access - - - 24 - - - 0 - - - 24 - - - - - - - - + spacer6 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + - buttonGroup3 - - - Thread - - - - showMailCheckBox - - - - 30 - 40 - 193 - 19 - - - - Show mail address in the thread. - - - - - textLabel1 - - - - 10 - 20 - 270 - 16 - - - - this option affects from the next thread. - - + MarkTimespinBox + + + within + + + hour + + + after last access + + + 24 + + + 0 + + + 24 + + + + - + + + + + buttonGroup3 + + + Thread + + + + unnamed + + - viewGroup - - - Views - - - - threePaneRadio - - - - 20 - 50 - 80 - 19 - - - - Three pane - - - 1 - - - - - twoPaneRadio - - - - 20 - 20 - 120 - 19 - - - - (pseudo) Two pane - - - true - - - 0 - - + textLabel1 + + + this option affects from the next thread. + - + - orderGroup - - - When open the board - - - - numOrderRadio - - - - 20 - 50 - 185 - 19 - - - - Show thread in numerical order - - - 1 - - - - - unreadFirstRadio - - - - 20 - 20 - 250 - 19 - - - - Show unread thread first - - - true - - - 0 - - + showMailCheckBox + + + Show mail address in the thread. + - + - spacer11 + viewGroup - - Horizontal + + Views - - Expanding + + + unnamed + + + + twoPaneRadio + + + (pseudo) Two pane + + + true + + + 0 + + + + + threePaneRadio + + + Three pane + + + 1 + + + + + + + orderGroup - - - 285 - 31 - + + When open the board - - + + + unnamed + + + + unreadFirstRadio + + + Show unread thread first + + + true + + + 0 + + + + + numOrderRadio + + + Show thread in numerical order + + + 1 + + + + + - + - spacer2 + spacer11 - Vertical + Horizontal Expanding - 30 - 180 + 241 + 31 - + -- 2.11.0