Revision: 7197
Author:   nogu.dev
Date:     Sat Jul  9 00:47:37 2011
Log:      * qt4/immodule/qhelpermanager.cpp
  - (QUimHelperManager::parseHelperStr)
    * Call QUimInputContext::updatePosition()
      when candidate-window-position is specified.
    * Call QUimInputContext::updateStyle()
      when candidate-window-style is specified.
    * Call QUimInputContext::readIMConf()
      when help string has custom_reload_notify
      to update style of candidate window dynamically.
* qt4/immodule/quiminputcontext.cpp
  - (QUimInputContext::updatePosition): New.
  - (QUimInputContext::updateStyle): New.
  - (QUimInputContext::readIMConf):
    Call not only updatePosition() but also updateStyle().
* qt4/immodule/quiminputcontext.h
  - (QUimInputContext::updatePosition): New.
  - (QUimInputContext::updateStyle): New.
http://code.google.com/p/uim/source/detail?r=7197

Modified:
 /trunk/qt4/immodule/qhelpermanager.cpp
 /trunk/qt4/immodule/quiminputcontext.cpp
 /trunk/qt4/immodule/quiminputcontext.h

=======================================
--- /trunk/qt4/immodule/qhelpermanager.cpp      Thu Jan  6 18:09:56 2011
+++ /trunk/qt4/immodule/qhelpermanager.cpp      Sat Jul  9 00:47:37 2011
@@ -159,6 +159,12 @@
                 uim_prop_update_custom( ( *it )->uimContext(),
                                         list[ 1 ].toUtf8().data(),
                                         list[ 2 ].toUtf8().data() );
+                if ( list[ 1 ]
+                        == QLatin1String( "candidate-window-position" ) )
+                    ( *it )->updatePosition();
+                if ( list[ 1 ]
+                        == QLatin1String( "candidate-window-style" ) )
+                    ( *it )->updateStyle();
                 break;  /* all custom variables are global */
             }
         }
@@ -170,6 +176,10 @@
         QUimInfoManager *infoManager =
             UimInputContextPlugin::getQUimInfoManager();
         infoManager->initUimInfo();
+
+        QList<QUimInputContext *>::iterator it;
+        for ( it = contextList.begin(); it != contextList.end(); ++it )
+            ( *it )->readIMConf();
     }
 }

=======================================
--- /trunk/qt4/immodule/quiminputcontext.cpp    Sat Jul  9 00:47:01 2011
+++ /trunk/qt4/immodule/quiminputcontext.cpp    Sat Jul  9 00:47:37 2011
@@ -902,12 +902,30 @@
     QUimHelperManager::send_im_change_whole_desktop( name );
 }

-void QUimInputContext::readIMConf()
+void QUimInputContext::updatePosition()
 {
     char * leftp = uim_scm_symbol_value_str( "candidate-window-position" );
     cwin->setAlwaysLeftPosition( leftp && !strcmp( leftp, "left" ) );
     free( leftp );
 }
+
+void QUimInputContext::updateStyle()
+{
+    // don't update window style if deprecated uim-candwin-prog is set
+    char *candwinprog = uim_scm_symbol_value_str( "uim-candwin-prog" );
+    if ( candwinprog ) {
+        free( candwinprog );
+        return;
+    }
+    delete cwin;
+    createCandidateWindow();
+}
+
+void QUimInputContext::readIMConf()
+{
+    updatePosition();
+    updateStyle();
+}

 void QUimInputContext::updateIndicator( const QString &str )
 {
=======================================
--- /trunk/qt4/immodule/quiminputcontext.h      Thu Jan  6 18:09:56 2011
+++ /trunk/qt4/immodule/quiminputcontext.h      Sat Jul  9 00:47:37 2011
@@ -95,6 +95,8 @@

     void commitString( const QString& str );

+    void updatePosition();
+    void updateStyle();
     void readIMConf();

     QUimTextUtil *textUtil() { return mTextUtil; }

Reply via email to