コード例 #1
0
ファイル: __init__.py プロジェクト: iilei/frescobaldi
 def settings_changed(self):
     """Determine if any changes in global extension settings
     requires a restart."""
     s = QSettings()
     s.beginGroup('extension-settings')
     active = s.value('active', True, bool)
     inactive = qsettings.get_string_list(s, 'installed/inactive')
     root = s.value('root-directory', '', str)
     inactive_changed = False
     if len(inactive) != len(self._inactive_extensions):
         inactive_changed = True
     else:
         for ext in inactive:
             if not ext in self._inactive_extensions:
                 inactive_changed = True
                 break
     self.reset_inactive(inactive)
     if (active != self.active() or root != self.root_directory()
             or inactive_changed):
         from widgets.restartmessage import suggest_restart
         suggest_restart(_('Extensions have changed'))
コード例 #2
0
ファイル: menu.py プロジェクト: dliessi/frescobaldi
 def slotTriggered(self, action):
     """Handle click on a listed branch.
     Try to checkout the new branch and request a restart afterwards."""
     for branch, act in self._acts.items():
         if act == action:
             new_branch = branch
             break
     if not new_branch:
         return
     try:
         vcs.app_repo.checkout(new_branch)
         from widgets.restartmessage import suggest_restart
         suggest_restart(
             _("Successful checkout of branch\n{}".format(new_branch)))
     except GitError as giterror:
         msgBox = QMessageBox()
         msgBox.setIcon(QMessageBox.Critical)
         msgBox.setText(_("Git Checkout Error"))
         msgBox.setInformativeText(str(giterror))
         msgBox.exec_()
         action.setChecked(False)
         self._acts[vcs.app_repo.current_branch()].setChecked(True)
コード例 #3
0
 def slotTriggered(self, action):
     """Handle click on a listed branch.
     Try to checkout the new branch and request a restart afterwards."""
     for branch, act in self._acts.items():
         if act == action:
             new_branch = branch
             break
     if not new_branch:
         return
     try:
         vcs.app_repo.checkout(new_branch)
         from widgets.restartmessage import suggest_restart
         suggest_restart(
             _("Successful checkout of branch\n{}".format(new_branch)))
     except GitError as giterror:
         msgBox = QMessageBox()
         msgBox.setIcon(QMessageBox.Critical)
         msgBox.setText(_("Git Checkout Error"))
         msgBox.setInformativeText(str(giterror))
         msgBox.exec_()
         action.setChecked(False)
         self._acts[vcs.app_repo.current_branch()].setChecked(True)
コード例 #4
0
ファイル: __init__.py プロジェクト: wbsoft/frescobaldi
 def settings_changed(self):
     """Determine if any changes in global extension settings
     requires a restart."""
     s = QSettings()
     s.beginGroup('extension-settings')
     active = s.value('active', True, bool)
     inactive = s.value('installed/inactive', [], list)
     root = s.value('root-directory', '', str)
     inactive_changed = False
     if len(inactive) != len(self._inactive_extensions):
         inactive_changed = True
     else:
         for ext in inactive:
             if not ext in self._inactive_extensions:
                 inactive_changed = True
                 break
     self.reset_inactive(inactive)
     if (
         active != self.active()
         or root != self.root_directory()
         or inactive_changed
     ):
         from widgets.restartmessage import suggest_restart
         suggest_restart(_('Extensions have changed'))