Skip to content

Commit

Permalink
Add label for option alerts
Browse files Browse the repository at this point in the history
Ref #306
  • Loading branch information
algorys committed Apr 26, 2018
1 parent 8b0f9f0 commit f7277fb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
38 changes: 25 additions & 13 deletions alignak_app/qobjects/user/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,31 @@ def get_notifications_widget(self, item_type, options):

line = 1
while current_options:
opt = current_options.pop(0)
# Title
object_name = 'option' + str(selected_options[opt])
self.titles_labels[item_type][opt].setObjectName(object_name)
options_layout.addWidget(self.titles_labels[item_type][opt], line, 0, 1, 1)
# Icon
options_labels[opt].setPixmap(
get_icon_pixmap(selected_options[opt], ['checked', 'error'])
)
options_labels[opt].setFixedSize(14, 14)
options_labels[opt].setScaledContents(True)
options_layout.addWidget(options_labels[opt], line, 1, 1, 1)
line += 1
if line == 2:
alert_lbl = QLabel('Alerts:')
alert_lbl.setObjectName('subtitle')
options_layout.addWidget(alert_lbl, line, 0, 1, 2)
line += 1
else:
# Current option
opt = current_options.pop(0)

# Title
object_name = ''
if opt not in ['n', 's', 'f']:
object_name = 'offset'
object_name += 'option' + str(selected_options[opt])
self.titles_labels[item_type][opt].setObjectName(object_name)
options_layout.addWidget(self.titles_labels[item_type][opt], line, 0, 1, 1)

# Icon
options_labels[opt].setPixmap(
get_icon_pixmap(selected_options[opt], ['checked', 'error'])
)
options_labels[opt].setFixedSize(14, 14)
options_labels[opt].setScaledContents(True)
options_layout.addWidget(options_labels[opt], line, 1, 1, 1)
line += 1

# Login button
accept_btn = QPushButton(_('OK'), self)
Expand Down
10 changes: 10 additions & 0 deletions etc/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ QLabel#optionFalse {
color: #f44336;
}

QLabel#offsetoptionTrue {
color: #4caf50;
margin-left: 20px;
}

QLabel#offsetoptionFalse {
color: #f44336;
margin-left: 20px;
}

QLabel#services_ok, QLabel#hosts_up {
color: #27ae60;
font: 10pt;
Expand Down

0 comments on commit f7277fb

Please sign in to comment.