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

List:       kde-commits
Subject:    kdereview/ktranslator
From:       Raul Fernandes <rgfbr () yahoo ! com ! br>
Date:       2005-09-13 22:44:31
Message-ID: 1126651471.871975.18632.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 460464 by rgfbr:

Add option to not show details about word (inflections and part of speech)
Remove commas from words


 M  +2 -0      ChangeLog  
 M  +0 -2      TODO  
 M  +25 -17    advancedsettings.ui  
 M  +4 -2      ktranslator.cpp  
 M  +5 -0      ktranslator.kcfg  


--- trunk/kdereview/ktranslator/ChangeLog #460463:460464
@@ -4,6 +4,8 @@
    Add StarDict plugin
    Add option to choose the font of popup window
    Add option to enable/disable the need of modifier key to translate the word (only \
clipboard plugin) +   Add option to not show details about word (inflections and part \
of speech) +   Remove commas from words
 
 2005-09-10
    Changed the format of ktranslator plugin. It should be a specially formatted DICT \
                file now.
--- trunk/kdereview/ktranslator/TODO #460463:460464
@@ -1,5 +1,4 @@
 Plugin for DICT servers
-Plugin for StarDict dictionaries
 Trim the selected word (remove commas, periods and others)
 Add support to KNewStuff
 Add support to add new words and send them through Internet
@@ -7,7 +6,6 @@
 Add a "index" plugins framework to support inflexions in more languages
 Add option to start the KTranslator in KDE login
 Add option to choose what sites the word will be searched in "Search in Internet"
-Be able to turn off extra info about the word. Only the translation
 Support for Hebrew and Japanese languages
 Add a spell check and other types of search
 
--- trunk/kdereview/ktranslator/advancedsettings.ui #460463:460464
@@ -9,7 +9,7 @@
             <x>0</x>
             <y>0</y>
             <width>295</width>
-            <height>128</height>
+            <height>156</height>
         </rect>
     </property>
     <property name="caption">
@@ -19,15 +19,20 @@
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
-        <widget class="QLabel" row="0" column="0">
+        <widget class="KURLRequester" row="4" column="0">
             <property name="name">
-                <cstring>textLabel1_4</cstring>
+                <cstring>kcfg_FestivalBinary</cstring>
             </property>
-            <property name="text">
-                <string>Font for Popup Window</string>
+            <property name="sizePolicy">
+                <sizepolicy>
+                    <hsizetype>0</hsizetype>
+                    <vsizetype>0</vsizetype>
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                </sizepolicy>
             </property>
         </widget>
-        <widget class="QLabel" row="2" column="0">
+        <widget class="QLabel" row="3" column="0">
             <property name="name">
                 <cstring>textLabel1</cstring>
             </property>
@@ -43,31 +48,34 @@
                 <string>Festival binary:</string>
             </property>
         </widget>
-        <widget class="KFontRequester" row="1" column="0">
+        <widget class="KFontRequester" row="2" column="0">
             <property name="name">
                 <cstring>kcfg_ResultFont</cstring>
             </property>
         </widget>
-        <widget class="KURLRequester" row="3" column="0">
+        <widget class="QLabel" row="1" column="0">
             <property name="name">
-                <cstring>kcfg_FestivalBinary</cstring>
+                <cstring>textLabel1_4</cstring>
             </property>
-            <property name="sizePolicy">
-                <sizepolicy>
-                    <hsizetype>0</hsizetype>
-                    <vsizetype>0</vsizetype>
-                    <horstretch>0</horstretch>
-                    <verstretch>0</verstretch>
-                </sizepolicy>
+            <property name="text">
+                <string>Font for Popup Window</string>
             </property>
         </widget>
+        <widget class="QCheckBox" row="0" column="0">
+            <property name="name">
+                <cstring>kcfg_ShowDetails</cstring>
+            </property>
+            <property name="text">
+                <string>Show details about translations</string>
+            </property>
+        </widget>
     </grid>
 </widget>
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>
-    <includehint>kfontrequester.h</includehint>
     <includehint>kurlrequester.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kpushbutton.h</includehint>
+    <includehint>kfontrequester.h</includehint>
 </includehints>
 </UI>
--- trunk/kdereview/ktranslator/ktranslator.cpp #460463:460464
@@ -173,7 +173,7 @@
     QTime time;
   #endif
 
-  word.remove( "." ); // remove dots from the word
+  word.remove( "." ).remove( "," ).remove( ";" ); // remove dots and commas from the \
word  word = word.lower().stripWhiteSpace();
   result += "<tr><td><b>" + i18n( "Word to translate:" ) + "<br><font color=" + \
config::headwordColor().name() + ">" + word + "</font><br></b></td></tr>";  
@@ -181,7 +181,7 @@
   QString indexResult = searchIndex( word );
   // test if searchIndex returns something
   // if yes, show it
-  if( !indexResult.isEmpty() ) result += "<tr><td>" + indexResult + "</td></tr>";
+  if( !indexResult.isEmpty() && config::showDetails() ) result += "<tr><td>" + \
indexResult + "</td></tr>";  
   QString dicResult;
   // search in dictionaries
@@ -207,6 +207,8 @@
   {
     result += "</table></body></html>";
 
+    if( !config::showDetails() ) result.replace( QRegExp( "<pos>[^<]</pos>" ), "" );
+
     // dictionary name
     result.replace( "<dicName>", "<font color=" + config::nameColor().name() + \
"><b>" );  result.replace( "</dicName>", "</b></font><br>" );
--- trunk/kdereview/ktranslator/ktranslator.kcfg #460463:460464
@@ -87,5 +87,10 @@
       <whatsthis>Font for Results Window.</whatsthis>
       <default></default>
     </entry>
+    <entry name="ShowDetails" type="Bool">
+      <label>Show details about words.</label>
+      <whatsthis>Show details about words.</whatsthis>
+      <default code="true">true</default>
+    </entry>
   </group>
 </kcfg>


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

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