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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/kopete/config/chatwindow
From:       Dennis Nienhüser <earthwings () gentoo ! org>
Date:       2007-10-29 16:31:07
Message-ID: 1193675467.957744.8860.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 730789 by nienhueser:

Make chat style deletion work again (previously not fully ported and thus disabled)


 M  +15 -16    chatwindowconfig.cpp  


--- trunk/KDE/kdenetwork/kopete/kopete/config/chatwindow/chatwindowconfig.cpp \
#730788:730789 @@ -436,22 +436,21 @@
 
 void ChatWindowConfig::slotDeleteChatStyle()
 {
-//	QString styleName = m_styleUi.styleList->selectedItem()->text();
-//	QString stylePathToDelete = m_styleItemMap[m_styleUi.styleList->selectedItem()];
-//	if( ChatWindowStyleManager::self()->removeStyle(stylePathToDelete) )
-//	{
-//		KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18n("It's the \
                deleted style name", "The style %1 was successfully \
                deleted.").arg(styleName));
-//
-		// Get the first item in the stye List.
-//		QString stylePath = (*m_styleItemMap.begin());
-//		m_currentStyle = ChatWindowStyleManager::self()->getStyleFromPool(stylePath);
-//		emitChanged();
-//	}
-//	else
-//	{
-//		KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18n("It's the \
deleted style name", "An error occurred while trying to delete %1 \
                style.").arg(styleName));
-//	}
-	emitChanged();
+	if (!m_styleUi.styleList->selectedItem())
+	{
+		return; // nothing selected
+	}
+
+	QString styleName = m_styleUi.styleList->selectedItem()->text();
+	if( ChatWindowStyleManager::self()->removeStyle(styleName) )
+	{
+		KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18nc("@info", "The \
style <resource>%1</resource> was successfully deleted.", styleName)); \
+		emitChanged(); +	}
+	else
+	{
+		KMessageBox::queuedMessageBox(this, KMessageBox::Sorry, i18nc("@info", "An error \
occurred while trying to delete the <resource>%1</resource> style. Your account might \
not have permission to remove it.", styleName)); +	}
 }
 
 void ChatWindowConfig::slotGetChatStyles()


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

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