Ejemplo n.º 1
0
void PlayerEditNameState::init()
{
    State::init();
    setFullscreen(false);
    setModal(true);

    auto bgX = (Game::getInstance()->renderer()->width() - 640)*0.5;
    auto bgY = (Game::getInstance()->renderer()->height() - 480)*0.5;

    _keyCodes.insert(std::make_pair(SDLK_a, 'a'));
    _keyCodes.insert(std::make_pair(SDLK_b, 'b'));
    _keyCodes.insert(std::make_pair(SDLK_c, 'c'));
    _keyCodes.insert(std::make_pair(SDLK_d, 'd'));
    _keyCodes.insert(std::make_pair(SDLK_e, 'e'));
    _keyCodes.insert(std::make_pair(SDLK_f, 'f'));
    _keyCodes.insert(std::make_pair(SDLK_g, 'g'));
    _keyCodes.insert(std::make_pair(SDLK_h, 'h'));
    _keyCodes.insert(std::make_pair(SDLK_i, 'i'));
    _keyCodes.insert(std::make_pair(SDLK_j, 'j'));
    _keyCodes.insert(std::make_pair(SDLK_k, 'k'));
    _keyCodes.insert(std::make_pair(SDLK_l, 'l'));
    _keyCodes.insert(std::make_pair(SDLK_m, 'm'));
    _keyCodes.insert(std::make_pair(SDLK_n, 'n'));
    _keyCodes.insert(std::make_pair(SDLK_o, 'o'));
    _keyCodes.insert(std::make_pair(SDLK_p, 'p'));
    _keyCodes.insert(std::make_pair(SDLK_q, 'q'));
    _keyCodes.insert(std::make_pair(SDLK_r, 'r'));
    _keyCodes.insert(std::make_pair(SDLK_s, 's'));
    _keyCodes.insert(std::make_pair(SDLK_t, 't'));
    _keyCodes.insert(std::make_pair(SDLK_u, 'u'));
    _keyCodes.insert(std::make_pair(SDLK_v, 'v'));
    _keyCodes.insert(std::make_pair(SDLK_w, 'w'));
    _keyCodes.insert(std::make_pair(SDLK_x, 'x'));
    _keyCodes.insert(std::make_pair(SDLK_y, 'y'));
    _keyCodes.insert(std::make_pair(SDLK_z, 'z'));
    _keyCodes.insert(std::make_pair(SDLK_1, '1'));
    _keyCodes.insert(std::make_pair(SDLK_2, '2'));
    _keyCodes.insert(std::make_pair(SDLK_3, '3'));
    _keyCodes.insert(std::make_pair(SDLK_4, '4'));
    _keyCodes.insert(std::make_pair(SDLK_5, '5'));
    _keyCodes.insert(std::make_pair(SDLK_6, '6'));
    _keyCodes.insert(std::make_pair(SDLK_7, '7'));
    _keyCodes.insert(std::make_pair(SDLK_8, '8'));
    _keyCodes.insert(std::make_pair(SDLK_9, '9'));
    _keyCodes.insert(std::make_pair(SDLK_0, '0'));

    _timer = SDL_GetTicks();

    auto bg = new Image("art/intrface/charwin.frm");
    bg->setX(bgX+22);
    bg->setY(bgY+0);

    auto nameBox = new Image("art/intrface/namebox.frm");
    nameBox->setX(bgX+35);
    nameBox->setY(bgY+10);

    auto doneBox = new Image("art/intrface/donebox.frm");
    doneBox->setX(bgX+35);
    doneBox->setY(bgY+40);

    auto msg = ResourceManager::msgFileType("text/english/game/editor.msg");
    auto doneLabel = new TextArea(msg->message(100), bgX+65, bgY+43);
    auto font3_b89c28ff = ResourceManager::font("font3.aaf", 0xb89c28ff);
    doneLabel->setFont(font3_b89c28ff);

    auto doneButton = new ImageButton(ImageButton::TYPE_SMALL_RED_CIRCLE, bgX+45, bgY+43);
    doneButton->addEventHandler("mouseleftclick", this, (EventRecieverMethod) &PlayerEditNameState::onDoneButtonClick);

    _name = new TextArea(Game::getInstance()->player()->name(), bgX+43, bgY+15);
    _name->addEventHandler("keyup", this, (EventRecieverMethod) &PlayerEditNameState::onKeyboardPress);

    _cursor = new Image(5, 8);
    _cursor->setX(bgX+83);
    _cursor->setY(bgY+15);
    _cursor->texture()->fill(0x3FF800FF);

    addUI(bg);
    addUI(nameBox);
    addUI(doneBox);
    addUI(doneLabel);
    addUI(doneButton);
    addUI(_name);
    addUI(_cursor);
}
Ejemplo n.º 2
0
//***************************************************************************
Kwave::NotchFilterDialog::NotchFilterDialog(QWidget *parent, double sample_rate)
    :QDialog(parent), Kwave::PluginSetupDialog(),
     Ui::NotchFilterDlg(),
     m_frequency(3500),m_bw(100),
     m_sample_rate(sample_rate), m_filter(0)
{
    setupUi(this);
    setModal(true);

    // set maximum frequency to sample rate / 2
    double f_max = sample_rate / 2.0;

    slider->setMaximum(Kwave::toInt(f_max));
    spinbox->setMaximum(Kwave::toInt(f_max));

    slider_2->setMaximum(Kwave::toInt(f_max));
    spinbox_2->setMaximum(Kwave::toInt(f_max));

    // initialize the frequency scale widget
    scale_freq->setMinMax(0, Kwave::toInt(f_max));
    scale_freq->setLogMode(false);
    scale_freq->setUnit(i18n("Hz"));

    // initialize the attenuation scale widget
    scale_db->setMinMax(-24, +6);
    scale_db->setLogMode(false);
    scale_db->setUnit(i18n("dB"));

    // initialize the frequency response widget
    freq_response->init(f_max, -24, +6);

    // set up the low pass filter dunction
    m_filter = new NotchFilter();
    freq_response->setFilter(m_filter);

    // initialize the controls and the curve display
    slider->setValue(Kwave::toInt(m_frequency));
    spinbox->setValue(Kwave::toInt(m_frequency));
    slider_2->setValue(Kwave::toInt(m_bw));
    spinbox_2->setValue(Kwave::toInt(m_bw));
    updateDisplay();

    // changes in the slider or spinbox
    connect(spinbox, SIGNAL(valueChanged(int)),
            this, SLOT(freqValueChanged(int)));
    connect(spinbox_2, SIGNAL(valueChanged(int)),
    	    this, SLOT(bwValueChanged(int)));
    // click to the "Listen" button
    connect(btListen, SIGNAL(toggled(bool)),
            this, SLOT(listenToggled(bool)));

    // expand the "Listen" button to it's maximum width
    listenToggled(true);
    if (btListen->width() > btListen->minimumWidth())
        btListen->setMinimumWidth(btListen->width());
    listenToggled(false);
    if (btListen->width() > btListen->minimumWidth())
        btListen->setMinimumWidth(btListen->width());

    // set the initial size of the dialog
    int h = (width() * 3) / 5;
    if (height() < h) resize(width(), h);
    int w = (height() * 5) / 3;
    if (width() < w) resize(w, height());

    connect(buttonHelp->button(QDialogButtonBox::Help), SIGNAL(clicked()),
            this,   SLOT(invokeHelp()));

    // set the focus onto the "OK" button
    buttonBox->button(QDialogButtonBox::Ok)->setFocus();
}
Ejemplo n.º 3
0
void GameMenu::init()
{
    if (_initialized) return;
    State::init();

    setModal(true);
    setFullscreen(false);

    auto background = new UI::Image("art/intrface/opbase.frm");
    auto panelHeight = Game::getInstance()->locationState()->playerPanelState()->height();

    auto backgroundPos = (Game::getInstance()->renderer()->size() - background->size() - Point(0, panelHeight)) / 2;
    int backgroundX = backgroundPos.x();
    int backgroundY = backgroundPos.y();

    auto saveGameButton    = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18);
    auto loadGameButton    = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37);
    auto preferencesButton = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*2);
    auto exitGameButton    = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*3);
    auto doneButton        = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*4);

    preferencesButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doPreferences(); });
    exitGameButton->addEventHandler("mouseleftclick",    [this](Event::Event* event){ this->doExit(); });
    doneButton->addEventHandler("mouseleftclick",        [this](Event::Event* event){ this->closeMenu(); });

    auto font = ResourceManager::getInstance()->font("font3.aaf", 0xb89c28ff);

    // label: save game
    auto saveGameButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 0), backgroundX+8, backgroundY+26);
    saveGameButtonLabel->setFont(font);
    saveGameButtonLabel->setSize({150, 0});
    saveGameButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
    saveGameButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doSaveGame(); });

    // label: load game
    auto loadGameButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 1), backgroundX+8, backgroundY+26+37);
    loadGameButtonLabel->setFont(font);
    loadGameButtonLabel->setSize({150, 0});
    loadGameButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
    loadGameButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doLoadGame(); });

    // label: preferences
    auto preferencesButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 2), backgroundX+8, backgroundY+26+37*2);
    preferencesButtonLabel->setFont(font);
    preferencesButtonLabel->setSize({150, 0});
    preferencesButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);

    // label: exit game
    auto exitGameButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 3), backgroundX+8, backgroundY+26+37*3);
    exitGameButtonLabel->setFont(font);
    exitGameButtonLabel->setSize({150, 0});
    exitGameButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);

    // label: done
    auto doneButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 4), backgroundX+8, backgroundY+26+37*4);
    doneButtonLabel->setFont(font);
    doneButtonLabel->setSize({150, 0});
    doneButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);

    background->setPosition(backgroundPos);

    addUI(background);
    addUI(saveGameButton);
    addUI(loadGameButton);
    addUI(preferencesButton);
    addUI(exitGameButton);
    addUI(doneButton);
    addUI(saveGameButtonLabel);
    addUI(loadGameButtonLabel);
    addUI(preferencesButtonLabel);
    addUI(exitGameButtonLabel);
    addUI(doneButtonLabel);
}
Ejemplo n.º 4
0
//BEGIN class LinkerOptionsDlg
LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent )
	: // KDialog( parent, "Linker Options Dialog", true, "Linker Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true )
	KDialog( parent) //, "Linker Options Dialog", true, "Linker Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true )
{
    setObjectName("Linker Options Dialog");
    setModal(true);
    setCaption(i18n("Linker Options"));
    setButtons(KDialog::Ok|KDialog::Cancel);
    setDefaultButton(KDialog::Ok);
    showButtonSeparator(true);


	m_pLinkerOptions = linkingOptions;
	m_pWidget = new LinkerOptionsWidget(this);
	
	ProjectInfo * pi = ProjectManager::self()->currentProject();
	assert(pi);
	
	
	//BEGIN Update gplink options
	m_pWidget->m_pHexFormat->setCurrentIndex( m_pLinkerOptions->hexFormat() );
	m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() );
	m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() );
	m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() );
	m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() );
	//END Update gplink options
	
	
	
	//BEGIN Update library widgets
	const KUrl::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType );
	const QStringList linkedInternal = m_pLinkerOptions->linkedInternal();
	
	KUrl::List::const_iterator end = availableInternal.end();
	for ( KUrl::List::const_iterator it = availableInternal.begin(); it != end; ++it )
	{
		QString relativeURL = KUrl::relativeUrl( pi->url(), *it );
        // 2017.12.1 - convert to QListWidgetItem
		//Q3CheckListItem * item = new Q3CheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, Q3CheckListItem::CheckBox );
        QListWidgetItem * item = new QListWidgetItem( relativeURL, m_pWidget->m_pInternalLibraries );
        item->setCheckState( (linkedInternal.contains(relativeURL)) ? Qt::Checked : Qt::Unchecked );
		//item->setOn( linkedInternal.contains(relativeURL) ); // 2017.12.1 - convert to QListWidgetItem
	}
	
	m_pExternalLibraryRequester = new KUrlRequester( 0l );
	m_pExternalLibraryRequester->fileDialog()->setUrl( KUrl( "/usr/share/sdcc/lib" ) );
	
	delete m_pWidget->m_pExternalLibraries;
	m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget );
	m_pWidget->m_pExternalLibraries->layout()->setMargin(11);
    {
        QGridLayout* grLayout = (dynamic_cast<QGridLayout*>(m_pWidget->layout()));
        //grLayout->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 ); // 2018.12.02
        grLayout->addWidget( m_pWidget->m_pExternalLibraries, 7, 0, 1, 2);
    }
	
	m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove );
	m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() );
	//END Update library widgets
	
	
	setMainWidget( m_pWidget );
	setInitialSize( m_pWidget->rect().size() );
}
Ejemplo n.º 5
0
/*
*  Constructs a ResampleForm as a child of 'parent', with the
*  name 'name' and widget flags set to 'f'.
*
*  The dialog will by default be modeless, unless you set 'modal' to
*  TRUE to construct a modal dialog.
*/
ResampleForm::ResampleForm( RasterInfo input, RasterInfo output, QWidget* parent, bool modal, Qt::WFlags fl )
: QDialog( parent, fl )
{
	setModal( modal );
	//Keeps it from overly expanding since over riding sizeHint didn't work
	setMaximumSize( 152, 150 );	
	
	if ( objectName().isEmpty() )
		setObjectName( "ResampleForm" );

	setPalette( RESAMPLEFORM_COLOR );

	bytesPerRow = (input.cols() * (input.bitCount() / 8));

	ResampleFormLayout = new QVBoxLayout( this );
	ResampleFormLayout->setSpacing( 6 );

	inputLayout = new QVBoxLayout( 0 ); 
	inputLayout->setSpacing( 6 );

	resampleBox = new QGroupBox( this );	
	resampleBoxLayout = new QVBoxLayout( resampleBox );
	resampleBoxLayout->setSpacing( 6 );
	resampleBoxLayout->setMargin( 11 );
	resampleBoxLayout->setAlignment( Qt::AlignTop );

	resampleCombo = new QComboBox( resampleBox );
	resampleCombo->setMinimumSize( QSize( 125, 0 ) );
	resampleCombo->installEventFilter( this );
	resampleBoxLayout->addWidget( resampleCombo );

	categoricalLayout = new QHBoxLayout( 0 );
	categoricalLayout->setParent( resampleBoxLayout );
	resampleBoxLayout->addLayout( categoricalLayout );
	catconLabel = new QLabel( "", resampleBox );
	conRadio = new QRadioButton( "Continuous Data", resampleBox );
	catRadio = new QRadioButton( "Categorical Data", resampleBox );
	catconButtonGroup = new QGroupBox( resampleBox );
	catconButtonGroup->hide();
	
	QHBoxLayout *catconLayout = new QHBoxLayout( catconButtonGroup );
	catconLayout->addWidget( catRadio );
	catconLayout->addWidget( conRadio );
	categoricalLayout->addWidget( catconLabel );
	categoricalLayout->addWidget( conRadio );
	categoricalLayout->addWidget( catRadio );

	inputLayout->addWidget( resampleBox );

	ignoreBox = new QGroupBox( this );		
	ignoreBoxLayout = new QHBoxLayout( ignoreBox );
	ignoreBoxLayout->setSpacing( 6 );
	ignoreBoxLayout->setMargin( 11 );
	ignoreBoxLayout->setAlignment( Qt::AlignTop );

	ignoreLayout = new QVBoxLayout( 0 );
	ignoreLayout->setSpacing( 6 );

	ignoreLabel = new QLabel( "Ignore values cannot be used if an output \"No Data \nValue\" is not provided.", ignoreBox );
	ignoreLabel->hide();
	ignoreBoxLayout->addWidget( ignoreLabel );
	
	ignoreEdit = new QLineEdit( ignoreBox );
	ignoreEdit->setMinimumSize( QSize( 125, 0 ) );
	ignoreEdit->setValidator( new MapimgValidator( output.fullDataType(), ignoreEdit ) );
	ignoreLayout->addWidget( ignoreEdit );

	newButton = new QPushButton( ignoreBox );
	newButton->setAutoDefault( false );
	ignoreLayout->addWidget( newButton );
	delButton = new QPushButton( ignoreBox );
	delButton->setEnabled( false );
	delButton->setAutoDefault( false );
	ignoreLayout->addWidget( delButton );
	ingoreSpacer = new QSpacerItem( 31, 91, QSizePolicy::Minimum, QSizePolicy::Expanding );
	ignoreLayout->addItem( ingoreSpacer );
	ignoreBoxLayout->addLayout( ignoreLayout );

	ignoreListBox = new QListWidget( ignoreBox );
	ignoreListBox->setMinimumSize( QSize( 125, 0 ) );
	ignoreListBox->installEventFilter( this );
	ignoreBoxLayout->addWidget( ignoreListBox );
	inputLayout->addWidget( ignoreBox );

	if( !output.hasNoDataValue() )
	{
		ignoreLabel->show();

		ignoreEdit->hide();
		newButton->hide();
		delButton->hide();
		ignoreListBox->hide();
	}

	ResampleFormLayout->addLayout( inputLayout );

	memoryBox = new QGroupBox( this );		
	memoryBoxLayout = new QVBoxLayout( memoryBox );
	memoryBoxLayout->setSpacing( 6 );
	memoryBoxLayout->setMargin( 11 );
	memoryBoxLayout->setAlignment( Qt::AlignHCenter | Qt::AlignTop );

	memoryLabelResetLayout = new QHBoxLayout();

	memoryLabel = new QLabel( memoryBox );
	memoryLabel->setAlignment( Qt::AlignCenter );

	memoryResetButton = new QPushButton( "Default", memoryBox );
	QFontMetrics metrics( memoryResetButton->font() );
	memoryResetButton->setMaximumWidth( metrics.width(memoryResetButton->text()) + (metrics.maxWidth()) );
	memoryResetButton->setMaximumHeight( (int)(1.5*metrics.height()) );

	memoryResetButton->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ) );

	//DEFAULT_Max_Data_Element_Count is defined in imgio.h
	//minimum computed as the ratio of output to input plus 2% of the input
	memoryAllocation = new QSlider( Qt::Horizontal, memoryBox );
	memoryAllocation->setMinimum( (int)((output.pixelSize()/input.pixelSize()) + 0.02*(float)input.rows()) );
	memoryAllocation->setMaximum( input.rows() );
	memoryAllocation->setPageStep( 10 );
	memoryAllocation->setValue( DEFAULT_Max_Data_Element_Count );

	defaultMemory = memoryAllocation->value();

	memoryLabelResetLayout->addWidget( memoryLabel );
	memoryLabelResetLayout->addWidget( memoryResetButton );
	memoryBoxLayout->addLayout( memoryLabelResetLayout );
	memoryBoxLayout->addWidget( memoryAllocation );
	inputLayout->addWidget( memoryBox );

	okLayout = new QHBoxLayout( 0 );
	okLayout->setSpacing( 6 );
	okSpacer = new QSpacerItem( 141, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
	okLayout->addItem( okSpacer );

	okButton = new QPushButton( this );
	okButton->setAutoDefault( false );
	okLayout->addWidget( okButton );

	cancelButton = new QPushButton( this );
	cancelButton->setAutoDefault( false );
	cancelButton->setShortcut( Qt::Key_Escape );
	okLayout->addWidget( cancelButton );
	ResampleFormLayout->addLayout( okLayout );
	languageChange();
	resize( QSize(300, 218).expandedTo(minimumSizeHint()) );
	//   clearWState( WState_Polished );


	connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
	connect( resampleCombo, SIGNAL( activated(const QString&) ), this, SLOT( rcodeChanged(const QString&) ) );
	connect( ignoreEdit, SIGNAL( returnPressed() ), this, SLOT( newVal() ) );
	connect( ignoreEdit, SIGNAL( returnPressed() ), newButton, SLOT( animateClick() ) );
	connect( newButton, SIGNAL( clicked() ), this, SLOT( newVal() ) );
	connect( delButton, SIGNAL( clicked() ), this, SLOT( delVal() ) );
	connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
	connect( memoryAllocation, SIGNAL( valueChanged( int ) ), this, SLOT( updateMemoryAllocation() ) );
	connect( memoryResetButton, SIGNAL( clicked() ), this, SLOT( resetMemory() ) );


	canceled = false;
	ilist.clear();
	rcodeChanged( resampleCombo->currentText() );
}
Ejemplo n.º 6
0
/**
 * @brief PartSetter::showDialogModal
 *
 * Affiche le dialogue
 */
