Esempio n. 1
0
void JabberAddAccountWidget::createGui(bool showButtons)
{
  	QVBoxLayout *mainLayout = new QVBoxLayout(this);

	QWidget *formWidget = new QWidget(this);
	mainLayout->addWidget(formWidget);

	QFormLayout *layout = new QFormLayout(formWidget);

	QWidget *jidWidget = new QWidget(this);
	QGridLayout *jidLayout = new QGridLayout(jidWidget);
	jidLayout->setSpacing(0);
	jidLayout->setMargin(0);
	jidLayout->setColumnStretch(0, 2);
	jidLayout->setColumnStretch(2, 2);

	Username = new QLineEdit(this);
	connect(Username, SIGNAL(textEdited(QString)), this, SLOT(dataChanged()));
	jidLayout->addWidget(Username);

	AtLabel = new QLabel("@", this);
	jidLayout->addWidget(AtLabel, 0, 1);

	Domain = new QComboBox();
	Domain->setEditable(true);
	if (!Factory->allowChangeServer())
	{
		Domain->setVisible(false);
		AtLabel->setVisible(false);

		QString toolTip = Factory->whatIsMyUsername();
		if (!toolTip.isEmpty())
		{
			QLabel *whatIsMyUsernameLabel = new QLabel(tr("<a href='#'>What is my username?</a>"), this);
			whatIsMyUsernameLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
			jidLayout->addWidget(whatIsMyUsernameLabel, 0, 2, Qt::AlignRight);

			connect(whatIsMyUsernameLabel, SIGNAL(linkActivated(QString)), this, SLOT(showWhatIsMyUsername()));
		}
	}
	else
	{
		connect(Domain, SIGNAL(currentIndexChanged(QString)), this, SLOT(dataChanged()));
		connect(Domain, SIGNAL(editTextChanged(QString)), this, SLOT(dataChanged()));
	}
	jidLayout->addWidget(Domain, 0, 2);

	layout->addRow(tr("Username") + ':', jidWidget);

	AccountPassword = new QLineEdit(this);
	connect(AccountPassword, SIGNAL(textEdited(QString)), this, SLOT(dataChanged()));
	AccountPassword->setEchoMode(QLineEdit::Password);
	layout->addRow(tr("Password") + ':', AccountPassword);

	RememberPassword = new QCheckBox(tr("Remember Password"), this);
	layout->addRow(0, RememberPassword);

	Identity = new IdentitiesComboBox(this);
	connect(Identity, SIGNAL(currentIndexChanged(int)), this, SLOT(dataChanged()));
	layout->addRow(tr("Account Identity") + ':', Identity);

	QLabel *infoLabel = new QLabel(tr("<font size='-1'><i>Select or enter the identity that will be associated with this account.</i></font>"), this);
	infoLabel->setWordWrap(true);
	infoLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
	infoLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
	layout->addRow(0, infoLabel);

	mainLayout->addStretch(100);

	QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this);
	mainLayout->addWidget(buttons);

	AddAccountButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogApplyButton), tr("Add Account"), this);
	QPushButton *cancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Cancel"), this);

	buttons->addButton(AddAccountButton, QDialogButtonBox::AcceptRole);
	buttons->addButton(cancelButton, QDialogButtonBox::DestructiveRole);

	connect(AddAccountButton, SIGNAL(clicked(bool)), this, SLOT(apply()));
	connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(cancel()));

	if (!showButtons)
		buttons->hide();
}
Esempio n. 2
0
void MainWindow::createRibbon()
{
    if (Qtitan::RibbonPage* pageGallery = ribbonBar()->addPage( tr("&Galleries 1")))
    {
        if (Qtitan::RibbonGroup* groupPopup = pageGallery->addGroup(tr("Popup Galleries")))
        {
            groupPopup->setOptionButtonVisible();
            QAction* act = groupPopup->optionButtonAction();
            act->setToolTip(tr("Popup Galleries"));
            connect(act, SIGNAL(triggered()), this, SLOT(pressButton()));

            groupPopup->setControlsCentering(true);

            OfficePopupMenu* popup = OfficePopupMenu::createPopupMenu(this);
            Qtitan::RibbonGallery* popupGallery = new Qtitan::RibbonGallery;
            popupGallery->setBaseSize(QSize(307, 168));
            popupGallery->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
            popupGallery->setGalleryGroup(m_itemsStyles);
            popup->addWidget(popupGallery);
            popup->addSeparator();
            popup->addAction(tr("Save Style"));
            popup->addAction(tr("Apply Style"));
            groupPopup->addAction(QIcon(":/res/largeStyleButton.png"), tr("Styles"), 
                Qt::ToolButtonTextUnderIcon, popup, QToolButton::InstantPopup);

            popup = OfficePopupMenu::createPopupMenu(this);
            m_popupTableGallery = new Qtitan::RibbonGallery;
            m_popupTableGallery->setBaseSize(QSize(193, 175));
            m_popupTableGallery->setLabelsVisible(true);
            m_popupTableGallery->setScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            m_popupTableGallery->setGalleryGroup(m_itemsTable);
            popup->addWidget(m_popupTableGallery);
            groupPopup->addAction(QIcon(":/res/largeTable.png"), tr("Table"), 
                Qt::ToolButtonTextUnderIcon, popup, QToolButton::InstantPopup);
            connect(m_popupTableGallery, SIGNAL(itemPressed(RibbonGalleryItem*)), 
                this, SLOT(itemTablePressed(RibbonGalleryItem*)));

            popup = OfficePopupMenu::createPopupMenu(this);
            popupGallery = new Qtitan::RibbonGallery();
            popupGallery->setBaseSize(QSize(173, 145));
            popupGallery->setLabelsVisible(true);
            popupGallery->setScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            popupGallery->setGalleryGroup(m_itemsFontTextColor);
            popup->addWidget(popupGallery);
            groupPopup->addAction(QIcon(":/res/largeColorButton.png"), 
                tr("Color"), Qt::ToolButtonTextUnderIcon, popup, QToolButton::InstantPopup);

            popup = OfficePopupMenu::createPopupMenu(this);
            popup->setGripVisible(false);
            m_popupUndoGallery = new WidgetGalleryUndo();
            m_popupUndoGallery->setGalleryGroup(m_itemsUndo);
            m_popupUndoGallery->setBaseSize(QSize(120, m_itemsUndo->getSize().height() * m_itemsUndo->getItemCount() + 2));
            m_popupUndoGallery->setScrollBarPolicy(Qt::ScrollBarAlwaysOff);
            popup->addWidget(m_popupUndoGallery);

            QLabel* label = new QLabel();
            label->setAlignment(Qt::AlignCenter);
            label->setMinimumWidth(118);
            popup->addWidget(label);
            m_popupUndoGallery->selectedItemChanged();

            m_actionUndo = groupPopup->addAction(QIcon(":/res/largeUndo.png"), 
                tr("Undo"), Qt::ToolButtonTextUnderIcon, popup);
            connect(popup, SIGNAL(aboutToHide()), this, SLOT(aboutToHideUndo()));

            connect(m_popupUndoGallery, SIGNAL(itemPressed(RibbonGalleryItem*)), 
                this, SLOT(itemUndoPressed(RibbonGalleryItem*)));
        }

        if (Qtitan::RibbonGroup* groupInline = pageGallery->addGroup(tr("Inline Galleries")))
        {
            groupInline->setOptionButtonVisible();
            QAction* act = groupInline->optionButtonAction();
            act->setToolTip(tr("Inline Galleries"));
            connect(act, SIGNAL(triggered()), this, SLOT(pressButton()));

            groupInline->setControlsCentering(true);

            m_widgetFontTextColor = new Qtitan::RibbonGallery;
            m_widgetFontTextColor->setBaseSize(QSize(190, 60));
            m_widgetFontTextColor->setLabelsVisible(false);
            m_widgetFontTextColor->setScrollBarPolicy(Qt::ScrollBarAlwaysOn);
            m_widgetFontTextColor->setBorderVisible(true);
            m_widgetFontTextColor->setGalleryGroup(m_itemsFontTextColor);
            m_widgetFontTextColor->setCheckedIndex(1);
            act = groupInline->addWidget(m_widgetFontTextColor);
            act->setText(tr("&Color"));
            connect(m_widgetFontTextColor, SIGNAL(itemPressed(RibbonGalleryItem*)), 
                this, SLOT(itemColorPressed(RibbonGalleryItem*)));

            groupInline->addSeparator();

            m_widgetStyleFont = new Qtitan::RibbonGallery;
            m_widgetStyleFont->setBaseSize(QSize(632, 60));
            m_widgetStyleFont->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
            m_widgetStyleFont->setLabelsVisible(false);
            m_widgetStyleFont->setContentsMargins(0, 1, 0, 1);
            m_widgetStyleFont->setBorderVisible(true);
            m_widgetStyleFont->setGalleryGroup(m_itemsStyles);
            m_widgetStyleFont->setCheckedIndex(0);

            connect(m_widgetStyleFont, SIGNAL(itemPressed(RibbonGalleryItem*)), 
                this, SLOT(itemStyleFontPressed(RibbonGalleryItem*)));

            OfficePopupMenu* popup = OfficePopupMenu::createPopupMenu(this);
            m_widgetStyleFont->setPopupMenu(popup);

            m_popupStyleFont = new Qtitan::RibbonGallery;
            m_popupStyleFont->setBaseSize(QSize(307, 168));
            m_popupStyleFont->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
            m_popupStyleFont->setGalleryGroup(m_itemsStyles);
            m_popupStyleFont->setCheckedIndex(0);
            connect(m_popupStyleFont, SIGNAL(itemPressed(RibbonGalleryItem*)), 
                this, SLOT(itemStyleFontPressed(RibbonGalleryItem*)));
            popup->addWidget(m_popupStyleFont);
            popup->addSeparator();

            // hide page, if enabled minimization signal - released()
            QAction* actSaveStyle = popup->addAction(tr("&Save Style"));
            QObject::connect(actSaveStyle, SIGNAL(triggered()), groupInline, SIGNAL(released()));

            QAction* actApplyStyle = popup->addAction(tr("&Apply Style"));
            QObject::connect(actApplyStyle, SIGNAL(triggered()), groupInline, SIGNAL(released()));
            
            act = groupInline->addWidget(m_widgetStyleFont);
            act->setText(tr("&Style"));
        }
Esempio n. 3
0
KPTagsPage::KPTagsPage(bool ro, QWidget *parent, const char *name) : KPrintDialogPage(parent, name)
{

    // WhatsThis strings.... (added by [email protected])
    QString whatsThisAdditionalTagsTable = i18n(
        " <qt><p><b>Additional Tags</b></p>"
        " You may send additional commands to the CUPS server via this editable list. "
        " There are 3 purposes for this:"
        " <ul>"
        " <li>Use any current or future standard CUPS job option not supported by the "
        " KDEPrint GUI. </li>"
        " <li>Control any custom job option you may want to support in custom CUPS filters "
        " and backends plugged into the CUPS filtering chain.</li> "
        " <li>Send short messages to the operators of your production printers in your "
        " <em>Central Repro Department</em>."
        " </ul> "
        " <p><b>Standard CUPS job options:</b> A complete list of standard CUPS job "
        " options is in the <a href=\"http://localhost:631/sum.html\">CUPS User Manual</a>. "
        " Mappings of the kprinter user interface widgets to respective CUPS job option "
        " names are named in the various <em>WhatsThis</em> help items..</p>"
        " <p><b>Custom CUPS job options:</b> CUPS print servers may be customized with additional "
        " print filters and backends which understand custom job options. You can specify such "
        " custom job options here. If in doubt, ask your system administrator..</p>"
        " <p><b> </b></p>"
        " <p><b>Operator Messages:</b> You may send additional messages to the operator(s) of your"
        " production printers (e.g. in your <em>Central Repro Department</p>)"
        " Messages can be read by the operator(s) (or yourself) by viewing"
        " the <em>\"Job IPP Report\"</em> for the job.</p>"
        " <b>Examples:</b><br>"
        " <pre>"
        " A standard CUPS job option:<br> "
        "   <em>(Name) number-up</em>                -- <em>(Value) 9</em>                     <br>"
        " <br>"
        " A job option for custom CUPS filters or backends:<br> "
        "   <em>(Name) DANKA_watermark</em>          -- <em>(Value) Company_Confidential</em>   <br>"
        " <br>"
        " A message to the operator(s):<br> "
        "   <em>(Name) Deliver_after_completion</em> -- <em>(Value) to_Marketing_Departm.</em><br>"
        " </pre>"
        " <p><b>Note:</b> the fields must not include spaces, tabs or quotes. You may need to "
        " double-click on a field to edit it."
        " <p><b>Warning:</b> Do not use such standard CUPS option names which also can be used "
        " through the KDEPrint GUI. Results may be  unpredictable if they conflict, "
        " or if they are sent multiple times. For all options supported by the GUI, please do use "
        " the GUI. (Each GUI element's  'WhatsThis' names the related CUPS option name.) </p> "
        " </qt>");
    setTitle(i18n("Additional Tags"));
    setOnlyRealPrinters(true);

    m_tags = new QTable(10, 2, this);
    m_tags->horizontalHeader()->setStretchEnabled(true);
    m_tags->horizontalHeader()->setLabel(0, i18n("Name"));
    m_tags->horizontalHeader()->setLabel(1, i18n("Value"));
    m_tags->setReadOnly(ro);
    QWhatsThis::add(m_tags, whatsThisAdditionalTagsTable);

    QVBoxLayout *l0 = new QVBoxLayout(this, 0, 5);
    l0->addWidget(m_tags);

    if(ro)
    {
        QLabel *lab = new QLabel(i18n("Read-Only"), this);
        QFont f = lab->font();
        f.setBold(true);
        lab->setFont(f);
        lab->setAlignment(AlignVCenter | AlignRight);
        l0->addWidget(lab);
    }
}
Esempio n. 4
0
PlaylistBrowserNS::DynamicCategory::DynamicCategory( QWidget* parent )
    : BrowserCategory( "dynamic category", parent )
{
    setPrettyName( i18n( "Dynamic Playlists" ) );
    setShortDescription( i18n( "Dynamically updating parameter based playlists" ) );
    setIcon( KIcon( "dynamic-amarok" ) );

    setLongDescription( i18n( "With a dynamic playlist, Amarok becomes your own personal dj, automatically selecting tracks for you, based on a number of parameters that you select." ) );

    setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_dynamic_playlists.png" ) );

    // set background
    if( AmarokConfig::showBrowserBackgroundImage() )
        setBackgroundImage( imagePath() );

    bool enabled = AmarokConfig::dynamicMode();

    setContentsMargins( 0, 0, 0, 0 );

    KHBox* controls2Layout = new KHBox( this );

    QLabel *label;
    label = new QLabel( i18n( "Previous:" ), controls2Layout );
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    m_previous = new QSpinBox( controls2Layout );
    m_previous->setMinimum( 0 );
    m_previous->setToolTip( i18n( "Number of previous tracks to remain in the playlist." ) );
    m_previous->setValue( AmarokConfig::previousTracks() );
    QObject::connect( m_previous, SIGNAL(valueChanged(int)), this, SLOT(setPreviousTracks(int)) );

    label = new QLabel( i18n( "Upcoming:" ), controls2Layout );
    // label->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    m_upcoming = new QSpinBox( controls2Layout );
    m_upcoming->setMinimum( 1 );
    m_upcoming->setToolTip( i18n( "Number of upcoming tracks to add to the playlist." ) );
    m_upcoming->setValue( AmarokConfig::upcomingTracks() );
    QObject::connect( m_upcoming, SIGNAL(valueChanged(int)), this, SLOT(setUpcomingTracks(int)) );


    QObject::connect( (const QObject*)Amarok::actionCollection()->action( "playlist_clear" ),  SIGNAL(triggered(bool)),  this, SLOT(playlistCleared()) );
    QObject::connect( (const QObject*)Amarok::actionCollection()->action( "disable_dynamic" ),  SIGNAL(triggered(bool)),  this, SLOT(playlistCleared()), Qt::DirectConnection );


    // -- the tool bar

    KHBox* presetLayout = new KHBox( this );
    KToolBar* presetToolbar = new KToolBar( presetLayout );
    presetToolbar->setIconSize( QSize( 22, 22 ) );

    presetToolbar->setToolButtonStyle( Qt::ToolButtonIconOnly );
    presetToolbar->setMovable( false );
    presetToolbar->setFloatable( false );
    presetToolbar->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );

    m_onOffButton = new QToolButton( presetToolbar );
    m_onOffButton->setText( i18nc( "Turn dynamic mode on", "On") );
    m_onOffButton->setCheckable( true );
    m_onOffButton->setIcon( KIcon( "dynamic-amarok" ) );
    m_onOffButton->setToolTip( i18n( "Turn dynamic mode on." ) );
    presetToolbar->addWidget( m_onOffButton );

    m_duplicateButton = new QToolButton( presetToolbar );
    m_duplicateButton->setText( i18n("Duplicates") );
    m_duplicateButton->setCheckable( true );
    m_duplicateButton->setChecked( allowDuplicates() );
    m_duplicateButton->setIcon( KIcon( "edit-copy" ) );
    m_duplicateButton->setToolTip( i18n( "Allow duplicate songs in result" ) );
    presetToolbar->addWidget( m_duplicateButton );

    m_addButton = new QToolButton( presetToolbar );
    m_addButton->setText( i18n("New") );
    m_addButton->setIcon( KIcon( "document-new" ) );
    m_addButton->setToolTip( i18n( "New playlist" ) );
    presetToolbar->addWidget( m_addButton );

    m_editButton = new QToolButton( presetToolbar );
    m_editButton->setText( i18n("Edit") );
    m_editButton->setIcon( KIcon( "document-properties-amarok" ) );
    m_editButton->setToolTip( i18n( "Edit the selected playlist or bias" ) );
    presetToolbar->addWidget( m_editButton );

    m_deleteButton = new QToolButton( presetToolbar );
    m_deleteButton->setText( i18n("Delete") );
    m_deleteButton->setEnabled( false );
    m_deleteButton->setIcon( KIcon( "edit-delete" ) );
    m_deleteButton->setToolTip( i18n( "Delete the selected playlist or bias") );
    presetToolbar->addWidget( m_deleteButton );

    m_repopulateButton = new QPushButton( presetLayout );
    m_repopulateButton->setText( i18n("Repopulate") );
    m_repopulateButton->setToolTip( i18n("Replace the upcoming tracks with fresh ones.") );
    m_repopulateButton->setIcon( KIcon( "view-refresh-amarok" ) );
    m_repopulateButton->setEnabled( enabled );
    // m_repopulateButton->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
    QObject::connect( m_repopulateButton, SIGNAL(clicked(bool)), The::playlistActions(), SLOT(repopulateDynamicPlaylist()) );


    // -- the tree view

    m_tree = new DynamicView( this );
    connect( m_tree->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
             this, SLOT(selectionChanged()) );

    connect( m_onOffButton, SIGNAL(toggled(bool)), The::playlistActions(), SLOT(enableDynamicMode(bool)) );
    connect( m_duplicateButton, SIGNAL(toggled(bool)), this, SLOT(setAllowDuplicates(bool)) );

    connect( m_addButton, SIGNAL(clicked(bool)), m_tree, SLOT(addPlaylist()) );
    connect( m_editButton, SIGNAL(clicked(bool)), m_tree, SLOT(editSelected()) );
    connect( m_deleteButton, SIGNAL(clicked(bool)), m_tree, SLOT(removeSelected()) );

    navigatorChanged();
    selectionChanged();

    connect( The::playlistActions(), SIGNAL(navigatorChanged()),
             this, SLOT(navigatorChanged()) );
}
Esempio n. 5
0
PlaylistDialog::PlaylistDialog(QWidget *parent)
	: QDialog(parent, Qt::Tool)
	, _unsavedPlaylistModel(new QStandardItemModel(this))
	, _savedPlaylistModel(new QStandardItemModel(this))
{
	setupUi(this);
	this->setAttribute(Qt::WA_DeleteOnClose);
	unsavedPlaylists->setAttribute(Qt::WA_MacShowFocusRect, false);
	savedPlaylists->setAttribute(Qt::WA_MacShowFocusRect, false);
	previewPlaylist->setAttribute(Qt::WA_MacShowFocusRect, false);

	delete groupBoxPreview->layout();
	_stackLayout = new QStackedLayout(groupBoxPreview);
	groupBoxPreview->setContentsMargins(11, 24, 11, 11);
	QLabel *icon = new QLabel();
	icon->setAlignment(Qt::AlignCenter);
	icon->setPixmap(QPixmap(":/icons/emptyPlaylist"));

	_labelEmptyPreview = new QLabel(tr("This preview area is empty.\nSelect a playlist to display the first 30 tracks."));
	_labelEmptyPreview->setAlignment(Qt::AlignCenter);
	_labelEmptyPreview->setWordWrap(true);

	QVBoxLayout *vboxLayout = new QVBoxLayout();
	vboxLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding));
	vboxLayout->addWidget(icon);
	vboxLayout->addWidget(_labelEmptyPreview);
	vboxLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding));

	QWidget *widget = new QWidget();
	widget->setLayout(vboxLayout);

	_stackLayout->addWidget(widget);
	_stackLayout->addWidget(previewPlaylist);

	loadPlaylists->setIcon(this->style()->standardIcon(QStyle::SP_DialogOpenButton));
	deletePlaylists->setIcon(this->style()->standardIcon(QStyle::SP_DialogCloseButton));
	exportPlaylists->setIcon(this->style()->standardIcon(QStyle::SP_DialogSaveButton));

	unsavedPlaylists->installEventFilter(this);
	savedPlaylists->installEventFilter(this);
	savedPlaylists->setDragDropMode(QListView::DropOnly);
	this->installEventFilter(this);

	unsavedPlaylists->setModel(_unsavedPlaylistModel);
	savedPlaylists->setModel(_savedPlaylistModel);
	/// XXX: MiamStyledItemDelegate should be improved!
	// savedPlaylists->setItemDelegate(new MiamStyledItemDelegate(savedPlaylists, false));

	connect(unsavedPlaylists->selectionModel(), &QItemSelectionModel::selectionChanged, this, &PlaylistDialog::populatePreviewFromUnsaved);
	connect(savedPlaylists->selectionModel(), &QItemSelectionModel::selectionChanged, this, &PlaylistDialog::populatePreviewFromSaved);
	connect(loadPlaylists, &QPushButton::clicked, this, &PlaylistDialog::loadSelectedPlaylists);
	connect(savePlaylists, &QPushButton::clicked, this, [=]() {
		for (QModelIndex idx : savedPlaylists->selectionModel()->selectedIndexes()) {
			uint playlistId = idx.data(PlaylistID).toUInt();
			for (int i = 0; i < _playlists.count(); i++) {
				Playlist *p = _playlists.at(i);
				if (playlistId == p->id()) {
					emit aboutToSavePlaylist(p, true);
					break;
				}
			}
		}
		this->updatePlaylists();
	});
	connect(deletePlaylists, &QPushButton::clicked, this, &PlaylistDialog::deleteSavedPlaylists);

	connect(unsavedPlaylists->model(), &QStandardItemModel::rowsAboutToBeRemoved, this, &PlaylistDialog::dropAutoSavePlaylists);
	connect(unsavedPlaylists->model(), &QStandardItemModel::rowsRemoved, this, [=](const QModelIndex &, int, int) {
		this->updatePlaylists();
	});

	connect(_unsavedPlaylistModel, &QStandardItemModel::itemChanged, this, &PlaylistDialog::renameItem);
	connect(_savedPlaylistModel, &QStandardItemModel::itemChanged, this, &PlaylistDialog::renameItem);

	connect(exportPlaylists, &QPushButton::clicked, this, &PlaylistDialog::exportSelectedPlaylist);
}
Esempio n. 6
0
bool KXSConfigDialog::create()
{
    QVBoxLayout *topLayout = new QVBoxLayout(plainPage(), spacingHint());
    QHBoxLayout *layout = new QHBoxLayout(topLayout, spacingHint());
    QVBox *controlLayout = new QVBox(plainPage());
    controlLayout->setSpacing(spacingHint());
    layout->addWidget(controlLayout);
    ((QBoxLayout*)controlLayout->layout())->addStrut(120);

    KConfig config(mConfigFile);

    QString xmlFile = "/doesntexist";
#ifdef XSCREENSAVER_CONFIG_DIR
    xmlFile = XSCREENSAVER_CONFIG_DIR;
#endif

    xmlFile += "/" + mExeName + ".xml";
    if ( QFile::exists( xmlFile ) ) {
	// We can use the xscreensaver xml config files.
	KXSXml xmlParser(controlLayout);
	xmlParser.parse( xmlFile );
	mConfigItemList = *xmlParser.items();
	QWidget *spacer = new QWidget(controlLayout);
	controlLayout->setStretchFactor(spacer, 1 );
	QString descr = xmlParser.description();
	if ( !descr.isEmpty() ) {
	    descr.replace('\n',' ');
	    descr = descr.simplifyWhiteSpace();
	    QLabel *l = new QLabel( i18n( descr.utf8() ), plainPage() );
	    l->setAlignment ( WordBreak );
 	    topLayout->addWidget( l );
 	}
    } else {
        // fall back to KDE's old config files.
	int idx = 0;
	while (true) {
	    QString group = QString("Arg%1").arg(idx);
	    if (config.hasGroup(group)) {
		config.setGroup(group);
		QString type = config.readEntry("Type");
		if (type == "Range") {
		    KXSRangeControl *rc = new KXSRangeControl(controlLayout, group, config);
		    mConfigItemList.append(rc);
		} else if (type == "DoubleRange") {
		    KXSDoubleRangeControl *rc =
			new KXSDoubleRangeControl(controlLayout, group, config);
		    mConfigItemList.append(rc);
		} else if (type == "Check") {
		    KXSCheckBoxControl *cc = new KXSCheckBoxControl(controlLayout, group,
			    config);
		    mConfigItemList.append(cc);
		} else if (type == "DropList") {
		    KXSDropListControl *dl = new KXSDropListControl(controlLayout, group,
			    config);
		    mConfigItemList.append(dl);
		}
	    } else {
		break;
	    }
	    idx++;
	}
	if ( idx == 0 )
	    return false;
    }

    QPtrListIterator<KXSConfigItem> it( mConfigItemList );
    KXSConfigItem *item;
    while ( (item = it.current()) != 0 ) {
	++it;
	item->read( config );
        QWidget *i = dynamic_cast<QWidget*>(item);
        if (i) {
            connect( i, SIGNAL(changed()), SLOT(slotChanged()) );
        }
    }

    mPreviewProc = new KProcess;
    connect(mPreviewProc, SIGNAL(processExited(KProcess *)),
	    SLOT(slotPreviewExited(KProcess *)));

    mPreviewTimer = new QTimer(this);
    connect(mPreviewTimer, SIGNAL(timeout()), SLOT(slotNewPreview()));

    mPreview = new QWidget(plainPage());
    mPreview->setFixedSize(250, 200);
    //  mPreview->setBackgroundMode(QWidget::NoBackground);
    mPreview->setBackgroundColor(Qt::black);

    layout->add(mPreview);
    show();

    // So that hacks can XSelectInput ButtonPressMask
    XSelectInput(qt_xdisplay(), mPreview->winId(), widgetEventMask );

    slotPreviewExited(0);
    return true;
}
Esempio n. 7
0
DecoratorDialog::DecoratorDialog(QWidget * parent, QString & s, bool visit)
    : QDialog(parent, "decorator editor", TRUE), value(s) {
  setCaption(TR("decorator dialog"));
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

  vbox->setMargin(5);

  // multiline edit
  
  e = new MultiLineEdit(this);
  e->setText(s);  
  vbox->addWidget(e);
  
  if (! visit) {
    e->setFocus();

    // to choose and add an decorator
    
    QLabel * label =
      new QLabel(TR("\nTo add an decorator at the cursor position\n"
		    "you may select it in the list and press 'add'\n"
		    "\nSet operation static to add @staticmethod,\n"
		    "set operation abstract to add @abstractmethod\n"),
		 this);
    label->setAlignment(Qt::AlignCenter);
    vbox->addWidget(label);
    
    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    QPushButton * add_button;
    
    hbox->setMargin(5);
    add_button = new QPushButton(TR("Add "), this);
    hbox->addWidget(add_button);  
    connect(add_button, SIGNAL(clicked()), this, SLOT(add_decorator()));
    
    cb = new Q3ComboBox(FALSE, this);
    
    QSizePolicy sp = cb->sizePolicy();
    
    sp.setHorData(QSizePolicy::Expanding);
    cb->setSizePolicy(sp);
    cb->setAutoCompletion(completion());
    
    for (int i = 0;
	 i != sizeof(DefaultDecorators)/sizeof(*DefaultDecorators);
	 i += 1)
      cb->insertItem(DefaultDecorators[i]);
    
    BrowserClass::instances(decorators);
    if (! decorators.isEmpty()) {
      QStringList list;
    
      decorators.full_names(list);
      cb->insertStringList(list);
    }
    
    hbox->addWidget(cb);
    
    // buttons ok, cancel
    
    vbox->addWidget(new QLabel("", this));
    
    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    QPushButton * accept = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
    QSize bs(cancel->sizeHint());
    
    accept->setDefault( TRUE );
    accept->setFixedSize(bs);
    cancel->setFixedSize(bs);
    
    hbox->addWidget(accept);
    hbox->addWidget(cancel);
    
    connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
  }
  else {
    e->setReadOnly(TRUE);

    // buttons cancel
    
    vbox->addWidget(new QLabel("", this));
    
    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    
    hbox->setMargin(5);
    QPushButton * close = new QPushButton(TR("&Close"), this);

    hbox->addWidget(close);
    
    connect(close, SIGNAL(clicked()), this, SLOT(reject()));
  }
  
  // not done in polish else the initial size is too small
  UmlDesktop::setsize_center(this, previous_size, 0.3, 0.3);
}
Esempio n. 8
0
void WoCluster::constructor()
{
//  Create the component Widgets
  Q3VBoxLayout *_mainLayout      = new Q3VBoxLayout(this, 0, 2, "_layoutMain"); 
  Q3HBoxLayout *_woLayout        = new Q3HBoxLayout(0, 0, 5, "_layoutLit"); 
  Q3HBoxLayout *_warehouseLayout = new Q3HBoxLayout(0, 0, 5, "_layoutLit"); 
  Q3HBoxLayout *_line1Layout     = new Q3HBoxLayout(0, 0, 7, "_layoutLit"); 
  Q3HBoxLayout *_itemLayout      = new Q3HBoxLayout(0, 0, 5, "_layoutLit"); 
  Q3HBoxLayout *_uomLayout       = new Q3HBoxLayout(0, 0, 5, "_layoutLit"); 
  Q3HBoxLayout *_line2Layout     = new Q3HBoxLayout(0, 0, 7, "_layoutLit"); 
  Q3HBoxLayout *_statusLayout    = new Q3HBoxLayout(0, 0, 5, "_layoutLit"); 

  QLabel *woNumberLit = new QLabel(tr("Work Order #:"), this, "woNumberLit");
  woNumberLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  woNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _woLayout->addWidget(woNumberLit);

  _woNumber = new WoLineEdit(this);
  _woNumber->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _woLayout->addWidget(_woNumber);

  _woList = new QPushButton(tr("..."), this, "_woList");
  _woList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
#ifndef Q_WS_MAC
  _woList->setMaximumWidth(25);
#endif
  _woList->setFocusPolicy(Qt::NoFocus);
  _woLayout->addWidget(_woList);
  _line1Layout->addLayout(_woLayout);

  QLabel *warehouseLit = new QLabel(tr("Whs.:"), this, "warehouseLit");
  _woNumber->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  warehouseLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _warehouseLayout->addWidget(warehouseLit);

  _warehouse = new QLabel(this, "_warehouse");
  _warehouse->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  _warehouse->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _warehouseLayout->addWidget(_warehouse);
  _line1Layout->addLayout(_warehouseLayout);
  _mainLayout->addLayout(_line1Layout);

  QLabel *itemNumberLit = new QLabel(tr("Item Number:"), this, "itemNumberLit");
  itemNumberLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  itemNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _itemLayout->addWidget(itemNumberLit);

  _itemNumber = new QLabel(this, "_itemNumber");
  _itemNumber->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _itemNumber->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _itemLayout->addWidget(_itemNumber);
  _line2Layout->addLayout(_itemLayout);

  QLabel *uomLit = new QLabel(tr("UOM:"), this, "uomLit");
  uomLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  uomLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _uomLayout->addWidget(uomLit);

  _uom = new QLabel(this, "_uom");
  _uom->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  _uom->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _uomLayout->addWidget(_uom);
  _line2Layout->addLayout(_uomLayout);
  _mainLayout->addLayout(_line2Layout);

  _descrip1 = new QLabel(this, "_descrip1");
  _descrip1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _descrip1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _mainLayout->addWidget(_descrip1);

  _descrip2 = new QLabel(this, "_descrip2");
  _descrip2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _descrip2->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _mainLayout->addWidget(_descrip2);

  QLabel *statusLit = new QLabel(tr("Status:"), this, "statusLit");
  statusLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  statusLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _statusLayout->addWidget(statusLit);

  _status = new QLabel(this, "_status");
  _status->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _status->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _statusLayout->addWidget(_status);
  _mainLayout->addLayout(_statusLayout);

//  Make some internal connections
  connect(_woNumber, SIGNAL(itemNumberChanged(const QString &)), _itemNumber, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(uomChanged(const QString &)), _uom, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(itemDescrip1Changed(const QString &)), _descrip1, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(itemDescrip2Changed(const QString &)), _descrip2, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(warehouseChanged(const QString &)), _warehouse, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(statusChanged(const QString &)), _status, SLOT(setText(const QString &)));

  connect(_woNumber, SIGNAL(newId(int)), this, SIGNAL(newId(int)));
  connect(_woNumber, SIGNAL(newItemid(int)), this, SIGNAL(newItemid(int)));
  connect(_woNumber, SIGNAL(startDateChanged(const QDate &)), this, SIGNAL(startDateChanged(const QDate &)));
  connect(_woNumber, SIGNAL(dueDateChanged(const QDate &)), this, SIGNAL(dueDateChanged(const QDate &)));
  connect(_woNumber, SIGNAL(qtyOrderedChanged(const QString &)), this, SIGNAL(qtyOrderedChanged(const QString &)));
  connect(_woNumber, SIGNAL(qtyReceivedChanged(const QString &)), this, SIGNAL(qtyReceivedChanged(const QString &)));
  connect(_woNumber, SIGNAL(qtyBalanceChanged(const QString &)), this, SIGNAL(qtyBalanceChanged(const QString &)));
  connect(_woNumber, SIGNAL(valid(bool)), this, SIGNAL(valid(bool)));

  connect(_woList, SIGNAL(clicked()), SLOT(sWoList()));
  connect(_woNumber, SIGNAL(requestList()), SLOT(sWoList()));

  setFocusProxy(_woNumber);
}
Esempio n. 9
0
ExampleWidget::ExampleWidget( QWidget *parent, const char *name )
    : QWidget( parent, name )
{
    // Make the top-level layout; a vertical box to contain all widgets
    // and sub-layouts.
    QBoxLayout *topLayout = new QVBoxLayout( this, 5 );

    // Create a menubar...
    QMenuBar *menubar = new QMenuBar( this );
    menubar->setSeparator( QMenuBar::InWindowsStyle );
    QPopupMenu* popup;
    popup = new QPopupMenu( this );
    popup->insertItem( "&Quit", qApp, SLOT(quit()) );
    menubar->insertItem( "&File", popup );

    // ...and tell the layout about it.
    topLayout->setMenuBar( menubar );

    // Make an hbox that will hold a row of buttons.
    QBoxLayout *buttons = new QHBoxLayout( topLayout );
    int i;
    for ( i = 1; i <= 4; i++ ) {
	QPushButton* but = new QPushButton( this );
	QString s;
	s.sprintf( "Button %d", i );
	but->setText( s );

	// Set horizontal stretch factor to 10 to let the buttons
	// stretch horizontally. The buttons will not stretch
	// vertically, since bigWidget below will take up vertical
	// stretch.
	buttons->addWidget( but, 10 );
	// (Actually, the result would have been the same with a
	// stretch factor of 0; if no items in a layout have non-zero
	// stretch, the space is divided equally between members.)
    }

    // Make another hbox that will hold a left-justified row of buttons.
    QBoxLayout *buttons2 = new QHBoxLayout( topLayout );

    QPushButton* but = new QPushButton( "Button five", this );
    buttons2->addWidget( but );

    but = new QPushButton( "Button 6", this );
    buttons2->addWidget( but );

    // Fill up the rest of the hbox with stretchable space, so that
    // the buttons get their minimum width and are pushed to the left.
    buttons2->addStretch( 10 );

    // Make  a big widget that will grab all space in the middle.
    QMultiLineEdit *bigWidget = new QMultiLineEdit( this );
    bigWidget->setText( "This widget will get all the remaining space" );
    bigWidget->setFrameStyle( QFrame::Panel | QFrame::Plain );

    // Set vertical stretch factor to 10 to let the bigWidget stretch
    // vertically. It will stretch horizontally because there are no
    // widgets beside it to take up horizontal stretch.
    //    topLayout->addWidget( bigWidget, 10 );
    topLayout->addWidget( bigWidget ); 

    // Make a grid that will hold a vertical table of QLabel/QLineEdit
    // pairs next to a large QMultiLineEdit.

    // Don't use hard-coded row/column numbers in QGridLayout, you'll
    // regret it when you have to change the layout.
    const int numRows = 3;
    const int labelCol = 0;
    const int linedCol = 1;
    const int multiCol = 2;

    // Let the grid-layout have a spacing of 10 pixels between
    // widgets, overriding the default from topLayout.
    QGridLayout *grid = new QGridLayout( topLayout, 0, 0, 10 );
    int row;

    for ( row = 0; row < numRows; row++ ) {
	QLineEdit *ed = new QLineEdit( this );
	// The line edit goes in the second column
	grid->addWidget( ed, row, linedCol );	

	// Make a label that is a buddy of the line edit
	QString s;
	s.sprintf( "Line &%d", row+1 );
	QLabel *label = new QLabel( ed, s, this );
	// The label goes in the first column.
	grid->addWidget( label, row, labelCol );
    }

    // The multiline edit will cover the entire vertical range of the
    // grid (rows 0 to numRows) and stay in column 2.

    QMultiLineEdit *med = new QMultiLineEdit( this );
    grid->addMultiCellWidget( med, 0, -1, multiCol, multiCol );

    // The labels will take the space they need. Let the remaining
    // horizontal space be shared so that the multiline edit gets
    // twice as much as the line edit.
    grid->setColStretch( linedCol, 10 );
    grid->setColStretch( multiCol, 20 );

    // Add a widget at the bottom.
    QLabel* sb = new QLabel( this );
    sb->setText( "Let's pretend this is a status bar" );
    sb->setFrameStyle( QFrame::Panel | QFrame::Sunken );
    // This widget will use all horizontal space, and have a fixed height.

    // we should have made a subclass and implemented sizePolicy there...
    sb->setFixedHeight( sb->sizeHint().height() );

    sb->setAlignment( AlignVCenter | AlignLeft );
    topLayout->addWidget( sb );

    topLayout->activate();
}
Esempio n. 10
0
QWidget *image_format_param_t::do_create_widgets()
{
    QWidget *top = new QWidget();

    menu_ = new QComboBox( top);
    QSize s = menu_->sizeHint();

    QLabel *label = new QLabel( top);
    label->move( 0, 0);
    label->resize( app().ui()->inspector().left_margin() - 5, s.height());
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter);
    label->setText( name().c_str());

    menu_->setFocusPolicy( Qt::NoFocus);

    for( int i = 0; i < image::format_t::presets().size(); ++i)
        menu_->addItem( image::format_t::presets()[i].first.c_str());

    menu_->addItem( "Custom");

    image::format_t format( get_value<image::format_t>( *this));

    menu_->move( app().ui()->inspector().left_margin(), 0);
    menu_->setCurrentIndex( format.preset_index());
    menu_->setEnabled( enabled());
    connect( menu_, SIGNAL( currentIndexChanged( int)), this, SLOT( preset_picked(int)));
    int h = s.height() + 5;

    width_input_ = new ui::double_spinbox_t( top);
    width_input_->setRange( 16, app().preferences().max_image_width());
    width_input_->setDecimals( 0);
    width_input_->setTrackMouse( false);
    width_input_->setValue( value().cast<image::format_t>().width);
    width_input_->move( app().ui()->inspector().left_margin(), h);
    width_input_->setMinimum( 16);
    width_input_->setValue( format.width);
    width_input_->setEnabled( enabled());
    connect( width_input_, SIGNAL( valueChanged( double)), this, SLOT( set_new_format( double)));
    s = width_input_->sizeHint();

    height_input_ = new ui::double_spinbox_t( top);
    height_input_->setRange( 16, app().preferences().max_image_height());
    height_input_->setDecimals( 0);
    height_input_->setValue( value().cast<image::format_t>().height);
    height_input_->setTrackMouse( false);
    height_input_->setEnabled( enabled());
    height_input_->move( app().ui()->inspector().left_margin() + s.width() + 5, h);
    height_input_->setMinimum( 16);
    height_input_->setValue( format.height);
    connect( height_input_, SIGNAL( valueChanged( double)), this, SLOT( set_new_format(double)));

    aspect_input_ = new ui::double_spinbox_t( top);
    aspect_input_->setValue( 1);
    aspect_input_->setTrackMouse( false);
    aspect_input_->setEnabled( enabled());
    aspect_input_->setValue( format.aspect);
    aspect_input_->setDecimals( 3);
    aspect_input_->setMinimum( 0.1);
    aspect_input_->setSingleStep( 0.05);
    aspect_input_->move( app().ui()->inspector().left_margin() + ( 2 * s.width()) + 10, h);
    connect( aspect_input_, SIGNAL( valueChanged( double)), this, SLOT( set_new_format(double)));
    h += s.height() + 5;

    int w = ( width_input_->sizeHint().width() * 2) + aspect_input_->sizeHint().width() + 10;
    menu_->resize( w, menu_->sizeHint().height());

    top->setMinimumSize( app().ui()->inspector().width(), h);
    top->setMaximumSize( app().ui()->inspector().width(), h);
    top->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed);
    return top;
}
Esempio n. 11
0
void DetailWindow::analysisFinished(){
  QString error = analysisWatcher.result().errorMessage;
  if(error != ""){
    say(error);
    cleanUpAfterRun();
    return;
  }
  // Title bar
  TagLibMetadata md(filePath);
  QString shortName = md.getTitle();
  if(shortName == "")
    shortName = filePath.mid(filePath.lastIndexOf("/") + 1);
  this->setWindowTitle(GuiStrings::getInstance()->appName() + GuiStrings::getInstance()->delim() + tr("Detailed Analysis") + GuiStrings::getInstance()->delim() + shortName);
  // full chromagram
  chromagramImage = imageFromChromagram(analysisWatcher.result().core.fullChromagram);
  ui->chromagramLabel->setPixmap(QPixmap::fromImage(chromagramImage));
  ui->chromagramLabel->setMinimumHeight(analysisWatcher.result().core.fullChromagram.getBins()+2);
  ui->chromagramLabel->setMinimumWidth(analysisWatcher.result().core.fullChromagram.getHops()+2);
  // one octave chromagram
  miniChromagramImage = imageFromChromagram(analysisWatcher.result().core.oneOctaveChromagram);
  ui->miniChromagramLabel->setPixmap(QPixmap::fromImage(miniChromagramImage));
  //: A tooltip on the Detail window
  ui->miniChromagramLabel->setToolTip(wrapToolTip(tr("This is the same chromagram data, reduced to a single octave.")));
  // harmonic change signal
  int rateOfChangePrecision = 100;
  int size = (signed)analysisWatcher.result().core.harmonicChangeSignal.size();
  harmonicChangeImage = QImage(size*chromaScaleH,rateOfChangePrecision,QImage::Format_Indexed8);
  prefs.setImageColours(harmonicChangeImage,ui->chromaColourCombo->currentIndex());
  for(int h=0; h<size; h++){
    int value = analysisWatcher.result().core.harmonicChangeSignal[h] * rateOfChangePrecision;
    for(int y=0; y<rateOfChangePrecision; y++)
      for(int x=0; x<chromaScaleH; x++)
        harmonicChangeImage.setPixel(h*chromaScaleH+x, y, (rateOfChangePrecision - y > value ? 0 : 50));
  }
  ui->harmonicChangeLabel->setPixmap(QPixmap::fromImage(harmonicChangeImage));
  // Tooltip
  if(prefs.getSegmentation() == 'n'){
    //: A tooltip on the Detail window
    ui->harmonicChangeLabel->setToolTip(wrapToolTip(tr("You are not using segmentation, so there is no harmonic change data to display.")));
  }else if(prefs.getSegmentation() == 'a'){
    //: A tooltip on the Detail window
    ui->harmonicChangeLabel->setToolTip(wrapToolTip(tr("You are using arbitrary segmentation, so there is no harmonic change data to display.")));
  }else{
    //: A tooltip on the Detail window
    ui->harmonicChangeLabel->setToolTip(wrapToolTip(tr("This is the level of harmonic change detected in the chromagram over time. Peaks in this signal are used to segment the chromagram.")));
  }
  // Key estimates
  deleteKeyLabels();
  int lastChange = -1; // enable correct stretch policy for first segment
  for(int h = 0; h < (signed)analysisWatcher.result().core.segments.size(); h++){
    QLabel* newLabel = new QLabel(prefs.getKeyCode(analysisWatcher.result().core.segments[h].key));
    newLabel->setAlignment(Qt::AlignCenter);
    QPalette pal = newLabel->palette();
    pal.setColor(backgroundRole(), prefs.getKeyColour(analysisWatcher.result().core.segments[h].key));
    newLabel->setPalette(pal);
    newLabel->setFrameStyle(1);
    newLabel->setAutoFillBackground(true);
    newLabel->setMinimumHeight(20);
    newLabel->setMaximumHeight(30);
    if(prefs.getSegmentation() == 'n'){
      //: A tooltip on the Detail window
      newLabel->setToolTip(wrapToolTip(tr("This row shows the key estimate for the unsegmented chromagram.")));
    }else if(prefs.getSegmentation() == 'a'){
      //: A tooltip on the Detail window
      newLabel->setToolTip(wrapToolTip(tr("This row shows the key estimates for the arbitrary segments.")));
    }else{
      //: A tooltip on the Detail window
      newLabel->setToolTip(wrapToolTip(tr("This row shows the key estimates for the segments between peak harmonic changes.")));
    }
    ui->horizontalLayout_keyLabels->addWidget(newLabel, h - lastChange);
    keyLabels.push_back(newLabel);
    lastChange = h;
  }
  //: Text in the Batch window status bar; includes a key code at %1
  say(tr("Key estimate: %1").arg(prefs.getKeyCode(analysisWatcher.result().core.globalKeyEstimate)));
  cleanUpAfterRun();
}
Esempio n. 12
0
KCMStyle::KCMStyle( QWidget* parent, const char* name )
	: KCModule( parent, name ), appliedStyle(NULL)
{
    setQuickHelp( i18n("<h1>Style</h1>"
			"This module allows you to modify the visual appearance "
			"of user interface elements, such as the widget style "
			"and effects."));

	m_bEffectsDirty = false;
	m_bStyleDirty= false;
	m_bToolbarsDirty = false;

	KGlobal::dirs()->addResourceType("themes",
		KStandardDirs::kde_default("data") + "kstyle/themes");

	KAboutData *about =
		new KAboutData( I18N_NOOP("kcmstyle"),
						I18N_NOOP("KDE Style Module"),
						0, 0, KAboutData::License_GPL,
						I18N_NOOP("(c) 2002 Karol Szwed, Daniel Molkentin"));

	about->addAuthor("Karol Szwed", 0, "*****@*****.**");
	about->addAuthor("Daniel Molkentin", 0, "*****@*****.**");
	about->addAuthor("Ralf Nolden", 0, "*****@*****.**");
	setAboutData( about );

	// Setup pages and mainLayout
	mainLayout = new QVBoxLayout( this );
	tabWidget  = new QTabWidget( this );
	mainLayout->addWidget( tabWidget );

	page1 = new QWidget( tabWidget );
	page1Layout = new QVBoxLayout( page1, KDialog::marginHint(), KDialog::spacingHint() );
	page2 = new QWidget( tabWidget );
	page2Layout = new QVBoxLayout( page2, KDialog::marginHint(), KDialog::spacingHint() );
	page3 = new QWidget( tabWidget );
	page3Layout = new QVBoxLayout( page3, KDialog::marginHint(), KDialog::spacingHint() );

	// Add Page1 (Style)
	// -----------------
	gbWidgetStyle = new QGroupBox( i18n("Widget Style"), page1, "gbWidgetStyle" );
	gbWidgetStyle->setColumnLayout( 0, Qt::Vertical );
	gbWidgetStyle->layout()->setMargin( KDialog::marginHint() );
	gbWidgetStyle->layout()->setSpacing( KDialog::spacingHint() );

	gbWidgetStyleLayout = new QVBoxLayout( gbWidgetStyle->layout() );
	gbWidgetStyleLayout->setAlignment( Qt::AlignTop );
	hbLayout = new QHBoxLayout( KDialog::spacingHint(), "hbLayout" );

	cbStyle = new KComboBox( gbWidgetStyle, "cbStyle" );
	cbStyle->setEditable( FALSE );
	hbLayout->addWidget( cbStyle );

	pbConfigStyle = new QPushButton( i18n("Con&figure..."), gbWidgetStyle );
	pbConfigStyle->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Minimum );
	pbConfigStyle->setEnabled( FALSE );
	hbLayout->addWidget( pbConfigStyle );

	gbWidgetStyleLayout->addLayout( hbLayout );

	lblStyleDesc = new QLabel( gbWidgetStyle );
	lblStyleDesc->setTextFormat(Qt::RichText);
	gbWidgetStyleLayout->addWidget( lblStyleDesc );

	cbIconsOnButtons = new QCheckBox( i18n("Sho&w icons on buttons"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbIconsOnButtons );
	cbEnableTooltips = new QCheckBox( i18n("E&nable tooltips"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbEnableTooltips );
	cbTearOffHandles = new QCheckBox( i18n("Show tear-off handles in &popup menus"), gbWidgetStyle );
	gbWidgetStyleLayout->addWidget( cbTearOffHandles );
	cbTearOffHandles->hide(); // reenable when the corresponding Qt method is virtual and properly reimplemented

    QGroupBox *gbPreview = new QGroupBox( i18n( "Preview" ), page1 );
	gbPreview->setColumnLayout( 0, Vertical );
	gbPreview->layout()->setMargin( 0 );
	gbPreview->layout()->setSpacing( KDialog::spacingHint() );
	gbPreview->setFlat( true );
	stylePreview = new StylePreview( gbPreview );
	gbPreview->layout()->add( stylePreview );

	page1Layout->addWidget( gbWidgetStyle );
	page1Layout->addWidget( gbPreview );

	// Connect all required stuff
	connect( cbStyle, SIGNAL(activated(int)), this, SLOT(styleChanged()) );
	connect( cbStyle, SIGNAL(activated(int)), this, SLOT(updateConfigButton()));
	connect( pbConfigStyle, SIGNAL(clicked()), this, SLOT(styleSpecificConfig()));

	// Add Page2 (Effects)
	// -------------------
	cbEnableEffects = new QCheckBox( i18n("&Enable GUI effects"), page2 );
	containerFrame = new QFrame( page2 );
	containerFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
	containerFrame->setMargin(0);
	containerLayout = new QGridLayout( containerFrame, 1, 1,	// rows, columns
		KDialog::marginHint(), KDialog::spacingHint() );

	comboComboEffect = new QComboBox( FALSE, containerFrame );
	comboComboEffect->insertItem( i18n("Disable") );
	comboComboEffect->insertItem( i18n("Animate") );
	lblComboEffect = new QLabel( i18n("Combobo&x effect:"), containerFrame );
	lblComboEffect->setBuddy( comboComboEffect );
	containerLayout->addWidget( lblComboEffect, 0, 0 );
	containerLayout->addWidget( comboComboEffect, 0, 1 );

	comboTooltipEffect = new QComboBox( FALSE, containerFrame );
	comboTooltipEffect->insertItem( i18n("Disable") );
	comboTooltipEffect->insertItem( i18n("Animate") );
	comboTooltipEffect->insertItem( i18n("Fade") );
	lblTooltipEffect = new QLabel( i18n("&Tool tip effect:"), containerFrame );
	lblTooltipEffect->setBuddy( comboTooltipEffect );
	containerLayout->addWidget( lblTooltipEffect, 1, 0 );
	containerLayout->addWidget( comboTooltipEffect, 1, 1 );

	comboMenuEffect = new QComboBox( FALSE, containerFrame );
	comboMenuEffect->insertItem( i18n("Disable") );
	comboMenuEffect->insertItem( i18n("Animate") );
	comboMenuEffect->insertItem( i18n("Fade") );
	comboMenuEffect->insertItem( i18n("Make Translucent") );
	lblMenuEffect = new QLabel( i18n("&Menu effect:"), containerFrame );
	lblMenuEffect->setBuddy( comboMenuEffect );
	containerLayout->addWidget( lblMenuEffect, 2, 0 );
	containerLayout->addWidget( comboMenuEffect, 2, 1 );

	comboMenuHandle = new QComboBox( FALSE, containerFrame );
	comboMenuHandle->insertItem( i18n("Disable") );
	comboMenuHandle->insertItem( i18n("Application Level") );
//	comboMenuHandle->insertItem( i18n("Enable") );
	lblMenuHandle = new QLabel( i18n("Me&nu tear-off handles:"), containerFrame );
	lblMenuHandle->setBuddy( comboMenuHandle );
	containerLayout->addWidget( lblMenuHandle, 3, 0 );
	containerLayout->addWidget( comboMenuHandle, 3, 1 );

	cbMenuShadow = new QCheckBox( i18n("Menu &drop shadow"), containerFrame );
	containerLayout->addWidget( cbMenuShadow, 4, 0 );

	// Push the [label combo] to the left.
	comboSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
	containerLayout->addItem( comboSpacer, 1, 2 );

	// Separator.
	QFrame* hline = new QFrame ( page2 );
	hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );

	// Now implement the Menu Transparency container.
	menuContainer = new QFrame( page2 );
	menuContainer->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
	menuContainer->setMargin(0);
	menuContainerLayout = new QGridLayout( menuContainer, 1, 1,    // rows, columns
		KDialog::marginHint(), KDialog::spacingHint() );

	menuPreview = new MenuPreview( menuContainer, /* opacity */ 90, MenuPreview::Blend );

	comboMenuEffectType = new QComboBox( FALSE, menuContainer );
	comboMenuEffectType->insertItem( i18n("Software Tint") );
	comboMenuEffectType->insertItem( i18n("Software Blend") );
#ifdef HAVE_XRENDER
	comboMenuEffectType->insertItem( i18n("XRender Blend") );
#endif

	// So much stuffing around for a simple slider..
	sliderBox = new QVBox( menuContainer );
	sliderBox->setSpacing( KDialog::spacingHint() );
	sliderBox->setMargin( 0 );
	slOpacity = new QSlider( 0, 100, 5, /*opacity*/ 90, Qt::Horizontal, sliderBox );
	slOpacity->setTickmarks( QSlider::Below );
	slOpacity->setTickInterval( 10 );
	QHBox* box1 = new QHBox( sliderBox );
	box1->setSpacing( KDialog::spacingHint() );
	box1->setMargin( 0 );
	QLabel* lbl = new QLabel( i18n("0%"), box1 );
	lbl->setAlignment( AlignLeft );
	lbl = new QLabel( i18n("50%"), box1 );
	lbl->setAlignment( AlignHCenter );
	lbl = new QLabel( i18n("100%"), box1 );
	lbl->setAlignment( AlignRight );

	lblMenuEffectType = new QLabel( comboMenuEffectType, i18n("Menu trans&lucency type:"), menuContainer );
	lblMenuEffectType->setAlignment( AlignBottom | AlignLeft );
	lblMenuOpacity    = new QLabel( slOpacity, i18n("Menu &opacity:"), menuContainer );
	lblMenuOpacity->setAlignment( AlignBottom | AlignLeft );

	menuContainerLayout->addWidget( lblMenuEffectType, 0, 0 );
	menuContainerLayout->addWidget( comboMenuEffectType, 1, 0 );
	menuContainerLayout->addWidget( lblMenuOpacity, 2, 0 );
	menuContainerLayout->addWidget( sliderBox, 3, 0 );
	menuContainerLayout->addMultiCellWidget( menuPreview, 0, 3, 1, 1 );

	// Layout page2.
	page2Layout->addWidget( cbEnableEffects );
	page2Layout->addWidget( containerFrame );
	page2Layout->addWidget( hline );
	page2Layout->addWidget( menuContainer );

	QSpacerItem* sp1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
	page2Layout->addItem( sp1 );

	// Data flow stuff.
	connect( cbEnableEffects,     SIGNAL(toggled(bool)), containerFrame, SLOT(setEnabled(bool)) );
	connect( cbEnableEffects,     SIGNAL(toggled(bool)), this, SLOT(menuEffectChanged(bool)) );
	connect( slOpacity,           SIGNAL(valueChanged(int)),menuPreview, SLOT(setOpacity(int)) );
	connect( comboMenuEffect,     SIGNAL(activated(int)), this, SLOT(menuEffectChanged()) );
	connect( comboMenuEffect,     SIGNAL(highlighted(int)), this, SLOT(menuEffectChanged()) );
	connect( comboMenuEffectType, SIGNAL(activated(int)), this, SLOT(menuEffectTypeChanged()) );
	connect( comboMenuEffectType, SIGNAL(highlighted(int)), this, SLOT(menuEffectTypeChanged()) );

	// Add Page3 (Miscellaneous)
	// -------------------------
	cbHoverButtons = new QCheckBox( i18n("High&light buttons under mouse"), page3 );
	cbTransparentToolbars = new QCheckBox( i18n("Transparent tool&bars when moving"), page3 );

	QWidget * dummy = new QWidget( page3 );
	
	QHBoxLayout* box2 = new QHBoxLayout( dummy, 0, KDialog::spacingHint() );
	lbl = new QLabel( i18n("Text pos&ition:"), dummy );
	comboToolbarIcons = new QComboBox( FALSE, dummy );
	comboToolbarIcons->insertItem( i18n("Icons Only") );
	comboToolbarIcons->insertItem( i18n("Text Only") );
	comboToolbarIcons->insertItem( i18n("Text Alongside Icons") );
	comboToolbarIcons->insertItem( i18n("Text Under Icons") );
	lbl->setBuddy( comboToolbarIcons );

	box2->addWidget( lbl );
	box2->addWidget( comboToolbarIcons );
	QSpacerItem* sp2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
	box2->addItem( sp2 );
	
	page3Layout->addWidget( cbHoverButtons );
	page3Layout->addWidget( cbTransparentToolbars );
	page3Layout->addWidget( dummy );
	
	// Layout page3.
	QSpacerItem* sp3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
	page3Layout->addItem( sp3 );

	// Load settings
	load();

	// Do all the setDirty connections.
	connect(cbStyle, SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
	// Page2
	connect( cbEnableEffects,     SIGNAL(toggled(bool)),    this, SLOT(setEffectsDirty()));
	connect( cbEnableEffects,     SIGNAL(toggled(bool)),    this, SLOT(setStyleDirty()));
	connect( comboTooltipEffect,  SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
	connect( comboComboEffect,    SIGNAL(activated(int)), this, SLOT(setEffectsDirty()));
	connect( comboMenuEffect,     SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
	connect( comboMenuHandle,     SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
	connect( comboMenuEffectType, SIGNAL(activated(int)), this, SLOT(setStyleDirty()));
	connect( slOpacity,           SIGNAL(valueChanged(int)),this, SLOT(setStyleDirty()));
	connect( cbMenuShadow,        SIGNAL(toggled(bool)),    this, SLOT(setStyleDirty()));
	// Page3
	connect( cbHoverButtons,        SIGNAL(toggled(bool)),    this, SLOT(setToolbarsDirty()));
	connect( cbTransparentToolbars, SIGNAL(toggled(bool)),    this, SLOT(setToolbarsDirty()));
	connect( cbEnableTooltips,      SIGNAL(toggled(bool)),    this, SLOT(setEffectsDirty()));
	connect( cbIconsOnButtons,      SIGNAL(toggled(bool)),    this, SLOT(setEffectsDirty()));
	connect( cbTearOffHandles,      SIGNAL(toggled(bool)),    this, SLOT(setEffectsDirty()));
	connect( comboToolbarIcons,     SIGNAL(activated(int)), this, SLOT(setToolbarsDirty()));

	addWhatsThis();

	// Insert the pages into the tabWidget
	tabWidget->insertTab( page1, i18n("&Style"));
	tabWidget->insertTab( page2, i18n("&Effects"));
	tabWidget->insertTab( page3, i18n("&Toolbar"));

	//Enable/disable the button for the initial style
	updateConfigButton();
}
Esempio n. 13
0
Donate::Donate(QWidget *parent) : QDialog(parent)
{
    resize(400, 0);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    // Initialize "Thanks" section:

    QString thanks = QString("<hr>%1:<br>").arg(tr("Thank you for your support"));

    QRegExp rx("\\((.+)\\)");
    rx.setMinimal(true);

    QFile inputFile(APPDIR + "/authors.txt");
    if (inputFile.open(QIODevice::ReadOnly)) {

        QTextStream stream(&inputFile);

        while (!stream.atEnd()) {

            QString line = stream.readLine();

            if (line == "Supported by:") {
                while (!line.isEmpty() && !stream.atEnd()) {
                    line = stream.readLine();
                    line = line.replace(rx, "(<a href=\"\\1\">\\1</a>)");
                    thanks += line + "<br>";
                }
                thanks.chop(8);
                break;
            }
        }

        inputFile.close();
    }

    // Create GUI:

    QGridLayout *grid = new QGridLayout(this);
    QLabel *donators = new QLabel(this);
    donators->setAlignment(Qt::AlignCenter);
    donators->setTextFormat(Qt::RichText);
    donators->setOpenExternalLinks(true);
    donators->setText(thanks);

    QLabel *titlePayPal = new QLabel("PayPal", this);
    QLabel *titleBitCoin = new QLabel("BitCoin", this);
    QLineEdit *fieldPayPal = new QLineEdit(PAYPAL, this);
    QLineEdit *fieldBitCoin = new QLineEdit(BITCOIN, this);
    fieldPayPal->setReadOnly(true);
    fieldBitCoin->setReadOnly(true);
    fieldPayPal->setCursor(Qt::IBeamCursor);
    fieldBitCoin->setCursor(Qt::IBeamCursor);

    QToolButton *btnPayPal = new QToolButton(this);
    QToolButton *btnBitCoin = new QToolButton(this);
    btnPayPal->setIcon(QIcon(":/gfx/actions/copy.png"));
    btnBitCoin->setIcon(QIcon(":/gfx/actions/copy.png"));
    btnPayPal->setToolTip(tr("Copy to Clipboard"));
    btnBitCoin->setToolTip(tr("Copy to Clipboard"));

    QPushButton *btnOk = new QPushButton("OK", this);

    grid->addWidget(titlePayPal, 0, 0);
    grid->addWidget(fieldPayPal, 0, 1);
    grid->addWidget(btnPayPal, 0, 2);
    grid->addWidget(titleBitCoin, 1, 0);
    grid->addWidget(fieldBitCoin, 1, 1);
    grid->addWidget(btnBitCoin, 1, 2);
    grid->addWidget(btnOk, 2, 1);
    grid->addWidget(donators, 3, 1);

    connect(btnPayPal, SIGNAL(clicked()), this, SLOT(copyPayPal()));
    connect(btnBitCoin, SIGNAL(clicked()), this, SLOT(copyBitCoin()));
    connect(btnOk, SIGNAL(clicked()), this, SLOT(accept()));
}
Esempio n. 14
0
ActionWidget::ActionWidget( const ActionList *list, ConfigDialog* configWidget, QWidget *parent,
                            const char *name )
    : KVBox( parent ),
      advancedWidget( 0L )
{
    setObjectName(name);

    Q_ASSERT( list != 0L );

    QLabel *lblAction = new QLabel(
	  i18n("Action &list (right click to add/remove commands):"), this );

    listView = new ListView( configWidget, this );
    lblAction->setBuddy( listView );
    listView->addColumn( i18n("Regular Expression (see http://doc.trolltech.com/qregexp.html#details)") );
    listView->addColumn( i18n("Description") );

    listView->setRenameable(0);
    listView->setRenameable(1);
    listView->setItemsRenameable( true );
    listView->setItemsMovable( false );
//     listView->setAcceptDrops( true );
//     listView->setDropVisualizer( true );
//     listView->setDragEnabled( true );

    listView->setRootIsDecorated( true );
    listView->setMultiSelection( false );
    listView->setAllColumnsShowFocus( true );
    listView->setSelectionMode( Q3ListView::Single );
    connect( listView, SIGNAL(executed( Q3ListViewItem*, const QPoint&, int )),
             SLOT( slotItemChanged( Q3ListViewItem*, const QPoint& , int ) ));
    connect( listView, SIGNAL( selectionChanged ( Q3ListViewItem * )),
             SLOT(selectionChanged ( Q3ListViewItem * )));
    connect(listView,
            SIGNAL(contextMenu(K3ListView *, Q3ListViewItem *, const QPoint&)),
            SLOT( slotContextMenu(K3ListView*, Q3ListViewItem*, const QPoint&)));

    ClipAction *action   = 0L;
    ClipCommand *command = 0L;
    Q3ListViewItem *item  = 0L;
    Q3ListViewItem *child = 0L;
    Q3ListViewItem *after = 0L; // QListView's default inserting really sucks
    ActionListIterator it( *list );

    const QPixmap& doc = SmallIcon( "misc" );
    const QPixmap& exec = SmallIcon( "exec" );

    for ( action = it.current(); action; action = ++it ) {
        item = new Q3ListViewItem( listView, after,
                                  action->regExp(), action->description() );
        item->setPixmap( 0, doc );

        Q3PtrListIterator<ClipCommand> it2( action->commands() );
        for ( command = it2.current(); command; command = ++it2 ) {
            child = new Q3ListViewItem( item, after,
                                       command->command, command->description);
        if ( command->pixmap.isEmpty() )
            child->setPixmap( 0, exec );
        else
            child->setPixmap( 0, SmallIcon( command->pixmap ) );
            after = child;
        }
        after = item;
    }

    listView->setSorting( -1 ); // newly inserted items just append unsorted

    cbUseGUIRegExpEditor = new QCheckBox( i18n("&Use graphical editor for editing regular expressions" ), this );
    if ( KServiceTypeTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty() )
    {
	cbUseGUIRegExpEditor->hide();
	cbUseGUIRegExpEditor->setChecked( false );
    }

    KHBox *box = new KHBox( this );
    box->setSpacing( KDialog::spacingHint() );
    QPushButton *button = new QPushButton( i18n("&Add Action"), box );
    connect( button, SIGNAL( clicked() ), SLOT( slotAddAction() ));

    delActionButton = new QPushButton( i18n("&Delete Action"), box );
    connect( delActionButton, SIGNAL( clicked() ), SLOT( slotDeleteAction() ));

    QLabel *label = new QLabel(i18n("Click on a highlighted item's column to change it. \"%s\" in a command will be replaced with the clipboard contents."), box);
    label->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    label->setWordWrap( true );
    
    box->setStretchFactor( label, 5 );

    box = new KHBox( this );
    QPushButton *advanced = new QPushButton( i18n("Advanced..."), box );
    advanced->setFixedSize( advanced->sizeHint() );
    connect( advanced, SIGNAL( clicked() ), SLOT( slotAdvanced() ));
    (void) new QWidget( box ); // spacer

    delActionButton->setEnabled(listView->currentItem () !=0);
}
Esempio n. 15
0
void KPrWebPresentationWizard::setupPage1()
{
    page1 = new QHBox( this );
    QWhatsThis::add( page1, i18n("This page allows you to specify some of the key"
                                 " values for how your presentation will be shown"
                                 " in HTML. Select individual items for more help"
                                 " on what they do.") );
    page1->setSpacing( KDialog::spacingHint() );
    page1->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page1 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page1 );
    QGridLayout *layout = new QGridLayout( canvas, 7, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignTop| Qt::AlignLeft );
    helptext->setText( i18n( "Enter your name, email address and "
                             "the title of the web presentation. "
                             "Also enter the output directory where the "
                             "web presentation should be saved. " ) );
    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );

    QLabel *label1 = new QLabel( i18n("Author:"), canvas );
    label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label1, i18n("This is where you enter the name of the person or "
                                  "organization that should be named as the author of "
                                  "the presentation.") );
    layout->addWidget( label1, 2, 0 );

    QLabel *label2 = new QLabel( i18n("Title:"), canvas );
    label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label2, i18n("This is where you enter the title of the overall "
                                  "presentation." ) );
    layout->addWidget( label2, 3, 0 );

    QLabel *label3 = new QLabel( i18n("Email address:"), canvas );
    label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label3, i18n("This is where you enter the email address of the "
                                  "person or organization that is responsible for "
                                  "the presentation.") );
    layout->addWidget( label3, 4, 0 );

    QLabel *label4 = new QLabel( i18n("Path:"), canvas );
    label4->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label4, i18n("The value entered for the path is the directory "
                                  "where the presentation will be saved. If it does "
                                  "not exist, you'll be asked if you want to create "
                                  "the directory or abort the creation.") );
    layout->addWidget( label4, 5, 0 );

    author = new KLineEdit( webPres.getAuthor(), canvas );
    QWhatsThis::add( author, i18n("This is where you enter the name of the person or "
                                  "organization that should be named as the author of "
                                  "the presentation.") );
    layout->addWidget( author, 2, 1 );

    title = new KLineEdit( webPres.getTitle(), canvas );
    QWhatsThis::add( title, i18n("This is where you enter the title of the overall "
                                 "presentation." ) );
    layout->addWidget( title, 3, 1 );

    email = new KLineEdit( webPres.getEmail(), canvas );
    QWhatsThis::add( email, i18n("This is where you enter the email address of the "
                                 "person or organization that is responsible for "
                                 "the presentation.") );
    layout->addWidget( email, 4, 1 );

    path=new KURLRequester( canvas );
    path->setMode( KFile::Directory);
    path->lineEdit()->setText(webPres.getPath());
    QWhatsThis::add( path, i18n("The value entered for the path is the directory "
                                "where the presentation will be saved. If it does "
                                "not exist, you'll be asked if you want to create "
                                "the directory or abort the creation.") );
    layout->addWidget( path, 5, 1 );

    QSpacerItem* spacer = new QSpacerItem( 1, 10,
                                           QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addMultiCell( spacer, 6, 6, 0, 1 );

    connect(path, SIGNAL(textChanged(const QString&)),
            this,SLOT(slotChoosePath(const QString&)));
    connect(path, SIGNAL(urlSelected( const QString& )),
            this,SLOT(slotChoosePath(const QString&)));

    addPage( page1, i18n( "Step 1: General Information" ) );

    setHelpEnabled(page1, false);  //doesn't do anything currently
}
Esempio n. 16
0
GeneralTab::GeneralTab(const QString &fileName, QWidget *parent) :
    QWidget(parent)
{
    QGroupBox *communicationGroup = new QGroupBox(COMMUNICATION_CONFIG);

    QLabel *ipLabel = new QLabel(COMMUNICATION_IP);
    ipLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    m_pIpEdit = new QLineEdit();
    m_pIpEdit->setText(tr("127.0.0.1"));

    QLabel *srcPortLabel = new QLabel(COMMUNICATION_SRCPORT);
    srcPortLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    m_pSrcPortEdit = new QLineEdit();
    m_pSrcPortEdit->setText(tr("6009"));

    QLabel *destPortLabel = new QLabel(COMMUNICATION_DESTPORT);
    destPortLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    m_pDestPortEdit = new QLineEdit();
    m_pDestPortEdit->setText(tr("6008"));

    QLabel *askLabel = new QLabel(QStringLiteral("转发表功能:"));
    m_pYesRButton = new QRadioButton(QStringLiteral("启用"));
    m_pNoRButton = new QRadioButton(QStringLiteral("禁用"));
    m_pAskGrp = new QButtonGroup();
    m_pAskGrp->addButton(m_pYesRButton, 0);
    m_pAskGrp->addButton(m_pNoRButton, 1);
    m_pNoRButton->setChecked(true);
    connect(m_pAskGrp, SIGNAL(buttonReleased(int)), this, SLOT(changeTransPage(int)));
    QHBoxLayout *rbLayout = new QHBoxLayout();
    rbLayout->addWidget(m_pYesRButton);
    rbLayout->addWidget(m_pNoRButton);
    /////////////////////////////////////////////////////////////////
    m_pTransWidget = new QStackedWidget;
    m_pTransPage = new TransPage;
    m_pTransWidget->addWidget(m_pTransPage);
    m_pTransWidget->addWidget(new ReservePage);
    m_pTransWidget->setCurrentIndex(1);

    QGridLayout *gridLayout = new QGridLayout();
    //gridLayout->setSpacing(6);
    //gridLayout->setContentsMargins(40, 10, 40, 10);
    //gridLayout->setObjectName(QString::fromUtf8("gridLayout"));

    gridLayout->addWidget(ipLabel, 0, 0, 1, 1);
    gridLayout->addWidget(m_pIpEdit, 0, 1, 1, 1);
    gridLayout->addWidget(srcPortLabel, 1, 0, 1, 1);
    gridLayout->addWidget(m_pSrcPortEdit, 1, 1, 1, 1);
    gridLayout->addWidget(destPortLabel, 2, 0, 1, 1);
    gridLayout->addWidget(m_pDestPortEdit, 2, 1, 1, 1);
    gridLayout->addWidget(askLabel, 3, 0, 1, 1);
    gridLayout->addLayout(rbLayout, 3, 1, 1, 1);
    gridLayout->addWidget(m_pTransWidget, 4, 0, 1, 2);
    communicationGroup->setLayout(gridLayout);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(communicationGroup);
    mainLayout->addStretch(1);
    this->setLayout(mainLayout);

    SERVER_INFO Server;
    XmlParser parser;
    if (parser.readXml(fileName, XML_ELEMENT_SERVERINFO, &Server))
    {
        //qDebug() << fileName;
        m_pIpEdit->setText(Server.ip);
        m_pSrcPortEdit->setText(Server.srcPort);
        m_pDestPortEdit->setText(Server.destPort);
        m_pTransPage->setTransPort(Server.transPort);
        if(Server.transEnable.toInt())
        {
            m_pYesRButton->setChecked(true);
            m_pTransWidget->setCurrentIndex(0);
        }
    }
}
Esempio n. 17
0
void KPrWebPresentationWizard::setupPage2()
{
    page2 = new QHBox( this );
    QWhatsThis::add( page2, i18n("This page allows you to specify how the HTML "
                                 "for your presentation will be displayed. Select "
                                 "individual items for more help on what they do.") );
    page2->setSpacing( KDialog::spacingHint() );
    page2->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page2 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page2 );
    QGridLayout *layout = new QGridLayout( canvas, 6, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    QString help = i18n("Here you can configure the style of the web pages.");
    help += i18n( "You can also specify the zoom for the slides." );
    helptext->setText(help);

    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );

    QLabel *label1 = new QLabel( i18n("Zoom:"), canvas );
    label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label1, i18n( "This selection allows you to specify "
                                   "the size of the slide image." ) );
    layout->addWidget( label1, 2, 0 );

    QLabel *label2 = new QLabel( i18n( "Encoding:" ), canvas );
    label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );

    layout->addWidget( label2, 3, 0 );

    QLabel *label3 = new QLabel( i18n( "Document type:" ), canvas );
    label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label3, 4, 0 );

    zoom = new KIntNumInput( webPres.getZoom(), canvas );
    QWhatsThis::add( zoom, i18n( "This selection allows you to specify "
                                 "the size of the slide image." ) );
    layout->addWidget( zoom, 2, 1 );
    zoom->setSuffix( " %" );
    zoom->setRange( 25, 1000, 5 );

    encoding = new KComboBox( false, canvas );
    layout->addWidget( encoding, 3, 1 );

    // Fill encoding combo
    // Stolen from kdelibs/kate/part/katedialogs.cpp
    QStringList encodings(KGlobal::charsets()->descriptiveEncodingNames());
    int idx = 0;
    for (uint i = 0; i < encodings.count(); i++)
    {
      bool found = false;
      QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(encodings[i]), found);
      if (found)
      {
        encoding->insertItem(encodings[i]);

        if ( codecForEnc->name() == webPres.getEncoding() )
          encoding->setCurrentItem(idx);
        idx++;
      }
    }

    doctype = new KComboBox( false, canvas );
    layout->addWidget( doctype, 4, 1 );
    doctype->insertItem( "HTML 4.01", -1 );
    doctype->insertItem( "XHTML 1.0", -1 );

    doctype->setCurrentItem( webPres.isXML() ? 1 : 0 );

    QSpacerItem* spacer = new QSpacerItem( 1, 10,
                                           QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addMultiCell( spacer, 5, 5, 0, 1 );

    addPage( page2, i18n( "Step 2: Configure HTML" ) );

    setHelpEnabled(page2, false);  //doesn't do anything currently
}
Esempio n. 18
0
void WomatlCluster::constructor()
{
  _valid  = FALSE;
  _id     = -1;
  _woid   = -1;
  _type   = (Push | Pull | Mixed);

  _source = WoMaterial;
  _sourceId = -1;

  _required = 0.0;
  _issued = 0.0;

//  Create the component Widgets
  QLabel *itemNumberLit = new QLabel(tr("Component Item Number:"), this, "itemNumberLit");
  itemNumberLit->setGeometry(0, 0, 140, 25);
  itemNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _itemNumber = new XComboBox(this, "_itemNumber");
  _itemNumber->setGeometry(145, 0, 120, 25);
  _itemNumber->setAllowNull(TRUE);

  QLabel *uomLit = new QLabel(tr("UOM:"), this, "uomLit");
  uomLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _uom = new QLabel(this, "_uom");
  _uom->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

  _descrip1 = new QLabel(this, "_descrip1");
  _descrip1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

  _descrip2 = new QLabel(this, "_descrip2");
  _descrip2->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

  QLabel *qtyPerLit = new QLabel(tr("Qty. Per:"), this, "qtyPerLit");
  qtyPerLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _qtyPer = new QLabel(this, "_qtyPer");
  _qtyPer->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  QLabel *scrapLit = new QLabel(tr("Scrap %:"), this, "scrapLit");
  scrapLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _scrap = new QLabel(this, "_scrap");
  _scrap->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  QLabel *qtyRequiredLit = new QLabel(tr("Qty. Required:"), this, "qtyRequiredLit");
  qtyRequiredLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _qtyRequired = new QLabel(this, "_qtyRequired");
  _qtyRequired->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  QLabel *qtyIssuedLit = new QLabel(tr("Qty. Issued:"), this, "qtyIssuedLit");
  qtyIssuedLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _qtyIssued = new QLabel(this, "_qtyIssued");
  _qtyIssued->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  // lay out the component widgets
  Q3VBoxLayout *clusterLyt    = new Q3VBoxLayout(this, 5, -1, "clusterLyt");
  Q3HBoxLayout *itemMainLyt   = new Q3HBoxLayout(clusterLyt, -1, "itemMainLyt");
  Q3HBoxLayout *itemDescLyt   = new Q3HBoxLayout(clusterLyt, -1, "itemDescLyt");
  Q3HBoxLayout *qtyHBoxLyt    = new Q3HBoxLayout(clusterLyt, -1, "qtyHBoxLyt");
  Q3VBoxLayout *qtyLitVBoxLyt = new Q3VBoxLayout(qtyHBoxLyt, -1, "qtyLitVBoxLyt");
  Q3VBoxLayout *qtyVBoxLyt    = new Q3VBoxLayout(qtyHBoxLyt, -1, "qtyVBoxLyt");

  itemMainLyt->addWidget(itemNumberLit);
  itemMainLyt->addWidget(_itemNumber);
  itemMainLyt->addWidget(uomLit);
  itemMainLyt->addWidget(_uom);
  itemDescLyt->addWidget(_descrip1);
  itemDescLyt->addWidget(_descrip2);

  qtyLitVBoxLyt->addWidget(qtyPerLit);
  qtyLitVBoxLyt->addWidget(scrapLit);
  qtyLitVBoxLyt->addWidget(qtyRequiredLit);
  qtyLitVBoxLyt->addWidget(qtyIssuedLit);
  qtyVBoxLyt->addWidget(_qtyPer);
  qtyVBoxLyt->addWidget(_scrap);
  qtyVBoxLyt->addWidget(_qtyRequired);
  qtyVBoxLyt->addWidget(_qtyIssued);

  connect(_itemNumber, SIGNAL(newID(int)), SLOT(sPopulateInfo(int)));

  setFocusProxy(_itemNumber);
}
Esempio n. 19
0
void KPrWebPresentationWizard::setupPage4()
{
    page4 = new QHBox( this );
    QWhatsThis::add( page4, i18n("This page allows you to modify the titles of "
                                 "each slide, if required. You normally do not need "
                                 "to do this, but it is available if required.") );
    page4->setSpacing( KDialog::spacingHint() );
    page4->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page4 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page4 );
    QGridLayout *layout = new QGridLayout( canvas, 3, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    helptext->setText( i18n( "Here you can specify titles for "
                             "each slide. Click on a slide in "
                             "the list and then enter the title "
                             "in the textbox below. If you "
                             "click on a title, KPresenter "
                             "mainview will display the slide.") );

    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    QLabel *label = new QLabel( i18n( "Slide title:" ), canvas );
    label->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    layout->addWidget( label, 1, 0 );

    slideTitle = new KLineEdit( canvas );
    layout->addWidget( slideTitle, 1, 1 );
    connect( slideTitle, SIGNAL( textChanged( const QString & ) ), this,
             SLOT( slideTitleChanged( const QString & ) ) );

    slideTitles = new KListView( canvas );
    layout->addMultiCellWidget( slideTitles, 2, 2, 0, 1 );
    slideTitles->addColumn( i18n( "No." ) );
    slideTitles->addColumn( i18n( "Slide Title" ) );
    connect( slideTitles, SIGNAL( selectionChanged( QListViewItem * ) ), this,
             SLOT( slideTitleChanged( QListViewItem * ) ) );
    slideTitles->setSorting( -1 );
    slideTitles->setAllColumnsShowFocus( true );
    slideTitles->setResizeMode( QListView::LastColumn );
    slideTitles->header()->setMovingEnabled( false );

    QValueList<KPrWebPresentation::SlideInfo> infos = webPres.getSlideInfos();
    for ( int i = infos.count() - 1; i >= 0; --i ) {
        KListViewItem *item = new KListViewItem( slideTitles );
        item->setText( 0, QString::number( i + 1 ) );
        //kdDebug(33001) << "KPrWebPresentationWizard::setupPage3 " << infos[ i ].slideTitle << endl;
        item->setText( 1, infos[ i ].slideTitle );
    }

    slideTitles->setSelected( slideTitles->firstChild(), true );

    addPage( page4, i18n( "Step 4: Customize Slide Titles" ) );

    setHelpEnabled(page4, false);  //doesn't do anything currently
}
Esempio n. 20
0
void WoCluster::constructor()
{
  QVBoxLayout *_mainLayout      = new QVBoxLayout(this);
  QHBoxLayout *_woLayout        = new QHBoxLayout(0);
  QHBoxLayout *_warehouseLayout = new QHBoxLayout(0);
  QHBoxLayout *_line1Layout     = new QHBoxLayout(0);
  QHBoxLayout *_itemLayout      = new QHBoxLayout(0);
  QHBoxLayout *_uomLayout       = new QHBoxLayout(0);
  QHBoxLayout *_line2Layout     = new QHBoxLayout(0);
  QHBoxLayout *_statusLayout    = new QHBoxLayout(0);

  _mainLayout->setContentsMargins(0, 0, 0, 0);
  _woLayout->setContentsMargins(0, 0, 0, 0);
  _warehouseLayout->setContentsMargins(0, 0, 0, 0);
  _line1Layout->setContentsMargins(0, 0, 0, 0);
  _itemLayout->setContentsMargins(0, 0, 0, 0);
  _uomLayout->setContentsMargins(0, 0, 0, 0);
  _line2Layout->setContentsMargins(0, 0, 0, 0);
  _statusLayout->setContentsMargins(0, 0, 0, 0);

  _mainLayout->setSpacing(2); 
  _woLayout->setSpacing(5); 
  _warehouseLayout->setSpacing(5); 
  _line1Layout->setSpacing(7); 
  _itemLayout->setSpacing(5); 
  _uomLayout->setSpacing(5); 
  _line2Layout->setSpacing(7); 
  _statusLayout->setSpacing(5); 

  QLabel *woNumberLit = new QLabel(tr("Work Order #:"), this);
  woNumberLit->setObjectName("woNumberLit");
  woNumberLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  woNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _woLayout->addWidget(woNumberLit);

  _woNumber = new WoLineEdit(this);
  _woNumber->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _woLayout->addWidget(_woNumber);

  _line1Layout->addLayout(_woLayout);

  QLabel *warehouseLit = new QLabel(tr("Site:"), this);
  warehouseLit->setObjectName("warehouseLit");
  _woNumber->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  warehouseLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _warehouseLayout->addWidget(warehouseLit);

  _warehouse = new QLabel(this);
  _warehouse->setObjectName("_warehouse");
  _warehouse->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  _warehouse->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _warehouseLayout->addWidget(_warehouse);
  _line1Layout->addLayout(_warehouseLayout);
  _mainLayout->addLayout(_line1Layout);

  QLabel *itemNumberLit = new QLabel(tr("Item Number:"), this);
  itemNumberLit->setObjectName("itemNumberLit");
  itemNumberLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  itemNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _itemLayout->addWidget(itemNumberLit);

  _itemNumber = new QLabel(this);
  _itemNumber->setObjectName("_itemNumber");
  _itemNumber->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _itemNumber->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _itemLayout->addWidget(_itemNumber);
  _line2Layout->addLayout(_itemLayout);

  QLabel *uomLit = new QLabel(tr("UOM:"), this);
  uomLit->setObjectName("uomLit");
  uomLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  uomLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _uomLayout->addWidget(uomLit);

  _uom = new QLabel(this);
  _uom->setObjectName("_uom");
  _uom->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  _uom->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _uomLayout->addWidget(_uom);
  _line2Layout->addLayout(_uomLayout);
  _mainLayout->addLayout(_line2Layout);

  _descrip1 = new QLabel(this);
  _descrip1->setObjectName("_descrip1");
  _descrip1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _descrip1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _mainLayout->addWidget(_descrip1);

  _descrip2 = new QLabel(this);
  _descrip2->setObjectName("_descrip2");
  _descrip2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _descrip2->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _mainLayout->addWidget(_descrip2);

  QLabel *statusLit = new QLabel(tr("Status:"), this);
  statusLit->setObjectName("statusLit");
  statusLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  statusLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _statusLayout->addWidget(statusLit);

  _status = new QLabel(this);
  _status->setObjectName("_status");
  _status->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _status->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _statusLayout->addWidget(_status);
  
  QLabel *methodLit = new QLabel(tr("Method:"), this);
  methodLit->setObjectName("methodLit");
  methodLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  methodLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
  _statusLayout->addWidget(methodLit);

  _method = new QLabel(this);
  _method->setObjectName("_method");
  _method->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  _method->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  _statusLayout->addWidget(_method);
  
  _mainLayout->addLayout(_statusLayout);

//  Make some internal connections
  connect(_woNumber, SIGNAL(itemNumberChanged(const QString &)), _itemNumber, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(uomChanged(const QString &)), _uom, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(itemDescrip1Changed(const QString &)), _descrip1, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(itemDescrip2Changed(const QString &)), _descrip2, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(warehouseChanged(const QString &)), _warehouse, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(statusChanged(const QString &)), _status, SLOT(setText(const QString &)));
  connect(_woNumber, SIGNAL(methodChanged(const QString &)), _method, SLOT(setText(const QString &)));

  connect(_woNumber, SIGNAL(newId(int)), this, SIGNAL(newId(int)));
  connect(_woNumber, SIGNAL(newItemid(int)), this, SIGNAL(newItemid(int)));
  connect(_woNumber, SIGNAL(startDateChanged(const QDate &)), this, SIGNAL(startDateChanged(const QDate &)));
  connect(_woNumber, SIGNAL(dueDateChanged(const QDate &)), this, SIGNAL(dueDateChanged(const QDate &)));
  connect(_woNumber, SIGNAL(qtyOrderedChanged(const double)),  this, SIGNAL(qtyOrderedChanged(const double)));
  connect(_woNumber, SIGNAL(qtyReceivedChanged(const double)), this, SIGNAL(qtyReceivedChanged(const double)));
  connect(_woNumber, SIGNAL(qtyBalanceChanged(const double)),  this, SIGNAL(qtyBalanceChanged(const double)));
  connect(_woNumber, SIGNAL(valid(bool)), this, SIGNAL(valid(bool)));

  setFocusProxy(_woNumber);
}
Esempio n. 21
0
void KPrWebPresentationWizard::setupPage5()
{
    page5 = new QHBox( this );
    QWhatsThis::add( page5, i18n("This page allows you to specify some options for "
                                 "presentations which run unattended, such as time "
                                 "elapsed before advancing to the next slide, looping "
                                 "and the presence of headers. If you do not want "
                                 "an unattended presentation, just leave defaults unchanged.") );
    page5->setSpacing( KDialog::spacingHint() );
    page5->setMargin( KDialog::marginHint() );

    QLabel* sidebar = new QLabel( page5 );
    sidebar->setMinimumSize( 106, 318 );
    sidebar->setMaximumSize( 106, 318 );
    sidebar->setFrameShape( QFrame::Panel );
    sidebar->setFrameShadow( QFrame::Sunken );
    sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));

    QWidget* canvas = new QWidget( page5 );
    QGridLayout *layout = new QGridLayout( canvas, 6, 2,
                                           KDialog::marginHint(), KDialog::spacingHint() );

    QLabel *helptext = new QLabel( canvas );
    helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
    QString help = i18n("Here you can configure some options for unattended "
                        "presentations, such as time elapsed before automatically advance to "
                        "the next slide, looping and the presence of headers.");
    helptext->setText(help);

    layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );

    QLabel *label1 = new QLabel( i18n("Advance after:"), canvas );
    label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
    QWhatsThis::add( label1, i18n( "This selection allows you to specify "
                                   "the time between slides." ) );
    layout->addWidget( label1, 2, 0 );

    timeBetweenSlides = new KIntNumInput( webPres.getTimeBetweenSlides(), canvas );
    timeBetweenSlides->setSpecialValueText(i18n( "Disabled" ));
    QWhatsThis::add( timeBetweenSlides, i18n( "This selection allows you to specify "
                                 "the time between slides." ) );
    layout->addWidget( timeBetweenSlides, 2, 1 );
    timeBetweenSlides->setSuffix( " seconds" );
    timeBetweenSlides->setRange( 0, 900, 1 );

    layout->addMultiCell( new QSpacerItem( 1, 10 ), 1, 1, 0, 1 );

    writeHeader=new QCheckBox( i18n("Write header to the slides"), canvas);
    QWhatsThis::add( writeHeader, i18n( "This checkbox allows you to specify if you "
                                       "want to write the navigation buttons on top "
                                       "of the slide." ) );
    writeHeader->setChecked( webPres.wantHeader() );
    layout->addWidget( writeHeader, 3, 1);

    writeFooter=new QCheckBox( i18n("Write footer to the slides"), canvas);
    QWhatsThis::add( writeFooter, i18n( "This checkbox allows you to specify if you "
                                       "want to write an imprint consisting on the author "
                                       "and the software used to create these slides." ) );
    writeFooter->setChecked( webPres.wantFooter() );
    layout->addWidget( writeFooter, 4, 1);

    loopSlides=new QCheckBox( i18n("Loop presentation"), canvas);
    QWhatsThis::add( loopSlides, i18n( "This checkbox allows you to specify if you "
                                       "want the presentation to start again once "
                                       "the latest slide is reached." ) );
    loopSlides->setChecked( webPres.wantLoopSlides() );
    layout->addWidget( loopSlides, 5, 1);

    QSpacerItem* spacer = new QSpacerItem( 1, 10,
                                           QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addMultiCell( spacer, 5, 5, 0, 1 );

    addPage( page5, i18n( "Step 5: Options for Unattended Presentations" ) );

    setHelpEnabled(page5, false);  //doesn't do anything currently

    setFinish( page5, true );
}
Esempio n. 22
0
PTabDisplComp::PTabDisplComp(QMyTabWidget* _container, int _tab_index) : QWidget(), container(_container), tab_index(_tab_index)
{
    #ifdef TSP_DEBUG
    printf("TeraStitcher plugin [thread %d] >> PTabDisplComp created\n", this->thread()->currentThreadId());
    #endif

    //creating Basic panel widgets
    basic_panel = new QWidget();
    saveproj_label = new QLabel("Save project XML to:");
    saveproj_field = new QLineEdit();
    saveproj_field->setFont(QFont("",8));
    browse_button = new QPushButton("...");
    algorithm_label = new QLabel("Algorithm:");
    algorithm_cbox = new QComboBox();
    algorithm_cbox->insertItem(0, "MIP-NCC");
    algorithm_cbox->setEditable(true);
    algorithm_cbox->lineEdit()->setReadOnly(true);
    algorithm_cbox->lineEdit()->setAlignment(Qt::AlignCenter);
    for(int i = 0; i < algorithm_cbox->count(); i++)
        algorithm_cbox->setItemData(i, Qt::AlignCenter, Qt::TextAlignmentRole);
    subvoldims_label = new QLabel("Number of slices per layer:");
    subvoldims_sbox = new QSpinBox();
    subvoldims_sbox->setAlignment(Qt::AlignCenter);
    subvoldims_sbox->setMaximum(600);
    subvoldims_sbox->setMinimum(1);
    memocc_label = new QLabel("Estimated memory usage:");
    memocc_field = new QLineEdit();
    memocc_field->setReadOnly(true);
    memocc_field->setAlignment(Qt::AlignCenter);
    channel_selection = new QComboBox();
    channel_selection->addItem("all channels");
    channel_selection->addItem("R");
    channel_selection->addItem("G");
    channel_selection->addItem("B");
    channel_selection->setEditable(true);
    channel_selection->lineEdit()->setReadOnly(true);
    channel_selection->lineEdit()->setAlignment(Qt::AlignCenter);
    for(int i = 0; i < channel_selection->count(); i++)
        channel_selection->setItemData(i, Qt::AlignCenter, Qt::TextAlignmentRole);
    connect(channel_selection, SIGNAL(currentIndexChanged(int)),this, SLOT(channelSelectedChanged(int)));

    showAdvancedButton = new QPushButton(QString("Advanced options ").append(QChar(0x00BB)), this);
    showAdvancedButton->setCheckable(true);

    //creating Advanced panel widgets
    advanced_panel = new QWidget();
    stackrowstbp_label = new QLabel("Data subset selection (rows):");
    startrow_sbox = new QSpinBox();
    startrow_sbox->setAlignment(Qt::AlignCenter);
    to_label_1 = new QLabel("to");
    to_label_1->setAlignment(Qt::AlignCenter);
    endrow_sbox = new QSpinBox();
    endrow_sbox->setAlignment(Qt::AlignCenter);
    stackcolstbp_label = new QLabel("Data subset selection (columns):");
    startcol_sbox = new QSpinBox();
    startcol_sbox->setAlignment(Qt::AlignCenter);
    to_label_2 = new QLabel("to");
    to_label_2->setAlignment(Qt::AlignCenter);
    endcol_sbox = new QSpinBox();
    endcol_sbox->setAlignment(Qt::AlignCenter);

    startslice_sbox = new QSpinBox();
    startslice_sbox->setAlignment(Qt::AlignCenter);
    endslice_sbox = new QSpinBox();
    endslice_sbox->setAlignment(Qt::AlignCenter);

    searchregion_label = new QLabel("Search Region (voxels):");
    Ysearch_sbox = new QSpinBox();
    Ysearch_sbox->setAlignment(Qt::AlignCenter);
    Ysearch_sbox->setMinimum(5);
    Ysearch_sbox->setValue(20);
    Ysearch_sbox->setSuffix(" (Y)");
    Xsearch_sbox = new QSpinBox();
    Xsearch_sbox->setAlignment(Qt::AlignCenter);
    Xsearch_sbox->setMinimum(5);
    Xsearch_sbox->setValue(20);
    Xsearch_sbox->setSuffix(" (X)");
    Zsearch_sbox = new QSpinBox();
    Zsearch_sbox->setAlignment(Qt::AlignCenter);
    Zsearch_sbox->setMinimum(5);
    Zsearch_sbox->setValue(20);
    Zsearch_sbox->setSuffix(" (Z)");
    for_label_1 = new QLabel(QChar(0x00D7));
    for_label_1->setAlignment(Qt::AlignCenter);
    for_label_2 = new QLabel(QChar(0x00D7));
    for_label_2->setAlignment(Qt::AlignCenter);
    overlap_label = new QLabel("Overlap (voxels):");
    Yoverlap_sbox = new QSpinBox();
    Yoverlap_sbox->setAlignment(Qt::AlignCenter);
    Yoverlap_sbox->setSuffix(" (Y)");
    Xoverlap_sbox = new QSpinBox();
    Xoverlap_sbox->setAlignment(Qt::AlignCenter);
    Xoverlap_sbox->setSuffix(" (X)");
    for_label_3 = new QLabel(QChar(0x00D7));
    for_label_3->setAlignment(Qt::AlignCenter);
    restoreSPIM_label = new QLabel("SPIM artifacts removal:");
    restoreSPIM_cbox = new QCheckBox("Compute stacks profiles to be used in the Merging tiles step");

    /*** LAYOUT SECTIONS ***/
    //basic panel
    QGridLayout* basicpanel_layout = new QGridLayout();
    QHBoxLayout *tmp = new QHBoxLayout();
    basicpanel_layout->addWidget(saveproj_label,     0,0,1,1);
    saveproj_label->setFixedWidth(200);
    browse_button->setFixedWidth(80);
    tmp->addWidget(saveproj_field,1);
    tmp->addWidget(browse_button);
    tmp->setSpacing(6);
    basicpanel_layout->addLayout(tmp,                0,1,1,11);
    basicpanel_layout->addWidget(algorithm_label,    1,0,1,1);
    //algorithm_cbox->setFixedWidth(150);
    //channel_selection->setFixedWidth(150);
    basicpanel_layout->addWidget(algorithm_cbox,     1,1,1,2);
    basicpanel_layout->addWidget(subvoldims_label,   2,0,1,1);
    basicpanel_layout->addWidget(subvoldims_sbox,    2,1,1,2);
    QLabel* channel_label = new QLabel("Channel selection:");
    channel_label->setFixedWidth(200);
    basicpanel_layout->addWidget(channel_label,       3,0,1,1);
    basicpanel_layout->addWidget(channel_selection,   3,1,1,2);
    basicpanel_layout->addWidget(memocc_label,       4,0,1,1);
    basicpanel_layout->addWidget(memocc_field,       4,1,1,2);
    QWidget* emptyspace3 = new QWidget();
    emptyspace3->setFixedHeight(5);
    QWidget* emptyspace4 = new QWidget();
    emptyspace4->setFixedHeight(1);
    basicpanel_layout->addWidget(emptyspace3, 4+S_MAX_MULTIRES, 0, 1, 12);
    basicpanel_layout->addWidget(showAdvancedButton, 5+S_MAX_MULTIRES, 0, 1, 12);
    basicpanel_layout->addWidget(emptyspace4, 6+S_MAX_MULTIRES, 0, 1, 12);
    basicpanel_layout->setVerticalSpacing(2);
    basic_panel->setLayout(basicpanel_layout);
    basic_panel->setContentsMargins(0,0,0,0);


    //advanced panel
    QGridLayout* advancedpanel_layout = new QGridLayout();
    advancedpanel_layout->addWidget(stackrowstbp_label,     0,0,1,1);
    stackrowstbp_label->setFixedWidth(200);
   // startrow_sbox->setFixedWidth(150);
    advancedpanel_layout->addWidget(startrow_sbox,          0,1,1,3);
    advancedpanel_layout->addWidget(to_label_1,             0,4,1,1);
    advancedpanel_layout->addWidget(endrow_sbox,            0,5,1,3);
    advancedpanel_layout->addWidget(stackcolstbp_label,     1,0,1,1);
    advancedpanel_layout->addWidget(startcol_sbox,          1,1,1,3);
    advancedpanel_layout->addWidget(to_label_2,             1,4,1,1);
    advancedpanel_layout->addWidget(endcol_sbox,            1,5,1,3);
    advancedpanel_layout->addWidget(new QLabel("Data subset selection (slices):"),     2,0,1,1);
    advancedpanel_layout->addWidget(startslice_sbox,        2,1,1,3);
    QLabel *toLabel = new QLabel("to");
    toLabel->setAlignment(Qt::AlignCenter);
    advancedpanel_layout->addWidget(toLabel ,               2,4,1,1);
    advancedpanel_layout->addWidget(endslice_sbox,          2,5,1,3);
    advancedpanel_layout->addWidget(searchregion_label,     3,0,1,1);
    advancedpanel_layout->addWidget(Xsearch_sbox,           3,1,1,3);
    advancedpanel_layout->addWidget(for_label_1,            3,4,1,1);
    advancedpanel_layout->addWidget(Ysearch_sbox,           3,5,1,3);
    advancedpanel_layout->addWidget(for_label_2,            3,8,1,1);
    advancedpanel_layout->addWidget(Zsearch_sbox,           3,9,1,3);
    advancedpanel_layout->addWidget(overlap_label,          4,0,1,1);
    advancedpanel_layout->addWidget(Xoverlap_sbox,          4,1,1,3);
    QLabel* for_label_4 = new QLabel(QChar(0x00D7));
    for_label_4->setAlignment(Qt::AlignCenter);
    advancedpanel_layout->addWidget(for_label_4,            4,4,1,1);
    advancedpanel_layout->addWidget(Yoverlap_sbox,          4,5,1,3);
    advancedpanel_layout->addWidget(restoreSPIM_label,      5,0,1,1);
    advancedpanel_layout->addWidget(restoreSPIM_cbox,       5,1,1,11);
    advancedpanel_layout->setVerticalSpacing(2);
    advanced_panel->setLayout(advancedpanel_layout);
    advanced_panel->setContentsMargins(0,0,0,0);



    //overall
    QVBoxLayout* layout = new QVBoxLayout();
    layout->addWidget(basic_panel);
    layout->addWidget(advanced_panel);
    layout->addStretch(1);
    layout->setSpacing(0);
    layout->setContentsMargins(10,0,10,0);
    setLayout(layout);

    //wait animated GIF tab icon
    wait_movie = new QMovie(":/icons/wait.gif");
    wait_label = new QLabel(this);
    wait_label->setMovie(wait_movie);

    // signals and slots
    connect(subvoldims_sbox, SIGNAL(valueChanged(int)), this, SLOT(updateMemoryOccupancy(int)));
    connect(startrow_sbox, SIGNAL(valueChanged(int)), this, SLOT(updateMemoryOccupancy(int)));
    connect(endrow_sbox, SIGNAL(valueChanged(int)), this, SLOT(updateMemoryOccupancy(int)));
    connect(startcol_sbox, SIGNAL(valueChanged(int)), this, SLOT(updateMemoryOccupancy(int)));
    connect(endcol_sbox, SIGNAL(valueChanged(int)), this, SLOT(updateMemoryOccupancy(int)));
    connect(browse_button, SIGNAL(clicked()), this, SLOT(browse_button_clicked()));
    connect(CDisplComp::instance(), SIGNAL(sendOperationOutcome(iom::exception*)), this, SLOT(displcomp_done(iom::exception*)), Qt::QueuedConnection);
    connect(showAdvancedButton, SIGNAL(toggled(bool)), this, SLOT(showAdvancedChanged(bool)));

    reset();
}
Esempio n. 23
0
ImportFields::ImportFields(QWidget *parent,const char *name)
  : QWidget(parent,name)
{
  QLabel *label;
  import_changed=false;

  //
  // Traffic Cartname Parser Data Section
  //
  label=new QLabel(tr("Cart Number:"),this,
		   "_cartname_label");
  label->setGeometry(0,0,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Cart Offset
  //
  cart_offset_spin=new QSpinBox(this,"cart_offset_spin");
  cart_offset_spin->setGeometry(175,0,50,19);
  cart_offset_spin->setRange(0,1024);
  label=new QLabel(cart_offset_spin,
		   tr("Offset:"),this,
		   "cart_win_path_label");
  label->setGeometry(125,0,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(cart_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Cart Length
  //
  cart_length_spin=new QSpinBox(this,"cart_length_spin");
  cart_length_spin->setGeometry(285,0,50,19);
  cart_length_spin->setRange(0,6);
  label=new QLabel(cart_length_spin,
		   tr("Length:"),this,
		   "cart_win_path_label");
  label->setGeometry(230,0,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(cart_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Title Parser Data Section
  //
  label=new QLabel(tr("Title:"),this,"_cartname_label");
  label->setGeometry(0,21,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Title Cart Offset
  //
  title_offset_spin=new QSpinBox(this,"title_offset_spin");
  title_offset_spin->setGeometry(175,21,50,19);
  title_offset_spin->setRange(0,1024);
  label=new QLabel(title_offset_spin,
		   tr("Offset:"),this,
		   "title_win_path_label");
  label->setGeometry(125,21,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(title_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Title Cart Length
  //
  title_length_spin=new QSpinBox(this,"title_length_spin");
  title_length_spin->setGeometry(285,21,50,19);
  title_length_spin->setRange(0,255);
  label=new QLabel(title_length_spin,
		   tr("Length:"),this,
		   "title_win_path_label");
  label->setGeometry(230,21,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(title_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Start Hours Parser Data Section
  //
  label=new QLabel(tr("Start Time - Hours:"),this,
		   "_startname_label");
  label->setGeometry(0,42,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Start Hours Offset
  //
  hours_offset_spin=new QSpinBox(this,"hours_offset_spin");
  hours_offset_spin->setGeometry(175,42,50,19);
  hours_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(hours_offset_spin,
		   tr("Offset:"),this,
		   "hours_win_path_label");
  label->setGeometry(125,42,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(hours_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Start Hours Length
  //
  hours_length_spin=new QSpinBox(this,"hours_length_spin");
  hours_length_spin->setGeometry(285,42,50,19);
  hours_length_spin->setRange(0,8);
  label=new QLabel(hours_length_spin,
		   tr("Length:"),this,
		   "hours_win_path_label");
  label->setGeometry(230,42,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(hours_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Start Minutes Parser Data Section
  //
  label=new QLabel(tr("Start Time - Minutes:"),this,
		   "_startname_label");
  label->setGeometry(0,63,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Start Minutes Offset
  //
  minutes_offset_spin=new QSpinBox(this,"minutes_offset_spin");
  minutes_offset_spin->setGeometry(175,63,50,19);
  minutes_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(minutes_offset_spin,
		   tr("Offset:"),this,
		   "minutes_win_path_label");
  label->setGeometry(125,63,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(minutes_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Start Minutes Length
  //
  minutes_length_spin=new QSpinBox(this,"minutes_length_spin");
  minutes_length_spin->setGeometry(285,63,50,19);
  minutes_length_spin->setRange(0,8);
  label=new QLabel(minutes_length_spin,
		   tr("Length:"),this,
		   "minutes_win_path_label");
  label->setGeometry(230,63,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(minutes_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Start Seconds Parser Data Section
  //
  label=new QLabel(tr("Start Time - Seconds:"),this,
		   "_startname_label");
  label->setGeometry(0,84,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Start Seconds Offset
  //
  seconds_offset_spin=new QSpinBox(this,"seconds_offset_spin");
  seconds_offset_spin->setGeometry(175,84,50,19);
  seconds_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(seconds_offset_spin,
		   tr("Offset:"),this,
		   "seconds_win_path_label");
  label->setGeometry(125,84,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(seconds_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Start Seconds Length
  //
  seconds_length_spin=new QSpinBox(this,"seconds_length_spin");
  seconds_length_spin->setGeometry(285,84,50,19);
  seconds_length_spin->setRange(0,8);
  label=new QLabel(seconds_length_spin,
		   tr("Length:"),this,
		   "seconds_win_path_label");
  label->setGeometry(230,84,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(seconds_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Length Hours Parser Data Section
  //
  label=new QLabel(tr("Length - Hours:"),this,
		   "_lengthname_label");
  label->setGeometry(0,106,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Length Hours Offset
  //
  len_hours_offset_spin=new QSpinBox(this,"len_hours_offset_spin");
  len_hours_offset_spin->setGeometry(175,106,50,19);
  len_hours_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(len_hours_offset_spin,
		   tr("Offset:"),this,
		   "len_hours_win_path_label");
  label->setGeometry(125,106,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(len_hours_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Length Hours Length
  //
  len_hours_length_spin=new QSpinBox(this,"len_hours_length_spin");
  len_hours_length_spin->setGeometry(285,106,50,19);
  len_hours_length_spin->setRange(0,8);
  label=new QLabel(len_hours_length_spin,
		   tr("Length:"),this,
		   "len_hours_win_path_label");
  label->setGeometry(230,106,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(len_hours_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Length Minutes Parser Data Section
  //
  label=new QLabel(tr("Length - Minutes:"),this,
		   "_lengthname_label");
  label->setGeometry(0,127,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Length Minutes Offset
  //
  len_minutes_offset_spin=new QSpinBox(this,"len_minutes_offset_spin");
  len_minutes_offset_spin->setGeometry(175,127,50,19);
  len_minutes_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(len_minutes_offset_spin,
		   tr("Offset:"),this,
		   "len_minutes_win_path_label");
  label->setGeometry(125,127,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(len_minutes_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Length Minutes Length
  //
  len_minutes_length_spin=new QSpinBox(this,"len_minutes_length_spin");
  len_minutes_length_spin->setGeometry(285,127,50,19);
  len_minutes_length_spin->setRange(0,8);
  label=new QLabel(len_minutes_length_spin,
		   tr("Length:"),this,
		   "len_minutes_win_path_label");
  label->setGeometry(230,127,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(len_minutes_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Length Seconds Parser Data Section
  //
  label=new QLabel(tr("Length - Seconds:"),this,
		   "_lengthname_label");
  label->setGeometry(0,148,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Length Seconds Offset
  //
  len_seconds_offset_spin=new QSpinBox(this,"len_seconds_offset_spin");
  len_seconds_offset_spin->setGeometry(175,148,50,19);
  len_seconds_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(len_seconds_offset_spin,
		   tr("Offset:"),this,
		   "len_seconds_win_path_label");
  label->setGeometry(125,148,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(len_seconds_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Length Seconds Length
  //
  len_seconds_length_spin=new QSpinBox(this,"len_seconds_length_spin");
  len_seconds_length_spin->setGeometry(285,148,50,19);
  len_seconds_length_spin->setRange(0,8);
  label=new QLabel(len_seconds_length_spin,
		   tr("Length:"),this,
		   "len_seconds_win_path_label");
  label->setGeometry(230,148,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(len_seconds_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Contract # Parser Data Section
  //
  label=new QLabel(tr("Contract #:"),this,
		   "_dataname_label");
  label->setGeometry(0,169,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Contract # Offset
  //
  data_offset_spin=new QSpinBox(this,"data_offset_spin");
  data_offset_spin->setGeometry(175,169,50,19);
  data_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(data_offset_spin,
		   tr("Offset:"),this,
		   "data_win_path_label");
  label->setGeometry(125,169,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(data_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Contract # Length
  //
  data_length_spin=new QSpinBox(this,"data_length_spin");
  data_length_spin->setGeometry(285,169,50,19);
  data_length_spin->setRange(0,32);
  label=new QLabel(data_length_spin,
		   tr("Length:"),this,
		   "data_win_path_label");
  label->setGeometry(230,169,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(data_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Event ID Parser Data Section
  //
  label=new QLabel(tr("Event ID:"),this,
		   "_event_idname_label");
  label->setGeometry(0,190,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Event ID Offset
  //
  event_id_offset_spin=new QSpinBox(this,"event_id_offset_spin");
  event_id_offset_spin->setGeometry(175,190,50,19);
  event_id_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(event_id_offset_spin,
		   tr("Offset:"),this,
		   "event_id_win_path_label");
  label->setGeometry(125,190,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(event_id_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Event ID Length
  //
  event_id_length_spin=new QSpinBox(this,"event_id_length_spin");
  event_id_length_spin->setGeometry(285,190,50,19);
  event_id_length_spin->setRange(0,8);
  label=new QLabel(event_id_length_spin,
		   tr("Length:"),this,
		   "event_id_win_path_label");
  label->setGeometry(230,190,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(event_id_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Announcement Type Parser Data Section
  //
  label=new QLabel(tr("Annc. Type:"),this,
		   "_annctypename_label");
  label->setGeometry(0,211,120,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);

  //
  // Traffic Announcement Type Offset
  //
  annctype_offset_spin=new QSpinBox(this,"annctype_offset_spin");
  annctype_offset_spin->setGeometry(175,211,50,19);
  annctype_offset_spin->setRange(0,RD_MAX_IMPORT_LINE_LENGTH);
  label=new QLabel(annctype_offset_spin,
		   tr("Offset:"),this,
		   "annctype_win_path_label");
  label->setGeometry(125,211,45,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(annctype_offset_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

  //
  // Traffic Announcement Type Length
  //
  annctype_length_spin=new QSpinBox(this,"annctype_length_spin");
  annctype_length_spin->setGeometry(285,211,50,19);
  annctype_length_spin->setRange(0,8);
  label=new QLabel(annctype_length_spin,
		   tr("Length:"),this,
		   "annctype_win_path_label");
  label->setGeometry(230,211,50,19);
  label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
  connect(annctype_length_spin,SIGNAL(valueChanged(int)),
	  this,SLOT(valueChangedData(int)));

}
Esempio n. 24
0
ConstrDestrCopyDialog::ConstrDestrCopyDialog(UmlClass * cl, bool have_constructor,
                                  bool have_destructor, bool have_copy,
                                  bool have_const_copy, bool have_assignment,
                                  bool have_const_assignment)
   : QDialog(0, 0, TRUE), target(cl) {
  QVBoxLayout * vbox = new QVBoxLayout(this);
  QHGroupBox * g;
  QList<QLabel> labels;
  QLabel * lbl;

  vbox->setSpacing(5);
  vbox->setMargin(5);
  
  lbl = new QLabel(QString("<big><b>C++ utilities for the class <i><tt>") + 
		   (const char *) cl->name() + "</tt></i></b></big>",
		   this);
  lbl->setAlignment(AlignCenter);
  vbox->addWidget(lbl);

  // constructor
  
  g = new QHGroupBox(this);
  vbox->addWidget(g);
  
  labels.append(new QLabel((have_constructor)
			   ? "the class already have contructor  "
			   : "the class doesn't have contructor  ",
			   g));
  
  QHBox * h = new QHBox(g);
    
  add_constr = new QCheckBox("add constructor", h);
  constr_explicit = new QCheckBox("explicit", h);
  
  // destructor
  
  if (! have_destructor) {
    g = new QHGroupBox(this);
    vbox->addWidget(g);
  
    labels.append(new QLabel("the class doesn't have destructor  ",
			     g));
    
    h = new QHBox(g);
    
    add_destr = new QCheckBox("add destructor", h);
    virtual_destr = new QCheckBox("virtual", h);
  }
  else
    add_destr = 0;
  
  // copy contructor

  if (have_copy) {
    add_copy = 0;
    if (!have_const_copy) {
      g = new QHGroupBox(this);
      vbox->addWidget(g);
      
      labels.append(new QLabel("the class doesn't have copy contructor  \nwith const argument  ",
			       g));
      add_const_copy = new QCheckBox("add copy constructor\nwith const argument",
				     g);
    }
    else
      add_const_copy = 0;
  }
  else if (!have_const_copy) {
    g = new QHGroupBox(this);
    vbox->addWidget(g);
    
    labels.append(new QLabel("the class doesn't have copy contructor  ",
			     g));
    
    QVBox * v = new QVBox(g);
    
    add_const_copy = new QCheckBox("add copy constructor\nwith const argument",
				   v);      
    add_copy = new QCheckBox("add copy constructor\nwith non const argument",
			     v);
  }
  else {
    g = new QHGroupBox(this);
    vbox->addWidget(g);
    
    labels.append(new QLabel("the class doesn't have copy contructor  \nwith non const argument  ",
			     g));
    add_copy = new QCheckBox("add copy constructor\nwith non const argument",
			     g);
    add_const_copy = 0;
  }

  // assignment

  if (have_assignment) {
    add_assign = 0;
    if (!have_const_assignment) {
      g = new QHGroupBox(this);
      vbox->addWidget(g);
    
      labels.append(new QLabel("the class doesn't have assignment\noperator with const argument  ",
			       g));
      add_const_assign = new QCheckBox("add assignment\nwith const argument",
				       g);
    }
    else
      add_const_assign = 0;
  }
  else if (!have_const_assignment) {
    g = new QHGroupBox(this);
    vbox->addWidget(g);
    
    labels.append(new QLabel("the class doesn't have assignment operator  ", g));
    
    QVBox * v = new QVBox(g);
    
    add_const_assign = new QCheckBox("add assignment\nwith const argument",
				     v);      
    add_assign = new QCheckBox("add assignment\nwith non const argument",
			       v);
  }
  else {
    g = new QHGroupBox(this);
    vbox->addWidget(g);
    
    labels.append(new QLabel("the class doesn't have assignment operator  \nwith non const argument  ",
			     g));
    add_assign = new QCheckBox("add assignment\nwith non const argument",
			       g);
    add_const_assign = 0;
  }

  // use the same width for all the labels on the first column

  QSize sz(labels.first()->sizeHint());
  
  while ((lbl = labels.next()) != 0) {
    if (lbl->sizeHint().width() > sz.width())
      sz.setWidth(lbl->sizeHint().width());
  }

  for (lbl = labels.first(); lbl != 0; lbl = labels.next()) {
    sz.setHeight(lbl->sizeHint().height());
    lbl->setFixedSize(sz);
  }
    
  // ok & cancel buttons
  
  QHBox * hbox = new QHBox(this);
  
  vbox->addWidget(hbox);
  
  QPushButton * ok = new QPushButton("&OK", hbox);
  QPushButton * cancel = new QPushButton("&Cancel", hbox);

  QSize bs(cancel->sizeHint());
  
  ok->setDefault(TRUE);
  
  ok->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Esempio n. 25
0
MakeDeposits::MakeDeposits
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{
	setCaption( "Make Deposits" );

    // Create our widgets.
    paymentList = new Q3ListView(this, "paymentList");
    int curCol = 1;
    paymentList->addColumn("Date");             curCol++;
    paymentList->addColumn("Cust ID");          curCol++;
    paymentList->addColumn("Customer Name");    curCol++;
    paymentList->addColumn("Check No");         curCol++;
    paymentList->addColumn("Amount");           curCol++;
    paymentList->addColumn("IntID");
    paymentList->setColumnAlignment(curCol++, AlignRight);
    paymentList->setAllColumnsShowFocus(true);
    paymentList->setMultiSelection(true);
    connect(paymentList, SIGNAL(selectionChanged()), this, SLOT(itemSelected()));
    connect(paymentList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *)));

    QLabel  *selectedItemCountLabel = new QLabel(this, "selectedItemCountLabel");
    selectedItemCountLabel->setText("Items Selected:");
    selectedItemCountLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

    selectedItemCount = new QLabel(this, "selectedItemCount");
    selectedItemCount->setText("0");
    selectedItemCount->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

    QLabel  *undepositedAmountLabel = new QLabel(this, "undepositedAmountLabel");
    undepositedAmountLabel->setText("Undeposted amount:");
    undepositedAmountLabel->setAlignment(AlignRight | AlignVCenter);

    undepositedAmount = new QLabel(this, "undepositedAmount");
    undepositedAmount->setText("$0.00");
    undepositedAmount->setAlignment(AlignRight | AlignVCenter);

    QLabel  *amountSelectedLabel = new QLabel(this, "amountSelectedLabel");
    amountSelectedLabel->setText("Amount selected:");
    amountSelectedLabel->setAlignment(AlignRight | AlignVCenter);

    amountSelected = new QLabel(this, "amountSelected");
    amountSelected->setText("$0.00");
    amountSelected->setAlignment(AlignRight | AlignVCenter);

    QLabel  *targetAccountLabel = new QLabel(this, "targetAccountLabel");
    targetAccountLabel->setText("Target Account:");
    targetAccountLabel->setAlignment(AlignRight | AlignVCenter);

    targetAccountList = new QComboBox(false, this, "targetAccountList");

    QLabel  *transDateLabel = new QLabel(this, "transDateLabel");
    transDateLabel->setText("Desposit Date:");
    transDateLabel->setAlignment(AlignRight | AlignVCenter);

    transDate = new Q3DateEdit(QDate::currentDate(), this, "transDate");

    // Our buttons now.
    QPushButton *printButton = new QPushButton(this, "printButton");
    printButton->setText("&Print");
    connect(printButton, SIGNAL(clicked()), this, SLOT(printSelected()));
    
    QPushButton *selectAllButton = new QPushButton(this, "selectAllButton");
    selectAllButton->setText("Select &All");
    connect(selectAllButton, SIGNAL(clicked()), this, SLOT(selectAll()));

    QPushButton *selectNoneButton = new QPushButton(this, "selectNoneButton");
    selectNoneButton->setText("Select &None");
    connect(selectNoneButton, SIGNAL(clicked()), this, SLOT(selectNone()));

    QPushButton *continueButton = new QPushButton(this, "continueButton");
    continueButton->setText("C&ontinue");
    connect(continueButton, SIGNAL(clicked()), this, SLOT(processSelections()));

    QPushButton *cancelButton = new QPushButton(this, "cancelButton");
    cancelButton->setText("&Cancel");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelSelected()));

    // Create our layout.
    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);

    ml->addWidget(paymentList, 1);

    // A grid for our labels and account selection.
    Q3GridLayout *asl = new Q3GridLayout(3, 2);
    asl->setColStretch(0, 0);
    asl->setColStretch(1, 1);
    int curRow = 0;

    asl->addWidget(selectedItemCountLabel,          curRow, 0);
    asl->addWidget(selectedItemCount,               curRow, 1);
    asl->setRowStretch(curRow++, 0);
    asl->addWidget(undepositedAmountLabel,          curRow, 0);
    asl->addWidget(undepositedAmount,               curRow, 1);
    asl->setRowStretch(curRow++, 0);
    asl->addWidget(amountSelectedLabel,             curRow, 0);
    asl->addWidget(amountSelected,                  curRow, 1);
    asl->setRowStretch(curRow++, 0);
    asl->addWidget(targetAccountLabel,              curRow, 0);
    asl->addWidget(targetAccountList,               curRow, 1);
    asl->setRowStretch(curRow++, 0);
    asl->addWidget(transDateLabel,                  curRow, 0);
    asl->addWidget(transDate,                       curRow, 1);
    asl->setRowStretch(curRow++, 0);

    // Now our button layout
    Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
    bl->addStretch(1);
    bl->addWidget(printButton,      0);
    bl->addWidget(selectAllButton,  0);
    bl->addWidget(selectNoneButton, 0);
    bl->addWidget(continueButton,   0);
    bl->addWidget(cancelButton,     0);

    // Add the buttons to our other widget layout
    //owl->addLayout(bl, 0);

    // Add the other widget layout to our main layout.
    ml->addLayout(asl, 0);
    ml->addWidget(new HorizLine(this), 0);
    ml->addLayout(bl, 0);

    // Done with the layout.

    // Fill our account list.
    ADB     DB;
    int     tmpPos = 0;
    DB.query("select IntAccountNo, AccountNo, AcctName from Accounts order by AccountNo");
    accountIDX = new long[DB.rowCount+2];
    accountIDX[0] = 0;
    QString tmpStr;
    if (DB.rowCount) while (DB.getrow()) {
        accountIDX[tmpPos++] = atol(DB.curRow["IntAccountNo"]);
        tmpStr = DB.curRow["AccountNo"];
        tmpStr += " ";
        tmpStr += DB.curRow["AcctName"];
        targetAccountList->insertItem(tmpStr);
    }
    
    selTotal = 0.00;
    fillDepositList();
}
Esempio n. 26
0
KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, const KComponentData &inst, QWidget *parent)
    : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{
    QString wtstr;
    QLabel *label;
    QVBoxLayout *lay = new QVBoxLayout (this);

    //iTLabel = new QLabel(i18n("  Allowed overlap:\n"
    //                         "(% of desktop space)"),
    //             plcBox);
    //iTLabel->setAlignment(AlignTop|AlignHCenter);
    //pLay->addWidget(iTLabel,1,1);

    //interactiveTrigger = new QSpinBox(0, 500, 1, plcBox);
    //pLay->addWidget(interactiveTrigger,1,2);

    //pLay->addRowSpacing(2,KDialog::spacingHint());

    //lay->addWidget(plcBox);

    shBox = new KButtonGroup(this);
    shBox->setTitle(i18n("Shading"));
    QGridLayout *kLay = new QGridLayout(shBox);

    shadeHoverOn = new QCheckBox(i18n("&Enable hover"), shBox);

    connect(shadeHoverOn, SIGNAL(toggled(bool)), this, SLOT(shadeHoverChanged(bool)));
    kLay->addWidget(shadeHoverOn, 0, 0, 1, 2);

    shadeHover = new KIntNumInput(500, shBox);
    shadeHover->setRange(0, 3000, 100);
    shadeHover->setSteps(100, 100);
    shadeHover->setSuffix(i18n(" ms"));

    shadeHoverOn->setWhatsThis( i18n("If Shade Hover is enabled, a shaded window will un-shade automatically "
                                       "when the mouse pointer has been over the title bar for some time."));

    wtstr = i18n("Sets the time in milliseconds before the window unshades "
                "when the mouse pointer goes over the shaded window.");
    shadeHover->setWhatsThis( wtstr);
    shadeHover->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    shadeHoverLabel = new QLabel(i18n("Dela&y:"), this);
    shadeHoverLabel->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
    shadeHoverLabel->setBuddy(shadeHover);
    kLay->addWidget(shadeHoverLabel, 1, 0);
    kLay->addWidget(shadeHover, 1, 1);

    lay->addWidget(shBox);

    // Any changes goes to slotChanged()
    connect(shadeHoverOn, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(shadeHover, SIGNAL(valueChanged(int)), SLOT(changed()));

    QGridLayout *vLay = new QGridLayout();
    lay->addLayout( vLay );

    placementCombo = new QComboBox(this);
    placementCombo->setEditable( false );
    placementCombo->addItem(i18n("Smart"), SMART_PLACEMENT);
    placementCombo->addItem(i18n("Maximizing"), MAXIMIZING_PLACEMENT);
    placementCombo->addItem(i18n("Cascade"), CASCADE_PLACEMENT);
    placementCombo->addItem(i18n("Random"), RANDOM_PLACEMENT);
    placementCombo->addItem(i18n("Centered"), CENTERED_PLACEMENT);
    placementCombo->addItem(i18n("Zero-Cornered"), ZEROCORNERED_PLACEMENT);
    // CT: disabling is needed as long as functionality misses in kwin
    //placementCombo->addItem(i18n("Interactive"), INTERACTIVE_PLACEMENT);
    //placementCombo->addItem(i18n("Manual"), MANUAL_PLACEMENT);
    placementCombo->setCurrentIndex(SMART_PLACEMENT);

    // FIXME, when more policies have been added to KWin
    wtstr = i18n("The placement policy determines where a new window"
                 " will appear on the desktop."
                 " <ul>"
                 " <li><em>Smart</em> will try to achieve a minimum overlap of windows</li>"
                 " <li><em>Maximizing</em> will try to maximize every window to fill the whole screen."
                 " It might be useful to selectively affect placement of some windows using"
                 " the window-specific settings.</li>"
                 " <li><em>Cascade</em> will cascade the windows</li>"
                 " <li><em>Random</em> will use a random position</li>"
                 " <li><em>Centered</em> will place the window centered</li>"
                 " <li><em>Zero-Cornered</em> will place the window in the top-left corner</li>"
                 "</ul>") ;

    placementCombo->setWhatsThis( wtstr);

    placementCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    label = new QLabel(i18n("&Placement:"), this);
    label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
    label->setBuddy(placementCombo);
    vLay->addWidget(label, 0, 0);
    vLay->addWidget(placementCombo, 0, 1);

    connect( placementCombo, SIGNAL(activated(int)), SLOT(changed()));

    hideUtilityWindowsForInactive = new QCheckBox( i18n( "Hide utility windows for inactive applications" ), this );
    hideUtilityWindowsForInactive->setWhatsThis(
        i18n( "When turned on, utility windows (tool windows, torn-off menus,...) of inactive applications will be"
              " hidden and will be shown only when the application becomes active. Note that applications"
              " have to mark the windows with the proper window type for this feature to work." ));
    connect(hideUtilityWindowsForInactive, SIGNAL(toggled(bool)), SLOT(changed()));
    vLay->addWidget( hideUtilityWindowsForInactive, 1, 0, 1, 2 );


    lay->addStretch();
    load();

}
Esempio n. 27
0
CustRegister::CustRegister
(
	QWidget* parent,
	const char* name,
	long CustID
) : TAAWidget(parent)
{
	setCaption( "Register" );
	
	myCustID = CustID;

    // Create our labels
    QLabel  *custNameLabel = new QLabel(this);
    custNameLabel->setText("Customer Name:");
    custNameLabel->setAlignment(AlignRight);

    customerName = new QLabel(this);
    customerName->setAlignment(AlignLeft);
    
    QLabel  *customerIDLabel = new QLabel(this);
    customerIDLabel->setText("Customer ID:");
    customerIDLabel->setAlignment(AlignRight);

    custIDLabel = new QLabel(this);
    custIDLabel->setAlignment(AlignLeft);
    
    QLabel  *customerBalanceLabel = new QLabel(this);
    customerBalanceLabel->setText("Current Balance:");
    customerBalanceLabel->setAlignment(AlignRight);

    currentBalanceArea = new QLabel(this);
    currentBalanceArea->setAlignment(AlignLeft);
    
    QLabel  *customerStatusLabel = new QLabel(this);
    customerStatusLabel->setText("Customer Status:");
    customerStatusLabel->setAlignment(AlignRight);

    customerStatus = new QLabel(this);
    customerStatus->setAlignment(AlignLeft);
    
    list = new Q3ListView(this);
    list->addColumn( "Date" );
    list->addColumn( "Login ID" );
    list->addColumn( "Item ID" );
    list->addColumn( "Qty" );
    list->setColumnAlignment(3, Qt::AlignRight);
    list->addColumn( "Amount" );
    list->setColumnAlignment(4, Qt::AlignRight);
    list->addColumn( "Total" );
    list->setColumnAlignment(5, Qt::AlignRight);
    list->addColumn( "Description" );
    //list->addColumn( "TrnsID" );

    QPushButton *printButton = new QPushButton(this);
    printButton->setText("&Print");
    connect(printButton, SIGNAL(clicked()), this, SLOT(printRegister()));

    voidChargeButton = new QPushButton(this);
    voidChargeButton->setText("&Void");
    connect(voidChargeButton, SIGNAL(clicked()), this, SLOT(voidCustCharge()));
    voidChargeButton->setEnabled(false);

    delChargeButton = new QPushButton(this);
    delChargeButton->setText("&Delete");
    connect(delChargeButton, SIGNAL(clicked()), this, SLOT(delCustCharge()));

    editChargeButton = new QPushButton(this);
    editChargeButton->setText("&Edit");
    connect(editChargeButton, SIGNAL(clicked()), this, SLOT(editCustCharge()));
    editChargeButton->setEnabled(false);

    newChargeButton = new QPushButton(this);
    newChargeButton->setText("&New");
    connect(newChargeButton, SIGNAL(clicked()), this, SLOT(newCustCharge()));

    QPushButton *closeButton = new QPushButton(this);
    closeButton->setText("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

    // Now, create our layouts
    Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);

    // The text label layouts
    Q3GridLayout *tl = new Q3GridLayout(2, 4, 3);
    tl->setColStretch(0, 0);
    tl->setColStretch(1, 1);
    tl->setColStretch(2, 0);
    tl->setColStretch(3, 1);
    tl->setRowStretch(0, 0);
    tl->setRowStretch(1, 0);
    tl->addWidget(custNameLabel,        0, 0);
    tl->addWidget(customerName,         0, 1);
    tl->addWidget(customerBalanceLabel, 0, 2);
    tl->addWidget(currentBalanceArea,   0, 3);
    tl->addWidget(customerIDLabel,      1, 0);
    tl->addWidget(custIDLabel,          1, 1);
    tl->addWidget(customerStatusLabel,  1, 2);
    tl->addWidget(customerStatus,       1, 3);

    ml->addLayout(tl, 0);

    ml->addWidget(list, 1);

    // Now, our button area
    Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
    bl->addStretch(1);
    bl->addWidget(printButton, 0);
    bl->addWidget(voidChargeButton, 0);
    bl->addWidget(delChargeButton, 0);
    bl->addWidget(editChargeButton, 0);
    bl->addWidget(newChargeButton, 0);
    bl->addSpacing(10);
    bl->addWidget(closeButton, 0);

    ml->addLayout(bl, 0);


    
    
    CustomersDB     CDB;
    
    char    tmpStr[1024];
    
    CDB.get(myCustID);
    customerName->setText(CDB.getStr("FullName"));
    custIDLabel->setText(CDB.getStr("CustomerID"));
    sprintf(tmpStr, "$%.2f", CDB.getFloat("CurrentBalance"));
    currentBalanceArea->setText(tmpStr);
    if (CDB.getInt("Active")) {
        strcpy(tmpStr, "Active");
    } else {
        strcpy(tmpStr, "Inactive");
    }
    customerStatus->setText(tmpStr);
    
    sprintf(tmpStr, "Register for %s (%ld)", (const char *) CDB.getStr("FullName"), myCustID);
    setCaption(tmpStr);

	if (!isManager()) {
		newChargeButton->hide();
		editChargeButton->hide();
		delChargeButton->hide();
		voidChargeButton->hide();
	}


    //list->setSorting(7, TRUE);  // Sort by the internal transaction ID to
                                // make sure that our total works.
    
    // The numeric columns should be aligned to the right.
    
    list->setAllColumnsShowFocus(TRUE);

	refreshRegister(1);
	

}