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

List:       kopete-devel
Subject:    Re: [Kopete-devel] Re: Suggestions
From:       David Levitan <david () dlevitan ! com>
Date:       2003-07-30 18:18:13
[Download RAW message or body]

David Levitan wrote:
> Matt Rogers wrote:
> 
>> On Wednesday 30 July 2003 09:49 am, David Levitan wrote:
>>
>>> 3. Template reload - it seems like the only way to reload templates is
>>> to quit and restart kopete. I haven't looked around to find out why this
>>> is the case, but is there a reason for this? I would prefer changes to
>>> be immediate, even if it does require reprocessing the templates.
>>
>>
>>
>> What do you mean by templates? If you're talking about the message 
>> styles, I can change those on the fly, and it worked the last time I 
>> tried it about a week ago to set up my own custom style
>>
> 
> Ack, sorry - wrong name. Every XSLT app has a different name for them. 
> Anyway, I've found the bug. If you have a custom style already applied, 
> then edit it, save the changes, and click apply, nothing will be 
> updated. If, on the other hand, you select another style, click apply, 
> reselect the custom style and click apply again the new style applies 
> correctly.
> 
> -David
> 

After talking a bit on IRC, here's a patch that detects whether the 
style sheet has either changed (name) or if someone has 
edited/copied/imported a stylesheet. It's not perfect, but it'll apply 
stylesheets only when a user modifies custom stylesheets or changes the 
stylesheet that is being used.
-David

["patch" (text/plain)]

? patch
? protocols/irc/pixmaps/Makefile
? protocols/irc/pixmaps/Makefile.in
Index: kopete/conf/appearanceconfig.cpp
===================================================================
RCS file: /home/kde/kdenonbeta/kopete/kopete/conf/appearanceconfig.cpp,v
retrieving revision 1.75
diff -u -3 -p -r1.75 appearanceconfig.cpp
--- kopete/conf/appearanceconfig.cpp	26 Jul 2003 21:50:04 -0000	1.75
+++ kopete/conf/appearanceconfig.cpp	30 Jul 2003 18:16:41 -0000
@@ -160,6 +160,7 @@ AppearanceConfig::AppearanceConfig(QWidg
 	// ==========================================================================
 
 	errorAlert = false;
+	styleChanged = false;
 	slotTransparencyChanged(mPrfsChatWindow->mTransparencyEnabled->isChecked());
 }
 
@@ -179,7 +180,8 @@ void AppearanceConfig::save()
 	p->setTransparencyEnabled( mPrfsChatWindow->mTransparencyEnabled->isChecked() );
 	p->setTransparencyValue( mPrfsChatWindow->mTransparencyValue->value() );
 	p->setBgOverride( mPrfsChatWindow->mTransparencyBgOverride->isChecked() );
-	p->setStyleSheet( itemMap[ mPrfsChatWindow->styleList->selectedItem() ] );
+	if( styleChanged || p->styleSheet() != itemMap[ mPrfsChatWindow->styleList->selectedItem() ] )
+		p->setStyleSheet( itemMap[ mPrfsChatWindow->styleList->selectedItem() ] );
 
 
 	// "Colors & Fonts" TAB =====================================================
@@ -194,6 +196,7 @@ void AppearanceConfig::save()
 
 	p->save();
 	errorAlert = false;
+	styleChanged = false;
 }
 
 void AppearanceConfig::reopen()
@@ -525,6 +528,7 @@ void AppearanceConfig::addStyle( const Q
 			itemMap.insert( mPrfsChatWindow->styleList->firstItem(), filePath );
 			mPrfsChatWindow->styleList->setSelected( mPrfsChatWindow->styleList->firstItem(), true );
 			mPrfsChatWindow->styleList->sort();
+			styleChanged = true;
 		}
 		else
 		{
Index: kopete/conf/appearanceconfig.h
===================================================================
RCS file: /home/kde/kdenonbeta/kopete/kopete/conf/appearanceconfig.h,v
retrieving revision 1.28
diff -u -3 -p -r1.28 appearanceconfig.h
--- kopete/conf/appearanceconfig.h	17 Jun 2003 18:45:05 -0000	1.28
+++ kopete/conf/appearanceconfig.h	30 Jul 2003 18:16:41 -0000
@@ -95,6 +95,7 @@ private:
 	QMap<QListBoxItem*,QString> itemMap;
 	QString currentStyle;
 	bool errorAlert;
+	bool styleChanged;
 
 private:
 	void updateHighlight();
Index: libkopete/private/kopeteprefs.cpp
===================================================================
RCS file: /home/kde/kdenonbeta/kopete/libkopete/private/kopeteprefs.cpp,v
retrieving revision 1.17
diff -u -3 -p -r1.17 kopeteprefs.cpp
--- libkopete/private/kopeteprefs.cpp	19 Jun 2003 15:56:59 -0000	1.17
+++ libkopete/private/kopeteprefs.cpp	30 Jul 2003 18:16:41 -0000
@@ -215,12 +215,10 @@ void KopetePrefs::setSoundIfAway(bool va
 
 void KopetePrefs::setStyleSheet(const QString &value)
 {
-	if( mStyleSheet != value )
-	{
-		mStyleSheet = value;
-		mStyleContents = fileContents( mStyleSheet );
-		emit( messageAppearanceChanged() );
-	}
+	kdDebug(14000) << "setStyleSheet called." << endl;
+	mStyleSheet = value;
+	mStyleContents = fileContents( mStyleSheet );
+	emit( messageAppearanceChanged() );
 }
 
 void KopetePrefs::setFontFace( const QFont &value )


_______________________________________________
Kopete-devel mailing list
Kopete-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kopete-devel


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

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