Пример #1
0
 def __init__(self):
     super().__init__()
     self.setWindowTitle("Foreseeable")
     self.setWindowIcon(QIcon("icon.png"))
     QtWin.setCurrentProcessExplicitAppUserModelID("ModernEra.Foreseeable.1.0")
     self.setFixedWidth(700)
     self.setFixedHeight(100)
     # Create a QHBoxLayout instance
     self.layout = QHBoxLayout()
     # Add widgets to the layout
     self.lineEdit = QLineEdit()
     self.layout.addWidget(self.lineEdit)
     self.button = QPushButton("Get Temp!")
     self.button.clicked.connect(self.button_click)
     self.layout.addWidget(self.button)
     self.label = QLabel("Enter a City (and a State optionally)")
     self.layout.addWidget(self.label)
     self.image = QLabel()
     question = QPixmap('question.jpg')
     question = question.scaledToWidth(75)
     self.image.setPixmap(question)
     self.layout.addWidget(self.image)
     # Set the layout on the application's window
     self.setLayout(self.layout)
     print(self.children())
def main():
    """
    Main function for the GUI that sets up the application, main window, database and system tray and starts the
    even loop. General settings regarding the application is also handled here.
    """
    app = QtWidgets.QApplication(sys.argv)
    app.setWindowIcon(QtGui.QIcon("../resources/graph_icon.ico"))

    # Changing the app id so our custom window icon is shown on the toolbar.
    QtWin.setCurrentProcessExplicitAppUserModelID("aqt_assistant.v1.0")

    # Ensuring that we do not stop the application when the main window is closed.
    app.setQuitOnLastWindowClosed(False)

    # Setting up the database object that can be used to query from the livingroom database.
    aqt_assistant_db = Database()

    # Setting up the main GUI window.
    main_window = MainWindow(aqt_assistant_db)

    # Setting up the system tray icon.
    system_tray = SystemTray(main_window, aqt_assistant_db, app)

    # setup stylesheet
    app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())

    main_window.show()
    sys.exit(app.exec_())
Пример #3
0
def define_win_extras():
    """Windows only definition"""
    try:
        from PyQt5.QtWinExtras import QtWin  # noqa

        app_id = 'semiworld.org.tools.wdg'
        QtWin.setCurrentProcessExplicitAppUserModelID(app_id)  # noqa
    except ImportError:
        pass
Пример #4
0
def makeApp():
    try:
        from PyQt5.QtWinExtras import QtWin
        QtWin.setCurrentProcessExplicitAppUserModelID(APP_ID)
    except:
        pass
    app = QApplication(sys.argv)
    app.setQuitOnLastWindowClosed(False)
    app.setWindowIcon(makeIcon("tomato"))
    app.setApplicationName("Pomodoro")
    app.setOrganizationName("Burak Martin")
    app.setOrganizationDomain("https://github.com/burakmartin")
    return app
Пример #5
0
def main():
    try:
        from PyQt5.QtWinExtras import QtWin
        myappid = f'timeerr.portfolio.{confighandler.get_version().replace(".","-")}'
        QtWin.setCurrentProcessExplicitAppUserModelID(myappid)
    except ImportError:
        pass

    app = QApplication(sys.argv)
    # ----- Internationalization ------
    # If a language hasn't been selected yet, we ask the user for one
    confighandler.initial_setup()
    if confighandler.get_language(
    ) == 'None' or confighandler.get_fiat_currency() == 'None':
        # Select language for the first time
        preferences_dlg = PreferencesSelection()
        preferences_dlg.exec_()
    # Load language
    selected_language = confighandler.get_language()
    if selected_language != 'EN':
        logger.info(f"Loading language {selected_language}")
        # Search for translation file
        translation_file = os.path.join(
            RESOURCES_PATH,
            f"app_{selected_language.lower()}_{confighandler.get_version()}.qm"
        )
        if not os.path.exists(translation_file):
            logger.warning(
                f"Couldn't tanslate app to {selected_language} : Translation file missing"
            )
        else:
            # Translate
            translator = QTranslator()
            translator.load(translation_file)
            app.installTranslator(translator)

    # ------- Style ---------
    # Dark Style Theme
    app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
    # Font
    defaultfont = QFont()
    defaultfont.setFamily('Roboto')
    app.setFont(defaultfont)
    # Icon
    app.setWindowIcon(resource_gatherer.get_resource_QIcon('logo.png'))

    # ---- Execution ----
    window = MainWindow()
    window.show()
    app.exec_()
Пример #6
0
def main():
    app = QtWidgets.QApplication(sys.argv)
    app.setWindowIcon(QtGui.QIcon("../resources/stationarybicycle.ico"))

    # Changing the app id so our custom window icon is shown on the toolbar.
    QtWin.setCurrentProcessExplicitAppUserModelID('exercise_bike_logger.v1.0')

    main_window = MainWindow()

    # Set stylesheet.
    file = QFile(":/dark.qss")
    file.open(QFile.ReadOnly | QFile.Text)
    stream = QTextStream(file)
    app.setStyleSheet(stream.readAll())

    main_window.show()
    sys.exit(app.exec_())
