def __init__(self): super().__init__() self.setFixedHeight(500) self.setFixedWidth(350) self.setupNote() self.setupToolBar() self.setupStatusBar() self.view.setupSignal(self.updateStatusBar) ti = TrayIcon(self) ti.show() self.show()
def __init__(self, exec_by_ibus): engine_name = "bogo" long_engine_name = "BoGo" author = "BoGo Development Team <*****@*****.**>" description = "ibus-bogo for IBus" version = "0.4" license = "GPLv3" self.component = \ IBus.Component.new("org.freedesktop.IBus.BoGo", description, version, license, author, "https://github.com/BoGoEngine/ibus-bogo", "/usr/bin/exec", "ibus-bogo") engine = IBus.EngineDesc(name=engine_name, longname=long_engine_name, description=description, language="vi", license=license, author=author, icon=current_path + "/data/ibus-bogo-dev.svg", # icon = "ibus-bogo", layout="default") self.component.add_engine(engine) self.mainloop = GObject.MainLoop() self.bus = IBus.Bus() self.bus.connect("disconnected", self.bus_disconnected_cb) self.engine_count = 0 self.factory = IBus.Factory.new(self.bus.get_connection()) self.factory.connect("create-engine", self.create_engine) CONFIG_DIR = os.path.expanduser("~/.config/ibus-bogo/") self.config = Config() self.abbr_expander = AbbreviationExpander(config=self.config) self.abbr_expander.watch_file(CONFIG_DIR + "/abbr_rules.json") self.icon = TrayIcon() if exec_by_ibus: self.bus.request_name("org.freedesktop.IBus.BoGo", 0) else: self.bus.register_component(self.component) self.bus.set_global_engine_async( "bogo", -1, None, None, None)
def __init__(self, parent=None): super(QWidget, self).__init__(parent) self.setWindowFlags(Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) self.signals = self.Signals() self.setAcceptDrops(1) self.resize(QSize(238, 68)) self.setAlignment(Qt.AlignCenter) self.trayIcon = TrayIcon() self.trayIcon.show() self.trayIcon.activated[QSystemTrayIcon.ActivationReason].connect( self.trayActivated) self.signals.itemDropped[str].connect(self.trayIcon.apiHandle.addItem) self.trayIcon.apiHandle.pdialog.voffsetSlider.valueChanged[ int].connect(self.vmove) self.move(qApp.desktop().width() - 227, self.trayIcon.apiHandle.pdialog.settings['drop_topoffset']) self.slideIn()
import webbrowser from concurrent.futures import CancelledError from config import getConfigs, writeConfig from dialogs import selectFileDialog, selectDirectoryDialog, showMessage from logger import Logger, clearLogFile from mapsfileobserver import MapsFileObserver from mapsobserver import MapsObserver from path import mapsFilePath, poeDirectoryIsValid from sound import playAlert, setAlertSoundPath, stopAlert, audioFileIsValid from trayicon import TrayIcon clearLogFile() logger = Logger('main') mainLoop = asyncio.get_event_loop() trayIcon = TrayIcon() def _selectPathOfExileDirectory(): path = selectDirectoryDialog('Path of Exile') if not path: return if not poeDirectoryIsValid(path): showMessage( 'Invalid directory. Are you sure this is Path of Exile directory?') _selectPathOfExileDirectory() return writeConfig('Main', 'PathOfExileDirectoryPath', path) def _openMapsFile():
def createTrayIcon(self, toolTip='', icon=''): return TrayIcon(self.window, toolTip, self.normUrl(icon))