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