Ejemplo n.º 1
0
 def onImComboBoxChanged(self, widget, data=None):
     selectedIndex = self.imCb.get_active()
     if selectedIndex == -1 or self.imCbIndexDic == None:
         return
     imCbData = self.imCbIndexDic[selectedIndex]
     if imCbData == "LangLabel":
         nextIndex = self.imCb.get_active() + 1
         self.imCb.set_active(nextIndex)
         self.onImComboBoxChanged(self.imCb)
     if imCbData == "AddRemoveBtn":
         # trigger the Add/Remove Widget
         IlAdvance.DialogWidget(
             self, self.curIl, self.curKb, self.curImInfoDic, self.window, IlUtil.AddRmImPage, self.saveMode
         )
     if type(imCbData) is ListType:
         # check if detail btn is available
         if imCbData[IlUtil.InfoUuid] in IlUtil.SetupModuleDic:
             self.detailBtn.set_sensitive(True)
             if self.detailHandlerId != None:
                 self.detailBtn.disconnect(self.detailHandlerId)
             self.detailHandlerId = self.detailBtn.connect(
                 "button-release-event", self.onDetailBtnPressed, imCbData[IlUtil.InfoUuid]
             )
         else:
             self.detailBtn.set_sensitive(False)
         # change it to max pri im
         self.curImInfoDic = IlUtil.setUuidWithMaxPri(
             imCbData[IlUtil.InfoUuid], self.curImInfoDic.copy(), self.curIl
         ).copy()
     if self.saveMode == IlUtil.IS:
         # save im data immediately
         self.saveNRXconfig()
Ejemplo n.º 2
0
 def setImInfoDic(self, inputImInfoDic=None):
     if inputImInfoDic == {} or inputImInfoDic == None:
         # 1.change the default IM to English
         self.curImInfoDic = IlUtil.setUuidWithMaxPri(IlUtil.EnglishImUuid, {}, self.curIl)
         # 2.disable IM
         self.setEnableImAndChangeUi(False)
     else:
         self.curImInfoDic = inputImInfoDic.copy()
     self.setupImComboBox()
Ejemplo n.º 3
0
 def onEnableToggled(self,cell,path_str):
     model=self.imTv.get_model()
     iter=model.get_iter_from_string(path_str)
     toggleItem=model.get_value(iter,EnableCol)
     if model.iter_parent(iter)==None:
         self.imTv.expand_row(path_str,True)
         for i in range(model.iter_n_children(iter)):
             childIter=model.iter_nth_child(iter,i)
             model.set(childIter,EnableCol,not toggleItem)
             uuid=model.get_value(childIter,UuidCol)
             #set all child im 
             if toggleItem==True:
                 self.curImInfoDic=IlUtil.disableImWithUuid(uuid,self.curImInfoDic).copy()
             else:
                 self.curImInfoDic=IlUtil.setUuidWithMaxPri(uuid,self.curImInfoDic,self.curIl).copy()
     else:
         uuid=model.get_value(iter,UuidCol)
         if toggleItem==True:
             self.curImInfoDic=IlUtil.disableImWithUuid(uuid,self.curImInfoDic).copy()
         else:
             self.curImInfoDic=IlUtil.setUuidWithMaxPri(uuid,self.curImInfoDic,self.curIl).copy()
     model.set(iter,EnableCol,not toggleItem)
     self.updateIncState(iter)
Ejemplo n.º 4
0
 def onEnAllPressed(self,widget,data=None):
     model=self.imTv.get_model()
     iter=model.get_iter_root()
     while iter!=None:
         model.set(iter,IncCol,False)
         model.set(iter,EnableCol,True)
         for i in range(model.iter_n_children(iter)):
             childIter=model.iter_nth_child(iter,i)
             enabledVal=model.get_value(childIter,EnableCol)
             if enabledVal==False:
                 model.set(childIter,EnableCol,True)
                 uuid=model.get_value(childIter,UuidCol)
                 self.curImInfoDic=IlUtil.setUuidWithMaxPri(uuid,self.curImInfoDic,self.curIl).copy()
         iter=model.iter_next(iter)