11 |
11 |
12 from PyQt4.QtCore import * |
12 from PyQt4.QtCore import * |
13 from PyQt4.QtGui import * |
13 from PyQt4.QtGui import * |
14 |
14 |
15 from .Ui_ShellHistoryDialog import Ui_ShellHistoryDialog |
15 from .Ui_ShellHistoryDialog import Ui_ShellHistoryDialog |
|
16 |
16 |
17 |
17 class ShellHistoryDialog(QDialog, Ui_ShellHistoryDialog): |
18 class ShellHistoryDialog(QDialog, Ui_ShellHistoryDialog): |
18 """ |
19 """ |
19 Class implementing the shell history dialog. |
20 Class implementing the shell history dialog. |
20 """ |
21 """ |
28 """ |
29 """ |
29 QDialog.__init__(self, shell) |
30 QDialog.__init__(self, shell) |
30 self.setupUi(self) |
31 self.setupUi(self) |
31 |
32 |
32 self.historyList.addItems(history) |
33 self.historyList.addItems(history) |
33 self.historyList.setCurrentRow(self.historyList.count() - 1, |
34 self.historyList.setCurrentRow(self.historyList.count() - 1, |
34 QItemSelectionModel.Clear) |
35 QItemSelectionModel.Clear) |
35 self.historyList.scrollToItem(self.historyList.currentItem()) |
36 self.historyList.scrollToItem(self.historyList.currentItem()) |
36 |
37 |
37 self.vm = vm |
38 self.vm = vm |
38 self.shell = shell |
39 self.shell = shell |
109 Private slot to reload the history. |
110 Private slot to reload the history. |
110 """ |
111 """ |
111 history = self.shell.getHistory(None) |
112 history = self.shell.getHistory(None) |
112 self.historyList.clear() |
113 self.historyList.clear() |
113 self.historyList.addItems(history) |
114 self.historyList.addItems(history) |
114 self.historyList.setCurrentRow(self.historyList.count() - 1, |
115 self.historyList.setCurrentRow(self.historyList.count() - 1, |
115 QItemSelectionModel.Clear) |
116 QItemSelectionModel.Clear) |
116 self.historyList.scrollToItem(self.historyList.currentItem()) |
117 self.historyList.scrollToItem(self.historyList.currentItem()) |
117 |
118 |
118 def getHistory(self): |
119 def getHistory(self): |
119 """ |
120 """ |