fix last tab style

master3.3
Denis Spiridonov 12 years ago
parent 6bdad1a170
commit d3970ff9b8

@ -9,7 +9,7 @@ import sudsds, time, sys
from TrayIcon import TrayIcon
from more import show_question, get_sid, get_view_params
from more import get_sid, get_view_params
from MainClass import ApiClient
from calculate.consolegui.datavars import DataVarsGui
from pid_information import client_pid_info
@ -31,7 +31,7 @@ class SelectedMethodWgt(QtGui.QWidget):
self.setWindowIcon(QtGui.QIcon('/usr/share/pixmaps/calculate3.png'))
if self.connect():
return
sys.exit(1)
# definition of screen resolution
prim_screen = app.desktop().primaryScreen()
d_size = app.desktop().screenGeometry(prim_screen).size()
@ -227,8 +227,7 @@ class ToolTabWidget(QtGui.QTabWidget):
self.setMinimumWidth(450)
self.setWindowTitle(self.Name)
self.setStyleSheet(
'''
self.setStyleSheet('''
QTabBar::tab:last {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
@ -237,8 +236,12 @@ class ToolTabWidget(QtGui.QTabWidget):
border-bottom-color: #C2C7CB; border-top-left-radius: 4px;
border-top-right-radius: 4px; padding-left: 3px;
margin-left: 3px; margin-bottom: 5px; margin-top: 2px; width: 18px;
}''')
margin-left: 3px; margin-bottom: 5px; margin-top: 2px; width: 18px;}
QTabBar::tab:last::hover {background:
qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E9E9E9, stop: 0.4 #E5E5E5,
stop: 0.5 #E1E1E1, stop: 1.0 #DDDDDD);}
''')
self.setWindowIcon(QtGui.QIcon('/usr/share/pixmaps/calculate3.png'))
self.show()
@ -314,6 +317,10 @@ class ToolTabWidget(QtGui.QTabWidget):
self.insertTab(self.count() - 1, widget, self.gui_icon , \
self.new_con_txt)
self.setCurrentIndex(self.count() - 2)
if self.currentWidget().ClientObj.client:
self.tabbar.setTabEnabled(self.count() - 1, True)
else:
self.tabbar.setTabEnabled(self.count() - 1, False)
def rename_tab(self, text = None, ind = None):
if not text:

@ -2026,7 +2026,6 @@ class PasswordWgt(QtGui.QWidget):
super(PasswordWgt, self).__init__()
self._parent = parent
self.text = text
self.layout = QtGui.QGridLayout(self)
self.pass_edit = QtGui.QLineEdit(self)
@ -2043,20 +2042,16 @@ class PasswordWgt(QtGui.QWidget):
self.pass_edit.textChanged.connect(self.check_passwd)
self.pass_edit2.textChanged.connect(self.check_passwd)
self.ok_button = QtGui.QPushButton(_('Ok'), self)
self.ok_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return))
self.ok_button.clicked.connect(self.send_password)
self.layout.addWidget(self.ok_button,2,0)
self.cancel_button = QtGui.QPushButton(_('Cancel'), self)
self.cancel_button.setShortcut(QtGui.QKeySequence \
(QtCore.Qt.Key_Escape))
self.cancel_button.clicked.connect(self.close)
self.layout.addWidget(self.cancel_button,2,1)
self.move(QtGui.QCursor.pos())
def send_password(self):

Loading…
Cancel
Save