Bug 59080 - [PATCH] Kopete does not keep toolbar settings
Summary: [PATCH] Kopete does not keep toolbar settings
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Chat Window (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 84382 86907 87602 127176 148712 157499 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-28 12:39 UTC by Ralph Jenkin
Modified: 2008-05-31 18:48 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kopete-format-toolbar.patch (2.79 KB, patch)
2007-05-08 22:55 UTC, Josh Berry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Jenkin 2003-05-28 12:39:35 UTC
Version:           0.6.90cvs >= 20030426 (Using KDE 3.1.2) (using KDE KDE 3.1.2)
Installed from:    Debian testing/unstable Packages
Compiler:          (Packages from http://kopete.creativa.cl/debian/sid/cvs) 
OS:          Linux

When I open a new chat, the Format Toolbar is always enabled, and when I disable it it goes away. However, when I open a new chat after closing the first, the Format Toolbar is back. A similar problem occurs when trying to change the icon size on the Format Toolbar, i.e. the change occurs correctly during a given chat, and reverts to the default when opening a new chat.

The problem is worse when using tabs: opening a new chat in a new tab after disabling the Format Toolbar instantly re-enables the Toolbar. In the new tab, the toolbar is marked as enabled, but switching back to the old tab, the toolbar is marked as disabled, even though it is visible. Any further attempts to disable or enable the toolbar at that point results only in the toggling of the tick, the toolbar doggedly remains put.

Now, this is not really an earth shatteringly serious bug or anything, and the short term solution is obvious: live with the damn format toolbar. However, I really never use the thing, and it bugs me everytime I try to disable it.
Comment 1 Olivier Goffart 2003-06-07 10:54:38 UTC
Yes, this RichTextEditor component is not so great in the current state of kopete. 
it needs more works 
Comment 2 Olivier Goffart 2003-06-30 19:25:48 UTC
as the rich text editor is now optional, i close this bug. (because you can remove it if 
you don't need it) 
Comment 3 Alexandre Pereira 2004-06-02 12:34:15 UTC
reopening , because its happening again in latest cvs code
Comment 4 Alexandre Pereira 2004-06-02 12:38:24 UTC
reopening , i mean -> reopen , please :)
Comment 5 Till Gerken 2004-06-02 12:55:26 UTC
Bug reappeared.
Comment 6 Matt Rogers 2004-07-06 23:32:26 UTC
*** Bug 84382 has been marked as a duplicate of this bug. ***
Comment 7 christian 2004-07-12 00:49:22 UTC
hello i just wanted to file this bug too, recent cvs (12.07.2004) here is a picture of the problem : http://www.kha.uni-karlsruhe.de/tmp/bug.png.

this toolbar always re-appears.
Comment 8 Philipp Eberle 2004-07-15 11:54:25 UTC
same for me: i can disable the format toolbar, but it reappears when i open a new chat-window. i am using kopete from kde 3.3 beta1 (kopete 0.8.91, CVS >= 2004 06 26), using the gentoo linux ebuilds in portage.
Comment 9 Christopher J. Bottaro 2004-07-21 18:48:09 UTC
i have this problem also in kde-3.3-beta1.  opening a new tab, closing then reopening a chat window, restarting kopete will all result in the format toolbar reappearing.  also, all my format options (and thus the format toolbar) are greyed out (i.e. unavailable).
Comment 10 Till Gerken 2004-07-21 19:01:57 UTC
Formatting is only available for protocols supporting RTF.
Comment 11 Jason Ahrens 2004-07-27 20:15:48 UTC
The issue with the Kopete Format Bar always being active when the chat window opens (regardless that I turn it off every time) is also present in KDE 3.3.0 beta 2.
Comment 12 Richard Smith 2004-07-29 17:13:53 UTC
As a temporary workaround, you can comment out (add // to the start of) this 
line (around line 216) of kopete/chatwindow/chatview.cpp:

connect( this, SIGNAL( windowCreated()), editpart, 
SLOT(checkToolbarEnabled()) );

Then recompile and reinstall. The format toolbar will then not ever 
automatically appear. Those of you who use pre-compiled packages will have to 
wait for us to fix it, I'm afraid.

Comment 13 Richard Smith 2004-07-31 00:58:32 UTC
When we do fix this, can someone tell the KMail people how? They have the same bug.
Comment 14 robert lindgren 2004-08-18 09:00:13 UTC
This still is present in 3.3.0 final, kopete 0.9.0. pitty.
Comment 15 Matt Rogers 2004-08-20 16:11:17 UTC
*** Bug 86907 has been marked as a duplicate of this bug. ***
Comment 16 Matt Rogers 2004-08-20 16:12:31 UTC
*** Bug 87602 has been marked as a duplicate of this bug. ***
Comment 17 jos poortvliet 2004-09-01 11:08:39 UTC
its very annoying, hope it can get fixed in kde 3.3.1??? please?
Comment 18 Matt Rogers 2004-09-10 05:50:14 UTC
CVS commit by mattr: 

Fix the reappearing format toolbar.

CCMAIL: 59080-done@bugs.kde.org


  M +1 -1      kopetechatwindow.cpp   1.88


--- kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp  #1.87:1.88
@@ -852,5 +852,5 @@ void KopeteChatWindow::setActiveView( QW
         guiFactory()->addClient(view->msgManager());
         createGUI( view->part() );
-
+        readOptions();
         if( m_activeView )
                 m_activeView->setActive( false );


Comment 19 Matt Rogers 2004-09-10 05:51:19 UTC
CVS commit by mattr: 

Backport the reappearing format toolbar fix.

This will be in KDE 3.3.1

CCMAIL: 59080@bugs.kde.org


  M +1 -1      kopetechatwindow.cpp   1.82.2.2


--- kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp  #1.82.2.1:1.82.2.2
@@ -847,5 +847,5 @@ void KopeteChatWindow::setActiveView( QW
         guiFactory()->addClient(view->msgManager());
         createGUI( view->part() );
-
+        readOptions();
         if( m_activeView )
                 m_activeView->setActive( false );


Comment 20 jos poortvliet 2004-09-10 15:38:09 UTC
thanx

great work
Comment 21 Alexandre Pereira 2004-09-10 15:44:40 UTC
this doesnt fix the format toolbar setting , does it ?

Comment 22 Barak Neeman 2004-09-23 18:22:13 UTC
Matt's patch makes chat window "remember" the on/off state of the three toolbars (main, status and format) in the chatwindow. The state also gets saved for the next time you run kopete.

In another bug report people asked for saving of individual toolbar settings for each chat window (per chat-buddy), but it looks like that would take a lot more work.

I'm just happy that i don't have to see that annoying format toolbar anymore :)

thanks!
Comment 23 P. Varet 2004-10-17 15:20:58 UTC
As of KDE 3.3.1, this bug still exists, albeit in a slightly different form:
1) Disable the toolbar;
2) Switch tabs;
3) BUG: the toolbar reappears.

Additionally, Matt's patch seems to have caused bug #89911.

Shall we reopen this until it's fixed for good? It doesn't seem like a very big bug: when switching tabs, the last active tab should save its settings immediately BEFORE the switch. Should Work(tm).
Comment 24 Richard Smith 2004-10-17 16:17:16 UTC
On Sunday 17 October 2004 14:20, Sundance wrote:
> Shall we reopen this until it's fixed for good?

No, #89911 is enough.
Comment 25 Richard Smith 2004-10-20 02:53:30 UTC
CVS commit by lilachaze: 

Apply a different fix to bug #59080 which doesn't cause bug #89911.

Basically, this is a revert of Jason's commit of 28/05/04 which appears to
be bogus; dynamically adding/removing a toolbar is not fundamentally
different to adding/removing toolbar buttons or menu items -- we should not
do it. Plus the existing fix for bug #59080 disabled this behaviour anyway.

CCBUG: 59080
CCBUG: 89911
CCMAIL: matt@matt.rogers.name


  M +0 -1      chatview.cpp   1.171
  M +1 -1      kopetechatwindow.cpp   1.92


--- kdenetwork/kopete/kopete/chatwindow/chatview.cpp  #1.170:1.171
@@ -230,5 +230,4 @@ ChatView::ChatView( Kopete::MessageManag
                 mgr->protocol()->capabilities() );
         connect( editpart, SIGNAL( toggleToolbar(bool)), this, SLOT(slotToggleRtfToolbar(bool)) );
-        connect( this, SIGNAL( windowCreated()), editpart, SLOT(checkToolbarEnabled()) );
 
         m_edit = static_cast<KTextEdit*>( editpart->widget() );

--- kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp  #1.91:1.92
@@ -852,5 +852,5 @@ void KopeteChatWindow::setActiveView( QW
         guiFactory()->addClient(view->msgManager());
         createGUI( view->part() );
-        readOptions();
+        
         if( m_activeView )
                 m_activeView->setActive( false );


Comment 26 Matt Rogers 2004-10-20 03:01:28 UTC
CVS commit by mattr: 

Backport the fixes for 59080 and 89911. Should be in KDE 3.3.2
BUG: 89911
CCBUG: 59080


  M +0 -1      chatview.cpp   1.155.2.2
  M +1 -1      kopetechatwindow.cpp   1.82.2.3


--- kdenetwork/kopete/kopete/chatwindow/chatview.cpp  #1.155.2.1:1.155.2.2
@@ -217,5 +217,4 @@ ChatView::ChatView( KopeteMessageManager
                 mgr->protocol()->richTextCapabilities() );
         connect( editpart, SIGNAL( toggleToolbar(bool)), this, SLOT(slotToggleRtfToolbar(bool)) );
-        connect( this, SIGNAL( windowCreated()), editpart, SLOT(checkToolbarEnabled()) );
 
         m_edit = static_cast<KTextEdit*>( editpart->widget() );

--- kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp  #1.82.2.2:1.82.2.3
@@ -847,5 +847,5 @@ void KopeteChatWindow::setActiveView( QW
         guiFactory()->addClient(view->msgManager());
         createGUI( view->part() );
-        readOptions();
+        
         if( m_activeView )
                 m_activeView->setActive( false );


Comment 27 Brett Miller 2006-10-13 01:24:59 UTC
I am having this same problem with version 0.12.2 (KDE 3.5.2), the only difference being when using tabs. After marking the format tool bar as enabed and switching tabs in the new tab the tool bar is visable and marked as enabled. After switching back to the original tab the tool bar is now visable again and is marked as enabled, where as in the original bug it was still marked as disabled.
Comment 28 Benjamin Dietrich 2006-11-10 01:22:08 UTC
I have the problem in 3.5.5 with kopete 0.12.3 on my jabber account... when i have a icq/msn chatwindow/tab open, everything works fine... its just jabber + format-toolbar -_-
Comment 29 Paul Thomas 2007-02-14 17:50:23 UTC
I have this same problem with Kopete 0.12.4. The formatting toolbar does not keep its setting to stay hidden. This just annoys me. I couldn't find the spot to re-open this bug or I would.
Comment 30 Philip Rodrigues 2007-02-14 21:31:13 UTC
Reopening due to feedback in the last few comments
Comment 31 Josh Berry 2007-05-05 19:45:20 UTC
Also seeing the problem in Kopete 0.12.4 (KDE 3.5.6).
Comment 32 Josh Berry 2007-05-08 22:55:22 UTC
Created attachment 20518 [details]
kopete-format-toolbar.patch

This has been driving me absolutely batty for a long time, so I wrote a patch
against the 3.5 branch (attached).

KMainWindow's standard way of tracking toolbar visibility doesn't work for the
format toolbar.  This is because the format toolbar is automatically
shown/hidden based on whether or not the protocol(I think?) supports rich text.
 So it would be automatically shown every time the user opened a chat window
using such a protocol.

The solution is to keep a separate, special config option based not on whether
the toolbar is actually visible or not, but on the *last specific show/hide
request* the user made.  (Then, of course, only show the toolbar if the user
requested it.)	This preserves the toolbar visibility even when it is
automatically shown/hidden due to RTFness.

It has to be a separate option because otherwise there is no way to know if the
toolbar was hidden because the user requested it, or because the protocol
doesn't support rich text.

I preserved the existing default of "show the toolbar if it's supported".

Please review and commit if it's OK.  Thanks!
Comment 33 Matt Rogers 2007-06-09 03:51:43 UTC
SVN commit 673118 by mattr:

Commit patch by Josh Berry to fix bug 59080.
Thanks for the patch!

BUG: 59080



 M  +17 -1     kopetechatwindow.cpp  
 M  +3 -0      kopetechatwindow.h  


--- branches/KDE/3.5/kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp #673117:673118
@@ -216,6 +216,8 @@
 
 	KGlobal::config()->setGroup( QString::fromLatin1("ChatWindowSettings") );
 	m_alwaysShowTabs = KGlobal::config()->readBoolEntry( QString::fromLatin1("AlwaysShowTabs"), false );
+	m_showFormatToolbar = KGlobal::config()->readBoolEntry( QString::fromLatin1("Show Format Toolbar"), true );
+	adjustingFormatToolbar = false;
 //	kdDebug( 14010 ) << k_funcinfo << "Open Windows: " << windows.count() << endl;
 	kapp->ref();
 }
@@ -418,6 +420,9 @@
 
 	setXMLFile( QString::fromLatin1( "kopetechatwindow.rc" ) );
 	createGUI( 0L );
+
+	// Special handling for remembering whether the format toolbar is visible or not
+	connect ( toolBar("formatToolBar"), SIGNAL(visibilityChanged(bool)), this, SLOT(slotToggleFormatToolbar(bool)) );
 }
 
 const QString KopeteChatWindow::fileContents( const QString &path ) const
@@ -1029,6 +1034,7 @@
 	KConfig *config = KGlobal::config();
 	applyMainWindowSettings( config, QString::fromLatin1( "KopeteChatWindow" ) );
 	config->setGroup( QString::fromLatin1("ChatWindowSettings") );
+	m_showFormatToolbar = config->readBoolEntry( QString::fromLatin1("Show Format Toolbar"), true );
 }
 
 void KopeteChatWindow::saveOptions()
