[uim-commit] r633 - trunk/qt

makeinu at freedesktop.org makeinu at freedesktop.org
Fri Feb 11 08:27:38 PST 2005


Author: makeinu
Date: 2005-02-11 08:27:17 -0800 (Fri, 11 Feb 2005)
New Revision: 633

Modified:
   trunk/qt/pref-qt.cpp
   trunk/qt/pref-qt.h
Log:
* qt/pref-qt.h, helper/pref-qt.cpp
  - Comment out SubgroupData.
  - (GroupPageWidget::setupWidgets): Create sub groups directly in this
    function.


Modified: trunk/qt/pref-qt.cpp
===================================================================
--- trunk/qt/pref-qt.cpp	2005-02-11 15:53:16 UTC (rev 632)
+++ trunk/qt/pref-qt.cpp	2005-02-11 16:27:17 UTC (rev 633)
@@ -373,6 +373,7 @@
     vLayout->addWidget( defaultGroupVBox );    
     defaultGroupVBox->hide();
 
+#if 0
     SubgroupData *sd = new SubgroupData( this, group_name );
 
     /* add various widgets to the vbox */
@@ -395,9 +396,48 @@
 
         uim_custom_symbol_list_free( custom_syms );
     }
+#else
+    char **sub_groups = uim_custom_group_subgroups( group_name );
+    char **sgrp;
+    for( sgrp = sub_groups; *sgrp; sgrp++ )
+    {
+        struct uim_custom_group *sgroup_custom =  uim_custom_group_get( *sgrp );
+        QVGroupBox *vbox;
+        if( QString::compare( *sgrp, "main" ) == 0 )
+        {
+            vbox = defaultGroupVBox;
+	    vbox->show();
+        }
+        else
+        {
+            vbox = new QVGroupBox( _FU8(sgroup_custom->label), this );
+            layout()->add( vbox );
+        }
 
+	/* XXX quick hack to use AND expression of groups */
+	QString groups( group_name );
+	groups += " '";
+	groups += *sgrp;
+        char **custom_syms = uim_custom_collect_by_group( groups );
+        if( !custom_syms )
+            continue;
+
+        for( char **custom_sym = custom_syms; *custom_sym; custom_sym++ )
+        {
+            UimCustomItemIface *iface = addCustom( vbox, *custom_sym );
+            if( iface )
+                m_customIfaceList.append( iface );
+        }
+        uim_custom_symbol_list_free( custom_syms );
+
+
+        uim_custom_group_free( sgroup_custom );
+    }
+    uim_custom_symbol_list_free( sub_groups );
+#endif
+
     /* free */
-    delete sd;
+    //delete sd;
     uim_custom_group_free( group );
 
     /* bottom up */
@@ -555,6 +595,7 @@
     }
 }
 
+#if 0
 //-----------------------------------------------------------------------------------
 SubgroupData::SubgroupData( QWidget*parentWidget, const char *parent_group_name )
 {
@@ -607,6 +648,7 @@
         return NULL;
     return gvboxMap[QString(custom_sym)];
 }
+#endif
 
 //--------------------------------------------------------------------------------------
 int main( int argc, char **argv )

Modified: trunk/qt/pref-qt.h
===================================================================
--- trunk/qt/pref-qt.h	2005-02-11 15:53:16 UTC (rev 632)
+++ trunk/qt/pref-qt.h	2005-02-11 16:27:17 UTC (rev 633)
@@ -137,6 +137,7 @@
     QPtrList<UimCustomItemIface> m_customIfaceList;
 };
 
+#if 0
 class SubgroupData {
 public:
     SubgroupData( QWidget *parentWidget, const char *parent_group_name );
@@ -147,6 +148,7 @@
 protected:
     QMap<QString, QVGroupBox*> gvboxMap;
 };
+#endif
 
 
 #endif /* Not def: _UIM_PREF_QT_H_ */



More information about the Uim-commit mailing list