void PartSetter::showDialogModal()
{
	// on affiche la boite de dialogue de facon modale
	setModal(true);
	show();
}
Ejemplo n.º 7
0
RecompressOptionsDialog::RecompressOptionsDialog(QWidget *parent)
                       : KDialog( parent)
{
    setCaption(i18n("Recompression Options"));
    setModal(true);
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    QWidget* box = new QWidget( this );
    setMainWidget(box);
    Q3VBoxLayout *dvlay = new Q3VBoxLayout( box, 10, spacingHint() );
    QString whatsThis;

    // JPEG file format.

    Q3GroupBox * groupBox1 = new Q3GroupBox( 2, Qt::Horizontal, i18n("JPEG File Format"), box );

    m_label_JPEGimageCompression = new QLabel (i18n("Image compression level:"), groupBox1);
    m_JPEGCompression = new KIntNumInput(75, groupBox1);
    m_JPEGCompression->setRange(1, 100);
    m_JPEGCompression->setSliderEnabled(true);
    whatsThis = i18n("<p>The compression value for JPEG target images:<p>");
    whatsThis = whatsThis + i18n("<b>1</b>: very high compression<p>"
                                 "<b>25</b>: high compression<p>"
                                 "<b>50</b>: medium compression<p>"
                                 "<b>75</b>: low compression (default value)<p>"
                                 "<b>100</b>: no compression");

    m_JPEGCompression->setWhatsThis(whatsThis);
    m_label_JPEGimageCompression->setBuddy( m_JPEGCompression );

    m_compressLossLess = new QCheckBox( i18n("Use lossless compression"), groupBox1);
    m_compressLossLess->setWhatsThis(i18n("<p>If this option is enabled, "
                                              "all JPEG operations will use lossless compression."));

    connect(m_compressLossLess, SIGNAL( toggled(bool) ),
            this, SLOT( slotCompressLossLessEnabled(bool) ) );

    dvlay->addWidget( groupBox1 );

    // PNG File format.

    Q3GroupBox * groupBox2 = new Q3GroupBox( 2, Qt::Horizontal, i18n("PNG File Format"), box );

    m_label_PNGimageCompression = new QLabel (i18n("Image compression level:"), groupBox2);
    m_PNGCompression = new KIntNumInput(75, groupBox2);
    m_PNGCompression->setRange(1, 100);
    m_PNGCompression->setSliderEnabled(true);
    whatsThis = i18n("<p>The compression value for PNG target images:<p>");
    whatsThis = whatsThis + i18n("<b>1</b>: very high compression<p>"
                                 "<b>25</b>: high compression<p>"
                                 "<b>50</b>: medium compression<p>"
                                 "<b>75</b>: low compression (default value)<p>"
                                 "<b>100</b>: no compression");

    m_PNGCompression->setWhatsThis(whatsThis);
    m_label_PNGimageCompression->setBuddy( m_PNGCompression );

    dvlay->addWidget( groupBox2 );

    // TIFF File format.

    Q3GroupBox * groupBox3 = new Q3GroupBox( 2, Qt::Horizontal, i18n("TIFF File Format"), box );

    m_label_TIFFimageCompression = new QLabel (i18n("Image compression algorithm:"), groupBox3);
    m_TIFFCompressionAlgo = new QComboBox( false, groupBox3 );
    m_TIFFCompressionAlgo->insertItem("LZW");
    m_TIFFCompressionAlgo->insertItem("JPEG");
    m_TIFFCompressionAlgo->insertItem(i18n("None"));
    m_TIFFCompressionAlgo->setWhatsThis(i18n("<p>Select here the TIFF compression algorithm.") );
    m_label_TIFFimageCompression->setBuddy( m_TIFFCompressionAlgo );

    dvlay->addWidget( groupBox3 );

    // TGA File format.

    Q3GroupBox * groupBox4 = new Q3GroupBox( 2, Qt::Horizontal, i18n("TGA File Format"), box );

    m_label_TGAimageCompression = new QLabel (i18n("Image compression algorithm:"), groupBox4);
    m_TGACompressionAlgo = new QComboBox( false, groupBox4 );
    m_TGACompressionAlgo->insertItem("RLE");
    m_TGACompressionAlgo->insertItem(i18n("None"));
    m_TGACompressionAlgo->setWhatsThis(i18n("<p>Select here the TGA compression algorithm.") );
    m_label_TGAimageCompression->setBuddy( m_TGACompressionAlgo );

    dvlay->addWidget( groupBox4 );
}
Ejemplo n.º 8
0
SearchReplace::SearchReplace( QWidget* parent, ScribusDoc *doc, PageItem* ite, bool mode )
	: QDialog( parent ),
	matchesFound(0)
{
	m_item = ite;
	m_doc = doc;
	m_notFound = false;
	m_itemMode = mode;
	m_firstMatchPosition = -1;

	setModal(true);
	setWindowTitle( tr( "Search/Replace" ) );
	setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));

	SearchReplaceLayout = new QVBoxLayout( this );
	SearchReplaceLayout->setMargin(10);
	SearchReplaceLayout->setSpacing(5);
	SelLayout = new QHBoxLayout;
	SelLayout->setMargin(0);
	SelLayout->setSpacing(5);
	Search = new QGroupBox( this );
	Search->setTitle( tr( "Search for:" ) );
	SearchLayout = new QGridLayout( Search );
	SearchLayout->setMargin(5);
	SearchLayout->setSpacing(2);
	SearchLayout->setAlignment( Qt::AlignTop );
	SText = new QCheckBox( Search );
	SText->setText( tr( "Text" ) );
	SearchLayout->addWidget( SText, 0, 0 );
	SStyle = new QCheckBox( Search );
	SStyle->setText( tr( "Style" ) );
	SearchLayout->addWidget( SStyle, 1, 0 );
	SAlign = new QCheckBox( Search );
	SAlign->setText( tr( "Alignment" ) );
	SearchLayout->addWidget( SAlign, 2, 0 );
	SFont = new QCheckBox( Search );
	SFont->setText( tr( "Font" ) );
	SearchLayout->addWidget( SFont, 3, 0 );
	SSize = new QCheckBox( Search );
	SSize->setText( tr( "Font Size" ) );
	SearchLayout->addWidget( SSize, 4, 0 );
	SEffect = new QCheckBox( Search );
	SEffect->setText( tr( "Font Effects" ) );
	SearchLayout->addWidget( SEffect, 5, 0 );
	SFill = new QCheckBox( Search);
	SFill->setText( tr( "Fill Color" ) );
	SearchLayout->addWidget( SFill, 6, 0 );
	SFillS = new QCheckBox( Search );
	SFillS->setText( tr( "Fill Shade" ) );
	SearchLayout->addWidget( SFillS, 7, 0 );
	SStroke = new QCheckBox( Search );
	SStroke->setText( tr( "Stroke Color" ) );
	SearchLayout->addWidget( SStroke, 8, 0 );
	SStrokeS = new QCheckBox( Search );
	SStrokeS->setText( tr( "Stroke Shade" ) );
	SearchLayout->addWidget( SStrokeS, 9, 0 );
	STextVal = new QLineEdit( Search );
	STextVal->setEnabled(false);
	SearchLayout->addWidget( STextVal, 0, 1 );
	SStyleVal = new QComboBox( Search );
	SStyleVal->setEditable(false);
	for (int x = 0; x < doc->paragraphStyles().count(); ++x)
		SStyleVal->addItem(doc->paragraphStyles()[x].name());
	QListView *tmpView = dynamic_cast<QListView*>(SStyleVal->view()); Q_ASSERT(tmpView);
	int tmpWidth = tmpView->sizeHintForColumn(0);
	if (tmpWidth > 0)
		tmpView->setMinimumWidth(tmpWidth + 24);
	SStyleVal->setCurrentIndex(findParagraphStyle(doc, doc->currentStyle));
	SStyleVal->setEnabled(false);
	SearchLayout->addWidget( SStyleVal, 1, 1 );
	SAlignVal = new QComboBox( Search );
	SAlignVal->setEditable(false);
	QString tmp_sty[] = { tr("Left"), tr("Center"), tr("Right"), tr("Block"), tr("Forced")};
	size_t ar_sty = sizeof(tmp_sty) / sizeof(*tmp_sty);
	for (uint a = 0; a < ar_sty; ++a)
		SAlignVal->addItem( tmp_sty[a] );
	tmpView = dynamic_cast<QListView*>(SAlignVal->view()); Q_ASSERT(tmpView);
	tmpWidth = tmpView->sizeHintForColumn(0);
	if (tmpWidth > 0)
		tmpView->setMinimumWidth(tmpWidth + 24);
	SAlignVal->setEnabled(false);
	SearchLayout->addWidget( SAlignVal, 2, 1 );
	SFontVal = new FontCombo(Search);
	SFontVal->setMaximumSize(190, 30);
	setCurrentComboItem(SFontVal, doc->currentStyle.charStyle().font().scName());
	SFontVal->setEnabled(false);
	SearchLayout->addWidget( SFontVal, 3, 1 );
	SSizeVal = new ScrSpinBox( 0.5, 2048, Search, 0 );
	SSizeVal->setValue( doc->currentStyle.charStyle().fontSize() / 10.0 );
	SSizeVal->setEnabled(false);
	SearchLayout->addWidget( SSizeVal, 4, 1 );
	SEffVal = new StyleSelect( Search );
	SEffVal->setStyle(0);
	SEffVal->setEnabled(false);
	SearchLayout->addWidget( SEffVal, 5, 1, Qt::AlignLeft );
	SFillVal = new ColorCombo( Search );
	SFillVal->setEditable(false);
	SFillVal->setPixmapType(ColorCombo::fancyPixmaps);
	SFillVal->setColors(doc->PageColors, true);
	SFillVal->setMinimumWidth(SFillVal->view()->maximumViewportSize().width() + 24);
	setCurrentComboItem(SFillVal, doc->currentStyle.charStyle().fillColor());
	SFillVal->setEnabled(false);
	SearchLayout->addWidget( SFillVal, 6, 1 );
	SFillSVal = new ShadeButton(Search);
	SFillSVal->setEnabled(false);
	SearchLayout->addWidget( SFillSVal, 7, 1, Qt::AlignLeft );
	SStrokeVal = new ColorCombo( Search );
	SStrokeVal->setEditable(false);
	SStrokeVal->setPixmapType(ColorCombo::fancyPixmaps);
	SStrokeVal->setColors(doc->PageColors, true);
	SStrokeVal->view()->setMinimumWidth(SStrokeVal->view()->maximumViewportSize().width() + 24);
	setCurrentComboItem(SStrokeVal, doc->currentStyle.charStyle().strokeColor());
	SStrokeVal->setEnabled(false);
	SearchLayout->addWidget( SStrokeVal, 8, 1 );
	SStrokeSVal =  new ShadeButton(Search);
	SStrokeSVal->setEnabled(false);
	SearchLayout->addWidget( SStrokeSVal, 9, 1, Qt::AlignLeft );
	SelLayout->addWidget( Search );

	Replace = new QGroupBox( this );
	Replace->setTitle( tr( "Replace with:" ) );
	ReplaceLayout = new QGridLayout( Replace );
	ReplaceLayout->setSpacing( 2 );
	ReplaceLayout->setMargin( 5 );
	ReplaceLayout->setAlignment( Qt::AlignTop );
	RText = new QCheckBox( Replace );
	RText->setText( tr( "Text" ) );
	ReplaceLayout->addWidget( RText, 0, 0 );
	RStyle = new QCheckBox( Replace );
	RStyle->setText( tr( "Style" ) );
	ReplaceLayout->addWidget( RStyle, 1, 0 );
	RAlign = new QCheckBox( Replace );
	RAlign->setText( tr( "Alignment" ) );
	ReplaceLayout->addWidget( RAlign, 2, 0 );
	RFont = new QCheckBox( Replace );
	RFont->setText( tr( "Font" ) );
	ReplaceLayout->addWidget( RFont, 3, 0 );
	RSize = new QCheckBox( Replace );
	RSize->setText( tr( "Font Size" ) );
	ReplaceLayout->addWidget( RSize, 4, 0 );
	REffect = new QCheckBox( Replace );
	REffect->setText( tr( "Font Effects" ) );
	ReplaceLayout->addWidget( REffect, 5, 0 );
	RFill = new QCheckBox( Replace );
	RFill->setText( tr( "Fill Color" ) );
	ReplaceLayout->addWidget( RFill, 6, 0 );
	RFillS = new QCheckBox( Replace );
	RFillS->setText( tr( "Fill Shade" ) );
	ReplaceLayout->addWidget( RFillS, 7, 0 );
	RStroke = new QCheckBox( Replace );
	RStroke->setText( tr( "Stroke Color" ) );
	ReplaceLayout->addWidget( RStroke, 8, 0 );
	RStrokeS = new QCheckBox( Replace );
	RStrokeS->setText( tr( "Stroke Shade" ) );
	ReplaceLayout->addWidget( RStrokeS, 9, 0 );
	RTextVal = new QLineEdit( Replace );
	RTextVal->setEnabled(false);
	ReplaceLayout->addWidget( RTextVal, 0, 1 );
	RStyleVal = new QComboBox( Replace );
	RStyleVal->setEditable(false);
	for (int x = 0; x < doc->paragraphStyles().count(); ++x)
		RStyleVal->addItem(doc->paragraphStyles()[x].name());
	tmpView = dynamic_cast<QListView*>(RStyleVal->view()); Q_ASSERT(tmpView);
	tmpWidth = tmpView->sizeHintForColumn(0);
	if (tmpWidth > 0)
		tmpView->setMinimumWidth(tmpWidth + 24);
	RStyleVal->setCurrentIndex(findParagraphStyle(doc, doc->currentStyle));
	RStyleVal->setEnabled(false);
	ReplaceLayout->addWidget( RStyleVal, 1, 1 );
	RAlignVal = new QComboBox( Replace );
	RAlignVal->setEditable(false);
	for (uint a = 0; a < ar_sty; ++a)
		RAlignVal->addItem(tmp_sty[a]);
	tmpView = dynamic_cast<QListView*>(RAlignVal->view()); Q_ASSERT(tmpView);
	tmpWidth = tmpView->sizeHintForColumn(0);
	if (tmpWidth > 0)
		tmpView->setMinimumWidth(tmpWidth + 24);
	RAlignVal->setEnabled(false);
	ReplaceLayout->addWidget( RAlignVal, 2, 1 );
	RFontVal = new FontCombo(Replace);
	RFontVal->setMaximumSize(190, 30);
	setCurrentComboItem(RFontVal, doc->currentStyle.charStyle().font().scName());
	RFontVal->setEnabled(false);
	ReplaceLayout->addWidget( RFontVal, 3, 1 );
	RSizeVal = new ScrSpinBox( 0.5, 2048, Replace, 0 );
	RSizeVal->setValue( doc->currentStyle.charStyle().fontSize() / 10.0 );
	RSizeVal->setEnabled(false);
	ReplaceLayout->addWidget( RSizeVal, 4, 1 );
	REffVal = new StyleSelect( Replace );
	REffVal->setStyle(0);
	REffVal->setEnabled(false);
	ReplaceLayout->addWidget( REffVal, 5, 1, Qt::AlignLeft );
	RFillVal = new ColorCombo( true, Replace );
	RFillVal->setEditable(false);
	RFillVal->setPixmapType(ColorCombo::fancyPixmaps);
	RFillVal->setColors(doc->PageColors, true);
	RFillVal->view()->setMinimumWidth(RFillVal->view()->maximumViewportSize().width() + 24);
	setCurrentComboItem(RFillVal, doc->currentStyle.charStyle().fillColor());
	RFillVal->setEnabled(false);
	ReplaceLayout->addWidget( RFillVal, 6, 1 );
	RFillSVal = new ShadeButton(Replace);
	RFillSVal->setEnabled(false);
	ReplaceLayout->addWidget( RFillSVal, 7, 1, Qt::AlignLeft );
	RStrokeVal = new ColorCombo( true, Replace );
	RStrokeVal->setEditable(false);
	RStrokeVal->setPixmapType(ColorCombo::fancyPixmaps);
	RStrokeVal->setColors(doc->PageColors, true);
	RStrokeVal->view()->setMinimumWidth(RStrokeVal->view()->maximumViewportSize().width() + 24);
	setCurrentComboItem(RStrokeVal, doc->currentStyle.charStyle().strokeColor());
	RStrokeVal->setEnabled(false);
	ReplaceLayout->addWidget( RStrokeVal, 8, 1 );
	RStrokeSVal = new ShadeButton(Replace);;
	RStrokeSVal->setEnabled(false);
	ReplaceLayout->addWidget( RStrokeSVal, 9, 1, Qt::AlignLeft );
	SelLayout->addWidget( Replace );
	SearchReplaceLayout->addLayout( SelLayout );

	OptsLayout = new QHBoxLayout;
	OptsLayout->setSpacing( 5 );
	OptsLayout->setMargin( 0 );
	Word = new QCheckBox( tr( "&Whole Word" ), this );
	if (mode)
		Word->setEnabled(false);
	OptsLayout->addWidget( Word );
	CaseIgnore = new QCheckBox( tr( "&Ignore Case, Diacritics and Kashida" ), this );
	if (mode)
		CaseIgnore->setEnabled(false);
	OptsLayout->addWidget( CaseIgnore );
	SearchReplaceLayout->addLayout( OptsLayout );

	ButtonsLayout = new QHBoxLayout;
	ButtonsLayout->setSpacing( 5 );
	ButtonsLayout->setMargin( 0 );
	DoSearch = new QPushButton( tr( "&Search" ), this );
	DoSearch->setDefault( true );
	ButtonsLayout->addWidget( DoSearch );
	DoReplace = new QPushButton( tr( "&Replace" ), this );
	DoReplace->setEnabled(false);
	ButtonsLayout->addWidget( DoReplace );
	AllReplace = new QPushButton( tr( "Replace &All" ), this );
	AllReplace->setEnabled(false);
	ButtonsLayout->addWidget( AllReplace );
	clearButton = new QPushButton( tr("C&lear"), this);
	ButtonsLayout->addWidget(clearButton);
	Leave = new QPushButton( tr( "&Close" ), this );
	ButtonsLayout->addWidget( Leave );
	SearchReplaceLayout->addLayout( ButtonsLayout );

	resize(minimumSizeHint());

 // signals and slots connections
	connect( Leave, SIGNAL( clicked() ), this, SLOT( writePrefs() ) );
	connect( DoSearch, SIGNAL( clicked() ), this, SLOT( slotSearch() ) );
	connect( DoReplace, SIGNAL( clicked() ), this, SLOT( slotReplace() ) );
	connect( AllReplace, SIGNAL( clicked() ), this, SLOT( slotReplaceAll() ) );
	connect( STextVal, SIGNAL( textChanged(QString) ), this, SLOT( updateSearchButtonState() ) );
	connect( SText, SIGNAL( clicked() ), this, SLOT( enableTxSearch() ) );
	connect( SStyle, SIGNAL( clicked() ), this, SLOT( enableStyleSearch() ) );
	connect( SAlign, SIGNAL( clicked() ), this, SLOT( enableAlignSearch() ) );
	connect( SFont, SIGNAL( clicked() ), this, SLOT( enableFontSearch() ) );
	connect( SSize, SIGNAL( clicked() ), this, SLOT( enableSizeSearch() ) );
	connect( SEffect, SIGNAL( clicked() ), this, SLOT( enableEffSearch() ) );
	connect( SFill, SIGNAL( clicked() ), this, SLOT( enableFillSearch() ) );
	connect( SFillS, SIGNAL( clicked() ), this, SLOT( enableFillSSearch() ) );
	connect( SStrokeS, SIGNAL( clicked() ), this, SLOT( enableStrokeSSearch() ) );
	connect( SStroke, SIGNAL( clicked() ), this, SLOT( enableStrokeSearch() ) );
	connect( RText, SIGNAL( clicked() ), this, SLOT( enableTxReplace() ) );
	connect( RStyle, SIGNAL( clicked() ), this, SLOT( enableStyleReplace() ) );
	connect( RAlign, SIGNAL( clicked() ), this, SLOT( enableAlignReplace() ) );
	connect( RFont, SIGNAL( clicked() ), this, SLOT( enableFontReplace() ) );
	connect( RSize, SIGNAL( clicked() ), this, SLOT( enableSizeReplace() ) );
	connect( REffect, SIGNAL( clicked() ), this, SLOT( enableEffReplace() ) );
	connect( RFill, SIGNAL( clicked() ), this, SLOT( enableFillReplace() ) );
	connect( RStroke, SIGNAL( clicked() ), this, SLOT( enableStrokeReplace() ) );
	connect( RFillS, SIGNAL( clicked() ), this, SLOT( enableFillSReplace() ) );
	connect( RStrokeS, SIGNAL( clicked() ), this, SLOT( enableStrokeSReplace() ) );
	connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));

	//tooltips
	DoSearch->setToolTip( tr( "Search for text or formatting in the current text" ) );
	DoReplace->setToolTip( tr( "Replace the searched for formatting with the replacement values" ) );
	AllReplace->setToolTip( tr( "Replace all found instances" ) );
	clearButton->setToolTip( tr( "Clear all search and replace options" ) );
	Leave->setToolTip( tr( "Close search and replace" ) );

 // tab order
	setTabOrder( SText, SStyle );
	setTabOrder( SStyle, SFont );
	setTabOrder( SFont, SSize );
	setTabOrder( SSize, SEffect );
	setTabOrder( SEffect, SFill );
	setTabOrder( SFill, SStroke );
	setTabOrder( SStroke, STextVal );
	setTabOrder( STextVal, SStyleVal );
	setTabOrder( SStyleVal, SAlignVal );
	setTabOrder( SAlignVal, SFontVal );
	setTabOrder( SFontVal, SSizeVal );
	setTabOrder( SSizeVal, SEffVal );
	setTabOrder( SEffVal, SFillVal );
	setTabOrder( SFillVal, SStrokeVal );
	setTabOrder( SStrokeVal, RText );
	setTabOrder( RText, RStyle );
	setTabOrder( RStyle, RFont );
	setTabOrder( RFont, RSize );
	setTabOrder( RSize, REffect );
	setTabOrder( REffect, RFill );
	setTabOrder( RFill, RStroke );
	setTabOrder( RStroke, RTextVal );
	setTabOrder( RTextVal, RStyleVal );
	setTabOrder( RStyleVal, RAlignVal );
	setTabOrder( RAlignVal, RFontVal );
	setTabOrder( RFontVal, RSizeVal );
	setTabOrder( RSizeVal, REffVal );
	setTabOrder( REffVal, RFillVal );
	setTabOrder( RFillVal, RStrokeVal );
	setTabOrder( RStrokeVal, Word );
	setTabOrder( Word, CaseIgnore );
	setTabOrder( CaseIgnore, DoSearch );
	setTabOrder( DoSearch, DoReplace );
	setTabOrder( DoReplace, AllReplace );
	setTabOrder( AllReplace, Leave );

	m_prefs = PrefsManager::instance()->prefsFile->getContext("SearchReplace");
	readPrefs();
}
Ejemplo n.º 9
0
EditGpi::EditGpi(int gpi,int *oncart,QString *ondesc,
		 int *offcart,QString *offdesc,QWidget *parent)
  : QDialog(parent)
{
  setModal(true);

  edit_gpi=gpi;
  edit_oncart=oncart;
  edit_offcart=offcart;
  edit_ondescription=ondesc;
  edit_offdescription=offdesc;
  setWindowTitle("RDAdmin - "+tr("Edit GPI")+QString().sprintf(" %d",gpi));

  //
  // Fix the Window Size
  //
  setMinimumWidth(sizeHint().width());
  setMaximumWidth(sizeHint().width());
  setMinimumHeight(sizeHint().height());
  setMaximumHeight(sizeHint().height());

  //
  // Create Fonts
  //
  QFont label_font=QFont("Helvetica",14,QFont::Bold);
  label_font.setPixelSize(14);
  QFont bold_font=QFont("Helvetica",12,QFont::Bold);
  bold_font.setPixelSize(12);
  QFont font=QFont("Helvetica",12,QFont::Normal);
  font.setPixelSize(12);

  //
  // Text Validator
  //
  RDTextValidator *validator=new RDTextValidator(this);

  //
  // On Section Label
  //
  QLabel *label=new QLabel("ON Transition",this);
  label->setGeometry(30,10,120,20);
  label->setFont(label_font);
  label->setAlignment(Qt::AlignCenter);

  //
  // On Cart Macro Cart
  //
  edit_onmacro_edit=new QLineEdit(this);
  edit_onmacro_edit->setGeometry(120,30,60,20);
  edit_onmacro_edit->setFont(font);
  edit_onmacro_edit->setValidator(validator);
  label=new QLabel(tr("Cart Number: "),this);
  label->setGeometry(15,30,100,20);
  label->setFont(bold_font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // On Select Button
  //
  QPushButton *button=new QPushButton(this);
  button->setGeometry(190,30,60,20);
  button->setFont(font);
  button->setText(tr("&Select"));
  connect(button,SIGNAL(clicked()),this,SLOT(selectOnData()));

  //
  // On Clear Button
  //
  button=new QPushButton(this);
  button->setGeometry(270,30,60,20);
  button->setFont(font);
  button->setText(tr("C&lear"));
  connect(button,SIGNAL(clicked()),this,SLOT(clearOnData()));

  //
  // On Cart Description
  //
  edit_ondescription_edit=new QLineEdit(this);
  edit_ondescription_edit->setGeometry(120,52,sizeHint().width()-140,20);
  edit_ondescription_edit->setFont(font);
  edit_ondescription_edit->setReadOnly(true);
  label=new QLabel(tr("Description: "),this);
  label->setGeometry(15,52,100,20);
  label->setFont(bold_font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // Off Section Label
  //
  label=new QLabel("OFF Transition",this);
  label->setGeometry(30,90,120,20);
  label->setFont(label_font);
  label->setAlignment(Qt::AlignCenter);

  //
  // Off Cart Macro Cart
  //
  edit_offmacro_edit=new QLineEdit(this);
  edit_offmacro_edit->setGeometry(120,110,60,20);
  edit_offmacro_edit->setFont(font);
  edit_offmacro_edit->setValidator(validator);
  label=new QLabel(tr("Cart Number: "),this);
  label->setGeometry(15,110,100,20);
  label->setFont(bold_font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  // Off Select Button
  //
  button=new QPushButton(this);
  button->setGeometry(190,110,60,20);
  button->setFont(font);
  button->setText(tr("&Select"));
  connect(button,SIGNAL(clicked()),this,SLOT(selectOffData()));

  //
  // Off Clear Button
  //
  button=new QPushButton(this);
  button->setGeometry(270,110,60,20);
  button->setFont(font);
  button->setText(tr("C&lear"));
  connect(button,SIGNAL(clicked()),this,SLOT(clearOffData()));

  //
  // Off Cart Description
  //
  edit_offdescription_edit=new QLineEdit(this);
  edit_offdescription_edit->setGeometry(120,132,sizeHint().width()-140,20);
  edit_offdescription_edit->setFont(font);
  edit_offdescription_edit->setReadOnly(true);
  label=new QLabel(tr("Description: "),this);
  label->setGeometry(15,132,100,20);
  label->setFont(bold_font);
  label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  //
  //  Ok Button
  //
  button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
  button->setDefault(true);
  button->setFont(bold_font);
  button->setText(tr("&OK"));
  connect(button,SIGNAL(clicked()),this,SLOT(okData()));

  //
  //  Cancel Button
  //
  button=new QPushButton(this);
  button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
			     80,50);
  button->setFont(bold_font);
  button->setText(tr("&Cancel"));
  connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));

  //
  // Load Data
  //
  if(*edit_oncart>0) {
    RDCart *rdcart=new RDCart(*oncart);
    edit_onmacro_edit->setText(QString().sprintf("%06d",*oncart));
    edit_ondescription_edit->setText(rdcart->title());
    delete rdcart;
  }
  if(*edit_offcart>0) {
    RDCart *rdcart=new RDCart(*offcart);
    edit_offmacro_edit->setText(QString().sprintf("%06d",*offcart));
    edit_offdescription_edit->setText(rdcart->title());
    delete rdcart;
  }
}
Ejemplo n.º 10
0
HatPrompt::HatPrompt(int currentIndex, QWidget* parent) : QDialog(parent)
{
    setModal(true);
    setWindowFlags(Qt::Sheet);
    setWindowModality(Qt::WindowModal);
    setMinimumSize(550, 430);
    resize(550, 430);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    setStyleSheet("QPushButton { padding: 5px; margin-top: 10px; }");

    // Hat model, and a model for setting a filter
    HatModel * hatModel = DataManager::instance().hatModel();
    filterModel = new QSortFilterProxyModel();
    filterModel->setSourceModel(hatModel);
    filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);

    // Grid
    QGridLayout * dialogLayout = new QGridLayout(this);
    dialogLayout->setSpacing(0);
    dialogLayout->setColumnStretch(1, 1);

    QHBoxLayout * topLayout = new QHBoxLayout();

    // Help/prompt message at top
    QLabel * lblDesc = new QLabel(tr("Search for a hat:"));
    lblDesc->setObjectName("lblDesc");
    lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}");
    lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    lblDesc->setFixedHeight(24);
    lblDesc->setMinimumWidth(0);

    // Filter text box
    QWidget * filterContainer = new QWidget();
    filterContainer->setFixedHeight(24);
    filterContainer->setObjectName("filterContainer");
    filterContainer->setStyleSheet("#filterContainer { background: #F6CB1C; border-top-right-radius: 10px; padding: 3px; }");
    filterContainer->setFixedWidth(150);
    txtFilter = new LineEditCursor(filterContainer);
    txtFilter->setFixedWidth(150);
    txtFilter->setFocus();
    txtFilter->setFixedHeight(22);
    txtFilter->setStyleSheet("LineEditCursor { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: 4px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }");
    connect(txtFilter, SIGNAL(textChanged(const QString &)), this, SLOT(filterChanged(const QString &)));
    connect(txtFilter, SIGNAL(moveUp()), this, SLOT(moveUp()));
    connect(txtFilter, SIGNAL(moveDown()), this, SLOT(moveDown()));
    connect(txtFilter, SIGNAL(moveLeft()), this, SLOT(moveLeft()));
    connect(txtFilter, SIGNAL(moveRight()), this, SLOT(moveRight()));

    // Corner widget
    QLabel * corner = new QLabel();
    corner->setPixmap(QPixmap(QString::fromUtf8(":/res/inverse-corner-bl.png")));
    corner->setFixedSize(10, 10);

    // Add widgets to top layout
    topLayout->addWidget(lblDesc);
    topLayout->addWidget(filterContainer);
    topLayout->addWidget(corner, 0, Qt::AlignBottom);
    topLayout->addStretch(1);

    // Cancel button (closes dialog)
    QPushButton * btnCancel = new QPushButton(tr("Cancel"));
    connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));

    // Select button
    QPushButton * btnSelect = new QPushButton(tr("Use selected hat"));
    btnSelect->setDefault(true);
    connect(btnSelect, SIGNAL(clicked()), this, SLOT(onAccepted()));

    // Add hats
    list = new HatListView();
    list->setModel(filterModel);
    list->setViewMode(QListView::IconMode);
    list->setResizeMode(QListView::Adjust);
    list->setMovement(QListView::Static);
    list->setEditTriggers(QAbstractItemView::NoEditTriggers);
    list->setSpacing(8);
    list->setWordWrap(true);
    list->setSelectionMode(QAbstractItemView::SingleSelection);
    list->setObjectName("hatList");
    list->setCurrentIndex(filterModel->index(currentIndex, 0));
    connect(list, SIGNAL(activated(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &)));
    connect(list, SIGNAL(clicked(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &)));

    // Add elements to layouts
    dialogLayout->addLayout(topLayout, 0, 0, 1, 3);
    dialogLayout->addWidget(list, 1, 0, 1, 3);
    dialogLayout->addWidget(btnCancel, 2, 0, 1, 1, Qt::AlignLeft);
    dialogLayout->addWidget(btnSelect, 2, 2, 1, 1, Qt::AlignRight);
}
purchaseOrderList::purchaseOrderList(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) :
  QDialog(parent, fl)
{
  setObjectName(name ? name : "purchaseOrderList");
  setModal(modal);

  _poheadid = -1;
  _type = (cPOUnposted | cPOOpen | cPOClosed);

  setWindowTitle(tr("Purchase Orders"));

  QHBoxLayout *purchaseOrderListLayout = new QHBoxLayout(this);
  QVBoxLayout *tableLayout  = new QVBoxLayout();
  QVBoxLayout *buttonLayout = new QVBoxLayout();
  purchaseOrderListLayout->addLayout(tableLayout);
  purchaseOrderListLayout->addLayout(buttonLayout);

  QHBoxLayout *vendLayout = new QHBoxLayout();
  _vend = new VendorCluster(this, "_vend");
  vendLayout->addWidget(_vend);
  vendLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
				      QSizePolicy::Minimum));
  tableLayout->addLayout(vendLayout);

  QLabel *_poheadLit = new QLabel(tr("&Purchase Orders:"), this);
  _poheadLit->setObjectName("_poheadLit");
  tableLayout->addWidget( _poheadLit );

  _pohead = new XTreeWidget(this);
  _pohead->setObjectName("_pohead");
  _poheadLit->setBuddy(_pohead);
  tableLayout->addWidget(_pohead);

  _close = new QPushButton(tr("&Cancel"), this);
  _close->setObjectName("_close");
  buttonLayout->addWidget( _close );

  _select = new QPushButton(tr("&Select"), this);
  _select->setObjectName("_select");
  _select->setEnabled( false );
  _select->setDefault( true );
  buttonLayout->addWidget( _select );

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

  resize( QSize(550, 350).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

    // signals and slots connections
  connect(_close,  SIGNAL(clicked()),		this,	SLOT(sClose()	     ));
  connect(_pohead, SIGNAL(itemSelected(int)), _select,	SLOT(animateClick()  ));
  connect(_pohead, SIGNAL(valid(bool)),       _select,	SLOT(setEnabled(bool)));
  connect(_select, SIGNAL(clicked()),		this,	SLOT(sSelect()	     ));
  connect(_vend,   SIGNAL(newId(int)),		this,	SLOT(sFillList()     ));

  _type = 0;

  _pohead->addColumn(tr("Number"),   _orderColumn, Qt::AlignRight, true, "pohead_number");
  _pohead->addColumn(tr("Vendor"),             -1, Qt::AlignLeft,  true, "vend_name");
  _pohead->addColumn(tr("Agent"),     _itemColumn, Qt::AlignCenter,true, "pohead_agent_username");
  _pohead->addColumn(tr("Order Date"),_dateColumn, Qt::AlignLeft,  true, "pohead_orderdate");
  _pohead->addColumn(tr("First Item"),_itemColumn, Qt::AlignLeft,  true, "item_number");

  _pohead->setFocus();
}
RocketStorageSceneImporter::RocketStorageSceneImporter(QWidget *parent, RocketPlugin *plugin, const QString &destinationPrefix,
                                                       const SceneDesc &sceneDesc_, const ImportEntityItemList &entities_, 
                                                       const ImportAssetItemList &assets_) :
    QDialog(parent, Qt::SplashScreen),
    plugin_(plugin),
    destinationPrefix_(destinationPrefix),
    menu_(0),
    sceneDesc(sceneDesc_),
    entities(entities_),
    assets(assets_)
{
    setAttribute(Qt::WA_DeleteOnClose, true);
    setWindowModality(Qt::ApplicationModal);
    setModal(true);
    
    ui.setupUi(this);
    hide();

#ifdef Q_WS_WIN
    // @bug Scrolling is broken on Mac if you have custom stylesheet to QTableWidgets;
    QString style("QTableView { border: 1px solid grey; font: 10px \"Arial\"; }");
    ui.assets->setStyleSheet(style);
    ui.entities->setStyleSheet(style);
#endif

    ui.assets->setSortingEnabled(false);
    ui.entities->setSortingEnabled(false);
    ui.assets->setVisible(false);
    ui.entities->setVisible(false);

    // Rewrite all asset refs to be relative "file.extension" from "local://file.extension" etc.
    QMutableListIterator<EntityDesc> edIt(sceneDesc.entities);
    while(edIt.hasNext())
    {
        QMutableListIterator<ComponentDesc> cdIt(edIt.next().components);
        while(cdIt.hasNext())
        {
            QMutableListIterator<AttributeDesc> adIt(cdIt.next().attributes);
            while(adIt.hasNext())
            {
                adIt.next();
                if ((adIt.value().typeName.compare(cAttributeAssetReferenceTypeName, Qt::CaseInsensitive) == 0) ||
                    (adIt.value().typeName.compare(cAttributeAssetReferenceListTypeName, Qt::CaseInsensitive) == 0))
                {
                    QString trimmed = adIt.value().value.trimmed();
                    if (trimmed.isEmpty() || trimmed == "RexSkyBox")
                        continue;

                    QStringList newValues;
                    QStringList valueParts = adIt.value().value.split(";", QString::KeepEmptyParts);
                    for(int i=0; i<valueParts.size(); ++i)
                    {
                        QString &value = valueParts[i];
                        if (value.trimmed().isEmpty())
                            newValues << "";
                        else
                        {
                            // Leave http refs alone
                            if (!value.startsWith("http://") && !value.startsWith("https://"))
                            {
                                QString filename, subasset;
                                AssetAPI::ParseAssetRef(value, 0, 0, 0, 0, 0, 0, &filename, &subasset);
                                newValues << destinationPrefix_ + filename + (!subasset.isEmpty() ? "#" + subasset : "");
                            }
                            else
                            {
                                LogDebug("Found web ref, leaving alone: " + value);
                                newValues << value;
                            }
                           
                        }
                    }

                    if (!newValues.isEmpty())
                    {
                        QString newValue = newValues.join(";");
                        if (adIt.value().value != newValue)
                        {
                            foreach(const RocketStorageImportAssetItem &item, assets)
                            {
                                if (newValue == item.pathRelative)
                                {
                                    newValue = item.desc.destinationName;
                                    break;
                                }
                            }

                            //LogInfo("[RocketSceneImporter]: Rewriting asset reference from " + adIt.value().value + " to " + newValue);
                            adIt.value().value = newValue;
                        }
                    }
                }
            }
Ejemplo n.º 13
0
CustomFDialog::CustomFDialog(QWidget *parent, QString wDir, QString caption, QString filter, int flags)
			: QDialog(parent), optionFlags(flags)
{
	setModal(true);
	setWindowTitle(caption);
	setWindowIcon(QIcon(loadIcon("AppIcon.png")));
	vboxLayout = new QVBoxLayout(this);
	vboxLayout->setSpacing(5);
	vboxLayout->setMargin(10);
    hboxLayout = new QHBoxLayout;
	hboxLayout->setSpacing(5);
	hboxLayout->setMargin(0);
	fileDialog = new ScFileWidget(this);
	hboxLayout->addWidget(fileDialog);
	fileDialog->setIconProvider(new ImIconProvider());
	fileDialog->setFilter(filter);
	fileDialog->selectFilter(filter);
	fileDialog->setDirectory(wDir);
	vboxLayout1 = new QVBoxLayout;
	vboxLayout1->setSpacing(0);
	vboxLayout1->setMargin(0);
	vboxLayout1->setContentsMargins(0, 37, 0, 0);
	vboxLayout1->setAlignment( Qt::AlignTop );
	pw = new FDialogPreview( this );
	pw->setMinimumSize(QSize(200, 200));
	pw->setMaximumSize(QSize(200, 200));
	vboxLayout1->addWidget(pw);
	hboxLayout->addLayout(vboxLayout1);
	vboxLayout->addLayout(hboxLayout);
    QHBoxLayout *hboxLayout1 = new QHBoxLayout;
	hboxLayout1->setSpacing(5);
	hboxLayout1->setContentsMargins(9, 0, 0, 0);
	showPreview = new QCheckBox(this);
	showPreview->setText( tr("Show Preview"));
	showPreview->setToolTip( tr("Show a preview and information for the selected file"));
	showPreview->setChecked(true);
	previewIsShown = true;
	hboxLayout1->addWidget(showPreview);
	QSpacerItem *spacerItem = new QSpacerItem(2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum);
	hboxLayout1->addItem(spacerItem);
	OKButton = new QPushButton( CommonStrings::tr_OK, this);
	OKButton->setDefault( true );
	hboxLayout1->addWidget( OKButton );
	CancelB = new QPushButton( CommonStrings::tr_Cancel, this);
	CancelB->setAutoDefault( false );
	hboxLayout1->addWidget( CancelB );
	vboxLayout->addLayout(hboxLayout1);
	SaveZip=NULL;
	WithFonts=NULL;
	WithProfiles=NULL;
	if (flags & fdDirectoriesOnly)
	{
		Layout = new QFrame(this);
		Layout1 = new QHBoxLayout(Layout);
		Layout1->setSpacing( 0 );
		Layout1->setContentsMargins(9, 0, 0, 0);
		SaveZip = new QCheckBox( tr( "&Compress File" ), Layout);
		Layout1->addWidget(SaveZip, Qt::AlignLeft);
		QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
		Layout1->addItem( spacer );
		vboxLayout->addWidget(Layout);
		LayoutC = new QFrame(this);
		Layout1C = new QHBoxLayout(LayoutC);
		Layout1C->setSpacing( 0 );
		Layout1C->setContentsMargins(9, 0, 0, 0);
		WithFonts = new QCheckBox( tr( "&Include Fonts" ), LayoutC);
		Layout1C->addWidget(WithFonts, Qt::AlignLeft);
		WithProfiles = new QCheckBox( tr( "&Include Color Profiles" ), LayoutC);
		Layout1C->addWidget(WithProfiles, Qt::AlignLeft);
		QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
		Layout1C->addItem( spacer2 );
		vboxLayout->addWidget(LayoutC);
		fileDialog->setFileMode(QFileDialog::DirectoryOnly);
		pw->hide();
		showPreview->setVisible(false);
		showPreview->setChecked(false);
		previewIsShown = false;
	}
	else
	{
		if (flags & fdCompressFile)
		{
			Layout = new QFrame(this);
			Layout1 = new QHBoxLayout(Layout);
			Layout1->setSpacing( 5 );
			Layout1->setContentsMargins(9, 0, 0, 0);
			SaveZip = new QCheckBox( tr( "&Compress File" ), Layout);
			Layout1->addWidget(SaveZip);
			QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
			Layout1->addItem( spacer );
		}
		if (flags & fdExistingFiles)
			fileDialog->setFileMode(QFileDialog::ExistingFile);
		else
		{
			fileDialog->setFileMode(QFileDialog::AnyFile);
			if (flags & fdCompressFile)
				vboxLayout->addWidget(Layout);
		}
		
		if (SaveZip!=NULL)
			SaveZip->setToolTip( "<qt>" + tr( "Compress the Scribus document on save" ) + "</qt>");
		if (WithFonts!=NULL)
			WithFonts->setToolTip( "<qt>" + tr( "Include fonts when collecting files for the document. Be sure to know and understand licensing information for any fonts you collect and possibly redistribute." ) + "</qt>");
		if (WithProfiles!=NULL)
			WithProfiles->setToolTip( "<qt>" + tr( "Include color profiles when collecting files for the document" ) + "</qt>");
		
		if (flags & fdShowCodecs)
		{
			LayoutC = new QFrame(this);
			Layout1C = new QHBoxLayout(LayoutC);
			Layout1C->setSpacing( 0 );
			Layout1C->setContentsMargins(9, 0, 0, 0);
			TxCodeT = new QLabel(this);
			TxCodeT->setText( tr("Encoding:"));
			Layout1C->addWidget(TxCodeT);
			TxCodeM = new ScComboBox(LayoutC);
			TxCodeM->setEditable(false);
			QString tmp_txc[] = {"ISO 8859-1", "ISO 8859-2", "ISO 8859-3",
								"ISO 8859-4", "ISO 8859-5", "ISO 8859-6",
								"ISO 8859-7", "ISO 8859-8", "ISO 8859-9",
								"ISO 8859-10", "ISO 8859-13", "ISO 8859-14",
								"ISO 8859-15", "UTF-8", "UTF-16", "KOI8-R", "KOI8-U",
								"CP1250", "CP1251", "CP1252", "CP1253",
								"CP1254", "CP1255", "CP1256", "CP1257",
								"Apple Roman"};
			size_t array = sizeof(tmp_txc) / sizeof(*tmp_txc);
			for (uint a = 0; a < array; ++a)
				TxCodeM->addItem(tmp_txc[a]);
			QString localEn = QTextCodec::codecForLocale()->name();
			if (localEn == "ISO-10646-UCS-2")
				localEn = "UTF-16";
			bool hasIt = false;
			for (int cc = 0; cc < TxCodeM->count(); ++cc)
			{
				if (TxCodeM->itemText(cc) == localEn)
				{
					TxCodeM->setCurrentIndex(cc);
					hasIt = true;
					break;
				}
			}
			if (!hasIt)
			{
				TxCodeM->addItem(localEn);
				TxCodeM->setCurrentIndex(TxCodeM->count()-1);
			}
			TxCodeM->setMinimumSize(QSize(200, 0));
			Layout1C->addWidget(TxCodeM);
			QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
			Layout1C->addItem( spacer2 );
			vboxLayout->addWidget(LayoutC);
		}
		bool setter2 = flags & fdHidePreviewCheckBox;
		if (!setter2)
		{
			bool setter = flags & fdShowPreview;
			showPreview->setChecked(setter);
			previewIsShown = setter;
			pw->setVisible(setter);
		}
		else
		{
			showPreview->hide();
			previewIsShown = false;
			pw->setVisible(false);
		}
		if (flags & fdCompressFile)
			connect(SaveZip, SIGNAL(clicked()), this, SLOT(handleCompress()));
	}
#if QT_VERSION >= 0x040600
	fileDialog->setNameFilterDetailsVisible(false);
#else
	fileDialog->setOption(QFileDialog::HideNameFilterDetails);
#endif
	extZip = "gz";
	connect(OKButton, SIGNAL(clicked()), this, SLOT(accept()));
	connect(CancelB, SIGNAL(clicked()), this, SLOT(reject()));
	connect(showPreview, SIGNAL(clicked()), this, SLOT(togglePreview()));
	connect(fileDialog, SIGNAL(currentChanged(const QString &)), this, SLOT(fileClicked(const QString &)));
	connect(fileDialog, SIGNAL(filesSelected(const QStringList &)), this, SLOT(accept()));
	connect(fileDialog, SIGNAL(accepted()), this, SLOT(accept()));
	connect(fileDialog, SIGNAL(rejected()), this, SLOT(reject()));
	resize(minimumSizeHint());
}
Ejemplo n.º 14
0
SelectFields::SelectFields(QWidget* parent, QString Felder, QString Own, ScribusDoc *Doc, int Art) : QDialog(parent)
{
	setModal(true);
	setWindowTitle( tr( "Select Fields" ) );
	setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
	FTyp = Art;
	SelectFieldsLayout = new QVBoxLayout( this );
	SelectFieldsLayout->setMargin(10);
	SelectFieldsLayout->setSpacing(5);
	Layout5 = new QHBoxLayout;
	Layout5->setMargin(0);
	Layout5->setSpacing(5);
	Layout1 = new QVBoxLayout;
	Layout1->setMargin(0);
	Layout1->setSpacing(5);

	Text1 = new QLabel( tr( "Available Fields" ), this );
	Layout1->addWidget( Text1 );
	AvailFields = new QListWidget( this );
	AvailFields->setMinimumSize( QSize( 130, 180 ) );
	for (int se = 0; se < Doc->Items->count(); ++se)
	{
		PageItem* item = Doc->Items->at(se);
		if (Art < 2)
		{
			if ((item->isAnnotation()) && ((item->annotation().Type() > 1) && (item->annotation().Type() < 12)))
				AvailFields->addItem(item->itemName());
		}
		else
		{
			if ((item->isAnnotation()) && (item->annotation().Type() == Art) && (item->itemName() != Own))
				AvailFields->addItem(item->itemName());
		}
	}
	Layout1->addWidget( AvailFields );
	Layout5->addLayout( Layout1 );

	if (Art > 1)
	{
		Layout2 = new QVBoxLayout;
		Layout2->setMargin(0);
		Layout2->setSpacing(5);
		QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
		Layout2->addItem( spacer );
		ToSel = new QPushButton( tr( "&>>" ), this );
		Layout2->addWidget( ToSel );
		FromSel = new QPushButton( tr( "&<<" ), this );
		Layout2->addWidget( FromSel );
		QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
		Layout2->addItem( spacer_2 );
		Layout5->addLayout( Layout2 );
		Layout3 = new QVBoxLayout;
		Layout3->setMargin(0);
		Layout3->setSpacing(5);
		Text2 = new QLabel( tr( "Selected Fields" ), this );
		Layout3->addWidget( Text2 );
		SelFields = new QListWidget( this );
		SelFields->setMinimumSize( QSize( 130, 180 ) );
		QStringList pfol;
		pfol = Felder.split(",", QString::SkipEmptyParts);
		if (pfol.count() > 0)
		{
			for (int cfx = 0; cfx < pfol.count(); ++cfx)
				SelFields->addItem(pfol[cfx].simplified());
		}
		FromSel->setEnabled(false);
		ToSel->setEnabled(false);
		Layout3->addWidget( SelFields );
		Layout5->addLayout( Layout3 );
		connect(SelFields, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelEField(QListWidgetItem*)));
		connect(ToSel, SIGNAL(clicked()), this, SLOT(PutToSel()));
		connect(FromSel, SIGNAL(clicked()), this, SLOT(RemoveSel()));
	}
Ejemplo n.º 15
0
histogramUI::histogramUI(QDialog *parent) : QDialog(parent)
{
    setupUi(parent);
    setModal(false);

}
Ejemplo n.º 16
0
AboutDlg::AboutDlg(QWidget* parent)
	: QDialog(parent)
{
	setAttribute(Qt::WA_DeleteOnClose);
	ui_.setupUi(this);

	setModal(false);

	ui_.lb_name->setText ( QString("<h3><b>%1 v%2</b></h3>").arg(ApplicationInfo::name()).arg(ApplicationInfo::version()) );

	ui_.te_license->setText ( loadText(":/COPYING") );

	QString lang_name = qApp->translate( "@default", "language_name" );
	if ( lang_name == "language_name" ) // remove the translation tab, if no translation is used
		ui_.tw_tabs->removePage ( ui_.tw_tabs->page(3) );

	// fill in Authors tab...
	QString authors;
	authors += details(QString::fromUtf8("Justin Karneges"),
			   "[email protected]", "", "",
			   tr("Founder and Original Author"));
	authors += details(QString::fromUtf8("Kevin Smith"),
			   "[email protected]", "", "",
			   tr("Project Lead/Maintainer"));
	authors += details(QString::fromUtf8("Remko Tronçon"),
			   "[email protected]", "", "",
			   tr("Lead Developer"));
	authors += details(QString::fromUtf8("Michail Pishchagin"),
			   "[email protected]", "", "",
			   tr("Lead Widget Developer"));
	authors += details(QString::fromUtf8("Maciej Niedzielski"),
			   "[email protected]", "", "",
			   tr("Developer"));
	authors += details(QString::fromUtf8("Martin Hostettler"),
			   "[email protected]", "", "",
			   tr("Developer"));
	authors += details(QString::fromUtf8("Akito Nozaki"),
			   "[email protected]", "", "",
			   tr("Miscellaneous Developer"));
	ui_.te_authors->setText( authors );

	// fill in Thanks To tab...
	QString thanks;
	thanks += details(QString::fromUtf8("Jan Niehusmann"),
			  "[email protected]", "", "",
			  tr("Build setup, miscellaneous assistance"));
	thanks += details(QString::fromUtf8("Everaldo Coelho"),
			  "", "", "http://www.everaldo.com",
			  tr("Many icons are from his Crystal icon theme"));
	thanks += details(QString::fromUtf8("Jason Kim"),
			  "", "", "",
			  tr("Graphics"));
	thanks += details(QString::fromUtf8("Hideaki Omuro"),
			  "", "", "",
			  tr("Graphics"));
	thanks += details(QString::fromUtf8("Bill Myers"),
			  "", "", "",
			  tr("Original Mac Port"));
	thanks += details(QString::fromUtf8("Eric Smith (Tarkvara Design, Inc.)"),
			 "[email protected]", "", "",
			 tr("Mac OS X Port"));
	thanks += details(QString::fromUtf8("Tony Collins"),
	 		 "", "", "",
	 		 tr("Original End User Documentation"));
	thanks += details(QString::fromUtf8("Hal Rottenberg"),
			  "", "", "",
			 tr("Webmaster, Marketing"));
	thanks += details(QString::fromUtf8("Mircea Bardac"),
			 "", "", "",
			 tr("Bug Tracker Management"));
	thanks += details(QString::fromUtf8("Jacek Tomasiak"),
			 "", "", "",
			 tr("Patches"));
					  
	//thanks += tr("Thanks to many others.\n"
	//	     "The above list only reflects the contributors I managed to keep track of.\n"
	//	     "If you're not included but you think that you must be in the list, contact the developers.");
	ui_.te_thanks->setText( thanks );

	QString translation = tr(
		"I. M. Anonymous <note text=\"replace with your real name\"><br>\n"
		"&nbsp;&nbsp;<a href=\"http://me.com\">http://me.com</a><br>\n"
		"&nbsp;&nbsp;Jabber: <a href=\"xmpp:[email protected]\">[email protected]</a><br>\n"
		"&nbsp;&nbsp;<a href=\"mailto:[email protected]\">[email protected]</a><br>\n"
		"&nbsp;&nbsp;Translator<br>\n"
		"<br>\n"
		"Join the translation team today! Go to \n"
		"<a href=\"http://forum.psi-im.org/forum/14\">\n"
		"http://forum.psi-im.org/forum/14</a> for further details!"
	);
	ui_.te_translation->appendText(translation);
}
Ejemplo n.º 17
0
void PlayerCreateOptions::init()
{
    if (_initialized) return;
    State::init();

    setModal(true);
    setFullscreen(false);

    auto background = new Image("art/intrface/opbase.frm");

    auto backgroundX = (Game::getInstance()->renderer()->width() - background->width())*0.5;
    auto backgroundY = (Game::getInstance()->renderer()->height() - background->height())*0.5;

    auto saveButton = new ImageButton(ImageButton::TYPE_OPTIONS_BUTTON, backgroundX+14, backgroundY+18);
    auto loadButton = new ImageButton(ImageButton::TYPE_OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37);
    auto printToFileButton = new ImageButton(ImageButton::TYPE_OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*2);
    auto eraseButton = new ImageButton(ImageButton::TYPE_OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*3);
    auto doneButton = new ImageButton(ImageButton::TYPE_OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*4);

    saveButton->addEventHandler("mouseleftclick",    [this](Event* event){ this->onSaveButtonClick(dynamic_cast<MouseEvent*>(event)); });
    loadButton->addEventHandler("mouseleftclick",    [this](Event* event){ this->onLoadButtonClick(dynamic_cast<MouseEvent*>(event)); });
    printToFileButton->addEventHandler("mouseleftclick", [this](Event* event){ this->onPrintToFileButtonClick(dynamic_cast<MouseEvent*>(event)); });
    eraseButton->addEventHandler("mouseleftclick",       [this](Event* event){ this->onEraseButtonClick(dynamic_cast<MouseEvent*>(event)); });
    doneButton->addEventHandler("mouseleftclick",        [this](Event* event){ this->onDoneButtonClick(dynamic_cast<MouseEvent*>(event)); });

    auto font = ResourceManager::font("font3.aaf", 0xb89c28ff);

    // label: save
    auto saveButtonLabel = new TextArea(_t(MSG_EDITOR, 600), backgroundX+8, backgroundY+26);
    saveButtonLabel->setFont(font)->setWidth(150)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER);

    // label: load
    auto loadButtonLabel = new TextArea(_t(MSG_EDITOR, 601), backgroundX+8, backgroundY+26+37);
    loadButtonLabel->setFont(font)->setWidth(150)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER);

    // label: print to file
    auto printToFileButtonLabel = new TextArea(_t(MSG_EDITOR, 602), backgroundX+8, backgroundY+26+37*2);
    printToFileButtonLabel->setFont(font)->setWidth(150)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER);

    // label: erase
    auto eraseButtonLabel = new TextArea(_t(MSG_EDITOR, 603), backgroundX+8, backgroundY+26+37*3);
    eraseButtonLabel->setFont(font)->setWidth(150)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER);

    // label: done
    auto doneButtonLabel = new TextArea(_t(MSG_EDITOR, 604), backgroundX+8, backgroundY+26+37*4);
    doneButtonLabel->setFont(font)->setWidth(150)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER);

    background->setX(backgroundX);
    background->setY(backgroundY);

    addUI(background);

    addUI(saveButton);
    addUI(loadButton);
    addUI(printToFileButton);
    addUI(eraseButton);
    addUI(doneButton);

    addUI(saveButtonLabel);
    addUI(loadButtonLabel);
    addUI(printToFileButtonLabel);
    addUI(eraseButtonLabel);
    addUI(doneButtonLabel);
}
Ejemplo n.º 18
0
ExtendedAboutDialog::ExtendedAboutDialog(const KAboutData *aboutData, const OcsData *ocsData, QWidget *parent)
  : KDialog(parent)
  , d(new Private(this))
{
    DEBUG_BLOCK
    if (aboutData == 0)
        aboutData = KGlobal::mainComponent().aboutData();

    d->aboutData = aboutData;

    if (!aboutData) {
        QLabel *errorLabel = new QLabel(i18n("<qt>No information available.<br />"
                                             "The supplied KAboutData object does not exist.</qt>"), this);

        errorLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
        setMainWidget(errorLabel);
        return;
    }
    if( !ocsData )
    {
        QLabel *errorLabel = new QLabel(i18n("<qt>No information available.<br />"
                                             "The supplied OcsData object does not exist.</qt>"), this);

        errorLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
        setMainWidget(errorLabel);
        return;
    }
    m_ocsData = *ocsData;

    setPlainCaption(i18n("About %1", aboutData->programName()));
    setButtons(KDialog::Close);
    setDefaultButton(KDialog::Close);
    setModal(false);


    //Set up the title widget...
    KTitleWidget *titleWidget = new KTitleWidget(this);

    QIcon windowIcon;
    if (!aboutData->programIconName().isEmpty()) {
        windowIcon = KIcon(aboutData->programIconName());
    } else {
        windowIcon = qApp->windowIcon();
    }
    titleWidget->setPixmap(windowIcon.pixmap(64, 64), KTitleWidget::ImageLeft);
    if (aboutData->programLogo().canConvert<QPixmap>())
        titleWidget->setPixmap(aboutData->programLogo().value<QPixmap>(), KTitleWidget::ImageLeft);
    else if (aboutData->programLogo().canConvert<QImage>())
        titleWidget->setPixmap(QPixmap::fromImage(aboutData->programLogo().value<QImage>()), KTitleWidget::ImageLeft);

    titleWidget->setText(i18n("<html><font size=\"5\">%1</font><br /><b>Version %2</b><br />Using KDE %3</html>",
                         aboutData->programName(), aboutData->version(), KDE::versionString()));


    //Now let's add the tab bar...
    QTabWidget *tabWidget = new QTabWidget;
    tabWidget->setUsesScrollButtons(false);


    //Set up the first page...
    QString aboutPageText = aboutData->shortDescription() + '\n';

    if (!aboutData->otherText().isEmpty())
        aboutPageText += '\n' + aboutData->otherText() + '\n';

    if (!aboutData->copyrightStatement().isEmpty())
        aboutPageText += '\n' + aboutData->copyrightStatement() + '\n';

    if (!aboutData->homepage().isEmpty())
        aboutPageText += '\n' + QString("<a href=\"%1\">%1</a>").arg(aboutData->homepage()) + '\n';
    aboutPageText = aboutPageText.trimmed();

    QLabel *aboutLabel = new QLabel;
    aboutLabel->setWordWrap(true);
    aboutLabel->setOpenExternalLinks(true);
    aboutLabel->setText(aboutPageText.replace('\n', "<br />"));
    aboutLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QVBoxLayout *aboutLayout = new QVBoxLayout;
    aboutLayout->addStretch();
    aboutLayout->addWidget(aboutLabel);

    const int licenseCount = aboutData->licenses().count();
    debug()<< "About to show license stuff";
    debug()<< "License count is"<<licenseCount;
    for (int i = 0; i < licenseCount; ++i) {
        const KAboutLicense &license = aboutData->licenses().at(i);

        QLabel *showLicenseLabel = new QLabel;
        showLicenseLabel->setText(QString("<a href=\"%1\">%2</a>").arg(QString::number(i),
                                                                       i18n("License: %1",
                                                                            license.name(KAboutData::FullName))));
        showLicenseLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
        connect(showLicenseLabel, SIGNAL(linkActivated(QString)), this, SLOT(_k_showLicense(QString)));

        aboutLayout->addWidget(showLicenseLabel);
    }
    debug()<<"License widget added";

    aboutLayout->addStretch();

    QWidget *aboutWidget = new QWidget(this);
    aboutWidget->setLayout(aboutLayout);

    tabWidget->addTab(aboutWidget, i18n("&About"));


    //Stuff needed by both Authors and Credits pages:
    QPixmap openDesktopPixmap = QPixmap( KStandardDirs::locate( "data", "amarok/images/opendesktop-22.png" ) );
    QIcon openDesktopIcon = QIcon( openDesktopPixmap );


    //And now, the Authors page:
    const int authorCount = d->aboutData->authors().count();

    if (authorCount)
    {
        m_authorWidget = new QWidget( this );
        QVBoxLayout *authorLayout = new QVBoxLayout( m_authorWidget.data() );

        m_showOcsAuthorButton = new AnimatedBarWidget( openDesktopIcon,
                                     i18n( "Get data from openDesktop.org to learn more about the team" ),
                                     "process-working", m_authorWidget.data() );
        connect( m_showOcsAuthorButton.data(), SIGNAL(clicked()), this, SLOT(switchToOcsWidgets()) );
        authorLayout->addWidget( m_showOcsAuthorButton.data() );

        if (!aboutData->customAuthorTextEnabled() || !aboutData->customAuthorRichText().isEmpty())
        {
            QLabel *bugsLabel = new QLabel( m_authorWidget.data() );
            bugsLabel->setContentsMargins( 4, 2, 0, 4 );
            if (!aboutData->customAuthorTextEnabled())
            {
                if (aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "[email protected]")
                    bugsLabel->setText( i18n("Please use <a href=\"http://bugs.kde.org\">http://bugs.kde.org</a> to report bugs.\n") );
                else
                {
                    if(aboutData->authors().count() == 1 && (aboutData->authors().first().emailAddress() == aboutData->bugAddress()))
                    {
                        bugsLabel->setText( i18n("Please report bugs to <a href=\"mailto:%1\">%2</a>.\n",
                                              aboutData->authors().first().emailAddress(),
                                              aboutData->authors().first().emailAddress()));
                    }
                    else
                    {
                        bugsLabel->setText( i18n("Please report bugs to <a href=\"mailto:%1\">%2</a>.\n",
                                              aboutData->bugAddress(), aboutData->bugAddress()));
                    }
                }
            }
            else
                bugsLabel->setText( aboutData->customAuthorRichText() );
            authorLayout->addWidget( bugsLabel );
        }

        m_authorListWidget = new OcsPersonListWidget( d->aboutData->authors(), m_ocsData.authors(), OcsPersonItem::Author, m_authorWidget.data() );
        connect( m_authorListWidget.data(), SIGNAL(switchedToOcs()), m_showOcsAuthorButton.data(), SLOT(stop()) );
        connect( m_authorListWidget.data(), SIGNAL(switchedToOcs()), m_showOcsAuthorButton.data(), SLOT(fold()) );

        authorLayout->addWidget( m_authorListWidget.data() );
        authorLayout->setMargin( 0 );
        authorLayout->setSpacing( 2 );
        m_authorWidget.data()->setLayout( authorLayout );

        m_authorPageTitle = ( authorCount == 1 ) ? i18n("A&uthor") : i18n("A&uthors");
        tabWidget->addTab(m_authorWidget.data(), m_authorPageTitle);
        m_isOfflineAuthorWidget = true; //is this still used?
    }

    //Then the Credits page:
    const int creditCount = aboutData->credits().count();

    if (creditCount)
    {
        m_creditWidget = new QWidget( this );
        QVBoxLayout *creditLayout = new QVBoxLayout( m_creditWidget.data() );

        m_showOcsCreditButton = new AnimatedBarWidget( openDesktopIcon,
                                     i18n( "Get data from openDesktop.org to learn more about contributors" ),
                                     "process-working", m_creditWidget.data() );
        connect( m_showOcsCreditButton.data(), SIGNAL(clicked()), this, SLOT(switchToOcsWidgets()) );
        creditLayout->addWidget( m_showOcsCreditButton.data() );

        m_creditListWidget = new OcsPersonListWidget( d->aboutData->credits(), m_ocsData.credits(), OcsPersonItem::Contributor, m_creditWidget.data() );
        connect( m_creditListWidget.data(), SIGNAL(switchedToOcs()), m_showOcsCreditButton.data(), SLOT(stop()) );
        connect( m_creditListWidget.data(), SIGNAL(switchedToOcs()), m_showOcsCreditButton.data(), SLOT(fold()) );

        creditLayout->addWidget( m_creditListWidget.data() );
        creditLayout->setMargin( 0 );
        creditLayout->setSpacing( 2 );
        m_creditWidget.data()->setLayout( creditLayout );

        tabWidget->addTab( m_creditWidget.data(), i18n("&Contributors"));
        m_isOfflineCreditWidget = true; //is this still used?
    }

    //Finally, the Donors page:
    const int donorCount = ocsData->donors()->count();

    if (donorCount)
    {
        m_donorWidget = new QWidget( this );
        QVBoxLayout *donorLayout = new QVBoxLayout( m_donorWidget.data() );

        m_showOcsDonorButton = new AnimatedBarWidget( openDesktopIcon,
                                     i18n( "Get data from openDesktop.org to learn more about our generous donors" ),
                                     "process-working", m_donorWidget.data() );
        connect( m_showOcsDonorButton.data(), SIGNAL(clicked()), this, SLOT(switchToOcsWidgets()) );
        donorLayout->addWidget( m_showOcsDonorButton.data() );

        QList< KAboutPerson > donors;
        for( QList< QPair< QString, KAboutPerson > >::const_iterator it = m_ocsData.donors()->constBegin();
             it != m_ocsData.donors()->constEnd(); ++it )
        {
            donors << ( *it ).second;
        }
        m_donorListWidget = new OcsPersonListWidget( donors , m_ocsData.donors(), OcsPersonItem::Contributor, m_donorWidget.data() );
        connect( m_donorListWidget.data(), SIGNAL(switchedToOcs()), m_showOcsDonorButton.data(), SLOT(stop()) );
        connect( m_donorListWidget.data(), SIGNAL(switchedToOcs()), m_showOcsDonorButton.data(), SLOT(fold()) );

        donorLayout->addWidget( m_donorListWidget.data() );
        donorLayout->setMargin( 0 );
        donorLayout->setSpacing( 2 );
        QLabel *roktoberLabel =
            new QLabel(i18n("<p>Each year in October the Amarok team organizes a funding "
                            "drive called <b>Roktober</b>.</p>"
                            "<p>If you want your name mentioned on this list "
                            "<a href=\"http://amarok.kde.org/donations\"> donate "
                            "during Roktober</a> and opt-in.</p>"));
        roktoberLabel->setOpenExternalLinks(true);
        donorLayout->addWidget(roktoberLabel);
        m_donorWidget.data()->setLayout( donorLayout );

        tabWidget->addTab( m_donorWidget.data(), i18n("&Donors"));
        m_isOfflineDonorWidget = true;
    }


    //And the translators:
    QPalette transparentBackgroundPalette;
    transparentBackgroundPalette.setColor( QPalette::Base, Qt::transparent );
    transparentBackgroundPalette.setColor( QPalette::Text, transparentBackgroundPalette.color( QPalette::WindowText ) );


    const QList<KAboutPerson> translatorList = aboutData->translators();

    if(translatorList.count() > 0) {
        QString translatorPageText;

        QList<KAboutPerson>::ConstIterator it;
        for(it = translatorList.begin(); it != translatorList.end(); ++it) {
            translatorPageText += QString("<p style=\"margin: 0px;\">%1</p>").arg((*it).name());
            if (!(*it).emailAddress().isEmpty())
                translatorPageText += QString("<p style=\"margin: 0px; margin-left: 15px;\"><a href=\"mailto:%1\">%1</a></p>").arg((*it).emailAddress());
            translatorPageText += "<p style=\"margin: 0px;\">&nbsp;</p>";
        }

        translatorPageText += KAboutData::aboutTranslationTeam();

        KTextBrowser *translatorTextBrowser = new KTextBrowser;
        translatorTextBrowser->setFrameStyle(QFrame::NoFrame);
        translatorTextBrowser->setPalette(transparentBackgroundPalette);
        translatorTextBrowser->setHtml(translatorPageText);
        tabWidget->addTab(translatorTextBrowser, i18n("T&ranslation"));
    }

    //Jam everything together in a layout:
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(titleWidget);
    mainLayout->addWidget(tabWidget);
    mainLayout->setMargin(0);

    QWidget *mainWidget = new QWidget;
    mainWidget->setLayout(mainLayout);
    setMainWidget(mainWidget);
    setInitialSize( QSize( 480, 460 ) );
}
Save_grid_dialog::Save_grid_dialog( const GsTL_project* project,
				    QWidget * parent, const char * name) 
  : QFileDialog( parent ) {

  if (name)
    setObjectName(name);
  
  setModal(true);
  setFileMode( QFileDialog::AnyFile );
  setLabelText(QFileDialog::Accept, "Save");

  QGridLayout * lo = dynamic_cast<QGridLayout*>(this->layout());
  
  grid_selector_ = new QComboBox( this);
  QLabel* label = new QLabel( "Grid to save", this );
  lo->addWidget(label, 4,0,Qt::AlignLeft);
  lo->addWidget(grid_selector_,4,1,Qt::AlignLeft);



  //TL modified
  propList_ = new QListWidget( this);
  propList_->setSelectionMode(QAbstractItemView::ExtendedSelection);
  QLabel* plabel = new QLabel( "Properties to save", this );
  lo->addWidget(plabel, 5,0,Qt::AlignLeft);
  lo->addWidget(propList_,5,1,Qt::AlignLeft);


  //TL + AB modified
  masked_as_regular_frame_ = new QFrame(this);
  saveRegular_ = new QCheckBox(masked_as_regular_frame_);
  //saveRegular_->setDisabled(true);
  QLabel* slabel = new QLabel( "Save masked grid as Cartesian", masked_as_regular_frame_ );
  QHBoxLayout* mgrid_to_cgrid_layout = new QHBoxLayout(masked_as_regular_frame_);
  mgrid_to_cgrid_layout->addWidget(slabel);
  mgrid_to_cgrid_layout->addWidget(saveRegular_);
  masked_as_regular_frame_->setLayout(mgrid_to_cgrid_layout);
  lo->addWidget(masked_as_regular_frame_,6,1,Qt::AlignLeft);
  masked_as_regular_frame_->setVisible(false);

 // lo->addWidget(slabel, 6,0,Qt::AlignLeft);
 // lo->addWidget(saveRegular_,6,1,Qt::AlignLeft);
  
  // search for available output filters

  QStringList filters;
  SmartPtr<Named_interface> ni_filter = 
    Root::instance()->interface( outfilters_manager );
  Manager* dir = dynamic_cast<Manager*>( ni_filter.raw_ptr() );
  appli_assert( dir );

  Manager::type_iterator begin = dir->begin();
  Manager::type_iterator end = dir->end();
  for( ; begin != end ; ++begin ) {
    SmartPtr<Output_filter> outf(dynamic_cast<Output_filter*>(dir->new_interface(*begin).raw_ptr() ));
    if( outf->type_data() != "Grid") continue;
    QString filt( begin->c_str() );
    filt += " (*.*)";
    filters.push_back( filt ) ;
  }

  setFilters( filters );

  
  // search for available grids

  const GsTL_project::String_list& grids = project->objects_list();
  typedef GsTL_project::String_list::const_iterator const_iterator;
  for( const_iterator it = grids.begin(); it != grids.end(); ++it ) {
    grid_selector_->addItem( it->c_str() );
  }

  QObject::connect( grid_selector_, SIGNAL( activated(const QString &) ),
	  this, SLOT( gridChanged(const QString &) ) );

  if (!grid_selector_->currentText().isEmpty())
	gridChanged(grid_selector_->currentText());
}
Ejemplo n.º 20
0
LilyPondOptionsDialog::LilyPondOptionsDialog(QWidget *parent,
	RosegardenDocument *doc,
        QString windowCaption,
        QString /* heading */,
        bool createdFromNotationEditor):
        QDialog(parent),
	m_doc(doc),
	m_createdFromNotationEditor(createdFromNotationEditor)
{
    setModal(true);
    setWindowTitle((windowCaption = "" ? tr("LilyPond Export/Preview") : windowCaption));

    QGridLayout *metaGridLayout = new QGridLayout;

    QWidget *mainbox = new QWidget(this);
    QVBoxLayout *mainboxLayout = new QVBoxLayout;
    metaGridLayout->addWidget(mainbox, 0, 0);

    //
    // Arrange options in "Layout" and "Headers" tabs.
    //

    QTabWidget *tabWidget = new QTabWidget(mainbox);
    mainboxLayout->addWidget(tabWidget);

    QFrame *layoutFrame = new QFrame();
    tabWidget->addTab(layoutFrame, tr("Layout"));

    layoutFrame->setContentsMargins(5, 5, 5, 5);
    QGridLayout *layoutGrid = new QGridLayout;
    layoutGrid->setSpacing(5);

    m_headersPage = new HeadersConfigurationPage(this, m_doc);
    tabWidget->addTab(m_headersPage, tr("Headers"));
//     m_headersPage->setSpacing(5);
//     m_headersPage->setMargin(5);
	
	
    //
    // LilyPond export: Basic options
    //

    QGroupBox *basicOptionsBox = new QGroupBox(tr("Basic options"), layoutFrame);
    QVBoxLayout *basicOptionsBoxLayout = new QVBoxLayout;

    layoutGrid->addWidget(basicOptionsBox, 0, 0);

    QFrame *frameBasic = new QFrame(basicOptionsBox);
    frameBasic->setContentsMargins(10, 10, 10, 10);
    QGridLayout *layoutBasic = new QGridLayout;
    layoutBasic->setSpacing(5);
    basicOptionsBoxLayout->addWidget(frameBasic);

    layoutBasic->addWidget(new QLabel(
                          tr("Export content"), frameBasic), 0, 0);

    m_lilyExportSelection = new QComboBox(frameBasic);
    m_lilyExportSelection->setToolTip(tr("<qt>Choose which tracks or segments to export</qt>"));
    m_lilyExportSelection->addItem(tr("All tracks"));
    m_lilyExportSelection->addItem(tr("Non-muted tracks"));
    m_lilyExportSelection->addItem(tr("Selected track"));
    m_lilyExportSelection->addItem(tr("Selected segments"));
    if (m_createdFromNotationEditor) {
        // The following item is shown only when the dialog is opened
        // from the notation editor
        QString itemName = tr("Edited segments");
        m_lilyExportSelection->addItem(itemName);
        m_editedSegmentsIndex = m_lilyExportSelection->findText(itemName);
    }

    layoutBasic->addWidget(m_lilyExportSelection, 0, 1);

    layoutBasic->addWidget(new QLabel(
                          tr("Compatibility level"), frameBasic), 1, 0);

    m_lilyLanguage = new QComboBox(frameBasic);
    m_lilyLanguage->setToolTip(tr("<qt>Set the LilyPond version you have installed. If you have a newer version of LilyPond, choose the highest version Rosegarden supports.</qt>"));

    m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.6")));
    m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.8")));
    m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.10")));
    m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.12")));
    m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.14")));
    layoutBasic->addWidget(m_lilyLanguage, 1, 1);

    layoutBasic->addWidget(new QLabel(
                          tr("Paper size"), frameBasic), 2, 0);

    QHBoxLayout *hboxPaper = new QHBoxLayout;
    m_lilyPaperSize = new QComboBox(frameBasic);
    m_lilyPaperSize->setToolTip(tr("<qt>Set the paper size</qt>"));
    m_lilyPaperSize->addItem(tr("A3"));
    m_lilyPaperSize->addItem(tr("A4"));
    m_lilyPaperSize->addItem(tr("A5"));
    m_lilyPaperSize->addItem(tr("A6"));
    m_lilyPaperSize->addItem(tr("Legal"));
    m_lilyPaperSize->addItem(tr("US Letter"));
    m_lilyPaperSize->addItem(tr("Tabloid"));
    m_lilyPaperSize->addItem(tr("do not specify"));

    m_lilyPaperLandscape = new QCheckBox(tr("Landscape"), frameBasic);
    m_lilyPaperLandscape->setToolTip(tr("<qt>If checked, your score will print in landscape orientation instead of the default portrait orientation</qt>"));

    hboxPaper->addWidget(m_lilyPaperSize);
    hboxPaper->addWidget(new QLabel(" ", frameBasic)); // fixed-size spacer
    hboxPaper->addWidget(m_lilyPaperLandscape);
    layoutBasic->addLayout(hboxPaper, 2, 1);

    layoutBasic->addWidget(new QLabel(
                          tr("Staff size"), frameBasic), 3, 0);

    m_lilyFontSize = new QComboBox(frameBasic);
    m_lilyFontSize->setToolTip(tr("<qt><p>Choose the staff size of the score.  LilyPond will scale staff contents relative to this size.</p><p>Sizes marked * may provide the best rendering quality.</p></qt>"));
    for (unsigned int i = 0; i < MAX_POINTS; i++) {
        bool recommended = false;
        int printSize = i + FONT_OFFSET;
        switch (printSize) {
            case 11:
            case 13:
            case 14:
            case 19:
            case 20:
            case 23:
            case 26: recommended = true; break;
            default: recommended = false;
        }
        QString fontString = tr("%1 pt %2").arg(printSize).arg(recommended ? tr(" *") : "");
        m_lilyFontSize->addItem(fontString);
    }
    layoutBasic->addWidget(m_lilyFontSize, 3, 1);

    //
    // LilyPond export: Notation options
    //

    QGroupBox *specificOptionsBox = new QGroupBox(tr("Advanced options"), layoutFrame);
    QVBoxLayout *specificOptionsBoxLayout = new QVBoxLayout;
    layoutGrid->addWidget(specificOptionsBox, 2, 0);

    QFrame *frameNotation = new QFrame(specificOptionsBox);
    frameNotation->setContentsMargins(10, 10, 10, 10);
    QGridLayout *layoutNotation = new QGridLayout;
    layoutNotation->setSpacing(5);
    specificOptionsBoxLayout->addWidget(frameNotation);

    m_lilyTempoMarks = new QComboBox(frameNotation);
    m_lilyTempoMarks->addItem(tr("None"));
    m_lilyTempoMarks->addItem(tr("First"));
    m_lilyTempoMarks->addItem(tr("All"));

    layoutNotation->addWidget(new QLabel(
			 tr("Export tempo marks "), frameNotation), 0, 0);
    layoutNotation->addWidget(m_lilyTempoMarks, 0, 1);
    m_lilyTempoMarks->setToolTip(tr("<qt>Choose how often to show tempo marks in your score</qt>"));

    layoutNotation->addWidget(new QLabel(
			 tr("Export lyrics"), frameNotation), 1, 0);
    m_lilyExportLyrics = new QComboBox(frameNotation);
    m_lilyExportLyrics->addItem(tr("None"));
    m_lilyExportLyrics->addItem(tr("Left"));
    m_lilyExportLyrics->addItem(tr("Center"));
    m_lilyExportLyrics->addItem(tr("Right"));
    layoutNotation->addWidget(m_lilyExportLyrics, 1, 1);
    m_lilyExportLyrics->setToolTip(tr("<qt>Set the position of the <b>lyrics</b> in relation to the notes</qt>"));


    m_lilyExportBeams = new QCheckBox(
                            tr("Export beamings"), frameNotation);
    layoutNotation->addWidget(m_lilyExportBeams, 2, 0, 1, 2);
    m_lilyExportBeams->setToolTip(tr("<qt>If checked, Rosegarden's beamings will be exported.  Otherwise, LilyPond will calculate beams automatically.</qt>"));

    // recycle this for a new option to ignore the track brackets (so it is less
    // obnoxious to print single parts where brackets are in place)
    m_lilyExportStaffGroup = new QCheckBox(
                                 tr("Export track staff brackets"), frameNotation);
    layoutNotation->addWidget(m_lilyExportStaffGroup, 3, 0, 1, 2);
    m_lilyExportStaffGroup->setToolTip(tr("<qt>Track staff brackets are found in the <b>Track Parameters</b> box, and may be used to group staffs in various ways</qt>"));

    m_useShortNames = new QCheckBox(
                          tr("Print short staff names"), frameNotation);
    m_useShortNames->setToolTip(tr("<qt>Useful for large, complex scores, this prints the short name every time there is a line break in the score, making it easier to follow which line belongs to which instrument across pages</qt>"));
    layoutNotation->addWidget(m_useShortNames, 4, 0, 1, 2);

    layoutGrid->setRowStretch(4, 10);

    m_lilyChordNamesMode = new QCheckBox(
                           tr("Interpret chord texts as lead sheet chord names"), frameNotation);
    layoutNotation->addWidget(m_lilyChordNamesMode, 5, 0, 1, 2);
    m_lilyChordNamesMode->setToolTip(tr("<qt><p>There is a tutorial on how to use this feature at http://www.rosegardenmusic.com/tutorials/supplemental/chordnames/index.html</p></qt>"));

    m_lilyRaggedBottom = new QCheckBox(
                           tr("Ragged bottom (systems will not be spread vertically across the page)"), frameNotation);
    layoutNotation->addWidget(m_lilyRaggedBottom, 6, 0, 1, 2);
    m_lilyRaggedBottom->setToolTip(tr("<qt><p>Useful for multi-page scores: this may prevent ugly final pages</p></qt>"));

    m_lilyMarkerMode = new QComboBox(frameNotation);
    m_lilyMarkerMode->addItem(tr("No markers"));
    m_lilyMarkerMode->addItem(tr("Rehearsal marks"));
    m_lilyMarkerMode->addItem(tr("Marker text"));

    layoutNotation->addWidget(new QLabel(
                                   tr("Export markers"), frameNotation), 7, 0);
    layoutNotation->addWidget(m_lilyMarkerMode, 7, 1);
    m_lilyMarkerMode->setToolTip(tr("<qt>Markers are found on the <b>Marker Ruler</b>.  They may be exported as text, or as rehearsal marks.</qt>"));

    m_lilyNoteLanguage = new QComboBox(frameNotation);
    // NB: language strings are specific to LilyPond so are not translated here
    m_lilyNoteLanguage->addItem("Arabic");
    m_lilyNoteLanguage->addItem("Catalan");
    m_lilyNoteLanguage->addItem("Deutsch");
    m_lilyNoteLanguage->addItem("English");
    m_lilyNoteLanguage->addItem("Espanol");
    m_lilyNoteLanguage->addItem("Italiano");
    m_lilyNoteLanguage->addItem("Nederlands");
    m_lilyNoteLanguage->addItem("Norsk");
    m_lilyNoteLanguage->addItem("Portugues");
    m_lilyNoteLanguage->addItem("Suomi");
    m_lilyNoteLanguage->addItem("Svenska");
    m_lilyNoteLanguage->addItem("Vlaams");

    layoutNotation->addWidget(new QLabel(
            tr("Notation language"), frameNotation), 8, 0);
    layoutNotation->addWidget(m_lilyNoteLanguage, 8, 1);
    m_lilyNoteLanguage->setToolTip(tr("<qt>Outputs note names and accidentals in any of LilyPond's supported languages</qt>"));

//     m_lilyRepeatMode = new QComboBox(frameNotation);
//     m_lilyRepeatMode->addItem(tr("Old mode"));
//     m_lilyRepeatMode->addItem(tr("Repeat when possible"));
//     m_lilyRepeatMode->addItem(tr("Always unfold"));

//     layoutNotation->addWidget(new QLabel(
//                                    tr("Repeat mode"), frameNotation),8, 0);
//     layoutNotation->addWidget(m_lilyRepeatMode, 8, 1);
    m_lilyRepeatMode = new QCheckBox(
                           tr("Use repeat when possible"), frameNotation);
    m_lilyRepeatMode->setToolTip(tr("<qt>How to export repeating segments: When unchecked, "
                                    "repeating segments are always unfolded.</qt>"));
    layoutNotation->addWidget(m_lilyRepeatMode, 9, 0);

    m_lilyDrawBarAtVolta = new QCheckBox(
                           tr("Draw bar line at volta"), frameNotation);
    m_lilyDrawBarAtVolta->setToolTip(tr("<qt>If checked a bar line is always "
                                    "drawn when a volta begins even if it "
                                    "begins in the middle of a bar.</qt>"));
    layoutNotation->addWidget(m_lilyDrawBarAtVolta, 10, 0);

    m_cancelAccidentals = new QCheckBox(tr("Cancel accidentals"));
    layoutNotation->addWidget(m_cancelAccidentals, 11, 0);
    m_cancelAccidentals->setToolTip(tr("<qt>When checked, natural signs are automatically printed to cancel any accidentals from previous key signatures. This cancelation behavior is separate from, and not related to how Rosegarden displays accidental cancelation in the notation editor.</qt>"));

    m_lilyExportEmptyStaves = new QCheckBox(tr("Export empty staves"));
    layoutNotation->addWidget(m_lilyExportEmptyStaves, 12, 0);
    m_lilyExportEmptyStaves->setToolTip(tr("<qt>When checked, LilyPond will print all staves, even if they are empty.  Turning this option off may reduce clutter on scores that feature long silences for some instruments.</qt>"));

    // as of lucky 13 here, I'm seeing we really need to tidy up the layout soon
    m_fingeringsInStaff = new QCheckBox(tr("Allow fingerings inside staff"));
    layoutNotation->addWidget(m_fingeringsInStaff, 13, 0);
    m_fingeringsInStaff->setToolTip(tr("<qt>When checked, LilyPond is allowed print fingerings inside the staff.  This can improve rendering in polyphonic scores with fingerings in different voices, and is on by default.</qt>"));


    basicOptionsBox->setLayout(basicOptionsBoxLayout);
    specificOptionsBox->setLayout(specificOptionsBoxLayout);

    layoutFrame->setLayout(layoutGrid);

    frameNotation->setLayout(layoutNotation);
    frameBasic->setLayout(layoutBasic);

    mainbox->setLayout(mainboxLayout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
    metaGridLayout->addWidget(buttonBox, 1, 0);
    metaGridLayout->setRowStretch(0, 10);

    setLayout(metaGridLayout);


    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(help()));

    populateDefaultValues();

    resize(minimumSizeHint());
}
Ejemplo n.º 21
0
NewDoc::NewDoc( QWidget* parent, const QStringList& recentDocs, bool startUp, QString lang) : QDialog( parent )
{
	setObjectName(QString::fromLocal8Bit("NewDocumentWindow"));
	setModal(true);
	prefsManager=PrefsManager::instance();
	m_tabSelected = 0;
	m_onStartup = startUp;
	m_unitIndex = prefsManager->appPrefs.docSetupPrefs.docUnitIndex;
	m_unitRatio = unitGetRatioFromIndex(m_unitIndex);
	m_unitSuffix = unitGetSuffixFromIndex(m_unitIndex);
	m_orientation = prefsManager->appPrefs.docSetupPrefs.pageOrientation;
	setWindowTitle( tr( "New Document" ) );
	setWindowIcon(QIcon(loadIcon("AppIcon.png")));
	TabbedNewDocLayout = new QVBoxLayout( this );
	TabbedNewDocLayout->setMargin(10);
	TabbedNewDocLayout->setSpacing(5);
	if (startUp)
		tabWidget = new QTabWidget( this );
	createNewDocPage();
	if (startUp)
	{
		tabWidget->addTab(newDocFrame, tr("&New Document"));
		createNewFromTempPage();
		nftGui->setupSettings(lang);
		tabWidget->addTab(newFromTempFrame, tr("New &from Template"));
		createOpenDocPage();
		tabWidget->addTab(openDocFrame, tr("Open &Existing Document"));
		recentDocList=recentDocs;
 		createRecentDocPage();
 		tabWidget->addTab(recentDocFrame, tr("Open Recent &Document"));
 		TabbedNewDocLayout->addWidget(tabWidget);
	}
	else
		TabbedNewDocLayout->addWidget(newDocFrame);

	Layout1 = new QHBoxLayout;
	Layout1->setSpacing( 5 );
	Layout1->setMargin( 0 );
	if (startUp)
	{
		startUpDialog = new QCheckBox( tr( "Do not show this dialog again" ), this );
		startUpDialog->setChecked(!prefsManager->appPrefs.uiPrefs.showStartupDialog);
		Layout1->addWidget( startUpDialog );
	}
	QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
	Layout1->addItem( spacer );
	OKButton = new QPushButton( CommonStrings::tr_OK, this );
	OKButton->setDefault( true );
	Layout1->addWidget( OKButton );
	CancelB = new QPushButton( CommonStrings::tr_Cancel, this );
	CancelB->setAutoDefault( false );
	Layout1->addWidget( CancelB );
	TabbedNewDocLayout->addLayout( Layout1 );
	//tooltips
	pageSizeComboBox->setToolTip( tr( "Document page size, either a standard size or a custom size" ) );
	pageOrientationComboBox->setToolTip( tr( "Orientation of the document's pages" ) );
	widthSpinBox->setToolTip( tr( "Width of the document's pages, editable if you have chosen a custom page size" ) );
	heightSpinBox->setToolTip( tr( "Height of the document's pages, editable if you have chosen a custom page size" ) );
	pageCountSpinBox->setToolTip( tr( "Initial number of pages of the document" ) );
	unitOfMeasureComboBox->setToolTip( tr( "Default unit of measurement for document editing" ) );
	autoTextFrame->setToolTip( tr( "Create text frames automatically when new pages are added" ) );
	numberOfCols->setToolTip( tr( "Number of columns to create in automatically created text frames" ) );
	Distance->setToolTip( tr( "Distance between automatically created columns" ) );

	// signals and slots connections
	connect( OKButton, SIGNAL( clicked() ), this, SLOT( ExitOK() ) );
	connect( CancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
	connect(pageSizeComboBox, SIGNAL(activated(const QString &)), this, SLOT(setPageSize(const QString &)));
	connect(pageOrientationComboBox, SIGNAL(activated(int)), this, SLOT(setOrientation(int)));
	connect(unitOfMeasureComboBox, SIGNAL(activated(int)), this, SLOT(setUnit(int)));
	connect(Distance, SIGNAL(valueChanged(double)), this, SLOT(setDistance(double)));
	connect(autoTextFrame, SIGNAL(clicked()), this, SLOT(handleAutoFrame()));
	connect(layoutsView, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(itemSelected(QListWidgetItem* )));
	connect(layoutsView, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(itemSelected(QListWidgetItem* )));
	connect(layoutsView, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(itemSelected(QListWidgetItem* )));
	connect(layoutsView, SIGNAL(itemPressed(QListWidgetItem *)), this, SLOT(itemSelected(QListWidgetItem* )));
	if (startUp)
	{
		connect(nftGui, SIGNAL(leaveOK()), this, SLOT(ExitOK()));
		connect(recentDocListBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(recentDocListBox_doubleClicked()));
		connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(adjustTitles(int)));
	}

// 	setMinimumSize(minimumSizeHint());
//  	setMaximumSize(minimumSizeHint());
// 	resize(minimumSizeHint());
}
Ejemplo n.º 22
0
BinarizePopup::BinarizePopup()
	: Dialog(TApp::instance()->getMainWindow(), true, false, "Binarize"), m_frameIndex(-1), m_progressBar(0), m_timerId(0)
{
	setWindowTitle(tr("Binarize"));
	setLabelWidth(0);
	setModal(false);

	setTopMargin(0);
	setTopSpacing(0);

	beginVLayout();

	QSplitter *splitter = new QSplitter(Qt::Vertical);
	splitter->setSizePolicy(
		QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
	addWidget(splitter);

	endVLayout();

	QWidget *parametersArea = new QFrame();
	splitter->addWidget(parametersArea);

	QGridLayout *parametersLayout = new QGridLayout();

	// parametersArea->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));

	//QFrame* topWidget = new QFrame(scrollArea);
	//topWidget->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
	//scrollArea->setWidget(topWidget);

	// parametersLayout->setSizeConstraint(QLayout::SetFixedSize);

	//------------------------- Parameters --------------------------

	/*
  //Brightness
	QLabel* brightnessLabel = new QLabel(tr("Brightness:"));
	topLayout->addWidget(brightnessLabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);

  m_brightnessField = new DVGui::IntField(topWidget);
  m_brightnessField->setRange(-127, 127);
  m_brightnessField->setValue(0);
	topLayout->addWidget(m_brightnessField, 0, 1);

  //Contrast
	QLabel* contrastLabel = new QLabel(tr("Contrast:"));
	topLayout->addWidget(contrastLabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);

  m_contrastField = new DVGui::IntField(topWidget);
  m_contrastField->setRange(-127, 127);
  m_contrastField->setValue(0);
	topLayout->addWidget(m_contrastField, 1, 1);
*/

	m_alphaChk = new DVGui::CheckBox(tr("Alpha"));
	m_previewChk = new DVGui::CheckBox(tr("Preview"));
	parametersLayout->addWidget(m_alphaChk, 0, 0);
	parametersLayout->addWidget(m_previewChk, 0, 1);

	parametersArea->setLayout(parametersLayout);

	//--------------------------- Swatch ----------------------------

	m_viewer = new Swatch();
	m_viewer->setMinimumHeight(150);
	m_viewer->setFocusPolicy(Qt::WheelFocus);
	splitter->addWidget(m_viewer);

	splitter->setStretchFactor(0, 0);
	splitter->setStretchFactor(1, 1);

	//--------------------------- Button ----------------------------

	m_okBtn = new QPushButton(tr("Apply"), this);
	connect(m_okBtn, SIGNAL(clicked()), this, SLOT(apply()));

	addButtonBarWidget(m_okBtn);

	//------------------------ Connections --------------------------

	bool ret = true;

	//ret = ret && connect(m_brightnessField, SIGNAL(valueChanged(bool)), this, SLOT(onValuesChanged(bool)));
	//ret = ret && connect(m_contrastField,   SIGNAL(valueChanged(bool)), this, SLOT(onValuesChanged(bool)));
	ret = ret && connect(m_previewChk, SIGNAL(stateChanged(int)), this, SLOT(onPreviewCheckboxChanged(int)));

	ret = ret && connect(m_alphaChk, SIGNAL(stateChanged(int)), this, SLOT(onAlphaCheckboxChanged(int)));

	assert(ret);

	m_viewer->resize(0, 350);
	resize(600, 500);
}
Ejemplo n.º 23
0
AddEventos::AddEventos(QSqlDatabase w_db, QWidget*parent )
    :QDialog(parent)
{
    setupUi(this);
    db=w_db;//request data base
    setModal(true);


    //set size of form
    QSize fixedSize(this->width(),this->height());
    setMinimumSize(fixedSize);
    setMaximumSize(fixedSize);
    setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);

    //Aceptar/Cancelar
    connect(BtnAceptar,SIGNAL(clicked()),this, SLOT(ClickAceptar())); //ok
    connect(BtnCancelar,SIGNAL(clicked()),this, SLOT(close())); //cancel

    connect(ComboEvento,SIGNAL(activated(int)),this, SLOT(ClickTipo(int))); //type event
    connect(ChecEspera, SIGNAL(clicked(bool)), SpinEspera, SLOT(setEnabled(bool)));//Espera máxima

    connect(ChecExpiracion, SIGNAL(clicked(bool)), TimeExpiracion, SLOT(setEnabled(bool)));//expiracion
    connect(ChecExpiracion, SIGNAL(clicked(bool)), DateExpiracion, SLOT(setEnabled(bool)));

    connect(RadioOtrasHoras, SIGNAL(clicked()), this, SLOT(OtrasHoras()));
    connect(RadioUnaVez, SIGNAL(clicked()), this, SLOT(OtrasHoras()));
    connect(RadioCadaHora, SIGNAL(clicked()), this, SLOT(OtrasHoras()));


    connect(BtnTodos, SIGNAL(clicked(bool)), BtnLunes, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnMartes, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnMiercoles, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnJueves, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnViernes, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnSabado, SLOT(click())); //¿todos?
    connect(BtnTodos, SIGNAL(clicked(bool)), BtnDomingo, SLOT(click())); //¿todos?

    connect(TimeHoraInicio, SIGNAL(editingFinished()), this, SLOT( HoratoCheckBox()));


    connect(BtnUrl,SIGNAL(clicked()),this, SLOT(ClickUrl()));//url of add radio
    connect(BtnAddRadio,SIGNAL(clicked()),this, SLOT(AddRadio())); //button add radio


    //QString Path=QCoreApplication::applicationDirPath().toLatin1();
    //QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    //db.setDatabaseName(Path + "/Eventos/evento.evt");
    //db.open();

    QSqlQuery query(db);

    w_AddHora = new AddHora(this);

    QDateTime w_DateTime;

    this->TimeHoraInicio->setTime(QDateTime::currentDateTime().time());  //ponemos hora y fecha de inico al dia de hoy
    this->DateFechaInicio->setDate(QDateTime::currentDateTime().date());

    TimeExpiracion->setTime(QDateTime::currentDateTime().time());  //ponemos hora y fecha expiracion  al dia de hoy
    DateExpiracion->setDate(QDateTime::currentDateTime().date());

    HoratoCheckBox();

    ModoEdit=false;
    this->FrameTipoRadio->setVisible(false); //parametros radio on-line false por defecto
}
Ejemplo n.º 24
0
        void PipBoy::init()
        {
            if (_initialized) return;
            State::init();

            setModal(true);
            setFullscreen(true);

            Game::getInstance()->mouse()->pushState(Input::Mouse::Cursor::BIG_ARROW);

            // Background
            auto background = new UI::Image("art/intrface/pip.frm");
            Point backgroundPos = Point((Game::getInstance()->renderer()->size() - background->size()) / 2);
            int backgroundX = backgroundPos.x();
            int backgroundY = backgroundPos.y();
            background->setPosition(backgroundPos);

            // Buttons
            auto alarmButton = new UI::ImageButton(UI::ImageButton::Type::PIPBOY_ALARM_BUTTON, backgroundX+124, backgroundY+13);
            auto statusButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, backgroundX+53, backgroundY+340);
            auto automapsButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, backgroundX+53, backgroundY+394);
            auto archivesButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, backgroundX+53, backgroundY+423);
            auto closeButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, backgroundX+53, backgroundY+448);
            closeButton->mouseClickHandler().add(std::bind(&PipBoy::onCloseButtonClick, this, std::placeholders::_1));
            // Date and time

            // Date
            auto day = new UI::SmallCounter(backgroundPos + Point(21, 17));
            day->setLength(2);
            day->setNumber(Game::getInstance()->gameTime()->day());
            day->setColor(UI::SmallCounter::Color::WHITE);
            day->setType(UI::SmallCounter::Type::UNSIGNED);

            auto month = new UI::MonthCounter(
                static_cast<UI::MonthCounter::Month>(Game::getInstance()->gameTime()->month()),
                backgroundPos + Point(46, 18)
            );

            auto year = new UI::SmallCounter(backgroundPos + Point(84, 17));
            year->setLength(4);
            year->setNumber(Game::getInstance()->gameTime()->year());
            year->setColor(UI::SmallCounter::Color::WHITE);
            year->setType(UI::SmallCounter::Type::UNSIGNED);

            // Time
            auto time = new UI::SmallCounter(backgroundPos + Point(160, 17));
            time->setLength(4);
            time->setNumber((Game::getInstance()->gameTime()->hours() * 100) + Game::getInstance()->gameTime()->minutes());
            time->setColor(UI::SmallCounter::Color::WHITE);
            time->setType(UI::SmallCounter::Type::UNSIGNED);

            addUI(background);

            addUI(alarmButton);
            addUI(statusButton);
            addUI(automapsButton);
            addUI(archivesButton);

            addUI(day);
            addUI(month);
            addUI(year);
            addUI(time);

            addUI(closeButton);
        }
