Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

hgqt: remove more HgConfig references

Changeset 0c68a265fa41

Parent 7bfb178c9612

by Steve Borho

Changes to 6 files · Browse files at 0c68a265fa41 Showing diff from parent 7bfb178c9612 Diff from another changeset...

 
28
29
30
31
32
33
34
 
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 
 
 
 
108
109
110
 
28
29
30
 
31
32
33
 
88
89
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
92
93
94
95
96
97
@@ -28,7 +28,6 @@
 SIGNAL = QtCore.SIGNAL  Qt = QtCore.Qt   -from tortoisehg.hgqt.config import HgConfig  from tortoisehg.hgqt import should_rebuild    class HgDialogMixin(object): @@ -89,22 +88,10 @@
  w.hide()     def load_config(self, ui): - cfg = HgConfig(ui) - fontstr = cfg.getFont() - font = QtGui.QFont() - try: - if not font.fromString(fontstr): - raise Exception - except: - print "bad font name '%s'" % fontstr - font.setFamily("Monospace") - font.setFixedPitch(True) - font.setPointSize(10) - self._font = font - - self.rowheight = cfg.getRowHeight() - self.users, self.aliases = cfg.getUsers() - return cfg + # TODO: connect to font changed signal + self._font = qtlib.getfont(ui, 'fontlog').font() + self.rowheight = 8 + self.users, self.aliases = [], []     def accept(self):   self.close()
 
30
31
32
33
34
35
36
37
 
264
265
266
267
268
 
269
270
271
 
30
31
32
 
 
33
34
35
 
262
263
264
 
 
265
266
267
268
@@ -30,8 +30,6 @@
   from tortoisehg.util.util import exec_flag_changed, isbfile, bfilepath   -from tortoisehg.hgqt.config import HgConfig -  from tortoisehg.hgqt.lexers import get_lexer  from tortoisehg.hgqt.blockmatcher import BlockList   @@ -264,8 +262,7 @@
  if flag == '':   return   - cfg = HgConfig(self._model.repo.ui) - lexer = get_lexer(filename, data, flag, cfg) + lexer = get_lexer(filename, data, flag)   if flag == "+":   nlines = data.count('\n')   self.sci.setMarginWidth(1, str(nlines)+'0')
 
14
15
16
 
17
18
19
 
142
143
144
145
 
146
147
 
148
149
150
 
151
152
153
 
14
15
16
17
18
19
20
 
143
144
145
 
146
147
 
148
149
150
 
151
152
153
154
@@ -14,6 +14,7 @@
  return self.cfg_lexer(self._lexer(), cfg)     def cfg_lexer(self, lexer, cfg=None): + # TODO: get font from qtlib.getfont()   if cfg:   font = QtGui.QFont()   fontstr = cfg.getFont() @@ -142,12 +143,12 @@
 lexers = [cls() for clsname, cls in globals().items() if not clsname.startswith('_') and isinstance(cls, type) and \   issubclass(cls, (_LexerSelector, _FilenameLexerSelector, _ScriptLexerSelector))]   -def get_lexer(filename, filedata, fileflag=None, cfg=None): +def get_lexer(filename, filedata, fileflag=None):   if fileflag == "=": - return DiffLexerSelector().lexer(cfg) + return DiffLexerSelector().lexer(None)   for lselector in lexers:   if lselector.match(filename, filedata): - return lselector.lexer(cfg) + return lselector.lexer(None)   return None    
 
16
17
18
19
 
20
21
22
23
24
25
 
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
 
 
 
 
107
108
109
 
16
17
18
 
19
20
21
 
22
23
24
 
86
87
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
90
91
92
93
94
95
@@ -16,10 +16,9 @@
   from tortoisehg.hgqt.i18n import _   -from tortoisehg.hgqt.qtlib import geticon +from tortoisehg.hgqt.qtlib import geticon, getfont  from tortoisehg.hgqt.repomodel import HgRepoListModel  from tortoisehg.hgqt import cmdui, update, tag, manifestdialog, backout, merge -from tortoisehg.hgqt.config import HgConfig    from repoview import HgRepoView  from revdetailswidget import RevDetailsWidget @@ -87,23 +86,10 @@
  self.revDetailsWidget = w     def load_config(self): - cfg = HgConfig(self.repo.ui) - fontstr = cfg.getFont() - font = QFont() - try: - if not font.fromString(fontstr): - raise Exception - except: - print "bad font name '%s'" % fontstr - font.setFamily("Monospace") - font.setFixedPitch(True) - font.setPointSize(10) - self._font = font - - self.rowheight = cfg.getRowHeight() - self.users, self.aliases = cfg.getUsers() - self.hidefinddelay = cfg.getHideFindDelay() - return cfg + self._font = getfont(self.repo.ui, 'fontlog') + self.rowheight = 8 + self.users, self.aliases = [], [] + self.hidefinddelay = False     def reponame(self):   return os.path.basename(self.repo.root)
 
