[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:       2008-05-19 11:13:34
Message-ID: 1211195614.468472.25901.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 809740 by nienhueser:

Merge branch 'simplify_emoticon_configuration'


 M  +9 -86     chatwindowconfig.cpp  
 M  +1 -5      chatwindowconfig.h  
 M  +14 -123   chatwindowconfig_emoticons.ui  


--- trunk/KDE/kdenetwork/kopete/kopete/config/chatwindow/chatwindowconfig.cpp \
#809739:809740 @@ -50,6 +50,7 @@
 #include <kfiledialog.h>
 #include <kurl.h>
 #include <kemoticons.h>
+#include <KCMultiDialog>
 
 // KNewStuff
 #include <knewstuff2/engine.h>
@@ -207,14 +208,10 @@
 	addConfig( Kopete::AppearanceSettings::self(), emoticonsWidget );
 
 	connect(m_emoticonsUi.icon_theme_list, SIGNAL(itemSelectionChanged()),
-		this, SLOT(slotSelectedEmoticonsThemeChanged()));
-	connect(m_emoticonsUi.btnInstallTheme, SIGNAL(clicked()),
-		this, SLOT(slotInstallEmoticonTheme()));
+		this, SLOT(emitChanged()));
 
-	connect(m_emoticonsUi.btnGetThemes, SIGNAL(clicked()),
-		this, SLOT(slotGetEmoticonThemes()));
-	connect(m_emoticonsUi.btnRemoveTheme, SIGNAL(clicked()),
-		this, SLOT(slotRemoveEmoticonTheme()));
+	connect(m_emoticonsUi.btnManageThemes, SIGNAL(clicked()),
+		this, SLOT(slotManageEmoticonThemes()));
 
 //--------- colors tab --------------------------
 	QWidget *colorsWidget = new QWidget(m_tab);
@@ -626,16 +623,6 @@
 	emitChanged();
 }
 
-void ChatWindowConfig::slotUpdateEmoticonsButton(bool _b)
-{
-	QListWidgetItem *item = m_emoticonsUi.icon_theme_list->currentItem();
-	if (!item)
-		return;
-	QString themeName = item->text();
-	QFileInfo fileInf(KGlobal::dirs()->findResource("emoticons", themeName+'/'));
-	m_emoticonsUi.btnRemoveTheme->setEnabled( _b && fileInf.isWritable());
-	m_emoticonsUi.btnGetThemes->setEnabled( false );
-}
 
 void ChatWindowConfig::updateEmoticonList()
 {
@@ -674,81 +661,17 @@
 		m_emoticonsUi.icon_theme_list->setCurrentItem( 0 );
 }
 
-void ChatWindowConfig::slotSelectedEmoticonsThemeChanged()
-{
-	QListWidgetItem *item = m_emoticonsUi.icon_theme_list->currentItem();
-	if (!item)
-		return;
-	QString themeName = item->text();
-	QFileInfo fileInf(KGlobal::dirs()->findResource("emoticons", themeName+'/'));
-	m_emoticonsUi.btnRemoveTheme->setEnabled( fileInf.isWritable() );
 
-	emitChanged();
-}
-
-void ChatWindowConfig::slotInstallEmoticonTheme()
+void ChatWindowConfig::slotManageEmoticonThemes()
 {
-	KUrl themeURL = KUrlRequesterDialog::getUrl(QString::null, \
                this,	//krazy:exclude=nullstrassign for old broken gcc
-			i18n("Drag or Type Emoticon Theme URL"));
-	if ( themeURL.isEmpty() )
-		return;
-
-	//TODO: support remote theme files!
-	if ( !themeURL.isLocalFile() )
-	{
-		KMessageBox::queuedMessageBox( this, KMessageBox::Error, i18n("Sorry, emoticon \
                themes must be installed from local files."),
-		                               i18n("Could Not Install Emoticon Theme") );
-		return;
-	}
-
-	Kopete::Emoticons::self()->installTheme( themeURL.path() );
+	KCMultiDialog *kcm = new KCMultiDialog( this );
+	kcm->setCaption( i18n( "Configure Emoticon Themes" ) );
+	kcm->addModule( "emoticons" );
+	kcm->exec();
 	updateEmoticonList();
 }
 