Ejemplo n.º 25
0
AboutDlg::AboutDlg(QWidget* parent)
	: QDialog(parent)
{
	setAttribute(Qt::WA_DeleteOnClose);
	ui_.setupUi(this);

	setModal(false);

	ui_.lb_name->setText ( QString("<h3><b>%1 v%2</b></h3>").arg(ApplicationInfo::name()).arg(ApplicationInfo::version()) );

	ui_.te_license->setText ( loadText(":/COPYING") );

	QString lang_name = qApp->translate( "@default", "language_name" );
	if ( lang_name == "language_name" ) // remove the translation tab, if no translation is used
		ui_.tw_tabs->removePage ( ui_.tw_tabs->page(3) );

	// fill in Authors tab...
	QString authors;
	authors += details(QString::fromUtf8("Andrzej W�cik"),
			   "[email protected]", "[email protected]", "http://andrzej.hi-low.eu",
			   tr("Author and Lead Developer of Synapse-IM"));
	authors += details(QString::fromUtf8("Justin Karneges"),
			   "[email protected]", "", "",
			   tr("Founder and Original Author of Psi-IM"));
	authors += details(QString::fromUtf8("Kevin Smith"),
			   "[email protected]", "", "",
			   tr("Psi Project Lead/Maintainer"));
	authors += details(QString::fromUtf8("Remko Tronçon"),
			   "[email protected]", "", "",
			   tr("Psi Lead Developer"));
	authors += details(QString::fromUtf8("Michail Pishchagin"),
			   "[email protected]", "", "",
			   tr("Psi Lead Widget Developer"));
	authors += details(QString::fromUtf8("Maciej Niedzielski"),
			   "[email protected]", "", "",
			   tr("Psi Developer"));
	authors += details(QString::fromUtf8("Martin Hostettler"),
 			   "[email protected]", "", "",
			   tr("Psi Developer"));
	authors += details(QString::fromUtf8("Akito Nozaki"),
			   "[email protected]", "", "",
			   tr("Psi Miscellaneous Developer"));
	ui_.te_authors->setText( authors );


	// fill in Thanks To tab...
	QString thanks;
	thanks += details(QString::fromUtf8("Jan Niehusmann"),
			  "[email protected]", "", "",
			  tr("Build setup, miscellaneous assistance"));
	thanks += details(QString::fromUtf8("Everaldo Coelho"),
			  "", "", "http://www.everaldo.com",
			  tr("Many icons are from his Crystal icon theme"));
	thanks += details(QString::fromUtf8("Jason Kim"),
			  "", "", "",
			  tr("Graphics"));
	thanks += details(QString::fromUtf8("Hideaki Omuro"),
			  "", "", "",
			  tr("Graphics"));
	thanks += details(QString::fromUtf8("Bill Myers"),
			  "", "", "",
			  tr("Original Mac Port"));
	thanks += details(QString::fromUtf8("Eric Smith (Tarkvara Design, Inc.)"),
			 "[email protected]", "", "",
			 tr("Mac OS X Port"));
	thanks += details(QString::fromUtf8("Tony Collins"),
	 		 "", "", "",
	 		 tr("Original End User Documentation"));
	thanks += details(QString::fromUtf8("Hal Rottenberg"),
			  "", "", "",
			 tr("Webmaster, Marketing"));
	thanks += details(QString::fromUtf8("Mircea Bardac"),
			 "", "", "",
			 tr("Bug Tracker Management"));
	thanks += details(QString::fromUtf8("Jacek Tomasiak"),
			 "", "", "",
			 tr("Patches"));

	foreach(QCA::Provider *p, QCA::providers()) {
		QString credit = p->credit();
		if(!credit.isEmpty()) {
			thanks += details(tr("Security plugin: %1").arg(p->name()),
				"", "", "",
				credit);
		}
	}
    // --------------- QDesignerPromotionDialog
    QDesignerPromotionDialog::QDesignerPromotionDialog(QDesignerFormEditorInterface *core,
                                                       QWidget *parent,
                                                       const QString &promotableWidgetClassName,
                                                       QString *promoteTo) :
        QDialog(parent),
        m_mode(promotableWidgetClassName.isEmpty() || promoteTo == 0 ? ModeEdit : ModeEditChooseClass),
        m_promotableWidgetClassName(promotableWidgetClassName),
        m_core(core),
        m_promoteTo(promoteTo),
        m_promotion(core->promotion()),
        m_model(new PromotionModel(core)),
        m_treeView(new QTreeView),
        m_buttonBox(0),
        m_removeButton(new QPushButton(createIconSet(QString::fromUtf8("minus.png")), QString()))
    {
        m_buttonBox = createButtonBox();
        setModal(true);
        setWindowTitle(tr("Promoted Widgets"));
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

        QVBoxLayout *vboxLayout = new QVBoxLayout(this);

        // tree view group
        QGroupBox *treeViewGroup = new QGroupBox();
        treeViewGroup->setTitle(tr("Promoted Classes"));
        QVBoxLayout *treeViewVBoxLayout = new QVBoxLayout(treeViewGroup);
        // tree view
        m_treeView->setModel (m_model);
        m_treeView->setMinimumWidth(450);
        m_treeView->setContextMenuPolicy(Qt::CustomContextMenu);

        connect(m_treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
                this, &QDesignerPromotionDialog::slotSelectionChanged);

        connect(m_treeView, &QWidget::customContextMenuRequested,
                this, &QDesignerPromotionDialog::slotTreeViewContextMenu);

        QHeaderView *headerView = m_treeView->header();
        headerView->setSectionResizeMode(QHeaderView::ResizeToContents);
        treeViewVBoxLayout->addWidget(m_treeView);
        // remove button
        QHBoxLayout *hboxLayout = new QHBoxLayout();
        hboxLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));

        m_removeButton->setAutoDefault(false);
        connect(m_removeButton, &QAbstractButton::clicked, this, &QDesignerPromotionDialog::slotRemove);
        m_removeButton->setEnabled(false);
        hboxLayout->addWidget(m_removeButton);
        treeViewVBoxLayout->addLayout(hboxLayout);
        vboxLayout->addWidget(treeViewGroup);
        // Create new panel: Try to be smart and preselect a base class. Default to QFrame
        const QStringList &baseClassNameList = baseClassNames(m_promotion);
        int preselectedBaseClass = -1;
        if (m_mode == ModeEditChooseClass) {
            preselectedBaseClass = baseClassNameList.indexOf(m_promotableWidgetClassName);
        }
        if (preselectedBaseClass == -1)
            preselectedBaseClass = baseClassNameList.indexOf(QStringLiteral("QFrame"));

        NewPromotedClassPanel *newPromotedClassPanel = new NewPromotedClassPanel(baseClassNameList, preselectedBaseClass);
        newPromotedClassPanel->setPromotedHeaderSuffix(core->integration()->headerSuffix());
        newPromotedClassPanel->setPromotedHeaderLowerCase(core->integration()->isHeaderLowercase());
        connect(newPromotedClassPanel, &NewPromotedClassPanel::newPromotedClass,
                this, &QDesignerPromotionDialog::slotNewPromotedClass);
        connect(this, &QDesignerPromotionDialog::selectedBaseClassChanged,
                newPromotedClassPanel, &NewPromotedClassPanel::chooseBaseClass);
        vboxLayout->addWidget(newPromotedClassPanel);
        // button box
        vboxLayout->addWidget(m_buttonBox);
        // connect model
        connect(m_model, &PromotionModel::includeFileChanged,
                this, &QDesignerPromotionDialog::slotIncludeFileChanged);

        connect(m_model, &PromotionModel::classNameChanged,
                this, &QDesignerPromotionDialog::slotClassNameChanged);

        // focus
        if (m_mode == ModeEditChooseClass)
            newPromotedClassPanel->grabFocus();

        slotUpdateFromWidgetDatabase();
    }
