|
1 | | -from ..logger import logger, handle_exception |
2 | | -logger.debug("Started 'reading app/application.py'") |
3 | | - |
4 | | -import sys, os, time |
5 | 1 | import ctypes |
| 2 | +import os |
6 | 3 | import platform |
| 4 | +import sys |
| 5 | +import time |
7 | 6 | import traceback |
8 | | -logger.debug("Started 'reading app/application.py, importing qtpy'") |
| 7 | + |
9 | 8 | from qtpy import QtCore, QtWidgets, QtGui |
10 | | -logger.debug("Completed 'reading app/application.py, importing qtpy'") |
| 9 | +from qtpy.QtCore import QUrl |
| 10 | +from qtpy.QtGui import QDesktopServices |
| 11 | + |
| 12 | +from flika import global_vars as g |
| 13 | +from flika.app.plugin_manager import PluginManager, load_local_plugins |
| 14 | +from flika.app.script_editor import ScriptEditor |
| 15 | +from flika.app.settings_editor import SettingsEditor, rectSettings, pointSettings, pencilSettings |
| 16 | +from flika.images import image_path |
| 17 | +from flika.logger import logger, handle_exception |
| 18 | +from flika.update_flika import checkUpdates |
| 19 | +from flika.utils.app import get_qapp |
| 20 | +from flika.utils.misc import nonpartial, send_user_stats, load_ui, send_error_report |
| 21 | +from flika.utils.thread_manager import run_in_thread, cleanup_threads |
| 22 | +from flika.version import __version__ |
11 | 23 |
|
12 | | -from ..utils.misc import nonpartial, send_user_stats |
13 | | -from ..utils.app import get_qapp |
14 | | -from ..app.settings_editor import SettingsEditor, rectSettings, pointSettings, pencilSettings |
15 | | -from .. import global_vars as g |
16 | | -from .plugin_manager import PluginManager, load_local_plugins |
17 | | -from .script_editor import ScriptEditor |
18 | | -from ..utils.misc import load_ui, send_error_report |
19 | | -from ..utils.thread_manager import run_in_thread, cleanup_threads |
20 | | -from ..images import image_path |
21 | | -from ..version import __version__ |
22 | | -from ..update_flika import checkUpdates |
| 24 | +logger.debug("Started 'reading app/application.py'") |
23 | 25 |
|
24 | 26 |
|
25 | 27 | def status_pixmap(attention=False): |
@@ -151,8 +153,8 @@ class FlikaApplication(QtWidgets.QMainWindow): |
151 | 153 | """ |
152 | 154 | def __init__(self): |
153 | 155 | logger.debug("Started 'creating app.application.FlikaApplication'") |
154 | | - from ..process.file_ import open_file, open_file_from_gui, open_image_sequence_from_gui, open_points, save_file, save_movie_gui, save_points, save_rois |
155 | | - from ..process import setup_menus |
| 156 | + from flika.process.file_ import open_file, open_file_from_gui, open_image_sequence_from_gui, open_points, save_file, save_movie_gui, save_points, save_rois |
| 157 | + from flika.process import setup_menus |
156 | 158 | logger.debug("Started 'creating app.application.FlikaApplication.app'") |
157 | 159 | self.app = get_qapp(image_path('favicon.png')) |
158 | 160 | logger.debug("Completed 'creating app.application.FlikaApplication.app'") |
@@ -252,8 +254,8 @@ def setWindowSize(self): |
252 | 254 |
|
253 | 255 | def _make_menu(self): |
254 | 256 | logger.debug("Started 'app.application.FlikaApplication._make_menu()'") |
255 | | - from ..roi import open_rois |
256 | | - from ..process.file_ import open_file, open_file_from_gui, open_image_sequence_from_gui, open_points, save_file, save_movie_gui, save_points, save_rois |
| 257 | + from flika.roi import open_rois |
| 258 | + from flika.process.file_ import open_file, open_file_from_gui, open_image_sequence_from_gui, open_points, save_file, save_movie_gui, save_points, save_rois |
257 | 259 | fileMenu = self.menuBar().addMenu('File') |
258 | 260 | openMenu = fileMenu.addMenu("Open") |
259 | 261 | openMenu.addAction("Open Image/Movie", open_file_from_gui) |
@@ -284,7 +286,7 @@ def _make_menu(self): |
284 | 286 |
|
285 | 287 | helpMenu = self.menuBar().addMenu("Help") |
286 | 288 | url = 'http://flika-org.github.io' |
287 | | - helpMenu.addAction("Documentation", lambda: QtGui.QDesktopServices.openUrl(QtCore.QUrl(url))) |
| 289 | + helpMenu.addAction("Documentation", lambda: QDesktopServices.openUrl(QUrl(url))) |
288 | 290 | helpMenu.addAction("Check For Updates", checkUpdates) |
289 | 291 | logger.debug("Completed 'app.application.FlikaApplication._make_menu()'") |
290 | 292 |
|
@@ -356,7 +358,7 @@ def dragEnterEvent(self, event): |
356 | 358 | event.ignore() |
357 | 359 |
|
358 | 360 | def dropEvent(self, event): |
359 | | - from ..process.file_ import open_file |
| 361 | + from flika.process.file_ import open_file |
360 | 362 | if event.mimeData().hasUrls(): # if file or link is dropped |
361 | 363 | for url in event.mimeData().urls(): |
362 | 364 | filename = url.toLocalFile() |
@@ -397,7 +399,7 @@ def closeEvent(self, event): |
397 | 399 |
|
398 | 400 | def setup_button_icons(self): |
399 | 401 | """Ultra-simple button icon setup""" |
400 | | - from ..images import image_path |
| 402 | + from flika.images import image_path |
401 | 403 |
|
402 | 404 | # One-liner for most buttons (assumes button name matches icon name) |
403 | 405 | for btn in self.findChildren(QtWidgets.QPushButton): |
|
0 commit comments