...
 
Commits (7)
......@@ -11,3 +11,8 @@ __pycache__/
.dmypy.json
/venv/
.flatpak-builder/
/stage/
/prime/
/parts/
/snap/.snapcraft/
*.snap
\ No newline at end of file
......@@ -34,9 +34,9 @@ gi.require_version('Gtk', '3.0')
gi.require_version('Dazzle', '1.0')
from gi.repository import GLib
from gwe.util.log import set_log_level
from gwe.repository import NvidiaRepository
from gwe.di import INJECTOR
from gwe.app import Application
from gwe.repository import NvidiaRepository
WHERE_AM_I = abspath(dirname(__file__))
LOCALE_DIR = join(WHERE_AM_I, 'mo')
......
......@@ -52,6 +52,8 @@ class Application(Gtk.Application):
super().__init__(*args, application_id=APP_ID,
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
**kwargs)
database.connect()
database.create_tables([FanProfile, SpeedStep, CurrentFanProfile, Setting])
if FanProfile.select().count() == 0:
......
......@@ -84,10 +84,8 @@ class ProviderModule(Module):
@singleton
@provider
def provide_database(self) -> SqliteDatabase:
LOG.debug("provide SqliteDatabase")
database = SqliteDatabase(get_config_path(APP_DB_NAME))
database.connect()
return database
LOG.debug("provide CompositeDisposable")
return SqliteDatabase(get_config_path(APP_DB_NAME))
@singleton
@provider
......
......@@ -21,7 +21,6 @@ from typing import Any, Tuple, Dict
from gi.repository import Gtk, GLib
from injector import singleton, inject
from gwe.interactor import SettingsInteractor
from gwe.model import Status
from gwe.util.view import hide_on_delete, is_dazzle_version_supported
......@@ -56,11 +55,8 @@ class HistoricalDataViewInterface:
@singleton
class HistoricalDataPresenter:
@inject
def __init__(self,
settings_interactor: SettingsInteractor,
) -> None:
def __init__(self) -> None:
LOG.debug("init HistoricalDataPresenter ")
self._settings_interactor = settings_interactor
self.view: HistoricalDataViewInterface = HistoricalDataViewInterface()
def add_status(self, new_status: Status) -> None:
......@@ -103,6 +99,3 @@ class HistoricalDataPresenter:
def on_dialog_delete_event(self, widget: Gtk.Widget, *_: Any) -> Any:
return hide_on_delete(widget)
def get_refresh_interval(self) -> int:
return self._settings_interactor.get_int('settings_refresh_interval')
......@@ -78,7 +78,7 @@ class HistoricalDataView(HistoricalDataViewInterface):
graph_renderer.set_stroke_color_rgba(stroke_color)
graph_renderer.set_stacked_color_rgba(stacked_color)
graph_model.set_timespan(MONITORING_INTERVAL * 1000 * 1000)
graph_model.set_max_samples(MONITORING_INTERVAL / self._presenter.get_refresh_interval() + 1)
graph_model.set_max_samples(MONITORING_INTERVAL / 3)
graph_model.props.value_max = 100.0
graph_model.props.value_min = 0.0
......
This diff is collapsed.