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

settings: add icons to list view

These are consistently sized, which looks.. suboptimal

Changeset 6fc05f592794

Parent 8c0d54baf634

by Steve Borho

Changes to one file · Browse files at 6fc05f592794 Showing diff from parent 8c0d54baf634 Diff from another changeset...

 
22
23
24
25
 
26
27
28
 
214
215
216
217
218
 
219
220
221
 
330
331
332
333
 
334
335
336
 
343
344
345
346
 
347
348
349
 
378
379
380
381
 
 
382
383
384
 
471
472
473
 
474
475
476
 
497
498
499
500
501
 
 
 
 
 
 
 
 
 
502
503
504
 
22
23
24
 
25
26
27
28
 
214
215
216
 
 
217
218
219
220
 
329
330
331
 
332
333
334
335
 
342
343
344
 
345
346
347
348
 
377
378
379
 
380
381
382
383
384
 
471
472
473
474
475
476
477
 
498
499
500
 
 
501
502
503
504
505
506
507
508
509
510
511
512
@@ -22,7 +22,7 @@
 # Technical Debt  # stacked widget or pages need to be scrollable  # add extensions page after THG 1.1 is released -# show icons in the page listview +# we need a consistent icon set    _unspecstr = _('<unspecified>')   @@ -214,8 +214,7 @@
  ' instead of just the root directory name. Default: False')),   )),   -({'name': 'log', 'label': _('Workbench'), - 'icon': 'menulog.ico'}, ( +({'name': 'log', 'label': _('Workbench'), 'icon': 'menulog.ico'}, (   (_('Author Coloring'), 'tortoisehg.authorcolor', genBoolCombo,   _('Color changesets by author name. If not enabled,'   ' the changes are colored green for merge, red for' @@ -330,7 +329,7 @@
  _('Character encoding name')),   )),   -({'name': 'proxy', 'label': _('Proxy'), 'icon': 'general.ico'}, ( +({'name': 'proxy', 'label': _('Proxy'), 'icon': QStyle.SP_DriveNetIcon}, (   (_('Host'), 'http_proxy.host', genEditCombo,   _('Host name and (optional) port of proxy server, for'   ' example "myproxy:8000"')), @@ -343,7 +342,7 @@
  _('Optional. Password to authenticate with at the proxy server')),   )),   -({'name': 'email', 'label': _('Email'), 'icon': 'general.ico'}, ( +({'name': 'email', 'label': _('Email'), 'icon': QStyle.SP_ArrowForward}, (   (_('From'), 'email.from', genEditCombo,   _('Email address to use in the "From" header and for'   ' the SMTP envelope')), @@ -378,7 +377,8 @@
  ' mail server.')),   )),   -({'name': 'diff', 'label': _('Diff'), 'icon': 'general.ico'}, ( +({'name': 'diff', 'label': _('Diff'), + 'icon': QStyle.SP_FileDialogContentsView}, (   (_('Patch EOL'), 'patch.eol', (genDefaultCombo,   ['auto', 'strict', 'crlf', 'lf']),   _('Normalize file line endings during and after patch to lf or' @@ -471,6 +471,7 @@
  bothbox = QHBoxLayout()   layout.addLayout(bothbox)   pageList = QListWidget() + pageList.setUniformItemSizes(True)   stack = QStackedWidget()   bothbox.addWidget(pageList, 0)   bothbox.addWidget(stack, 1) @@ -497,8 +498,15 @@
    # add page items to treeview   for meta, info in INFO: - # TODO: set meta['icon'] - pageList.addItem(meta['label']) + icon = QIcon() + if isinstance(meta['icon'], str): + iconfile = paths.get_tortoise_icon(meta['icon']) + icon.addPixmap(QPixmap(iconfile), QIcon.Normal, QIcon.Off) + else: + style = QApplication.style() + icon.addPixmap(style.standardPixmap(meta['icon'])) + item = QListWidgetItem(icon, meta['label']) + pageList.addItem(item)   self.addPage(meta['name'])     combo.setCurrentIndex(configrepo and CONF_REPO or CONF_GLOBAL)