Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset spyder and restart from within running application #2423

Merged
merged 25 commits into from
Jul 17, 2015
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
17395a3
Reset spyder and restart from running application
goanpeca May 7, 2015
01c2188
Fix response for subprocess
goanpeca Jun 11, 2015
037e59d
Add option to preferences dialog
goanpeca Jun 11, 2015
58d3772
Rebased
goanpeca Jun 11, 2015
6c9f61f
Add traceback print error handling and pep8 corrections
goanpeca Jun 11, 2015
e04aca3
Add restart, reset and close extra error handling
goanpeca Jun 11, 2015
519201a
Improve code style
goanpeca Jun 12, 2015
bc95a72
Change timer settings
goanpeca Jun 12, 2015
13330fc
Change timer settings
goanpeca Jun 12, 2015
f0ec3f5
Update reset logic
goanpeca Jun 12, 2015
4003c37
Fix duplicate range
goanpeca Jun 12, 2015
28fc618
Rework exception handling
goanpeca Jun 13, 2015
eb8b585
Update error codes
goanpeca Jun 18, 2015
d341b5c
Update error codes
goanpeca Jun 18, 2015
4e9b789
Improve comments and variable names
goanpeca Jul 1, 2015
a6f8646
Reorganize code in config dialog
goanpeca Jul 1, 2015
a0d7a5f
Add splash screen
goanpeca Jul 2, 2015
3f4b398
Using current sys.path to restart app
SylvainCorlay Jul 8, 2015
a738d31
Using current sys.path to restart app
SylvainCorlay Jul 8, 2015
4931b49
Fix check logic on restarter script
goanpeca Jul 8, 2015
363853c
Fix typo in docstring
goanpeca Jul 8, 2015
63ca7be
Modify path in restart method only in bootstrap mode
goanpeca Jul 11, 2015
73eab81
reduce waiting times on all OSs
goanpeca Jul 11, 2015
37e0535
Reduce max waiting time when resetting
goanpeca Jul 15, 2015
abdb8f9
Remove helper function adn use to_text_string from spyderlib.py3compat
goanpeca Jul 17, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add option to preferences dialog
  • Loading branch information
goanpeca committed Jul 11, 2015
commit 037e59dd803a672673d94c420d52a7f33b4c9021
28 changes: 28 additions & 0 deletions spyderlib/plugins/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@

from spyderlib.baseconfig import (_, running_in_mac_app, LANGUAGE_CODES,
save_lang_conf, load_lang_conf)
from spyderlib.baseconfig import _, running_in_mac_app
from spyderlib.config import CONF
from spyderlib.guiconfig import (CUSTOM_COLOR_SCHEME_NAME,
set_default_color_scheme)
from spyderlib.utils.qthelpers import get_icon, get_std_icon
from spyderlib.userconfig import NoDefault
from spyderlib.widgets.colors import ColorLayout
from spyderlib.widgets.sourcecode import syntaxhighlighters as sh
Expand Down Expand Up @@ -106,6 +108,7 @@ def apply_changes(self):
break # Ensure a single popup is displayed
self.set_modified(False)


def load_from_conf(self):
"""Load settings from configuration file"""
raise NotImplementedError
Expand All @@ -124,6 +127,21 @@ class ConfigDialog(QDialog):

def __init__(self, parent=None):
QDialog.__init__(self, parent)

self._parent = parent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need this line, since self.main is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha

self.main = parent

# Widgets
self.pages_widget = QStackedWidget()
self.contents_widget = QListWidget()
self.button_reset = QPushButton(_('Reset to defaults'))

bbox = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Apply
|QDialogButtonBox.Cancel)
self.apply_btn = bbox.button(QDialogButtonBox.Apply)

# Widgets setup


# Destroying the C++ object right after closing the dialog box,
# otherwise it may be garbage-collected in another QThread
Expand Down Expand Up @@ -154,6 +172,7 @@ def __init__(self, parent=None):
hsplitter.addWidget(self.pages_widget)

btnlayout = QHBoxLayout()
btnlayout.addWidget(self.button_reset)
btnlayout.addStretch(1)
btnlayout.addWidget(bbox)

Expand All @@ -169,6 +188,15 @@ def __init__(self, parent=None):
# Ensures that the config is present on spyder first run
CONF.set('main', 'interface_language', load_lang_conf())

# Signals and slots
self.button_reset.clicked.connect(self.main.reset_spyder)
self.pages_widget.currentChanged.connect(self.current_page_changed)
self.contents_widget.currentRowChanged.connect(
self.pages_widget.setCurrentIndex)
bbox.accepted.connect(self.accept)
bbox.rejected.connect(self.reject)
bbox.clicked.connect(self.button_clicked)

def get_current_index(self):
"""Return current page index"""
return self.contents_widget.currentRow()
Expand Down