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

List:       kde-devel
Subject:    Improvements for "Add applet to panel" dialog [kicker]
From:       "=?UTF-8?Q?Rafael_Fern=C3=A1ndez_L=C3=B3pez?=" <ereslibre () gmail ! com>
Date:       2006-12-01 0:57:46
Message-ID: 93f85fee0611301657v64b725c3h76863778ae9183fd () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Hi,

Wow guys when I was going to bed I came up with an idea [while working on
uiserver, yes ;)]. This improvement is for the benefit of the "Add applet to
panel" dialog, and I really like it.

There are some steps to reproduce what this patch fixes:

1. Add a unique applet to kicker
2. The applet should have disappeared from the list
3. Remove it from kicker

Now you see, it won't be added to the list if you dont:

1. Search another string, so all applets will be checked and it will be
inmediatly added to the list
2. You reopen the dialog

Well, the explanation is that addapplet dialog didn't notice that a
uniqueApplet was removed from kicker so it needs  to be added to the list
again. I've fixed this adding a new signal on pluginmanager.h, so when an
applet is deleted [slotPluginDestroyed] it will emit the signal that a
plugin was deleted.

What addapplet dialog does is really easy, it just re-searches with the
current search string (it doesn't matter if the search string is empty, we
just need to search to have it added to the list).

I attach the patch. Waiting for your comments. If no objections, I will
commit it on monday.

Bye,
Rafael Fernández López.

[Attachment #5 (text/html)]

Hi,<br><br>Wow guys when I was going to bed I came up with an idea [while working on \
uiserver, yes ;)]. This improvement is for the benefit of the &quot;Add applet to \
panel&quot; dialog, and I really like it.<br><br>There are some steps to reproduce \
what this patch fixes: <br><br>1. Add a unique applet to kicker<br>2. The applet \
should have disappeared from the list<br>3. Remove it from kicker<br><br>Now you see, \
it won't be added to the list if you dont:<br><br>1. Search another string, so all \
applets will be checked and it will be inmediatly added to the list <br>2. You reopen \
the dialog<br><br>Well, the explanation is that addapplet dialog didn't notice that a \
uniqueApplet was removed from kicker so it needs&nbsp; to be added to the list again. \
I've fixed this adding a new signal on  pluginmanager.h, so when an applet is deleted \
[slotPluginDestroyed] it will emit the signal that a plugin was deleted.<br><br>What \
addapplet dialog does is really easy, it just re-searches with the current search \
string (it doesn't matter if the search string is empty, we just need to search to \
have it added to the list). <br><br>I attach the patch. Waiting for your comments. If \
no objections, I will commit it on monday.<br><br>Bye,<br>Rafael Fernández \
López.<br>


["patch.diff" (text/plain)]

Index: workspace/kicker/kicker/core/pluginmanager.h
===================================================================
--- workspace/kicker/kicker/core/pluginmanager.h	(revisión: 609479)
+++ workspace/kicker/kicker/core/pluginmanager.h	(copia de trabajo)
@@ -77,6 +77,9 @@ protected:
                                     bool sort,
                                     AppletInfo::List* list);
 
+Q_SIGNALS:
+    void pluginDestroyed();
+
 private Q_SLOTS:
     void slotPluginDestroyed(QObject* plugin);
 
Index: workspace/kicker/kicker/core/pluginmanager.cpp
===================================================================
--- workspace/kicker/kicker/core/pluginmanager.cpp	(revisión: 609479)
+++ workspace/kicker/kicker/core/pluginmanager.cpp	(copia de trabajo)
@@ -244,6 +244,8 @@ void PluginManager::slotPluginDestroyed(
 
     LibUnloader::unload(info->library());
     delete info;
+
+    emit pluginDestroyed();
 }
 
 AppletContainer* PluginManager::createAppletContainer(
Index: workspace/kicker/kicker/ui/addapplet.h
===================================================================
--- workspace/kicker/kicker/ui/addapplet.h	(revisión: 609479)
+++ workspace/kicker/kicker/ui/addapplet.h	(copia de trabajo)
@@ -60,6 +60,7 @@ private Q_SLOTS:
 	void search(const QString &s);
 	void filter(int i);
 	void slotUser1Clicked();
+    void updateAppletList();
 
 private:
 	bool appletMatchesSearch(const AppletInfo *i, const QString &s);
Index: workspace/kicker/kicker/ui/addapplet.cpp
===================================================================
--- workspace/kicker/kicker/ui/addapplet.cpp	(revisión: 609479)
+++ workspace/kicker/kicker/ui/addapplet.cpp	(copia de trabajo)
@@ -88,6 +88,7 @@ AddAppletDialog::AddAppletDialog(Contain
 	connect(m_mainWidgetView->appletListView, SIGNAL(clicked(const QModelIndex&)), \
this, SLOT(selectApplet(const QModelIndex&)));  \
connect(m_mainWidgetView->appletListView, SIGNAL(doubleClicked(const QModelIndex&)), \
this, SLOT(addCurrentApplet(const QModelIndex&)));  connect(this, \
SIGNAL(user1Clicked()), this, SLOT(slotUser1Clicked())); +    \
connect(PluginManager::self(), SIGNAL(pluginDestroyed()), this, \
SLOT(updateAppletList()));  
 	m_selectedType = AppletInfo::Undefined;
 
@@ -287,4 +288,9 @@ void AddAppletDialog::slotUser1Clicked()
 	}
 }
 
+void AddAppletDialog::updateAppletList()
+{
+    search(m_mainWidgetView->appletSearch->text());
+}
+
 #include "addapplet.moc"



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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