void ThemeEval::addDialog(const Common::String &name, const Common::String &overlays, bool enabled, int inset) { int16 x, y; uint16 w, h; ThemeLayout *layout = 0; if (overlays == "screen") { layout = new ThemeLayoutMain(inset, inset, g_system->getOverlayWidth() - 2 * inset, g_system->getOverlayHeight() - 2 * inset); } else if (overlays == "screen_center") { layout = new ThemeLayoutMain(-1, -1, -1, -1); } else if (getWidgetData(overlays, x, y, w, h)) { layout = new ThemeLayoutMain(x + inset, y + inset, w - 2 * inset, h - 2 * inset); } if (!layout) error("Error when loading dialog position for '%s'", overlays.c_str()); if (_layouts.contains(name)) delete _layouts[name]; _layouts[name] = layout; layout->setPadding( getVar("Globals.Padding.Left", 0), getVar("Globals.Padding.Right", 0), getVar("Globals.Padding.Top", 0), getVar("Globals.Padding.Bottom", 0) ); _curLayout.push(layout); _curDialog = name; setVar(name + ".Enabled", enabled ? 1 : 0); }
void FilterWidget::filterButton_clicked() { TQueryMap opts; Attr *a = 0; for( int i = 0; i < attrList.size(); i++ ) { QApplication::processEvents(); a = attrList.at(i); if ( widgetMap.contains( a->getName() ) ) { QWidget *w = widgetMap[a->getName() ]; if ( false == w->isEnabled() ) continue; QString v = getWidgetData( a, w ); if ( !v.isEmpty() ) { int flag = Like | Case; bool ok; v.toInt(&ok, 10); if ( ok ) { flag = Equal; } if (a->getType() == Attr::Bool) { flag = Equal; } if ( opts.size() > 0 ) { flag |= And; } opts.insert(a->getName(),keeper->prepareParam(flag, v)); } } } emit filterActivated(opts); }
void restoreGeometryState(T* widget) const { widget->restoreGeometry(getWidgetData(widget->objectName() + "Geometry")); widget->restoreState(getWidgetData(widget->objectName() + "State")); }