Commit e671c9e5 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Small cleanup.

parent 7b63aca2
......@@ -1732,7 +1732,6 @@ WttQt::WttQt(void* wt_parent_ctx, QWidget* wt_parent_wid, const char* wt_name,
char layout_palette[80];
char title_w1[40];
char title_w2[40];
pwr_tFileName fname;
wb_rev_info rev_info;
char version[80];
......@@ -2216,8 +2215,7 @@ WttQt::WttQt(void* wt_parent_ctx, QWidget* wt_parent_wid, const char* wt_name,
vbox1->addWidget(menu_bar);
vbox1->addWidget(tools);
dcli_translate_filename(fname, "$pwr_exe/pwr_logohalf2.png");
QLabel* wb_image = new_image_label(toplevel, fname);
QLabel* wb_image = new_image_label(toplevel, "$pwr_exe/pwr_logohalf2.png");
QHBoxLayout* hbox1 = new QHBoxLayout();
hbox1->addLayout(vbox1);
......
......@@ -589,7 +589,6 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
const int window_width = 400;
const int window_height = 700;
pwr_tStatus sts;
pwr_tFileName fname;
char title[120] = "Xtt ";
char nodename[80];
......@@ -753,8 +752,7 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
vbox1->addWidget(menu_bar);
vbox1->addWidget(tools);
dcli_translate_filename(fname, "$pwr_exe/pwr_logohalf2y.png");
QLabel* xtt_image = new_image_label(toplevel, fname);
QLabel* xtt_image = new_image_label(toplevel, "$pwr_exe/pwr_logohalf2y.png");
QHBoxLayout* hbox1 = new QHBoxLayout();
hbox1->addLayout(vbox1);
......
......@@ -125,9 +125,7 @@ CoLoginQt::CoLoginQt(void* wl_parent_ctx, QWidget* wl_parent_wid,
passwordlabel->setFixedHeight(20);
password->setEchoMode(QLineEdit::Password);
pwr_tFileName fname;
dcli_translate_filename(fname, "$pwr_exe/pwr_logofull.png");
QLabel* image = new_image_label(toplevel, fname);
QLabel* image = new_image_label(toplevel, "$pwr_exe/pwr_logofull.png");
buttons = new QDialogButtonBox();
buttons->addButton(QDialogButtonBox::Ok);
......
......@@ -218,8 +218,10 @@ QFrame* separator(QFrame::Shape shape)
return line;
}
QLabel* new_image_label(QWidget* parent, const char* fname)
QLabel* new_image_label(QWidget* parent, const char* filename)
{
pwr_tFileName fname;
dcli_translate_filename(fname, filename);
QLabel* label = new QLabel(parent);
label->setPixmap(QPixmap(fl(fname)));
return label;
......
......@@ -73,7 +73,7 @@ QComboBox* addToolMenu(QWidget* parent, QToolBar* tools, const char* callback);
QWidget* layout_to_widget(QLayout* layout);
void set_pane_position(QSplitter* pane, int right);
QFrame* separator(QFrame::Shape shape);
QLabel* new_image_label(QWidget* parent, const char* fname);
QLabel* new_image_label(QWidget* parent, const char* filename);
void fixed_put(QWidget* parent, QWidget* widget, int x, int y);
void add_expanding(QStatusBar* statusbar, QWidget* widget);
void add_expanding(QSplitter* splitter, QWidget* widget);
......
......@@ -139,13 +139,10 @@ RtMonQt::RtMonQt(void* rtmon_parent_ctx, QWidget* rtmon_parent_wid,
SLOT(activate_op()), "$pwr_exe/xtt_op.png");
// Button box
pwr_tFileName fname;
dcli_translate_filename(fname, "$pwr_exe/pwr_logofully.png");
bbox_image = new_image_label(toplevel, fname);
bbox_image = new_image_label(toplevel, "$pwr_exe/pwr_logofully.png");
bbox_image->setVisible(false);
dcli_translate_filename(fname, "$pwr_exe/pwr_logofullg.png");
bbox_image_gray = new_image_label(toplevel, fname);
bbox_image_gray = new_image_label(toplevel, "$pwr_exe/pwr_logofullg.png");
bbox_label = new QLabel("Down");
bbox_label->setFixedSize(170, 25);
......
......@@ -371,9 +371,7 @@ CoWowWarrantQt::CoWowWarrantQt(CoWowQtObject* parent)
QHBoxLayout* inner_layout = new QHBoxLayout();
pwr_tFileName fname;
dcli_translate_filename(fname, "$pwr_exe/pwr_logofull.png");
QLabel* image = new_image_label(this, fname);
QLabel* image = new_image_label(this, "$pwr_exe/pwr_logofull.png");
inner_layout->addWidget(image);
inner_layout->setAlignment(image, Qt::AlignTop);
......
......@@ -158,18 +158,15 @@ OpQt::OpQt(void* op_parent_ctx, QWidget* op_parent_wid, char* opplace,
CoWowQt::SetWindowIcon(toplevel);
QRect xtt_monitor_geometry = QApplication::desktop()->screenGeometry();
pwr_tFileName fname;
dcli_translate_filename(fname, "$pwr_exe/xtt_alarm_active.png");
for (int i = 0; i < 5; i++) {
aalarm_active[i] = new_image_label(toplevel, fname);
aalarm_active[i] = new_image_label(toplevel, "$pwr_exe/xtt_alarm_active.png");
aalarm_label[i] = new QLabel("");
}
alarmcnt_label = new QLabel("");
aalarm_mark = new QLabel("A");
dcli_translate_filename(fname, "$pwr_exe/xtt_alarm_active.png");
balarm_active = new_image_label(toplevel, fname);
balarm_active = new_image_label(toplevel, "$pwr_exe/xtt_alarm_active.png");
balarm_mark = new QLabel("");
balarm_label = new QLabel("");
......@@ -365,6 +362,7 @@ OpQt::OpQt(void* op_parent_ctx, QWidget* op_parent_wid, char* opplace,
char text[80];
pwr_tTime time;
pwr_tFileName fname;
dcli_translate_filename(fname, "$pwrp_exe/pwrp_logotype.png");
if (EVEN(dcli_file_time(fname, &time))) {
dcli_translate_filename(fname, "$pwr_exe/proview_icon17.png");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment