This commit is contained in:
Kovid Goyal 2021-03-20 20:50:52 +05:30
parent 8135c83537
commit 7fdd6bb3e4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 5 deletions

View File

@ -25,7 +25,7 @@ def sanitize_file_name(x):
for ch in '?&=;#/\\':
ans = ans.replace(ch, '_')
q = quote(ch, safe='')
ans = re.sub(f'\{q}', '_', ans, flags=re.I)
ans = re.sub(f'\\{q}', '_', ans, flags=re.I)
ans = ans.strip().rstrip('.')
ans, ext = ans.rpartition('.')[::2]
return (ans.strip() + '.' + ext.strip()).rstrip('.')

View File

@ -332,8 +332,8 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
# Set the height of the table
h = tv.rowHeight(0) * min(len(mi), 5)
h += 2 * tv.frameWidth() + tv.horizontalHeader().height()
tv.setMinimumHeight(h);
tv.setMaximumHeight(h);
tv.setMinimumHeight(h)
tv.setMaximumHeight(h)
# Set the size of the title column
if self.table_column_widths:
tv.setColumnWidth(0, self.table_column_widths[0])
@ -416,10 +416,9 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
geom = gprefs.get('template_editor_dialog_geometry', None)
if geom is not None:
QApplication.instance().safe_restore_geometry(self, QByteArray(geom))
except:
except Exception:
pass
def font_size_changed(self, toWhat):
gprefs['gpm_template_editor_font_size'] = toWhat
self.highlighter.initializeFormats()