[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [patch] Minicli shows app descriptions
From: Unai Garro <ugarro () telefonica ! net>
Date: 2004-12-06 22:27:10
Message-ID: 200412062327.10209.ugarro () telefonica ! net
[Download RAW message or body]
On Monday 06 December 2004 23:24, Unai Garro wrote:
> > I think this is a good improvement, but wouldn't it be better to place
> > the description unter the command ?
>
> Well, imho it looks better on top, since it's related to the icon change.
> The icon and the text both describe the application, so the whole
> description is on top. Rather than a result, I see it as an information on
> what you're about to do. Note you haven't done anything yet until you press
> enter. No results until you accept ;)
>
> Anyway, you have a screenie and patch attached.
>
> I see also as a possibility to replace the "Enter the name" text
> description, but i'm not sure if that's a good thing to do.
>
> For future changes, please experiment with the .ui. I can do fixes, but I
> can't be changing it 100 times to see how it looks like for every request
> ;)
>
> Unai
Ouch, wrong patch, sorry. This one is the one with the text below, as you
asked
["minicliTextBelow.patch" (text/x-diff)]
? minicli_ui.ui_back
Index: minicli.cpp
===================================================================
RCS file: /home/kde/kdebase/kdesktop/minicli.cpp,v
retrieving revision 1.187
diff -u -3 -p -u -r1.187 minicli.cpp
--- minicli.cpp 18 Nov 2004 20:18:26 -0000 1.187
+++ minicli.cpp 6 Dec 2004 22:24:46 -0000
@@ -675,6 +675,31 @@ void Minicli::parseLine( bool final )
if (!wasAutoChecked && willBeAutoChecked)
m_autoCheckedRunInTerm = true;
}
+
+
+ if (m_filterData->uriType()==KURIFilterData::EXECUTABLE)
+ {
+ // Look for desktop file
+ KService::Ptr service = KService::serviceByDesktopName(cmd);
+ if (service && service->isValid() && service->type() == "Application")
+ {
+ QString description =service->genericName();
+ QString name=service->name();
+
+ //If there is no genericName, try with the comment
+ if (description==QString::null || description=="")
+ description=service->comment();
+
+ if (description==QString::null) description="";
+
+ if (name!=QString::null && name !="") description=name+QString(": ")+description;
+ m_dlg->lbDescription->setText(description);
+ }
+ }
+ else
+ {
+ m_dlg->lbDescription->setText("");
+ }
kdDebug (1207) << "Command: " << m_filterData->uri().url() << endl;
kdDebug (1207) << "Arguments: " << m_filterData->argsAndOptions() << endl;
Index: minicli_ui.ui
===================================================================
RCS file: /home/kde/kdebase/kdesktop/minicli_ui.ui,v
retrieving revision 1.27
diff -u -3 -p -u -r1.27 minicli_ui.ui
--- minicli_ui.ui 13 Jul 2004 22:10:12 -0000 1.27
+++ minicli_ui.ui 6 Dec 2004 22:24:46 -0000
@@ -24,7 +24,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>layout4</cstring>
</property>
@@ -102,7 +102,7 @@
</widget>
</hbox>
</widget>
- <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>layout4</cstring>
</property>
@@ -432,7 +432,7 @@
</widget>
</hbox>
</widget>
- <widget class="QFrame" row="3" column="0" rowspan="1" colspan="2">
+ <widget class="QFrame" row="4" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>separator</cstring>
</property>
@@ -511,6 +511,25 @@
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
+ <widget class="QLabel" row="2" column="1">
+ <property name="name">
+ <cstring>lbDescription</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
</grid>
</widget>
<connections>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic