trackma 0.6__py3.5.egg → 0.7.4__py3.5.egg
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- EGG-INFO/PKG-INFO +1 -1
- EGG-INFO/SOURCES.txt +23 -6
- EGG-INFO/entry_points.txt +4 -3
- EGG-INFO/requires.txt +1 -3
- trackma/__pycache__/__init__.cpython-35.pyc +0 -0
- trackma/__pycache__/accounts.cpython-35.pyc +0 -0
- trackma/__pycache__/data.cpython-35.pyc +0 -0
- trackma/__pycache__/engine.cpython-35.pyc +0 -0
- trackma/__pycache__/messenger.cpython-35.pyc +0 -0
- trackma/__pycache__/utils.cpython-35.pyc +0 -0
- trackma/data/kitsu.png +0 -0
- trackma/data.py +28 -17
- trackma/engine.py +208 -64
- trackma/extras/AnimeInfoExtractor.py +14 -5
- trackma/extras/__pycache__/AnimeInfoExtractor.cpython-35.pyc +0 -0
- trackma/extras/__pycache__/__init__.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/__init__.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/lib.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/libanilist.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/libkitsu.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/libmal.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/libshikimori.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/libvndb.cpython-35.pyc +0 -0
- trackma/lib/libanilist.py +21 -17
- trackma/lib/libkitsu.py +506 -0
- trackma/lib/libmal.py +15 -15
- trackma/lib/libshikimori.py +3 -3
- trackma/lib/libvndb.py +26 -14
- trackma/messenger.py +1 -1
- trackma/tracker/__init__.py +0 -0
- trackma/tracker/__pycache__/__init__.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/inotify.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/inotifyBase.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/plex.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/polling.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/pyinotify.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/tracker.cpython-35.pyc +0 -0
- trackma/tracker/__pycache__/win32.cpython-35.pyc +0 -0
- trackma/tracker/inotify.py +69 -0
- trackma/tracker/inotifyBase.py +107 -0
- trackma/tracker/plex.py +139 -0
- trackma/tracker/polling.py +55 -0
- trackma/tracker/pyinotify.py +90 -0
- trackma/tracker/tracker.py +223 -0
- trackma/tracker/win32.py +74 -0
- trackma/ui/__pycache__/__init__.cpython-35.pyc +0 -0
- trackma/ui/__pycache__/cli.cpython-35.pyc +0 -0
- trackma/ui/__pycache__/curses.cpython-35.pyc +0 -0
- trackma/ui/__pycache__/gtkui.cpython-35.pyc +0 -0
- trackma/ui/__pycache__/qt4ui.cpython-35.pyc +0 -0
- trackma/ui/__pycache__/qtui.cpython-35.pyc +0 -0
- trackma/ui/cli.py +195 -26
- trackma/ui/curses.py +133 -66
- trackma/ui/gtkui.py +253 -78
- trackma/ui/qt4ui.py +25 -0
- trackma/ui/qtui.py +357 -186
- trackma/utils.py +40 -11
- trackma/__pycache__/tracker.cpython-35.pyc +0 -0
- trackma/data/hb.jpg +0 -0
- trackma/data/melative.jpg +0 -0
- trackma/extras/__pycache__/plex.cpython-35.pyc +0 -0
- trackma/extras/plex.py +0 -101
- trackma/lib/__pycache__/libhb.cpython-35.pyc +0 -0
- trackma/lib/__pycache__/libmelative.cpython-35.pyc +0 -0
- trackma/lib/libhb.py +0 -237
- trackma/lib/libmelative.py +0 -204
- trackma/tracker.py +0 -390
trackma/ui/gtkui.py
CHANGED
|
@@ -25,13 +25,15 @@ try:
|
|
|
25
25
|
from gi.repository import GObject
|
|
26
26
|
except ImportError as ex:
|
|
27
27
|
print("Couldn't import GTK dependencies. Make sure you "
|
|
28
|
-
"installed the PyGTK package and
|
|
28
|
+
"installed the PyGTK package and {} module.".format(ex.name))
|
|
29
|
+
print("Details: {}".format(ex))
|
|
29
30
|
sys.exit(-1)
|
|
30
31
|
|
|
31
32
|
Gdk.threads_init() # We'll use threads
|
|
32
33
|
|
|
33
34
|
import webbrowser
|
|
34
35
|
import os
|
|
36
|
+
import subprocess
|
|
35
37
|
import cgi
|
|
36
38
|
import time
|
|
37
39
|
import threading
|
|
@@ -54,7 +56,7 @@ from trackma.accounts import AccountManager
|
|
|
54
56
|
from trackma import utils
|
|
55
57
|
from trackma import messenger
|
|
56
58
|
|
|
57
|
-
class Trackma_gtk():
|
|
59
|
+
class Trackma_gtk(object):
|
|
58
60
|
engine = None
|
|
59
61
|
config = None
|
|
60
62
|
show_lists = dict()
|
|
@@ -63,6 +65,9 @@ class Trackma_gtk():
|
|
|
63
65
|
hidden = False
|
|
64
66
|
quit = False
|
|
65
67
|
|
|
68
|
+
def __init__(self, debug=False):
|
|
69
|
+
self.debug = debug
|
|
70
|
+
|
|
66
71
|
def main(self):
|
|
67
72
|
"""Start the Account Selector"""
|
|
68
73
|
self.configfile = utils.get_root_filename('ui-Gtk.json')
|
|
@@ -122,9 +127,13 @@ class Trackma_gtk():
|
|
|
122
127
|
|
|
123
128
|
# Menus
|
|
124
129
|
mb_show = Gtk.Menu()
|
|
125
|
-
self.mb_play = Gtk.ImageMenuItem('Play', Gtk.Image.new_from_icon_name(Gtk.STOCK_MEDIA_PLAY, 0))
|
|
130
|
+
self.mb_play = Gtk.ImageMenuItem('Play Next', Gtk.Image.new_from_icon_name(Gtk.STOCK_MEDIA_PLAY, 0))
|
|
126
131
|
self.mb_play.connect("activate", self.__do_play, True)
|
|
132
|
+
self.mb_play_random = Gtk.MenuItem('Play random')
|
|
133
|
+
self.mb_play_random.connect("activate", self.__do_play_random)
|
|
127
134
|
mb_scanlibrary = Gtk.MenuItem('Re-scan library')
|
|
135
|
+
self.mb_folder = Gtk.MenuItem("Open containing folder")
|
|
136
|
+
self.mb_folder.connect("activate", self.do_containingFolder)
|
|
128
137
|
mb_scanlibrary.connect("activate", self.__do_scanlibrary)
|
|
129
138
|
self.mb_info = Gtk.MenuItem('Show details...')
|
|
130
139
|
self.mb_info.connect("activate", self.__do_info)
|
|
@@ -142,10 +151,12 @@ class Trackma_gtk():
|
|
|
142
151
|
self.mb_addsearch.connect("activate", self._do_addsearch)
|
|
143
152
|
|
|
144
153
|
mb_show.append(self.mb_addsearch)
|
|
154
|
+
mb_show.append(self.mb_play_random)
|
|
145
155
|
mb_show.append(Gtk.SeparatorMenuItem())
|
|
146
156
|
mb_show.append(self.mb_play)
|
|
147
157
|
mb_show.append(self.mb_info)
|
|
148
158
|
mb_show.append(self.mb_web)
|
|
159
|
+
mb_show.append(self.mb_folder)
|
|
149
160
|
mb_show.append(Gtk.SeparatorMenuItem())
|
|
150
161
|
mb_show.append(self.mb_copy)
|
|
151
162
|
mb_show.append(self.mb_alt_title)
|
|
@@ -366,6 +377,8 @@ class Trackma_gtk():
|
|
|
366
377
|
|
|
367
378
|
key, mod = Gtk.accelerator_parse("<Control>N")
|
|
368
379
|
self.mb_play.add_accelerator("activate", accelgrp, key, mod, Gtk.AccelFlags.VISIBLE)
|
|
380
|
+
key, mod = Gtk.accelerator_parse("<Control>R")
|
|
381
|
+
self.mb_play_random.add_accelerator("activate", accelgrp, key, mod, Gtk.AccelFlags.VISIBLE)
|
|
369
382
|
key, mod = Gtk.accelerator_parse("<Control>A")
|
|
370
383
|
self.mb_addsearch.add_accelerator("activate", accelgrp, key, mod, Gtk.AccelFlags.VISIBLE)
|
|
371
384
|
key, mod = Gtk.accelerator_parse("<Control>S")
|
|
@@ -635,6 +648,9 @@ class Trackma_gtk():
|
|
|
635
648
|
def __do_play(self, widget, playnext, ep=None):
|
|
636
649
|
threading.Thread(target=self.task_play, args=(playnext,ep)).start()
|
|
637
650
|
|
|
651
|
+
def __do_play_random(self, widget):
|
|
652
|
+
threading.Thread(target=self.task_play_random).start()
|
|
653
|
+
|
|
638
654
|
def __do_scanlibrary(self, widget):
|
|
639
655
|
threading.Thread(target=self.task_scanlibrary).start()
|
|
640
656
|
|
|
@@ -688,21 +704,32 @@ class Trackma_gtk():
|
|
|
688
704
|
self.error(e)
|
|
689
705
|
|
|
690
706
|
def __do_update_next(self, show, played_ep):
|
|
691
|
-
# Thread safe
|
|
692
707
|
GObject.idle_add(self.task_update_next, show, played_ep)
|
|
693
708
|
|
|
694
709
|
def changed_show(self, show):
|
|
710
|
+
GObject.idle_add(self.task_changed_show, show)
|
|
711
|
+
|
|
712
|
+
def changed_show_title(self, show, altname):
|
|
713
|
+
GObject.idle_add(self.task_changed_show_title, show, altname)
|
|
714
|
+
|
|
715
|
+
def changed_show_status(self, show, old_status=None):
|
|
716
|
+
GObject.idle_add(self.task_changed_show_status, show, old_status)
|
|
717
|
+
|
|
718
|
+
def playing_show(self, show, is_playing, episode):
|
|
719
|
+
GObject.idle_add(self.task_playing_show, show, is_playing, episode)
|
|
720
|
+
|
|
721
|
+
def task_changed_show(self, show):
|
|
695
722
|
status = show['my_status']
|
|
696
723
|
self.show_lists[status].update(show)
|
|
697
724
|
if show['id'] == self.selected_show:
|
|
698
725
|
self.show_ep_button.set_label(str(show['my_progress']))
|
|
699
726
|
self.show_score.set_value(show['my_score'])
|
|
700
727
|
|
|
701
|
-
def
|
|
728
|
+
def task_changed_show_title(self, show, altname):
|
|
702
729
|
status = show['my_status']
|
|
703
730
|
self.show_lists[status].update_title(show, altname)
|
|
704
731
|
|
|
705
|
-
def
|
|
732
|
+
def task_changed_show_status(self, show, old_status):
|
|
706
733
|
# Rebuild lists
|
|
707
734
|
status = show['my_status']
|
|
708
735
|
|
|
@@ -715,7 +742,7 @@ class Trackma_gtk():
|
|
|
715
742
|
|
|
716
743
|
self.show_lists[status].select(show)
|
|
717
744
|
|
|
718
|
-
def
|
|
745
|
+
def task_playing_show(self, show, is_playing, episode):
|
|
719
746
|
status = show['my_status']
|
|
720
747
|
self.show_lists[status].playing(show, is_playing)
|
|
721
748
|
|
|
@@ -757,11 +784,22 @@ class Trackma_gtk():
|
|
|
757
784
|
self.status("Ready.")
|
|
758
785
|
self.allow_buttons(True)
|
|
759
786
|
|
|
787
|
+
def task_play_random(self):
|
|
788
|
+
self.allow_buttons(False)
|
|
789
|
+
|
|
790
|
+
try:
|
|
791
|
+
self.engine.play_random()
|
|
792
|
+
except utils.TrackmaError as e:
|
|
793
|
+
self.error(e)
|
|
794
|
+
|
|
795
|
+
self.status("Ready.")
|
|
796
|
+
self.allow_buttons(True)
|
|
797
|
+
|
|
760
798
|
def task_scanlibrary(self):
|
|
761
799
|
self.allow_buttons(False)
|
|
762
800
|
|
|
763
801
|
try:
|
|
764
|
-
result = self.engine.scan_library()
|
|
802
|
+
result = self.engine.scan_library(rescan=True)
|
|
765
803
|
except utils.TrackmaError as e:
|
|
766
804
|
self.error(e)
|
|
767
805
|
|
|
@@ -964,11 +1002,13 @@ class Trackma_gtk():
|
|
|
964
1002
|
|
|
965
1003
|
def message_handler(self, classname, msgtype, msg):
|
|
966
1004
|
# Thread safe
|
|
967
|
-
print("%s: %s" % (classname, msg))
|
|
1005
|
+
#print("%s: %s" % (classname, msg))
|
|
968
1006
|
if msgtype == messenger.TYPE_WARN:
|
|
969
1007
|
GObject.idle_add(self.status_push, "%s warning: %s" % (classname, msg))
|
|
970
1008
|
elif msgtype != messenger.TYPE_DEBUG:
|
|
971
1009
|
GObject.idle_add(self.status_push, "%s: %s" % (classname, msg))
|
|
1010
|
+
elif self.debug:
|
|
1011
|
+
print('[D] {}: {}'.format(classname, msg))
|
|
972
1012
|
|
|
973
1013
|
def error(self, msg, icon=Gtk.MessageType.ERROR):
|
|
974
1014
|
# Thread safe
|
|
@@ -987,6 +1027,7 @@ class Trackma_gtk():
|
|
|
987
1027
|
GObject.idle_add(self.status_push, msg)
|
|
988
1028
|
|
|
989
1029
|
def status_push(self, msg):
|
|
1030
|
+
print(msg)
|
|
990
1031
|
self.statusbar.push(0, msg)
|
|
991
1032
|
|
|
992
1033
|
def allow_buttons(self, boolean):
|
|
@@ -1017,6 +1058,7 @@ class Trackma_gtk():
|
|
|
1017
1058
|
self.mb_alt_title.set_sensitive(boolean)
|
|
1018
1059
|
self.mb_info.set_sensitive(boolean)
|
|
1019
1060
|
self.mb_web.set_sensitive(boolean)
|
|
1061
|
+
self.mb_folder.set_sensitive(boolean)
|
|
1020
1062
|
|
|
1021
1063
|
def __do_copytoclip(self, widget):
|
|
1022
1064
|
# Copy selected show title to clipboard
|
|
@@ -1056,6 +1098,23 @@ class Trackma_gtk():
|
|
|
1056
1098
|
|
|
1057
1099
|
dialog.destroy()
|
|
1058
1100
|
|
|
1101
|
+
def do_containingFolder(self, widget):
|
|
1102
|
+
|
|
1103
|
+
#get needed show info
|
|
1104
|
+
show = self.engine.get_show_info(self.selected_show)
|
|
1105
|
+
try:
|
|
1106
|
+
filename = self.engine.get_episode_path(show, 1)
|
|
1107
|
+
with open(os.devnull, 'wb') as DEVNULL:
|
|
1108
|
+
subprocess.Popen(["/usr/bin/xdg-open",
|
|
1109
|
+
os.path.dirname(filename)], stdout=DEVNULL, stderr=DEVNULL)
|
|
1110
|
+
except OSError:
|
|
1111
|
+
# xdg-open failed.
|
|
1112
|
+
raise utils.EngineError("Could not open folder.")
|
|
1113
|
+
|
|
1114
|
+
except utils.EngineError:
|
|
1115
|
+
# Show not in library.
|
|
1116
|
+
self.error("No folder found.")
|
|
1117
|
+
|
|
1059
1118
|
def altname_response(self, entry, dialog, response):
|
|
1060
1119
|
dialog.response(response)
|
|
1061
1120
|
|
|
@@ -1064,6 +1123,19 @@ class Trackma_gtk():
|
|
|
1064
1123
|
if show['url']:
|
|
1065
1124
|
Gtk.show_uri(None, show['url'], Gdk.CURRENT_TIME)
|
|
1066
1125
|
|
|
1126
|
+
def _build_episode_menu(self, show):
|
|
1127
|
+
total = show['total'] or utils.estimate_aired_episodes(show) or 0
|
|
1128
|
+
|
|
1129
|
+
menu_eps = Gtk.Menu()
|
|
1130
|
+
for i in range(1, total + 1):
|
|
1131
|
+
mb_playep = Gtk.CheckMenuItem(str(i))
|
|
1132
|
+
if i <= show['my_progress']:
|
|
1133
|
+
mb_playep.set_active(True)
|
|
1134
|
+
mb_playep.connect("activate", self.__do_play, False, i)
|
|
1135
|
+
menu_eps.append(mb_playep)
|
|
1136
|
+
|
|
1137
|
+
return menu_eps
|
|
1138
|
+
|
|
1067
1139
|
def showview_context_menu(self, treeview, event):
|
|
1068
1140
|
if event.button == 3:
|
|
1069
1141
|
x = int(event.x)
|
|
@@ -1076,12 +1148,14 @@ class Trackma_gtk():
|
|
|
1076
1148
|
show = self.engine.get_show_info(self.selected_show)
|
|
1077
1149
|
|
|
1078
1150
|
menu = Gtk.Menu()
|
|
1079
|
-
mb_play = Gtk.ImageMenuItem('Play', Gtk.Image.new_from_icon_name(Gtk.STOCK_MEDIA_PLAY, 0))
|
|
1151
|
+
mb_play = Gtk.ImageMenuItem('Play Next', Gtk.Image.new_from_icon_name(Gtk.STOCK_MEDIA_PLAY, 0))
|
|
1080
1152
|
mb_play.connect("activate", self.__do_play, True)
|
|
1081
1153
|
mb_info = Gtk.MenuItem("Show details...")
|
|
1082
1154
|
mb_info.connect("activate", self.__do_info)
|
|
1083
1155
|
mb_web = Gtk.MenuItem("Open web site")
|
|
1084
1156
|
mb_web.connect("activate", self.__do_web)
|
|
1157
|
+
mb_folder = Gtk.MenuItem("Open containing folder")
|
|
1158
|
+
mb_folder.connect("activate", self.do_containingFolder)
|
|
1085
1159
|
mb_copy = Gtk.MenuItem("Copy title to clipboard")
|
|
1086
1160
|
mb_copy.connect("activate", self.__do_copytoclip)
|
|
1087
1161
|
mb_alt_title = Gtk.MenuItem("Set alternate title...")
|
|
@@ -1091,18 +1165,15 @@ class Trackma_gtk():
|
|
|
1091
1165
|
|
|
1092
1166
|
menu.append(mb_play)
|
|
1093
1167
|
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
menu_eps.append(mb_playep)
|
|
1100
|
-
mb_playep = Gtk.MenuItem("Play episode")
|
|
1101
|
-
mb_playep.set_submenu(menu_eps)
|
|
1102
|
-
menu.append(mb_playep)
|
|
1168
|
+
menu_eps = self._build_episode_menu(show)
|
|
1169
|
+
|
|
1170
|
+
mb_playep = Gtk.MenuItem("Play episode")
|
|
1171
|
+
mb_playep.set_submenu(menu_eps)
|
|
1172
|
+
menu.append(mb_playep)
|
|
1103
1173
|
|
|
1104
1174
|
menu.append(mb_info)
|
|
1105
1175
|
menu.append(mb_web)
|
|
1176
|
+
menu.append(mb_folder)
|
|
1106
1177
|
menu.append(Gtk.SeparatorMenuItem())
|
|
1107
1178
|
menu.append(mb_copy)
|
|
1108
1179
|
menu.append(mb_alt_title)
|
|
@@ -1352,7 +1423,7 @@ class ShowView(Gtk.TreeView):
|
|
|
1352
1423
|
self.store.clear()
|
|
1353
1424
|
|
|
1354
1425
|
def append(self, show, altname=None, eps=None):
|
|
1355
|
-
episodes_str = "
|
|
1426
|
+
episodes_str = "{} / {}".format(show['my_progress'], show['total'] or '?')
|
|
1356
1427
|
if show['total'] and show['my_progress'] <= show['total']:
|
|
1357
1428
|
progress = (float(show['my_progress']) / show['total']) * 100
|
|
1358
1429
|
else:
|
|
@@ -1718,7 +1789,7 @@ class InfoWidget(Gtk.VBox):
|
|
|
1718
1789
|
self.w_image.image_show(imagefile)
|
|
1719
1790
|
else:
|
|
1720
1791
|
self.w_image.pholder_show('Loading...')
|
|
1721
|
-
self.image_thread = ImageTask(self.w_image, show['image'], imagefile)
|
|
1792
|
+
self.image_thread = ImageTask(self.w_image, show['image'], imagefile, (200, 298))
|
|
1722
1793
|
self.image_thread.start()
|
|
1723
1794
|
|
|
1724
1795
|
# Start info loading thread
|
|
@@ -1776,54 +1847,60 @@ class Settings(Gtk.Window):
|
|
|
1776
1847
|
### Play Next ###
|
|
1777
1848
|
lbl_player = Gtk.Label('Media Player')
|
|
1778
1849
|
lbl_player.set_size_request(120, -1)
|
|
1850
|
+
lbl_player.set_xalign(0)
|
|
1779
1851
|
self.txt_player = Gtk.Entry()
|
|
1780
1852
|
self.txt_player.set_max_length(4096)
|
|
1781
1853
|
playerbrowse_button = Gtk.Button('Browse...')
|
|
1782
1854
|
playerbrowse_button.connect("clicked", self.__do_browse, 'Select player', self.txt_player)
|
|
1783
1855
|
|
|
1784
1856
|
header0 = Gtk.Label()
|
|
1785
|
-
header0.set_text('<
|
|
1857
|
+
header0.set_text('<b>Play Next</b>')
|
|
1786
1858
|
header0.set_use_markup(True)
|
|
1859
|
+
header0.set_xalign(0)
|
|
1787
1860
|
|
|
1788
1861
|
line0 = Gtk.HBox(False, 5)
|
|
1789
|
-
line0.pack_start(lbl_player, False, False,
|
|
1790
|
-
line0.pack_start(self.txt_player,
|
|
1862
|
+
line0.pack_start(lbl_player, False, False, 5)
|
|
1863
|
+
line0.pack_start(self.txt_player, True, True, 0)
|
|
1791
1864
|
line0.pack_start(playerbrowse_button, False, False, 0)
|
|
1792
|
-
|
|
1865
|
+
|
|
1793
1866
|
### Tracker ###
|
|
1794
1867
|
|
|
1795
1868
|
# Labels
|
|
1796
1869
|
lbl_process = Gtk.Label('Process Name')
|
|
1797
1870
|
lbl_process.set_size_request(120, -1)
|
|
1871
|
+
lbl_process.set_xalign(0)
|
|
1798
1872
|
lbl_searchdir = Gtk.Label('Library Directory')
|
|
1799
1873
|
lbl_searchdir.set_size_request(120, -1)
|
|
1874
|
+
lbl_searchdir.set_xalign(0)
|
|
1875
|
+
lbl_library_options = Gtk.Label('Library options')
|
|
1876
|
+
lbl_library_options.set_size_request(120, -1)
|
|
1877
|
+
lbl_library_options.set_xalign(0)
|
|
1878
|
+
|
|
1800
1879
|
lbl_tracker_enabled = Gtk.Label('Enable Tracker')
|
|
1801
1880
|
lbl_tracker_enabled.set_size_request(120, -1)
|
|
1802
|
-
|
|
1803
|
-
lbl_tracker_plex_host_port.set_size_request(120, -1)
|
|
1881
|
+
lbl_tracker_enabled.set_xalign(0)
|
|
1804
1882
|
lbl_tracker_update_wait = Gtk.Label('Wait before update')
|
|
1805
1883
|
lbl_tracker_update_wait.set_size_request(120, -1)
|
|
1884
|
+
lbl_tracker_update_wait.set_xalign(0)
|
|
1806
1885
|
lbl_tracker_update_options = Gtk.Label('Update options')
|
|
1807
1886
|
lbl_tracker_update_options.set_size_request(120, -1)
|
|
1887
|
+
lbl_tracker_update_options.set_xalign(0)
|
|
1808
1888
|
|
|
1809
1889
|
# Entries
|
|
1810
1890
|
self.txt_process = Gtk.Entry()
|
|
1811
1891
|
self.txt_process.set_max_length(4096)
|
|
1812
1892
|
self.txt_searchdir = Gtk.Entry()
|
|
1813
1893
|
self.txt_searchdir.set_max_length(4096)
|
|
1894
|
+
self.chk_library_autoscan = Gtk.CheckButton('Auto-scan at start')
|
|
1814
1895
|
self.browse_button = Gtk.Button('Browse...')
|
|
1815
1896
|
self.browse_button.connect("clicked", self.__do_browse, 'Select search directory', self.txt_searchdir, True)
|
|
1816
1897
|
self.chk_tracker_enabled = Gtk.CheckButton()
|
|
1817
|
-
self.txt_plex_host = Gtk.Entry()
|
|
1818
|
-
self.txt_plex_host.set_max_length(4096)
|
|
1819
|
-
self.txt_plex_port = Gtk.Entry()
|
|
1820
|
-
self.txt_plex_port.set_max_length(5)
|
|
1821
|
-
self.txt_plex_port.set_width_chars(5)
|
|
1822
1898
|
self.chk_tracker_enabled.connect("toggled", self.tracker_type_sensitive)
|
|
1823
1899
|
self.spin_tracker_update_wait = Gtk.SpinButton()
|
|
1824
1900
|
self.spin_tracker_update_wait.set_adjustment(Gtk.Adjustment(value=5, lower=0, upper=500, step_incr=1, page_incr=10))
|
|
1825
1901
|
self.chk_tracker_update_close = Gtk.CheckButton('Wait for the player to close')
|
|
1826
1902
|
self.chk_tracker_update_prompt = Gtk.CheckButton('Ask before updating')
|
|
1903
|
+
self.chk_tracker_not_found_prompt = Gtk.CheckButton('Ask to add if not in list')
|
|
1827
1904
|
|
|
1828
1905
|
# Radio buttons
|
|
1829
1906
|
self.rbtn_tracker_local = Gtk.RadioButton.new_with_label_from_widget(None, 'Local')
|
|
@@ -1844,43 +1921,90 @@ class Settings(Gtk.Window):
|
|
|
1844
1921
|
|
|
1845
1922
|
# HBoxes
|
|
1846
1923
|
header1 = Gtk.Label()
|
|
1847
|
-
header1.set_text('<
|
|
1924
|
+
header1.set_text('<b>Tracker Options</b>')
|
|
1848
1925
|
header1.set_use_markup(True)
|
|
1926
|
+
header1.set_xalign(0)
|
|
1849
1927
|
|
|
1850
1928
|
line1 = Gtk.HBox(False, 5)
|
|
1851
|
-
line1.pack_start(lbl_searchdir, False, False,
|
|
1929
|
+
line1.pack_start(lbl_searchdir, False, False, 5)
|
|
1852
1930
|
line1.pack_start(self.txt_searchdir, True, True, 0)
|
|
1853
1931
|
line1.pack_start(self.browse_button, False, False, 0)
|
|
1854
1932
|
|
|
1855
1933
|
line2 = Gtk.HBox(False, 5)
|
|
1856
|
-
line2.pack_start(lbl_process, False, False,
|
|
1934
|
+
line2.pack_start(lbl_process, False, False, 5)
|
|
1857
1935
|
line2.pack_start(self.txt_process, True, True, 0)
|
|
1858
1936
|
|
|
1859
|
-
line7 = Gtk.HBox(False, 5)
|
|
1860
|
-
line7.pack_start(lbl_tracker_plex_host_port, False, False, 0)
|
|
1861
|
-
line7.pack_start(self.txt_plex_host, True, True, 0)
|
|
1862
|
-
line7.pack_start(self.txt_plex_port, True, True, 0)
|
|
1863
|
-
|
|
1864
1937
|
line3 = Gtk.HBox(False, 5)
|
|
1865
|
-
line3.pack_start(lbl_tracker_enabled, False, False,
|
|
1938
|
+
line3.pack_start(lbl_tracker_enabled, False, False, 5)
|
|
1866
1939
|
line3.pack_start(self.chk_tracker_enabled, False, False, 0)
|
|
1867
1940
|
line3.pack_start(self.rbtn_tracker_local, False, False, 0)
|
|
1868
1941
|
line3.pack_start(self.rbtn_tracker_plex, False, False, 0)
|
|
1869
1942
|
|
|
1943
|
+
lin_library_options = Gtk.HBox(False, 5)
|
|
1944
|
+
lin_library_options.pack_start(lbl_library_options, False, False, 5)
|
|
1945
|
+
lin_library_options.pack_start(self.chk_library_autoscan, False, False, 0)
|
|
1946
|
+
|
|
1870
1947
|
line8 = Gtk.HBox(False, 5)
|
|
1871
|
-
line8.pack_start(lbl_tracker_update_wait, False, False,
|
|
1948
|
+
line8.pack_start(lbl_tracker_update_wait, False, False, 5)
|
|
1872
1949
|
line8.pack_start(self.spin_tracker_update_wait, False, False, 0)
|
|
1873
1950
|
line8.pack_start(Gtk.Label('seconds'), False, False, 0)
|
|
1874
1951
|
|
|
1875
1952
|
line9 = Gtk.HBox(False, 5)
|
|
1876
|
-
line9.pack_start(lbl_tracker_update_options, False, False,
|
|
1877
|
-
|
|
1878
|
-
|
|
1953
|
+
line9.pack_start(lbl_tracker_update_options, False, False, 5)
|
|
1954
|
+
line9a = Gtk.VBox(False, 0)
|
|
1955
|
+
line9a.pack_start(self.chk_tracker_update_close, False, False, 0)
|
|
1956
|
+
line9a.pack_start(self.chk_tracker_update_prompt, False, False, 0)
|
|
1957
|
+
line9a.pack_start(self.chk_tracker_not_found_prompt, False, False, 0)
|
|
1958
|
+
line9.pack_start(line9a, False, False, 0)
|
|
1959
|
+
|
|
1960
|
+
### Plex ###
|
|
1961
|
+
header6 = Gtk.Label()
|
|
1962
|
+
header6.set_text('<b>Plex Media Server</b>')
|
|
1963
|
+
header6.set_use_markup(True)
|
|
1964
|
+
header6.set_xalign(0)
|
|
1965
|
+
|
|
1966
|
+
# Labels
|
|
1967
|
+
lbl_tracker_plex_host_port = Gtk.Label('Host and Port')
|
|
1968
|
+
lbl_tracker_plex_host_port.set_size_request(120, -1)
|
|
1969
|
+
lbl_tracker_plex_host_port.set_xalign(0)
|
|
1970
|
+
lbl_tracker_plex_obey_wait = Gtk.Label('Use "wait before update" time')
|
|
1971
|
+
lbl_tracker_plex_obey_wait.set_size_request(120, -1)
|
|
1972
|
+
lbl_tracker_plex_obey_wait.set_xalign(0)
|
|
1973
|
+
lbl_tracker_plex_login = Gtk.Label('myPlex login (claimed server)')
|
|
1974
|
+
lbl_tracker_plex_login.set_size_request(120, -1)
|
|
1975
|
+
lbl_tracker_plex_login.set_xalign(0)
|
|
1976
|
+
|
|
1977
|
+
# Entries
|
|
1978
|
+
self.txt_plex_host = Gtk.Entry()
|
|
1979
|
+
self.txt_plex_host.set_max_length(4096)
|
|
1980
|
+
self.txt_plex_port = Gtk.Entry()
|
|
1981
|
+
self.txt_plex_port.set_max_length(5)
|
|
1982
|
+
self.txt_plex_port.set_width_chars(5)
|
|
1983
|
+
self.txt_plex_user = Gtk.Entry()
|
|
1984
|
+
self.txt_plex_user.set_max_length(4096)
|
|
1985
|
+
self.txt_plex_passw = Gtk.Entry()
|
|
1986
|
+
self.txt_plex_passw.set_max_length(128)
|
|
1987
|
+
self.txt_plex_passw.set_visibility(False)
|
|
1988
|
+
self.chk_tracker_plex_obey_wait = Gtk.CheckButton()
|
|
1989
|
+
|
|
1990
|
+
# HBoxes
|
|
1991
|
+
line7 = Gtk.HBox(False, 5)
|
|
1992
|
+
line7.pack_start(lbl_tracker_plex_host_port, False, False, 5)
|
|
1993
|
+
line7.pack_start(self.txt_plex_host, True, True, 0)
|
|
1994
|
+
line7.pack_start(self.txt_plex_port, True, True, 0)
|
|
1995
|
+
line10 = Gtk.HBox(False, 5)
|
|
1996
|
+
line10.pack_start(lbl_tracker_plex_obey_wait, False, False, 5)
|
|
1997
|
+
line10.pack_start(self.chk_tracker_plex_obey_wait, False, False, 0)
|
|
1998
|
+
line11 = Gtk.HBox(False, 5)
|
|
1999
|
+
line11.pack_start(lbl_tracker_plex_login, False, False, 5)
|
|
2000
|
+
line11.pack_start(self.txt_plex_user, True, True, 0)
|
|
2001
|
+
line11.pack_start(self.txt_plex_passw, True, True, 0)
|
|
1879
2002
|
|
|
1880
2003
|
### Auto-retrieve ###
|
|
1881
2004
|
header2 = Gtk.Label()
|
|
1882
|
-
header2.set_text('<
|
|
2005
|
+
header2.set_text('<b>Auto-retrieve</b>')
|
|
1883
2006
|
header2.set_use_markup(True)
|
|
2007
|
+
header2.set_xalign(0)
|
|
1884
2008
|
|
|
1885
2009
|
# Radio buttons
|
|
1886
2010
|
self.rbtn_autoret_off = Gtk.RadioButton.new_with_label_from_widget(None, 'Disabled')
|
|
@@ -1904,24 +2028,25 @@ class Settings(Gtk.Window):
|
|
|
1904
2028
|
|
|
1905
2029
|
### Auto-send ###
|
|
1906
2030
|
header3 = Gtk.Label()
|
|
1907
|
-
header3.set_text('<
|
|
2031
|
+
header3.set_text('<b>Auto-send</b>')
|
|
1908
2032
|
header3.set_use_markup(True)
|
|
2033
|
+
header3.set_xalign(0)
|
|
1909
2034
|
|
|
1910
2035
|
# Radio buttons
|
|
1911
2036
|
self.rbtn_autosend_off = Gtk.RadioButton.new_with_label_from_widget(None, 'Disabled')
|
|
1912
2037
|
self.rbtn_autosend_always = Gtk.RadioButton.new_with_label_from_widget(self.rbtn_autosend_off, 'After every change')
|
|
1913
2038
|
self.rbtn_autosend_at_exit = Gtk.CheckButton('Auto-send at exit')
|
|
1914
2039
|
|
|
1915
|
-
self.
|
|
1916
|
-
self.
|
|
1917
|
-
self.
|
|
1918
|
-
self.
|
|
1919
|
-
self.
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
2040
|
+
self.rbtn_autosend_minutes = Gtk.RadioButton.new_with_label_from_widget(self.rbtn_autosend_off, 'After')
|
|
2041
|
+
self.spin_autosend_minutes = Gtk.SpinButton()
|
|
2042
|
+
self.spin_autosend_minutes.set_adjustment(Gtk.Adjustment(value=60, lower=1, upper=1000, step_incr=1, page_incr=10))
|
|
2043
|
+
self.spin_autosend_minutes.set_sensitive(False)
|
|
2044
|
+
self.rbtn_autosend_minutes.connect("toggled", self.radio_toggled, self.spin_autosend_minutes)
|
|
2045
|
+
lbl_autosend_minutes = Gtk.Label('minutes')
|
|
2046
|
+
line_autosend_minutes = Gtk.HBox(False, 5)
|
|
2047
|
+
line_autosend_minutes.pack_start(self.rbtn_autosend_minutes, False, False, 0)
|
|
2048
|
+
line_autosend_minutes.pack_start(self.spin_autosend_minutes, False, False, 0)
|
|
2049
|
+
line_autosend_minutes.pack_start(lbl_autosend_minutes, False, False, 0)
|
|
1925
2050
|
|
|
1926
2051
|
self.rbtn_autosend_size = Gtk.RadioButton.new_with_label_from_widget(self.rbtn_autosend_off, 'After the queue is larger than')
|
|
1927
2052
|
self.spin_autosend_size = Gtk.SpinButton()
|
|
@@ -1937,29 +2062,33 @@ class Settings(Gtk.Window):
|
|
|
1937
2062
|
line5 = Gtk.VBox(False, 5)
|
|
1938
2063
|
line5.pack_start(self.rbtn_autosend_off, False, False, 0)
|
|
1939
2064
|
line5.pack_start(self.rbtn_autosend_always, False, False, 0)
|
|
1940
|
-
line5.pack_start(
|
|
2065
|
+
line5.pack_start(line_autosend_minutes, False, False, 0)
|
|
1941
2066
|
line5.pack_start(line_autosend_size, False, False, 0)
|
|
1942
2067
|
line5.pack_start(self.rbtn_autosend_at_exit, False, False, 0)
|
|
1943
2068
|
|
|
1944
2069
|
### Additional options
|
|
1945
2070
|
header_additional = Gtk.Label()
|
|
1946
|
-
header_additional.set_text('<
|
|
2071
|
+
header_additional.set_text('<b>Additional options</b>')
|
|
1947
2072
|
header_additional.set_use_markup(True)
|
|
2073
|
+
header_additional.set_xalign(0)
|
|
1948
2074
|
|
|
1949
2075
|
self.chk_auto_status_change = Gtk.CheckButton('Change status automatically')
|
|
1950
2076
|
self.chk_auto_status_change_if_scored = Gtk.CheckButton('Change status automatically only if scored')
|
|
1951
2077
|
self.chk_auto_status_change_if_scored.set_sensitive(False)
|
|
1952
2078
|
self.chk_auto_status_change.connect("toggled", self.radio_toggled, self.chk_auto_status_change_if_scored)
|
|
1953
2079
|
self.chk_auto_date_change = Gtk.CheckButton('Change start and finish dates automatically')
|
|
2080
|
+
line_auto_status_change_if_scored = Gtk.HBox(False, 5)
|
|
2081
|
+
line_auto_status_change_if_scored.pack_start(self.chk_auto_status_change_if_scored, False, False, 20)
|
|
1954
2082
|
line_additional = Gtk.VBox(False, 5)
|
|
1955
2083
|
line_additional.pack_start(self.chk_auto_status_change, False, False, 0)
|
|
1956
|
-
line_additional.pack_start(
|
|
2084
|
+
line_additional.pack_start(line_auto_status_change_if_scored, False, False, 0)
|
|
1957
2085
|
line_additional.pack_start(self.chk_auto_date_change, False, False, 0)
|
|
1958
2086
|
|
|
1959
2087
|
### GTK Interface ###
|
|
1960
2088
|
header4 = Gtk.Label()
|
|
1961
|
-
header4.set_text('<
|
|
2089
|
+
header4.set_text('<b>GTK Interface</b>')
|
|
1962
2090
|
header4.set_use_markup(True)
|
|
2091
|
+
header4.set_xalign(0)
|
|
1963
2092
|
|
|
1964
2093
|
self.chk_show_tray = Gtk.CheckButton('Show Tray Icon')
|
|
1965
2094
|
self.chk_close_to_tray = Gtk.CheckButton('Close to Tray')
|
|
@@ -1973,18 +2102,27 @@ class Settings(Gtk.Window):
|
|
|
1973
2102
|
self.chk_show_tray.connect("toggled", self.radio_toggled, self.chk_close_to_tray)
|
|
1974
2103
|
self.chk_show_tray.connect("toggled", self.radio_toggled, self.chk_start_in_tray)
|
|
1975
2104
|
self.chk_show_tray.connect("toggled", self.radio_toggled, self.chk_tray_api_icon)
|
|
2105
|
+
|
|
2106
|
+
line_close_to_tray = Gtk.HBox(False, 5)
|
|
2107
|
+
line_close_to_tray.pack_start(self.chk_close_to_tray, False, False, 20)
|
|
2108
|
+
line_start_in_tray = Gtk.HBox(False, 5)
|
|
2109
|
+
line_start_in_tray.pack_start(self.chk_start_in_tray, False, False, 20)
|
|
2110
|
+
line_tray_api_icon = Gtk.HBox(False, 5)
|
|
2111
|
+
line_tray_api_icon.pack_start(self.chk_tray_api_icon, False, False, 20)
|
|
2112
|
+
|
|
1976
2113
|
line6 = Gtk.VBox(False, 5)
|
|
1977
2114
|
line6.pack_start(self.chk_show_tray, False, False, 0)
|
|
1978
|
-
line6.pack_start(
|
|
1979
|
-
line6.pack_start(
|
|
1980
|
-
line6.pack_start(
|
|
2115
|
+
line6.pack_start(line_close_to_tray, False, False, 0)
|
|
2116
|
+
line6.pack_start(line_start_in_tray, False, False, 0)
|
|
2117
|
+
line6.pack_start(line_tray_api_icon, False, False, 0)
|
|
1981
2118
|
line6.pack_start(self.chk_remember_geometry, False, False, 0)
|
|
1982
2119
|
line6.pack_start(self.chk_classic_progress, False, False, 0)
|
|
1983
2120
|
|
|
1984
2121
|
### Colors ###
|
|
1985
2122
|
header5 = Gtk.Label()
|
|
1986
|
-
header5.set_text('<
|
|
2123
|
+
header5.set_text('<b>Color Scheme</b>')
|
|
1987
2124
|
header5.set_use_markup(True)
|
|
2125
|
+
header5.set_xalign(0)
|
|
1988
2126
|
self.colors = {}
|
|
1989
2127
|
pages = [('rows', 'Row text'),
|
|
1990
2128
|
('progress','Progress widget')]
|
|
@@ -2003,11 +2141,12 @@ class Settings(Gtk.Window):
|
|
|
2003
2141
|
|
|
2004
2142
|
col_notebook = Gtk.Notebook()
|
|
2005
2143
|
for (key,tab_title) in pages:
|
|
2006
|
-
rows = Gtk.VBox(False,
|
|
2144
|
+
rows = Gtk.VBox(False, 5)
|
|
2145
|
+
rows.set_border_width(10)
|
|
2007
2146
|
rows_lines = []
|
|
2008
2147
|
for (c_key,text) in self.colors[key]: # Generate widgets for each color
|
|
2009
2148
|
line = Gtk.HBox(False, 5)
|
|
2010
|
-
label = Gtk.Label(text)
|
|
2149
|
+
label = Gtk.Label(text, xalign=0)
|
|
2011
2150
|
picker = Gtk.ColorButton.new_with_color(getColor(self.config['colors'][c_key]))
|
|
2012
2151
|
self.col_pickers[c_key] = picker
|
|
2013
2152
|
line.pack_start(label, True, True, 0)
|
|
@@ -2022,19 +2161,23 @@ class Settings(Gtk.Window):
|
|
|
2022
2161
|
notebook = Gtk.Notebook()
|
|
2023
2162
|
|
|
2024
2163
|
page0 = Gtk.VBox(False, 10)
|
|
2025
|
-
page0.set_border_width(
|
|
2164
|
+
page0.set_border_width(10)
|
|
2026
2165
|
page0.pack_start(header0, False, False, 0)
|
|
2027
2166
|
page0.pack_start(line0, False, False, 0)
|
|
2028
2167
|
page0.pack_start(header1, False, False, 0)
|
|
2029
2168
|
page0.pack_start(line3, False, False, 0)
|
|
2030
2169
|
page0.pack_start(line1, False, False, 0)
|
|
2170
|
+
page0.pack_start(lin_library_options, False, False, 0)
|
|
2031
2171
|
page0.pack_start(line2, False, False, 0)
|
|
2032
|
-
page0.pack_start(line7, False, False, 0)
|
|
2033
2172
|
page0.pack_start(line8, False, False, 0)
|
|
2034
2173
|
page0.pack_start(line9, False, False, 0)
|
|
2174
|
+
page0.pack_start(header6, False, False, 0)
|
|
2175
|
+
page0.pack_start(line7, False, False, 0)
|
|
2176
|
+
page0.pack_start(line10, False, False, 0)
|
|
2177
|
+
page0.pack_start(line11, False, False, 0)
|
|
2035
2178
|
|
|
2036
2179
|
page1 = Gtk.VBox(False, 10)
|
|
2037
|
-
page1.set_border_width(
|
|
2180
|
+
page1.set_border_width(10)
|
|
2038
2181
|
page1.pack_start(header2, False, False, 0)
|
|
2039
2182
|
page1.pack_start(line4, False, False, 0)
|
|
2040
2183
|
page1.pack_start(header3, False, False, 0)
|
|
@@ -2043,7 +2186,7 @@ class Settings(Gtk.Window):
|
|
|
2043
2186
|
page1.pack_start(line_additional, False, False, 0)
|
|
2044
2187
|
|
|
2045
2188
|
page2 = Gtk.VBox(False, 10)
|
|
2046
|
-
page2.set_border_width(
|
|
2189
|
+
page2.set_border_width(10)
|
|
2047
2190
|
page2.pack_start(header4, False, False, 0)
|
|
2048
2191
|
page2.pack_start(line6, False, False, 0)
|
|
2049
2192
|
page2.pack_start(header5, False, False, 0)
|
|
@@ -2063,18 +2206,24 @@ class Settings(Gtk.Window):
|
|
|
2063
2206
|
self.txt_player.set_text(self.engine.get_config('player'))
|
|
2064
2207
|
self.txt_process.set_text(self.engine.get_config('tracker_process'))
|
|
2065
2208
|
self.txt_searchdir.set_text(self.engine.get_config('searchdir'))
|
|
2209
|
+
self.chk_library_autoscan.set_active(self.engine.get_config('library_autoscan'))
|
|
2066
2210
|
self.txt_plex_host.set_text(self.engine.get_config('plex_host'))
|
|
2067
2211
|
self.txt_plex_port.set_text(self.engine.get_config('plex_port'))
|
|
2212
|
+
self.chk_tracker_plex_obey_wait.set_active(self.engine.get_config('plex_obey_update_wait_s'))
|
|
2213
|
+
self.txt_plex_user.set_text(self.engine.get_config('plex_user'))
|
|
2214
|
+
self.txt_plex_passw.set_text(self.engine.get_config('plex_passwd'))
|
|
2068
2215
|
self.chk_tracker_enabled.set_active(self.engine.get_config('tracker_enabled'))
|
|
2069
2216
|
self.rbtn_autosend_at_exit.set_active(self.engine.get_config('autosend_at_exit'))
|
|
2070
2217
|
self.spin_tracker_update_wait.set_value(self.engine.get_config('tracker_update_wait_s'))
|
|
2071
2218
|
self.chk_tracker_update_close.set_active(self.engine.get_config('tracker_update_close'))
|
|
2072
2219
|
self.chk_tracker_update_prompt.set_active(self.engine.get_config('tracker_update_prompt'))
|
|
2220
|
+
self.chk_tracker_not_found_prompt.set_active(self.engine.get_config('tracker_not_found_prompt'))
|
|
2073
2221
|
|
|
2074
2222
|
if self.engine.get_config('tracker_type') == 'local':
|
|
2075
2223
|
self.rbtn_tracker_local.set_active(True)
|
|
2076
2224
|
self.txt_plex_host.set_sensitive(False)
|
|
2077
2225
|
self.txt_plex_port.set_sensitive(False)
|
|
2226
|
+
self.chk_tracker_plex_obey_wait.set_sensitive(False)
|
|
2078
2227
|
elif self.engine.get_config('tracker_type') == 'plex':
|
|
2079
2228
|
self.rbtn_tracker_plex.set_active(True)
|
|
2080
2229
|
self.txt_process.set_sensitive(False)
|
|
@@ -2086,13 +2235,13 @@ class Settings(Gtk.Window):
|
|
|
2086
2235
|
|
|
2087
2236
|
if self.engine.get_config('autosend') == 'always':
|
|
2088
2237
|
self.rbtn_autosend_always.set_active(True)
|
|
2089
|
-
elif self.engine.get_config('autosend')
|
|
2090
|
-
self.
|
|
2238
|
+
elif self.engine.get_config('autosend') in ('minutes', 'hours'):
|
|
2239
|
+
self.rbtn_autosend_minutes.set_active(True)
|
|
2091
2240
|
elif self.engine.get_config('autosend') == 'size':
|
|
2092
2241
|
self.rbtn_autosend_size.set_active(True)
|
|
2093
2242
|
|
|
2094
2243
|
self.spin_autoret_days.set_value(self.engine.get_config('autoretrieve_days'))
|
|
2095
|
-
self.
|
|
2244
|
+
self.spin_autosend_minutes.set_value(self.engine.get_config('autosend_minutes'))
|
|
2096
2245
|
self.spin_autosend_size.set_value(self.engine.get_config('autosend_size'))
|
|
2097
2246
|
|
|
2098
2247
|
self.chk_auto_status_change.set_active(self.engine.get_config('auto_status_change'))
|
|
@@ -2112,13 +2261,18 @@ class Settings(Gtk.Window):
|
|
|
2112
2261
|
self.engine.set_config('player', self.txt_player.get_text())
|
|
2113
2262
|
self.engine.set_config('tracker_process', self.txt_process.get_text())
|
|
2114
2263
|
self.engine.set_config('searchdir', self.txt_searchdir.get_text())
|
|
2264
|
+
self.engine.set_config('library_autoscan', self.chk_library_autoscan.get_active())
|
|
2115
2265
|
self.engine.set_config('plex_host', self.txt_plex_host.get_text())
|
|
2116
2266
|
self.engine.set_config('plex_port', self.txt_plex_port.get_text())
|
|
2267
|
+
self.engine.set_config('plex_obey_update_wait_s', self.chk_tracker_plex_obey_wait.get_active())
|
|
2268
|
+
self.engine.set_config('plex_user', self.txt_plex_user.get_text())
|
|
2269
|
+
self.engine.set_config('plex_passwd', self.txt_plex_passw.get_text())
|
|
2117
2270
|
self.engine.set_config('tracker_enabled', self.chk_tracker_enabled.get_active())
|
|
2118
2271
|
self.engine.set_config('autosend_at_exit', self.rbtn_autosend_at_exit.get_active())
|
|
2119
2272
|
self.engine.set_config('tracker_update_wait_s', self.spin_tracker_update_wait.get_value())
|
|
2120
2273
|
self.engine.set_config('tracker_update_close', self.chk_tracker_update_close.get_active())
|
|
2121
2274
|
self.engine.set_config('tracker_update_prompt', self.chk_tracker_update_prompt.get_active())
|
|
2275
|
+
self.engine.set_config('tracker_not_found_prompt', self.chk_tracker_not_found_prompt.get_active())
|
|
2122
2276
|
|
|
2123
2277
|
# Tracker type
|
|
2124
2278
|
if self.rbtn_tracker_local.get_active():
|
|
@@ -2137,15 +2291,15 @@ class Settings(Gtk.Window):
|
|
|
2137
2291
|
# Auto-send
|
|
2138
2292
|
if self.rbtn_autosend_always.get_active():
|
|
2139
2293
|
self.engine.set_config('autosend', 'always')
|
|
2140
|
-
elif self.
|
|
2141
|
-
self.engine.set_config('autosend', '
|
|
2294
|
+
elif self.rbtn_autosend_minutes.get_active():
|
|
2295
|
+
self.engine.set_config('autosend', 'minutes')
|
|
2142
2296
|
elif self.rbtn_autosend_size.get_active():
|
|
2143
2297
|
self.engine.set_config('autosend', 'size')
|
|
2144
2298
|
else:
|
|
2145
2299
|
self.engine.set_config('autosend', 'off')
|
|
2146
2300
|
|
|
2147
2301
|
self.engine.set_config('autoretrieve_days', self.spin_autoret_days.get_value_as_int())
|
|
2148
|
-
self.engine.set_config('
|
|
2302
|
+
self.engine.set_config('autosend_minutes', self.spin_autosend_minutes.get_value_as_int())
|
|
2149
2303
|
self.engine.set_config('autosend_size', self.spin_autosend_size.get_value_as_int())
|
|
2150
2304
|
|
|
2151
2305
|
self.engine.set_config('auto_status_change', self.chk_auto_status_change.get_active())
|
|
@@ -2182,9 +2336,11 @@ class Settings(Gtk.Window):
|
|
|
2182
2336
|
self.txt_process.set_sensitive(True)
|
|
2183
2337
|
self.txt_plex_host.set_sensitive(False)
|
|
2184
2338
|
self.txt_plex_port.set_sensitive(False)
|
|
2339
|
+
self.chk_tracker_plex_obey_wait.set_sensitive(False)
|
|
2185
2340
|
elif self.rbtn_tracker_plex.get_active():
|
|
2186
2341
|
self.txt_plex_host.set_sensitive(True)
|
|
2187
2342
|
self.txt_plex_port.set_sensitive(True)
|
|
2343
|
+
self.chk_tracker_plex_obey_wait.set_sensitive(True)
|
|
2188
2344
|
self.txt_process.set_sensitive(False)
|
|
2189
2345
|
self.spin_tracker_update_wait.set_sensitive(True)
|
|
2190
2346
|
else:
|
|
@@ -2192,6 +2348,7 @@ class Settings(Gtk.Window):
|
|
|
2192
2348
|
self.spin_tracker_update_wait.set_sensitive(False)
|
|
2193
2349
|
self.txt_plex_host.set_sensitive(False)
|
|
2194
2350
|
self.txt_plex_port.set_sensitive(False)
|
|
2351
|
+
self.chk_tracker_plex_obey_wait.set_sensitive(False)
|
|
2195
2352
|
|
|
2196
2353
|
def __do_browse(self, widget, title, entry, dironly=False):
|
|
2197
2354
|
browsew = Gtk.FileChooserDialog(title,
|
|
@@ -2235,9 +2392,11 @@ class AccountSelectAdd(Gtk.Window):
|
|
|
2235
2392
|
# Entries
|
|
2236
2393
|
self.txt_user = Gtk.Entry()
|
|
2237
2394
|
self.txt_user.set_max_length(128)
|
|
2395
|
+
self.txt_user.set_activates_default(True)
|
|
2238
2396
|
self.txt_passwd = Gtk.Entry()
|
|
2239
2397
|
self.txt_passwd.set_max_length(128)
|
|
2240
2398
|
self.txt_passwd.set_visibility(False)
|
|
2399
|
+
self.txt_passwd.set_activates_default(True)
|
|
2241
2400
|
|
|
2242
2401
|
# Combobox
|
|
2243
2402
|
self.model_api = Gtk.ListStore(str, str, GdkPixbuf.Pixbuf)
|
|
@@ -2261,6 +2420,8 @@ class AccountSelectAdd(Gtk.Window):
|
|
|
2261
2420
|
alignment = Gtk.Alignment(xalign=0.5, xscale=0)
|
|
2262
2421
|
bottombar = Gtk.HBox(False, 5)
|
|
2263
2422
|
self.add_button = Gtk.Button(stock=Gtk.STOCK_APPLY)
|
|
2423
|
+
self.add_button.set_can_default(True)
|
|
2424
|
+
self.add_button.grab_default()
|
|
2264
2425
|
close_button = Gtk.Button(stock=Gtk.STOCK_CLOSE)
|
|
2265
2426
|
close_button.connect("clicked", self.__do_close)
|
|
2266
2427
|
bottombar.pack_start(self.add_button, False, False, 0)
|
|
@@ -2630,7 +2791,21 @@ def scale(w, h, x, y, maximum=True):
|
|
|
2630
2791
|
return x, nh or 1
|
|
2631
2792
|
|
|
2632
2793
|
def main():
|
|
2633
|
-
|
|
2794
|
+
debug = False
|
|
2795
|
+
|
|
2796
|
+
print("Trackma-gtk v{}".format(utils.VERSION))
|
|
2797
|
+
|
|
2798
|
+
if '-h' in sys.argv:
|
|
2799
|
+
print("Usage: trackma-qt [options]")
|
|
2800
|
+
print()
|
|
2801
|
+
print('Options:')
|
|
2802
|
+
print(' -d Shows debugging information')
|
|
2803
|
+
print(' -h Shows this help')
|
|
2804
|
+
return
|
|
2805
|
+
if '-d' in sys.argv:
|
|
2806
|
+
debug = True
|
|
2807
|
+
|
|
2808
|
+
app = Trackma_gtk(debug)
|
|
2634
2809
|
try:
|
|
2635
2810
|
Gdk.threads_enter()
|
|
2636
2811
|
app.main()
|