TjSummaryReport::TjSummaryReport(QWidget* p, ReportManager* m, const Project* pr, const QString& n) : TjUIReportBase(p, m, 0, n), project(pr) { QVBoxLayout* hl = new QVBoxLayout(this, 1); hl->setAutoAdd(true); textBrowser = new QTextBrowser(this); textBrowser->setTextFormat(Qt::RichText); textBrowser->setReadOnly(true); }
void tst_QLayout::task193350_sizeGrip() { QDialog dialog; dialog.setSizeGripEnabled(true); QVBoxLayout* layout = new QVBoxLayout(&dialog); layout->setAutoAdd(true); new QLabel("Label", &dialog); dialog.show(); QCOMPARE(layout->indexOf(qFindChild<QSizeGrip *>(&dialog)),-1); }
BrowserBar::BrowserBar( QWidget *parent ) : QWidget( parent, "BrowserBar" ) , EngineObserver( EngineController::instance() ) , m_playlistBox( new QVBox( this ) ) , m_divider( new Amarok::Splitter( this ) ) , m_browserBox( new QVBox( this ) ) , m_currentIndex( -1 ) , m_lastIndex( -1 ) , m_mapper( new QSignalMapper( this ) ) { m_tabManagementButton = new QPushButton( SmallIconSet(Amarok::icon( "configure" )), 0, this, "tab_managment_button" ); connect (m_tabManagementButton, SIGNAL(clicked()), SLOT(showBrowserSelectionMenu())); m_tabManagementButton->setIsMenuButton ( true ); //deprecated, but since I cannot add menu directly to button it is needed. QToolTip::add (m_tabManagementButton, i18n("Manage tabs")); m_tabBar = new MultiTabBar( MultiTabBar::Vertical, this ); m_tabManagementButton->setFixedWidth(m_tabBar->sizeHint().width()); m_tabManagementButton->setFixedHeight(m_tabBar->sizeHint().width()); s_instance = this; m_pos = m_tabBar->sizeHint().width() + 5; //5 = esthetic spacing m_tabBar->setStyle( MultiTabBar::AMAROK ); m_tabBar->setPosition( MultiTabBar::Left ); m_tabBar->showActiveTabTexts( true ); m_tabBar->setFixedWidth( m_pos ); m_tabBar->move( 0, 25 ); QVBoxLayout *layout = new QVBoxLayout( m_browserBox ); layout->addSpacing( 3 ); // aesthetics layout->setAutoAdd( true ); m_browserBox->move( m_pos, 0 ); m_browserBox->hide(); m_divider->hide(); m_playlistBox->setSpacing( 1 ); connect( m_mapper, SIGNAL(mapped( int )), SLOT(showHideBrowser( int )) ); //m_tabBar->appendButton( Amarok::icon( "configure" ), 1, 0, QString::null ); }
void KKameraConfig::displayGPSuccessDialogue(void) { // set the kcontrol module buttons setButtons(Help | Apply | Cancel | Ok); // create a layout with two vertical boxes QVBoxLayout *topLayout = new QVBoxLayout(this, 0, 0); topLayout->setAutoAdd(true); m_toolbar = new KToolBar(this, "ToolBar"); m_toolbar->setMovingEnabled(false); // create list of devices m_deviceSel = new KIconView(this); connect(m_deviceSel, SIGNAL(rightButtonClicked(QIconViewItem *, const QPoint &)), SLOT(slot_deviceMenu(QIconViewItem *, const QPoint &))); connect(m_deviceSel, SIGNAL(doubleClicked(QIconViewItem *)), SLOT(slot_configureCamera())); connect(m_deviceSel, SIGNAL(selectionChanged(QIconViewItem *)), SLOT(slot_deviceSelected(QIconViewItem *))); m_deviceSel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); // create actions KAction *act; act = new KAction(i18n("Add"), "camera", 0, this, SLOT(slot_addCamera()), m_actions, "camera_add"); act->setWhatsThis(i18n("Click this button to add a new camera.")); act->plug(m_toolbar); m_toolbar->insertLineSeparator(); act = new KAction(i18n("Test"), "camera_test", 0, this, SLOT(slot_testCamera()), m_actions, "camera_test"); act->setWhatsThis(i18n("Click this button to remove the selected camera from the list.")); act->plug(m_toolbar); act = new KAction(i18n("Remove"), "edittrash", 0, this, SLOT(slot_removeCamera()), m_actions, "camera_remove"); act->setWhatsThis(i18n("Click this button to remove the selected camera from the list.")); act->plug(m_toolbar); act = new KAction(i18n("Configure..."), "configure", 0, this, SLOT(slot_configureCamera()), m_actions, "camera_configure"); act->setWhatsThis(i18n("Click this button to change the configuration of the selected camera.<br><br>The availability of this feature and the contents of the Configuration dialog depend on the camera model.")); act->plug(m_toolbar); act = new KAction(i18n("Information"), "hwinfo", 0, this, SLOT(slot_cameraSummary()), m_actions, "camera_summary"); act->setWhatsThis(i18n("Click this button to view a summary of the current status of the selected camera.<br><br>The availability of this feature and the contents of the Configuration dialog depend on the camera model.")); act->plug(m_toolbar); m_toolbar->insertLineSeparator(); act = new KAction(i18n("Cancel"), "stop", 0, this, SLOT(slot_cancelOperation()), m_actions, "camera_cancel"); act->setWhatsThis(i18n("Click this button to cancel the current camera operation.")); act->setEnabled(false); act->plug(m_toolbar); }
Receiver::Receiver() { QVBoxLayout *lay = new QVBoxLayout(this); lay->setAutoAdd(true); QPushButton *h = new QPushButton("Press here to terminate", this); start = new QPushButton("Launch KRuns", this); stop = new QPushButton("Stop those KRuns", this); stop->setEnabled(false); QObject::connect(h, SIGNAL(clicked()), kapp, SLOT(quit())); QObject::connect(start, SIGNAL(clicked()), this, SLOT(slotStart())); QObject::connect(stop, SIGNAL(clicked()), this, SLOT(slotStop())); adjustSize(); show(); }
DubConfigModule::DubConfigModule(QObject* parent) : CModule(i18n("Dub"), i18n("Folder-Based Playlist"), "noatun", parent) , playMode(oneDir) , playOrder(normal) { QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setAutoAdd(true); vbox->setSpacing( 0 ); vbox->setMargin( 0 ); prefs = new DubPrefs(this); prefs->mediaDirectory->setMode(KFile::Directory); reopen(); }
JumpButtonBar::JumpButtonBar( KAB::Core *core, QWidget *parent, const char *name ) : QWidget( parent, name ), mCore( core ) { setMinimumSize( 1, 1 ); QVBoxLayout *layout = new QVBoxLayout( this, 0, 0 ); layout->setAlignment( Qt::AlignTop ); layout->setAutoAdd( true ); layout->setResizeMode( QLayout::FreeResize ); mGroupBox = new QButtonGroup( 1, Qt::Horizontal, this ); mGroupBox->setExclusive( true ); mGroupBox->layout()->setSpacing( 0 ); mGroupBox->layout()->setMargin( 0 ); mGroupBox->setFrameStyle( QFrame::NoFrame ); }
ImageTextEditor::ImageTextEditor( QImage& i, QWidget *parent, const char *name, WFlags f ) : QDialog(parent,name,TRUE,f), image(i) { QVBoxLayout* vbox = new QVBoxLayout(this,8); vbox->setAutoAdd(TRUE); QGrid* controls = new QGrid(3,QGrid::Horizontal,this); controls->setSpacing(8); QLabel* l; l=new QLabel("Language",controls); l->setAlignment(AlignCenter); l=new QLabel("Key",controls); l->setAlignment(AlignCenter); (void)new QLabel("",controls); // dummy languages = new QComboBox(controls); keys = new QComboBox(controls); QPushButton* remove = new QPushButton("Remove",controls); newlang = new QLineEdit(controls); newkey = new QLineEdit(controls); QPushButton* add = new QPushButton("Add",controls); text = new QMultiLineEdit(this); QHBox* hbox = new QHBox(this); QPushButton* cancel = new QPushButton("Cancel",hbox); QPushButton* ok = new QPushButton("OK",hbox); connect(add,SIGNAL(clicked()), this,SLOT(addText())); connect(remove,SIGNAL(clicked()), this,SLOT(removeText())); connect(ok,SIGNAL(clicked()), this,SLOT(accept())); connect(cancel,SIGNAL(clicked()), this,SLOT(reject())); connect(languages,SIGNAL(activated(int)), this,SLOT(updateText())); connect(keys,SIGNAL(activated(int)), this,SLOT(updateText())); imageChanged(); }
addUser::addUser( KU::KUser *AUser, bool useprivategroup, QWidget *parent, const char *name ) : propdlg( AUser, useprivategroup, parent, name ) { QGroupBox *group = new QGroupBox(frontpage); group->setTitle(i18n("New Account Options")); QVBoxLayout *groupLayout = new QVBoxLayout(group, marginHint(), spacingHint()); groupLayout->addSpacing(group->fontMetrics().lineSpacing()); groupLayout->setAutoAdd(true); createhome = new QCheckBox(i18n("Create home folder"), group); createhome->setChecked(true); copyskel = new QCheckBox(i18n("Copy skeleton"), group); connect(createhome, SIGNAL(toggled(bool)), copyskel, SLOT(setEnabled(bool))); frontlayout->addMultiCellWidget(group, frontrow, frontrow, 0, 2); if ( useprivategroup ) pbprigr->setEnabled( false ); }
StreamView::StreamView( POLE::Stream* s ): QDialog( 0 ) { stream = s; setModal( false ); QVBoxLayout* layout = new QVBoxLayout( this ); layout->setAutoAdd( true ); layout->setMargin( 10 ); layout->setSpacing( 5 ); infoLabel = new QLabel( this ); log = new QTextEdit( this ); log->setTextFormat( Qt::LogText ); log->setFont( QFont("Courier") ); log->setMinimumSize( 500, 300 ); QTimer::singleShot( 0, this, SLOT( loadStream() ) ); }
Fsystem::Fsystem(KSim::PluginObject *parent, const char *name) : DCOPObject("fsystem"), KSim::PluginView(parent, name) { config()->setGroup("Fsystem"); QVBoxLayout *vbLayout = new QVBoxLayout(this); vbLayout->setAutoAdd(true); QSpacerItem *item = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); vbLayout->addItem(item); m_mountEntries = makeList(config()->readListEntry("mountEntries")); m_showPercentage = config()->readBoolEntry("ShowPercentage", true); m_widget = new FilesystemWidget(this, "FilesystemWidget"); createFreeInfo(); m_updateTimer = new QTimer(this); connect(m_updateTimer, SIGNAL(timeout()), SLOT(updateFS())); m_updateTimer->start(config()->readNumEntry("updateValue", 60) * 1000); }
TjHTMLReport::TjHTMLReport(QWidget* p, ReportManager* m, Report* rDef, const QString& n) : TjUIReportBase(p, m, rDef, n) { QVBoxLayout* hl = new QVBoxLayout(this, 0); hl->setAutoAdd(true); browser = new KHTMLPart(this); /* It is very unlikely that we need these advanced KHTML features, so * let's disable them for security reasons. */ browser->setJScriptEnabled(false); browser->setJavaEnabled(false); browser->setMetaRefreshEnabled(false); browser->setPluginsEnabled(false); browser->setOnlyLocalReferences(true); connect(browser->browserExtension(), SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs&)), this, SLOT(openURLRequest(const KURL &, const KParts::URLArgs&))); connect(browser, SIGNAL(onURL(const QString&)), this, SLOT(showURLinStatusBar(const QString&))); }
IOSlaveSettings::IOSlaveSettings(const QString& config, QWidget *parent) :KCModule(parent) ,m_config(config,false,true) { QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); layout->setAutoAdd(true); QGroupBox* group=new QGroupBox(1, Horizontal, i18n("Show Links for Following Services"), this); m_ftpSettings=new PortSettingsBar(i18n("FTP (TCP, port 21): "), group); m_httpSettings=new PortSettingsBar(i18n("HTTP (TCP, port 80): "),group); m_nfsSettings=new PortSettingsBar(i18n("NFS (TCP, port 2049): "),group); m_smbSettings=new PortSettingsBar(i18n("Windows shares (TCP, ports 445 and 139):"),group); m_fishSettings=new PortSettingsBar(i18n("Secure Shell/Fish (TCP, port 22): "),group); m_shortHostnames = new QCheckBox(i18n("Show &short hostnames (without domain suffix)"),this); QHBox *hbox=new QHBox(this); QLabel *label=new QLabel(i18n("Default LISa server host: "), hbox); m_defaultLisaHostLe=new QLineEdit(hbox); label->setBuddy(m_defaultLisaHostLe); QWidget *w=new QWidget(this); layout->setStretchFactor(m_ftpSettings,0); layout->setStretchFactor(m_httpSettings,0); layout->setStretchFactor(m_nfsSettings,0); layout->setStretchFactor(m_smbSettings,0); layout->setStretchFactor(m_shortHostnames,0); layout->setStretchFactor(hbox,0); layout->setStretchFactor(w,1); connect(m_ftpSettings,SIGNAL(changed()),this,SIGNAL(changed())); connect(m_httpSettings,SIGNAL(changed()),this,SIGNAL(changed())); connect(m_nfsSettings,SIGNAL(changed()),this,SIGNAL(changed())); connect(m_smbSettings,SIGNAL(changed()),this,SIGNAL(changed())); connect(m_fishSettings,SIGNAL(changed()),this,SIGNAL(changed())); connect(m_shortHostnames,SIGNAL(clicked()),this,SIGNAL(changed())); connect(m_defaultLisaHostLe, SIGNAL(textChanged(const QString&)),this,SIGNAL(changed())); }
void KCheckAccelerators::createDialog(QWidget *actWin, bool automatic) { if ( drklash ) return; drklash = new QDialog( actWin, "kapp_accel_check_dlg", false, Qt::WDestructiveClose); drklash->setCaption( i18n( "Dr. Klash' Accelerator Diagnosis" )); drklash->resize( 500, 460 ); QVBoxLayout* layout = new QVBoxLayout( drklash, 11, 6 ); layout->setAutoAdd( true ); drklash_view = new QTextView( drklash ); QCheckBox* disableAutoCheck = NULL; if( automatic ) { disableAutoCheck = new QCheckBox( i18n( "&Disable automatic checking" ), drklash ); connect(disableAutoCheck, SIGNAL(toggled(bool)), SLOT(slotDisableCheck(bool))); } QPushButton* btnClose = new QPushButton( i18n( "&Close" ), drklash ); btnClose->setDefault( true ); connect( btnClose, SIGNAL( clicked() ), drklash, SLOT( close() ) ); if (disableAutoCheck) disableAutoCheck->setFocus(); else drklash_view->setFocus(); }
InstallerActionView::InstallerActionView( QWidget *parent, const char *name ) : QWidget( parent, name ) { emergeProcess = new EmergeProcess( this ); QVBoxLayout* layout = new QVBoxLayout( this ); layout->setAutoAdd( true ); m_log = new KTextEdit( this ); m_log->setTextFormat( Qt::LogText ); /* maybe use later for pretty printing: QStyleSheetItem * item = new QStyleSheetItem( m_log->styleSheet(), "mytag" ); item->setColor( "red" ); item->setFontWeight( QFont::Bold ); item->setFontUnderline( TRUE ); */ QHBox* hBox = new QHBox( this ); KPushButton* startButton = new KPushButton("Start!", hBox); connect( startButton, SIGNAL( pressed() ), emergeProcess, SLOT( start() ) ); connect( emergeProcess, SIGNAL( receivedOutput(const QString&) ), m_log, SLOT( append(const QString&) ) ); }
KPartsGenericPart::KPartsGenericPart(QWidget *parentWidget, const char *name) : QWidget(parentWidget, name), m_part(0) { QVBoxLayout *layout = new QVBoxLayout(this); layout->setAutoAdd(true); }
KPrTransEffectDia::KPrTransEffectDia( QWidget *parent, const char *name, KPrDocument *_doc, KPrView *_view ) : KDialogBase( parent, name, true, "", KDialogBase::User1|Ok|Cancel ), doc( _doc ), view( _view ), soundPlayer( 0 ) { enableButtonSeparator( true ); QWidget *page = new QWidget( this ); setMainWidget(page); QBoxLayout *topLayout = new QHBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() ); QWidget* leftpart = new QWidget( page ); topLayout->addWidget( leftpart ); QWidget* rightpart = new QWidget( page ); topLayout->addWidget( rightpart ); // right-side of the dialog, for showing effect preview QVBoxLayout *rightlayout = new QVBoxLayout( rightpart, KDialog::marginHint(), KDialog::spacingHint() ); rightlayout->setAutoAdd( true ); effectPreview = new KPrEffectPreview( rightpart, doc, view ); int pgnum = view->getCurrPgNum() - 1; // getCurrPgNum() is 1-based KPrPage* pg = doc->pageList().at( pgnum ); // pixmap for effect preview QRect rect= pg->getZoomPageRect(); QPixmap pix( rect.size() ); pix.fill( Qt::white ); view->getCanvas()->drawPageInPix( pix, pgnum, 100 ); effectPreview->setPixmap( pix ); pageEffect = pg->getPageEffect(); speed = pg->getPageEffectSpeed(); QVBoxLayout *leftlayout = new QVBoxLayout( leftpart, KDialog::marginHint(), KDialog::spacingHint() ); leftlayout->setAutoAdd( true ); new QLabel( i18n("Effect:"), leftpart ); effectList = new QListBox( leftpart ); effectList->insertItem( i18n( "No Effect" ) ); effectList->insertItem( i18n( "Close Horizontal" ) ); effectList->insertItem( i18n( "Close Vertical" ) ); effectList->insertItem( i18n( "Close From All Directions" ) ); effectList->insertItem( i18n( "Open Horizontal" ) ); effectList->insertItem( i18n( "Open Vertical" ) ); effectList->insertItem( i18n( "Open From All Directions" ) ); effectList->insertItem( i18n( "Interlocking Horizontal 1" ) ); effectList->insertItem( i18n( "Interlocking Horizontal 2" ) ); effectList->insertItem( i18n( "Interlocking Vertical 1" ) ); effectList->insertItem( i18n( "Interlocking Vertical 2" ) ); effectList->insertItem( i18n( "Surround 1" ) ); effectList->insertItem( i18n( "Fly Away 1" ) ); effectList->insertItem( i18n( "Blinds Horizontal" ) ); effectList->insertItem( i18n( "Blinds Vertical" ) ); effectList->insertItem( i18n( "Box In" ) ); effectList->insertItem( i18n( "Box Out" ) ); effectList->insertItem( i18n( "Checkerboard Across" ) ); effectList->insertItem( i18n( "Checkerboard Down" ) ); effectList->insertItem( i18n( "Cover Down" ) ); effectList->insertItem( i18n( "Uncover Down" ) ); effectList->insertItem( i18n( "Cover Up" ) ); effectList->insertItem( i18n( "Uncover Up" ) ); effectList->insertItem( i18n( "Cover Left" ) ); effectList->insertItem( i18n( "Uncover Left" ) ); effectList->insertItem( i18n( "Cover Right" ) ); effectList->insertItem( i18n( "Uncover Right" ) ); effectList->insertItem( i18n( "Cover Left-Up" ) ); effectList->insertItem( i18n( "Uncover Left-Up" ) ); effectList->insertItem( i18n( "Cover Left-Down" ) ); effectList->insertItem( i18n( "Uncover Left-Down" ) ); effectList->insertItem( i18n( "Cover Right-Up" ) ); effectList->insertItem( i18n( "Uncover Right-Up" ) ); effectList->insertItem( i18n( "Cover Right-Bottom" ) ); effectList->insertItem( i18n( "Uncover Right-Bottom" ) ); effectList->insertItem( i18n( "Dissolve" ) ); effectList->insertItem( i18n( "Strips Left-Up" ) ); effectList->insertItem( i18n( "Strips Left-Down" ) ); effectList->insertItem( i18n( "Strips Right-Up" ) ); effectList->insertItem( i18n( "Strips Right-Down" ) ); effectList->insertItem( i18n( "Melting" ) ); effectList->insertItem( i18n( "Random Transition" ) ); effectList->setCurrentItem( static_cast<int>( pageEffect ) ); // workaround, because Random Effect is always negative if( pageEffect == PEF_RANDOM ) effectList->setCurrentItem( effectList->count()-1 ); connect( effectList, SIGNAL(highlighted(int)), this, SLOT(effectChanged(int)) ); connect( effectList, SIGNAL( doubleClicked ( QListBoxItem *) ), this, SLOT( effectChanged()) ); new QLabel( i18n("Speed:"), leftpart ); QWidget* sp = new QWidget( leftpart ); QBoxLayout* speedLayout = new QHBoxLayout( sp, KDialog::marginHint(), KDialog::spacingHint() ); speedLayout->setAutoAdd( true ); speedCombo = new QComboBox( sp ); speedCombo->insertItem(i18n("Slow") ); speedCombo->insertItem(i18n("Medium") ); speedCombo->insertItem(i18n("Fast") ); speedCombo->setCurrentItem( speed ); connect( speedCombo, SIGNAL(activated(int)), this, SLOT(speedChanged(int)) ); QWidget* previewgrp = new QWidget( leftpart ); QBoxLayout* previewLayout = new QHBoxLayout( previewgrp, KDialog::marginHint(), KDialog::spacingHint() ); previewLayout->setAutoAdd( true ); automaticPreview = new QCheckBox( i18n( "Automatic preview" ), previewgrp ); automaticPreview->setChecked( true ); QWidget* previewspacer = new QWidget( previewgrp ); previewspacer->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); previewButton = new QPushButton( previewgrp ); previewButton->setText( i18n("Preview") ); connect( previewButton, SIGNAL(clicked()), this, SLOT(preview()) ); QFrame* line = new QFrame( leftpart ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); soundFileName = pg->getPageSoundFileName(); soundEffect = pg->getPageSoundEffect(); checkSoundEffect = new QCheckBox( i18n( "Sound effect" ), leftpart ); checkSoundEffect->setChecked( soundEffect ); connect( checkSoundEffect, SIGNAL( clicked() ), this, SLOT( soundEffectChanged() ) ); QWidget* soundgrp = new QWidget( leftpart ); QBoxLayout* soundLayout = new QHBoxLayout( soundgrp, KDialog::marginHint(), KDialog::spacingHint() ); soundLayout->setAutoAdd( true ); lSoundEffect = new QLabel( i18n( "File name:" ), soundgrp ); requester = new KURLRequester( soundgrp ); requester->setURL( soundFileName ); connect( requester, SIGNAL( openFileDialog( KURLRequester * ) ), this, SLOT( slotRequesterClicked( KURLRequester * ) ) ); connect( requester, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotSoundFileChanged( const QString& ) ) ); buttonTestPlaySoundEffect = new QPushButton( soundgrp ); buttonTestPlaySoundEffect->setPixmap( BarIcon("1rightarrow", KIcon::SizeSmall) ); QToolTip::add( buttonTestPlaySoundEffect, i18n("Play") ); connect( buttonTestPlaySoundEffect, SIGNAL( clicked() ), this, SLOT( playSound() ) ); buttonTestStopSoundEffect = new QPushButton( soundgrp ); buttonTestStopSoundEffect->setPixmap( BarIcon("player_stop", KIcon::SizeSmall) ); QToolTip::add( buttonTestStopSoundEffect, i18n("Stop") ); connect( buttonTestStopSoundEffect, SIGNAL( clicked() ), this, SLOT( stopSound() ) ); soundEffect = pg->getPageSoundEffect(); setButtonText(KDialogBase::User1,i18n( "Apply &Global" )); slideTime = pg->getPageTimer(); new QLabel( i18n("Automatically advance to the next slide after:"), rightpart ); timeSlider = new KIntNumInput( slideTime, rightpart ); timeSlider->setRange( 1, 600, 1 ); timeSlider->setSuffix( i18n( " seconds" ) ); connect( timeSlider, SIGNAL(valueChanged(int)), this, SLOT(timeChanged(int)) ); QWidget* rspacer = new QWidget( rightpart ); rspacer->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); QWidget* lspacer = new QWidget( leftpart ); lspacer->setMinimumSize( 10, spacingHint() ); soundEffectChanged(); }
DialogCreateTag::DialogCreateTag(QWidget *parent, TagTreeNode* parentNode, const char *name) : KDialogBase(parent, name, true, "", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, false ) , m_parentNode(parentNode) { if (parentNode) { this->setCaption(i18n("Create tag")); } else { this->setCaption(i18n("Create toplevel tag")); } QWidget* mainPanel = new QWidget(this, "mainPanel"); setMainWidget(mainPanel); QVBoxLayout* mainPanelLayout = new QVBoxLayout(mainPanel, 0, 5, "mainPanelLayout"); mainPanelLayout->setAutoAdd(true); // parent if (parentNode) { // newTagGroup QGroupBox* parentTagGroup = new QGroupBox(i18n("Parent tag"), mainPanel, "parentTagGroup"); QGridLayout* parentTagGroupLayout = new QGridLayout(parentTagGroup, 4, 4, 20, 5, "parentTagGroupLayout"); parentTagGroupLayout->setRowSpacing(0, 10); // type QLabel* typeLabel = new QLabel(i18n("Type"), parentTagGroup, "typeLabel"); parentTagGroupLayout->addWidget(typeLabel, 1, 0); KComboBox* typeComboBox = new KComboBox(false, parentTagGroup, "typeComboBox"); typeComboBox->insertItem(parentNode->tagNode()->typeName()); typeComboBox->setEnabled(false); parentTagGroupLayout->addMultiCellWidget(typeComboBox, 1, 1, 1, 2); // name QLabel* nameLabel = new QLabel(i18n("Name"), parentTagGroup, "nameLabel"); parentTagGroupLayout->addWidget(nameLabel, 2, 0); KLineEdit* nameLineEdit = new KLineEdit(parentTagGroup, "nameLineEdit"); nameLineEdit->setText(*parentNode->tagNode()->text()); nameLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); nameLineEdit->setReadOnly(true); parentTagGroupLayout->addMultiCellWidget(nameLineEdit, 2, 2, 1, 2); // icon QLabel* iconLabel = new QLabel(i18n("Icon"), parentTagGroup, "iconLabel"); parentTagGroupLayout->addWidget(iconLabel, 3, 0); KLineEdit* iconLineEdit = new KLineEdit(parentTagGroup, "iconLineEdit"); iconLineEdit->setText(*parentNode->tagNode()->iconName()); iconLineEdit->setMinimumWidth(300); iconLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); iconLineEdit->setReadOnly(true); parentTagGroupLayout->addWidget(iconLineEdit, 3, 1); QPushButton* iconButton = new QPushButton(i18n("Icon"), parentTagGroup, "iconButton"); QIconSet iconSet = KGlobal::iconLoader()->loadIconSet(iconLineEdit->text(), KIcon::Small, Configuration::getInstance()->tagtreeIconSize(), true); iconButton->setIconSet(iconSet); iconButton->setText(QString::null); iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); iconButton->setEnabled(true); parentTagGroupLayout->addWidget(iconButton, 3, 2); } // newTagGroup QGroupBox* newTagGroup = new QGroupBox(i18n("New tag"), mainPanel, "newTagGroup"); QGridLayout* newTagGroupLayout = new QGridLayout(newTagGroup, 4, 4, 20, 5, "newTagGroupLayout"); newTagGroupLayout->setRowSpacing(0, 10); // type QLabel* typeLabel = new QLabel(i18n("Type"), newTagGroup, "typeLabel"); newTagGroupLayout->addWidget(typeLabel, 1, 0); m_typeComboBox = new KComboBox(false, newTagGroup, "typeComboBox"); m_typeComboBoxEntries = new QValueList<int>; if (!parentNode) { m_typeComboBox->insertItem(TagNode::tagNodeTypeName(TagNode::TYPE_TITLE)); m_typeComboBoxEntries->append(TagNode::tagNodeTypeId(TagNode::TYPE_TITLE)); } m_typeComboBox->insertItem(TagNode::tagNodeTypeName(TagNode::TYPE_BOOLEAN)); m_typeComboBoxEntries->append(TagNode::tagNodeTypeId(TagNode::TYPE_BOOLEAN)); newTagGroupLayout->addMultiCellWidget(m_typeComboBox, 1, 1, 1, 2); // name QLabel* nameLabel = new QLabel(i18n("Name"), newTagGroup, "nameLabel"); newTagGroupLayout->addWidget(nameLabel, 2, 0); m_nameLineEdit = new KLineEdit(newTagGroup, "nameLineEdit"); m_nameLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QObject::connect(m_nameLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotNameChanged(const QString&))); newTagGroupLayout->addMultiCellWidget(m_nameLineEdit, 2, 2, 1, 2); // icon QLabel* iconLabel = new QLabel(i18n("Icon"), newTagGroup, "iconLabel"); newTagGroupLayout->addWidget(iconLabel, 3, 0); m_iconLineEdit = new KLineEdit(newTagGroup, "iconLineEdit"); m_iconLineEdit->setMinimumWidth(300); m_iconLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QObject::connect(m_iconLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotIconTextChanged(const QString&))); newTagGroupLayout->addWidget(m_iconLineEdit, 3, 1); m_iconButton = new QPushButton(i18n("Icon"), newTagGroup, "iconButton"); m_iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); newTagGroupLayout->addWidget(m_iconButton, 3, 2); QObject::connect(m_iconButton, SIGNAL(clicked()), this, SLOT(slotIconButtonClicked())); // spacer QWidget* spacer = new QWidget(mainPanel, "spacer"); spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); // disable ok button validate(); // set the focus m_nameLineEdit->setFocus(); }