This commit is contained in:
Kovid Goyal 2021-05-07 13:17:42 +05:30
parent 752f8de057
commit 43c70c10d0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -975,8 +975,7 @@ class EditRules(QWidget): # {{{
self.open_icon_folder_button = b = QPushButton(QIcon(I('icon_choose.png')),
_('Open icon folder'), self)
connect_lambda(b.clicked, self,
lambda _: open_local_file(os.path.join(config_dir, 'cc_icons')))
b.clicked.connect(self.open_icon_folder)
hb.addWidget(b)
sep = Separator(self, b)
hb.addWidget(sep)
@ -989,6 +988,11 @@ class EditRules(QWidget): # {{{
b.clicked.connect(self.import_rules)
hb.addWidget(b)
def open_icon_folder(self):
path = os.path.join(config_dir, 'cc_icons')
os.makedirs(path, exist_ok=True)
open_local_file(path)
def initialize(self, fm, prefs, mi, pref_name):
self.pref_name = pref_name
self.model = RulesModel(prefs, fm, self.pref_name)