-void ChatWindowConfig::slotRemoveEmoticonTheme()
-{
-	QListWidgetItem *selected = m_emoticonsUi.icon_theme_list->currentItem();
-	if(!selected)
-		return;
 
-	QString themeName = selected->text();
-
-	QString question=i18nc("@info", "Are you sure you want to remove the "
-			"<resource>%1</resource> emoticon theme?<br />"
-			"<br />"
-			"<warning>This will delete all files installed by this theme.</warning>",
-		themeName);
-
-        int res = KMessageBox::warningContinueCancel(this, question, \
                i18n("Confirmation"),KStandardGuiItem::del());
-	if (res!=KMessageBox::Continue)
-		return;
-
-	KUrl themeUrl(KGlobal::dirs()->findResource("emoticons", themeName+'/'));
-	KIO::NetAccess::del(themeUrl, this);
-
-	updateEmoticonList();
-}
-
-void ChatWindowConfig::slotGetEmoticonThemes()
-{
-#ifdef __GNUC__
-#warning "Port KNS changes!"
-#endif
-#if 0
-	KConfigGroup config(KGlobal::config(), "KNewStuff");
-	config.writeEntry( "ProvidersUrl",
-						"http://download.kde.org/khotnewstuff/emoticons-providers.xml" );
-	config.writeEntry( "StandardResource", "emoticons" );
-	config.writeEntry( "Uncompress", "application/x-gzip" );
-	config.sync();
-
-	KNS::DownloadDialog::open( "emoticons", i18n( "Get New Emoticons") );
-
-	updateEmoticonList();
-#endif
-}
-
-
 void ChatWindowConfig::emitChanged()
 {
 	emit changed( true );
--- trunk/KDE/kdenetwork/kopete/kopete/config/chatwindow/chatwindowconfig.h \
#809739:809740 @@ -61,11 +61,7 @@
 	void slotLoadChatStyles();
 	void slotUpdateChatPreview();
 	//----- Emoticons TAB ---------------------
-	void slotSelectedEmoticonsThemeChanged();
-	void slotInstallEmoticonTheme();
-	void slotRemoveEmoticonTheme();
-	void slotGetEmoticonThemes();
-	void slotUpdateEmoticonsButton(bool);
+	void slotManageEmoticonThemes();
 
 private:
 	//----- Style TAB ---------------------
--- trunk/KDE/kdenetwork/kopete/kopete/config/chatwindow/chatwindowconfig_emoticons.ui \
#809739:809740 @@ -5,12 +5,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>481</width>
-    <height>353</height>
+    <width>535</width>
+    <height>333</height>
    </rect>
   </property>
   <layout class="QGridLayout" >
-   <item row="0" column="0" colspan="4" >
+   <item row="0" column="0" colspan="2" >
     <widget class="QCheckBox" name="kcfg_useEmoticons" >
      <property name="sizePolicy" >
       <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
@@ -22,98 +22,37 @@
       <string>If this is checked, the text representation of emoticons in messages \
will be replaced by an image</string>  </property>
      <property name="text" >
-      <string>U&amp;se emoticons</string>
+      <string>U&amp;se the following emoticon theme:</string>
      </property>
      <property name="checked" >
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="1" column="0" colspan="4" >
-    <widget class="QLabel" name="textLabel1" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="focusPolicy" >
-      <enum>Qt::NoFocus</enum>
-     </property>
-     <property name="text" >
-      <string>Select emoticon theme:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="4" >
+   <item row="1" column="0" colspan="2" >
     <widget class="QListWidget" name="icon_theme_list" >
      <property name="alternatingRowColors" >
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="3" column="0" >
-    <widget class="QPushButton" name="btnGetThemes" >
-     <property name="enabled" >
-      <bool>false</bool>
-     </property>
+   <item row="2" column="1" >
+    <widget class="QPushButton" name="btnManageThemes" >
      <property name="sizePolicy" >
       <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="whatsThis" >
-      <string>Download emoticon theme from the Internet</string>
-     </property>
      <property name="text" >
-      <string>&amp;Get New Themes...</string>
+      <string>&amp;Manage emoticons...</string>
      </property>
     </widget>
    </item>
-   <item row="3" column="1" >
-    <widget class="QPushButton" name="btnInstallTheme" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text" >
-      <string>&amp;Install Theme File...</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="2" >
-    <widget class="QPushButton" name="btnRemoveTheme" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text" >
-      <string>Remove &amp;Theme</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="3" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Preferred</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>31</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
+  <zorder>kcfg_useEmoticons</zorder>
+  <zorder>icon_theme_list</zorder>
+  <zorder>btnManageThemes</zorder>
  </widget>
  <layoutdefault spacing="6" margin="11" />
  <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
@@ -122,7 +61,7 @@
   <connection>
    <sender>kcfg_useEmoticons</sender>
    <signal>toggled(bool)</signal>
-   <receiver>textLabel1</receiver>
+   <receiver>icon_theme_list</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
@@ -130,58 +69,10 @@
      <y>20</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>20</x>
-     <y>20</y>
+     <x>267</x>
+     <y>160</y>
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>kcfg_useEmoticons</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>btnGetThemes</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>kcfg_useEmoticons</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>btnInstallTheme</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>kcfg_useEmoticons</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>btnRemoveTheme</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
  </connections>
 </ui>


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

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