Skip to content

Commit

Permalink
rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Jun 29, 2024
1 parent b51cbc8 commit c57c459
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions media_converter/bulkconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

from .common import find_convertible_images, tooltip
from .config import config
from .consts import ADDON_NAME
from .consts import ADDON_FULL_NAME
from .gui import BulkConvertDialog
from .image_converters.internal_file_converter import InternalFileConverter

ACTION_NAME = f"{ADDON_NAME}: Bulk-convert"
ACTION_NAME = f"{ADDON_FULL_NAME}: Bulk-convert"


class ConvertResult:
Expand Down
3 changes: 2 additions & 1 deletion media_converter/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from .ajt_common.consts import ADDON_SERIES

ADDON_PATH = os.path.dirname(os.path.abspath(__file__))
ADDON_NAME = f"{ADDON_SERIES} Media Converter"
ADDON_NAME = "Media Converter"
ADDON_FULL_NAME = f"{ADDON_SERIES} {ADDON_NAME}"
THIS_ADDON_MODULE = __name__.split(".")[0]
SUPPORT_DIR = os.path.join(ADDON_PATH, "support")

Expand Down
4 changes: 2 additions & 2 deletions media_converter/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .ajt_common.enum_select_combo import EnumSelectCombo
from .ajt_common.multiple_choice_selector import MultipleChoiceSelector
from .config import ImageFormat, config
from .consts import ADDON_NAME, THIS_ADDON_MODULE, WINDOW_MIN_WIDTH
from .consts import ADDON_FULL_NAME, THIS_ADDON_MODULE, WINDOW_MIN_WIDTH, ADDON_NAME
from .image_converters.common import ImageDimensions, should_show_settings
from .utils.converter_interfaces import FileNamePatterns
from .utils.show_options import ShowOptions
Expand All @@ -31,7 +31,7 @@ class SettingsDialog(QDialog):

def __init__(self, parent=None) -> None:
super().__init__(parent)
cast(QDialog, self).setWindowTitle(ADDON_NAME)
cast(QDialog, self).setWindowTitle(ADDON_FULL_NAME)
self.setMinimumWidth(WINDOW_MIN_WIDTH)
self._sliders = ImageSliderBox("Image parameters")
self._presets_editor = PresetsEditor("Presets", sliders=self._sliders)
Expand Down
4 changes: 2 additions & 2 deletions media_converter/image_converters/image_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from ..ajt_common.utils import find_executable as find_executable_ajt
from ..config import ImageFormat, config
from ..consts import ADDON_NAME, SUPPORT_DIR
from ..consts import ADDON_FULL_NAME, SUPPORT_DIR
from ..utils.mime_helper import iter_files
from .common import ImageDimensions

Expand Down Expand Up @@ -112,7 +112,7 @@ def is_animation(source_path: str) -> bool:

def ffmpeg_not_found_dialog(parent=None):
return showWarning(
title=ADDON_NAME,
title=ADDON_FULL_NAME,
parent=parent,
text="""
<h2>FFmpeg is not found in PATH.</h2>
Expand Down
2 changes: 1 addition & 1 deletion media_converter/media_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, editor: Editor, note: Note, filenames: list[str], *args, **kw
self.note = note
self.edits_layout = QVBoxLayout()
self.bottom_box = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
cast(QDialog, self).setWindowTitle(f"{ADDON_NAME}: rename files")
cast(QDialog, self).setWindowTitle(f"{ADDON_FULL_NAME}: rename files")
self.setMinimumWidth(WINDOW_MIN_WIDTH)
self.setLayout(self.make_layout())
self.connect_ui_elements()
Expand Down
8 changes: 5 additions & 3 deletions media_converter/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .ajt_common.about_menu import menu_root_entry
from .common import *
from .config import config
from .consts import ADDON_NAME, ADDON_PATH
from .consts import ADDON_FULL_NAME, ADDON_NAME, ADDON_PATH
from .gui import SettingsMenuDialog
from .image_converters.image_converter import FFmpegNotFoundError, ffmpeg_not_found_dialog
from .image_converters.on_paste_converter import OnPasteConverter
Expand All @@ -32,7 +32,9 @@ def open_settings():

def action_tooltip():
return (
f"{ADDON_NAME}: Paste" if not config["shortcut"] else f"{ADDON_NAME}: Paste ({key_to_str(config['shortcut'])})"
f"{ADDON_FULL_NAME}: Paste"
if not config["shortcut"]
else f"{ADDON_FULL_NAME}: Paste ({key_to_str(config['shortcut'])})"
)


Expand Down Expand Up @@ -64,7 +66,7 @@ def on_editor_did_init_buttons(buttons: list[str], editor: Editor):
buttons.append(
editor.addButton(
icon=os.path.join(ADDON_PATH, "icons", "webp.png"),
cmd=f"ajt__{ADDON_NAME.lower().replace(' ', '_')}_button",
cmd=f"ajt__{ADDON_FULL_NAME.lower().replace(' ', '_')}_button",
func=lambda e=editor: convert_and_insert(e, source=ShowOptions.toolbar),
tip=action_tooltip(),
keys=config["shortcut"] or None,
Expand Down

0 comments on commit c57c459

Please sign in to comment.