[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdenetwork/kopete/kopete/chatwindow
From:       Matt Rogers <mattr () kde ! org>
Date:       2007-06-09 1:51:40
Message-ID: 1181353900.362274.21093.nullmailer () svn ! kde ! org
[Download RAW message or body]

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();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic