示例#1
0
 def next(self):
     if not self.save_data():
         return
     channels = Utils.get_channels(
         Utils.get_full_path('games/' + self.game['id'] + '/config.xml'))
     if channels is None:
         if not os.path.exists(Utils.get_full_path('channelsdk')):
             QMessageBox.warning(
                 self, "警告",
                 os.path.dirname(os.getcwd()) + " 没有channelsdk文件夹")
             return
         elif len(os.listdir(Utils.get_full_path('channelsdk'))) <= 0:
             QMessageBox.warning(
                 self, "警告", "本地没有渠道sdk,请手动添加sdk文件夹到" +
                 Utils.get_full_path('channelsdk'))
             return
         channels = []
         self.main_win.set_add_channel_widget(channels)
     else:
         self.main_win.set_channel_list_widget(channels)
示例#2
0
 def select_game(self, p_int):
     self.game_index = p_int
     if 'apk' in self.main_win.games[self.game_index]:
         self.apk_path.setText(self.main_win.games[self.game_index]['apk'])
     else:
         self.apk_path.setText("<h3><font color=%s>%s</font></h3>" %
                               ('red', "请浏览选择本地母包路径"))
         # self.apk_path.setText("请浏览选择本地母包路径")
     # 当前选中的game,其下的所有渠道列表
     self.channels = Utils.get_channels(
         Utils.get_full_path('games/' + self.main_win.games[p_int]['id'] +
                             '/config.xml'))
     channel_ids = []
     for channel in self.channels:
         channel_ids.append(channel['channelId'])
     list_model = QStringListModel()
     list_model.setStringList(channel_ids)
     self.clv = self.tool_box.currentWidget()
     self.clv.doubleClicked.connect(self.select_channel)
     self.clv.setModel(list_model)