mirror of
https://github.com/borgbase/vorta
synced 2024-12-23 00:07:58 +00:00
Reuse existing window when bringing to front. (#674)
This commit is contained in:
parent
1599f3adb0
commit
364d401b39
2 changed files with 4 additions and 3 deletions
|
@ -88,7 +88,8 @@ def create_backup_action(self, profile_id=None):
|
||||||
self.backup_progress_event.emit(translate('messages', msg['message']))
|
self.backup_progress_event.emit(translate('messages', msg['message']))
|
||||||
|
|
||||||
def open_main_window_action(self):
|
def open_main_window_action(self):
|
||||||
self.main_window = MainWindow(self)
|
if not self._main_window_exists():
|
||||||
|
self.main_window = MainWindow(self)
|
||||||
self.main_window.show()
|
self.main_window.show()
|
||||||
self.main_window.raise_()
|
self.main_window.raise_()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
import vorta
|
import vorta
|
||||||
from vorta.models import (RepoModel, RepoPassword, BackupProfileModel, SourceFileModel,
|
from vorta.models import (RepoModel, RepoPassword, BackupProfileModel, SourceFileModel,
|
||||||
SettingsModel, ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion)
|
SettingsModel, ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion)
|
||||||
|
from vorta.views.main_window import MainWindow
|
||||||
|
|
||||||
models = [RepoModel, RepoPassword, BackupProfileModel, SourceFileModel,
|
models = [RepoModel, RepoPassword, BackupProfileModel, SourceFileModel,
|
||||||
SettingsModel, ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion]
|
SettingsModel, ArchiveModel, WifiSettingModel, EventLogModel, SchemaVersion]
|
||||||
|
@ -40,7 +40,7 @@ def init_db(qapp):
|
||||||
source_dir = SourceFileModel(dir='/tmp/another', repo=new_repo)
|
source_dir = SourceFileModel(dir='/tmp/another', repo=new_repo)
|
||||||
source_dir.save()
|
source_dir.save()
|
||||||
|
|
||||||
qapp.open_main_window_action()
|
qapp.main_window = MainWindow(qapp) # Re-open main window to apply mock data in UI
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session', autouse=True)
|
@pytest.fixture(scope='session', autouse=True)
|
||||||
|
|
Loading…
Reference in a new issue