Ejemplo n.º 27
0
Dialog::Dialog(UmlArtifact * art, const QByteArray & path_exe, QByteArray & pro, QByteArray & target, QByteArray & tmplt, QByteArray & config, QByteArray & defines, QByteArray & includepath, QByteArray & dependpath, QByteArray & objectsdir, QByteArray & footer)
    : QDialog(0), _art(art), _pro(pro), _target(target), _tmplt(tmplt),
      _config(config), _defines(defines), _includepath(includepath), _dependpath(dependpath),
      _objectsdir(objectsdir), _footer(footer)
{
    setModal(true);
    QDir d(path_exe);
    QVBoxLayout * vbox = new QVBoxLayout(this);
    GridBox * grid = new GridBox(2, this);
    HHBox * htab;
    int index;

    vbox->addWidget(grid);
    vbox->setMargin(5);

    grid->addWidget(new QLabel(".pro file : ", grid));
    grid->addWidget(htab = new HHBox(grid));
    htab->addWidget(edpro = new QLineEdit(htab));
    edpro->setText(d.absoluteFilePath(pro));

    htab->addWidget(new QLabel(" ", htab));
    htab->addWidget(browsepro = new SmallPushButton("browse", htab));
    connect(browsepro, SIGNAL(clicked()), this, SLOT(browse_pro()));

    grid->addWidget(new QLabel("target : ", grid));
    grid->addWidget(htab = new HHBox(grid));
    htab->addWidget(edtarget = new QLineEdit(htab));
    edtarget->setText(d.absoluteFilePath(target));
    htab->addWidget(new QLabel(" ", htab));
    htab->addWidget(browsetarget = new SmallPushButton("browse", htab));
    connect(browsetarget, SIGNAL(clicked()), this, SLOT(browse_target()));

    grid->addWidget(new QLabel("template : ", grid));
    grid->addWidget(cbtemplate = new QComboBox(grid));
    cbtemplate->setEditable(true);

    static const char * templates[] = { "app", "lib", "subdirs" };
    bool find = FALSE;

    for (index = 0; index != sizeof(templates) / sizeof(*templates); index += 1) {
        cbtemplate->addItem(templates[index]);

        if (tmplt == templates[index]) {
            cbtemplate->setCurrentIndex(index);
            find = TRUE;
        }
    }

    if (! find) {
        cbtemplate->addItem((QString) tmplt);
        cbtemplate->setCurrentIndex(index);
    }

    grid->addWidget(new QLabel("config : ", grid));
    grid->addWidget(htab = new HHBox(grid));
    htab->addWidget(cbconf[0] = new QComboBox( htab));
    cbconf[0]->addItem("debug");
    cbconf[0]->addItem("release");

    QStringList lcnf = QString(config).split(" ");
        //QStringList::split(" ", (const char *) config);
    QStringList::Iterator it = lcnf.begin();

    cbconf[0]->setCurrentIndex((*it++ == "debug") ? 0 : 1);

    htab->addWidget(cbconf[1] = new QComboBox( htab));
    cbconf[1]->addItem("warn_on");
    cbconf[1]->addItem("warn_off");
    cbconf[1]->setCurrentIndex((*it++ == "warn_on") ? 0 : 1);

    QSizePolicy sp = cbconf[0]->sizePolicy();

    sp.setHorizontalPolicy(QSizePolicy::Fixed);
    cbconf[0]->setSizePolicy(sp);
    cbconf[1]->setSizePolicy(sp);

    htab->addWidget(new QLabel(" qt ", htab));
    it++;	// qt

    /*const char * configs[] = {
        "", "opengl", "thread", "x11", "windows",
        "console", "dll", "staticlib", 0
    };*/
    QStringList configs;
    configs<<""<<"opengl"<<"thread"<<"x11"<<"windows"<<
            "console"<<"dll"<<"staticlib";

    for (index = 2;
         index != sizeof(cbconf) / sizeof(*cbconf) - 1;
         index += 1) {
        htab->addWidget(cbconf[index] = new QComboBox( htab));
        cbconf[index]->setEditable(true);

        if (it != lcnf.end())
            cbconf[index]->addItem(*it++);

        cbconf[index]->addItems(configs);
        cbconf[index]->setCurrentIndex(0);
    }

    htab->addWidget(cbconf[index] = new QComboBox( htab));
    cbconf[index]->setEditable(true);

    if (it != lcnf.end()) {
        QString s = *it++;

        while (it != lcnf.end())
            s += " " + *it++;

        cbconf[index]->addItem(s);
    }

    cbconf[index]->addItems(configs);
    cbconf[index]->setCurrentIndex(0);


    grid->addWidget(new QLabel("defines : ", grid));
    grid->addWidget(eddefines = new QLineEdit(grid));
    eddefines->setText(defines);

    ///may be computed
    grid->addWidget(new QLabel("include paths : ", grid));
    grid->addWidget(htab = new HHBox(grid));
    htab->addWidget(edincludepath = new QLineEdit(htab));
    edincludepath->setText(includepath);
    htab->addWidget(new QLabel(" ", htab));
    htab->addWidget(computeincludepath = new SmallPushButton("compute", htab));
    connect(computeincludepath, SIGNAL(clicked()), this, SLOT(compute_includepath()));

    grid->addWidget(new QLabel("depend paths : ", grid));
    grid->addWidget(eddependpath = new QLineEdit(grid));
    eddependpath->setText(dependpath);

    grid->addWidget(new QLabel("objects dir : ", grid));
    grid->addWidget(htab = new HHBox(grid));
    htab->addWidget(edobjectsdir = new QLineEdit(htab));
    edobjectsdir->setText(objectsdir);
    htab->addWidget(new QLabel(" ", htab));
    htab->addWidget(browseobjectsdir = new SmallPushButton("browse", htab));
    connect(browseobjectsdir, SIGNAL(clicked()), this, SLOT(browse_objectsdir()));

    grid->addWidget(new QLabel("footer : ", grid));
    grid->addWidget(edfooter = new QTextEdit(grid));
    edfooter->setText(footer);

    grid->addWidget(new QLabel(grid));
    grid->addWidget(new QLabel(grid));

    grid->addWidget(new QLabel(grid));
    grid->addWidget(htab = new HHBox(grid));
    htab->addWidget(new QLabel(htab));
    QPushButton * ok ;
    htab->addWidget(ok = new QPushButton("&OK", htab));
    htab->addWidget(new QLabel(htab));
    QPushButton * cancel;
    htab->addWidget( cancel = new QPushButton("&Cancel", htab));
    htab->addWidget(new QLabel(htab));
    QSize bs(cancel->sizeHint());

    ok->setDefault(TRUE);

    if (ok->sizeHint().width() > bs.width())
        bs.setWidth(ok->sizeHint().width());

    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Ejemplo n.º 28
0
LogBrowser::LogBrowser(QWidget *parent) :
    QDialog(parent),
    _logWidget( new LogWidget(parent) )
{
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    setObjectName("LogBrowser"); // for save/restoreGeometry()
    setWindowTitle(tr("Log Output"));
    setMinimumWidth(600);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    // mainLayout->setMargin(0);

    mainLayout->addWidget( _logWidget );

    QHBoxLayout *toolLayout = new QHBoxLayout;
    mainLayout->addLayout( toolLayout );

    // Search input field
    QLabel *lab = new QLabel(tr("&Search: "));
    _findTermEdit = new QLineEdit;
    lab->setBuddy( _findTermEdit );
    toolLayout->addWidget(lab);
    toolLayout->addWidget( _findTermEdit );

    // find button
    QPushButton *findBtn = new QPushButton;
    findBtn->setText( tr("&Find") );
    connect( findBtn, SIGNAL(clicked()), this, SLOT(slotFind()));
    toolLayout->addWidget( findBtn );

    // stretch
    toolLayout->addStretch(1);
    _statusLabel = new QLabel;
    toolLayout->addWidget( _statusLabel );
    toolLayout->addStretch(5);

    QDialogButtonBox *btnbox = new QDialogButtonBox;
    QPushButton *closeBtn = btnbox->addButton( QDialogButtonBox::Close );
    connect(closeBtn,SIGNAL(clicked()),this,SLOT(close()));

    mainLayout->addWidget( btnbox );

    // clear button
    _clearBtn = new QPushButton;
    _clearBtn->setText( tr("Clear") );
    _clearBtn->setToolTip( tr("Clear the log display.") );
    btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole);
    connect( _clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog()));

    // save Button
    _saveBtn = new QPushButton;
    _saveBtn->setText( tr("S&ave") );
    _saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging."));
    btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole);
    connect( _saveBtn, SIGNAL(clicked()),this, SLOT(slotSave()));

    setLayout( mainLayout );

    setModal(false);

    // Direct connection for log comming from this thread, and queued for the one in a different thread
    connect(Logger::instance(), SIGNAL(newLog(QString)),this,SLOT(slotNewLog(QString)), Qt::AutoConnection);

    QAction *showLogWindow = new QAction(this);
    showLogWindow->setShortcut(QKeySequence("F12"));
    connect(showLogWindow, SIGNAL(triggered()), SLOT(close()));
    addAction(showLogWindow);

    MirallConfigFile cfg;
    cfg.restoreGeometry(this);
    int lines = cfg.maxLogLines();
    // qDebug() << "#        ##  Have " << lines << " Loglines!";
    _logWidget->document()->setMaximumBlockCount( lines );

}
Ejemplo n.º 29
0
SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
	m_bufferSize( ConfigManager::inst()->value( "mixer",
					"framesperaudiobuffer" ).toInt() ),
	m_toolTips( !ConfigManager::inst()->value( "tooltips",
							"disabled" ).toInt() ),
	m_warnAfterSetup( !ConfigManager::inst()->value( "app",
						"nomsgaftersetup" ).toInt() ),
	m_displaydBV( ConfigManager::inst()->value( "app", 
		      				"displaydbv" ).toInt() ),
	m_MMPZ( !ConfigManager::inst()->value( "app", "nommpz" ).toInt() ),
	m_disableBackup( !ConfigManager::inst()->value( "app",
							"disablebackup" ).toInt() ),
	m_openLastProject( ConfigManager::inst()->value( "app",
							"openlastproject" ).toInt() ),
	m_hqAudioDev( ConfigManager::inst()->value( "mixer",
							"hqaudio" ).toInt() ),
	m_lang( ConfigManager::inst()->value( "app",
							"language" ) ),
	m_workingDir( QDir::toNativeSeparators( ConfigManager::inst()->workingDir() ) ),
	m_vstDir( QDir::toNativeSeparators( ConfigManager::inst()->vstDir() ) ),
	m_artworkDir( QDir::toNativeSeparators( ConfigManager::inst()->artworkDir() ) ),
	m_flDir( QDir::toNativeSeparators( ConfigManager::inst()->flDir() ) ),
	m_ladDir( QDir::toNativeSeparators( ConfigManager::inst()->ladspaDir() ) ),
	m_gigDir( QDir::toNativeSeparators( ConfigManager::inst()->gigDir() ) ),
	m_sf2Dir( QDir::toNativeSeparators( ConfigManager::inst()->sf2Dir() ) ),
