DiagramDialog::DiagramDialog(Diagram *d, const QString& _DataSet, QWidget *parent, Graph *currentGraph) : QDialog(parent, 0, TRUE, Qt::WDestructiveClose) { Diag = d; Graphs.setAutoDelete(true); copyDiagramGraphs(); // make a copy of all graphs defaultDataSet = _DataSet; setCaption(tr("Edit Diagram Properties")); changed = false; transfer = false; // have changes be applied ? (used by "Cancel") toTake = false; // double-clicked variable be inserted into graph list ? Expr.setPattern("[^\"]+"); Validator = new QRegExpValidator(Expr, this); ValInteger = new QIntValidator(0, 360, this); ValDouble = new QDoubleValidator(-1e200, 1e200, 6, this); QString NameY, NameZ; if((Diag->Name == "Rect") || (Diag->Name == "Curve")) { NameY = tr("left Axis"); NameZ = tr("right Axis"); } else if(Diag->Name == "Polar") { NameY = tr("y-Axis"); } else if((Diag->Name == "Smith") || (Diag->Name == "ySmith")) { NameY = tr("y-Axis"); } else if(Diag->Name == "PS") { NameY = tr("smith Axis"); NameZ = tr("polar Axis"); } else if(Diag->Name == "SP") { NameY = tr("polar Axis"); NameZ = tr("smith Axis"); } else if(Diag->Name == "Rect3D") { NameY = tr("y-Axis"); NameZ = tr("z-Axis"); } all = new QVBoxLayout(this); // to provide neccessary size QTabWidget *t = new QTabWidget(this); all->addWidget(t); // ........................................................... QVBox *Tab1 = new QVBox(this); Tab1->setSpacing(5); Label4 = 0; // different types with same content yrLabel = 0; yAxisBox = 0; Property2 = 0; ColorButt = 0; hideInvisible = 0; rotationX = rotationY = rotationZ = 0; QVButtonGroup *InputGroup = new QVButtonGroup(tr("Graph Input"), Tab1); GraphInput = new QLineEdit(InputGroup); GraphInput->setValidator(Validator); connect(GraphInput, SIGNAL(textChanged(const QString&)), SLOT(slotResetToTake(const QString&))); QHBox *Box2 = new QHBox(InputGroup); Box2->setSpacing(5); if(Diag->Name == "Tab") { Label1 = new QLabel(tr("Number Notation: "), Box2); PropertyBox = new QComboBox(Box2); PropertyBox->insertItem(tr("real/imaginary")); PropertyBox->insertItem(tr("magnitude/angle (degree)")); PropertyBox->insertItem(tr("magnitude/angle (radian)")); PropertyBox->setCurrentItem(1); connect(PropertyBox, SIGNAL(activated(int)), SLOT(slotSetNumMode(int))); Box2->setStretchFactor(new QWidget(Box2), 5); // stretchable placeholder Label2 = new QLabel(tr("Precision:"), Box2); Property2 = new QLineEdit(Box2); Property2->setValidator(ValInteger); Property2->setMaxLength(2); Property2->setMaximumWidth(25); Property2->setText("3"); } else if(Diag->Name != "Truth") { Label1 = new QLabel(tr("Color:"),Box2); ColorButt = new QPushButton(" ",Box2); ColorButt->setMinimumWidth(50); ColorButt->setEnabled(false); connect(ColorButt, SIGNAL(clicked()), SLOT(slotSetColor())); Box2->setStretchFactor(new QWidget(Box2), 5); // stretchable placeholder Label3 = new QLabel(tr("Style:"),Box2); Label3->setEnabled(false); PropertyBox = new QComboBox(Box2); PropertyBox->insertItem(tr("solid line")); PropertyBox->insertItem(tr("dash line")); PropertyBox->insertItem(tr("dot line")); if(Diag->Name != "Time") { PropertyBox->insertItem(tr("long dash line")); PropertyBox->insertItem(tr("stars")); PropertyBox->insertItem(tr("circles")); PropertyBox->insertItem(tr("arrows")); } connect(PropertyBox, SIGNAL(activated(int)), SLOT(slotSetGraphStyle(int))); Box2->setStretchFactor(new QWidget(Box2), 5); // stretchable placeholder Label2 = new QLabel(tr("Thickness:"),Box2); Property2 = new QLineEdit(Box2); Property2->setValidator(ValInteger); Property2->setMaximumWidth(25); Property2->setMaxLength(2); Property2->setText("0"); if((Diag->Name=="Rect") || (Diag->Name=="PS") || (Diag->Name=="SP") || (Diag->Name=="Curve")) { QHBox *Box3 = new QHBox(InputGroup); Box3->setSpacing(5); Label4 = new QLabel(tr("y-Axis:"),Box3); Label4->setEnabled(false); yAxisBox = new QComboBox(Box3); yAxisBox->insertItem(NameY); yAxisBox->insertItem(NameZ); yAxisBox->setEnabled(false); connect(yAxisBox, SIGNAL(activated(int)), SLOT(slotSetYAxis(int))); Box3->setStretchFactor(new QWidget(Box3), 5); // stretchable placeholder } } if(Property2) { connect(Property2, SIGNAL(textChanged(const QString&)), SLOT(slotSetProp2(const QString&))); Label1->setEnabled(false); PropertyBox->setEnabled(false); Label2->setEnabled(false); Property2->setEnabled(false); } QHBox *Box1 = new QHBox(Tab1); Box1->setSpacing(5); QVButtonGroup *DataGroup = new QVButtonGroup(tr("Dataset"), Box1); ChooseData = new QComboBox(false, DataGroup); ChooseData->setMinimumWidth(200); connect(ChooseData, SIGNAL(activated(int)), SLOT(slotReadVars(int))); ChooseVars = new QListView(DataGroup); ChooseVars->addColumn(tr("Name")); ChooseVars->addColumn(tr("Type")); ChooseVars->addColumn(tr("Size")); connect(ChooseVars, SIGNAL(doubleClicked(QListViewItem*)), SLOT(slotTakeVar(QListViewItem*))); QVButtonGroup *GraphGroup = new QVButtonGroup(tr("Graph"), Box1); GraphList = new QListBox(GraphGroup); connect(GraphList, SIGNAL(clicked(QListBoxItem*)), SLOT(slotSelectGraph(QListBoxItem*))); QPushButton *NewButt = new QPushButton(tr("New Graph"), GraphGroup); connect(NewButt, SIGNAL(clicked()), SLOT(slotNewGraph())); QPushButton *DelButt = new QPushButton(tr("Delete Graph"), GraphGroup); connect(DelButt, SIGNAL(clicked()), SLOT(slotDeleteGraph())); t->addTab(Tab1, tr("Data")); // ........................................................... int Row = 0; if(Diag->Name.at(0) != 'T') { // not tabular or timing diagram QWidget *Tab2 = new QWidget(t); QGridLayout *gp = new QGridLayout(Tab2,13,3,5,5); gp->addMultiCellWidget(new QLabel(tr("x-Axis Label:"), Tab2), Row,Row,0,0); xLabel = new QLineEdit(Tab2); xLabel->setValidator(Validator); gp->addMultiCellWidget(xLabel, Row,Row,1,2); Row++; gp->addMultiCellWidget( new QLabel(NameY+" "+tr("Label:"), Tab2), Row,Row,0,0); ylLabel = new QLineEdit(Tab2); ylLabel->setValidator(Validator); gp->addMultiCellWidget(ylLabel, Row,Row,1,2); Row++; if((Diag->Name != "Smith") && (Diag->Name != "Polar")) { gp->addMultiCellWidget( new QLabel(NameZ +" "+tr("Label:"), Tab2), Row,Row,0,0); yrLabel = new QLineEdit(Tab2); yrLabel->setValidator(Validator); gp->addMultiCellWidget(yrLabel, Row,Row,1,2); Row++; } gp->addMultiCellWidget(new QLabel( tr("<b>Label text</b>: Use LaTeX style for special characters, e.g. \\tau"), Tab2), Row,Row,0,2); Row++; if(Diag->Name != "Rect3D") { GridOn = new QCheckBox(tr("show Grid"), Tab2); gp->addMultiCellWidget(GridOn, Row,Row,0,2); Row++; GridLabel1 = new QLabel(tr("Grid Color:"),Tab2); gp->addMultiCellWidget(GridLabel1, Row,Row,0,0); GridColorButt = new QPushButton(" ",Tab2); connect(GridColorButt, SIGNAL(clicked()), SLOT(slotSetGridColor())); gp->addMultiCellWidget(GridColorButt, Row,Row,1,2); Row++; GridColorButt->setPaletteBackgroundColor(Diag->GridPen.color()); GridLabel2 = new QLabel(tr("Grid Style: "), Tab2); gp->addMultiCellWidget(GridLabel2, Row,Row,0,0); GridStyleBox = new QComboBox(Tab2); GridStyleBox->insertItem(tr("solid line")); GridStyleBox->insertItem(tr("dash line")); GridStyleBox->insertItem(tr("dot line")); GridStyleBox->insertItem(tr("dash dot line")); GridStyleBox->insertItem(tr("dash dot dot line")); gp->addMultiCellWidget(GridStyleBox, Row,Row,1,2); Row++; GridStyleBox->setCurrentItem(Diag->GridPen.style()-1); GridOn->setChecked(Diag->xAxis.GridOn); if(!Diag->xAxis.GridOn) slotSetGridBox(QButton::Off); connect(GridOn, SIGNAL(stateChanged(int)), SLOT(slotSetGridBox(int))); } else { GridOn = 0; GridColorButt = 0; GridStyleBox = 0; } // ........................................................... xLabel->setText(Diag->xAxis.Label); ylLabel->setText(Diag->yAxis.Label); if(yrLabel) yrLabel->setText(Diag->zAxis.Label); if((Diag->Name.left(4) == "Rect") || (Diag->Name == "Curve")) { GridLogX = new QCheckBox(tr("logarithmical X Axis Grid"), Tab2); gp->addMultiCellWidget(GridLogX, Row,Row,0,2); Row++; GridLogY = new QCheckBox(tr("logarithmical")+" "+NameY+" "+tr("Grid"), Tab2); gp->addMultiCellWidget(GridLogY, Row,Row,0,2); Row++; GridLogZ = new QCheckBox(tr("logarithmical")+" "+NameZ+" "+tr("Grid"), Tab2); gp->addMultiCellWidget(GridLogZ, Row,Row,0,2); Row++; // ........................................................... // transfer the diagram properties to the dialog GridLogX->setChecked(Diag->xAxis.log); GridLogY->setChecked(Diag->yAxis.log); GridLogZ->setChecked(Diag->zAxis.log); if(Diag->Name == "Rect3D") { hideInvisible = new QCheckBox(tr("hide invisible lines"), Tab2); gp->addMultiCellWidget(hideInvisible, Row,Row,0,2); Row++; QLabel *LabelRotX = new QLabel(tr("Rotation around x-Axis:"), Tab2); LabelRotX->setPaletteForegroundColor(Qt::red); gp->addWidget(LabelRotX, Row,0); SliderRotX = new QSlider(0,360,20, ((Rect3DDiagram*)Diag)->rotX, Qt::Horizontal, Tab2); gp->addWidget(SliderRotX, Row,1); connect(SliderRotX, SIGNAL(valueChanged(int)), SLOT(slotNewRotX(int))); rotationX = new QLineEdit(Tab2); rotationX->setValidator(ValInteger); rotationX->setMaxLength(3); rotationX->setMaximumWidth(40); gp->addWidget(rotationX, Row,2); connect(rotationX, SIGNAL(textChanged(const QString&)), SLOT(slotEditRotX(const QString&))); Row++; QLabel *LabelRotY = new QLabel(tr("Rotation around y-Axis:"), Tab2); LabelRotY->setPaletteForegroundColor(Qt::green); gp->addWidget(LabelRotY, Row,0); SliderRotY = new QSlider(0,360,20, ((Rect3DDiagram*)Diag)->rotY, Qt::Horizontal, Tab2); gp->addWidget(SliderRotY, Row,1); connect(SliderRotY, SIGNAL(valueChanged(int)), SLOT(slotNewRotY(int))); rotationY = new QLineEdit(Tab2); rotationY->setValidator(ValInteger); rotationY->setMaxLength(3); rotationY->setMaximumWidth(40); gp->addWidget(rotationY, Row,2); connect(rotationY, SIGNAL(textChanged(const QString&)), SLOT(slotEditRotY(const QString&))); Row++; QLabel *LabelRotZ = new QLabel(tr("Rotation around z-Axis:"), Tab2); LabelRotZ->setPaletteForegroundColor(Qt::blue); gp->addWidget(LabelRotZ, Row,0); SliderRotZ = new QSlider(0,360,20, ((Rect3DDiagram*)Diag)->rotZ, Qt::Horizontal, Tab2); gp->addWidget(SliderRotZ, Row,1); connect(SliderRotZ, SIGNAL(valueChanged(int)), SLOT(slotNewRotZ(int))); rotationZ = new QLineEdit(Tab2); rotationZ->setValidator(ValInteger); rotationZ->setMaxLength(3); rotationZ->setMaximumWidth(40); gp->addWidget(rotationZ, Row,2); connect(rotationZ, SIGNAL(textChanged(const QString&)), SLOT(slotEditRotZ(const QString&))); Row++; gp->addWidget(new QLabel(tr("2D-projection:"), Tab2), Row,0); DiagCross = new Cross3D(((Rect3DDiagram*)Diag)->rotX, ((Rect3DDiagram*)Diag)->rotY, ((Rect3DDiagram*)Diag)->rotZ, Tab2); gp->addWidget(DiagCross, Row,1); // transfer the diagram properties to the dialog hideInvisible->setChecked(Diag->hideLines); rotationX->setText(QString::number(((Rect3DDiagram*)Diag)->rotX)); rotationY->setText(QString::number(((Rect3DDiagram*)Diag)->rotY)); rotationZ->setText(QString::number(((Rect3DDiagram*)Diag)->rotZ)); } } else GridLogX = GridLogY = GridLogZ = 0; t->addTab(Tab2, tr("Properties")); // ........................................................... QVBox *Tab3 = new QVBox(this); Tab1->setSpacing(5); QHGroupBox *axisX = new QHGroupBox(tr("x-Axis"), Tab3); QVBox *VBox1 = new QVBox(axisX); VBox1->setStretchFactor(new QWidget(VBox1),5); // stretchable placeholder manualX = new QCheckBox(tr("manual"), VBox1); connect(manualX, SIGNAL(stateChanged(int)), SLOT(slotManualX(int))); QVBox *VBox2 = new QVBox(axisX); new QLabel(tr("start"), VBox2); startX = new QLineEdit(VBox2); startX->setValidator(ValDouble); QVBox *VBox3 = new QVBox(axisX); new QLabel(tr("step"), VBox3); stepX = new QLineEdit(VBox3); stepX->setValidator(ValDouble); QVBox *VBox4 = new QVBox(axisX); new QLabel(tr("stop"), VBox4); stopX = new QLineEdit(VBox4); stopX->setValidator(ValDouble); QHGroupBox *axisY; axisY = new QHGroupBox(NameY, Tab3); QVBox *VBox5 = new QVBox(axisY); VBox5->setStretchFactor(new QWidget(VBox5),5); // stretchable placeholder manualY = new QCheckBox(tr("manual"), VBox5); connect(manualY, SIGNAL(stateChanged(int)), SLOT(slotManualY(int))); QVBox *VBox6 = new QVBox(axisY); new QLabel(tr("start"), VBox6); startY = new QLineEdit(VBox6); startY->setValidator(ValDouble); QVBox *VBox7 = new QVBox(axisY); if((Diag->Name=="Smith") || (Diag->Name=="ySmith") || (Diag->Name=="PS")) new QLabel(tr("number"), VBox7); else new QLabel(tr("step"), VBox7); stepY = new QLineEdit(VBox7); stepY->setValidator(ValDouble); QVBox *VBox8 = new QVBox(axisY); new QLabel(tr("stop"), VBox8); stopY = new QLineEdit(VBox8); stopY->setValidator(ValDouble); QHGroupBox *axisZ; axisZ = new QHGroupBox(NameZ, Tab3); QVBox *VBox9 = new QVBox(axisZ); VBox9->setStretchFactor(new QWidget(VBox9),5); // stretchable placeholder manualZ = new QCheckBox(tr("manual"), VBox9); connect(manualZ, SIGNAL(stateChanged(int)), SLOT(slotManualZ(int))); QVBox *VBox10 = new QVBox(axisZ); new QLabel(tr("start"), VBox10); startZ = new QLineEdit(VBox10); startZ->setValidator(ValDouble); QVBox *VBox11 = new QVBox(axisZ); if(Diag->Name == "SP") new QLabel(tr("number"), VBox11); else new QLabel(tr("step"), VBox11); stepZ = new QLineEdit(VBox11); stepZ->setValidator(ValDouble); QVBox *VBox12 = new QVBox(axisZ); new QLabel(tr("stop"), VBox12); stopZ = new QLineEdit(VBox12); stopZ->setValidator(ValDouble); Tab3->setStretchFactor(new QWidget(Tab3),5); // stretchable placeholder t->addTab(Tab3, tr("Limits")); // ........................................................... // transfer the diagram properties to the dialog if(Diag->xAxis.autoScale) slotManualX(QButton::Off); else manualX->setChecked(true); if(Diag->yAxis.autoScale) slotManualY(QButton::Off); else manualY->setChecked(true); if(Diag->zAxis.autoScale) slotManualZ(QButton::Off); else manualZ->setChecked(true); Diag->calcLimits(); // inserts auto-scale values if not manual startX->setText(QString::number(Diag->xAxis.limit_min)); stepX->setText(QString::number(Diag->xAxis.step)); stopX->setText(QString::number(Diag->xAxis.limit_max)); startY->setText(QString::number(Diag->yAxis.limit_min)); stepY->setText(QString::number(Diag->yAxis.step)); stopY->setText(QString::number(Diag->yAxis.limit_max)); startZ->setText(QString::number(Diag->zAxis.limit_min)); stepZ->setText(QString::number(Diag->zAxis.step)); stopZ->setText(QString::number(Diag->zAxis.limit_max)); if((Diag->Name == "Smith") || (Diag->Name == "ySmith") || (Diag->Name == "Polar")) { axisZ->setEnabled(false); } if(Diag->Name.left(4) != "Rect") // cartesian 2D and 3D if(Diag->Name != "Curve") { axisX->setEnabled(false); startY->setEnabled(false); startZ->setEnabled(false); } } else stepX = 0; connect(t, SIGNAL(currentChanged(QWidget*)), SLOT(slotChangeTab(QWidget*))); // ........................................................... QHBox *Butts = new QHBox(this); Butts->setSpacing(5); Butts->setMargin(5); all->addWidget(Butts); QPushButton *OkButt = new QPushButton(tr("OK"), Butts); connect(OkButt, SIGNAL(clicked()), SLOT(slotOK())); QPushButton *ApplyButt = new QPushButton(tr("Apply"), Butts); connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply())); QPushButton *CancelButt = new QPushButton(tr("Cancel"), Butts); connect(CancelButt, SIGNAL(clicked()), SLOT(slotCancel())); OkButt->setDefault(true); // ........................................................... // put all data files into ComboBox QFileInfo Info(defaultDataSet); QDir ProjDir(Info.dirPath()); QStringList Elements = ProjDir.entryList("*.dat", QDir::Files, QDir::Name); QStringList::iterator it; for(it = Elements.begin(); it != Elements.end(); ++it) { ChooseData->insertItem((*it).left((*it).length()-4)); if((*it) == Info.fileName()) // default dataset should be the current ChooseData->setCurrentItem(ChooseData->count()-1); } slotReadVars(0); // put variables into the ListView // ........................................................... // put all graphs into the ListBox Row = 0; for(Graph *pg = Diag->Graphs.first(); pg != 0; pg = Diag->Graphs.next()) { GraphList->insertItem(pg->Var); if(pg == currentGraph) { GraphList->setCurrentItem(Row); // select current graph SelectGraph(currentGraph); } Row++; } if(ColorButt) if(!currentGraph) ColorButt->setPaletteBackgroundColor (QColor(DefaultColors[GraphList->count()])); }
GearPropertiesDialog::GearPropertiesDialog(QWidget *parent, Gear *gear, Engine *engine) : QDialog(parent, "Properties", true), _gear(gear), _engine(engine) { setCaption("Properties"); _verticalLayout = new Q3VBoxLayout(this, 12, 12, "layout"); std::vector<Property*> properties; _gear->settings().getAll(&properties); //create all PropertieControls for the gear for (std::vector<Property*>::iterator it=properties.begin(); it!=properties.end(); ++it) addControl((*it)); //ok cancels Q3HBoxLayout *hLayout = new Q3HBoxLayout(2); _okButton = new QPushButton("Ok", this); hLayout->addWidget(_okButton); QObject::connect(_okButton, SIGNAL(clicked()), this, SLOT(slotOK())); _cancelButton = new QPushButton("Cancel", this); QObject::connect(_cancelButton, SIGNAL(clicked()), this, SLOT(accept())); hLayout->addWidget(_cancelButton); _verticalLayout->addLayout(hLayout); }
CharacterEdits::CharacterEdits( TQWidget *parent, const char *name) : KDialogBase( parent, name == 0 ? "CharacterEdits" : name, true, i18n("Specify Characters"), KDialogBase::Ok | KDialogBase::Cancel) { TQWidget* top = new TQWidget( this ); TQVBoxLayout *topLayout = new TQVBoxLayout(top, 6); setMainWidget( top ); negate = new TQCheckBox(i18n("Do not match the characters specified here"), top); topLayout->addWidget( negate ); // The predefined box TQHGroupBox* predefined = new TQHGroupBox(i18n("Predefined Character Ranges"),top); topLayout->addWidget(predefined); TQGrid* grid = new TQGrid(3, predefined ); wordChar = new TQCheckBox(i18n("A word character"),grid); digit = new TQCheckBox(i18n("A digit character"),grid); space = new TQCheckBox(i18n("A space character"), grid); _nonWordChar = new TQCheckBox(i18n("A non-word character"),grid); _nonDigit = new TQCheckBox(i18n("A non-digit character"),grid); _nonSpace = new TQCheckBox(i18n("A non-space character"), grid); // Single characters TQVGroupBox* singleBox = new TQVGroupBox(i18n("Single Characters"), top ); topLayout->addWidget( singleBox ); _single = new KMultiFormListBox(new SingleFactory(), KMultiFormListBox::MultiVisible, singleBox); _single->addElement(); _single->addElement(); _single->addElement(); TQWidget* moreW = new TQWidget( singleBox ); TQHBoxLayout* moreLay = new TQHBoxLayout( moreW ); TQPushButton* more = new TQPushButton( i18n("More Entries"), moreW ); moreLay->addWidget( more ); moreLay->addStretch( 1 ); connect(more,TQT_SIGNAL(clicked()), _single, TQT_SLOT(addElement())); // Ranges TQVGroupBox* rangeBox = new TQVGroupBox(i18n("Character Ranges"), top ); topLayout->addWidget( rangeBox ); _range = new KMultiFormListBox(new RangeFactory(), KMultiFormListBox::MultiVisible, rangeBox); _range->addElement(); _range->addElement(); _range->addElement(); moreW = new TQWidget( rangeBox ); moreLay = new TQHBoxLayout( moreW ); more = new TQPushButton( i18n("More Entries"), moreW ); moreLay->addWidget( more ); moreLay->addStretch( 1 ); connect(more,TQT_SIGNAL(clicked()), _range, TQT_SLOT(addElement())); // Buttons connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotOK())); }
KLProjectConfigWidget::KLProjectConfigWidget(KLProject* project, QWidget *parent, const char *name) :QDialog(parent, name), m_validator(QRegExp("0x[0-9a-fA-F]{1,4}"), this, "reValidator"), ui(new Ui_KLProjectConfigWidgetBase) { ui->setupUi(this); m_project = project; m_projectManagerInConfigWidget = new KLProjectManagerWidget( project, ui->tab_common, "managerInConfig" ); m_projectManagerInConfigWidget->setConfigButtonVisible( false ); ui->layProjectManager->addWidget( m_projectManagerInConfigWidget ); ui->cbCPU->clear(); // Add all the CPUs: ui->cbCPU->insertStringList( project->cpus() ); // Update the project files list: project->update(); // Add linker flags columns ui->lvLinkerFlags->addColumn(i18n("Purpose")); ui->lvLinkerFlags->addColumn(i18n("Flags")); // Fill the linker flags list: m_possibleLinkerFlags["-Wl,-lm"] = i18n("Link with math library"); m_possibleLinkerFlags["-Wl,-lprintf"] = i18n("Link with printf library"); m_possibleLinkerFlags["-Wl,-lprintf_min"] = i18n("Link with printf_min library"); m_possibleLinkerFlags["-Wl,-u,vfprintf -Wl,-lprintf_flt"] = i18n("Link with floating point printf library"); QStringList keys = m_possibleLinkerFlags.keys(); keys.sort(); for ( QStringList::iterator it = keys.begin(); it != keys.end(); ++it ) { Q3CheckListItem* cur = new Q3CheckListItem( ui->lvLinkerFlags, m_possibleLinkerFlags[*it], Q3CheckListItem::CheckBox ); cur->setText( 1, *it ); m_linkerFlagsCBs.append( cur ); } updateGUIFromSettings(); updateCPUInfo( ui->cbCPU->currentText() ); connect(ui->cbCPU,SIGNAL(currentIndexChanged(QString)),this,SLOT(slotCPUChanged(QString))); connect(ui->pbOK,SIGNAL(clicked()),this,SLOT(slotOK())); connect(ui->pbCancel,SIGNAL(clicked()),this,SLOT(slotCancel())); connect(ui->pbSetDefault,SIGNAL(clicked()),this,SLOT(slotSetDefault())); //Setup spinboxes with hex-in and output ui->kisbStartOfText->setValidator(&m_validator); ui->kisbStartOfText->setBase(16); ui->kisbStartOfData->setValidator(&m_validator); ui->kisbStartOfData->setBase(16); ui->kisbStartOfBSS->setValidator(&m_validator); ui->kisbStartOfBSS->setBase(16); ui->kisbStartOfHeap->setValidator(&m_validator); ui->kisbStartOfHeap->setBase(16); ui->kisbEndOfHeap->setValidator(&m_validator); ui->kisbEndOfHeap->setBase(16); }
void UimPrefDialog::createMainWidgets() { QVBoxLayout *mainVLayout = new QVBoxLayout( this ); mainVLayout->setMargin( 6 ); QSplitter *mainSplitter = new QSplitter( this ); /* ListView */ m_groupListView = new QTreeWidget( mainSplitter ); m_groupListView->setRootIsDecorated( false ); m_groupListView->setHeaderLabel( _("Group") ); m_groupListView->setSelectionMode( QAbstractItemView::SingleSelection ); connect( m_groupListView, SIGNAL(itemSelectionChanged()), this, SLOT(slotItemSelectionChanged()) ); /* Contents Frame */ m_rightSideWidget = new QScrollArea( mainSplitter ); m_rightSideWidget->setWidgetResizable( true ); m_groupWidgetStack = new QStackedWidget; /* Buttons */ QWidget *buttonHWidget = new QWidget( this ); buttonHWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed); QHBoxLayout *buttonHLayout = new QHBoxLayout( buttonHWidget ); buttonHLayout->setMargin( 6 ); buttonHLayout->setSpacing( 6 ); QPushButton *defaultButton = new QPushButton( _("Defaults"), buttonHWidget ); connect( defaultButton, SIGNAL(clicked()), this, SLOT(slotSetDefault()) ); QPushButton *okButton = new QPushButton( _("OK"), buttonHWidget ); connect( okButton, SIGNAL(clicked()), this, SLOT(slotOK()) ); m_applyButton = new QPushButton( _("Apply"), buttonHWidget ); m_applyButton->setEnabled( false ); connect( m_applyButton, SIGNAL(clicked()), this, SLOT(slotApply()) ); QPushButton *cancelButton = new QPushButton( _("Cancel"), buttonHWidget ); connect( cancelButton, SIGNAL(clicked()), this, SLOT(slotCancel()) ); buttonHLayout->addWidget( defaultButton ); buttonHLayout->addStretch(); buttonHLayout->addWidget( okButton ); buttonHLayout->addWidget( m_applyButton ); buttonHLayout->addWidget( cancelButton ); QFrame *separator = new QFrame( this ); separator->setFrameShape( QFrame::HLine ); separator->setFrameShadow( QFrame::Sunken ); mainVLayout->setMargin( 0 ); mainVLayout->addWidget( mainSplitter ); mainVLayout->addWidget( separator ); mainVLayout->addWidget( buttonHWidget ); mainSplitter->setStretchFactor( 1, 1 ); }
GuiCompareHistory::GuiCompareHistory(GuiView & lv) : GuiDialog(lv, "comparehistory", qt_("Compare different revisions")) { setupUi(this); setModal(Qt::WindowModal); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(cancelPB, SIGNAL(clicked()), this, SLOT(slotCancel())); connect(revbackRB, SIGNAL(clicked()), this, SLOT(selectRevback())); connect(betweenrevRB, SIGNAL(clicked()), this, SLOT(selectBetweenrev())); }
GuiPhantom::GuiPhantom(GuiView & lv) : GuiDialog(lv, "phantom", qt_("Phantom Settings")) { setupUi(this); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); connect(phantomRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(hphantomRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(vphantomRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); bc().setOK(okPB); bc().setCancel(closePB); }
GuiNomenclature::GuiNomenclature(GuiView & lv) : GuiDialog(lv, "nomenclature", qt_("Nomenclature")), params_(insetCode("nomenclature")) { setupUi(this); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); connect(symbolED, SIGNAL(textChanged(QString)), this, SLOT(change_adaptor())); connect(descriptionTE, SIGNAL(textChanged()), this, SLOT(change_adaptor())); setFocusProxy(descriptionTE); bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); bc().setOK(okPB); bc().setCancel(closePB); bc().addReadOnly(symbolED); bc().addReadOnly(descriptionTE); bc().addReadOnly(prefixED); }
int detailset::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: showtop((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: showcpu((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: showmem((*reinterpret_cast< int(*)>(_a[1]))); break; case 3: slotshowtop((*reinterpret_cast< int(*)>(_a[1]))); break; case 4: slotshowcpu((*reinterpret_cast< int(*)>(_a[1]))); break; case 5: slotshowmem((*reinterpret_cast< int(*)>(_a[1]))); break; case 6: slotOK(); break; case 7: slotAbout(); break; case 8: slotQuit(); break; default: ; } _id -= 9; } return _id; }
GuiPrintNomencl::GuiPrintNomencl(GuiView & lv) : GuiDialog(lv, "nomencl_print", qt_("Nomenclature settings")), params_(insetCode("nomencl_print")) { setupUi(this); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); connect(valueLE, SIGNAL(textChanged(QString)), this, SLOT(change_adaptor())); connect(unitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)), this, SLOT(change_adaptor())); valueLE->setValidator(unsignedLengthValidator(valueLE)); // Manage the ok, apply, restore and cancel/close buttons bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy); bc().setOK(okPB); bc().setApply(applyPB); bc().setCancel(closePB); // disable for read-only documents bc().addReadOnly(valueLE); bc().addReadOnly(unitLC); // initialize the length validator bc().addCheckedLineEdit(valueLE, valueLA); setWidthCO->addItem(qt_("Default"), QVariant(toqstr("none"))); setWidthCO->addItem(qt_("Longest label width"), QVariant(toqstr("auto"))); setWidthCO->addItem(qt_("Custom"), QVariant(toqstr("custom"))); }
OptimizeDialog::OptimizeDialog(Optimize_Sim *c_, Schematic *d_) : QDialog(d_, 0, TRUE, Qt::WDestructiveClose) { Comp = c_; Doc = d_; changed = false; setCaption(tr("Edit Optimization Properties")); Expr.setPattern("[\\w_]+"); Validator = new QRegExpValidator(Expr, this); numVal = new QDoubleValidator(this); intVal = new QIntValidator(this); all = new Q3VBoxLayout(this); // to provide the neccessary size QTabWidget *t = new QTabWidget(this); all->addWidget(t); // ........................................................... QWidget *Tab1 = new QWidget(t); Q3GridLayout *gp1 = new Q3GridLayout(Tab1,3,2,3,3); gp1->addWidget(new QLabel(tr("Name:"), Tab1), 0,0); NameEdit = new QLineEdit(Tab1); NameEdit->setValidator(Validator); gp1->addWidget(NameEdit,0,1); gp1->addWidget(new QLabel(tr("Simulation:"), Tab1), 1,0); SimEdit = new QComboBox(Tab1); SimEdit->setEditable(true); gp1->addWidget(SimEdit,1,1); t->addTab(Tab1, tr("General")); // ........................................................... QWidget *Tab4 = new QWidget(t); Q3GridLayout *gp4 = new Q3GridLayout(Tab4,11,2,3,3); gp4->addWidget(new QLabel(tr("Method:"), Tab4), 0,0); MethodCombo = new QComboBox(Tab4); MethodCombo->insertItem("DE/best/1/exp"); MethodCombo->insertItem("DE/rand/1/exp"); MethodCombo->insertItem("DE/rand-to-best/1/exp"); MethodCombo->insertItem("DE/best/2/exp"); MethodCombo->insertItem("DE/rand/1/exp"); MethodCombo->insertItem("DE/best/1/bin"); MethodCombo->insertItem("DE/rand/1/bin"); MethodCombo->insertItem("DE/rand-to-best/1/bin"); MethodCombo->insertItem("DE/best/2/bin"); MethodCombo->insertItem("DE/rand/2/bin"); gp4->addWidget(MethodCombo,0,1); gp4->addWidget(new QLabel(tr("Maximum number of iterations:"), Tab4), 1,0); IterEdit = new QLineEdit(Tab4); IterEdit->setValidator(intVal); gp4->addWidget(IterEdit,1,1); gp4->addWidget(new QLabel(tr("Output refresh cycle:"), Tab4), 2,0); RefreshEdit = new QLineEdit(Tab4); RefreshEdit->setValidator(intVal); gp4->addWidget(RefreshEdit,2,1); gp4->addWidget(new QLabel(tr("Number of parents:"), Tab4), 3,0); ParentsEdit = new QLineEdit(Tab4); ParentsEdit->setValidator(intVal); gp4->addWidget(ParentsEdit,3,1); gp4->addWidget(new QLabel(tr("Constant F:"), Tab4), 4,0); ConstEdit = new QLineEdit(Tab4); ConstEdit->setValidator(new QDoubleValidator(0.0,2.0,20,ConstEdit)); gp4->addWidget(ConstEdit,4,1); gp4->addWidget(new QLabel(tr("Crossing over factor:"), Tab4), 5,0); CrossEdit = new QLineEdit(Tab4); CrossEdit->setValidator(new QDoubleValidator(0.0,1.0,20,CrossEdit)); gp4->addWidget(CrossEdit,5,1); gp4->addWidget(new QLabel(tr("Pseudo random number seed:"), Tab4), 6,0); SeedEdit = new QLineEdit(Tab4); SeedEdit->setValidator(numVal); gp4->addWidget(SeedEdit,6,1); gp4->addWidget(new QLabel(tr("Minimum cost variance:"), Tab4), 7,0); CostVarEdit = new QLineEdit(Tab4); CostVarEdit->setValidator(numVal); gp4->addWidget(CostVarEdit,7,1); gp4->addWidget(new QLabel(tr("Cost objectives:"), Tab4), 8,0); CostObjEdit = new QLineEdit(Tab4); CostObjEdit->setValidator(numVal); gp4->addWidget(CostObjEdit,8,1); gp4->addWidget(new QLabel(tr("Cost constraints:"), Tab4), 9,0); CostConEdit = new QLineEdit(Tab4); CostConEdit->setValidator(numVal); gp4->addWidget(CostConEdit,9,1); t->addTab(Tab4, tr("Algorithm")); // ........................................................... QWidget *Tab2 = new QWidget(t); Q3GridLayout *gp2 = new Q3GridLayout(Tab2,5,3,3,3); VarList = new Q3ListView(Tab2); VarList->addColumn(tr("Name")); VarList->addColumn(tr("active")); VarList->addColumn(tr("initial")); VarList->addColumn(tr("min")); VarList->addColumn(tr("max")); VarList->addColumn(tr("Type")); VarList->setSorting(-1); // no sorting gp2->addMultiCellWidget(VarList,0,0,0,2); connect(VarList, SIGNAL(selectionChanged(Q3ListViewItem*)), SLOT(slotEditVariable(Q3ListViewItem*))); Q3HBox *VarLine = new Q3HBox(Tab2); VarLine->setSpacing(3); gp2->addMultiCellWidget(VarLine, 1,1,0,2); new QLabel(tr("Name:"), VarLine); VarNameEdit = new QLineEdit(VarLine); VarNameEdit->setValidator(Validator); connect(VarNameEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChangeVarName(const QString&))); VarActiveCheck = new QCheckBox(tr("active"), VarLine); VarActiveCheck->setChecked(true); connect(VarActiveCheck, SIGNAL(toggled(bool)), SLOT(slotChangeVarActive(bool))); gp2->addWidget(new QLabel(tr("initial:"), Tab2), 2,0); gp2->addWidget(new QLabel(tr("min:"), Tab2), 2,1); gp2->addWidget(new QLabel(tr("max:"), Tab2), 2,2); VarInitEdit = new QLineEdit(Tab2); VarInitEdit->setValidator(numVal); gp2->addWidget(VarInitEdit,3,0); connect(VarInitEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChangeVarInit(const QString&))); VarMinEdit = new QLineEdit(Tab2); VarMinEdit->setValidator(numVal); gp2->addWidget(VarMinEdit,3,1); connect(VarMinEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChangeVarMin(const QString&))); VarMaxEdit = new QLineEdit(Tab2); VarMaxEdit->setValidator(numVal); gp2->addWidget(VarMaxEdit,3,2); connect(VarMaxEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChangeVarMax(const QString&))); Q3HBox *VarButtons = new Q3HBox(Tab2); VarButtons->setSpacing(3); gp2->addMultiCellWidget(VarButtons, 4,4,0,2); new QLabel(tr("Type:"), VarButtons); VarTypeCombo = new QComboBox(VarButtons); VarTypeCombo->insertItem(tr("linear double")); VarTypeCombo->insertItem(tr("logarithmic double")); VarTypeCombo->insertItem(tr("linear integer")); VarTypeCombo->insertItem(tr("logarithmic integer")); connect(VarTypeCombo, SIGNAL(activated(const QString&)), SLOT(slotChangeVarType(const QString&))); VarButtons->setStretchFactor(new QWidget(VarButtons), 10); QPushButton *AddVar_Butt = new QPushButton(tr("Add"), VarButtons); connect(AddVar_Butt, SIGNAL(clicked()), SLOT(slotAddVariable())); QPushButton *DelVar_Butt = new QPushButton(tr("Delete"), VarButtons); connect(DelVar_Butt, SIGNAL(clicked()), SLOT(slotDeleteVariable())); t->addTab(Tab2, tr("Variables")); // ........................................................... QWidget *Tab3 = new QWidget(t); Q3GridLayout *gp3 = new Q3GridLayout(Tab3,4,3,3,3); GoalList = new Q3ListView(Tab3); GoalList->addColumn(tr("Name")); GoalList->addColumn(tr("Type")); GoalList->addColumn(tr("Value")); GoalList->setSorting(-1); // no sorting gp3->addMultiCellWidget(GoalList,0,0,0,2); connect(GoalList, SIGNAL(selectionChanged(Q3ListViewItem*)), SLOT(slotEditGoal(Q3ListViewItem*))); gp3->addWidget(new QLabel(tr("Name:"), Tab3), 1,0); GoalNameEdit = new QLineEdit(Tab3); GoalNameEdit->setValidator(Validator); gp3->addWidget(GoalNameEdit,1,1); connect(GoalNameEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChangeGoalName(const QString&))); gp3->addWidget(new QLabel(tr("Value:"), Tab3), 2,0); GoalNumEdit = new QLineEdit(Tab3); GoalNumEdit->setValidator(numVal); gp3->addWidget(GoalNumEdit,2,1); connect(GoalNumEdit, SIGNAL(textChanged(const QString&)), SLOT(slotChangeGoalNum(const QString&))); GoalTypeCombo = new QComboBox(Tab3); GoalTypeCombo->insertItem(tr("minimize")); GoalTypeCombo->insertItem(tr("maximize")); GoalTypeCombo->insertItem(tr("less")); GoalTypeCombo->insertItem(tr("greater")); GoalTypeCombo->insertItem(tr("equal")); GoalTypeCombo->insertItem(tr("monitor")); gp3->addWidget(GoalTypeCombo,2,2); connect(GoalTypeCombo, SIGNAL(activated(const QString&)), SLOT(slotChangeGoalType(const QString&))); Q3HBox *GoalButtons = new Q3HBox(Tab3); GoalButtons->setSpacing(3); gp3->addMultiCellWidget(GoalButtons, 3,3,0,2); GoalButtons->setStretchFactor(new QWidget(GoalButtons),5); QPushButton *AddGoal_Butt = new QPushButton(tr("Add"), GoalButtons); connect(AddGoal_Butt, SIGNAL(clicked()), SLOT(slotAddGoal())); QPushButton *DelGoal_Butt = new QPushButton(tr("Delete"), GoalButtons); connect(DelGoal_Butt, SIGNAL(clicked()), SLOT(slotDeleteGoal())); t->addTab(Tab3, tr("Goals")); // ........................................................... // buttons on the bottom of the dialog (independent of the TabWidget) Q3HBox *Butts = new Q3HBox(this); Butts->setSpacing(3); Butts->setMargin(3); all->addWidget(Butts); QPushButton *OkButt = new QPushButton(tr("OK"), Butts); connect(OkButt, SIGNAL(clicked()), SLOT(slotOK())); QPushButton *ApplyButt = new QPushButton(tr("Apply"), Butts); connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply())); QPushButton *CancelButt = new QPushButton(tr("Cancel"), Butts); connect(CancelButt, SIGNAL(clicked()), SLOT(slotCancel())); OkButt->setFocus(); // ........................................................... Component *pc; for(pc=Doc->Components->first(); pc!=0; pc=Doc->Components->next()) if(pc != Comp) if(pc->Model[0] == '.' && pc->Model != ".Opt") SimEdit->insertItem(pc->Name); Property *pp; pp = Comp->Props.at(0); if(!pp->Value.isEmpty()) SimEdit->setCurrentText(pp->Value); pp = Comp->Props.at(1); if(!pp->Value.isEmpty()) { MethodCombo->setCurrentItem(pp->Value.section('|',0,0).toInt()-1); IterEdit->setText(pp->Value.section('|',1,1)); RefreshEdit->setText(pp->Value.section('|',2,2)); ParentsEdit->setText(pp->Value.section('|',3,3)); ConstEdit->setText(pp->Value.section('|',4,4)); CrossEdit->setText(pp->Value.section('|',5,5)); SeedEdit->setText(pp->Value.section('|',6,6)); CostVarEdit->setText(pp->Value.section('|',7,7)); CostObjEdit->setText(pp->Value.section('|',8,8)); CostConEdit->setText(pp->Value.section('|',9,9)); } NameEdit->setText(Comp->Name); for(pp = Comp->Props.at(2); pp != 0; pp = Comp->Props.next()) { if(pp->Name == "Var") { new Q3ListViewItem(VarList, pp->Value.section('|',0,0), pp->Value.section('|',1,1) == "yes" ? tr("yes") : tr("no"), pp->Value.section('|',2,2), pp->Value.section('|',3,3), pp->Value.section('|',4,4), ((pp->Value.section('|',5,5)=="LIN_DOUBLE")?tr("linear double") : ((pp->Value.section('|',5,5)=="LOG_DOUBLE")?tr("logarithmic double") : ((pp->Value.section('|',5,5)=="LIN_INT")?tr("linear integer") : tr("logarithmic integer"))))); } if(pp->Name == "Goal") { new Q3ListViewItem(GoalList, pp->Value.section('|',0,0), ((pp->Value.section('|',1,1) == "MIN") ? tr("minimize") : ((pp->Value.section('|',1,1) == "MAX") ? tr("maximize") : ((pp->Value.section('|',1,1) == "LE") ? tr("less") : ((pp->Value.section('|',1,1) == "GE") ? tr("greater") : ((pp->Value.section('|',1,1) == "EQ") ? tr("equal") : tr("monitor")))))), pp->Value.section('|',2,2)); } } resize(300, 250); }
BackupDlg::BackupDlg( const QString & archiveName, const QString & workingDir, const QStringList& files, bool oneFilesystem, bool incremental, const QString & snapshot, bool removeSnapshot, int archiveSize, Tape* tape, QWidget* parent, const char* name ) : QDialog( parent, name, TRUE ), _proc( NULL ), _tarParser( NULL ), _archiveName( archiveName ), _workingDir( workingDir ), _files(files), _oneFilesystem( oneFilesystem ), _incremental( incremental ), _snapshot( snapshot ), _removeSnapshot( removeSnapshot ), _archiveSize( archiveSize ), _tape( tape ), _totalKBytes( 0.0 ), _totalRecords( 0 ), _startTime( 0 ), _archive( NULL ), _aborted( FALSE ), _numFiles( 0 ), _fileSize( -1 ), _fileMTime( -1 ), _fileStartRecord( -1 ) { // Copy the list of files to archive. setCaption( i18n( "KDat: Backup" ) ); setIconText( i18n( "KDat: Backup" ) ); resize( 515, 300 ); /* 2002-01-26 LEW: "Time remaining" was cut off in mid-"g" so we'll provide that plus some space beyond it. */ // const int labelWidth = 96; const int labelWidth = 110; QFrame* f1 = new QFrame( this ); f1->setFrameStyle( QFrame::Panel | QFrame::Sunken ); QFrame* f2 = new QFrame( this ); f2->setFrameStyle( QFrame::Panel | QFrame::Sunken ); QLabel* lbl1 = new QLabel( i18n( "Elapsed time:" ), f1 ); lbl1->setFixedSize( labelWidth, lbl1->sizeHint().height() ); _elapsedTime = new QLabel( i18n( "00:00:00" ), f1 ); _elapsedTime->setFixedHeight( _elapsedTime->sizeHint().height() ); QLabel* lbl2 = new QLabel( i18n( "Time remaining:" ), f2 ); lbl2->setFixedSize( labelWidth, lbl2->sizeHint().height() ); _timeRemaining = new QLabel( i18n( "00:00:00" ), f2 ); _timeRemaining->setFixedHeight( _timeRemaining->sizeHint().height() ); QLabel* lbl3 = new QLabel( i18n( "Total KB:" ), f1 ); lbl3->setFixedSize( labelWidth, lbl3->sizeHint().height() ); QLabel* totalKbytes = new QLabel( Util::kbytesToString( archiveSize ), f1 ); totalKbytes->setFixedHeight( totalKbytes->sizeHint().height() ); QLabel* lbl4 = new QLabel( i18n( "KB written:" ), f2 ); lbl4->setFixedSize( labelWidth, lbl4->sizeHint().height() ); _kbytesWritten = new QLabel( i18n( "0KB" ), f2 ); _kbytesWritten->setFixedHeight( _kbytesWritten->sizeHint().height() ); QLabel* lbl5 = new QLabel( i18n( "Transfer rate:" ), f1 ); lbl5->setFixedSize( labelWidth, lbl5->sizeHint().height() ); _transferRate = new QLabel( i18n( "0KB/min" ), f1 ); _transferRate->setFixedHeight( _transferRate->sizeHint().height() ); QLabel* lbl6 = new QLabel( i18n( "Files:" ), f2 ); lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() ); _fileCount = new QLabel( i18n( "0" ), f2 ); _fileCount->setFixedHeight( _fileCount->sizeHint().height() ); _log = new LoggerWidget( i18n( "Backup log:" ), this ); _ok = new KPushButton( KStdGuiItem::ok(), this ); _ok->setFixedSize( 80, _ok->sizeHint().height() ); connect( _ok, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); _ok->setEnabled( FALSE ); _save = new QPushButton( i18n( "Save Log..." ), this ); _save->setFixedSize( 80, _save->sizeHint().height() ); connect( _save, SIGNAL( clicked() ), _log, SLOT( save() ) ); _save->setEnabled( FALSE ); _abort = new KPushButton( KStdGuiItem::cancel(), this ); _abort->setFixedSize( 80, _abort->sizeHint().height() ); connect( _abort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) ); QVBoxLayout* l1 = new QVBoxLayout( this, 8, 4 ); QHBoxLayout* l1_1 = new QHBoxLayout(); l1->addLayout( l1_1 ); l1_1->addStrut( 3 * lbl1->height() + 16 ); l1_1->addWidget( f1 ); l1_1->addWidget( f2 ); QVBoxLayout* l1_1_1 = new QVBoxLayout( f1, 4, 4 ); QHBoxLayout* l1_1_1_1 = new QHBoxLayout(); l1_1_1->addLayout( l1_1_1_1 ); l1_1_1_1->addWidget( lbl1 ); l1_1_1_1->addWidget( _elapsedTime, 1 ); QHBoxLayout* l1_1_1_2 = new QHBoxLayout(); l1_1_1->addLayout( l1_1_1_2 ); l1_1_1_2->addWidget( lbl3 ); l1_1_1_2->addWidget( totalKbytes, 1 ); QHBoxLayout* l1_1_1_3 = new QHBoxLayout(); l1_1_1->addLayout( l1_1_1_3 ); l1_1_1_3->addWidget( lbl5 ); l1_1_1_3->addWidget( _transferRate, 1 ); QVBoxLayout* l1_1_2 = new QVBoxLayout( f2, 4, 4 ); QHBoxLayout* l1_1_2_1 = new QHBoxLayout(); l1_1_2->addLayout( l1_1_2_1 ); l1_1_2_1->addWidget( lbl2 ); l1_1_2_1->addWidget( _timeRemaining, 1 ); QHBoxLayout* l1_1_2_2 = new QHBoxLayout(); l1_1_2->addLayout( l1_1_2_2 ); l1_1_2_2->addWidget( lbl4 ); l1_1_2_2->addWidget( _kbytesWritten, 1 ); QHBoxLayout* l1_1_2_3 = new QHBoxLayout(); l1_1_2->addLayout( l1_1_2_3 ); l1_1_2_3->addWidget( lbl6 ); l1_1_2_3->addWidget( _fileCount, 1 ); l1->addWidget( _log, 1 ); QHBoxLayout* l1_2 = new QHBoxLayout(); l1->addLayout( l1_2 ); l1_2->addStretch( 1 ); l1_2->addWidget( _ok ); l1_2->addWidget( _save ); l1_2->addWidget( _abort ); }
SettingsDialog::SettingsDialog(Schematic *Doc_) : QDialog(Doc_) //, 0, TRUE, Qt::WDestructiveClose) { Doc = Doc_; setWindowTitle(tr("Edit File Properties")); all = new QVBoxLayout(this); QTabWidget *t = new QTabWidget(); all->addWidget(t); // ........................................................... QWidget *Tab1 = new QWidget(t); QGridLayout *gp = new QGridLayout(Tab1); Tab1->setLayout(gp); QLabel *l2 = new QLabel(tr("Data Set:"), Tab1); gp->addWidget(l2,0,0); Input_DataSet = new QLineEdit(Tab1); gp->addWidget(Input_DataSet,0,1,1,1); QLabel *l1 = new QLabel(tr("Data Display:")); gp->addWidget(l1,1,0); Input_DataDisplay = new QLineEdit(Tab1); gp->addWidget(Input_DataDisplay,1,1,1,1); Check_OpenDpl = new QCheckBox(tr("open data display after simulation"), Tab1); gp->addWidget(Check_OpenDpl,2,0,1,2); QLabel *l20 = new QLabel(tr("Octave Script:"), Tab1); gp->addWidget(l20,3,0); Input_Script = new QLineEdit(Tab1); gp->addWidget(Input_Script,3,1,1,1); Check_RunScript = new QCheckBox(tr("run script after simulation"), Tab1); gp->addWidget(Check_RunScript,4,0,1,2); t->addTab(Tab1, tr("Simulation")); // ........................................................... QWidget *Tab2 = new QWidget(t); QGridLayout *gp2 = new QGridLayout(Tab2); Check_GridOn = new QCheckBox(tr("show Grid"), Tab2); gp2->addWidget(Check_GridOn,0,0,1,1); valExpr = new QRegExpValidator(QRegExp("[1-9]\\d{0,2}"), this); QLabel *l3 = new QLabel(tr("horizontal Grid:"), Tab2); gp2->addWidget(l3,1,0); Input_GridX = new QLineEdit(Tab2); Input_GridX->setValidator(valExpr); gp2->addWidget(Input_GridX,1,1,1,1); QLabel *l4 = new QLabel(tr("vertical Grid:"), Tab2); gp2->addWidget(l4,2,0); Input_GridY = new QLineEdit(Tab2); Input_GridY->setValidator(valExpr); gp2->addWidget(Input_GridY,2,1,1,1); t->addTab(Tab2, tr("Grid")); // ........................................................... QWidget *Tab3 = new QWidget(t); QGridLayout *gp3 = new QGridLayout(Tab3); Combo_Frame = new QComboBox(Tab3); Combo_Frame->insertItem(tr("no Frame")); Combo_Frame->insertItem(tr("DIN A5 landscape")); Combo_Frame->insertItem(tr("DIN A5 portrait")); Combo_Frame->insertItem(tr("DIN A4 landscape")); Combo_Frame->insertItem(tr("DIN A4 portrait")); Combo_Frame->insertItem(tr("DIN A3 landscape")); Combo_Frame->insertItem(tr("DIN A3 portrait")); Combo_Frame->insertItem(tr("Letter landscape")); Combo_Frame->insertItem(tr("Letter portrait")); gp3->addWidget(Combo_Frame,0,0,1,2); Input_Frame0 = new QTextEdit(Tab3); Input_Frame0->setTextFormat(Qt::PlainText); Input_Frame0->setWordWrapMode(QTextOption::NoWrap); gp3->addWidget(Input_Frame0,1,0,2,2); Input_Frame1 = new QLineEdit(Tab3); gp3->addWidget(Input_Frame1,3,0,1,2); Input_Frame2 = new QLineEdit(Tab3); gp3->addWidget(Input_Frame2,4,0); Input_Frame3 = new QLineEdit(Tab3); gp3->addWidget(Input_Frame3,4,1); t->addTab(Tab3, tr("Frame")); // ........................................................... // buttons on the bottom of the dialog (independent of the TabWidget) QHBoxLayout *Butts = new QHBoxLayout(); Butts->setSpacing(5); Butts->setMargin(5); all->addLayout(Butts); QPushButton *OkButt = new QPushButton(tr("OK")); Butts->addWidget(OkButt); connect(OkButt, SIGNAL(clicked()), SLOT(slotOK())); QPushButton *ApplyButt = new QPushButton(tr("Apply")); Butts->addWidget(ApplyButt); connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply())); QPushButton *CancelButt = new QPushButton(tr("Cancel")); Butts->addWidget(CancelButt); connect(CancelButt, SIGNAL(clicked()), SLOT(reject())); OkButt->setDefault(true); // ........................................................... // fill the fields with the QucsDoc-Properties Input_DataSet->setText(Doc->DataSet); Input_DataDisplay->setText(Doc->DataDisplay); Input_Script->setText(Doc->Script); Check_OpenDpl->setChecked(Doc->SimOpenDpl); Check_RunScript->setChecked(Doc->SimRunScript); Check_GridOn->setChecked(Doc->GridOn); Input_GridX->setText(QString::number(Doc->GridX)); Input_GridY->setText(QString::number(Doc->GridY)); Combo_Frame->setCurrentItem(Doc->showFrame); QString Text_; decode_String(Text_ = Doc->Frame_Text0); Input_Frame0->setText(Text_); decode_String(Text_ = Doc->Frame_Text1); Input_Frame1->setText(Text_); decode_String(Text_ = Doc->Frame_Text2); Input_Frame2->setText(Text_); decode_String(Text_ = Doc->Frame_Text3); Input_Frame3->setText(Text_); resize(250, 200); }
EditMessageDialog::EditMessageDialog(AlcatelContactList *cont, QWidget *parent, const char *name ) : KDialog(parent,name, true) { contacts = cont; QLabel *label; QFrame *line; reread = false; resize(450, 280 ); setCaption( i18n( "New message" ) ); QGridLayout *mainLayout = new QGridLayout( this ); mainLayout->setSpacing( 6 ); mainLayout->setMargin( 8 ); label = new QLabel( i18n("<b>New message</b>"), this ); mainLayout->addMultiCellWidget(label,0,0,0,4); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,1,1,0,4); mainLayout->setRowStretch(0, -1); mainLayout->setRowStretch(1, -1); sendCheck = new QCheckBox(i18n("Send message"), this); sendCheck->setChecked(true); mainLayout->addMultiCellWidget(sendCheck,2,2,0,1); QWhatsThis::add(sendCheck ,i18n("<b>Send message</b><br>When checked message will be sent as you press OK button.")); writeCheck = new QCheckBox(i18n("Store to mobile as"), this); writeCheck->setChecked(true); mainLayout->addMultiCellWidget(writeCheck,2,2,2,3); QWhatsThis::add(writeCheck ,i18n("<b>Store to mobile</b><br>When checked, message will be written to mobile (SIM) as sent or unsent just as you press OK button.")); typeCombo = new QComboBox(this); typeCombo->insertItem(i18n("Sent")); typeCombo->insertItem(i18n("Unsent")); mainLayout->addWidget(typeCombo, 2,4); QWhatsThis::add( typeCombo,i18n("<b>Type of message</b><br>Which will be type of message stored in mobile?")); connect( sendCheck, SIGNAL( toggled(bool) ), this, SLOT( slotSendChanged(bool) ) ); connect( writeCheck, SIGNAL( toggled(bool) ), this, SLOT( slotWriteChanged(bool) ) ); label = new QLabel( i18n("Send to:"), this ); mainLayout->addWidget(label, 3,0); sendToCombo = new KComboBox(true, this); sendToCombo->setValidator(new PhoneNumberValidator(false, true, sendToCombo)); mainLayout->addMultiCellWidget(sendToCombo,3,3,1,3); QWhatsThis::add(sendToCombo ,i18n("<b>Send to number(s)</b><br>Enter here number(s) of receivers of this message, more numbers should be separated with space, comma or semicolon.")); QPushButton *buttonContacts = new QPushButton(i18n("Contacts..."), this); connect ( buttonContacts, SIGNAL( clicked() ), this, SLOT(selectContacts())); mainLayout->addWidget(buttonContacts,3,4); QWhatsThis::add(buttonContacts ,i18n("<b>Contacts</b><br>Use this button to add number from your contacts.")); messageEdit = new QTextEdit(this); messageEdit->setTextFormat(Qt::PlainText); messageEdit->setWordWrap(QTextEdit::WidgetWidth); mainLayout->addMultiCellWidget(messageEdit,4,4,0,4); connect( messageEdit, SIGNAL( textChanged() ), this, SLOT( slotTextChanged() ) ); connect( messageEdit, SIGNAL( returnPressed() ), this, SLOT( slotOK() ) ); QWhatsThis::add( messageEdit,i18n("<b>Message text</b><br>Write here message text, note that characters with accents will be very probably interpreted another way that you wanted, just few pass correctly.")); msgInfoLabel = new QLabel( i18n("Used %1 of %2 characters").arg(0).arg(160), this ); mainLayout->addMultiCellWidget(msgInfoLabel,5,5,0,2); mainLayout->addWidget(new QLabel( i18n("Class of message"),this),5,3); classCombo = new QComboBox(this); classCombo->insertItem(i18n("0 - flash")); classCombo->insertItem(i18n("1 - mobile")); classCombo->insertItem(i18n("2 - sim")); classCombo->insertItem(i18n("3 - terminal")); classCombo->setCurrentItem(1); mainLayout->addWidget(classCombo, 5,4); QWhatsThis::add( classCombo,i18n("<b>Class of message</b><br>Class 0 message just shows on display imediately after receiving. Class 1 and 2 message are normal messages, 1 should be preferably stored into mobile while 2 on SIM card. Class 3 should go to terminal equipment which most mobiles doesn't support.")); QHBoxLayout *layout = new QHBoxLayout; layout->setSpacing( 6 ); layout->setMargin( 0 ); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout->addItem( spacer ); QPushButton *buttonOK = new QPushButton(i18n("&OK"), this); buttonOK->setDefault(true); layout->addWidget(buttonOK); QPushButton *buttonCancel = new QPushButton(i18n("&Cancel"), this); layout->addWidget(buttonCancel); mainLayout->addMultiCellLayout( layout, 7,7, 0,4 ); line = new QFrame( this); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); mainLayout->addMultiCellWidget( line, 6,6, 0,4 ); connect( buttonOK, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); }
QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent, const char *name) : QDialog(parent, name, TRUE, Qt::WDestructiveClose) { App = parent; setCaption(tr("Edit Qucs Properties")); all = new Q3VBoxLayout(this); // to provide the neccessary size QTabWidget *t = new QTabWidget(this); all->addWidget(t); // ........................................................... QWidget *Tab1 = new QWidget(t); Q3GridLayout *gp = new Q3GridLayout(Tab1,5,2,5,5); QLabel *l1 = new QLabel(tr("Font (set after reload):"), Tab1); gp->addWidget(l1,0,0); FontButton = new QPushButton(Tab1); connect(FontButton, SIGNAL(clicked()), SLOT(slotFontDialog())); gp->addWidget(FontButton,0,1); QLabel *l2 = new QLabel(tr("Document Background Color:"), Tab1); gp->addWidget(l2,1,0); BGColorButton = new QPushButton(" ", Tab1); connect(BGColorButton, SIGNAL(clicked()), SLOT(slotBGColorDialog())); gp->addWidget(BGColorButton,1,1); val200 = new QIntValidator(0, 200, this); QLabel *l3 = new QLabel(tr("maximum undo operations:"), Tab1); gp->addWidget(l3,2,0); undoNumEdit = new QLineEdit(Tab1); undoNumEdit->setValidator(val200); gp->addWidget(undoNumEdit,2,1); QLabel *l4 = new QLabel(tr("text editor:"), Tab1); gp->addWidget(l4,3,0); editorEdit = new QLineEdit(Tab1); gp->addWidget(editorEdit,3,1); t->addTab(Tab1, tr("Settings")); // ........................................................... /* QWidget *Tab2 = new QWidget(t); QGridLayout *gp2 = new QGridLayout(Tab2,3,2,5,5); Check_GridOn = new QCheckBox(tr("show Grid"),Tab2); QLabel *l3 = new QLabel(tr("horizontal Grid:"), Tab2); gp2->addWidget(l3,1,0); Input_GridX = new QLineEdit(Tab2); gp2->addWidget(Input_GridX,1,1); QLabel *l4 = new QLabel(tr("vertical Grid:"), Tab2); gp2->addWidget(l4,2,0); Input_GridY = new QLineEdit(Tab2); gp2->addWidget(Input_GridY,2,1); t->addTab(Tab2, tr("Grid")); */ // ........................................................... // buttons on the bottom of the dialog (independent of the TabWidget) Q3HBox *Butts = new Q3HBox(this); Butts->setSpacing(5); Butts->setMargin(5); all->addWidget(Butts); QPushButton *OkButt = new QPushButton(tr("OK"), Butts); connect(OkButt, SIGNAL(clicked()), SLOT(slotOK())); QPushButton *ApplyButt = new QPushButton(tr("Apply"), Butts); connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply())); QPushButton *CancelButt = new QPushButton(tr("Cancel"), Butts); connect(CancelButt, SIGNAL(clicked()), SLOT(reject())); QPushButton *DefaultButt = new QPushButton(tr("Default Values"), Butts); connect(DefaultButt, SIGNAL(clicked()), SLOT(slotDefaultValues())); OkButt->setDefault(true); // ........................................................... // fill the fields with the Qucs-Properties Font = QucsSettings.font; FontButton->setText(Font.toString()); BGColorButton->setPaletteBackgroundColor( App->view->viewport()->paletteBackgroundColor()); undoNumEdit->setText(QString::number(QucsSettings.maxUndo)); editorEdit->setText(QucsSettings.Editor); }
VerifyDlg::VerifyDlg( const char* workingDir, int fileno, const RangeList& ranges, bool restore, QWidget* parent, const char* name ) : QDialog( parent, name, TRUE ), _restore( restore ), _proc( NULL ), _workingDir( workingDir ), _fileno( fileno ), _ranges( ranges ), _totalKBytes( 0.0 ), _fileCount( 0 ), _wroteStdin( TRUE ), _aborted( FALSE ), _done( FALSE ) { // Calculate size of verify. QListIterator<Range> i( _ranges.getRanges() ); _archiveSize = 0; for ( ; i.current(); ++i ) { _archiveSize += i.current()->getEnd() - i.current()->getStart(); } _archiveSize = ( _archiveSize + 1 ) / 2; if ( _restore ) { setCaption( i18n( "KDat: Restore" ) ); setIconText( i18n( "KDat: Restore" ) ); } else { setCaption( i18n( "KDat: Verify" ) ); setIconText( i18n( "KDat: Verify" ) ); } resize( 500, 300 ); const int labelWidth = 96; QFrame* f1 = new QFrame( this ); f1->setFrameStyle( QFrame::Panel | QFrame::Sunken ); QFrame* f2 = new QFrame( this ); f2->setFrameStyle( QFrame::Panel | QFrame::Sunken ); QLabel* lbl1 = new QLabel( i18n( "Elapsed time:" ), f1 ); lbl1->setFixedSize( labelWidth, lbl1->sizeHint().height() ); _elapsedTime = new QLabel( i18n( "00:00:00" ), f1 ); _elapsedTime->setFixedHeight( _elapsedTime->sizeHint().height() ); QLabel* lbl2 = new QLabel( i18n( "Time remaining:" ), f2 ); lbl2->setFixedSize( labelWidth, lbl2->sizeHint().height() ); _timeRemaining = new QLabel( i18n( "00:00:00" ), f2 ); _timeRemaining->setFixedHeight( _timeRemaining->sizeHint().height() ); QLabel* lbl3 = new QLabel( i18n( "Total kbytes:" ), f1 ); lbl3->setFixedSize( labelWidth, lbl3->sizeHint().height() ); QLabel* totalKbytes = new QLabel( Util::kbytesToString( _archiveSize ), f1 ); totalKbytes->setFixedHeight( totalKbytes->sizeHint().height() ); QLabel* lbl4 = new QLabel( i18n( "Kbytes read:" ), f2 ); lbl4->setFixedSize( labelWidth, lbl4->sizeHint().height() ); _kbytesRead = new QLabel( i18n( "0k" ), f2 ); _kbytesRead->setFixedHeight( _kbytesRead->sizeHint().height() ); QLabel* lbl5 = new QLabel( i18n( "Transfer rate:" ), f1 ); lbl5->setFixedSize( labelWidth, lbl5->sizeHint().height() ); _transferRate = new QLabel( i18n( "0k/min" ), f1 ); _transferRate->setFixedHeight( _transferRate->sizeHint().height() ); QLabel* lbl6; if ( _restore ) { lbl6 = new QLabel( i18n( "Files:" ), f2 ); lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() ); } else { lbl6 = new QLabel( i18n( "Differences:" ), f2 ); lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() ); } _files = new QLabel( "0", f2 ); _files->setFixedHeight( _files->sizeHint().height() ); if ( _restore ) { _log = new LoggerWidget( i18n( "Restore log:" ), this ); } else { _log = new LoggerWidget( i18n( "Verify log:" ), this ); } _ok = new QPushButton( i18n( "OK" ), this ); _ok->setFixedSize( 80, _ok->sizeHint().height() ); connect( _ok, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); _ok->setEnabled( FALSE ); _save = new QPushButton( i18n( "Save Log..." ), this ); _save->setFixedSize( 80, _save->sizeHint().height() ); connect( _save, SIGNAL( clicked() ), _log, SLOT( save() ) ); _save->setEnabled( FALSE ); _abort = new QPushButton( i18n( "Abort" ), this ); _abort->setFixedSize( 80, _abort->sizeHint().height() ); connect( _abort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) ); QVBoxLayout* l1 = new QVBoxLayout( this, 8, 4 ); QHBoxLayout* l1_1 = new QHBoxLayout(); l1->addLayout( l1_1 ); l1_1->addStrut( 3 * lbl1->height() + 16 ); l1_1->addWidget( f1 ); l1_1->addWidget( f2 ); QVBoxLayout* l1_1_1 = new QVBoxLayout( f1, 4, 4 ); QHBoxLayout* l1_1_1_1 = new QHBoxLayout(); l1_1_1->addLayout( l1_1_1_1 ); l1_1_1_1->addWidget( lbl1 ); l1_1_1_1->addWidget( _elapsedTime, 1 ); QHBoxLayout* l1_1_1_2 = new QHBoxLayout(); l1_1_1->addLayout( l1_1_1_2 ); l1_1_1_2->addWidget( lbl3 ); l1_1_1_2->addWidget( totalKbytes, 1 ); QHBoxLayout* l1_1_1_3 = new QHBoxLayout(); l1_1_1->addLayout( l1_1_1_3 ); l1_1_1_3->addWidget( lbl5 ); l1_1_1_3->addWidget( _transferRate, 1 ); QVBoxLayout* l1_1_2 = new QVBoxLayout( f2, 4, 4 ); QHBoxLayout* l1_1_2_1 = new QHBoxLayout(); l1_1_2->addLayout( l1_1_2_1 ); l1_1_2_1->addWidget( lbl2 ); l1_1_2_1->addWidget( _timeRemaining, 1 ); QHBoxLayout* l1_1_2_2 = new QHBoxLayout(); l1_1_2->addLayout( l1_1_2_2 ); l1_1_2_2->addWidget( lbl4 ); l1_1_2_2->addWidget( _kbytesRead, 1 ); QHBoxLayout* l1_1_2_3 = new QHBoxLayout(); l1_1_2->addLayout( l1_1_2_3 ); l1_1_2_3->addWidget( lbl6 ); l1_1_2_3->addWidget( _files, 1 ); l1->addWidget( _log, 1 ); QHBoxLayout* l1_2 = new QHBoxLayout(); l1->addLayout( l1_2 ); l1_2->addStretch( 1 ); l1_2->addWidget( _ok ); l1_2->addWidget( _save ); l1_2->addWidget( _abort ); }
EditContactDialog::EditContactDialog(AlcatelCategoryList *cat, AlcatelContactList *lst, const AlcatelContact *cont, QWidget *parent, const char *name ) : KDialog(parent,name,true) { contact = cont; list= lst; categories = cat; QLabel *label; QFrame *line; resize(500, 580 ); if (cont == NULL) setCaption( i18n( "New contact" ) ); else setCaption( i18n( "Edit contact" ) ); QGridLayout *mainLayout = new QGridLayout( this ); mainLayout->setSpacing( 6 ); mainLayout->setMargin( 8 ); if (cont == NULL) label = new QLabel( i18n("<b>New contact</b>"), this ); else label = new QLabel( i18n("<b>Edit contact</b>"), this ); mainLayout->addMultiCellWidget(label,0,0,0,3); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,1,1,0,3); mainLayout->setRowStretch(0, -1); mainLayout->setRowStretch(1, -1); mainLayout->addWidget(new QLabel(i18n("First name"), this), 2, 0); mainLayout->addWidget(editFirstName = new QLineEdit(this), 2, 1); mainLayout->addWidget(new QLabel(i18n("Last name"), this), 2, 2); mainLayout->addWidget(editLastName = new QLineEdit(this), 2, 3); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,3,3,0,3); mainLayout->addWidget(new QLabel(i18n("Company"), this), 4, 0); mainLayout->addWidget(editCompany = new QLineEdit(this), 4, 1); mainLayout->addWidget(new QLabel(i18n("Job title"), this), 4, 2); mainLayout->addWidget(editJobTitle = new QLineEdit(this), 4, 3); mainLayout->addWidget(new QLabel(i18n("Category"), this), 5, 0); mainLayout->addWidget(editCategory = new KComboBox(this), 5, 1); editCategory->insertItem(i18n("Not set")); /* -1 */ editCategory->insertItem(i18n("none_category", "None")); /* 255 */ for( AlcatelCategoryList::Iterator c_it = categories->begin(); c_it != categories->end(); ++c_it ) { editCategory->insertItem((*c_it).Name); } // , (*c_it).Id mainLayout->addWidget(new QLabel(i18n("Private"), this), 5, 2); mainLayout->addWidget(editPrivate = new QCheckBox(this), 5, 3); mainLayout->addWidget(new QLabel(i18n("Note"), this), 6, 0); /* this will be longer */ mainLayout->addMultiCellWidget(editNote = new QLineEdit(this), 6, 6, 1, 3); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,7,7,0,3); mainLayout->addWidget(new QLabel(i18n("Work number"), this),8 , 0); mainLayout->addWidget(editWorkNumber = new QLineEdit(this),8 , 1); editWorkNumber->setValidator(new PhoneNumberValidator(true, true, false, editWorkNumber)); mainLayout->addWidget(new QLabel(i18n("Main number"), this),8 , 2); mainLayout->addWidget(editMainNumber = new QLineEdit(this),8 , 3); editMainNumber->setValidator(new PhoneNumberValidator(true, true, false, editMainNumber)); mainLayout->addWidget(new QLabel(i18n("Fax number"), this),9 , 0); mainLayout->addWidget(editFaxNumber = new QLineEdit(this),9 , 1); editFaxNumber->setValidator(new PhoneNumberValidator(true, true, false, editFaxNumber)); mainLayout->addWidget(new QLabel(i18n("Other number"), this),9 , 2); mainLayout->addWidget(editOtherNumber = new QLineEdit(this),9 , 3); editOtherNumber->setValidator(new PhoneNumberValidator(true, true, false, editOtherNumber)); mainLayout->addWidget(new QLabel(i18n("Pager number"), this),10 , 0); mainLayout->addWidget(editPagerNumber = new QLineEdit(this),10 , 1); editPagerNumber->setValidator(new PhoneNumberValidator(true, true, false, editPagerNumber)); mainLayout->addWidget(new QLabel(i18n("Mobile number"), this),10 , 2); mainLayout->addWidget(editMobileNumber = new QLineEdit(this),10 , 3); editMobileNumber->setValidator(new PhoneNumberValidator(true, true, false, editMobileNumber)); mainLayout->addWidget(new QLabel(i18n("Home number"), this),11 , 0); mainLayout->addWidget(editHomeNumber = new QLineEdit(this),11 , 1); editHomeNumber->setValidator(new PhoneNumberValidator(true, true, false, editHomeNumber)); /* what should be here? mainLayout->addWidget(new QLabel(i18n(""), this), , 2);*/ line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,12,12,0,3); mainLayout->addWidget(new QLabel(i18n("Email 1"), this), 13, 0); mainLayout->addWidget(editEmail1 = new QLineEdit(this), 13, 1); mainLayout->addWidget(new QLabel(i18n("Email 2"), this), 13, 2); mainLayout->addWidget(editEmail2 = new QLineEdit(this), 13, 3); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,14,14,0,3); mainLayout->addWidget(new QLabel(i18n("Address"), this), 15, 0); /* this will be longer */ mainLayout->addMultiCellWidget(editAddress = new QLineEdit(this), 15, 15, 1, 3); mainLayout->addWidget(new QLabel(i18n("City"), this), 16, 0); mainLayout->addWidget(editCity = new QLineEdit(this), 16, 1); mainLayout->addWidget(new QLabel(i18n("Zip"), this), 16, 2); mainLayout->addWidget(editZip = new QLineEdit(this), 16, 3); mainLayout->addWidget(new QLabel(i18n("State"), this), 17, 0); mainLayout->addWidget(editState = new QLineEdit(this), 17, 1); mainLayout->addWidget(new QLabel(i18n("Country"), this), 17, 2); mainLayout->addWidget(editCountry = new QLineEdit(this), 17, 3); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,18,18,0,3); mainLayout->addWidget(new QLabel(i18n("Custom 1"), this), 19, 0); mainLayout->addWidget(editCustom1 = new QLineEdit(this), 19, 1); mainLayout->addWidget(new QLabel(i18n("Custom 2"), this), 19, 2); mainLayout->addWidget(editCustom2 = new QLineEdit(this), 19, 3); mainLayout->addWidget(new QLabel(i18n("Custom 3"), this), 20, 0); mainLayout->addWidget(editCustom3 = new QLineEdit(this), 20, 1); mainLayout->addWidget(new QLabel(i18n("Custom 4"), this), 20, 2); mainLayout->addWidget(editCustom4 = new QLineEdit(this), 20, 3); line = new QFrame( this ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMargin(3); mainLayout->addMultiCellWidget(line,21,21,0,3); mainLayout->addWidget(new QLabel(i18n("Storage"), this), 22, 0); editStorage = new KComboBox(this); editStorage->insertItem(i18n("none_storage", "None")); editStorage->insertItem(i18n("PC")); editStorage->insertItem(i18n("SIM")); editStorage->insertItem(i18n("Mobile")); connect( editStorage, SIGNAL( activated(int)), this, SLOT( slotStorage(int))); editStorage->setCurrentItem(1); mainLayout->addWidget(editStorage, 22, 1); mainLayout->addWidget(new QLabel(i18n("Position"), this), 22, 2); editPosition = new KIntNumInput(this); editPosition->setRange(-1, 9999,1,false); editPosition->setSpecialValueText(i18n("Auto")); mainLayout->addWidget(editPosition, 22, 3); QHBoxLayout *layout = new QHBoxLayout; layout->setSpacing( 6 ); layout->setMargin( 0 ); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout->addItem( spacer ); QPushButton *buttonOK = new QPushButton(i18n("&OK"), this); buttonOK->setDefault(true); layout->addWidget(buttonOK); QPushButton *buttonCancel = new QPushButton(i18n("&Cancel"), this); layout->addWidget(buttonCancel); mainLayout->addMultiCellLayout( layout, 24,24, 0,3 ); line = new QFrame( this); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); mainLayout->addMultiCellWidget( line, 23,23, 0,3 ); connect( buttonOK, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); editPosition->setEnabled(false); loadContact(); if (contact == NULL) editPosition->setValue(-1); editStorage->setEnabled(contact == NULL); }
QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent, const char *name) : QDialog(parent, name) { App = parent; setWindowTitle(tr("Edit Qucs Properties")); Expr.setPattern("[\\w_]+"); Validator = new QRegExpValidator(Expr, this); all = new QVBoxLayout(this); // to provide the neccessary size QTabWidget *t = new QTabWidget(); all->addWidget(t); // ........................................................... QWidget *Tab1 = new QWidget(t); QGridLayout *gp = new QGridLayout(Tab1); gp->addWidget(new QLabel(tr("Font (set after reload):"), Tab1), 0,0); FontButton = new QPushButton(Tab1); connect(FontButton, SIGNAL(clicked()), SLOT(slotFontDialog())); gp->addWidget(FontButton,0,1); gp->addWidget(new QLabel(tr("Document Background Color:"), Tab1) ,1,0); BGColorButton = new QPushButton(" ", Tab1); connect(BGColorButton, SIGNAL(clicked()), SLOT(slotBGColorDialog())); gp->addWidget(BGColorButton,1,1); gp->addWidget(new QLabel(tr("Language (set after reload):"), Tab1) ,2,0); LanguageCombo = new QComboBox(Tab1); LanguageCombo->insertItem(tr("system language")); LanguageCombo->insertItem(tr("English")+" (en)"); LanguageCombo->insertItem(tr("German")+" (de)"); LanguageCombo->insertItem(tr("French")+" (fr)"); LanguageCombo->insertItem(tr("Spanish")+" (es)"); LanguageCombo->insertItem(tr("Italian")+" (it)"); LanguageCombo->insertItem(tr("Polish")+" (pl)"); LanguageCombo->insertItem(tr("Romanian")+" (ro)"); LanguageCombo->insertItem(tr("Japanese")+" (jp)"); LanguageCombo->insertItem(tr("Swedish")+" (sv)"); LanguageCombo->insertItem(tr("Hungarian")+" (hu)"); LanguageCombo->insertItem(tr("Hebrew")+" (he)"); LanguageCombo->insertItem(tr("Portuguese")+" (pt)"); LanguageCombo->insertItem(tr("Turkish")+" (tr)"); LanguageCombo->insertItem(tr("Ukrainian")+" (uk)"); LanguageCombo->insertItem(tr("Russian")+" (ru)"); LanguageCombo->insertItem(tr("Czech")+" (cs)"); LanguageCombo->insertItem(tr("Catalan")+" (ca)"); LanguageCombo->insertItem(tr("Arabic")+" (ar)"); LanguageCombo->insertItem(tr("Kazakh")+" (kk)"); gp->addWidget(LanguageCombo,2,1); val200 = new QIntValidator(0, 200, this); gp->addWidget(new QLabel(tr("maximum undo operations:"), Tab1) ,3,0); undoNumEdit = new QLineEdit(Tab1); undoNumEdit->setValidator(val200); gp->addWidget(undoNumEdit,3,1); gp->addWidget(new QLabel(tr("text editor:"), Tab1) ,4,0); editorEdit = new QLineEdit(Tab1); gp->addWidget(editorEdit,4,1); gp->addWidget(new QLabel(tr("start wiring when clicking open node:"), Tab1) ,5,0); checkWiring = new QCheckBox(Tab1); gp->addWidget(checkWiring,5,1); t->addTab(Tab1, tr("Settings")); // ........................................................... QWidget *Tab3 = new QWidget(t); QGridLayout *gp3 = new QGridLayout(Tab3); gp3->addMultiCellWidget(new QLabel(tr("Colors for Syntax Highlighting:"), Tab3), 0,0,0,1); ColorComment = new QPushButton(tr("Comment"), Tab3); ColorComment->setPaletteForegroundColor(QucsSettings.Comment); ColorComment->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorComment, SIGNAL(clicked()), SLOT(slotColorComment())); gp3->addWidget(ColorComment,1,0); ColorString = new QPushButton(tr("String"), Tab3); ColorString->setPaletteForegroundColor(QucsSettings.String); ColorString->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorString, SIGNAL(clicked()), SLOT(slotColorString())); gp3->addWidget(ColorString,1,1); ColorInteger = new QPushButton(tr("Integer Number"), Tab3); ColorInteger->setPaletteForegroundColor(QucsSettings.Integer); ColorInteger->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorInteger, SIGNAL(clicked()), SLOT(slotColorInteger())); gp3->addWidget(ColorInteger,1,2); ColorReal = new QPushButton(tr("Real Number"), Tab3); ColorReal->setPaletteForegroundColor(QucsSettings.Real); ColorReal->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorReal, SIGNAL(clicked()), SLOT(slotColorReal())); gp3->addWidget(ColorReal,2,0); ColorCharacter = new QPushButton(tr("Character"), Tab3); ColorCharacter->setPaletteForegroundColor(QucsSettings.Character); ColorCharacter->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorCharacter, SIGNAL(clicked()), SLOT(slotColorCharacter())); gp3->addWidget(ColorCharacter,2,1); ColorDataType = new QPushButton(tr("Data Type"), Tab3); ColorDataType->setPaletteForegroundColor(QucsSettings.Type); ColorDataType->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorDataType, SIGNAL(clicked()), SLOT(slotColorDataType())); gp3->addWidget(ColorDataType,2,2); ColorAttribute = new QPushButton(tr("Attribute"), Tab3); ColorAttribute->setPaletteForegroundColor(QucsSettings.Attribute); ColorAttribute->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorAttribute, SIGNAL(clicked()), SLOT(slotColorAttribute())); gp3->addWidget(ColorAttribute,3,0); ColorDirective = new QPushButton(tr("Directive"), Tab3); ColorDirective->setPaletteForegroundColor(QucsSettings.Directive); ColorDirective->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorDirective, SIGNAL(clicked()), SLOT(slotColorDirective())); gp3->addWidget(ColorDirective,3,1); ColorTask = new QPushButton(tr("Task"), Tab3); ColorTask->setPaletteForegroundColor(QucsSettings.Task); ColorTask->setPaletteBackgroundColor(QucsSettings.BGColor); connect(ColorTask, SIGNAL(clicked()), SLOT(slotColorTask())); gp3->addWidget(ColorTask,3,2); t->addTab(Tab3, tr("Source Code Editor")); // ........................................................... QWidget *Tab2 = new QWidget(t); QGridLayout *gp2 = new QGridLayout(Tab2); QLabel *note = new QLabel( tr("Register filename extensions here in order to\nopen files with an appropriate program.")); gp2->addWidget(note,0,0,1,2); tableWidget = new QTableWidget(Tab2); tableWidget->setColumnCount(2); QTableWidgetItem *item1 = new QTableWidgetItem(); QTableWidgetItem *item2 = new QTableWidgetItem(); tableWidget->setHorizontalHeaderItem(0, item1); tableWidget->setHorizontalHeaderItem(1, item2); item1->setText(tr("Suffix")); item2->setText(tr("Program")); tableWidget->horizontalHeader()->setStretchLastSection(true); tableWidget->verticalHeader()->hide(); connect(tableWidget, SIGNAL(cellClicked(int,int)), SLOT(slotTableCliked(int,int))); gp2->addWidget(tableWidget,1,0,3,1); // fill listview with already registered file extensions QStringList::Iterator it = QucsSettings.FileTypes.begin(); while(it != QucsSettings.FileTypes.end()) { int row = tableWidget->rowCount(); tableWidget->setRowCount(row+1); QTableWidgetItem *suffix = new QTableWidgetItem(QString((*it).section('/',0,0))); QTableWidgetItem *program = new QTableWidgetItem(QString((*it).section('/',1,1))); suffix->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); program->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); tableWidget->setItem(row, 0, suffix); tableWidget->setItem(row, 1, program); it++; } QLabel *l5 = new QLabel(tr("Suffix:"), Tab2); gp2->addWidget(l5,1,1); Input_Suffix = new QLineEdit(Tab2); Input_Suffix->setValidator(Validator); gp2->addWidget(Input_Suffix,1,2); // connect(Input_Suffix, SIGNAL(returnPressed()), SLOT(slotGotoProgEdit())); //not implemented QLabel *l6 = new QLabel(tr("Program:"), Tab2); gp2->addWidget(l6,2,1); Input_Program = new QLineEdit(Tab2); gp2->addWidget(Input_Program,2,2); QPushButton *AddButt = new QPushButton(tr("Set")); gp2->addWidget(AddButt,3,1); connect(AddButt, SIGNAL(clicked()), SLOT(slotAdd())); QPushButton *RemoveButt = new QPushButton(tr("Remove")); gp2->addWidget(RemoveButt,3,2); connect(RemoveButt, SIGNAL(clicked()), SLOT(slotRemove())); gp2->setRowStretch(3,4); t->addTab(Tab2, tr("File Types")); // ........................................................... // buttons on the bottom of the dialog (independent of the TabWidget) QHBoxLayout *Butts = new QHBoxLayout(); Butts->setSpacing(3); Butts->setMargin(3); all->addLayout(Butts); QPushButton *OkButt = new QPushButton(tr("OK")); Butts->addWidget(OkButt); connect(OkButt, SIGNAL(clicked()), SLOT(slotOK())); QPushButton *ApplyButt = new QPushButton(tr("Apply")); Butts->addWidget(ApplyButt); connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply())); QPushButton *CancelButt = new QPushButton(tr("Cancel")); Butts->addWidget(CancelButt); connect(CancelButt, SIGNAL(clicked()), SLOT(reject())); QPushButton *DefaultButt = new QPushButton(tr("Default Values")); Butts->addWidget(DefaultButt); connect(DefaultButt, SIGNAL(clicked()), SLOT(slotDefaultValues())); OkButt->setDefault(true); // ........................................................... // fill the fields with the Qucs-Properties Font = QucsSettings.font; FontButton->setText(Font.toString()); BGColorButton->setPaletteBackgroundColor(QucsSettings.BGColor); undoNumEdit->setText(QString::number(QucsSettings.maxUndo)); editorEdit->setText(QucsSettings.Editor); checkWiring->setChecked(QucsSettings.NodeWiring); for(int z=LanguageCombo->count()-1; z>=0; z--) if(LanguageCombo->text(z).section('(',1,1).remove(')') == QucsSettings.Language) LanguageCombo->setCurrentItem(z); resize(300, 200); }