Commit 17bf9697 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Fixed missing icons

parent 98539cf5
...@@ -394,7 +394,10 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then ...@@ -394,7 +394,10 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then
if [ $pwre_conf_qt -eq 1 ]; then if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so" pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui" pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtNetwork/QtNetwork"
else else
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so" pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h" pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
...@@ -462,11 +465,11 @@ else ...@@ -462,11 +465,11 @@ else
#Gtk #Gtk
echo "Mandatory :" echo "Mandatory :"
# if [ $pwre_conf_qt -eq 1 ]; then if [ $pwre_conf_qt -eq 1 ]; then
# pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so" pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
# else else
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so" pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
# fi fi
pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 "/usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a:/usr/lib/$hwpl-linux-$gnu/librpcsvc.a" pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 "/usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a:/usr/lib/$hwpl-linux-$gnu/librpcsvc.a"
pwre_config_check_lib libasound LIBASOUND lib lib 0 "/usr/lib/libasound.so:/usr/lib/libasound.a:/usr/lib/$hwpl-linux-$gnu/libasound.so" pwre_config_check_lib libasound LIBASOUND lib lib 0 "/usr/lib/libasound.so:/usr/lib/libasound.a:/usr/lib/$hwpl-linux-$gnu/libasound.so"
...@@ -480,11 +483,14 @@ else ...@@ -480,11 +483,14 @@ else
pwre_config_check_lib libfl LIBFL lib lib 0 "/usr/lib/libfl.so:/usr/lib/libfl.a:/usr/lib/$hwpl-linux-$gnu/libfl.so" pwre_config_check_lib libfl LIBFL lib lib 0 "/usr/lib/libfl.so:/usr/lib/libfl.a:/usr/lib/$hwpl-linux-$gnu/libfl.so"
pwre_config_check_lib libX11 LIBX11 lib lib 0 "/usr/lib/libX11.so:/usr/lib/$hwpl-linux-$gnu/libX11.so" pwre_config_check_lib libX11 LIBX11 lib lib 0 "/usr/lib/libX11.so:/usr/lib/$hwpl-linux-$gnu/libX11.so"
# if [ $pwre_conf_qt -eq 1 ]; then if [ $pwre_conf_qt -eq 1 ]; then
# pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui" pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui"
# else pwre_config_check_include qt QT 1 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtNetwork/QtNetwork"
else
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h" pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
# fi fi
pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h" pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h"
echo "" echo ""
......
...@@ -164,10 +164,12 @@ set_env() ...@@ -164,10 +164,12 @@ set_env()
# Qt # Qt
if [ -e /usr/lib/x86_64-linux-gnu/libQtGui.so ]; then if [ -e /usr/lib/x86_64-linux-gnu/libQtGui.so ]; then
export pwre_conf_qt=1 export pwre_conf_qt=1
elif [ -e /usr/lib/i386-linux-gnu/libQtGui.so ]; then
export pwre_conf_qt=1
else else
export pwre_conf_qt=0 export pwre_conf_qt=0
fi fi
# libusb # libusb
if [ -e /usr/lib/libusb-1.0.so ]; then if [ -e /usr/lib/libusb-1.0.so ]; then
export pwre_conf_libusb=1 export pwre_conf_libusb=1
......
...@@ -79,14 +79,32 @@ void showNow(QWidget *w) ...@@ -79,14 +79,32 @@ void showNow(QWidget *w)
QIcon get_icon(const char *iconName) QIcon get_icon(const char *iconName)
{ {
if (strcmp(iconName, "")) { if (strcmp(iconName, "")) {
QIcon icon = QIcon::fromTheme(fl(iconName)); // iconName is not equal to ""
if (icon.isNull()) { QIcon icon;
if (strchr(iconName, '$')) { // iconName is a relative path to a local icon
pwr_tFileName fname; // First check if this is a standard gnome icon, e.g. "zoom-in"
dcli_translate_filename(fname, iconName); QIcon::setThemeName("gnome");
icon = QIcon(fl(fname)); if (QIcon::hasThemeIcon(fl(iconName))) {
} else { // iconName is an absolute path to a local icon icon = QIcon::fromTheme(fl(iconName));
icon = QIcon(fl(iconName)); if (icon.isNull() || icon.pixmap(16).isNull()) {
printf("Warning! Could not find theme icon: %s\n", iconName);
}
return icon;
}
if (strchr(iconName, '$')) {
// iconName is a relative path to a local icon, e.g. "xtt_close"
pwr_tFileName fname;
dcli_translate_filename(fname, iconName);
icon = QIcon(fl(fname));
if (icon.isNull() || icon.pixmap(16).isNull()) {
printf("Warning! Could not find proview icon: %s, path: %s\n", iconName, fname);
}
} else {
// iconName is an absolute path to a local icon
icon = QIcon(fl(iconName));
if (icon.isNull() || icon.pixmap(16).isNull()) {
printf("Warning! Could not find icon: %s\n", iconName);
} }
} }
return icon; return icon;
......
...@@ -81,7 +81,7 @@ static QPushButton *addButton(QWidget *parent, QBoxLayout *layout, ...@@ -81,7 +81,7 @@ static QPushButton *addButton(QWidget *parent, QBoxLayout *layout,
{ {
QPushButton *button = new QPushButton(fl(text)); QPushButton *button = new QPushButton(fl(text));
button->setFixedSize(170, 25); button->setFixedSize(170, 25);
QObject::connect(button, SIGNAL(triggered()), parent, SLOT(callback())); QObject::connect(button, SIGNAL(pressed()), parent, SLOT(callback()));
layout->addWidget(button); layout->addWidget(button);
return button; return button;
} }
...@@ -195,7 +195,7 @@ RtMonQt::RtMonQt(void *rtmon_parent_ctx, QWidget *rtmon_parent_wid, ...@@ -195,7 +195,7 @@ RtMonQt::RtMonQt(void *rtmon_parent_ctx, QWidget *rtmon_parent_wid,
wow = new CoWowQt(toplevel); wow = new CoWowQt(toplevel);
timerid = new QTimer(); timerid = new QTimer();
QObject::connect(timerid, SIGNAL(timeout()), toplevel, SLOT(rtmon_scan)); QObject::connect(timerid, SIGNAL(timeout()), toplevel, SLOT(rtmon_scan()));
timerid->start(1000); timerid->start(1000);
*status = 1; *status = 1;
...@@ -288,6 +288,16 @@ void RtMonQtWidget::focusInEvent(QFocusEvent *event) ...@@ -288,6 +288,16 @@ void RtMonQtWidget::focusInEvent(QFocusEvent *event)
QWidget::focusInEvent(event); QWidget::focusInEvent(event);
} }
void RtMonQtWidget::activate_xtt()
{
rtmon->activate_xtt();
}
void RtMonQtWidget::activate_op()
{
rtmon->activate_op();
}
void RtMonQtWidget::activate_zoom_in() void RtMonQtWidget::activate_zoom_in()
{ {
rtmon->nodelistnav->zoom(1.2); rtmon->nodelistnav->zoom(1.2);
...@@ -301,4 +311,9 @@ void RtMonQtWidget::activate_zoom_out() ...@@ -301,4 +311,9 @@ void RtMonQtWidget::activate_zoom_out()
void RtMonQtWidget::activate_zoom_reset() void RtMonQtWidget::activate_zoom_reset()
{ {
rtmon->nodelistnav->unzoom(); rtmon->nodelistnav->unzoom();
}
void RtMonQtWidget::activate_help()
{
rtmon->activate_help();
} }
\ No newline at end of file
...@@ -96,6 +96,9 @@ public slots: ...@@ -96,6 +96,9 @@ public slots:
void activate_zoom_in(); void activate_zoom_in();
void activate_zoom_out(); void activate_zoom_out();
void activate_zoom_reset(); void activate_zoom_reset();
void activate_xtt();
void activate_op();
void activate_help();
void rtmon_scan(); void rtmon_scan();
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include <QPrinter> #include <QPrinter>
#include <QPushButton> #include <QPushButton>
#include <QScrollArea> #include <QScrollArea>
#include <QTextEdit>
#include <QTimer> #include <QTimer>
#include <QVBoxLayout> #include <QVBoxLayout>
......
...@@ -261,11 +261,10 @@ void GeCurveQtWidget::activate_showname() ...@@ -261,11 +261,10 @@ void GeCurveQtWidget::activate_showname()
void GeCurveQtWidget::activate_filledcurves(bool set) void GeCurveQtWidget::activate_filledcurves(bool set)
{ {
int set;
if (sender() == ((GeCurveQt *)curve)->tools_curve_fill) { if (sender() == ((GeCurveQt *)curve)->tools_curve_fill) {
set = curve->fill_curves = !curve->fill_curves; set = curve->fill_curves = !curve->fill_curves;
} else { } else {
set = ((QCheckBox *)sender())->isChecked(); set = ((QAction *)sender())->isChecked();
} }
curve->activate_filledcurves(set); curve->activate_filledcurves(set);
} }
...@@ -429,6 +428,7 @@ void GeCurveQt::enable(unsigned int mask) ...@@ -429,6 +428,7 @@ void GeCurveQt::enable(unsigned int mask)
} }
if (mask & curve_mEnable_Add) { if (mask & curve_mEnable_Add) {
tools_add->setVisible(true); tools_add->setVisible(true);
}
if (mask & curve_mEnable_CurveType) { if (mask & curve_mEnable_CurveType) {
tools_curvetype_line->setVisible(true); tools_curvetype_line->setVisible(true);
tools_curvetype_points->setVisible(true); tools_curvetype_points->setVisible(true);
...@@ -704,28 +704,27 @@ GeCurveQt::GeCurveQt(void *gc_parent_ctx, QWidget *parent_widget, ...@@ -704,28 +704,27 @@ GeCurveQt::GeCurveQt(void *gc_parent_ctx, QWidget *parent_widget,
"$pwr_exe/ge_scroll_right.png"); "$pwr_exe/ge_scroll_right.png");
addToolItem(toplevel, tools, "Page right", SLOT(activate_page_right()), addToolItem(toplevel, tools, "Page right", SLOT(activate_page_right()),
"$pwr_exe/ge_page_right.png"); "$pwr_exe/ge_page_right.png");
addToolItem(toplevel, tools, "Add", SLOT(activate_add()), tools_add = addToolItem(toplevel, tools, "Add", SLOT(activate_add()),
"$pwr_exe/xtt_add.png"); "$pwr_exe/xtt_add.png");
QAction *a = addToolItem(toplevel, tools, "Curve line", tools_curvetype_line = addToolItem(toplevel, tools, "Curve line",
SLOT(activate_curvetype()), SLOT(activate_curvetype()), "$pwr_exe/xtt_curve_line.png");
"$pwr_exe/xtt_curve_line.png"); tools_curvetype_line->setData(glow_eCurveType_Line);
a->setData(glow_eCurveType_Line); tools_curvetype_points = addToolItem(toplevel, tools, "Curve points",
a = addToolItem(toplevel, tools, "Curve points", SLOT(activate_curvetype()), SLOT(activate_curvetype()), "$pwr_exe/xtt_curve_points.png");
"$pwr_exe/xtt_curve_points.png"); tools_curvetype_points->setData(glow_eCurveType_Points);
a->setData(glow_eCurveType_Points); tools_curvetype_linepoints = addToolItem(toplevel, tools,
a = addToolItem(toplevel, tools, "Curve line and points", "Curve line and points", SLOT(activate_curvetype()),
SLOT(activate_curvetype()), "$pwr_exe/xtt_curve_linepoints.png");
"$pwr_exe/xtt_curve_linepoints.png"); tools_curvetype_linepoints->setData(glow_eCurveType_LinePoints);
a->setData(glow_eCurveType_LinePoints); tools_curvetype_square = addToolItem(toplevel, tools, "Curve square",
a = addToolItem(toplevel, tools, "Curve square", SLOT(activate_curvetype()), SLOT(activate_curvetype()), "$pwr_exe/xtt_curve_square.png");
"$pwr_exe/xtt_curve_square.png"); tools_curvetype_square->setData(glow_eCurveType_Square);
a->setData(glow_eCurveType_Square); tools_curve_fill = addToolItem(toplevel, tools, "Filled curves",
addToolItem(toplevel, tools, "Filled curves", SLOT(activate_filledcurves()), SLOT(activate_filledcurves()), "$pwr_exe/xtt_curve_fill.png");
"$pwr_exe/xtt_curve_fill.png"); tools_curve_digsplit = addToolItem(toplevel, tools, "Split digital curves",
addToolItem(toplevel, tools, "Split digital curves", SLOT(activate_digsplit()), "$pwr_exe/xtt_curve_digsplit.png");
SLOT(activate_digsplit()), "$pwr_exe/xtt_curve_digsplit.png"); tools_snapshot = addToolItem(toplevel, tools, "Snapshot",
addToolItem(toplevel, tools, "Snapshot", SLOT(activate_shapshot()), SLOT(activate_shapshot()), "$pwr_exe/xtt_snapshot.png");
"$pwr_exe/xtt_snapshot.png");
// Time box // Time box
QToolBar *timetools = new QToolBar(); QToolBar *timetools = new QToolBar();
......
...@@ -82,8 +82,14 @@ public: ...@@ -82,8 +82,14 @@ public:
QWidget *menu_snapshot; QWidget *menu_snapshot;
QWidget *menu_export; QWidget *menu_export;
QWidget *menu_add; QWidget *menu_add;
QWidget *tools_snapshot; QAction *tools_snapshot;
QWidget *tools_add; QAction *tools_add;
QAction *tools_curvetype_line;
QAction *tools_curvetype_points;
QAction *tools_curvetype_linepoints;
QAction *tools_curvetype_square;
QAction *tools_curve_fill;
QAction *tools_curve_digsplit;
QWidget *export_widget; QWidget *export_widget;
QComboBox *export_attrcombo_widget; QComboBox *export_attrcombo_widget;
QLineEdit *export_fromtime_widget; QLineEdit *export_fromtime_widget;
...@@ -150,7 +156,7 @@ public slots: ...@@ -150,7 +156,7 @@ public slots:
void activate_madd(); void activate_madd();
void activate_remove(); void activate_remove();
void activate_timecombo(int index); void activate_timecombo(int index);
void activate_filledcurves(bool set); void activate_filledcurves(bool set = false);
void activate_curvetype(); void activate_curvetype();
void activate_digsplit(); void activate_digsplit();
void activate_xlimits(); void activate_xlimits();
......
...@@ -1932,7 +1932,7 @@ int GlowDrawQt::draw_points(GlowWind *wind, glow_sPointX *points, int point_num, ...@@ -1932,7 +1932,7 @@ int GlowDrawQt::draw_points(GlowWind *wind, glow_sPointX *points, int point_num,
if (idx > 0) { if (idx > 0) {
for (int i = 0; i < point_num; i++) { for (int i = 0; i < point_num; i++) {
painter->fillRect(points[i].x - idx/2, points[i].y - idx/2, idx, idx); painter->fillRect(points[i].x - idx/2, points[i].y - idx/2, idx, idx, painter->brush());
} }
return 1; return 1;
} }
......
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
#include "rt_xnav_msg.h" #include "rt_xnav_msg.h"
#include "../../cow/qt/cow_wow_qt.h" #include "../../cow/qt/cow_wow_qt.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QLabel> #include <QLabel>
#include <QPushButton> #include <QPushButton>
......
...@@ -307,10 +307,10 @@ RtTraceQt::RtTraceQt(void *tr_parent_ctx, QWidget *tr_parent_wid, ...@@ -307,10 +307,10 @@ RtTraceQt::RtTraceQt(void *tr_parent_ctx, QWidget *tr_parent_wid,
QToolBar *tools = new QToolBar(toplevel); QToolBar *tools = new QToolBar(toplevel);
pwr_tObjid parent; pwr_tObjid parent;
par_tCid parent_cid; pwr_tCid parent_cid;
sts = gdh_GetParent(objid, &parent); sts = gdh_GetParent(objid, &parent);
if (ODD(sts)) { if (ODD(sts)) {
sts = gdx_GetObjectClass(parent, &parent_cid); sts = gdh_GetObjectClass(parent, &parent_cid);
if (ODD(sts) && parent_cid != pwr_cClass_plc) { if (ODD(sts) && parent_cid != pwr_cClass_plc) {
addToolItem(toplevel, tools, "Open parent window", addToolItem(toplevel, tools, "Open parent window",
SLOT(activate_parent_window()), "$pwr_exe/xtt_up.png"); SLOT(activate_parent_window()), "$pwr_exe/xtt_up.png");
......
...@@ -454,9 +454,9 @@ QMenu *XNavQt::build_menu(int MenuType, const char *MenuTitle, ...@@ -454,9 +454,9 @@ QMenu *XNavQt::build_menu(int MenuType, const char *MenuTitle,
// Check that the Cascade contains any pushbuttons // Check that the Cascade contains any pushbuttons
int found = 0; int found = 0;
unsigned int cascade_level = Items[*idx].Level; unsigned int cascade_level = Items[idx].Level;
int cidx; int cidx;
for (cidx = *idx + 1; Items[cidx].Level != 0 && for (cidx = idx + 1; Items[cidx].Level != 0 &&
Items[cidx].Level > cascade_level; cidx++) { Items[cidx].Level > cascade_level; cidx++) {
if (Items[cidx].Item == xmenu_eMenuItem_Ref || if (Items[cidx].Item == xmenu_eMenuItem_Ref ||
Items[cidx].Item == xmenu_eMenuItem_Button) { Items[cidx].Item == xmenu_eMenuItem_Button) {
...@@ -476,7 +476,7 @@ QMenu *XNavQt::build_menu(int MenuType, const char *MenuTitle, ...@@ -476,7 +476,7 @@ QMenu *XNavQt::build_menu(int MenuType, const char *MenuTitle,
// Separator // Separator
menu->addSeparator(); menu->addSeparator();
break; break;
case xmenu_eMenuItem_Button: case xmenu_eMenuItem_Button: {
// Pushbutton // Pushbutton
QAction *w = menu->addAction(translate_utf8(Items[idx].Name)); QAction *w = menu->addAction(translate_utf8(Items[idx].Name));
w->setEnabled(Items[idx].Flags.f.Sensitive ? TRUE : FALSE); w->setEnabled(Items[idx].Flags.f.Sensitive ? TRUE : FALSE);
...@@ -485,6 +485,7 @@ QMenu *XNavQt::build_menu(int MenuType, const char *MenuTitle, ...@@ -485,6 +485,7 @@ QMenu *XNavQt::build_menu(int MenuType, const char *MenuTitle,
QObject::connect(w, SIGNAL(triggered()), popup_obj, Callback); QObject::connect(w, SIGNAL(triggered()), popup_obj, Callback);
} }
break; break;
}
default: ; default: ;
} }
} }
......
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