10
11
12
 
13
14
15
16
17
18
19
20
21
 
 
 
 
22
23
24
 
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
 
 
 
175
176
177
 
10
11
12
13
14
 
 
15
 
 
 
 
 
16
17
18
19
20
21
22
 
153
154
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
157
158
159
160
161
@@ -10,15 +10,13 @@
   from mercurial import hg   +from tortoisehg.hgqt import qtlib  from tortoisehg.hgqt.i18n import _ - -from tortoisehg.hgqt.config import HgConfig  from tortoisehg.hgqt.filelistmodel import HgFileListModel - -from filelistview import HgFileListView -from fileview import HgFileView -from revpanelwidget import RevPanelWidget -from revmessage import RevMessage +from tortoisehg.hgqt.filelistview import HgFileListView +from tortoisehg.hgqt.fileview import HgFileView +from tortoisehg.hgqt.revpanelwidget import RevPanelWidget +from tortoisehg.hgqt.revmessage import RevMessage    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -155,23 +153,9 @@
  revisiondetails_layout.addWidget(self.filelist_splitter)     def load_config(self): - cfg = HgConfig(self.repo.ui) - fontstr = cfg.getFont() - font = QFont() - try: - if not font.fromString(fontstr): - raise Exception - except: - print "bad font name '%s'" % fontstr - font.setFamily("Monospace") - font.setFixedPitch(True) - font.setPointSize(10) - self._font = font - - self.rowheight = cfg.getRowHeight() - self.users, self.aliases = cfg.getUsers() - self.hidefinddelay = cfg.getHideFindDelay() - return cfg + self._font = qtlib.getfont(self.repo.ui, 'fontlog').font() + self.rowheight = 8 + self.users, self.aliases = [], []     def revisionLinkClicked_(self, rev):   self.revisionLinkClicked.emit(rev)
 
16
17
18
19
20
21
 
22
23
24
25
26
27
 
28
29
30
 
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 
 
128
129
130
131
132
 
 
133
134
135
 
16
17
18
 
 
 
19
20
 
21
 
 
 
22
23
24
25
 
109
110
111
 
 
 
 
 
 
 
 
 
 
 
112
113
114
 
 
 
 
115
116
117
118
119
@@ -16,15 +16,10 @@
 from mercurial import hg  from mercurial.error import RepoError   -from tortoisehg.util.util import tounicode -from tortoisehg.util.util import rootpath, find_repository - +from tortoisehg.util.hglib import tounicode  from tortoisehg.hgqt.i18n import _ -  from tortoisehg.hgqt.decorators import timeit - -from tortoisehg.hgqt.config import HgConfig -from tortoisehg.hgqt.qtlib import geticon +from tortoisehg.hgqt.qtlib import geticon, getfont  from tortoisehg.hgqt.quickbar import FindInGraphlogQuickBar  from tortoisehg.hgqt.repowidget import RepoWidget  from tortoisehg.hgqt.commit import CommitWidget @@ -114,22 +109,11 @@
  w.hide()     def load_config(self, ui): - cfg = HgConfig(ui) - fontstr = cfg.getFont() - font = QFont() - try: - if not font.fromString(fontstr): - raise Exception - except: - print "bad font name '%s'" % fontstr - font.setFamily("Monospace") - font.setFixedPitch(True) - font.setPointSize(10) + # TODO: connect to font changed signal + font = getfont(ui, 'fontlog').font()   self._font = font - - self.rowheight = cfg.getRowHeight() - self.users, self.aliases = cfg.getUsers() - return cfg + self.rowheight = 8 + self.users, self.aliases = [], []     def accept(self):   self.close()