#ifdef LMMS_HAVE_FLUIDSYNTH
	m_defaultSoundfont( QDir::toNativeSeparators( ConfigManager::inst()->defaultSoundfont() ) ),
#endif
#ifdef LMMS_HAVE_STK
	m_stkDir( QDir::toNativeSeparators( ConfigManager::inst()->stkDir() ) ),
#endif
	m_backgroundArtwork( QDir::toNativeSeparators( ConfigManager::inst()->backgroundArtwork() ) ),
	m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ),
	m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() ),
	m_oneInstrumentTrackWindow( ConfigManager::inst()->value( "ui",
					"oneinstrumenttrackwindow" ).toInt() ),
	m_compactTrackButtons( ConfigManager::inst()->value( "ui",
					"compacttrackbuttons" ).toInt() ),
	m_syncVSTPlugins( ConfigManager::inst()->value( "ui",
							"syncvstplugins" ).toInt() ),
	m_animateAFP(ConfigManager::inst()->value( "ui",
						   "animateafp").toInt() ),
	m_printNoteLabels(ConfigManager::inst()->value( "ui",
						   "printnotelabels").toInt() ),
	m_displayWaveform(ConfigManager::inst()->value( "ui",
						   "displaywaveform").toInt() ),
	m_disableAutoQuit(ConfigManager::inst()->value( "ui",
						   "disableautoquit").toInt() )
{
	setWindowIcon( embed::getIconPixmap( "setup_general" ) );
	setWindowTitle( tr( "Setup LMMS" ) );
	setModal( true );

	Engine::projectJournal()->setJournalling( false );

	QVBoxLayout * vlayout = new QVBoxLayout( this );
	vlayout->setSpacing( 0 );
	vlayout->setMargin( 0 );
	QWidget * settings = new QWidget( this );
	QHBoxLayout * hlayout = new QHBoxLayout( settings );
	hlayout->setSpacing( 0 );
	hlayout->setMargin( 0 );

	m_tabBar = new TabBar( settings, QBoxLayout::TopToBottom );
	m_tabBar->setExclusive( true );
	m_tabBar->setFixedWidth( 72 );

	QWidget * ws = new QWidget( settings );
	int wsHeight = 370;
#ifdef LMMS_HAVE_STK
	wsHeight += 50;
#endif
#ifdef LMMS_HAVE_FLUIDSYNTH
	wsHeight += 50;
#endif
	ws->setFixedSize( 360, wsHeight );
	QWidget * general = new QWidget( ws );
	general->setFixedSize( 360, 240 );
	QVBoxLayout * gen_layout = new QVBoxLayout( general );
	gen_layout->setSpacing( 0 );
	gen_layout->setMargin( 0 );
	labelWidget( general, tr( "General settings" ) );

	TabWidget * bufsize_tw = new TabWidget( tr( "BUFFER SIZE" ), general );
	bufsize_tw->setFixedHeight( 80 );

	m_bufSizeSlider = new QSlider( Qt::Horizontal, bufsize_tw );
	m_bufSizeSlider->setRange( 1, 256 );
	m_bufSizeSlider->setTickPosition( QSlider::TicksBelow );
	m_bufSizeSlider->setPageStep( 8 );
	m_bufSizeSlider->setTickInterval( 8 );
	m_bufSizeSlider->setGeometry( 10, 16, 340, 18 );
	m_bufSizeSlider->setValue( m_bufferSize / 64 );

	connect( m_bufSizeSlider, SIGNAL( valueChanged( int ) ), this,
						SLOT( setBufferSize( int ) ) );

	m_bufSizeLbl = new QLabel( bufsize_tw );
	m_bufSizeLbl->setGeometry( 10, 40, 200, 24 );
	setBufferSize( m_bufSizeSlider->value() );

	QPushButton * bufsize_reset_btn = new QPushButton(
			embed::getIconPixmap( "reload" ), "", bufsize_tw );
	bufsize_reset_btn->setGeometry( 290, 40, 28, 28 );
	connect( bufsize_reset_btn, SIGNAL( clicked() ), this,
						SLOT( resetBufSize() ) );
	ToolTip::add( bufsize_reset_btn, tr( "Reset to default-value" ) );

	QPushButton * bufsize_help_btn = new QPushButton(
			embed::getIconPixmap( "help" ), "", bufsize_tw );
	bufsize_help_btn->setGeometry( 320, 40, 28, 28 );
	connect( bufsize_help_btn, SIGNAL( clicked() ), this,
						SLOT( displayBufSizeHelp() ) );


	TabWidget * misc_tw = new TabWidget( tr( "MISC" ), general );
	const int XDelta = 10;
	const int YDelta = 18;
	const int HeaderSize = 30;
	int labelNumber = 0;


	LedCheckBox * enable_tooltips = new LedCheckBox(
							tr( "Enable tooltips" ),
								misc_tw );
	labelNumber++;
	enable_tooltips->move( XDelta, YDelta*labelNumber );
	enable_tooltips->setChecked( m_toolTips );
	connect( enable_tooltips, SIGNAL( toggled( bool ) ),
					this, SLOT( toggleToolTips( bool ) ) );


	LedCheckBox * restart_msg = new LedCheckBox(
			tr( "Show restart warning after changing settings" ),
								misc_tw );
	labelNumber++;
	restart_msg->move( XDelta, YDelta*labelNumber );
	restart_msg->setChecked( m_warnAfterSetup );
	connect( restart_msg, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleWarnAfterSetup( bool ) ) );


	LedCheckBox * dbv = new LedCheckBox( tr( "Display volume as dBV " ),
								misc_tw );
	labelNumber++;
	dbv->move( XDelta, YDelta*labelNumber );
	dbv->setChecked( m_displaydBV );
	connect( dbv, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleDisplaydBV( bool ) ) );


	LedCheckBox * mmpz = new LedCheckBox(
				tr( "Compress project files per default" ),
								misc_tw );
	labelNumber++;
	mmpz->move( XDelta, YDelta*labelNumber );
	mmpz->setChecked( m_MMPZ );
	connect( mmpz, SIGNAL( toggled( bool ) ),
					this, SLOT( toggleMMPZ( bool ) ) );

	LedCheckBox * oneitw = new LedCheckBox(
				tr( "One instrument track window mode" ),
								misc_tw );
	labelNumber++;
	oneitw->move( XDelta, YDelta*labelNumber );
	oneitw->setChecked( m_oneInstrumentTrackWindow );
	connect( oneitw, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleOneInstrumentTrackWindow( bool ) ) );

	LedCheckBox * hqaudio = new LedCheckBox(
				tr( "HQ-mode for output audio-device" ),
								misc_tw );
	labelNumber++;
	hqaudio->move( XDelta, YDelta*labelNumber );
	hqaudio->setChecked( m_hqAudioDev );
	connect( hqaudio, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleHQAudioDev( bool ) ) );

	LedCheckBox * compacttracks = new LedCheckBox(
				tr( "Compact track buttons" ),
								misc_tw );
	labelNumber++;
	compacttracks->move( XDelta, YDelta*labelNumber );
	compacttracks->setChecked( m_compactTrackButtons );
	connect( compacttracks, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleCompactTrackButtons( bool ) ) );


	LedCheckBox * syncVST = new LedCheckBox(
				tr( "Sync VST plugins to host playback" ),
								misc_tw );
	labelNumber++;
	syncVST->move( XDelta, YDelta*labelNumber );
	syncVST->setChecked( m_syncVSTPlugins );
	connect( syncVST, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleSyncVSTPlugins( bool ) ) );

	LedCheckBox * noteLabels = new LedCheckBox(
				tr( "Enable note labels in piano roll" ),
								misc_tw );
	labelNumber++;
	noteLabels->move( XDelta, YDelta*labelNumber );
	noteLabels->setChecked( m_printNoteLabels );
	connect( noteLabels, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleNoteLabels( bool ) ) );

	LedCheckBox * displayWaveform = new LedCheckBox(
				tr( "Enable waveform display by default" ),
								misc_tw );
	labelNumber++;
	displayWaveform->move( XDelta, YDelta*labelNumber );
	displayWaveform->setChecked( m_displayWaveform );
	connect( displayWaveform, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleDisplayWaveform( bool ) ) );

	LedCheckBox * disableAutoquit = new LedCheckBox(
				tr( "Keep effects running even without input" ),
								misc_tw );
	labelNumber++;
	disableAutoquit->move( XDelta, YDelta*labelNumber );
	disableAutoquit->setChecked( m_disableAutoQuit );
	connect( disableAutoquit, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleDisableAutoquit( bool ) ) );

	LedCheckBox * disableBackup = new LedCheckBox(
				tr( "Create backup file when saving a project" ),
								misc_tw );
	labelNumber++;
	disableBackup->move( XDelta, YDelta*labelNumber );
	disableBackup->setChecked( m_disableBackup );
	connect( disableBackup, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleDisableBackup( bool ) ) );

	LedCheckBox * openLastProject = new LedCheckBox(
				tr( "Reopen last project on start" ),
								misc_tw );
	labelNumber++;
	openLastProject->move( XDelta, YDelta*labelNumber );
	openLastProject->setChecked( m_openLastProject );
	connect( openLastProject, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleOpenLastProject( bool ) ) );

	misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize );

	TabWidget * lang_tw = new TabWidget( tr( "LANGUAGE" ), general );
	lang_tw->setFixedHeight( 48 );
	QComboBox * changeLang = new QComboBox( lang_tw );
	changeLang->move( XDelta, YDelta );

	QDir dir( ConfigManager::inst()->localeDir() );
	QStringList fileNames = dir.entryList( QStringList( "*.qm" ) );
	for( int i = 0; i < fileNames.size(); ++i )
	{
		// get locale extracted by filename
		fileNames[i].truncate( fileNames[i].lastIndexOf( '.' ) );
		m_languages.append( fileNames[i] );
		QString lang = QLocale( m_languages.last() ).nativeLanguageName();
		changeLang->addItem( lang );
	}
	connect( changeLang, SIGNAL( currentIndexChanged( int ) ),
							this, SLOT( setLanguage( int ) ) );

	//If language unset, fallback to system language when available
	if( m_lang == "" )
	{
		QString tmp = QLocale::system().name().left( 2 );
		if( m_languages.contains( tmp ) )
		{
			m_lang = tmp;
		}
		else
		{
			m_lang = "en";
		}
	}

	for( int i = 0; i < changeLang->count(); ++i )
	{
		if( m_lang == m_languages.at( i ) )
		{
			changeLang->setCurrentIndex( i );
			break;
		}
	}

	gen_layout->addWidget( bufsize_tw );
	gen_layout->addSpacing( 10 );
	gen_layout->addWidget( misc_tw );
	gen_layout->addSpacing( 10 );
	gen_layout->addWidget( lang_tw );
	gen_layout->addStretch();



	QWidget * paths = new QWidget( ws );
	int pathsHeight = 370;