@@ -1043,6 +1049,7 @@
 	if( m_tabBar )
 		config->writeEntry ( QString::fromLatin1("Tab Placement"), m_tabBar->tabPosition() );
 
+	config->writeEntry( QString::fromLatin1("Show Format Toolbar"), m_showFormatToolbar );
 	config->sync();
 }
 
@@ -1072,6 +1079,13 @@
 		statusBar()->show();
 }
 
+void KopeteChatWindow::slotToggleFormatToolbar(bool visible)
+{
+	if ( adjustingFormatToolbar )
+		return;
+	m_showFormatToolbar = visible;
+}
+
 void KopeteChatWindow::slotViewMenuBar()
 {
 	if( !menuBar()->isHidden() )
@@ -1092,10 +1106,12 @@
 	if ( cv != m_activeView )
 		return;
 
-	if ( enabled )
+	adjustingFormatToolbar = true;
+	if ( enabled && m_showFormatToolbar )
 		toolBar( "formatToolBar" )->show();
 	else
 		toolBar( "formatToolBar" )->hide();
+	adjustingFormatToolbar = false;
 	updateSpellCheckAction();
 }
 
--- branches/KDE/3.5/kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.h #673117:673118
@@ -127,6 +127,8 @@
 	ChatView *m_activeView;
 	ChatView *m_popupView;
 	bool m_alwaysShowTabs;
