Prepare for tree widgets to store settings

Precursor for #12
This commit is contained in:
mailchuck 2015-11-12 00:33:57 +01:00 committed by Peter Surda
parent 4b88922104
commit 5b724f366e
3 changed files with 18 additions and 5 deletions

View File

@ -59,7 +59,7 @@ class Ui_MainWindow(object):
self.verticalSplitter_12 = settingsmixin.SSplitter()
self.verticalSplitter_12.setObjectName(_fromUtf8("verticalSplitter_12"))
self.verticalSplitter_12.setOrientation(QtCore.Qt.Vertical)
self.treeWidgetYourIdentities = QtGui.QTreeWidget(self.inbox)
self.treeWidgetYourIdentities = settingsmixin.STreeWidget(self.inbox)
self.treeWidgetYourIdentities.setObjectName(_fromUtf8("treeWidgetYourIdentities"))
self.treeWidgetYourIdentities.resize(200, self.treeWidgetYourIdentities.height())
icon1 = QtGui.QIcon()
@ -361,7 +361,7 @@ class Ui_MainWindow(object):
self.verticalSplitter_3 = settingsmixin.SSplitter()
self.verticalSplitter_3.setObjectName(_fromUtf8("verticalSplitter_3"))
self.verticalSplitter_3.setOrientation(QtCore.Qt.Vertical)
self.treeWidgetSubscriptions = QtGui.QTreeWidget(self.subscriptions)
self.treeWidgetSubscriptions = settingsmixin.STreeWidget(self.subscriptions)
self.treeWidgetSubscriptions.setAlternatingRowColors(True)
self.treeWidgetSubscriptions.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.treeWidgetSubscriptions.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
@ -458,7 +458,7 @@ class Ui_MainWindow(object):
self.verticalSplitter_17 = settingsmixin.SSplitter()
self.verticalSplitter_17.setObjectName(_fromUtf8("verticalSplitter_17"))
self.verticalSplitter_17.setOrientation(QtCore.Qt.Vertical)
self.treeWidgetChans = QtGui.QTreeWidget(self.chans)
self.treeWidgetChans = settingsmixin.STreeWidget(self.chans)
self.treeWidgetChans.setFrameShadow(QtGui.QFrame.Sunken)
self.treeWidgetChans.setLineWidth(1)
self.treeWidgetChans.setAlternatingRowColors(True)

View File

@ -2,6 +2,7 @@ from PyQt4 import QtCore, QtGui
from utils import *
import shared
from settingsmixin import SettingsMixin
class AccountMixin (object):
def accountColor (self):
@ -116,7 +117,7 @@ class Ui_FolderWidget(QtGui.QTreeWidgetItem, AccountMixin):
return super(QtGui.QTreeWidgetItem, self).__lt__(other)
class Ui_AddressWidget(QtGui.QTreeWidgetItem, AccountMixin):
class Ui_AddressWidget(QtGui.QTreeWidgetItem, AccountMixin, SettingsMixin):
def __init__(self, parent, pos = 0, address = "", unreadCount = 0, enabled = True):
super(QtGui.QTreeWidgetItem, self).__init__()
parent.insertTopLevelItem(pos, self)

View File

@ -64,4 +64,16 @@ class SSplitter(QtGui.QSplitter, SettingsMixin):
self.readState(self)
def saveSettings(self):
self.writeState(self)
self.writeState(self)
class STreeWidget(QtGui.QTreeWidget, SettingsMixin):
def loadSettings(self):
#recurse children
#self.readState(self)
pass
def saveSettings(self):
#recurse children
#self.writeState(self)
pass