[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:24:47
Message-ID: 200412062324.47399.ugarro () telefonica ! net
[Download RAW message or body]

> 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


["minicli.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 21:28:27 -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 21:28:28 -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>
@@ -451,7 +451,7 @@
                 <enum>Sunken</enum>
             </property>
         </widget>
-        <widget class="QLabel" row="1" column="0">
+        <widget class="QLabel" row="2" column="0">
             <property name="name">
                 <cstring>lbCommand</cstring>
             </property>
@@ -476,7 +476,7 @@
                 <set>AlignCenter</set>
             </property>
         </widget>
-        <widget class="KHistoryCombo" row="1" column="1">
+        <widget class="KHistoryCombo" row="2" column="1">
             <property name="name">
                 <cstring>cbCommand</cstring>
             </property>
@@ -511,6 +511,25 @@
                 <set>WordBreak|AlignVCenter</set>
             </property>
         </widget>
+	<widget class="QLabel" row="1" 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>

["minicliTextBelow.png" (image/png)]

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

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