+	bool m_showFormatToolbar;
+	bool adjustingFormatToolbar;
 	bool updateBg;
 	KTabWidget *m_tabBar;
 	KPushButton *m_button_send;
@@ -200,6 +202,7 @@
 
 	void slotViewMenuBar();
 	void slotToggleStatusBar();
+	void slotToggleFormatToolbar( bool );
 
 	void slotConfKeys();
 	void slotConfToolbar();
Comment 34 Matt Rogers 2007-06-09 07:20:44 UTC
*** Bug 127176 has been marked as a duplicate of this bug. ***
Comment 35 Jan Ritzerfeld 2007-08-10 20:02:29 UTC
*** Bug 148712 has been marked as a duplicate of this bug. ***
Comment 36 Martin Ammermüller 2007-12-17 22:58:52 UTC
Same problem here using kopete version 0.40.3, KDE 3.97.1, SVN checkout today. Format Toolbar status not saved for jabber chat/single message windows.
Comment 37 Josh Berry 2008-03-02 23:44:56 UTC
I can confirm this bug has regressed.  Please reopen.
Comment 38 Dennis Nienhüser 2008-05-14 14:54:07 UTC
Reopening, still (or again, probably related to porting to QT 4) present in SVN trunk.
Comment 39 Dennis Nienhüser 2008-05-14 14:55:01 UTC
*** Bug 157499 has been marked as a duplicate of this bug. ***
Comment 40 Manuel López-Ibáñez 2008-05-14 15:00:17 UTC
I have this bug in kopete 0.12.4. Not sure which one is the latest version in KDE 3.5.
Comment 41 Manuel López-Ibáñez 2008-05-14 15:11:15 UTC
In addition, the toolbar settings doesn't make any sense. First, there seems to be only 3 toolbars in Settings->Toolbars: "Main Toolbar", "Status" and "Format Toolbar". However, in "Congure Toolbars..." there are 6 toolbars and the particular toolbars change depending on the particular protocol of the chat window. Problems:

1) I cannot move the "Picture/Avatar" icon to the main toolbar. 

2) The picture/avatar only works for MSN.

3) I need to edit the MSN toolbar to remove icons that already appear in the main toolbar or that I never use ("Webcam" icons). However, since there is another status bar, those changes only work for MSN, which is very confusing.

Not sure what is the status of all this in trunk and whether I should open bug reports for these issues.
Comment 42 Bernd Buschinski 2008-05-19 17:35:28 UTC
Still present for me with kopete-0.50.1/kde-4.0.4

I cant hide the "Format Toolbar", it always comes back when I reopen the chatwindow or if I use the chatwindow with tabs when I switch from one to another
Comment 43 Matt Rogers 2008-05-31 18:48:24 UTC
Fixed by SVN revision 814689 and backported to KDE 4.0.x in revision 814670