This commit is contained in:
St.Huang 2018-08-12 23:17:45 +08:00
parent bdc5992e76
commit c93982edfd
6 changed files with 20 additions and 6 deletions

View File

@ -29,7 +29,7 @@ from .setting import SettingDialog
from ..context import config
from ..lang import _, _sl
from ..service import service_manager, service_pool
from ..utils import get_model_byId
from ..utils import get_model_byId, get_icon
from ..constants import Endpoint
@ -48,6 +48,9 @@ class OptionsDialog(Dialog):
]
_signal = pyqtSignal(str)
_NULL_ICON = get_icon('null.png')
_OK_ICON = get_icon('ok.png')
def __init__(self, parent, title=u'Options', model_id = -1):
super(OptionsDialog, self).__init__(parent, title)
self._signal.connect(self._before_build)
@ -238,8 +241,12 @@ class OptionsDialog(Dialog):
self.tab_widget.setTabText(k, _('CONFIG_INDEX') % (k+1))
def changedTab(self, i):
tab = self.tabs[i]
tab.build()
# restore
for k in range(0, len(self.tabs)):
self.tab_widget.setTabIcon(k, self._NULL_ICON)
# add flag
self.tab_widget.setTabIcon(i, self._OK_ICON)
self.tabs[i].build()
def show_models(self):
'''

BIN
addons/fastwq/res/null.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

BIN
addons/fastwq/res/ok.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

View File

@ -29,7 +29,7 @@ from .setting import SettingDialog
from ..context import config
from ..lang import _, _sl
from ..service import service_manager, service_pool
from ..utils import get_model_byId
from ..utils import get_model_byId, get_icon
from ..constants import Endpoint
@ -48,6 +48,9 @@ class OptionsDialog(Dialog):
]
_signal = pyqtSignal(str)
_NULL_ICON = get_icon('null.png')
_OK_ICON = get_icon('ok.png')
def __init__(self, parent, title=u'Options', model_id = -1):
super(OptionsDialog, self).__init__(parent, title)
self._signal.connect(self._before_build)
@ -238,8 +241,12 @@ class OptionsDialog(Dialog):
self.tab_widget.setTabText(k, _('CONFIG_INDEX') % (k+1))
def changedTab(self, i):
tab = self.tabs[i]
tab.build()
# restore
for k in range(0, len(self.tabs)):
self.tab_widget.setTabIcon(k, self._NULL_ICON)
# add flag
self.tab_widget.setTabIcon(i, self._OK_ICON)
self.tabs[i].build()
def show_models(self):
'''

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

BIN
addons21/fastwq/res/ok.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B