Esempio n. 1
0
userPreferences::userPreferences(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
  setupUi(this);

  if(!_privleges->check("MaintainPreferencesOthers"))
    _selectedUser->setEnabled(false);

  connect(_backgroundList,SIGNAL(clicked()),     this, SLOT(sBackgroundList()));
  connect(_close,         SIGNAL(clicked()),     this, SLOT(sClose()));
  connect(_neo,           SIGNAL(toggled(bool)), this, SLOT(sStyleChanged()));
  connect(_save,          SIGNAL(clicked()),     this, SLOT(sSave()));
  connect(_selectedUser,  SIGNAL(toggled(bool)), this, SLOT(sPopulate()));
  connect(_user,          SIGNAL(newID(int)),    this, SLOT(sPopulate()));
    //hot key signals and slots connections
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_hotkey, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
  connect(_hotkey, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
  connect(_hotkey, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));

  _hotkey->addColumn(tr("Keystroke"), _itemColumn, Qt::AlignLeft );
  _hotkey->addColumn(tr("Action"),    -1,          Qt::AlignLeft );
  _hotkey->addColumn("key",           0,           Qt::AlignLeft );

  connect(_warehouses, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(sWarehouseToggled(QTreeWidgetItem*)));
  connect(_event, SIGNAL(itemSelected(int)), this, SLOT(sAllWarehousesToggled(int)));
  connect(_event, SIGNAL(itemSelectionChanged()), this, SLOT(sFillWarehouseList()));

  _event->addColumn(tr("Module"),      50,   Qt::AlignCenter );
  _event->addColumn(tr("Name"),        150,  Qt::AlignLeft   );
  _event->addColumn(tr("Description"), -1,   Qt::AlignLeft   );
  _event->populate( "SELECT evnttype_id, evnttype_module, evnttype_name, evnttype_descrip "
                    "FROM evnttype "
                    "ORDER BY evnttype_module, evnttype_name" );

  _warehouses->addColumn(tr("Notify"),    50,         Qt::AlignCenter );
  _warehouses->addColumn(tr("Whs."),      _whsColumn, Qt::AlignCenter );
  _warehouses->addColumn(tr("Warehouse"), -1,         Qt::AlignLeft   );
  _warehouses->populate( "SELECT warehous_id, TEXT('-'), warehous_code, warehous_descrip "
                        "FROM warehous "
                        "ORDER BY warehous_code" );

  _dirty = FALSE;

#ifndef Q_WS_MAC
  _backgroundList->setMaximumWidth(25);
#endif

  _user->setType(XComboBox::Users);

  _userGroup->setEnabled(_privleges->check("MaintainUsers"));

  _ellipsesAction->append(1, tr("List"));
  _ellipsesAction->append(2, tr("Search"));

  sPopulate();
}
Esempio n. 2
0
/*
 *  Constructs a userPreferences as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
userPreferences::userPreferences(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
  setupUi(this);

  if(!_privleges->check("MaintainPreferencesOthers"))
    _selectedUser->setEnabled(false);

  // signals and slots connections
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_events, SIGNAL(clicked()), this, SLOT(sEvents()));
  connect(_selectedWarehouse, SIGNAL(toggled(bool)), _warehouse, SLOT(setEnabled(bool)));
  connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_selectedUser, SIGNAL(toggled(bool)), this, SLOT(sPopulate()));
  connect(_user, SIGNAL(newID(int)), this, SLOT(sPopulate()));
  connect(_selectedUser, SIGNAL(toggled(bool)), _user, SLOT(setEnabled(bool)));
  connect(_backgroundList, SIGNAL(clicked()), this, SLOT(sBackgroundList()));
  connect(_backgroundImage, SIGNAL(toggled(bool)), _backgroundList, SLOT(setEnabled(bool)));
  connect(_hotkeys, SIGNAL(clicked()), this, SLOT(sHotkeys()));
  connect(_neo, SIGNAL(toggled(bool)), this, SLOT(sStyleChanged()));

  _dirty = FALSE;

#ifdef Q_WS_MAC
  _backgroundList->setMaximumWidth(50);
#else
  _backgroundList->setMaximumWidth(25);
#endif

  _user->populate( "SELECT usr_id, usr_username "
                   "FROM usr "
                   "ORDER BY usr_username;" );

  _userGroup->setEnabled(_privleges->check("MaintainUsers"));

  _ellipsesAction->append(1, tr("List"));
  _ellipsesAction->append(2, tr("Search"));

  sPopulate();
}
Esempio n. 3
0
userPreferences::userPreferences(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  _pref = _preferences;
  _altPref = 0;

  if(!_privileges->check("MaintainPreferencesOthers"))
    _selectedUser->setEnabled(false);

  QPushButton* apply = _buttonBox->button(QDialogButtonBox::Apply);
  connect(apply, SIGNAL(clicked()), this, SLOT(sApply()));
  connect(_buttonBox,         SIGNAL(rejected()),     this, SLOT(sClose()));
  connect(_buttonBox,          SIGNAL(accepted()),     this, SLOT(sSave()));

  connect(_backgroundList,SIGNAL(clicked()),     this, SLOT(sBackgroundList()));
  connect(_selectedUser,  SIGNAL(toggled(bool)), this, SLOT(sPopulate()));
  connect(_user,          SIGNAL(newID(int)),    this, SLOT(sPopulate()));
    //hot key signals and slots connections
  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_hotkey, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
  connect(_hotkey, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
  connect(_hotkey, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));

  _hotkey->addColumn(tr("Keystroke"), _itemColumn, Qt::AlignLeft );
  _hotkey->addColumn(tr("Action"),    -1,          Qt::AlignLeft );
  _hotkey->addColumn("key",           0,           Qt::AlignLeft );

  connect(_warehouses, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(sWarehouseToggled(QTreeWidgetItem*)));
  connect(_event, SIGNAL(itemSelected(int)), this, SLOT(sAllWarehousesToggled(int)));
  connect(_event, SIGNAL(itemSelectionChanged()), this, SLOT(sFillWarehouseList()));
  connect(_translations, SIGNAL(clicked()), this, SLOT(sTranslations()));
  connect(_dictionaries, SIGNAL(clicked()), this, SLOT(sDictionaries()));

  _event->addColumn(tr("Module"),      50,   Qt::AlignCenter, true,  "evnttype_module" );
  _event->addColumn(tr("Name"),        150,  Qt::AlignLeft,   true,  "evnttype_name"   );
  _event->addColumn(tr("Description"), -1,   Qt::AlignLeft,   true,  "evnttype_descrip"   );
  _event->populate( "SELECT evnttype_id, evnttype_module, evnttype_name, evnttype_descrip "
                    "FROM evnttype "
                    "ORDER BY evnttype_module, evnttype_name" );

  _warehouses->addColumn(tr("Notify"),      50,         Qt::AlignCenter, true,  "notify" );
  _warehouses->addColumn(tr("Site"),        _whsColumn, Qt::AlignCenter, true,  "warehous_code" );
  _warehouses->addColumn(tr("Description"), -1,         Qt::AlignLeft,   true,  "warehous_descrip"   );
  _warehouses->populate( "SELECT warehous_id, TEXT('-') AS notify, warehous_code, warehous_descrip "
                        "FROM whsinfo "
                        "ORDER BY warehous_code" );

  _dirty = FALSE;

#ifndef Q_WS_MAC
  _backgroundList->setMaximumWidth(25);
#endif

  _user->setType(XComboBox::Users);

  _ellipsesAction->append(1, tr("List"));
  _ellipsesAction->append(2, tr("Search"));

  if (!_metrics->boolean("EnableBatchManager"))
  {
    _alarmEmail->setVisible(false);
    _emailEvents->setVisible(false);
  }
  _translations->setEnabled(_privileges->check("MaintainTranslations"));
  _dictionaries->setEnabled(_privileges->check("MaintainDictionaries"));

  sPopulate();
  adjustSize();
}