Exemplo n.º 1
0
void KWStatisticsDialog::addBoxGeneral( QFrame *page, QLabel **resultLabel )
{
    // Layout Managers
    QVBoxLayout *topLayout = new QVBoxLayout( page, 0, 7 );
    QGroupBox *box = new QGroupBox( i18n( "Statistics" ), page );
    QGridLayout *grid = new QGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() );
    grid->setRowStretch (9, 1);
    // margins
    int fHeight = box->fontMetrics().height();
    grid->setMargin( fHeight );
    grid->addColSpacing( 1, fHeight );
    grid->addRowSpacing( 0, fHeight );

    // insert labels
    QLabel *label1 = new QLabel( i18n( "Number of pages:" ), box );
    grid->addWidget( label1, 1, 0, 1 );
    resultLabel[0] = new QLabel( "", box );
    grid->addWidget( resultLabel[0], 1, 2, 2 );

    QLabel *label2 = new QLabel( i18n( "Number of frames:" ), box );
    grid->addWidget( label2, 2, 0, 1 );
    resultLabel[1] = new QLabel( "", box );
    grid->addWidget( resultLabel[1], 2, 2, 2 );

    QLabel *label3 = new QLabel( i18n( "Number of pictures:" ), box );
    grid->addWidget( label3, 3, 0, 1 );
    resultLabel[2] = new QLabel( "", box );
    grid->addWidget( resultLabel[2], 3, 2, 2 );


    QLabel *label4 = new QLabel( i18n( "Number of tables:" ), box );
    grid->addWidget( label4, 4, 0, 1 );
    resultLabel[3] = new QLabel( "", box );
    grid->addWidget( resultLabel[3], 4, 2, 2 );

    QLabel *label5 = new QLabel( i18n( "Number of embedded objects:" ), box );
    grid->addWidget( label5, 5, 0, 1 );
    resultLabel[4] = new QLabel( "", box );
    grid->addWidget( resultLabel[4], 5, 2, 2 );

    QLabel *label6 = new QLabel( i18n( "Number of formula frameset:" ), box );
    grid->addWidget( label6, 6, 0, 1 );
    resultLabel[5] = new QLabel( "", box );
    grid->addWidget( resultLabel[5], 6, 2, 2 );

    topLayout->addWidget( box );
}
Exemplo n.º 2
0
addUser::addUser( KU::KUser *AUser, bool useprivategroup,
  QWidget *parent, const char *name ) :
  propdlg( AUser, useprivategroup, parent, name )
{
  QGroupBox *group = new QGroupBox(frontpage);
  group->setTitle(i18n("New Account Options"));
  QVBoxLayout *groupLayout = new QVBoxLayout(group, marginHint(), spacingHint());
  groupLayout->addSpacing(group->fontMetrics().lineSpacing());
  groupLayout->setAutoAdd(true);
  createhome = new QCheckBox(i18n("Create home folder"), group);
  createhome->setChecked(true);
  copyskel = new QCheckBox(i18n("Copy skeleton"), group);
  connect(createhome, SIGNAL(toggled(bool)), copyskel, SLOT(setEnabled(bool)));
  frontlayout->addMultiCellWidget(group, frontrow, frontrow, 0, 2);

  if ( useprivategroup ) pbprigr->setEnabled( false );
}
Exemplo n.º 3
0
KDMAppearanceWidget::KDMAppearanceWidget(QWidget *parent, const char *name)
  : QWidget(parent, name)
{
  QString wtstr;

  QVBoxLayout *vbox = new QVBoxLayout(this, KDialog::marginHint(),
                      KDialog::spacingHint(), "vbox");
  QGroupBox *group = new QGroupBox(i18n("Appearance"), this);
  vbox->addWidget(group);

  QGridLayout *grid = new QGridLayout( group, 5, 2, KDialog::marginHint(),
                       KDialog::spacingHint(), "grid");
  grid->addRowSpacing(0, group->fontMetrics().height());
  grid->setColStretch(0, 1);
  grid->setColStretch(1, 1);

  QHBoxLayout *hlay = new QHBoxLayout( KDialog::spacingHint() );
  grid->addMultiCellLayout(hlay, 1,1, 0,1);
  greetstr_lined = new KLineEdit(group);
  QLabel *label = new QLabel(greetstr_lined, i18n("&Greeting:"), group);
  hlay->addWidget(label);
  connect(greetstr_lined, SIGNAL(textChanged(const QString&)),
      SLOT(changed()));
  hlay->addWidget(greetstr_lined);
  wtstr = i18n("This is the \"headline\" for KDM's login window. You may want to "
           "put some nice greeting or information about the operating system here.<p>"
           "KDM will substitute the following character pairs with the "
           "respective contents:<br><ul>"
           "<li>%d -> current display</li>"
           "<li>%h -> host name, possibly with domain name</li>"
           "<li>%n -> node name, most probably the host name without domain name</li>"
           "<li>%s -> the operating system</li>"
           "<li>%r -> the operating system's version</li>"
           "<li>%m -> the machine (hardware) type</li>"
           "<li>%% -> a single %</li>"
           "</ul>" );
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( greetstr_lined, wtstr );


  QGridLayout *hglay = new QGridLayout( 3, 4, KDialog::spacingHint() );
  grid->addMultiCellLayout(hglay, 2,4, 0,0);

  label = new QLabel(i18n("Logo area:"), group);
  hglay->addWidget(label, 0, 0);
  QVBoxLayout *vlay = new QVBoxLayout( KDialog::spacingHint() );
  hglay->addMultiCellLayout(vlay, 0,0, 1,2);
  noneRadio = new QRadioButton( i18n("logo area", "&None"), group );
  clockRadio = new QRadioButton( i18n("Show cloc&k"), group );
  logoRadio = new QRadioButton( i18n("Sho&w logo"), group );
  QButtonGroup *buttonGroup = new QButtonGroup( group );
  label->setBuddy( buttonGroup );
  connect( buttonGroup, SIGNAL(clicked(int)), SLOT(slotAreaRadioClicked(int)) );
  connect( buttonGroup, SIGNAL(clicked(int)), SLOT(changed()) );
  buttonGroup->hide();
  buttonGroup->insert(noneRadio, KdmNone);
  buttonGroup->insert(clockRadio, KdmClock);
  buttonGroup->insert(logoRadio, KdmLogo);
  vlay->addWidget(noneRadio);
  vlay->addWidget(clockRadio);
  vlay->addWidget(logoRadio);
  wtstr = i18n("You can choose to display a custom logo (see below), a clock or no logo at all.");
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( noneRadio, wtstr );
  QWhatsThis::add( logoRadio, wtstr );
  QWhatsThis::add( clockRadio, wtstr );

  logoLabel = new QLabel(i18n("&Logo:"), group);
  logobutton = new QPushButton(group);
  logoLabel->setBuddy( logobutton );
  logobutton->setAutoDefault(false);
  logobutton->setAcceptDrops(true);
  logobutton->installEventFilter(this); // for drag and drop
  connect(logobutton, SIGNAL(clicked()), SLOT(slotLogoButtonClicked()));
  hglay->addWidget(logoLabel, 1, 0);
  hglay->addWidget(logobutton, 1, 1, AlignCenter);
  hglay->addRowSpacing(1, 110);
  wtstr = i18n("Click here to choose an image that KDM will display. "
	       "You can also drag and drop an image onto this button "
	       "(e.g. from Konqueror).");
  QWhatsThis::add( logoLabel, wtstr );
  QWhatsThis::add( logobutton, wtstr );
  hglay->addRowSpacing( 2, KDialog::spacingHint());
  hglay->setColStretch( 3, 1);


  hglay = new QGridLayout( 2, 3, KDialog::spacingHint() );
  grid->addLayout(hglay, 2, 1);

  label = new QLabel(i18n("Position:"), group);
  hglay->addMultiCellWidget(label, 0,1, 0,0, AlignVCenter);
  QValidator *posValidator = new QIntValidator(0, 100, group);
  QLabel *xLineLabel = new QLabel(i18n("&X:"), group);
  hglay->addWidget(xLineLabel, 0, 1);
  xLineEdit = new QLineEdit (group);
  connect( xLineEdit, SIGNAL( textChanged(const QString&) ), SLOT( changed() ));
  hglay->addWidget(xLineEdit, 0, 2);
  xLineLabel->setBuddy(xLineEdit);
  xLineEdit->setValidator(posValidator);
  QLabel *yLineLabel = new QLabel(i18n("&Y:"), group);
  hglay->addWidget(yLineLabel, 1, 1);
  yLineEdit = new QLineEdit (group);
  connect( yLineEdit, SIGNAL( textChanged(const QString&) ), SLOT( changed() ));
  hglay->addWidget(yLineEdit, 1, 2);
  yLineLabel->setBuddy(yLineEdit);
  yLineEdit->setValidator(posValidator);
  wtstr = i18n("Here you specify the relative coordinates (in percent) of the login dialog's <em>center</em>.");
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( xLineLabel, wtstr );
  QWhatsThis::add( xLineEdit, wtstr );
  QWhatsThis::add( yLineLabel, wtstr );
  QWhatsThis::add( yLineEdit, wtstr );
  hglay->setColStretch( 3, 1);
  hglay->setRowStretch( 2, 1);


  hglay = new QGridLayout( 2, 3, KDialog::spacingHint() );
  grid->addLayout(hglay, 3, 1);
  hglay->setColStretch(3, 1);

  guicombo = new KBackedComboBox(group);
  guicombo->insertItem( "", i18n("<default>") );
  loadGuiStyles(guicombo);
  guicombo->listBox()->sort();
  label = new QLabel(guicombo, i18n("GUI s&tyle:"), group);
  connect(guicombo, SIGNAL(activated(int)), SLOT(changed()));
  hglay->addWidget(label, 0, 0);
  hglay->addWidget(guicombo, 0, 1);
  wtstr = i18n("You can choose a basic GUI style here that will be "
        "used by KDM only.");
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( guicombo, wtstr );

  colcombo = new KBackedComboBox(group);
  colcombo->insertItem( "", i18n("<default>") );
  loadColorSchemes(colcombo);
  colcombo->listBox()->sort();
  label = new QLabel(colcombo, i18n("&Color scheme:"), group);
  connect(colcombo, SIGNAL(activated(int)), SLOT(changed()));
  hglay->addWidget(label, 1, 0);
  hglay->addWidget(colcombo, 1, 1);
  wtstr = i18n("You can choose a basic Color Scheme here that will be "
        "used by KDM only.");
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( colcombo, wtstr );

  echocombo = new KBackedComboBox(group);
  echocombo->insertItem("NoEcho", i18n("No Echo"));
  echocombo->insertItem("OneStar", i18n("One Star"));
  echocombo->insertItem("ThreeStars", i18n("Three Stars"));
  label = new QLabel(echocombo, i18n("Echo &mode:"), group);
  connect(echocombo, SIGNAL(activated(int)), SLOT(changed()));
  hglay->addWidget(label, 2, 0);
  hglay->addWidget(echocombo, 2, 1);
  wtstr = i18n("You can choose whether and how KDM shows your password when you type it.");
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( echocombo, wtstr );


  // The Language group box
  group = new QGroupBox(0, Vertical, i18n("Locale"), this);
  vbox->addWidget(group);

  langcombo = new KLanguageButton(group);
  loadLanguageList(langcombo);
  connect(langcombo, SIGNAL(activated(const QString &)), SLOT(changed()));
  label = new QLabel(langcombo, i18n("Languag&e:"), group);
  QGridLayout *hbox = new QGridLayout( group->layout(), 2, 2, KDialog::spacingHint() );
  hbox->setColStretch(1, 1);
  hbox->addWidget(label, 1, 0);
  hbox->addWidget(langcombo, 1, 1);
  wtstr = i18n("Here you can choose the language used by KDM. This setting does not affect"
    " a user's personal settings; that will take effect after login.");
  QWhatsThis::add( label, wtstr );
  QWhatsThis::add( langcombo, wtstr );


  vbox->addStretch(1);

}
Exemplo n.º 4
0
KHTMLSearchConfig::KHTMLSearchConfig(QWidget *parent, const char *name)
  : KCModule(parent, name), indexProc(0)
{
  QVBoxLayout *vbox = new QVBoxLayout(this, 5);


  QGroupBox *gb = new QGroupBox(i18n("ht://dig"), this);
  vbox->addWidget(gb);

  QGridLayout *grid = new QGridLayout(gb, 3,2, 6,6);

  grid->addRowSpacing(0, gb->fontMetrics().lineSpacing());

  QLabel *l = new QLabel(i18n("The fulltext search feature makes use of the "
                  "ht://dig HTML search engine. "
                  "You can get ht://dig at the"), gb);
  l->setAlignment(QLabel::WordBreak);
  l->setMinimumSize(l->sizeHint());
  grid->addMultiCellWidget(l, 1, 1, 0, 1);
  QWhatsThis::add( gb, i18n( "Information about where to get the ht://dig package." ) );

  KURLLabel *url = new KURLLabel(gb);
  url->setURL("http://www.htdig.org");
  url->setText(i18n("ht://dig home page"));
  url->setAlignment(QLabel::AlignHCenter);
  grid->addMultiCellWidget(url, 2,2, 0, 1);
  connect(url, SIGNAL(leftClickedURL(const QString&)),
      this, SLOT(urlClicked(const QString&)));

  gb = new QGroupBox(i18n("Program Locations"), this);

  vbox->addWidget(gb);
  grid = new QGridLayout(gb, 4,2, 6,6);
  grid->addRowSpacing(0, gb->fontMetrics().lineSpacing());

  htdigBin = new KURLRequester(gb);
  l = new QLabel(htdigBin, i18n("ht&dig"), gb);
  l->setBuddy( htdigBin );
  grid->addWidget(l, 1,0);
  grid->addWidget(htdigBin, 1,1);
  connect(htdigBin->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(configChanged()));
  QString wtstr = i18n( "Enter the path to your htdig program here, e.g. /usr/local/bin/htdig" );
  QWhatsThis::add( htdigBin, wtstr );
  QWhatsThis::add( l, wtstr );

  htsearchBin = new KURLRequester(gb);
  l = new QLabel(htsearchBin, i18n("ht&search"), gb);
  l->setBuddy( htsearchBin );
  grid->addWidget(l, 2,0);
  grid->addWidget(htsearchBin, 2,1);
  connect(htsearchBin->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(configChanged()));
  wtstr = i18n( "Enter the path to your htsearch program here, e.g. /usr/local/bin/htsearch" );
  QWhatsThis::add( htsearchBin, wtstr );
  QWhatsThis::add( l, wtstr );

  htmergeBin = new KURLRequester(gb);
  l = new QLabel(htmergeBin, i18n("ht&merge"), gb);
  l->setBuddy( htmergeBin );
  grid->addWidget(l, 3,0);
  grid->addWidget(htmergeBin, 3,1);
  connect(htmergeBin->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(configChanged()));
  wtstr = i18n( "Enter the path to your htmerge program here, e.g. /usr/local/bin/htmerge" );
  QWhatsThis::add( htmergeBin, wtstr );
  QWhatsThis::add( l, wtstr );

  QHBoxLayout *hbox = new QHBoxLayout(vbox);

  gb = new QGroupBox(i18n("Scope"), this);
  hbox->addWidget(gb);
  QWhatsThis::add( gb, i18n( "Here you can select which parts of the documentation should be included in the fulltext search index. Available options are the KDE Help pages, the installed man pages, and the installed info pages. You can select any number of these." ) );

  QVBoxLayout *vvbox = new QVBoxLayout(gb, 6,2);
  vvbox->addSpacing(gb->fontMetrics().lineSpacing());

  indexKDE = new QCheckBox(i18n("&KDE help"), gb);
  vvbox->addWidget(indexKDE);
  connect(indexKDE, SIGNAL(clicked()), this, SLOT(configChanged()));

  indexMan = new QCheckBox(i18n("&Man pages"), gb);
  vvbox->addWidget(indexMan);
  indexMan->setEnabled(false),
  connect(indexMan, SIGNAL(clicked()), this, SLOT(configChanged()));

  indexInfo = new QCheckBox(i18n("&Info pages"), gb);
  vvbox->addWidget(indexInfo);
  indexInfo->setEnabled(false);
  connect(indexInfo, SIGNAL(clicked()), this, SLOT(configChanged()));

  gb = new QGroupBox(i18n("Additional Search Paths"), this);
  hbox->addWidget(gb);
  QWhatsThis::add( gb, i18n( "Here you can add additional paths to search for documentation. To add a path, click on the <em>Add...</em> button and select the folder from where additional documentation should be searched. You can remove folders by clicking on the <em>Delete</em> button." ) );

  grid = new QGridLayout(gb, 4,3, 6,2);
  grid->addRowSpacing(0, gb->fontMetrics().lineSpacing());

  addButton = new QPushButton(i18n("Add..."), gb);
  grid->addWidget(addButton, 1,0);

  delButton = new QPushButton(i18n("Delete"), gb);
  grid->addWidget(delButton, 2,0);

  searchPaths = new KListBox(gb);
  grid->addMultiCellWidget(searchPaths, 1,3, 1,1);
  grid->setRowStretch(2,2);

  gb = new QGroupBox(i18n("Language Settings"), this);
  vbox->addWidget(gb);
  QWhatsThis::add(gb, i18n("Here you can select the language you want to create the index for."));
  language = new KLanguageCombo(gb);
  l = new QLabel(language, i18n("&Language"), gb);
  vvbox = new QVBoxLayout(gb, 6,2);
  vvbox->addSpacing(gb->fontMetrics().lineSpacing());
  hbox = new QHBoxLayout(vvbox, 6);
  hbox->addWidget(l);
  hbox->addWidget(language,1);
  hbox->addStretch(1);

  loadLanguages();

  vbox->addStretch(1);

  runButton = new QPushButton(i18n("Generate Index..."), this);
  QWhatsThis::add( runButton, i18n( "Click this button to generate the index for the fulltext search." ) );
  runButton->setFixedSize(runButton->sizeHint());
  vbox->addWidget(runButton, AlignRight);
  connect(runButton, SIGNAL(clicked()), this, SLOT(generateIndex()));

  connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
  connect(delButton, SIGNAL(clicked()), this, SLOT(delClicked()));
  connect(searchPaths, SIGNAL(highlighted(const QString &)),
      this, SLOT(pathSelected(const QString &)));

  checkButtons();

  load();
}
Exemplo n.º 5
0
SalesHistory::SalesHistory(MainWindow* main)
    : QuasarWindow(main, "SalesHistory"), _grid(NULL)
{
    _helpSource = "sales_history.html";

    QFrame* frame = new QFrame(this);

    QGroupBox* select = new QGroupBox(tr("Data Selection"), frame);
    QGridLayout* grid1 = new QGridLayout(select, 2, 1, select->frameWidth()*2);
    grid1->addRowSpacing(0, select->fontMetrics().height());

    _lookup = new ItemLookup(_main, this);
    _lookup->soldOnly = true;
    _lookup->store_id = _quasar->defaultStore();

    QLabel* itemLabel = new QLabel(tr("Item Number:"), select);
    _item = new ItemEdit(_lookup, select);
    _item->setLength(18, '9');
    itemLabel->setBuddy(_item);

    QLabel* descLabel = new QLabel(tr("Description:"), select);
    _desc = new LineEdit(select);
    _desc->setLength(30);
    _desc->setFocusPolicy(NoFocus);

    QLabel* storeLabel = new QLabel(tr("Store:"), select);
    _store = new LookupEdit(new StoreLookup(_main, this), select);
    _store->setLength(30);
    storeLabel->setBuddy(_store);

    QLabel* sizeLabel = new QLabel(tr("Size:"), select);
    _size = new ComboBox(false, select);
    sizeLabel->setBuddy(_size);
    _size->insertItem(tr("All Sizes"));

    QLabel* dateLabel = new QLabel(tr("Date:"), select);
    _date = new DatePopup(select);
    dateLabel->setBuddy(_date);

    grid1->setColStretch(2, 1);
    grid1->addWidget(itemLabel, 1, 0);
    grid1->addWidget(_item, 1, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(descLabel, 2, 0);
    grid1->addWidget(_desc, 2, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(storeLabel, 3, 0);
    grid1->addWidget(_store, 3, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(sizeLabel, 1, 2, AlignRight | AlignVCenter);
    grid1->addWidget(_size, 1, 3, AlignLeft | AlignVCenter);
    grid1->addWidget(dateLabel, 2, 2, AlignRight | AlignVCenter);
    grid1->addWidget(_date, 2, 3, AlignLeft | AlignVCenter);

    QGroupBox* format = new QGroupBox(tr("Data Format"), frame);
    QGridLayout* grid2 = new QGridLayout(format, 2, 1, format->frameWidth()*2);
    grid2->addRowSpacing(0, format->fontMetrics().height());

    QLabel* qtySizeLabel = new QLabel(tr("Quantity Size:"), format);
    _qtySize = new ComboBox(false, format);
    qtySizeLabel->setBuddy(_qtySize);
    _qtySize->insertItem("EACH");

    QLabel* periodLabel = new QLabel(tr("Period:"), format);
    _period = new ComboBox(false, format);
    periodLabel->setBuddy(_period);

    _period->insertItem(tr("Month"));
    _period->insertItem(tr("Week"));
    _period->insertItem(tr("Day"));

    QLabel* countLabel = new QLabel(tr("Count:"), format);
    _count = new IntegerEdit(format);
    _count->setLength(4);
    countLabel->setBuddy(_count);

    grid2->setColStretch(2, 1);
    grid2->addWidget(qtySizeLabel, 1, 0);
    grid2->addWidget(_qtySize, 1, 1, AlignLeft | AlignVCenter);
    grid2->addWidget(periodLabel, 1, 2, AlignRight | AlignVCenter);
    grid2->addWidget(_period, 1, 3, AlignLeft | AlignVCenter);
    grid2->addWidget(countLabel, 2, 2, AlignRight | AlignVCenter);
    grid2->addWidget(_count, 2, 3, AlignLeft | AlignVCenter);

    _list = new ListView(frame);
    _list->addTextColumn(tr("Period"), 10);
    _list->addDateColumn(tr("Start Date"));
    _list->addNumberColumn(tr("Quantity"));
    _list->addMoneyColumn(tr("Total Cost"));
    _list->addMoneyColumn(tr("Total Price"));
    _list->addMoneyColumn(tr("Profit"));
    _list->addPercentColumn(tr("Margin"));
    _list->setSorting(1, false);
    _list->setShowSortIndicator(true);

    QFrame* info = new QFrame(frame);

    QLabel* minLabel = new QLabel(tr("Min:"), info);
    _minQty = new DoubleEdit(info);
    _minQty->setFocusPolicy(NoFocus);

    QLabel* maxLabel = new QLabel(tr("Max:"), info);
    _maxQty = new DoubleEdit(info);
    _maxQty->setFocusPolicy(NoFocus);

    QLabel* onHandLabel = new QLabel(tr("On Hand:"), info);
    _onHand = new DoubleEdit(info);
    _onHand->setFocusPolicy(NoFocus);

    QLabel* onOrderLabel = new QLabel(tr("On Order:"), info);
    _onOrder = new DoubleEdit(info);
    _onOrder->setFocusPolicy(NoFocus);

    QGridLayout* infoGrid = new QGridLayout(info);
    infoGrid->setSpacing(6);
    infoGrid->setMargin(6);
    infoGrid->setColStretch(2, 1);
    infoGrid->addWidget(minLabel, 0, 0);
    infoGrid->addWidget(_minQty, 0, 1, AlignLeft | AlignVCenter);
    infoGrid->addWidget(onHandLabel, 0, 3);
    infoGrid->addWidget(_onHand, 0, 4, AlignLeft | AlignVCenter);
    infoGrid->addWidget(maxLabel, 1, 0);
    infoGrid->addWidget(_maxQty, 1, 1, AlignLeft | AlignVCenter);
    infoGrid->addWidget(onOrderLabel, 1, 3);
    infoGrid->addWidget(_onOrder, 1, 4, AlignLeft | AlignVCenter);

    QFrame* box = new QFrame(frame);

    QPushButton* refresh = new QPushButton(tr("&Refresh"), box);
    refresh->setMinimumSize(refresh->sizeHint());
    connect(refresh, SIGNAL(clicked()), SLOT(slotRefresh()));

    QPushButton* print = new QPushButton(tr("&Print"), box);
    print->setMinimumSize(refresh->sizeHint());
    connect(print, SIGNAL(clicked()), SLOT(slotPrint()));

    QPushButton* close = new QPushButton(tr("Cl&ose"), box);
    close->setMinimumSize(refresh->sizeHint());
    connect(close, SIGNAL(clicked()), SLOT(close()));

    QGridLayout* boxGrid = new QGridLayout(box);
    boxGrid->setSpacing(6);
    boxGrid->setMargin(6);
    boxGrid->setColStretch(2, 1);
    boxGrid->addWidget(refresh, 0, 0, AlignLeft | AlignVCenter);
    boxGrid->addWidget(print, 0, 1, AlignLeft | AlignVCenter);
    boxGrid->addWidget(close, 0, 2, AlignRight | AlignVCenter);

    QGridLayout* grid = new QGridLayout(frame);
    grid->setSpacing(6);
    grid->setMargin(6);
    grid->setRowStretch(2, 1);
    grid->addWidget(select, 0, 0);
    grid->addWidget(format, 1, 0);
    grid->addWidget(_list, 2, 0);
    grid->addWidget(info, 3, 0);
    grid->addWidget(box, 4, 0);

    connect(_item, SIGNAL(validData()), SLOT(slotItemChanged()));
    connect(_store, SIGNAL(validData()), SLOT(slotStoreChanged()));
    connect(_size, SIGNAL(activated(int)), SLOT(slotRefresh()));
    connect(_date, SIGNAL(validData()), SLOT(slotRefresh()));
    connect(_qtySize, SIGNAL(activated(int)), SLOT(slotRefresh()));
    connect(_period, SIGNAL(activated(int)), SLOT(slotRefresh()));
    connect(_count, SIGNAL(validData()), SLOT(slotRefresh()));

    _store->setId(_quasar->defaultStore());
    _date->setDate(QDate::currentDate());
    _count->setInt(12);
    _item->setFocus();

    setCentralWidget(frame);
    setCaption(tr("Sales History"));
    finalize();
}
Exemplo n.º 6
0
TxSummary::TxSummary(MainWindow* main)
    : QuasarWindow(main, "TxSummary")
{
    _helpSource = "tx_summary.html";

    QFrame* frame = new QFrame(this);

    QGroupBox* select = new QGroupBox(tr("Data Selection"), frame);
    QGridLayout* grid1 = new QGridLayout(select, 2, 1, select->frameWidth()*2);
    grid1->addRowSpacing(0, select->fontMetrics().height());

    QLabel* rangeLabel = new QLabel(tr("Date Range:"), select);
    _range = new DateRange(select);

    QLabel* fromLabel = new QLabel(tr("From Date:"), select);
    _from = new DatePopup(select);
    _range->setFromPopup(_from);
    fromLabel->setBuddy(_from);

    QLabel* toLabel = new QLabel(tr("To Date:"), select);
    _to = new DatePopup(select);
    _range->setToPopup(_to);
    toLabel->setBuddy(_to);

    QLabel* storeLabel = new QLabel(tr("Store:"), select);
    _store = new LookupEdit(new StoreLookup(main, this), select);
    _store->setLength(30);
    storeLabel->setBuddy(_store);

    QLabel* stationLabel = new QLabel(tr("Station:"), select);
    _station = new LookupEdit(new StationLookup(main, this), select);
    _station->setLength(30);
    stationLabel->setBuddy(_station);

    QLabel* employeeLabel = new QLabel(tr("Employee:"), select);
    _employee = new LookupEdit(new EmployeeLookup(main, this), select);
    _employee->setLength(30);
    employeeLabel->setBuddy(_employee);

    grid1->setColStretch(2, 1);
    grid1->addColSpacing(2, 20);
    grid1->addWidget(rangeLabel, 1, 0);
    grid1->addWidget(_range, 1, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(fromLabel, 2, 0);
    grid1->addWidget(_from, 2, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(toLabel, 3, 0);
    grid1->addWidget(_to, 3, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(storeLabel, 1, 3);
    grid1->addWidget(_store, 1, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(stationLabel, 2, 3);
    grid1->addWidget(_station, 2, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(employeeLabel, 3, 3);
    grid1->addWidget(_employee, 3, 4, AlignLeft | AlignVCenter);

    _tabs = new QTabWidget(frame);

    QFrame* buttons = new QFrame(frame);
    QPushButton* refresh = new QPushButton(tr("&Refresh"), buttons);
    connect(refresh, SIGNAL(clicked()), SLOT(slotRefresh()));
    refresh->setMinimumSize(refresh->sizeHint());

    QPushButton* print = new QPushButton(tr("&Print"), buttons);
    connect(print, SIGNAL(clicked()), SLOT(slotPrint()));
    print->setMinimumSize(refresh->sizeHint());

    QPushButton* ok = new QPushButton(tr("&Close"), buttons);
    connect(ok, SIGNAL(clicked()), SLOT(close()));
    ok->setMinimumSize(refresh->sizeHint());

    QGridLayout* buttonGrid = new QGridLayout(buttons);
    buttonGrid->setSpacing(6);
    buttonGrid->setMargin(3);
    buttonGrid->setColStretch(2, 1);
    buttonGrid->addWidget(refresh, 0, 0, AlignLeft | AlignVCenter);
    buttonGrid->addWidget(print, 0, 1, AlignLeft | AlignVCenter);
    buttonGrid->addWidget(ok, 0, 2, AlignRight | AlignVCenter);

    QGridLayout* grid = new QGridLayout(frame);
    grid->setSpacing(6);
    grid->setMargin(3);
    grid->setRowStretch(1, 1);
    grid->setColStretch(0, 1);
    grid->addWidget(select, 0, 0);
    grid->addWidget(_tabs, 1, 0);
    grid->addWidget(buttons, 2, 0);

    _range->setFocus();
    _range->setCurrentItem(DateRange::Today);
    _tabs->hide();

    TenderSelect conditions;
    _quasar->db()->select(_tenders, conditions);
    for (unsigned int i = 0; i < _tenders.size(); ++i)
	_tenderCnts.push_back(0);

    setCentralWidget(frame);
    setCaption(tr("Daily Summary"));
    finalize();
}
Exemplo n.º 7
0
ItemMargin::ItemMargin(MainWindow* main)
    : QuasarWindow(main, "ItemMargin")
{
    _helpSource = "item_margin.html";

    QFrame* frame = new QFrame(this);

    QFrame* top = new QFrame(frame);

    _lookup = new ItemLookup(_main, this);
    _lookup->soldOnly = true;
    _lookup->store_id = _quasar->defaultStore();

    QLabel* itemLabel = new QLabel(tr("Item Number:"), top);
    _item = new ItemEdit(_lookup, top);
    _item->setLength(18, '9');
    itemLabel->setBuddy(_item);

    QLabel* descLabel = new QLabel(tr("Description:"), top);
    _desc = new LineEdit(top);
    _desc->setLength(30);
    _desc->setFocusPolicy(NoFocus);

    QLabel* storeLabel = new QLabel(tr("Store:"), top);
    _store = new LookupEdit(new StoreLookup(_main, this), top);
    _store->setLength(30);
    storeLabel->setBuddy(_store);

    QGridLayout* topGrid = new QGridLayout(top);
    topGrid->setMargin(3);
    topGrid->setSpacing(3);
    topGrid->setColStretch(2, 1);
    topGrid->addWidget(itemLabel, 0, 0);
    topGrid->addWidget(_item, 0, 1, AlignLeft | AlignVCenter);
    topGrid->addWidget(descLabel, 1, 0);
    topGrid->addWidget(_desc, 1, 1, AlignLeft | AlignVCenter);
    topGrid->addWidget(storeLabel, 2, 0);
    topGrid->addWidget(_store, 2, 1, AlignLeft | AlignVCenter);

    QGroupBox* price = new QGroupBox(tr("Price"), frame);
    QGridLayout* priceGrid = new QGridLayout(price,2,1,price->frameWidth()*2);
    priceGrid->addRowSpacing(0, price->fontMetrics().height());

    QLabel* priceSizeLabel = new QLabel(tr("Size:"), price);
    _priceSize = new ComboBox(price);
    priceSizeLabel->setBuddy(_priceSize);

    QLabel* priceLabel = new QLabel(tr("Price:"), price);
    _price = new PriceEdit(price);
    priceLabel->setBuddy(_price);

    QLabel* priceTaxLabel = new QLabel(tr("Tax:"), price);
    _priceTax = new MoneyEdit(price);
    _priceTax->setFocusPolicy(NoFocus);
    priceTaxLabel->setBuddy(_priceTax);

    QLabel* priceDepositLabel = new QLabel(tr("Deposit:"), price);
    _priceDeposit = new MoneyEdit(price);
    _priceDeposit->setFocusPolicy(NoFocus);
    priceDepositLabel->setBuddy(_priceDeposit);

    QLabel* priceBaseLabel = new QLabel(tr("Base:"), price);
    _priceBase = new MoneyEdit(price);
    priceBaseLabel->setBuddy(_priceBase);

    priceGrid->setColStretch(2, 1);
    priceGrid->addWidget(priceSizeLabel, 1, 0);
    priceGrid->addWidget(_priceSize, 1, 1, AlignLeft | AlignVCenter);
    priceGrid->addWidget(priceLabel, 2, 0);
    priceGrid->addWidget(_price, 2, 1, AlignLeft | AlignVCenter);
    priceGrid->addWidget(priceTaxLabel, 3, 0);
    priceGrid->addWidget(_priceTax, 3, 1, AlignLeft | AlignVCenter);
    priceGrid->addWidget(priceDepositLabel, 4, 0);
    priceGrid->addWidget(_priceDeposit, 4, 1, AlignLeft | AlignVCenter);
    priceGrid->addWidget(priceBaseLabel, 5, 0);
    priceGrid->addWidget(_priceBase, 5, 1, AlignLeft | AlignVCenter);

    QGroupBox* cost = new QGroupBox(tr("Rep Cost"), frame);
    QGridLayout* costGrid = new QGridLayout(cost,2,1,cost->frameWidth()*2);
    costGrid->addRowSpacing(0, cost->fontMetrics().height());

    QLabel* costSizeLabel = new QLabel(tr("Size:"), cost);
    _costSize = new ComboBox(cost);
    costSizeLabel->setBuddy(_costSize);

    QLabel* costLabel = new QLabel(tr("Cost:"), cost);
    _cost = new PriceEdit(cost);
    costLabel->setBuddy(_cost);

    QLabel* costTaxLabel = new QLabel(tr("Tax:"), cost);
    _costTax = new MoneyEdit(cost);
    _costTax->setFocusPolicy(NoFocus);
    costTaxLabel->setBuddy(_costTax);

    QLabel* costDepositLabel = new QLabel(tr("Deposit:"), cost);
    _costDeposit = new MoneyEdit(cost);
    _costDeposit->setFocusPolicy(NoFocus);
    costDepositLabel->setBuddy(_costDeposit);

    QLabel* costBaseLabel = new QLabel(tr("Base:"), cost);
    _costBase = new MoneyEdit(cost);
    costBaseLabel->setBuddy(_costBase);

    costGrid->setColStretch(2, 1);
    costGrid->addWidget(costSizeLabel, 1, 0);
    costGrid->addWidget(_costSize, 1, 1, AlignLeft | AlignVCenter);
    costGrid->addWidget(costLabel, 2, 0);
    costGrid->addWidget(_cost, 2, 1, AlignLeft | AlignVCenter);
    costGrid->addWidget(costTaxLabel, 3, 0);
    costGrid->addWidget(_costTax, 3, 1, AlignLeft | AlignVCenter);
    costGrid->addWidget(costDepositLabel, 4, 0);
    costGrid->addWidget(_costDeposit, 4, 1, AlignLeft | AlignVCenter);
    costGrid->addWidget(costBaseLabel, 5, 0);
    costGrid->addWidget(_costBase, 5, 1, AlignLeft | AlignVCenter);

    QGroupBox* margin = new QGroupBox(tr("Margin"), frame);
    QGridLayout* marginGrid = new QGridLayout(margin, 2, 1,
					      margin->frameWidth()*2);
    marginGrid->addRowSpacing(0, margin->fontMetrics().height());

    QLabel* marginSizeLabel = new QLabel(tr("Size:"), margin);
    _marginSize = new ComboBox(margin);
    marginSizeLabel->setBuddy(_marginSize);

    QLabel* marginPriceLabel = new QLabel(tr("Price:"), margin);
    _marginPrice = new MoneyEdit(margin);
    marginPriceLabel->setBuddy(_marginPrice);

    QLabel* targetLabel = new QLabel(tr("Target GM:"), margin);
    _targetGM = new PercentEdit(margin);
    _targetGM->setFocusPolicy(NoFocus);
    targetLabel->setBuddy(_targetGM);

    QLabel* repCostLabel = new QLabel(tr("Rep Cost:"), margin);
    _repCost = new MoneyEdit(margin);
    repCostLabel->setBuddy(_repCost);

    QLabel* repProfitLabel = new QLabel(tr("Rep Profit:"), margin);
    _repProfit = new MoneyEdit(margin);
    repProfitLabel->setBuddy(_repProfit);

    QLabel* repMarginLabel = new QLabel(tr("Rep Margin:"), margin);
    _repMargin = new PercentEdit(margin);
    repMarginLabel->setBuddy(_repMargin);

    QLabel* lastCostLabel = new QLabel(tr("Last Cost:"), margin);
    _lastCost = new MoneyEdit(margin);
    _lastCost->setFocusPolicy(NoFocus);
    lastCostLabel->setBuddy(_lastCost);

    QLabel* lastProfitLabel = new QLabel(tr("Last Profit:"), margin);
    _lastProfit = new MoneyEdit(margin);
    lastProfitLabel->setBuddy(_lastProfit);

    QLabel* lastMarginLabel = new QLabel(tr("Last Margin:"), margin);
    _lastMargin = new PercentEdit(margin);
    lastMarginLabel->setBuddy(_lastMargin);

    QLabel* avgCostLabel = new QLabel(tr("Avg Cost:"), margin);
    _avgCost = new MoneyEdit(margin);
    _avgCost->setFocusPolicy(NoFocus);
    avgCostLabel->setBuddy(_avgCost);

    QLabel* avgProfitLabel = new QLabel(tr("Avg Profit:"), margin);
    _avgProfit = new MoneyEdit(margin);
    avgProfitLabel->setBuddy(_avgProfit);

    QLabel* avgMarginLabel = new QLabel(tr("Avg Margin:"), margin);
    _avgMargin = new PercentEdit(margin);
    avgMarginLabel->setBuddy(_avgMargin);

    marginGrid->setColStretch(2, 1);
    marginGrid->setColStretch(5, 1);
    marginGrid->addColSpacing(2, 10);
    marginGrid->addColSpacing(5, 10);
    marginGrid->addWidget(marginSizeLabel, 1, 0);
    marginGrid->addWidget(_marginSize, 1, 1, AlignLeft | AlignVCenter);
    marginGrid->addWidget(marginPriceLabel, 1, 3);
    marginGrid->addWidget(_marginPrice, 1, 4, AlignLeft | AlignVCenter);
    marginGrid->addWidget(targetLabel, 1, 6);
    marginGrid->addWidget(_targetGM, 1, 7, AlignLeft | AlignVCenter);
    marginGrid->addWidget(repCostLabel, 2, 0);
    marginGrid->addWidget(_repCost, 2, 1, AlignLeft | AlignVCenter);
    marginGrid->addWidget(repProfitLabel, 2, 3);
    marginGrid->addWidget(_repProfit, 2, 4, AlignLeft | AlignVCenter);
    marginGrid->addWidget(repMarginLabel, 2, 6);
    marginGrid->addWidget(_repMargin, 2, 7, AlignLeft | AlignVCenter);
    marginGrid->addWidget(lastCostLabel, 3, 0);
    marginGrid->addWidget(_lastCost, 3, 1, AlignLeft | AlignVCenter);
    marginGrid->addWidget(lastProfitLabel, 3, 3);
    marginGrid->addWidget(_lastProfit, 3, 4, AlignLeft | AlignVCenter);
    marginGrid->addWidget(lastMarginLabel, 3, 6);
    marginGrid->addWidget(_lastMargin, 3, 7, AlignLeft | AlignVCenter);
    marginGrid->addWidget(avgCostLabel, 4, 0);
    marginGrid->addWidget(_avgCost, 4, 1, AlignLeft | AlignVCenter);
    marginGrid->addWidget(avgProfitLabel, 4, 3);
    marginGrid->addWidget(_avgProfit, 4, 4, AlignLeft | AlignVCenter);
    marginGrid->addWidget(avgMarginLabel, 4, 6);
    marginGrid->addWidget(_avgMargin, 4, 7, AlignLeft | AlignVCenter);

    QFrame* box = new QFrame(frame);

    QPushButton* refresh = new QPushButton(tr("&Refresh"), box);
    refresh->setMinimumSize(refresh->sizeHint());
    connect(refresh, SIGNAL(clicked()), SLOT(slotRefresh()));

    QPushButton* save = new QPushButton(tr("&Save"), box);
    save->setMinimumSize(refresh->sizeHint());
    connect(save, SIGNAL(clicked()), SLOT(slotSave()));

    QPushButton* close = new QPushButton(tr("Cl&ose"), box);
    close->setMinimumSize(refresh->sizeHint());
    connect(close, SIGNAL(clicked()), SLOT(slotClose()));

    QGridLayout* boxGrid = new QGridLayout(box);
    boxGrid->setSpacing(6);
    boxGrid->setMargin(6);
    boxGrid->setColStretch(1, 1);
    boxGrid->addWidget(refresh, 0, 0, AlignLeft | AlignVCenter);
    boxGrid->addWidget(save, 0, 1, AlignRight | AlignVCenter);
    boxGrid->addWidget(close, 0, 2, AlignRight | AlignVCenter);

    QGridLayout* grid = new QGridLayout(frame);
    grid->setSpacing(6);
    grid->setMargin(6);
    grid->addMultiCellWidget(top, 0, 0, 0, 1);
    grid->addWidget(price, 1, 0);
    grid->addWidget(cost, 1, 1);
    grid->addMultiCellWidget(margin, 2, 2, 0, 1);
    grid->addMultiCellWidget(box, 3, 3, 0, 1);

    connect(_item, SIGNAL(validData()), SLOT(slotItemChanged()));
    connect(_store, SIGNAL(validData()), SLOT(slotStoreChanged()));
    connect(_priceSize, SIGNAL(activated(int)), SLOT(slotPriceSizeChanged()));
    connect(_price, SIGNAL(validData()), SLOT(slotPriceChanged()));
    connect(_priceBase, SIGNAL(validData()), SLOT(slotPriceBaseChanged()));
    connect(_costSize, SIGNAL(activated(int)), SLOT(slotCostSizeChanged()));
    connect(_cost, SIGNAL(validData()), SLOT(slotCostChanged()));
    connect(_costBase, SIGNAL(validData()), SLOT(slotCostBaseChanged()));
    connect(_marginSize, SIGNAL(activated(int)),SLOT(slotMarginSizeChanged()));
    connect(_marginPrice, SIGNAL(validData()), SLOT(slotMarginPriceChanged()));
    connect(_repCost, SIGNAL(validData()), SLOT(slotRepCostChanged()));
    connect(_repProfit, SIGNAL(validData()), SLOT(slotRepProfitChanged()));
    connect(_repMargin, SIGNAL(validData()), SLOT(slotRepMarginChanged()));
    connect(_lastProfit, SIGNAL(validData()), SLOT(slotLastProfitChanged()));
    connect(_lastMargin, SIGNAL(validData()), SLOT(slotLastMarginChanged()));
    connect(_avgProfit, SIGNAL(validData()), SLOT(slotAvgProfitChanged()));
    connect(_avgMargin, SIGNAL(validData()), SLOT(slotAvgMarginChanged()));

    setStoreId(_quasar->defaultStore());
    _item->setFocus();

    setCentralWidget(frame);
    setCaption(tr("Item Margin"));
    finalize();
}
Exemplo n.º 8
0
CardTransfer::CardTransfer(MainWindow* main, Id transfer_id)
    : DataWindow(main, "CardTransfer", transfer_id)
{
    _helpSource = "card_transfer.html";

    // Create widgets
    _gltxFrame = new GltxFrame(main, tr("Transfer No."), _frame);
    _gltxFrame->setTitle(tr("From"));
    _gltxFrame->hideMemo();

    QFrame* mid = new QFrame(_frame);
    mid->setFrameStyle(QFrame::Raised | QFrame::Panel);

    QLabel* fromLabel = new QLabel(tr("From:"), mid);
    CardLookup* fromLookup = new CardLookup(main, this);
    fromLookup->type->setCurrentItem(tr("Customer and Vendor"));
    fromLookup->type->setEnabled(false);
    _from = new LookupEdit(fromLookup, mid);
    _from->setLength(30);
    fromLabel->setBuddy(_from);
    connect(_from, SIGNAL(validData()), SLOT(slotFromChanged()));

    QLabel* fromBalanceLabel = new QLabel(tr("Balance:"), mid);
    _fromBalance = new MoneyEdit(mid);
    _fromBalance->setFocusPolicy(NoFocus);

    QLabel* toLabel = new QLabel(tr("To:"), mid);
    CardLookup* toLookup = new CardLookup(main, this);
    toLookup->type->setCurrentItem(tr("Customer and Vendor"));
    toLookup->type->setEnabled(false);
    _to = new LookupEdit(toLookup, mid);
    _to->setLength(30);
    toLabel->setBuddy(_to);
    connect(_to, SIGNAL(validData()), SLOT(slotToChanged()));

    QLabel* toBalanceLabel = new QLabel(tr("Balance:"), mid);
    _toBalance = new MoneyEdit(mid);
    _toBalance->setFocusPolicy(NoFocus);

    QLabel* amountLabel = new QLabel(tr("Amount:"), mid);
    _amount = new MoneyEdit(mid);
    amountLabel->setBuddy(_amount);

    QLabel* memoLabel = new QLabel(tr("&Memo:"), mid);
    _memo = new LineEdit(mid);
    _memo->setMaxLength(40);
    _memo->setMinimumWidth(_memo->fontMetrics().width('x') * 40);
    memoLabel->setBuddy(_memo);

    QGridLayout* midGrid = new QGridLayout(mid);
    midGrid->setSpacing(3);
    midGrid->setMargin(3);
    midGrid->setColStretch(2, 1);
    midGrid->addWidget(fromLabel, 0, 0);
    midGrid->addWidget(_from, 0, 1, AlignLeft | AlignVCenter);
    midGrid->addWidget(fromBalanceLabel, 0, 2, AlignRight | AlignVCenter);
    midGrid->addWidget(_fromBalance, 0, 3, AlignLeft | AlignVCenter);
    midGrid->addWidget(toLabel, 1, 0);
    midGrid->addWidget(_to, 1, 1, AlignLeft | AlignVCenter);
    midGrid->addWidget(toBalanceLabel, 1, 2, AlignRight | AlignVCenter);
    midGrid->addWidget(_toBalance, 1, 3, AlignLeft | AlignVCenter);
    midGrid->addWidget(amountLabel, 2, 0);
    midGrid->addWidget(_amount, 2, 1, AlignLeft | AlignVCenter);
    midGrid->addWidget(memoLabel, 3, 0);
    midGrid->addMultiCellWidget(_memo, 3, 3, 1, 3);

    QGroupBox* to = new QGroupBox(tr("To"), _frame);

    QLabel* toNumberLabel = new QLabel(tr("Transfer No."), to);
    _toNumber = new LineEdit(9, to);
    toNumberLabel->setBuddy(_toNumber);

    QLabel* toShiftLabel = new QLabel(tr("Shift:"), to);
    _toShift = new LookupEdit(new GltxLookup(_main, this, DataObject::SHIFT),
			       to);
    _toShift->setLength(10);
    _toShift->setFocusPolicy(ClickFocus);
    toShiftLabel->setBuddy(_toShift);

    QGridLayout* toGrid = new QGridLayout(to, 1, 1, to->frameWidth() * 2);
    toGrid->setSpacing(3);
    toGrid->setMargin(6);
    toGrid->setColStretch(2, 1);
    toGrid->addColSpacing(2, 10);
    toGrid->addRowSpacing(0, to->fontMetrics().height());
    toGrid->addWidget(toNumberLabel, 1, 0);
    toGrid->addWidget(_toNumber, 1, 1, AlignLeft | AlignVCenter);
    toGrid->addWidget(toShiftLabel, 1, 3);
    toGrid->addWidget(_toShift, 1, 4, AlignLeft | AlignVCenter);

    QLabel* accountLabel = new QLabel(tr("Transfer Account:"), _frame);
    AccountLookup* lookup = new AccountLookup(main, this, Account::Expense);
    _account = new LookupEdit(lookup, _frame);
    _account->setLength(30);
    accountLabel->setBuddy(_account);

    _inactive->setText(tr("Voided?"));

    QGridLayout* grid = new QGridLayout(_frame);
    grid->setSpacing(3);
    grid->setMargin(3);
    grid->setColStretch(2, 1);
    grid->setRowStretch(1, 1);
    grid->addMultiCellWidget(_gltxFrame, 0, 0, 0, 4);
    grid->addMultiCellWidget(mid, 1, 1, 0, 4);
    grid->addMultiCellWidget(to, 2, 2, 0, 4);
    grid->addWidget(accountLabel, 3, 0);
    grid->addWidget(_account, 3, 1, AlignLeft | AlignVCenter);

    setCaption(tr("Card Transfer"));
    finalize();
}
Exemplo n.º 9
0
CustomerMaster::CustomerMaster(MainWindow* main, Id customer_id)
    : DataWindow(main, "CustomerMaster", customer_id)
{
    _helpSource = "customer_master.html";

    QPushButton* email = new QPushButton(tr("Email"), _buttons);
    connect(email, SIGNAL(clicked()), SLOT(slotEmail()));

    // Create widgets
    _company = new QCheckBox(tr("&Company?"), _frame);
    connect(_company, SIGNAL(toggled(bool)), SLOT(companyChanged(bool)));

    _label1 = new QLabel(_frame);
    _entry1 = new LineEdit(30, _frame);
    _label1->setBuddy(_entry1);

    _label2 = new QLabel(_frame);
    _entry2 = new LineEdit(30, _frame);
    _label2->setBuddy(_entry2);

    QLabel* numberLabel = new QLabel(tr("Number:"), _frame);
    _number = new LineEdit(12, _frame);
    numberLabel->setBuddy(_number);

    QLabel* typeLabel = new QLabel(tr("Type:"), _frame);
    _type = new LookupEdit(new CustomerTypeLookup(_main, this), _frame);
    _type->setSizeInfo(12, 'x');
    _type->setMinCharWidth(12);
    _type->setMaxLength(20);
    typeLabel->setBuddy(_type);
    connect(_type, SIGNAL(validData()), this, SLOT(typeChanged()));

    QGroupBox* addr = new QGroupBox(tr("Address"), _frame);
    QGridLayout* grid1 = new QGridLayout(addr, 7, 4,
                                         addr->frameWidth() * 2);
    grid1->addRowSpacing(0, addr->fontMetrics().height());
    grid1->setColStretch(2, 1);

    QLabel* streetLabel = new QLabel(tr("Street:"), addr);
    _street = new LineEdit(addr);
    _street->setLength(60);
    streetLabel->setBuddy(_street);

    _street2 = new LineEdit(addr);
    _street2->setLength(60);

    QLabel* cityLabel = new QLabel(tr("City:"), addr);
    _city = new LineEdit(20, addr);
    cityLabel->setBuddy(_city);

    QLabel* provLabel = new QLabel(tr("Prov/State:"), addr);
    _province = new LineEdit(20, addr);
    provLabel->setBuddy(_province);

    QLabel* postalLabel = new QLabel(tr("Postal/Zip:"), addr);
    _postal = new LineEdit(20, addr);
    postalLabel->setBuddy(_postal);

    QLabel* countryLabel = new QLabel(tr("Country:"), addr);
    _country = new LineEdit(20, addr);
    countryLabel->setBuddy(_country);

    QLabel* phoneLabel = new QLabel(tr("Phone #:"), addr);
    _phone_num = new LineEdit(20, addr);
    phoneLabel->setBuddy(_phone_num);

    QLabel* phone2Label = new QLabel(tr("Phone2 #:"), addr);
    _phone2_num = new LineEdit(20, addr);
    phone2Label->setBuddy(_phone2_num);

    QLabel* faxLabel = new QLabel(tr("Fax #:"), addr);
    _fax_num = new LineEdit(20, addr);
    faxLabel->setBuddy(_fax_num);

    QLabel* emailLabel = new QLabel(tr("Email:"), addr);
    _email = new LineEdit(60, addr);
    emailLabel->setBuddy(_email);

    QLabel* webLabel = new QLabel(tr("Web Page:"), addr);
    _web_page = new LineEdit(60,addr);
    webLabel->setBuddy(_web_page);

    grid1->addWidget(streetLabel, 1, 0);
    grid1->addMultiCellWidget(_street, 1, 1, 1, 4, AlignLeft | AlignVCenter);
    grid1->addMultiCellWidget(_street2, 2, 2, 1, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(cityLabel, 3, 0);
    grid1->addWidget(_city, 3, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(provLabel, 3, 3);
    grid1->addWidget(_province, 3, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(postalLabel, 4, 0);
    grid1->addWidget(_postal, 4, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(countryLabel, 4, 3);
    grid1->addWidget(_country, 4, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(phoneLabel, 5, 0);
    grid1->addWidget(_phone_num, 5, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(phone2Label, 5, 3);
    grid1->addWidget(_phone2_num, 5, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(faxLabel, 6, 0);
    grid1->addWidget(_fax_num, 6, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(emailLabel, 7, 0);
    grid1->addMultiCellWidget(_email, 7, 7, 1, 4, AlignLeft | AlignVCenter);
    grid1->addWidget(webLabel, 8, 0);
    grid1->addMultiCellWidget(_web_page, 8, 8, 1, 4, AlignLeft | AlignVCenter);

    QTabWidget* tabs = new QTabWidget(_frame);
    QFrame* control = new QFrame(tabs);
    QFrame* groupTab = new QFrame(tabs);
    QFrame* trans = new QFrame(tabs);
    QFrame* refsTab = new QFrame(tabs);
    QFrame* extraTab = new QFrame(tabs);
    tabs->addTab(control, tr("Control"));
    tabs->addTab(groupTab, tr("Groups"));
    tabs->addTab(trans, tr("Transactions"));
    tabs->addTab(refsTab, tr("References"));
    tabs->addTab(extraTab, tr("Extra Info"));

    QLabel* patgroupLabel = new QLabel(tr("Patronage Group:"), control);
    _patgroup_id = new LookupEdit(new PatGroupLookup(main, this), control);
    _patgroup_id->setLength(20);
    _patgroup_id->setFocusPolicy(NoFocus);
    patgroupLabel->setBuddy(_patgroup_id);

    QLabel* accountLabel = new QLabel(tr("AR Account:"), control);
    _account_id = new LookupEdit(new AccountLookup(main, this, Account::AR),
                                 control);
    _account_id->setLength(30);
    accountLabel->setBuddy(_account_id);

    QLabel* termLabel = new QLabel(tr("Terms:"), control);
    _term_id = new LookupEdit(new TermLookup(main, this), control);
    _term_id->setLength(30);
    termLabel->setBuddy(_term_id);

    QLabel* exemptLabel = new QLabel(tr("Tax Exempt:"), control);
    _exempt_id = new LookupEdit(new TaxLookup(main, this), control);
    _exempt_id->setLength(30);
    exemptLabel->setBuddy(_exempt_id);

    QLabel* creditLabel = new QLabel(tr("Credit Limit:"), control);
    _credit_limit = new MoneyEdit(control);
    _credit_limit->setLength(14);
    creditLabel->setBuddy(_credit_limit);

    _credit_hold = new QCheckBox(tr("Credit Hold?"), control);

    QLabel* scLabel = new QLabel(tr("Service Charge:"), control);
    _sc_rate = new PercentEdit(control);
    _sc_rate->setLength(8);
    scLabel->setBuddy(_sc_rate);

    _print_stmts = new QCheckBox(tr("Statements?"), control);

    QGridLayout* conGrid = new QGridLayout(control);
    conGrid->setSpacing(3);
    conGrid->setMargin(3);
    conGrid->setColStretch(3, 1);
    conGrid->addWidget(patgroupLabel, 0, 0);
    conGrid->addMultiCellWidget(_patgroup_id, 0,0,1,2,AlignLeft|AlignVCenter);
    conGrid->addWidget(accountLabel, 1, 0);
    conGrid->addMultiCellWidget(_account_id, 1,1,1,2,AlignLeft|AlignVCenter);
    conGrid->addWidget(termLabel, 2, 0);
    conGrid->addMultiCellWidget(_term_id, 2, 2, 1, 2, AlignLeft|AlignVCenter);
    conGrid->addWidget(exemptLabel, 3, 0);
    conGrid->addMultiCellWidget(_exempt_id, 3, 3, 1, 2,AlignLeft|AlignVCenter);
    conGrid->addWidget(creditLabel, 4, 0);
    conGrid->addWidget(_credit_limit, 4, 1, AlignLeft | AlignVCenter);
    conGrid->addWidget(_credit_hold, 4, 2, AlignLeft | AlignVCenter);
    conGrid->addWidget(scLabel, 5, 0);
    conGrid->addWidget(_sc_rate, 5, 1, AlignLeft | AlignVCenter);
    conGrid->addWidget(_print_stmts, 5, 2, AlignLeft | AlignVCenter);

    _groups = new Table(groupTab);
    _groups->setVScrollBarMode(QScrollView::AlwaysOn);
    _groups->setDisplayRows(2);
    _groups->setLeftMargin(fontMetrics().width("999"));
    connect(_groups, SIGNAL(cellChanged(int,int,Variant)),
            SLOT(groupCellChanged(int,int,Variant)));

    GroupLookup* groupLookup = new GroupLookup(_main, this, Group::CUSTOMER);
    new LookupColumn(_groups, tr("Group Name"), 20, groupLookup);
    new LookupEditor(_groups, 0, new LookupEdit(groupLookup, _groups));

    QGridLayout* groupGrid = new QGridLayout(groupTab);
    groupGrid->setSpacing(6);
    groupGrid->setMargin(3);
    groupGrid->setRowStretch(0, 1);
    groupGrid->setColStretch(0, 1);
    groupGrid->addWidget(_groups, 0, 0);

    _charge = new QCheckBox(tr("Can Charge?"), trans);
    _withdraw = new QCheckBox(tr("Can Withdraw?"), trans);
    _payment = new QCheckBox(tr("Can Make Payment?"), trans);
    _check_bal = new QCheckBox(tr("Check Withdraw Balance?"), trans);
    _second_rcpt = new QCheckBox(tr("Second Receipt?"), trans);

    _discs = new Table(trans);
    _discs->setVScrollBarMode(QScrollView::AlwaysOn);
    _discs->setDisplayRows(2);
    _discs->setLeftMargin(fontMetrics().width("999"));
    connect(_discs, SIGNAL(cellChanged(int,int,Variant)),
            SLOT(discountCellChanged(int,int,Variant)));

    DiscountLookup* discLookup = new DiscountLookup(_main, this);
    discLookup->txOnly = true;
    new LookupColumn(_discs, tr("Discount"), 20, discLookup);
    new LookupEditor(_discs, 0, new LookupEdit(discLookup, _discs));

    QGridLayout* transGrid = new QGridLayout(trans);
    transGrid->setSpacing(6);
    transGrid->setMargin(3);
    transGrid->setRowStretch(5, 1);
    transGrid->setColStretch(1, 1);
    transGrid->addWidget(_charge, 0, 0, AlignLeft | AlignVCenter);
    transGrid->addWidget(_withdraw, 1, 0, AlignLeft | AlignVCenter);
    transGrid->addWidget(_payment, 2, 0, AlignLeft | AlignVCenter);
    transGrid->addWidget(_check_bal, 3, 0, AlignLeft | AlignVCenter);
    transGrid->addWidget(_second_rcpt, 4, 0, AlignLeft | AlignVCenter);
    transGrid->addMultiCellWidget(_discs, 0, 5, 2, 2);

    _refs = new Table(refsTab);
    _refs->setVScrollBarMode(QScrollView::AlwaysOn);
    _refs->setDisplayRows(2);
    _refs->setLeftMargin(fontMetrics().width("999"));
    connect(_refs, SIGNAL(cellChanged(int,int,Variant)),
            SLOT(refCellChanged(int,int,Variant)));

    new TextColumn(_refs, tr("Reference"), 16);
    LineEdit* refEdit = new LineEdit(_refs);
    refEdit->setMaxLength(16);
    new LineEditor(_refs, 0, refEdit);

    QGridLayout* refGrid = new QGridLayout(refsTab);
    refGrid->setSpacing(6);
    refGrid->setMargin(3);
    refGrid->setRowStretch(0, 1);
    refGrid->setColStretch(0, 1);
    refGrid->addWidget(_refs, 0, 0);

    _extra = new Table(extraTab);
    _extra->setVScrollBarMode(QScrollView::AlwaysOn);
    _extra->setDisplayRows(2);
    _extra->setLeftMargin(fontMetrics().width("999"));
    connect(_extra, SIGNAL(focusNext(bool&,int&,int&,int)),
            SLOT(extraFocusNext(bool&,int&,int&,int)));

    ExtraLookup* extraLookup = new ExtraLookup(_main, this, "Customer");

    new LookupColumn(_extra, tr("Data Name"), 30, extraLookup);
    new TextColumn(_extra, tr("Value"), 30);

    new LineEditor(_extra, 1, new LineEdit(_extra));

    QPushButton* createData = new QPushButton(tr("Create Data"), extraTab);
    QPushButton* deleteData = new QPushButton(tr("Delete Data"), extraTab);
    QPushButton* renameData = new QPushButton(tr("Rename Data"), extraTab);

    connect(createData, SIGNAL(clicked()), SLOT(slotCreateData()));
    connect(deleteData, SIGNAL(clicked()), SLOT(slotDeleteData()));
    connect(renameData, SIGNAL(clicked()), SLOT(slotRenameData()));

    QGridLayout* extraGrid = new QGridLayout(extraTab);
    extraGrid->setSpacing(6);
    extraGrid->setMargin(3);
    extraGrid->setRowStretch(0, 1);
    extraGrid->setColStretch(0, 1);
    extraGrid->addMultiCellWidget(_extra, 0, 0, 0, 3);
    extraGrid->addWidget(createData, 1, 1);
    extraGrid->addWidget(deleteData, 1, 2);
    extraGrid->addWidget(renameData, 1, 3);

    _open_bal = new QGroupBox(tr("Opening Balance"), _frame);
    QGridLayout* i_grid = new QGridLayout(_open_bal, 2, 2,
                                          _open_bal->frameWidth() * 2);
    i_grid->addRowSpacing(0, _open_bal->fontMetrics().height());

    QLabel* asOfLabel = new QLabel(tr("As of"), _open_bal);
    _as_of = new DatePopup(_open_bal);
    asOfLabel->setBuddy(_as_of);

    QLabel* openBalLabel = new QLabel(tr("Balance:"), _open_bal);
    _open_balance = new MoneyEdit(_open_bal);
    _open_balance->setLength(20);
    openBalLabel->setBuddy(_open_balance);

    i_grid->setColStretch(2, 1);
    i_grid->addWidget(asOfLabel, 1, 0, AlignLeft);
    i_grid->addWidget(_as_of, 2, 0, AlignLeft | AlignVCenter);
    i_grid->addWidget(openBalLabel, 1, 1, AlignLeft);
    i_grid->addWidget(_open_balance, 2, 1, AlignLeft | AlignVCenter);

    Company company;
    _quasar->db()->lookup(company);
    if (_id != INVALID_ID || company.historicalBalancing() == INVALID_ID)
        _open_bal->hide();

    QGridLayout* grid = new QGridLayout(_frame);
    grid->setSpacing(3);
    grid->setMargin(3);
    grid->setRowStretch(4, 1);
    grid->setColStretch(2, 1);
    grid->addColSpacing(2, 10);
    grid->addWidget(_company, 0, 0);
    grid->addWidget(_label1, 1, 0, AlignLeft | AlignVCenter);
    grid->addWidget(_entry1, 1, 1, AlignLeft | AlignVCenter);
    grid->addWidget(_label2, 2, 0, AlignLeft | AlignVCenter);
    grid->addWidget(_entry2, 2, 1, AlignLeft | AlignVCenter);
    grid->addWidget(numberLabel, 1, 3, AlignLeft | AlignVCenter);
    grid->addWidget(_number, 1, 4, AlignLeft | AlignVCenter);
    grid->addWidget(typeLabel, 2, 3, AlignLeft | AlignVCenter);
    grid->addWidget(_type, 2, 4, AlignLeft | AlignVCenter);
    grid->addMultiCellWidget(addr, 3, 3, 0, 4);
    grid->addMultiCellWidget(tabs, 4, 4, 0, 4);
    grid->addMultiCellWidget(_open_bal, 5, 5, 0, 4);

    setCaption(tr("Customer Master"));
    finalize();
}
Exemplo n.º 10
0
QuasarConfig::QuasarConfig(MainWindow* main)
    : QuasarWindow(main, "QuasarConfig"), _styleChanged(false)
{
    _helpSource = "quasar_config.html";

    QFrame* frame = new QFrame(this);

    _areas = new QListView(frame);
    _stack = new QWidgetStack(frame);

    _display = new QFrame(_stack);
    _i18n = new QFrame(_stack);

    _changeStyle = new QCheckBox(tr("Change Style?"), _display);
    _changeStyle->setMinimumSize(_changeStyle->sizeHint());
    connect(_changeStyle, SIGNAL(toggled(bool)), SLOT(slotChangeStyle(bool)));

    _style = new ComboBox(_display);
    _style->insertItem("");
    _style->insertStringList(QStyleFactory::keys());

    _changeColor = new QCheckBox(tr("Change Color?"), _display);
    _changeColor->setMinimumSize(_changeColor->sizeHint());
    connect(_changeColor, SIGNAL(toggled(bool)), SLOT(slotChangeColor(bool)));

    _color = new QPushButton(tr("New Color"), _display);
    connect(_color, SIGNAL(clicked()), SLOT(slotPickColor()));

    _changeFont = new QCheckBox(tr("Change Font?"), _display);
    _changeFont->setMinimumSize(_changeFont->sizeHint());
    connect(_changeFont, SIGNAL(toggled(bool)), SLOT(slotChangeFont(bool)));

    _font = new QPushButton(tr("Push To Choose"), _display);
    connect(_font, SIGNAL(clicked()), SLOT(slotPickFont()));

    QGridLayout* displayGrid = new QGridLayout(_display);
    displayGrid->setSpacing(3);
    displayGrid->setMargin(3);
    displayGrid->setRowStretch(3, 1);
    displayGrid->setColStretch(2, 1);
    displayGrid->addWidget(_changeStyle, 0, 0);
    displayGrid->addWidget(_style, 0, 1);
    displayGrid->addWidget(_changeColor, 1, 0);
    displayGrid->addWidget(_color, 1, 1);
    displayGrid->addWidget(_changeFont, 2, 0);
    displayGrid->addWidget(_font, 2, 1);

    QLabel* localeLabel = new QLabel(tr("Locale:"), _i18n);
    _locale = new ComboBox(_i18n);
    _locale->setMinimumWidth(_locale->fontMetrics().width("x") * 30);
    localeLabel->setBuddy(_locale);
    connect(_locale, SIGNAL(activated(int)), SLOT(slotLocaleChange()));

    QGroupBox* samples = new QGroupBox(tr("Data Formats"), _i18n);

    QLabel* positiveLabel = new QLabel(tr("Positive"), samples);
    QLabel* negativeLabel = new QLabel(tr("Negative"), samples);

    QLabel* numLabel = new QLabel(tr("Number:"), samples);
    _numberPosSample = new QLabel(samples);
    _numberNegSample = new QLabel(samples);

    QLabel* moneyLabel = new QLabel(tr("Currency:"), samples);
    _moneyPosSample = new QLabel(samples);
    _moneyNegSample = new QLabel(samples);

    QLabel* percentLabel = new QLabel(tr("Percent:"), samples);
    _percentPosSample = new QLabel(samples);
    _percentNegSample = new QLabel(samples);

    QLabel* dateLabel = new QLabel(tr("Date:"), samples);
    _dateSample = new QLabel(samples);

    QLabel* timeLabel = new QLabel(tr("Time:"), samples);
    _timeSample = new QLabel(samples);

    QGridLayout* sampleGrid = new QGridLayout(samples);
    sampleGrid->addRowSpacing(0, samples->fontMetrics().height());
    sampleGrid->setSpacing(3);
    sampleGrid->setMargin(10);
    sampleGrid->setColStretch(1, 1);
    sampleGrid->setColStretch(2, 1);
    sampleGrid->setRowStretch(3, 1);
    sampleGrid->addRowSpacing(3, 20);
    sampleGrid->addWidget(dateLabel, 1, 0);
    sampleGrid->addWidget(_dateSample, 1, 1, AlignRight|AlignVCenter);
    sampleGrid->addWidget(timeLabel, 2, 0);
    sampleGrid->addWidget(_timeSample, 2, 1, AlignRight|AlignVCenter);
    sampleGrid->addWidget(positiveLabel, 4, 1, AlignRight|AlignVCenter);
    sampleGrid->addWidget(negativeLabel, 4, 2, AlignRight|AlignVCenter);
    sampleGrid->addWidget(numLabel, 5, 0);
    sampleGrid->addWidget(_numberPosSample, 5, 1, AlignRight|AlignVCenter);
    sampleGrid->addWidget(_numberNegSample, 5, 2, AlignRight|AlignVCenter);
    sampleGrid->addWidget(moneyLabel, 6, 0);
    sampleGrid->addWidget(_moneyPosSample, 6, 1, AlignRight|AlignVCenter);
    sampleGrid->addWidget(_moneyNegSample, 6, 2, AlignRight|AlignVCenter);
    sampleGrid->addWidget(percentLabel, 7, 0);
    sampleGrid->addWidget(_percentPosSample, 7, 1, AlignRight|AlignVCenter);
    sampleGrid->addWidget(_percentNegSample, 7, 2, AlignRight|AlignVCenter);

    QGridLayout* i18nGrid = new QGridLayout(_i18n);
    i18nGrid->setSpacing(3);
    i18nGrid->setMargin(3);
    i18nGrid->addRowSpacing(1, 20);
    i18nGrid->setRowStretch(2, 1);
    i18nGrid->setColStretch(2, 1);
    i18nGrid->addWidget(localeLabel, 0, 0);
    i18nGrid->addWidget(_locale, 0, 1, AlignLeft | AlignVCenter);
    i18nGrid->addMultiCellWidget(samples, 2, 2, 0, 2);

    _stack->addWidget(_display, 0);
    _stack->addWidget(_i18n, 1);

    _areas->addColumn(tr("Area"), -1);
    _areas->setSorting(-1);
    _areas->header()->hide();
    connect(_areas, SIGNAL(selectionChanged()), SLOT(slotAreaChange()));

    QListViewItem* user = new QListViewItem(_areas, tr("User Configuration"));

    user->setOpen(true);
    new QListViewItem(user, tr("Internationalization"));
    QListViewItem* displayArea = new QListViewItem(user, tr("Display"));

    QFrame* buttons = new QFrame(frame);
    QPushButton* ok = new QPushButton(tr("&OK"), buttons);
    QPushButton* apply = new QPushButton(tr("&Apply"), buttons);
    QPushButton* defaults = new QPushButton(tr("&Defaults"), buttons);
    QPushButton* cancel = new QPushButton(tr("&Cancel"), buttons);

    ok->setMinimumSize(defaults->sizeHint());
    apply->setMinimumSize(defaults->sizeHint());
    defaults->setMinimumSize(defaults->sizeHint());
    cancel->setMinimumSize(defaults->sizeHint());

    connect(ok, SIGNAL(clicked()), SLOT(slotOk()));
    connect(apply, SIGNAL(clicked()), SLOT(slotApply()));
    connect(defaults, SIGNAL(clicked()), SLOT(slotDefaults()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(slotCancel()));

    QGridLayout* buttonGrid = new QGridLayout(buttons);
    buttonGrid->setSpacing(3);
    buttonGrid->setMargin(3);
    buttonGrid->setColStretch(0, 1);
    buttonGrid->addWidget(ok, 0, 1);
    buttonGrid->addWidget(apply, 0, 2);
    buttonGrid->addWidget(defaults, 0, 3);
    buttonGrid->addWidget(cancel, 0, 4);

    QGridLayout* grid = new QGridLayout(frame);
    grid->setSpacing(3);
    grid->setMargin(3);
    grid->setColStretch(1, 1);
    grid->addWidget(_areas, 0, 0);
    grid->addWidget(_stack, 0, 1);
    grid->addMultiCellWidget(buttons, 1, 1, 0, 1);

    _config.load();
    _locales = Locale::getAvailableLocales(_localesCnt);

    slotDefaults();
    _areas->setCurrentItem(displayArea);
    _stack->raiseWidget(_display);
    _changeStyle->setFocus();

    setCentralWidget(frame);
    setCaption(tr("Quasar Configuration"));
    finalize();
}
Exemplo n.º 11
0
SubdeptMaster::SubdeptMaster(MainWindow* main, Id subdept_id)
    : DataWindow(main, "SubdeptMaster", subdept_id)
{
    _helpSource = "subdept_master.html";

    // Create widgets
    QLabel* nameLabel = new QLabel(tr("&Name:"), _frame);
    _name = new LineEdit(30, _frame);
    nameLabel->setBuddy(_name);

    QLabel* numberLabel = new QLabel(tr("Number:"), _frame);
    _number = new LineEdit(5, _frame);
    numberLabel->setBuddy(_number);

    QLabel* deptLabel = new QLabel(tr("&Department:"), _frame);
    _dept = new LookupEdit(new DeptLookup(main, this), _frame);
    _dept->setLength(30);
    deptLabel->setBuddy(_dept);

    QGroupBox* flags = new QGroupBox(tr("Type"), _frame);
    QGridLayout* f_grid = new QGridLayout(flags, 2, 2,
					  flags->frameWidth() * 2);
    f_grid->addRowSpacing(0, flags->fontMetrics().height());

    _purchased = new QCheckBox(tr("Purchased?"), flags);
    _sold = new QCheckBox(tr("Sold?"), flags);
    _inventoried = new QCheckBox(tr("Inventoried?"), flags);

    _expenseLabel = new QLabel(tr("COGS Account:"), flags);
    _expenseLookup = new AccountLookup(main, this, Account::COGS);
    _expense_acct = new LookupEdit(_expenseLookup, flags);
    _expense_acct->setLength(30);
    _expenseLabel->setBuddy(_expense_acct);

    QLabel* incomeLabel = new QLabel(tr("Income Account:"), flags);
    AccountLookup* il = new AccountLookup(main, this, Account::Income);
    _income_acct = new LookupEdit(il, flags);
    _income_acct->setLength(30);
    incomeLabel->setBuddy(_income_acct);

    QLabel* assetLabel = new QLabel(tr("Asset Account:"), flags);
    AccountLookup* al = new AccountLookup(main, this, Account::Inventory);
    _asset_acct = new LookupEdit(al, flags);
    _asset_acct->setLength(30);
    assetLabel->setBuddy(_asset_acct);

    connect(_purchased, SIGNAL(toggled(bool)), SLOT(flagsChanged()));
    connect(_sold, SIGNAL(toggled(bool)), SLOT(flagsChanged()));
    connect(_inventoried, SIGNAL(toggled(bool)), SLOT(flagsChanged()));

    f_grid->setColStretch(1, 1);
    f_grid->addWidget(_purchased, 1, 0, AlignLeft | AlignVCenter);
    f_grid->addWidget(_sold, 2, 0, AlignLeft | AlignVCenter);
    f_grid->addWidget(_inventoried, 3, 0, AlignLeft | AlignVCenter);
    f_grid->addWidget(_expenseLabel, 1, 1, AlignRight | AlignVCenter);
    f_grid->addWidget(_expense_acct, 1, 2, AlignLeft | AlignVCenter);
    f_grid->addWidget(incomeLabel, 2, 1, AlignRight | AlignVCenter);
    f_grid->addWidget(_income_acct, 2, 2, AlignLeft | AlignVCenter);
    f_grid->addWidget(assetLabel, 3, 1, AlignRight | AlignVCenter);
    f_grid->addWidget(_asset_acct, 3, 2, AlignLeft | AlignVCenter);

    QHBox* box = new QHBox(_frame);
    box->setSpacing(3);

    QGroupBox* purchase = new QGroupBox(tr("Purchase Information"), box);
    QGridLayout* p_grid = new QGridLayout(purchase, 2, 2,
					  purchase->frameWidth() * 2);
    p_grid->addRowSpacing(0, purchase->fontMetrics().height());

    QLabel* purchLabel = new QLabel(tr("Purchase Tax:"), purchase);
    _purch_tax = new LookupEdit(new TaxLookup(main, this), purchase);
    _purch_tax->setLength(6);
    purchLabel->setBuddy(_purch_tax);

    p_grid->setColStretch(1, 1);
    p_grid->setRowStretch(3, 1);
    p_grid->addWidget(purchLabel, 1, 0, AlignLeft | AlignVCenter);
    p_grid->addWidget(_purch_tax, 1, 1, AlignLeft | AlignVCenter);

    QGroupBox* sales = new QGroupBox(tr("Sales Information"), box);
    QGridLayout* s_grid = new QGridLayout(sales, 2, 2,
					  sales->frameWidth() * 2);
    s_grid->addRowSpacing(0, sales->fontMetrics().height());

    QLabel* targetLabel = new QLabel(tr("Target GM:"), sales);
    _target_gm = new PercentEdit(sales);
    _target_gm->setLength(10);
    targetLabel->setBuddy(_target_gm);

    QLabel* allowLabel = new QLabel(tr("Variance:"), sales);
    _allowed_var = new PercentEdit(sales);
    _allowed_var->setLength(10);
    allowLabel->setBuddy(_allowed_var);

    QLabel* sellLabel = new QLabel(tr("Selling Tax:"), sales);
    _sell_tax = new LookupEdit(new TaxLookup(main, this), sales);
    _sell_tax->setLength(6);
    sellLabel->setBuddy(_sell_tax);

    _discountable = new QCheckBox(tr("Discountable?"), sales);

    s_grid->setRowStretch(3, 1);
    s_grid->setColStretch(1, 1);
    s_grid->addWidget(targetLabel, 1, 0, AlignLeft | AlignVCenter);
    s_grid->addWidget(_target_gm, 1, 1, AlignLeft | AlignVCenter);
    s_grid->addWidget(allowLabel, 1, 2, AlignLeft | AlignVCenter);
    s_grid->addWidget(_allowed_var, 1, 3, AlignLeft | AlignVCenter);
    s_grid->addWidget(sellLabel, 2, 0, AlignLeft | AlignVCenter);
    s_grid->addWidget(_sell_tax, 2, 1, AlignLeft | AlignVCenter);
    s_grid->addMultiCellWidget(_discountable, 2, 2, 2, 3,
			       AlignLeft | AlignVCenter);

    QGridLayout* grid = new QGridLayout(_frame);
    grid->setMargin(3);
    grid->setSpacing(3);
    grid->setColStretch(2, 1);
    grid->addWidget(nameLabel, 0, 0);
    grid->addWidget(_name, 0, 1, AlignLeft | AlignVCenter);
    grid->addWidget(numberLabel, 0, 3);
    grid->addWidget(_number, 0, 4, AlignLeft | AlignVCenter);
    grid->addWidget(deptLabel, 1, 0);
    grid->addWidget(_dept, 1, 1, AlignLeft | AlignVCenter);
    grid->addMultiCellWidget(flags, 2, 2, 0, 4);
    grid->addMultiCellWidget(box, 3, 3, 0, 4);

    setCaption(tr("Subdepartment Master"));
    finalize();
}
Exemplo n.º 12
0
ItemTransfer::ItemTransfer(MainWindow* main, Id transfer_id)
    : DataWindow(main, "ItemTransfer", transfer_id)
{
    _helpSource = "item_transfer.html";

    // Search button
    QPushButton* search = new QPushButton(tr("Search"), _buttons);
    connect(search, SIGNAL(clicked()), SLOT(slotSearch()));

    // Get the company for deposit info
    _quasar->db()->lookup(_company);

    // Create widgets
    _gltxFrame = new GltxFrame(main, tr("Adjustment No."), _frame);
    _gltxFrame->setTitle(tr("From"));
    connect(_gltxFrame->store, SIGNAL(validData()), SLOT(slotStoreChanged()));

    _items = new Table(_frame);
    _items->setVScrollBarMode(QScrollView::AlwaysOn);
    _items->setLeftMargin(fontMetrics().width("99999"));
    _items->setDisplayRows(6);
    connect(_items, SIGNAL(cellMoved(int,int)), SLOT(cellMoved(int,int)));
    connect(_items, SIGNAL(cellChanged(int,int,Variant)),
	    SLOT(cellChanged(int,int,Variant)));
    connect(_items, SIGNAL(focusNext(bool&,int&,int&,int)),
	    SLOT(focusNext(bool&,int&,int&,int)));
    connect(_items, SIGNAL(rowInserted(int)), SLOT(rowInserted(int)));
    connect(_items, SIGNAL(rowDeleted(int)), SLOT(rowDeleted(int)));

    // Lookups
    _lookup = new ItemLookup(_main, this);
    _lookup->inventoriedOnly = true;

    // Add columns
    new LookupColumn(_items, tr("Item Number"), 18, _lookup);
    new TextColumn(_items, tr("Description"), 20);
    new TextColumn(_items, tr("Size"), 10);
    new NumberColumn(_items, tr("On Hand"), 6);
    new NumberColumn(_items, tr("Quantity"), 6);
    new MoneyColumn(_items, tr("Amount"));
    if (_company.depositAccount() != INVALID_ID)
	new MoneyColumn(_items, tr("Deposit"), 4);

    // Add editors
    _size = new QComboBox(_items);
    new LookupEditor(_items, 0, new ItemEdit(_lookup, _items));
    new ComboEditor(_items, 2, _size);
    new NumberEditor(_items, 4, new DoubleEdit(_items));
    new NumberEditor(_items, 5, new MoneyEdit(_items));
    if (_company.depositAccount() != INVALID_ID)
	new NumberEditor(_items, 6, new MoneyEdit(_items));

    QGroupBox* to = new QGroupBox(tr("To"), _frame);

    QLabel* toNumberLabel = new QLabel(tr("Adjustment No."), to);
    _toNumber = new LineEdit(9, to);
    toNumberLabel->setBuddy(_toNumber);

    QLabel* toShiftLabel = new QLabel(tr("Shift:"), to);
    _toShift = new LookupEdit(new GltxLookup(_main, this, DataObject::SHIFT),
			      to);
    _toShift->setLength(10);
    _toShift->setFocusPolicy(ClickFocus);
    toShiftLabel->setBuddy(_toShift);

    QLabel* toStoreLabel = new QLabel(tr("Store:"), to);
    _toStore = new LookupEdit(new StoreLookup(_main, this), to);
    _toStore->setLength(30);
    toStoreLabel->setBuddy(_toStore);

    QGridLayout* toGrid = new QGridLayout(to, 1, 1, to->frameWidth() * 2);
    toGrid->setSpacing(3);
    toGrid->setMargin(6);
    toGrid->setColStretch(2, 1);
    toGrid->addColSpacing(2, 10);
    toGrid->setColStretch(5, 1);
    toGrid->addColSpacing(5, 10);
    toGrid->addRowSpacing(0, to->fontMetrics().height());
    toGrid->addWidget(toNumberLabel, 1, 0);
    toGrid->addWidget(_toNumber, 1, 1, AlignLeft | AlignVCenter);
    toGrid->addWidget(toShiftLabel, 1, 3);
    toGrid->addWidget(_toShift, 1, 4, AlignLeft | AlignVCenter);
    toGrid->addWidget(toStoreLabel, 1, 6);
    toGrid->addWidget(_toStore, 1, 7, AlignLeft | AlignVCenter);

    QLabel* accountLabel = new QLabel(tr("Transfer Account:"), _frame);
    AccountLookup* lookup = new AccountLookup(main, this, 
					      Account::OtherCurLiability);
    _account = new LookupEdit(lookup, _frame);
    _account->setLength(30);
    accountLabel->setBuddy(_account);

    QLabel* totalLabel = new QLabel(tr("Transfer Amount:"), _frame);
    _total = new MoneyEdit(_frame);
    _total->setLength(14);
    _total->setFocusPolicy(NoFocus);
    totalLabel->setBuddy(_total);

    _inactive->setText(tr("Voided?"));

    QGridLayout* grid = new QGridLayout(_frame);
    grid->setSpacing(3);
    grid->setMargin(3);
    grid->setColStretch(2, 1);
    grid->setRowStretch(1, 1);
    grid->addMultiCellWidget(_gltxFrame, 0, 0, 0, 4);
    grid->addMultiCellWidget(_items, 1, 1, 0, 4);
    grid->addMultiCellWidget(to, 2, 2, 0, 4);
    grid->addWidget(accountLabel, 3, 0);
    grid->addWidget(_account, 3, 1, AlignLeft | AlignVCenter);
    grid->addWidget(totalLabel, 3, 3);
    grid->addWidget(_total, 3, 4, AlignLeft | AlignVCenter);

    setCaption(tr("Item Transfer"));
    finalize();
}
Exemplo n.º 13
0
AccountMaster::AccountMaster(MainWindow* main, Id account_id)
    : DataWindow(main, "AccountMaster", account_id)
{
    _helpSource = "account_master.html";

    // Create widgets
    QLabel* nameLabel = new QLabel(tr("&Name:"), _frame);
    _name = new LineEdit(_frame);
    _name->setLength(30);
    nameLabel->setBuddy(_name);

    QLabel* numberLabel = new QLabel(tr("N&umber:"), _frame);
    _number = new LineEdit(_frame);
    _number->setLength(12);
    numberLabel->setBuddy(_number);

    QLabel* typeLabel = new QLabel(tr("&Type:"), _frame);
    _type = new QComboBox(false, _frame);
    typeLabel->setBuddy(_type);
    connect(_type, SIGNAL(activated(int)), SLOT(typeChanged(int)));

    for (int type = Account::Bank; type <= Account::OtherExpense; ++type) {
	_type->insertItem(Account::typeName(Account::Type(type)));
    }
    _type->setMinimumSize(_type->sizeHint());
    _type->setMaximumSize(_type->sizeHint());

    QLabel* parentLabel = new QLabel(tr("&Parent:"), _frame);
    _parentLookup = new AccountLookup(main, this, -1, true, false);
    _parent = new LookupEdit(_parentLookup, _frame);
    parentLabel->setBuddy(_parent);

    QFrame* boxes = new QFrame(_frame);

    _header = new QCheckBox(tr("Header Account?"), boxes);

    QLabel* nextNumLabel = new QLabel(tr("Next Cheque #:"), boxes);
    _nextNum = new IntegerEdit(boxes);
    _nextNum->setLength(6);

    QLabel* lastReconLabel = new QLabel(tr("Last Reconciled:"), boxes);
    _lastRecon = new DateEdit(boxes);
    _lastRecon->setEnabled(false);

    QGroupBox* groups = new QGroupBox(tr("Groups"), boxes);
    QGridLayout* g_grid = new QGridLayout(groups, 2, 1,groups->frameWidth()*2);
    g_grid->addRowSpacing(0, groups->fontMetrics().height());

    _groups = new Table(groups);
    _groups->setVScrollBarMode(QScrollView::AlwaysOn);
    _groups->setDisplayRows(2);
    _groups->setLeftMargin(fontMetrics().width("999"));
    connect(_groups, SIGNAL(cellChanged(int,int,Variant)),
	    SLOT(groupCellChanged(int,int,Variant)));

    GroupLookup* groupLookup = new GroupLookup(_main, this, Group::ACCOUNT);
    new LookupColumn(_groups, tr("Group Name"), 15, groupLookup);
    new LookupEditor(_groups, 0, new LookupEdit(groupLookup, _groups));

    g_grid->addWidget(_groups, 1, 0);

    QGridLayout* grid1 = new QGridLayout(boxes);
    grid1->setSpacing(3);
    grid1->setMargin(3);
    grid1->setRowStretch(2, 1);
    grid1->setColStretch(1, 1);
    grid1->addWidget(_header, 0, 0);
    grid1->addWidget(nextNumLabel, 1, 0, AlignLeft | AlignVCenter);
    grid1->addWidget(_nextNum, 1, 1, AlignLeft | AlignVCenter);
    grid1->addWidget(lastReconLabel, 3, 0, AlignLeft | AlignVCenter);
    grid1->addWidget(_lastRecon, 3, 1, AlignLeft | AlignVCenter);
    grid1->addMultiCellWidget(groups, 0, 3, 2, 2);

    QGridLayout *grid = new QGridLayout(_frame);
    grid->setSpacing(3);
    grid->setMargin(3);
    grid->addWidget(nameLabel, 0, 0);
    grid->addWidget(_name, 0, 1);
    grid->addWidget(numberLabel, 0, 2);
    grid->addWidget(_number, 0, 3, AlignLeft | AlignVCenter);
    grid->addWidget(typeLabel, 1, 0);
    grid->addWidget(_type, 1, 1, AlignLeft | AlignVCenter);
    grid->addWidget(parentLabel, 1, 2);
    grid->addWidget(_parent, 1, 3);
    grid->addMultiCellWidget(boxes, 2, 2, 0, 3);

    setCaption(tr("Account Master"));
    finalize();
}
Exemplo n.º 14
0
void KWStatisticsDialog::addBox( QFrame *page, QLabel **resultLabel, bool calcWithFootNoteCheckbox )
{
    // Layout Managers
    QVBoxLayout *topLayout = new QVBoxLayout( page, 0, 7 );
    if ( calcWithFootNoteCheckbox )
    {
        QWidget *w = new QWidget(page);
        topLayout->addWidget( w );
        QVBoxLayout *noteLayout = new QVBoxLayout( w, KDialog::marginHint(), 0 );
        QCheckBox *calcWithFootNote = new QCheckBox( i18n("&Include text from foot- and endnotes"), w);
        noteLayout->addWidget( calcWithFootNote );
        connect( calcWithFootNote, SIGNAL(toggled ( bool )), this, SLOT( slotRefreshValue(bool)));
    }


    QGroupBox *box = new QGroupBox( i18n( "Statistics" ), page );
    QGridLayout *grid = new QGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() );
    grid->setRowStretch (9, 1);

    // margins
    int fHeight = box->fontMetrics().height();
    grid->setMargin( fHeight );
    grid->addColSpacing( 1, fHeight );
    grid->addRowSpacing( 0, fHeight );

    //maximum size for result column (don't know how to do this better..)
    QString init = i18n("approximately %1").arg( "00000000" );

    // insert labels
    QLabel *label1 = new QLabel( i18n( "Characters including spaces:" ), box );
    grid->addWidget( label1, 1, 0, 1 );
    resultLabel[0] = new QLabel( "", box );
    grid->addWidget( resultLabel[0], 1, 2, 2 );

    QLabel *label2 = new QLabel( i18n( "Characters without spaces:" ), box );
    grid->addWidget( label2, 2, 0, 1 );
    resultLabel[1] = new QLabel( "", box );
    grid->addWidget( resultLabel[1], 2, 2, 2 );

    QLabel *label3 = new QLabel( i18n( "Syllables:" ), box );
    grid->addWidget( label3, 3, 0, 1 );
    resultLabel[2] = new QLabel( "", box );
    grid->addWidget( resultLabel[2], 3, 2, 2 );

    QLabel *label4 = new QLabel( i18n( "Words:" ), box );
    grid->addWidget( label4, 4, 0, 1 );
    resultLabel[3] = new QLabel( "", box );
    grid->addWidget( resultLabel[3], 4, 2, 2 );

    QLabel *label5 = new QLabel( i18n( "Sentences:" ), box );
    grid->addWidget( label5, 5, 0, 1 );
    resultLabel[4] = new QLabel( "", box );
    grid->addWidget( resultLabel[4], 5, 2, 2 );

    QLabel *label6 = new QLabel( i18n( "Lines:" ), box );
    grid->addWidget( label6, 6, 0, 1 );
    resultLabel[5] = new QLabel( "", box );
    grid->addWidget( resultLabel[5], 6, 2, 2 );


    QLabel *label7 = new QLabel( i18n( "Flesch reading ease:" ), box );
    grid->addWidget( label7, 7, 0, 1 );
    resultLabel[6] = new QLabel( init, box );
    grid->addWidget( resultLabel[6], 7, 2, 2 );

    topLayout->addWidget( box );
}
Exemplo n.º 15
0
RecurringMaster::RecurringMaster(MainWindow* main, Id recurring_id)
    : DataWindow(main, "RecurringMaster", recurring_id)
{
    _helpSource = "recurring_master.html";

    // Post button
    QPushButton* posting = new QPushButton(tr("Post"), _buttons);
    connect(posting, SIGNAL(clicked()), SLOT(slotPost()));

    // Create widgets
    QGroupBox* tx = new QGroupBox(tr("Transaction"), _frame);

    QLabel* typeLabel = new QLabel(tr("Type:"), tx);
    _type = new LineEdit(20, tx);
    _type->setFocusPolicy(NoFocus);

    QLabel* numberLabel = new QLabel(tr("Id #:"), tx);
    _number = new LineEdit(10, tx);
    _number->setFocusPolicy(NoFocus);

    QLabel* storeLabel = new QLabel(tr("Store:"), tx);
    _store = new LineEdit(tx);
    _store->setFocusPolicy(NoFocus);

    QLabel* dateLabel = new QLabel(tr("Date:"), tx);
    _date = new LineEdit(tx);
    _date->setFocusPolicy(NoFocus);

    QLabel* descLabel = new QLabel(tr("Description:"), tx);
    _desc = new LineEdit(30, tx);
    descLabel->setBuddy(_desc);

    _cardLabel = new QRadioButton(tr("Card:"), tx);
    _card = new LineEdit(tx);
    _card->setFocusPolicy(NoFocus);
    connect(_cardLabel, SIGNAL(toggled(bool)), SLOT(slotTypeChanged()));

    _groupLabel = new QRadioButton(tr("Group:"), tx);
    _groupLookup = new GroupLookup(main, this, Group::CUSTOMER);
    _group = new LookupEdit(_groupLookup, tx);
    connect(_groupLabel, SIGNAL(toggled(bool)), SLOT(slotTypeChanged()));

    QButtonGroup* types = new QButtonGroup(this);
    types->hide();
    types->insert(_cardLabel);
    types->insert(_groupLabel);

    QGridLayout* txGrid = new QGridLayout(tx);
    txGrid->setMargin(6);
    txGrid->setSpacing(6);
    txGrid->setColStretch(2, 1);
    txGrid->addRowSpacing(0, tx->fontMetrics().height());
    txGrid->addWidget(typeLabel, 1, 0);
    txGrid->addWidget(_type, 1, 1);
    txGrid->addWidget(storeLabel, 1, 3);
    txGrid->addWidget(_store, 1, 4);
    txGrid->addWidget(numberLabel, 2, 0);
    txGrid->addWidget(_number, 2, 1);
    txGrid->addWidget(dateLabel, 2, 3);
    txGrid->addWidget(_date, 2, 4);
    txGrid->addWidget(descLabel, 3, 0);
    txGrid->addMultiCellWidget(_desc, 3, 3, 1, 4);
    txGrid->addWidget(_cardLabel, 4, 0);
    txGrid->addMultiCellWidget(_card, 4, 4, 1, 4);
    txGrid->addWidget(_groupLabel, 5, 0);
    txGrid->addMultiCellWidget(_group, 5, 5, 1, 4);

    QGroupBox* freq = new QGroupBox(tr("Frequency"), _frame);

    QLabel* freqLabel = new QLabel(tr("Type:"), freq);
    _freq = new ComboBox(false, freq);
    freqLabel->setBuddy(_freq);

    _freq->insertItem(tr("Daily"));
    _freq->insertItem(tr("Weekly"));
    _freq->insertItem(tr("Bi-Weekly"));
    _freq->insertItem(tr("Semi-Monthly"));
    _freq->insertItem(tr("Monthly"));
    _freq->insertItem(tr("Quarterly"));
    _freq->insertItem(tr("Semi-Anually"));
    _freq->insertItem(tr("Anually"));
    _freq->insertItem(tr("Other"));

    QLabel* maxPostLabel = new QLabel(tr("Max Postings:"), freq);
    _maxPost = new IntegerEdit(freq);
    maxPostLabel->setBuddy(_maxPost);

    QLabel* day1Label = new QLabel(tr("Day 1:"), freq);
    _day1 = new IntegerEdit(freq);
    day1Label->setBuddy(_day1);

    QLabel* day2Label = new QLabel(tr("Day 2:"), freq);
    _day2 = new IntegerEdit(freq);
    day2Label->setBuddy(_day2);

    QGridLayout* freqGrid = new QGridLayout(freq);
    freqGrid->setMargin(6);
    freqGrid->setSpacing(6);
    freqGrid->setColStretch(2, 1);
    freqGrid->addRowSpacing(0, freq->fontMetrics().height());
    freqGrid->addWidget(freqLabel, 1, 0);
    freqGrid->addWidget(_freq, 1, 1);
    freqGrid->addWidget(maxPostLabel, 2, 0);
    freqGrid->addWidget(_maxPost, 2, 1);
    freqGrid->addWidget(day1Label, 1, 3);
    freqGrid->addWidget(_day1, 1, 4);
    freqGrid->addWidget(day2Label, 2, 3);
    freqGrid->addWidget(_day2, 2, 4);

    QGroupBox* post = new QGroupBox(tr("Postings"), _frame);

    QLabel* lastPostLabel = new QLabel(tr("Last Posted:"), post);
    _lastPost = new DatePopup(post);
    lastPostLabel->setBuddy(_lastPost);

    QLabel* nextDueLabel = new QLabel(tr("Next Due:"), post);
    _nextDue = new LineEdit(post);
    _nextDue->setFocusPolicy(NoFocus);
    nextDueLabel->setBuddy(_nextDue);

    QLabel* postCntLabel = new QLabel(tr("Posting Count:"), post);
    _postCnt = new IntegerEdit(post);
    postCntLabel->setBuddy(_postCnt);

    QLabel* overdueLabel = new QLabel(tr("Overdue Days:"), post);
    _overdue = new IntegerEdit(post);
    _overdue->setFocusPolicy(NoFocus);
    overdueLabel->setBuddy(_overdue);

    QGridLayout* postGrid = new QGridLayout(post);
    postGrid->setMargin(6);
    postGrid->setSpacing(6);
    postGrid->setColStretch(2, 1);
    postGrid->addRowSpacing(0, post->fontMetrics().height());
    postGrid->addWidget(lastPostLabel, 1, 0);
    postGrid->addWidget(_lastPost, 1, 1);
    postGrid->addWidget(nextDueLabel, 2, 0);
    postGrid->addWidget(_nextDue, 2, 1);
    postGrid->addWidget(postCntLabel, 1, 3);
    postGrid->addWidget(_postCnt, 1, 4);
    postGrid->addWidget(overdueLabel, 2, 3);
    postGrid->addWidget(_overdue, 2, 4);

    QGridLayout* grid = new QGridLayout(_frame);
    grid->setSpacing(3);
    grid->setMargin(3);
    grid->addWidget(tx, 0, 0);
    grid->addWidget(freq, 1, 0);
    grid->addWidget(post, 2, 0);

    connect(_freq, SIGNAL(activated(int)), SLOT(slotRefresh()));

    setCaption(tr("Recurring Transaction"));
    finalize();
}