99from qgis .PyQt .QtGui import QIcon
1010from qgis .PyQt .QtWidgets import QAction , QWidget
1111
12+ from profile_manager .__about__ import __title__ , __title_clean__
1213from profile_manager .handlers .bookmarks import import_bookmarks
1314from profile_manager .handlers .customization import import_customizations
1415from profile_manager .handlers .data_sources import (
3637from profile_manager .profiles .utils import get_profile_qgis_ini_path , qgis_profiles_path
3738from profile_manager .utils import wait_cursor
3839
39- LOGGER = logging .getLogger ("profile_manager" )
40+ LOGGER = logging .getLogger (__title_clean__ )
4041logging .basicConfig (
4142 format = "%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s" ,
4243 datefmt = "%H:%M:%S" ,
@@ -69,7 +70,7 @@ def __init__(self, iface):
6970
7071 # Declare instance attributes
7172 self .action : Optional [QAction ] = None
72- self .menu = self . tr ( "&Profile Manager" )
73+ self .menu = __title__
7374
7475 # Check if plugin was started the first time in current QGIS session
7576 # Must be set in initGui() to survive plugin reloads
@@ -96,7 +97,7 @@ def initGui(self):
9697 """Create the menu entries and toolbar icons inside the QGIS GUI."""
9798
9899 icon = QIcon (str (self .__plugin_dir / "icon.png" ))
99- action = QAction (icon , self . tr ( "Profile Manager" ) , self .iface .mainWindow ())
100+ action = QAction (icon , __title__ , self .iface .mainWindow ())
100101 action .triggered .connect (self .run )
101102 action .setEnabled (True )
102103 self .iface .addToolBarIcon (action )
@@ -165,7 +166,7 @@ def make_backup(self, profile_name: str) -> Optional[str]:
165166 source_path = qgis_profiles_path () / profile_name
166167 QgsMessageLog .logMessage (
167168 f"Backing up profile { profile_name !r} to { target_path !r} " ,
168- "Profile Manager" ,
169+ __title__ ,
169170 level = Qgis .MessageLevel .Info ,
170171 )
171172 try :
@@ -234,7 +235,7 @@ def import_things(
234235 self .tr ("Importing {} data sources..." ).format (
235236 sum ([len (v ) for v in data_sources .values ()])
236237 ),
237- "Profile Manager" ,
238+ __title__ ,
238239 level = Qgis .MessageLevel .Info ,
239240 )
240241 try :
@@ -252,7 +253,7 @@ def import_things(
252253 if plugins :
253254 QgsMessageLog .logMessage (
254255 self .tr ("Importing {} plugins..." ).format (len (plugins )),
255- "Profile Manager" ,
256+ __title__ ,
256257 level = Qgis .MessageLevel .Info ,
257258 )
258259 try :
@@ -271,7 +272,7 @@ def import_things(
271272 if do_import_bookmarks :
272273 QgsMessageLog .logMessage (
273274 self .tr ("Importing bookmarks..." ),
274- "Profile Manager" ,
275+ __title__ ,
275276 level = Qgis .MessageLevel .Info ,
276277 )
277278 try :
@@ -287,7 +288,7 @@ def import_things(
287288 if do_import_favourites :
288289 QgsMessageLog .logMessage (
289290 self .tr ("Importing favourites..." ),
290- "Profile Manager" ,
291+ __title__ ,
291292 level = Qgis .MessageLevel .Info ,
292293 )
293294 try :
@@ -300,7 +301,7 @@ def import_things(
300301 if do_import_models :
301302 QgsMessageLog .logMessage (
302303 self .tr ("Importing models..." ),
303- "Profile Manager" ,
304+ __title__ ,
304305 level = Qgis .MessageLevel .Info ,
305306 )
306307 try :
@@ -313,7 +314,7 @@ def import_things(
313314 if do_import_scripts :
314315 QgsMessageLog .logMessage (
315316 self .tr ("Importing scripts..." ),
316- "Profile Manager" ,
317+ __title__ ,
317318 level = Qgis .MessageLevel .Info ,
318319 )
319320 try :
@@ -326,7 +327,7 @@ def import_things(
326327 if do_import_styles :
327328 QgsMessageLog .logMessage (
328329 self .tr ("Importing styles..." ),
329- "Profile Manager" ,
330+ __title__ ,
330331 level = Qgis .MessageLevel .Info ,
331332 )
332333 try :
@@ -339,7 +340,7 @@ def import_things(
339340 if do_import_expressions :
340341 QgsMessageLog .logMessage (
341342 self .tr ("Importing expressions..." ),
342- "Profile Manager" ,
343+ __title__ ,
343344 level = Qgis .MessageLevel .Info ,
344345 )
345346 try :
@@ -352,7 +353,7 @@ def import_things(
352353 if do_import_customizations :
353354 QgsMessageLog .logMessage (
354355 self .tr ("Importing customizations..." ),
355- "Profile Manager" ,
356+ __title__ ,
356357 level = Qgis .MessageLevel .Info ,
357358 )
358359 try :
@@ -377,7 +378,7 @@ def remove_things(
377378 self .tr ("Removing {} data sources..." ).format (
378379 sum ([len (v ) for v in data_sources .values ()])
379380 ),
380- "Profile Manager" ,
381+ __title__ ,
381382 level = Qgis .MessageLevel .Info ,
382383 )
383384 try :
@@ -395,7 +396,7 @@ def remove_things(
395396 if plugins :
396397 QgsMessageLog .logMessage (
397398 self .tr ("Removing {} plugins..." ).format (len (plugins )),
398- "Profile Manager" ,
399+ __title__ ,
399400 level = Qgis .MessageLevel .Info ,
400401 )
401402 try :
0 commit comments