Esempio n. 1
0
 def finish_download(self, is_succeed):
     self.push_button_confirm.setEnabled(True)
     if is_succeed:
         if self.result:
             self.show_msg(QMessageBox.Information, 'Tip',
                           self.result + '\n\nFiles path: ' + mconfig.get_file_path())
         else:
             self.show_msg(QMessageBox.Information, 'Completed',
                           'Download completed (ง •̀_•́)ง\n\nFiles path:' + mconfig.get_file_path())
     else:
         self.show_msg(QMessageBox.Critical, 'Failed', 'Download failed (╯°Д°)╯︵ ┻━┻')
Esempio n. 2
0
 def finish_download(self, is_succeed):
     self.push_button_confirm.setEnabled(True)
     if is_succeed:
         if self.result:
             self.show_msg(QMessageBox.Information, 'Tip',
                           self.result + '\n\nFiles path: ' + mconfig.get_file_path())
         else:
             self.show_msg(QMessageBox.Information, 'Completed',
                           'Download completed (ง •̀_•́)ง\n\nFiles path:' + mconfig.get_file_path())
     else:
         self.show_msg(QMessageBox.Critical, 'Failed', 'Download failed (╯°Д°)╯︵ ┻━┻')
Esempio n. 3
0
    def init_config(self):
        # 读取设置
        mconfig.set_file_path(self.config.value(mconfig.file_path, mconfig.base_dir))
        enable_proxy = self.config.value('enable_proxy', False)

        # 界面更新
        self.file_path_label.setText(mconfig.get_file_path())
        self.proxy_checkBox.setChecked(s2b(enable_proxy))
Esempio n. 4
0
 def set_file_path(self):
     fname = QFileDialog.getExistingDirectory(self.main_window, caption='Select Path', directory='',
                                              options=QFileDialog.ShowDirsOnly)
     if fname:
         mconfig.set_file_path(fname)
         mlog.debug('changed file path to ' + mconfig.get_file_path())
         self.show_msg(QMessageBox.Information, 'Tip', 'Changed file path to:\n' + str(fname))
     else:
         mconfig.set_file_path(mconfig.base_dir)
         self.show_msg(QMessageBox.Information, 'Tip', 'Default file path:\n' + str(mconfig.base_dir))
Esempio n. 5
0
 def set_file_path(self):
     fname = QFileDialog.getExistingDirectory(self.main_window, caption='Select Path', directory='',
                                              options=QFileDialog.ShowDirsOnly)
     if fname:
         self.config.setValue(mconfig.file_path, fname)
         self.file_path_label.setText(fname)
         set_file_path(fname)
         mlog.debug('changed file path to ' + mconfig.get_file_path())
     else:
         set_file_path(mconfig.base_dir)
         self.file_path_label.setText(mconfig.base_dir)
         self.config.setValue(mconfig.file_path, mconfig.base_dir)
Esempio n. 6
0
 def set_file_path(self):
     fname = QFileDialog.getExistingDirectory(
         self.main_window,
         caption='Select Path',
         directory='',
         options=QFileDialog.ShowDirsOnly)
     if fname:
         mconfig.set_file_path(fname)
         mlog.debug('changed file path to ' + mconfig.get_file_path())
         self.show_msg(QMessageBox.Information, 'Tip',
                       'Changed file path to:\n' + str(fname))
     else:
         mconfig.set_file_path(mconfig.base_dir)
         self.show_msg(QMessageBox.Information, 'Tip',
                       'Default file path:\n' + str(mconfig.base_dir))