Пример #7
0
    def __init__(self, parent=None, *args, **kwargs):
        super(MainWindow, self).__init__(parent, *args, **kwargs)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        # For getting the icon to work
        try:
            from PyQt5.QtWinExtras import QtWin

            myappid = "my_company.my_product.sub_product.version"
            QtWin.setCurrentProcessExplicitAppUserModelID(
                myappid)  # type: ignore
        except ImportError:
            pass

        global app_root
        if app_root:
            ico_path = str(Path(app_root) / Path("UI/images/icon.ico"))
        else:
            app_root = ":/"
            ico_path = app_root + "icon.ico"
        self.setWindowIcon(QtGui.QIcon(ico_path))
        self.batch_dialog = BatchAddDialogue(self)
        self.ui.saveToLineEdit.setText(desktop_path)
        self.ui.BrowseConvertToLineEdit.setText(str(Path().cwd()))
        self.ui.BrowseConvertLineEdit.files = []
        self.ui.statusbar.showMessage("Ready.")
        self.set_connections()

        self.url_list = []
        self.complete_url_list = {}
        self.convert_list = []
        self.threadpool = QtCore.QThreadPool()
        self.ui.tableWidget.horizontalHeader().setSectionResizeMode(
            0, QtWidgets.QHeaderView.Stretch)
        self.rowcount = 0

        self.connect_menu_action()

        self.about = AboutDialog(self)
        self.license = LicenseDialogue(self)
        self.closing = CloseSignals()
        self.show()
Пример #8
0
def main():
    app = QtWidgets.QApplication(sys.argv)
    app.setWindowIcon(QtGui.QIcon('../resources/reddit_icon.ico'))

    # Changing the app id so our custom window icon is shown on the toolbar.
    QtWin.setCurrentProcessExplicitAppUserModelID(
        'reddit_background_changer.v1.0')

    # Ensuring that we do not stop the application when the main window is closed.
    app.setQuitOnLastWindowClosed(False)

    # Setting up the background changer that will be used in the main window and the system tray.
    # We use the absolute path since it is required when changing the background on windows.
    background_changer = BackgroundChanger()

    main_window = MainWindow(background_changer)
    system_tray = SystemTray(background_changer, main_window, app)

    main_window.show()
    sys.exit(app.exec_())
Пример #9
0
try:
    # Include in try/except block if you're also targeting Mac/Linux
    from PyQt5.QtWinExtras import QtWin
    myappid = 'booktracker.11'
    QtWin.setCurrentProcessExplicitAppUserModelID(myappid)
except ImportError:
    pass

import sys
import json
from PyQt5 import uic
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from src.book_browse import bookBrowse
from src.book_move import BookMove
from src.book_entry import BookEntry
from src.book_type import BookType
from src.cost import Cost
from src.status import Status
from src.fs_utils import FsUtils
from src.price_breakdown import PriceBreakdown
from src.book_discription import BookDiscription
from src.settings import Settings


class MainWindow(QMainWindow):
    def __init__(self, *args, **kwargs):
        super(MainWindow, self).__init__(*args, **kwargs)

        uic.loadUi(FsUtils.get_resource("/ui/mainwindow.ui"), self)
Пример #10
0
from PyQt5.QtWidgets import (QApplication, QMainWindow, QHBoxLayout,
                             QDesktopWidget, QFrame)
import sys
from collections import OrderedDict
from multiprocessing import freeze_support
from app.components.navbar import NavBar
from app.components.dataset import Dataset
from app.components.model import Model
from app.components.flickr import Flickr
from app.components.export import Export
from app import resource_path

try:
    # Include in try/except block if you're also targeting Mac/Linux
    from PyQt5.QtWinExtras import QtWin
    QtWin.setCurrentProcessExplicitAppUserModelID('image-tools.0.1')
except ImportError:
    pass

if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'):
    QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)

if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'):
    QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)

# style variables
DARK_0 = "rgb(18,18,18)"
DARK_1 = "rgb(29,29,29)"
DARK_2 = "rgb(33,33,33)"
DARK_3 = "rgb(39,39,39)"
DARK_4 = "rgb(45,45,45)"
Пример #11
0
from PyQt5.QtWidgets import QApplication

from ui import CaveMainWindow

old_excepthook = sys.excepthook


def exception_hook(exctype, value, traceback):
    old_excepthook(exctype, value, traceback)
    sys.exit(1)


sys.excepthook = exception_hook

try:
    from PyQt5.QtWinExtras import QtWin

    QtWin.setCurrentProcessExplicitAppUserModelID('cavensio.cavencity')
except ImportError:
    pass

app = QApplication(sys.argv)
with open('cavencio.qss') as f:
    app.setStyleSheet(f.read())

window = CaveMainWindow()
window.show()

app.exec()
Пример #12
0
#     matplotlib.use("Qt5Agg")
# except:
#     matplotlib.use("TkAgg")

from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

import Pretzel
from Pretzel.app import PretzelWindow

try:
    # For Windows
    from PyQt5.QtWinExtras import QtWin
    pretzel_id = 'iwoithe.pretzel.app.0.0.1'
    QtWin.setCurrentProcessExplicitAppUserModelID(pretzel_id)
except ImportError:
    pass

if __name__ == '__main__':
    # TODO: Custom properties so users can add/remove columns of data
    # TODO: when using uic.loadUi(), see if using relative paths will work (e.g. "./test.ui" instead of "Pretzel/ui/test/test.ui etc.")
    # Setup the application
    app = QApplication(sys.argv)
    app.setStyle("fusion")

    # Show the splash screen
    splash_img = QPixmap("data/pretzel/logo.svg")
    splash_screen = QSplashScreen(splash_img)
    splash_screen.show()