Notepad++ generated in local folder (no need)
parent
63b8c7c435
commit
bdb008c97a
|
|
@ -1,100 +0,0 @@
|
|||
import base
|
||||
import random
|
||||
from PyQt6.QtCore import QObject, pyqtSlot
|
||||
|
||||
class CallHandler(QObject):
|
||||
def __init__(self, sight):
|
||||
super().__init__()
|
||||
self.sight = sight
|
||||
|
||||
@pyqtSlot(str)
|
||||
def test(self, t):
|
||||
print(t)
|
||||
|
||||
@pyqtSlot(str, result=str)
|
||||
def test2(self, t):
|
||||
print(t)
|
||||
return t+"_return"
|
||||
|
||||
@pyqtSlot(result=str)
|
||||
def getDefaultTemplate(self):
|
||||
return base.data["default_template"]
|
||||
|
||||
@pyqtSlot(int)
|
||||
def setWidth(self, width):
|
||||
self.sight.resize(width, self.sight.height());
|
||||
|
||||
@pyqtSlot(int)
|
||||
def setHeight(self, height):
|
||||
self.sight.resize(self.sight.width(), height);
|
||||
|
||||
@pyqtSlot(str, str, result = str)
|
||||
def create(self, id, type):
|
||||
new_id = base.sights.create(id, type)
|
||||
base.sights.show(new_id)
|
||||
return new_id;
|
||||
|
||||
@pyqtSlot(str, str, bool)
|
||||
def addData(self, key, value, is_global = False):
|
||||
if is_global:
|
||||
base.sights.addGlobalData(key,value)
|
||||
else:
|
||||
self.sight.addData(key,value)
|
||||
|
||||
@pyqtSlot(str, bool, result=str)
|
||||
def getData(self, key, is_global = False):
|
||||
if is_global:
|
||||
return base.sights.getGlobalData(key)
|
||||
return self.sight.getData(key)
|
||||
|
||||
@pyqtSlot()
|
||||
def activeSight(self):
|
||||
print("active")
|
||||
if base.data["active_sight"] != self.sight.getId():
|
||||
print(self.sight.getId())
|
||||
base.data["active_sight"] = self.sight.getId()
|
||||
|
||||
@pyqtSlot()
|
||||
def close(self):
|
||||
base.sights.close(self.sight.getId())
|
||||
|
||||
@pyqtSlot()
|
||||
def setMaximized(self):
|
||||
self.sight.showMaximized()
|
||||
self.sight.setLayoutContentMargins(0,0,0,0) #because there will be a transparented line as a border
|
||||
|
||||
@pyqtSlot()
|
||||
def setMinimize(self):
|
||||
self.sight.showMinimized()
|
||||
|
||||
@pyqtSlot()
|
||||
def restoreDown(self):
|
||||
self.sight.showNormal()
|
||||
self.sight.setLayoutContentMargins(1,1,1,1) #because if it is no border then I get setgeometry warning what can't be set
|
||||
|
||||
@pyqtSlot()
|
||||
def setFullscreen(self):
|
||||
self.sight.showFullScreen()
|
||||
|
||||
"""@pyqtSlot(result=str)
|
||||
def getTitle(self):
|
||||
return self.sight.getTitle();
|
||||
"""
|
||||
@pyqtSlot()
|
||||
def move(self):
|
||||
base.data["move"] = True
|
||||
|
||||
|
||||
@pyqtSlot()
|
||||
def endmove(self):
|
||||
base.data["move"] = False
|
||||
|
||||
@pyqtSlot()
|
||||
def resize(self):
|
||||
new_height = base.mousectrl.position[1]-self.sight.pos().y()
|
||||
new_width = base.mousectrl.position[0]-self.sight.pos().x()
|
||||
if(new_height<250):
|
||||
new_height = 250
|
||||
if(new_width<250):
|
||||
new_width = 250
|
||||
self.sight.resize( new_width, new_height)
|
||||
Loading…
Reference in New Issue