#ifdef LMMS_HAVE_STK
	pathsHeight += 55;
#endif
#ifdef LMMS_HAVE_FLUIDSYNTH
	pathsHeight += 55;
#endif
	paths->setFixedSize( 360, pathsHeight );
	QVBoxLayout * dir_layout = new QVBoxLayout( paths );
	dir_layout->setSpacing( 0 );
	dir_layout->setMargin( 0 );
	labelWidget( paths, tr( "Paths" ) );
	QLabel * title = new QLabel( tr( "Directories" ), paths );
	QFont f = title->font();
	f.setBold( true );
	title->setFont( pointSize<12>( f ) );


	QScrollArea *pathScroll = new QScrollArea( paths );

	QWidget *pathSelectors = new QWidget( ws );
	QVBoxLayout *pathSelectorLayout = new QVBoxLayout;
	pathScroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
	pathScroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
	pathScroll->resize( 362, pathsHeight - 50  );
	pathScroll->move( 0, 30 );
	pathSelectors->resize( 360, pathsHeight - 50 );

	const int txtLength = 285;
	const int btnStart = 305;


	// working-dir
	TabWidget * lmms_wd_tw = new TabWidget( tr(
					"LMMS working directory" ).toUpper(),
								pathSelectors );
	lmms_wd_tw->setFixedHeight( 48 );

	m_wdLineEdit = new QLineEdit( m_workingDir, lmms_wd_tw );
	m_wdLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_wdLineEdit, SIGNAL( textChanged( const QString & ) ), this,
				SLOT( setWorkingDir( const QString & ) ) );

	QPushButton * workingdir_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
							"", lmms_wd_tw );
	workingdir_select_btn->setFixedSize( 24, 24 );
	workingdir_select_btn->move( btnStart, 16 );
	connect( workingdir_select_btn, SIGNAL( clicked() ), this,
						SLOT( openWorkingDir() ) );


	// artwork-dir
	TabWidget * artwork_tw = new TabWidget( tr(
					"Themes directory" ).toUpper(),
								pathSelectors );
	artwork_tw->setFixedHeight( 48 );

	m_adLineEdit = new QLineEdit( m_artworkDir, artwork_tw );
	m_adLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_adLineEdit, SIGNAL( textChanged( const QString & ) ), this,
				SLOT( setArtworkDir( const QString & ) ) );

	QPushButton * artworkdir_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
							"", artwork_tw );
	artworkdir_select_btn->setFixedSize( 24, 24 );
	artworkdir_select_btn->move( btnStart, 16 );
	connect( artworkdir_select_btn, SIGNAL( clicked() ), this,
						SLOT( openArtworkDir() ) );



	// background artwork file
	TabWidget * backgroundArtwork_tw = new TabWidget( tr(
			"Background artwork" ).toUpper(), paths );
	backgroundArtwork_tw->setFixedHeight( 48 );

	m_baLineEdit = new QLineEdit( m_backgroundArtwork, 
			backgroundArtwork_tw );
	m_baLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_baLineEdit, SIGNAL( textChanged( const QString & ) ), this,
			SLOT( setBackgroundArtwork( const QString & ) ) );

	QPushButton * backgroundartworkdir_select_btn = new QPushButton(
			embed::getIconPixmap( "project_open", 16, 16 ),
			"", backgroundArtwork_tw );
	backgroundartworkdir_select_btn->setFixedSize( 24, 24 );
	backgroundartworkdir_select_btn->move( btnStart, 16 );
	connect( backgroundartworkdir_select_btn, SIGNAL( clicked() ), this,
					SLOT( openBackgroundArtwork() ) );





	// FL Studio-dir
	TabWidget * fl_tw = new TabWidget( tr(
				"FL Studio installation directory" ).toUpper(),
								paths );
	fl_tw->setFixedHeight( 48 );

	m_fdLineEdit = new QLineEdit( m_flDir, fl_tw );
	m_fdLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_fdLineEdit, SIGNAL( textChanged( const QString & ) ), this,
					SLOT( setFLDir( const QString & ) ) );

	QPushButton * fldir_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
								"", fl_tw );
	fldir_select_btn->setFixedSize( 24, 24 );
	fldir_select_btn->move( btnStart, 16 );
	connect( fldir_select_btn, SIGNAL( clicked() ), this,
						SLOT( openFLDir() ) );

	// vst-dir
	TabWidget * vst_tw = new TabWidget( tr(
					"VST-plugin directory" ).toUpper(),
								pathSelectors );
	vst_tw->setFixedHeight( 48 );

	m_vdLineEdit = new QLineEdit( m_vstDir, vst_tw );
	m_vdLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_vdLineEdit, SIGNAL( textChanged( const QString & ) ), this,
					SLOT( setVSTDir( const QString & ) ) );

	QPushButton * vstdir_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
								"", vst_tw );
	vstdir_select_btn->setFixedSize( 24, 24 );
	vstdir_select_btn->move( btnStart, 16 );
	connect( vstdir_select_btn, SIGNAL( clicked() ), this,
						SLOT( openVSTDir() ) );

	// gig-dir
	TabWidget * gig_tw = new TabWidget( tr(
					"GIG directory" ).toUpper(),
								pathSelectors );
	gig_tw->setFixedHeight( 48 );

	m_gigLineEdit = new QLineEdit( m_gigDir, gig_tw );
	m_gigLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_gigLineEdit, SIGNAL( textChanged( const QString & ) ), this,
					SLOT( setGIGDir( const QString & ) ) );

	QPushButton * gigdir_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
								"", gig_tw );
	gigdir_select_btn->setFixedSize( 24, 24 );
	gigdir_select_btn->move( btnStart, 16 );
	connect( gigdir_select_btn, SIGNAL( clicked() ), this,
						SLOT( openGIGDir() ) );

	// sf2-dir
	TabWidget * sf2_tw = new TabWidget( tr(
					"SF2 directory" ).toUpper(),
								pathSelectors );
	sf2_tw->setFixedHeight( 48 );

	m_sf2LineEdit = new QLineEdit( m_sf2Dir, sf2_tw );
	m_sf2LineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_sf2LineEdit, SIGNAL( textChanged( const QString & ) ), this,
					SLOT( setSF2Dir( const QString & ) ) );

	QPushButton * sf2dir_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
								"", sf2_tw );
	sf2dir_select_btn->setFixedSize( 24, 24 );
	sf2dir_select_btn->move( btnStart, 16 );
	connect( sf2dir_select_btn, SIGNAL( clicked() ), this,
						SLOT( openSF2Dir() ) );



	// LADSPA-dir
	TabWidget * lad_tw = new TabWidget( tr(
			"LADSPA plugin directories" ).toUpper(),
							paths );
	lad_tw->setFixedHeight( 48 );

	m_ladLineEdit = new QLineEdit( m_ladDir, lad_tw );
	m_ladLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_ladLineEdit, SIGNAL( textChanged( const QString & ) ), this,
		 		SLOT( setLADSPADir( const QString & ) ) );

	QPushButton * laddir_select_btn = new QPushButton(
				embed::getIconPixmap( "add_folder", 16, 16 ),
								"", lad_tw );
	laddir_select_btn->setFixedSize( 24, 24 );
	laddir_select_btn->move( btnStart, 16 );
	connect( laddir_select_btn, SIGNAL( clicked() ), this,
				 		SLOT( openLADSPADir() ) );


