-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
32 lines (27 loc) · 769 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import sys
from PyQt4.QtGui import QIcon
from env import Configuration, App
from utils import *
from views import MyWindow, FileTransferStatusBar, TrayIcon
from fsmonitor import FSMonitor
def init_monitor(model):
monitor = FSMonitor()
directory = Configuration.get_directory()
if directory:
monitor.watch(directory)
Configuration.have_updated.connect(lambda:monitor.watch(Configuration.get_directory()))
monitor.start()
def main():
window = MyWindow()
model = window.centralWidget().model().sourceModel()
init_monitor( model)
window.resize(800, 400)
window.show()
tray = TrayIcon(App)
tray.show()
App.exec_()
tray = None
sys.exit()
if __name__ == '__main__':
main()