Skip to content

Commit

Permalink
Merge from 2.3: Fix for issues #2659 and #2689
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Sep 21, 2015
2 parents d9e6861 + aac8649 commit 3b95ff3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spyderlib/utils/introspection/jedi_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
jedi = None


JEDI_REQVER = '>=0.8.1'
JEDI_REQVER = '>=0.8.1;<0.9.0'
dependencies.add('jedi',
_("(Experimental) Editor's code completion,"
" go-to-definition and help"),
Expand Down
9 changes: 6 additions & 3 deletions spyderlib/widgets/arrayeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from __future__ import print_function

from spyderlib.qt.QtGui import (QHBoxLayout, QColor, QTableView, QItemDelegate,
QLineEdit, QCheckBox, QGridLayout,
QLineEdit, QCheckBox, QGridLayout, QCursor,
QDoubleValidator, QDialog, QDialogButtonBox,
QMessageBox, QPushButton, QInputDialog, QMenu,
QApplication, QKeySequence, QLabel, QComboBox,
Expand Down Expand Up @@ -381,11 +381,14 @@ def load_more_data(self, value, rows=False, columns=False):
self.model().fetch_more(rows=rows)
if columns and value == self.horizontalScrollBar().maximum():
self.model().fetch_more(columns=columns)

def resize_to_contents(self):
"""Resize cells to contents"""
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.resizeColumnsToContents()
self.model().fetch_more(columns=True)
self.resizeColumnsToContents()
self.resizeRowsToContents()
QApplication.restoreOverrideCursor()

def setup_menu(self):
"""Setup context menu"""
Expand Down
11 changes: 9 additions & 2 deletions spyderlib/widgets/dataframeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from spyderlib.qt.QtCore import QAbstractTableModel, Qt, QModelIndex, Slot
from spyderlib.qt.QtGui import (QDialog, QTableView, QColor, QGridLayout,
QDialogButtonBox, QHBoxLayout, QPushButton,
QCheckBox, QMessageBox, QInputDialog,
QCheckBox, QMessageBox, QInputDialog, QCursor,
QLineEdit, QApplication, QMenu, QKeySequence)
from spyderlib.qt.compat import to_qvariant, from_qvariant
import spyderlib.utils.icon_manager as ima
Expand Down Expand Up @@ -511,7 +511,7 @@ def setup_and_check(self, data, title=''):
btn.clicked.connect(self.change_format)
btn = QPushButton(_('Resize'))
btn_layout.addWidget(btn)
btn.clicked.connect(self.dataTable.resizeColumnsToContents)
btn.clicked.connect(self.resize_to_contents)

bgcolor = QCheckBox(_('Background color'))
bgcolor.setChecked(self.dataModel.bgcolor_enabled)
Expand Down Expand Up @@ -569,6 +569,13 @@ def get_value(self):
else:
return df

def resize_to_contents(self):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.dataTable.resizeColumnsToContents()
self.dataModel.fetch_more(columns=True)
self.dataTable.resizeColumnsToContents()
QApplication.restoreOverrideCursor()


def test_edit(data, title="", parent=None):
"""Test subroutine"""
Expand Down

0 comments on commit 3b95ff3

Please sign in to comment.