#ifdef LMMS_HAVE_STK
	// STK-dir
	TabWidget * stk_tw = new TabWidget( tr(
			"STK rawwave directory" ).toUpper(),
							paths );
	stk_tw->setFixedHeight( 48 );

	m_stkLineEdit = new QLineEdit( m_stkDir, stk_tw );
	m_stkLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_stkLineEdit, SIGNAL( textChanged( const QString & ) ), this,
		 SLOT( setSTKDir( const QString & ) ) );

	QPushButton * stkdir_select_btn = new QPushButton(
			embed::getIconPixmap( "project_open", 16, 16 ),
								"", stk_tw );
	stkdir_select_btn->setFixedSize( 24, 24 );
	stkdir_select_btn->move( btnStart, 16 );
	connect( stkdir_select_btn, SIGNAL( clicked() ), this,
		 SLOT( openSTKDir() ) );
#endif

#ifdef LMMS_HAVE_FLUIDSYNTH
	// Soundfont
	TabWidget * sf_tw = new TabWidget( tr(
			"Default Soundfont File" ).toUpper(), paths );
	sf_tw->setFixedHeight( 48 );

	m_sfLineEdit = new QLineEdit( m_defaultSoundfont, sf_tw );
	m_sfLineEdit->setGeometry( 10, 20, txtLength, 16 );
	connect( m_sfLineEdit, SIGNAL( textChanged( const QString & ) ), this,
		 		SLOT( setDefaultSoundfont( const QString & ) ) );

	QPushButton * sf_select_btn = new QPushButton(
				embed::getIconPixmap( "project_open", 16, 16 ),
								"", sf_tw );
	sf_select_btn->setFixedSize( 24, 24 );
	sf_select_btn->move( btnStart, 16 );
	connect( sf_select_btn, SIGNAL( clicked() ), this,
				 		SLOT( openDefaultSoundfont() ) );
