switch from PyQt6 to PySide6
PySide6 uses LGPL instead of GPL, which is much nicer to work with.
This commit is contained in:
20
bigtext.py
20
bigtext.py
@@ -4,12 +4,12 @@ import math
|
||||
import os
|
||||
import time
|
||||
from typing import Callable, List
|
||||
from PyQt6 import QtGui
|
||||
from PySide6 import QtGui
|
||||
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
from PyQt6.QtGui import QMouseEvent
|
||||
from PyQt6.QtWidgets import *
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtGui import QMouseEvent
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
import constants
|
||||
from ScaledScrollBar import ScaledScrollBar
|
||||
@@ -19,7 +19,7 @@ from highlighted_range import HighlightedRange
|
||||
from highlightingdialog import HighlightingDialog
|
||||
from line import Line
|
||||
from logFileModel import LogFileModel
|
||||
|
||||
from raven.pluginregistry import PluginRegistry
|
||||
|
||||
from ravenui import RavenUI
|
||||
from settings import Settings
|
||||
@@ -86,7 +86,7 @@ class BigText(QWidget):
|
||||
|
||||
self.v_scroll_bar = ScaledScrollBar()
|
||||
# self.v_scroll_bar.setPageStep(1)
|
||||
self.v_scroll_bar.valueChanged.connect(self.big_text.v_scroll_event)
|
||||
self.v_scroll_bar.scaledValueChanged.connect(self.big_text.v_scroll_event)
|
||||
|
||||
self.grid.addWidget(self.big_text, 0, 0)
|
||||
self.grid.addWidget(self.h_scroll_bar, 1, 0)
|
||||
@@ -271,11 +271,13 @@ class InnerBigText(QWidget):
|
||||
self._left_offset = self._left_offset + 2
|
||||
self.update()
|
||||
|
||||
@Slot()
|
||||
def h_scroll_event(self, left_offset: int):
|
||||
self._left_offset = left_offset
|
||||
# print("left_offset: %d" % left_offset)
|
||||
self.update()
|
||||
|
||||
@Slot()
|
||||
def v_scroll_event(self, byte_offset: str):
|
||||
self._byte_offset = int(byte_offset)
|
||||
self.update()
|
||||
@@ -354,13 +356,13 @@ class InnerBigText(QWidget):
|
||||
dialog = QFileDialog(self)
|
||||
(selected_file, _filter) = dialog.getSaveFileName(
|
||||
caption=self.tr("Save File"),
|
||||
directory=os.path.dirname(self.model.get_file())
|
||||
dir=os.path.dirname(self.model.get_file())
|
||||
)
|
||||
if selected_file:
|
||||
self.model.write_range(start, end, selected_file)
|
||||
open_tab = self.model.settings.session.getboolean("general", "open_tab_on_save_as_file")
|
||||
if open_tab:
|
||||
RavenUI.window.open_file(selected_file)
|
||||
PluginRegistry.execute("open_file", selected_file)
|
||||
|
||||
def _select_all(self):
|
||||
self.selection_highlight.start_byte = 0
|
||||
|
||||
Reference in New Issue
Block a user