I am attaching a diff , that changes the following :
the format toolbar , now checks to see if the system wide variable ( Hidden ) is true or not. if it is true ( to be hidden ) , it does not auto add the format toolbar
i made this change , because i use windows without that format toolbar ( actually , never used it ).
the second change this diff makes its :
every window ( metacontact window ) will have a specific size saved to it. if the size doesnt exist , it will use the default. but if the size were previously saved , it will use it.
i have tested it and it seems to work fine.
if anyone have any ideas or comments , or something , please just let me know.
Yagami
diff -ur old/chatview.cpp new/chatview.cpp
--- old/chatview.cpp 2006-05-23 17:08:11.283794250 +0100
+++ new/chatview.cpp 2006-05-23 17:12:59.161785500 +0100
@@ -316,6 +316,7 @@
if ( !m_mainWindow->isVisible() )
{
+
m_mainWindow->show();
// scroll down post show and layout, otherwise the geometry is wrong to scroll to the bottom.
m_messagePart->keepScrolledDown();
@@ -865,11 +866,14 @@
config->setGroup( contactListGroup );
config->writeEntry( "EnableRichText", editPart()->richTextEnabled() );
config->writeEntry( "EnableAutoSpellCheck", editPart()->autoSpellCheckEnabled() );
+ config->writeEntry("Geometry", m_mainWindow->size());
+
config->sync();
}
void ChatView::loadChatSettings()
{
+
Kopete::ContactPtrList contacts = msgManager()->members();
if ( contacts.count() > 1 )
return; //can't load with more than one other person in the chat
@@ -877,13 +881,17 @@
//read settings for metacontact
QString contactListGroup = QString::fromLatin1("chatwindow_") +
contacts.first()->metaContact()->metaContactId();
+
KConfig* config = KGlobal::config();
+
config->setGroup( contactListGroup );
bool enableRichText = config->readBoolEntry( "EnableRichText", true );
editPart()->slotSetRichTextEnabled( enableRichText );
emit rtfEnabled( this, editPart()->richTextEnabled() );
bool enableAutoSpell = config->readBoolEntry( "EnableAutoSpellCheck", false );
emit autoSpellCheckEnabled( this, enableAutoSpell );
+ QSize size = config->readSizeEntry("Geometry");
+ emit sizeChatWindow( this, size);
}
void ChatView::readOptions()
diff -ur old/chatview.h new/chatview.h
--- old/chatview.h 2006-05-23 17:08:11.283794250 +0100
+++ new/chatview.h 2006-05-23 17:08:26.860767750 +0100
@@ -308,7 +308,7 @@
* Emitted when the state of RTF has changed
*/
void rtfEnabled( ChatView*, bool );
-
+ void sizeChatWindow( ChatView* , QSize );
void autoSpellCheckEnabled( ChatView*, bool );
private slots:
diff -ur old/kopetechatwindow.cpp new/kopetechatwindow.cpp
--- old/kopetechatwindow.cpp 2006-05-23 17:08:11.283794250 +0100
+++ new/kopetechatwindow.cpp 2006-05-23 17:08:26.860767750 +0100
@@ -699,15 +699,17 @@
KCursor::setAutoHideCursor( newView->editWidget(), true, true );
connect( newView, SIGNAL(captionChanged( bool)), this, SLOT(slotSetCaption(bool)) );
connect( newView, SIGNAL(messageSuccess( ChatView* )), this, SLOT(slotStopAnimation( ChatView* )) );
- connect( newView, SIGNAL(rtfEnabled( ChatView*, bool ) ), this, SLOT( slotRTFEnabled( ChatView*, bool ) ) );
connect( newView, SIGNAL(updateStatusIcon( ChatView* ) ), this, SLOT(slotUpdateCaptionIcons( ChatView* ) ) );
connect( newView, SIGNAL(updateChatState( ChatView*, int ) ), this, SLOT( updateChatState( ChatView*, int ) ) );
updateSpellCheckAction();
checkDetachEnable();
newView->loadChatSettings();
- connect( newView, SIGNAL(autoSpellCheckEnabled( ChatView*, bool ) ),
- this, SLOT( slotAutoSpellCheckEnabled( ChatView*, bool ) ) );
+
+ connect( newView, SIGNAL(autoSpellCheckEnabled( ChatView*, bool ) ),this, SLOT( slotAutoSpellCheckEnabled( ChatView*, bool ) ) );
+ connect( newView, SIGNAL(rtfEnabled( ChatView*, bool ) ), this, SLOT( slotRTFEnabled( ChatView*, bool ) ) );
+ connect( newView, SIGNAL(sizeChatWindow( ChatView*, QSize ) ), this, SLOT ( slotSizeChatWindow( ChatView*, QSize ) ) );
+
}
void KopeteChatWindow::checkDetachEnable()
@@ -782,11 +784,11 @@
else
newWindow = windows.at( newWindowIndex );
- newWindow->show();
- newWindow->raise();
detachChatView( detachedView );
newWindow->attachChatView( detachedView );
+ newWindow->show();
+ newWindow->raise();
}
void KopeteChatWindow::slotPreviousTab()
@@ -856,7 +858,7 @@
if( !chatViewList.contains( view ) )
attachChatView( view );
-
+
connect( m_activeView, SIGNAL( canSendChanged(bool) ), this, SLOT( slotUpdateSendEnabled() ) );
//Tell it it is active
@@ -895,6 +897,7 @@
slotUpdateSendEnabled();
m_activeView->editPart()->reloadConfig();
m_activeView->loadChatSettings();
+
}
void KopeteChatWindow::slotUpdateCaptionIcons( ChatView *view )
@@ -1097,13 +1100,30 @@
if ( cv != m_activeView )
return;
- if ( enabled )
- toolBar( "formatToolBar" )->show();
+
+ if ( enabled ) {
+ KConfig* config = KGlobal::config();
+ config->setGroup("KopeteChatWindow Toolbar formatToolBar");
+ bool formatHidden = config->readBoolEntry("Hidden",false);
+ kdDebug(14000) << k_funcinfo << "TOOLBAR formatHidden " << formatHidden<< endl;
+ if (!formatHidden) toolBar( "formatToolBar" )->show();
+ }
else
toolBar( "formatToolBar" )->hide();
updateSpellCheckAction();
}
+void KopeteChatWindow::slotSizeChatWindow( ChatView* cv, QSize size)
+{
+ if ( cv != m_activeView )
+ return ;
+
+ if ( ! size.isEmpty() )
+ resize (size.width(),size.height());
+ kdDebug(14000) << k_funcinfo << this->size() << endl;
+
+}
+
void KopeteChatWindow::slotAutoSpellCheckEnabled( ChatView* view, bool isEnabled )
{
if ( view != m_activeView )
diff -ur old/kopetechatwindow.h new/kopetechatwindow.h
--- old/kopetechatwindow.h 2006-05-23 17:08:11.307795750 +0100
+++ new/kopetechatwindow.h 2006-05-23 17:08:26.860767750 +0100
@@ -211,6 +211,7 @@
void toggleAutoSpellChecking();
void slotRTFEnabled( ChatView*, bool );
+ void slotSizeChatWindow( ChatView* cv, QSize size);
void slotAutoSpellCheckEnabled( ChatView*, bool );
void slotSetCaption( bool );
_______________________________________________ kopete-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kopete-devel