#endif	

	pathSelectors->setLayout( pathSelectorLayout );

	pathSelectorLayout->addWidget( lmms_wd_tw );
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( gig_tw );
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( sf2_tw );
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( vst_tw );
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( lad_tw );
#ifdef LMMS_HAVE_STK
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( stk_tw );
#endif	
#ifdef LMMS_HAVE_FLUIDSYNTH
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( sf_tw );
#endif	
	pathSelectorLayout->addWidget( fl_tw );
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addWidget( artwork_tw );
	pathSelectorLayout->addSpacing( 10 );
	pathSelectorLayout->addStretch();
	pathSelectorLayout->addWidget( backgroundArtwork_tw );
	pathSelectorLayout->addSpacing( 10 );

	dir_layout->addWidget( pathSelectors );

	pathScroll->setWidget( pathSelectors );
	pathScroll->setWidgetResizable( true );



	QWidget * performance = new QWidget( ws );
	performance->setFixedSize( 360, 240 );
	QVBoxLayout * perf_layout = new QVBoxLayout( performance );
	perf_layout->setSpacing( 0 );
	perf_layout->setMargin( 0 );
	labelWidget( performance, tr( "Performance settings" ) );

	TabWidget * ui_fx_tw = new TabWidget( tr( "UI effects vs. "
						"performance" ).toUpper(),
								performance );
	ui_fx_tw->setFixedHeight( 80 );

	LedCheckBox * smoothScroll = new LedCheckBox(
			tr( "Smooth scroll in Song Editor" ), ui_fx_tw );
	smoothScroll->move( 10, 20 );
	smoothScroll->setChecked( m_smoothScroll );
	connect( smoothScroll, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleSmoothScroll( bool ) ) );


	LedCheckBox * autoSave = new LedCheckBox(
			tr( "Enable auto save feature" ), ui_fx_tw );
	autoSave->move( 10, 40 );
	autoSave->setChecked( m_enableAutoSave );
	connect( autoSave, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleAutoSave( bool ) ) );


	LedCheckBox * animAFP = new LedCheckBox(
				tr( "Show playback cursor in AudioFileProcessor" ),
								ui_fx_tw );
	animAFP->move( 10, 60 );
	animAFP->setChecked( m_animateAFP );
	connect( animAFP, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleAnimateAFP( bool ) ) );



	perf_layout->addWidget( ui_fx_tw );
	perf_layout->addStretch();



	QWidget * audio = new QWidget( ws );
	audio->setFixedSize( 360, 200 );
	QVBoxLayout * audio_layout = new QVBoxLayout( audio );
	audio_layout->setSpacing( 0 );
	audio_layout->setMargin( 0 );
	labelWidget( audio, tr( "Audio settings" ) );

	TabWidget * audioiface_tw = new TabWidget( tr( "AUDIO INTERFACE" ),
									audio );
	audioiface_tw->setFixedHeight( 60 );

	m_audioInterfaces = new QComboBox( audioiface_tw );
	m_audioInterfaces->setGeometry( 10, 20, 240, 22 );


	QPushButton * audio_help_btn = new QPushButton(
			embed::getIconPixmap( "help" ), "", audioiface_tw );
	audio_help_btn->setGeometry( 320, 20, 28, 28 );
	connect( audio_help_btn, SIGNAL( clicked() ), this,
						SLOT( displayAudioHelp() ) );


	// create ifaces-settings-widget
	QWidget * asw = new QWidget( audio );
	asw->setFixedHeight( 60 );

	QHBoxLayout * asw_layout = new QHBoxLayout( asw );
	asw_layout->setSpacing( 0 );
	asw_layout->setMargin( 0 );
	//asw_layout->setAutoAdd( true );

#ifdef LMMS_HAVE_JACK
	m_audioIfaceSetupWidgets[AudioJack::name()] =
					new AudioJack::setupWidget( asw );
#endif

#ifdef LMMS_HAVE_ALSA
	m_audioIfaceSetupWidgets[AudioAlsa::name()] =
					new AudioAlsaSetupWidget( asw );
#endif

#ifdef LMMS_HAVE_PULSEAUDIO
	m_audioIfaceSetupWidgets[AudioPulseAudio::name()] =
					new AudioPulseAudio::setupWidget( asw );
#endif

#ifdef LMMS_HAVE_PORTAUDIO
	m_audioIfaceSetupWidgets[AudioPortAudio::name()] =
					new AudioPortAudio::setupWidget( asw );
#endif

#ifdef LMMS_HAVE_SOUNDIO
	m_audioIfaceSetupWidgets[AudioSoundIo::name()] =
					new AudioSoundIo::setupWidget( asw );
#endif

#ifdef LMMS_HAVE_SDL
	m_audioIfaceSetupWidgets[AudioSdl::name()] =
					new AudioSdl::setupWidget( asw );
#endif

#ifdef LMMS_HAVE_OSS
	m_audioIfaceSetupWidgets[AudioOss::name()] =
					new AudioOss::setupWidget( asw );
#endif
	m_audioIfaceSetupWidgets[AudioDummy::name()] =
					new AudioDummy::setupWidget( asw );


	for( AswMap::iterator it = m_audioIfaceSetupWidgets.begin();
				it != m_audioIfaceSetupWidgets.end(); ++it )
	{
		m_audioIfaceNames[tr( it.key().toLatin1())] = it.key();
	}
	for( trMap::iterator it = m_audioIfaceNames.begin();
				it != m_audioIfaceNames.end(); ++it )
	{
		QWidget * audioWidget = m_audioIfaceSetupWidgets[it.value()];
		audioWidget->hide();
		asw_layout->addWidget( audioWidget );
		m_audioInterfaces->addItem( it.key() );
	}

	QString audioDevName = 
		ConfigManager::inst()->value( "mixer", "audiodev" );
	if( audioDevName.length() == 0 )
	{
		audioDevName = Engine::mixer()->audioDevName();
		ConfigManager::inst()->setValue(
					"mixer", "audiodev", audioDevName );
	}
	m_audioInterfaces->
		setCurrentIndex( m_audioInterfaces->findText( audioDevName ) );
	m_audioIfaceSetupWidgets[audioDevName]->show();

	connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ),
		this, SLOT( audioInterfaceChanged( const QString & ) ) );


	audio_layout->addWidget( audioiface_tw );
	audio_layout->addSpacing( 20 );
	audio_layout->addWidget( asw );
	audio_layout->addStretch();




	QWidget * midi = new QWidget( ws );
	QVBoxLayout * midi_layout = new QVBoxLayout( midi );
	midi_layout->setSpacing( 0 );
	midi_layout->setMargin( 0 );
	labelWidget( midi, tr( "MIDI settings" ) );

	TabWidget * midiiface_tw = new TabWidget( tr( "MIDI INTERFACE" ),
									midi );
	midiiface_tw->setFixedHeight( 60 );

	m_midiInterfaces = new QComboBox( midiiface_tw );
	m_midiInterfaces->setGeometry( 10, 20, 240, 22 );


	QPushButton * midi_help_btn = new QPushButton(
			embed::getIconPixmap( "help" ), "", midiiface_tw );
	midi_help_btn->setGeometry( 320, 20, 28, 28 );
	connect( midi_help_btn, SIGNAL( clicked() ), this,
						SLOT( displayMIDIHelp() ) );


	// create ifaces-settings-widget
	QWidget * msw = new QWidget( midi );
	msw->setFixedHeight( 60 );

	QHBoxLayout * msw_layout = new QHBoxLayout( msw );
	msw_layout->setSpacing( 0 );
	msw_layout->setMargin( 0 );
	//msw_layout->setAutoAdd( true );

#ifdef LMMS_HAVE_ALSA
	m_midiIfaceSetupWidgets[MidiAlsaSeq::name()] =
					MidiSetupWidget::create<MidiAlsaSeq>( msw );
	m_midiIfaceSetupWidgets[MidiAlsaRaw::name()] =
					MidiSetupWidget::create<MidiAlsaRaw>( msw );
#endif

#ifdef LMMS_HAVE_OSS
	m_midiIfaceSetupWidgets[MidiOss::name()] =
					MidiSetupWidget::create<MidiOss>( msw );
#endif

#ifdef LMMS_BUILD_WIN32
	m_midiIfaceSetupWidgets[MidiWinMM::name()] =
					MidiSetupWidget::create<MidiWinMM>( msw );
#endif

#ifdef LMMS_BUILD_APPLE
    m_midiIfaceSetupWidgets[MidiApple::name()] =
                    MidiSetupWidget::create<MidiApple>( msw );
#endif

	m_midiIfaceSetupWidgets[MidiDummy::name()] =
					MidiSetupWidget::create<MidiDummy>( msw );


	for( MswMap::iterator it = m_midiIfaceSetupWidgets.begin();
				it != m_midiIfaceSetupWidgets.end(); ++it )
	{
		m_midiIfaceNames[tr( it.key().toLatin1())] = it.key();
	}
	for( trMap::iterator it = m_midiIfaceNames.begin();
				it != m_midiIfaceNames.end(); ++it )
	{
		QWidget * midiWidget = m_midiIfaceSetupWidgets[it.value()];
		midiWidget->hide();
		msw_layout->addWidget( midiWidget );
		m_midiInterfaces->addItem( it.key() );
	}

	QString midiDevName = 
		ConfigManager::inst()->value( "mixer", "mididev" );
	if( midiDevName.length() == 0 )
	{
		midiDevName = Engine::mixer()->midiClientName();
		ConfigManager::inst()->setValue(
					"mixer", "mididev", midiDevName );
	}
	m_midiInterfaces->setCurrentIndex( 
		m_midiInterfaces->findText( midiDevName ) );
	m_midiIfaceSetupWidgets[midiDevName]->show();

	connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
		this, SLOT( midiInterfaceChanged( const QString & ) ) );


	midi_layout->addWidget( midiiface_tw );
	midi_layout->addSpacing( 20 );
	midi_layout->addWidget( msw );
	midi_layout->addStretch();


	m_tabBar->addTab( general, tr( "General settings" ), 0, false, true 
			)->setIcon( embed::getIconPixmap( "setup_general" ) );
	m_tabBar->addTab( paths, tr( "Paths" ), 1, false, true 
			)->setIcon( embed::getIconPixmap(
							"setup_directories" ) );
	m_tabBar->addTab( performance, tr( "Performance settings" ), 2, false,
				true )->setIcon( embed::getIconPixmap(
							"setup_performance" ) );
	m_tabBar->addTab( audio, tr( "Audio settings" ), 3, false, true
			)->setIcon( embed::getIconPixmap( "setup_audio" ) );
	m_tabBar->addTab( midi, tr( "MIDI settings" ), 4, true, true
			)->setIcon( embed::getIconPixmap( "setup_midi" ) );


	m_tabBar->setActiveTab( _tab_to_open );

	hlayout->addWidget( m_tabBar );
	hlayout->addSpacing( 10 );
	hlayout->addWidget( ws );
	hlayout->addSpacing( 10 );
	hlayout->addStretch();

	QWidget * buttons = new QWidget( this );
	QHBoxLayout * btn_layout = new QHBoxLayout( buttons );
	btn_layout->setSpacing( 0 );
	btn_layout->setMargin( 0 );
	QPushButton * ok_btn = new QPushButton( embed::getIconPixmap( "apply" ),
						tr( "OK" ), buttons );
	connect( ok_btn, SIGNAL( clicked() ), this, SLOT( accept() ) );

	QPushButton * cancel_btn = new QPushButton( embed::getIconPixmap(
								"cancel" ),
							tr( "Cancel" ),
							buttons );
	connect( cancel_btn, SIGNAL( clicked() ), this, SLOT( reject() ) );

	btn_layout->addStretch();
	btn_layout->addSpacing( 10 );
	btn_layout->addWidget( ok_btn );
	btn_layout->addSpacing( 10 );
	btn_layout->addWidget( cancel_btn );
	btn_layout->addSpacing( 10 );

	vlayout->addWidget( settings );
	vlayout->addSpacing( 10 );
	vlayout->addWidget( buttons );
	vlayout->addSpacing( 10 );
	vlayout->addStretch();

	show();


}
CCopasiPlotSelectionDialog::CCopasiPlotSelectionDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags f):
    QDialog(parent, f)
    , mpOKButton(NULL)
    , mpCancelButton(NULL)
    , mpExpertCheckBox(NULL)
    , mpXAxisSelectionWidget(NULL)
    , mpYAxisSelectionWidget(NULL)
    , mpSplitter(NULL)
    , mpButtonBox(NULL)
    , mpMainLayout(NULL)
    , mpXAxisLabel(NULL)
    , mpYAxisLabel(NULL)
    , mpXAxisSelectionBox(NULL)
    , mpYAxisSelectionBox(NULL)
    , mpXAxisOutputVector(NULL)
    , mpYAxisOutputVector(NULL)
{
  setObjectName(QString::fromUtf8(name));
  setModal(modal);
  mpMainLayout = new QVBoxLayout(this);

  mpSplitter = new QSplitter(this);
  mpSplitter->setOrientation(Qt::Horizontal);
  mpMainLayout->addWidget(mpSplitter);

  mpButtonBox = new QHBoxLayout(this);
  mpMainLayout->addLayout(mpButtonBox);

  mpOKButton = new QPushButton(this);
  mpOKButton->setText("OK");
  mpOKButton->setDefault(true);
  mpButtonBox->addWidget(mpOKButton);

  mpCancelButton = new QPushButton(this);
  mpCancelButton->setText("Cancel");
  mpButtonBox->addWidget(mpCancelButton);

  mpExpertCheckBox = new QCheckBox(this);
  mpExpertCheckBox->setText("Expert Mode");
  mpExpertCheckBox->setChecked(false);
  mpButtonBox->addWidget(mpExpertCheckBox);

  mpXAxisSelectionBox = new QWidget(mpSplitter);
  QVBoxLayout *vBox1 = new QVBoxLayout(mpXAxisSelectionBox);
  mpXAxisSelectionBox->setLayout(vBox1);
  mpXAxisSelectionBox->layout()->setContentsMargins(5, 5, 5, 5);

  mpYAxisSelectionBox = new QWidget(mpSplitter);
  QVBoxLayout *vBox2 = new QVBoxLayout(mpYAxisSelectionBox);
  mpYAxisSelectionBox->setLayout(vBox2);
  mpYAxisSelectionBox->layout()->setContentsMargins(5, 5, 5, 5);

  mpXAxisLabel = new QLabel("X-Axis:", mpXAxisSelectionBox);
  mpXAxisLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
  mpXAxisSelectionBox->layout()->addWidget(mpXAxisLabel);

  mpYAxisLabel = new QLabel("Y-Axis:", mpYAxisSelectionBox);
  mpYAxisLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
  mpYAxisSelectionBox->layout()->addWidget(mpYAxisLabel);

  mpXAxisSelectionWidget = new CCopasiSelectionWidget(mpXAxisSelectionBox);
  mpXAxisSelectionWidget->setSingleSelection(true);
  mpXAxisSelectionWidget->setOutputVector(mpXAxisOutputVector);
  mpXAxisSelectionBox->layout()->addWidget(mpXAxisSelectionWidget);

  mpYAxisSelectionWidget = new CCopasiSelectionWidget(mpYAxisSelectionBox);
  mpYAxisSelectionWidget->setSingleSelection(false);
  mpYAxisSelectionWidget->setOutputVector(mpYAxisOutputVector);
  mpYAxisSelectionBox->layout()->addWidget(mpYAxisSelectionWidget);

  connect(mpOKButton, SIGNAL(clicked()), this, SLOT(slotOKButtonClicked()));
  connect(mpCancelButton, SIGNAL(clicked()), this, SLOT(slotCancelButtonClicked()));
  connect(mpExpertCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotExpertCheckBoxToggled(bool)));

  setTabOrder();
}