KWMailMergeVariableInsertDia::KWMailMergeVariableInsertDia( QWidget *parent, KWMailMergeDataBase *db ) : KDialogBase( Plain, i18n( "Mail Merge - Variable Name" ), Ok | Cancel, Ok, parent, "", true ) { m_db=db; QWidget *page = plainPage(); QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); layout->setAutoAdd( true ); QLabel *l = new QLabel( i18n( "Name:" ), page ); l->setMaximumHeight( l->sizeHint().height() ); names = new QListBox( page ); QMap< QString, QString >::ConstIterator it = db->getRecordEntries().begin(); for ( ; it != db->getRecordEntries().end(); ++it ) names->insertItem( m_db->version() ?it.data():it.key(), -1 ); setInitialSize( QSize( 350, 400 ) ); connect( names, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) ); connect( names, SIGNAL( doubleClicked( QListBoxItem* ) ), this, SLOT( slotOk() ) ); setFocus(); enableButtonOK( names->currentItem() != -1 ); }
DccRecipientDialog::DccRecipientDialog(QWidget* parent, const QStringList &list,const QSize &size) : KDialogBase(parent,"dcc_recipient_dialog",true,i18n("Select Recipient"), KDialogBase::Ok | KDialogBase::Cancel,KDialogBase::Ok,true) { // Create the top level widget QWidget* page=new QWidget(this); setMainWidget(page); // Add the layout to the widget QVBoxLayout* dialogLayout=new QVBoxLayout(page); dialogLayout->setSpacing(spacingHint()); // Add the nickname list widget KListBox* nicknameList=new KListBox(page,"recipient_list"); nicknameList->insertStringList(list); nicknameList->sort(true); nicknameInput=new KLineEdit(page,"nickname_input"); dialogLayout->addWidget(nicknameList); dialogLayout->addWidget(nicknameInput); connect(nicknameList,SIGNAL (highlighted(QListBoxItem*)),this,SLOT (newNicknameSelected(QListBoxItem*)) ); connect(nicknameList,SIGNAL (doubleClicked(QListBoxItem*)),this,SLOT (newNicknameSelectedQuit(QListBoxItem*)) ); setButtonOK(KGuiItem(i18n("&OK"),"button_ok",i18n("Select nickname and close the window"))); setButtonCancel(KGuiItem(i18n("&Cancel"),"button_cancel",i18n("Close the window without changes"))); setInitialSize(size); show(); }
TestbedWebcamDialog::TestbedWebcamDialog( const QString &contactId, QWidget * parent, const char * name ) : KDialogBase( KDialogBase::Plain, Qt::WDestructiveClose, parent, name, false, i18n( "Webcam for %1" ).arg( contactId ), KDialogBase::Close, KDialogBase::Close, true /*seperator*/ ) { setInitialSize( QSize(320,290), false ); setEscapeButton( KDialogBase::Close ); // QObject::connect( this, SIGNAL( closeClicked() ), this, SIGNAL( closingWebcamDialog() ) ); QWidget *page = plainPage(); setMainWidget(page); QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); mImageContainer = new Kopete::WebcamWidget( page ); mImageContainer->setMinimumSize(320,240); mImageContainer->setText( i18n( "No webcam image received" ) ); mImageContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); topLayout->add( mImageContainer ); show(); mVideoDevicePool = Kopete::AV::VideoDevicePool::self(); mVideoDevicePool->open(); mVideoDevicePool->setSize(320, 240); mVideoDevicePool->startCapturing(); mVideoDevicePool->getFrame(); mVideoDevicePool->getImage(&mImage); kdDebug() << "Just captured 1st frame" << endl; mPixmap=QPixmap(320,240,-1, QPixmap::DefaultOptim); if (mPixmap.convertFromImage(mImage,0) == true) mImageContainer->updatePixmap(mPixmap); connect(&qtimer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) ); qtimer.start(0,FALSE); }
RecipeImportDialog::RecipeImportDialog( const RecipeList &list, QWidget *parent ) : KDialog( parent ), list_copy( list ) { this->setObjectName( "RecipeImportDialog" ); this->setModal( true ); this->setCaption( i18nc( "@title:window", "Import Recipes" ) ); this->setButtons( KDialog::Ok | KDialog::Cancel ); this->setDefaultButton( KDialog::Ok ); setButtonsOrientation( Qt::Vertical ); KVBox *page = new KVBox( this ); setMainWidget( page ); kListView = new K3ListView( page ); kListView->addColumn( i18nc( "@title:column", "Recipes" ) ); kListView->setProperty( "selectionMode", "NoSelection" ); kListView->setRootIsDecorated( true ); kListView->setAllColumnsShowFocus( true ); languageChange(); setInitialSize( QSize( 600, 480 ).expandedTo( minimumSizeHint() ) ); loadListView(); }
XineConfig::XineConfig(const xine_t* const xine) : KDialogBase(KDialogBase::IconList, i18n("xine Engine Parameters"), KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Cancel) { setInitialSize(QSize(650,500), true); m_xine = (xine_t*)xine; QStringList cats = getCategories(); QTabWidget* tabWidget = NULL; QFrame* xineFrame = NULL; QVBoxLayout* xineLayout = NULL; QVBox* xineBeginnerPage = NULL; QVBox* xineExpertPage = NULL; QString icon; QStringList::ConstIterator end ( cats.end()); for (QStringList::ConstIterator it = cats.begin(); it != end; ++it) { // kdDebug() << "XineConfig: add page: " << *it << endl; if (*it == "audio") icon = "sound"; else if (*it == "video") icon = "video"; else if (*it == "vcd") icon = "cdrom_unmount"; else if (*it == "input") icon = "connect_established"; else if (*it == "effects") icon = "wizard"; else if (*it == "media") icon = "cdrom_unmount"; else if (*it == "subtitles") icon = "font_bitmap"; else if (*it == "osd") icon = "font_bitmap"; else if (*it == "engine") icon = "exec"; else icon = "edit"; xineFrame = addPage(*it, i18n("%1 Options").arg(*it), KGlobal::iconLoader()->loadIcon(icon, KIcon::Panel, KIcon::SizeMedium)); xineLayout = new QVBoxLayout(xineFrame, marginHint(), spacingHint()); tabWidget = new QTabWidget(xineFrame); xineLayout->addWidget(tabWidget); xineBeginnerPage = new QVBox(tabWidget); xineBeginnerPage->setMargin(5); tabWidget->addTab(xineBeginnerPage, i18n("Beginner Options")); createPage(*it, false, xineBeginnerPage); xineExpertPage = new QVBox(tabWidget); xineExpertPage->setMargin(5); tabWidget->addTab(xineExpertPage, i18n("Expert Options")); createPage(*it, true, xineExpertPage); } connect(this, SIGNAL(okClicked()), SLOT(slotOkPressed())); connect(this, SIGNAL(applyClicked()), SLOT(slotApplyPressed())); }
SieveDebugDialog::SieveDebugDialog( QWidget *parent ) : KDialog( parent ), mSieveJob( 0 ) { setCaption( i18n( "Sieve Diagnostics" ) ); setButtons( Ok ); // Collect all accounts AccountManager *am = kmkernel->acctMgr(); assert( am ); QList<KMAccount*>::iterator accountIt = am->begin(); while ( accountIt != am->end() ) { KMAccount *account = *accountIt; ++accountIt; mAccountList.append( account ); } mEdit = new KTextEdit( this ); mEdit->setReadOnly( true ); setMainWidget( mEdit ); mEdit->setText( i18n( "Collecting diagnostic information about Sieve support...\n\n" ) ); setInitialSize( QSize( 640, 480 ) ); if ( !mAccountList.isEmpty() ) QTimer::singleShot( 0, this, SLOT( slotDiagNextAccount() ) ); }
//BEGIN class ProcessingOptionsDlg ProcessingOptionsDlg::ProcessingOptionsDlg( ProjectItem * projectItem, QWidget *parent ) : KDialogBase( parent, "Processing Options Dialog", true, "Processing Options", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) { m_pProjectItem = projectItem; m_pWidget = new ProcessingOptionsWidget(this); m_pWidget->m_pMicroSelect->setEnabled( !projectItem->useParentMicroID() ); switch ( projectItem->type() ) { case ProjectItem::ProjectType: m_pWidget->m_pOutputURL->setEnabled(false); break; case ProjectItem::FileType: m_pWidget->m_pOutputURL->setEnabled(true); break; case ProjectItem::ProgramType: case ProjectItem::LibraryType: m_pWidget->m_pOutputURL->setEnabled(false); break; } m_pWidget->m_pOutputURL->setURL( projectItem->outputURL().path() ); m_pWidget->m_pMicroSelect->setMicro( projectItem->microID() ); setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
QueueManager::QueueManager( QWidget *parent, const char *name ) : KDialogBase( KDialogBase::Swallow, 0, parent, name, false, 0, Ok|Cancel ) { s_instance = this; // Gives the window a small title bar, and skips a taskbar entry KWin::setType( winId(), NET::Utility ); KWin::setState( winId(), NET::SkipTaskbar ); kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n("Queue Manager") ) ); setInitialSize( QSize( 400, 260 ) ); QVBox *mainBox = new QVBox( this ); setMainWidget( mainBox ); QHBox *box = new QHBox( mainWidget() ); box->setSpacing( 5 ); m_listview = new QueueList( box ); QVBox *buttonBox = new QVBox( box ); m_up = new KPushButton( KGuiItem( QString::null, "up" ), buttonBox ); m_down = new KPushButton( KGuiItem( QString::null, "down" ), buttonBox ); m_remove = new KPushButton( KGuiItem( QString::null, "edit_remove" ), buttonBox ); m_add = new KPushButton( KGuiItem( QString::null, "edit_add" ), buttonBox ); m_clear = new KPushButton( KGuiItem( QString::null, amaroK::icon( "playlist_clear" ) ), buttonBox ); QToolTip::add( m_up, i18n( "Move up" ) ); QToolTip::add( m_down, i18n( "Move down" ) ); QToolTip::add( m_remove, i18n( "Remove" ) ); QToolTip::add( m_add, i18n( "Enqueue track" ) ); QToolTip::add( m_clear, i18n( "Clear queue" ) ); m_up->setEnabled( false ); m_down->setEnabled( false ); m_remove->setEnabled( false ); m_add->setEnabled( false ); m_clear->setEnabled( false ); connect( m_up, SIGNAL( clicked() ), m_listview, SLOT( moveSelectedUp() ) ); connect( m_down, SIGNAL( clicked() ), m_listview, SLOT( moveSelectedDown() ) ); connect( m_remove, SIGNAL( clicked() ), this, SLOT( removeSelected() ) ); connect( m_add, SIGNAL( clicked() ), this, SLOT( addItems() ) ); connect( m_clear, SIGNAL( clicked() ), m_listview, SLOT( clear() ) ); Playlist *pl = Playlist::instance(); connect( pl, SIGNAL( selectionChanged() ), SLOT( updateButtons() ) ); connect( m_listview, SIGNAL( selectionChanged() ), SLOT( updateButtons() ) ); connect( pl, SIGNAL( queueChanged(const PLItemList &, const PLItemList &) ), SLOT( addQueuedItems(const PLItemList &, const PLItemList &) ) ); insertItems(); }
//BEGIN class LinkerOptionsDlg LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent ) : KDialogBase( parent, "Linker Options Dialog", true, "Linker Options", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) { m_pLinkerOptions = linkingOptions; m_pWidget = new LinkerOptionsWidget(this); ProjectInfo * pi = ProjectManager::self()->currentProject(); assert(pi); //BEGIN Update gplink options m_pWidget->m_pHexFormat->setCurrentItem( m_pLinkerOptions->hexFormat() ); m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() ); m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() ); m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() ); m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() ); //END Update gplink options //BEGIN Update library widgets const KURL::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType ); const QStringList linkedInternal = m_pLinkerOptions->linkedInternal(); KURL::List::const_iterator end = availableInternal.end(); for ( KURL::List::const_iterator it = availableInternal.begin(); it != end; ++it ) { QString relativeURL = KURL::relativeURL( pi->url(), *it ); QCheckListItem * item = new QCheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, QCheckListItem::CheckBox ); item->setOn( linkedInternal.contains(relativeURL) ); } m_pExternalLibraryRequester = new KURLRequester( 0l ); m_pExternalLibraryRequester->fileDialog()->setURL( "/usr/share/sdcc/lib" ); delete m_pWidget->m_pExternalLibraries; m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget ); m_pWidget->m_pExternalLibraries->layout()->setMargin(11); (dynamic_cast<QGridLayout*>(m_pWidget->layout()))->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 ); #if defined(KDE_MAKE_VERSION) # if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0) m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove ); # endif #endif m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() ); //END Update library widgets setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
ServerGroupDialog::ServerGroupDialog(const QString& title, QWidget *parent) : KDialog(parent) { setCaption(title); setButtons(Ok|Cancel); m_id = -1; m_identitiesNeedsUpdate = false; m_editedServer = false; m_mainWidget = new Ui::ServerGroupDialogUI(); m_mainWidget->setupUi(mainWidget()); mainWidget()->layout()->setMargin(0); m_mainWidget->serverWidget->layout()->setMargin(0); m_mainWidget->channelWidget->layout()->setMargin(0); connect(m_mainWidget->m_editIdentityButton, SIGNAL(clicked()), this, SLOT(editIdentity())); IdentityList identities = Preferences::identityList(); for (IdentityList::ConstIterator it = identities.constBegin(); it != identities.constEnd(); ++it) m_mainWidget->m_identityCBox->addItem((*it)->getName()); m_mainWidget->m_removeServerButton->setIcon(KIcon("list-remove")); m_mainWidget->m_upServerBtn->setIcon(KIcon("arrow-up")); m_mainWidget->m_downServerBtn->setIcon(KIcon("arrow-down")); connect(m_mainWidget->m_addServerButton, SIGNAL(clicked()), this, SLOT(addServer())); connect(m_mainWidget->m_changeServerButton, SIGNAL(clicked()), this, SLOT(editServer())); connect(m_mainWidget->m_removeServerButton, SIGNAL(clicked()), this, SLOT(deleteServer())); connect(m_mainWidget->m_serverLBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateServerArrows())); connect(m_mainWidget->m_upServerBtn, SIGNAL(clicked()), this, SLOT(moveServerUp())); connect(m_mainWidget->m_downServerBtn, SIGNAL(clicked()), this, SLOT(moveServerDown())); m_mainWidget->m_removeChannelButton->setIcon(KIcon("list-remove")); m_mainWidget->m_upChannelBtn->setIcon(KIcon("arrow-up")); m_mainWidget->m_downChannelBtn->setIcon(KIcon("arrow-down")); connect(m_mainWidget->m_addChannelButton, SIGNAL(clicked()), this, SLOT(addChannel())); connect(m_mainWidget->m_changeChannelButton, SIGNAL(clicked()), this, SLOT(editChannel())); connect(m_mainWidget->m_removeChannelButton, SIGNAL(clicked()), this, SLOT(deleteChannel())); connect(m_mainWidget->m_channelLBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateChannelArrows())); connect(m_mainWidget->m_upChannelBtn, SIGNAL(clicked()), this, SLOT(moveChannelUp())); connect(m_mainWidget->m_downChannelBtn, SIGNAL(clicked()), this, SLOT(moveChannelDown())); setButtonGuiItem(Ok, KGuiItem(i18n("&OK"), "dialog-ok", i18n("Change network information"))); setButtonGuiItem(Cancel, KGuiItem(i18n("&Cancel"), "dialog-cancel", i18n("Discards all changes made"))); m_mainWidget->m_nameEdit->setFocus(); setInitialSize(QSize(320, 400)); }
KMixWindow::KMixWindow(bool invisible) : KXmlGuiWindow(0, Qt::WindowContextHelpButtonHint), m_multiDriverMode(false), // -<- I never-ever want the multi-drivermode to be activated by accident m_dockWidget(), m_dsm(0), m_dontSetDefaultCardOnStart(false) { setObjectName(QLatin1String("KMixWindow")); // disable delete-on-close because KMix might just sit in the background waiting for cards to be plugged in setAttribute(Qt::WA_DeleteOnClose, false); initActions(); // init actions first, so we can use them in the loadConfig() already loadConfig(); // Load config before initMixer(), e.g. due to "MultiDriver" keyword initActionsLate(); // init actions that require a loaded config KGlobal::locale()->insertCatalog(QLatin1String("kmix-controls")); initWidgets(); initPrefDlg(); DBusMixSetWrapper::initialize(this, "/Mixers"); MixerToolBox::instance()->initMixer(m_multiDriverMode, m_backendFilter, m_hwInfoString); KMixDeviceManager *theKMixDeviceManager = KMixDeviceManager::instance(); initActionsAfterInitMixer(); // init actions that require initialized mixer backend(s). recreateGUI(false); if (m_wsMixers->count() < 1) { // Something is wrong. Perhaps a hardware or driver or backend change. Let KMix search harder recreateGUI(false, QString(), true); } if (!kapp->isSessionRestored() ) // done by the session manager otherwise setInitialSize(); fixConfigAfterRead(); theKMixDeviceManager->initHotplug(); connect(theKMixDeviceManager, SIGNAL(plugged(const char*,QString,QString&)), SLOT (plugged(const char*,QString,QString&))); connect(theKMixDeviceManager, SIGNAL(unplugged(QString)), SLOT (unplugged(QString))); if (m_startVisible && !invisible) show(); // Started visible connect(kapp, SIGNAL(aboutToQuit()), SLOT(saveConfig()) ); ControlManager::instance().addListener( QString(), // All mixers (as the Global master Mixer might change) (ControlChangeType::Type)(ControlChangeType::ControlList | ControlChangeType::MasterChanged), this, QString("KMixWindow") ); // Send an initial volume refresh (otherwise all volumes are 0 until the next change) ControlManager::instance().announce(QString(), ControlChangeType::Volume, QString("Startup")); }
//BEGIN class CreateSubprojectDlg CreateSubprojectDlg::CreateSubprojectDlg( QWidget * parent ) : KDialogBase( parent, "Create Subproject Dialog", true, "Create Subproject", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) { m_pWidget = new CreateSubprojectWidget(this); if ( ProjectManager::self()->currentProject() ) m_pWidget->m_targetFile->setURL( ProjectManager::self()->currentProject()->directory() ); m_type = ProgramType; setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
ConfigDialog::ConfigDialog(QWidget *parent, KActionCollection *collection, RecordItNowPluginManager *manager) : KConfigDialog(parent, "settings", Settings::self()), m_pluginManager(manager), m_collection(collection) { Q_ASSERT(m_pluginManager); setAttribute(Qt::WA_DeleteOnClose); setInitialSize(QSize(600, 550)); init(); }
PMObjectSelect::PMObjectSelect( QWidget* parent, const char* name, bool modal ) : KDialogBase( parent, name, modal, i18n( "Choose Object" ), Ok | Cancel ) { m_pSelectedObject = 0; m_pListBox = new QListBox( this ); setMainWidget( m_pListBox ); setInitialSize( s_size ); connect( m_pListBox, SIGNAL( highlighted( QListBoxItem* ) ), SLOT( slotHighlighted( QListBoxItem* ) ) ); connect( m_pListBox, SIGNAL( selected( QListBoxItem* ) ), SLOT( slotSelected( QListBoxItem* ) ) ); enableButtonOK( false ); }
KornSubjectsDlg::KornSubjectsDlg(QWidget *parent) : KDialogBase(parent, "urldialog", true, "test", Close, Close, true), _mailDrop(new QPtrList< KMailDrop >), _subjects(0), _delete(0), mailDlg(0), _canDeleteMaildrop(true) { _loadSubjectsCanceled = false; setModal(true); // The dialog contains a list view and several buttons. // Two box layouts hol dthem. QWidget *page = new QWidget(this); setMainWidget(page); invertSelButton = new KPushButton(i18n("&Invert Selection"), page); clearSelButton = new KPushButton(i18n("&Remove Selection"), page); deleteButton = new KPushButton(i18n("&Delete"), page); showButton = new KPushButton(i18n("&Show"), page); deleteButton->setEnabled(false); showButton->setEnabled(false); QVBoxLayout *topLayout = new QVBoxLayout(page, 0, spacingHint()); QHBoxLayout *buttons = new QHBoxLayout(); _list = new KListView(page); topLayout->addWidget(_list, 10); topLayout->addLayout(buttons, 0); buttons->addWidget(invertSelButton, 0); buttons->addWidget(clearSelButton, 0); buttons->addWidget(deleteButton, 0); buttons->addWidget(showButton, 0); buttons->addStretch(10); // feed the list view with its colums _list->setSelectionMode(QListView::Multi); _list->addColumn(i18n("From")); _list->addColumn(i18n("Subject")); _list->addColumn(i18n("Date")); _list->addColumn(i18n("Size (Bytes)")); // column 3 contains a number (change alignment) _list->setColumnAlignment(3, Qt::AlignRight); _list->setItemMargin(3); // connect the selection changed and double click events of the list view connect(_list, SIGNAL(selectionChanged()), this, SLOT(listSelectionChanged())); connect(_list, SIGNAL(executed(QListViewItem *)), this, SLOT(doubleClicked(QListViewItem *))); // connect the buttons connect(invertSelButton, SIGNAL(clicked()), this, SLOT(invertSelection())); connect(clearSelButton, SIGNAL(clicked()), this, SLOT(removeSelection())); connect(showButton, SIGNAL(clicked()), this, SLOT(showMessage())); connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteMessage())); setInitialSize(QSize(QApplication::desktop()->width(), QApplication::desktop()->height())); }
CodeViewerDialog::CodeViewerDialog ( QWidget* parent, CodeDocument * doc, Settings::CodeViewerState state, const char* name, bool modal, Qt::WFlags fl ) : KDialog ( parent, fl ), m_state(state) { setObjectName(name); uDebug() << "setObjectName(" << name << ")"; setModal(modal); setButtons(KDialog::Cancel); setupUi(mainWidget()); setInitialSize(QSize(630, 730)); initGUI(name); addCodeDocument(doc); connect(this, SIGNAL(cancelClicked()), mainWidget(), SLOT(close())); }
/// Pixmap Collection Editor Dialog PixmapCollectionEditor::PixmapCollectionEditor(PixmapCollection *collection, QWidget *parent) : KDialog(parent, "pixcollection_dialog", true, i18n("Edit Pixmap Collection: %1", collection->collectionName()), Close, Close, false) { m_collection = collection; QFrame *frame = makeMainWidget(); QHBoxLayout *l = new QHBoxLayout(frame); setInitialSize(QSize(400, 200), true); //// Setup the icon toolbar ///////////////// QVBoxLayout *vlayout = new QVBoxLayout(l); QToolButton *newItemPath = new QToolButton(frame); newItemPath->setIconSet(koIcon("document-open")); newItemPath->setTextLabel(i18n("&Add File"), true); vlayout->addWidget(newItemPath); m_buttons.insert(BNewItemPath, newItemPath); connect(newItemPath, SIGNAL(clicked()), this, SLOT(newItemByPath())); QToolButton *newItemName = new QToolButton(frame); newItemName->setIconSet(koIcon("list-add")); newItemName->setTextLabel(i18n("&Add an Icon"), true); vlayout->addWidget(newItemName); m_buttons.insert(BNewItemName, newItemName); connect(newItemName, SIGNAL(clicked()), this, SLOT(newItemByName())); QToolButton *delItem = new QToolButton(frame); delItem->setIconSet(koIcon("list-remove")); delItem->setTextLabel(i18n("&Remove Selected Item"), true); vlayout->addWidget(delItem); m_buttons.insert(BDelItem, delItem); connect(delItem, SIGNAL(clicked()), this, SLOT(removeItem())); vlayout->addStretch(); // Setup the iconView m_iconView = new K3IconView(frame, "pixcollection_iconView"); m_iconView->resize(100, 100); m_iconView->setArrangement(Q3IconView::LeftToRight); m_iconView->setAutoArrange(true); m_iconView->setMode(K3IconView::Select); l->addWidget(m_iconView); connect(m_iconView, SIGNAL(contextMenuRequested(Q3IconViewItem*,QPoint)), this, SLOT(displayMenu(Q3IconViewItem*,QPoint))); connect(m_iconView, SIGNAL(itemRenamed(Q3IconViewItem*,QString)), this, SLOT(renameCollectionItem(Q3IconViewItem*,QString))); PixmapMap::ConstIterator it; PixmapMap::ConstIterator endIt = collection->m_pixmaps.end(); for (it = collection->m_pixmaps.constBegin(); it != endIt; ++it) createIconViewItem(it.key()); }
//BEGIN class NewProjectDlg NewProjectDlg::NewProjectDlg( QWidget * parent ) : KDialogBase( parent, "newprojectdlg", true, "New Project", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) { m_pWidget = new NewProjectWidget(this); connect( m_pWidget->projectNameEdit, SIGNAL(textChanged(const QString & )), this, SLOT(locationChanged(const QString& )) ); connect( m_pWidget->projectLocationURL, SIGNAL(textChanged(const QString & )), this, SLOT(locationChanged(const QString& )) ); // Check if already valid dir locationChanged( QString::null ); m_pWidget->projectLocationURL->setURL( QDir::homeDirPath() ); m_pWidget->projectLocationURL->setMode( KFile::Directory ); setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
KoFilterChooser::KoFilterChooser(QWidget *parent, const QStringList &mimeTypes, const QString &nativeFormat, const KUrl &url) : KDialog(parent), m_mimeTypes(mimeTypes) { setObjectName("kofilterchooser"); setInitialSize(QSize(300, 350)); setButtons(KDialog::Ok|KDialog::Cancel); setDefaultButton(KDialog::Ok); setCaption(i18n("Choose Filter")); setModal(true); QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *layout = new QVBoxLayout(page); if (url.isValid()) { KSqueezedTextLabel *l = new KSqueezedTextLabel(url.path(), page); layout->addWidget(l); } m_filterList = new QListWidget(page); layout->addWidget(m_filterList); page->setLayout(layout); Q_ASSERT(!m_mimeTypes.isEmpty()); for (QStringList::ConstIterator it = m_mimeTypes.constBegin(); it != m_mimeTypes.constEnd(); it++) { KMimeType::Ptr mime = KMimeType::mimeType(*it); const QString name = mime ? mime->comment() : *it; if (! name.isEmpty()) m_filterList->addItem(name); } if (nativeFormat == "application/x-kword") { const int index = m_mimeTypes.indexOf("text/plain"); if (index > -1) m_filterList->setCurrentRow(index); } if (m_filterList->currentRow() == -1) m_filterList->setCurrentRow(0); m_filterList->setFocus(); connect(m_filterList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(accept())); resize(QSize(520, 400));//.expandedTo(minimumSizeHint())); }
KolabWizard::KolabWizard() : KConfigWizard( new KolabPropagator ) { QFrame *page = createWizardPage( i18n("Kolab Server") ); QGridLayout *topLayout = new QGridLayout( page ); topLayout->setSpacing( spacingHint() ); QLabel *label = new QLabel( i18n("Server name:"), page ); topLayout->addWidget( label, 0, 0 ); mServerEdit = new KLineEdit( page ); topLayout->addWidget( mServerEdit, 0, 1 ); label = new QLabel( i18n("Email address:"), page ); topLayout->addWidget( label, 1, 0 ); mUserEdit = new KLineEdit( page ); topLayout->addWidget( mUserEdit, 1, 1 ); QWhatsThis::add(mUserEdit, i18n("Your email address on the Kolab Server. " "Format: <i>[email protected]</i>")); label = new QLabel( i18n("Real name:"), page ); topLayout->addWidget( label, 2, 0 ); mRealNameEdit = new KLineEdit( page ); topLayout->addWidget( mRealNameEdit, 2, 1 ); label = new QLabel( i18n("Password:"******"Save password"), page ); topLayout->addMultiCellWidget( mSavePasswordCheck, 4, 4, 0, 1 ); topLayout->setRowStretch( 4, 1 ); mUseOnlineForNonGroupwareCheck = new QCheckBox( i18n("Use an online IMAP account for non-groupware folders"), page ); topLayout->addMultiCellWidget( mUseOnlineForNonGroupwareCheck, 5, 5, 0, 1 ); topLayout->setRowStretch( 5, 1 ); QButtonGroup *bg = new QHButtonGroup(i18n("Server Version"), page ); QWhatsThis::add( bg, i18n("Choose the version of the Kolab Server you are using.") ); mKolab1 = new QRadioButton( i18n ( "Kolab 1" ), bg ); mKolab2 = new QRadioButton( i18n ( "Kolab 2" ), bg ); topLayout->addMultiCellWidget( bg, 6, 6, 0, 1 ); setInitialSize( QSize( 600, 300 ) ); }
KisFilterChooser::KisFilterChooser(QWidget *parent, const QStringList &mimeTypes, const QString &/*nativeFormat*/, const QUrl &url) : KoDialog(parent), m_mimeTypes(mimeTypes) { setObjectName("kofilterchooser"); setInitialSize(QSize(300, 350)); setButtons(KoDialog::Ok|KoDialog::Cancel); setDefaultButton(KoDialog::Ok); setCaption(i18n("Choose Filter")); setModal(true); QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *layout = new QVBoxLayout(page); if (url.isValid()) { KSqueezedTextLabel *l = new KSqueezedTextLabel(url.path(), page); layout->addWidget(l); } m_filterList = new QListWidget(page); layout->addWidget(m_filterList); page->setLayout(layout); Q_ASSERT(!m_mimeTypes.isEmpty()); for (QStringList::ConstIterator it = m_mimeTypes.constBegin(); it != m_mimeTypes.constEnd(); ++it) { QMimeDatabase db; QMimeType mime = db.mimeTypeForName(*it); const QString name = mime.isValid() ? mime.comment() : *it; if (! name.isEmpty()) { QListWidgetItem *item = new QListWidgetItem(name, m_filterList); item->setData(32, *it); } } m_filterList->sortItems(); if (m_filterList->currentRow() == -1) m_filterList->setCurrentRow(0); m_filterList->setFocus(); connect(m_filterList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(accept())); resize(QSize(520, 400));//.expandedTo(minimumSizeHint())); }
IRCWebcamDialog::IRCWebcamDialog( const QString &contactId, QWidget * parent ) : KDialog( parent ) { setCaption( i18n( "Webcam for %1", contactId ) ); setButtons( KDialog::Close ); setDefaultButton( KDialog::Close ); showButtonSeparator( true ); setAttribute( Qt::WA_DeleteOnClose ); setInitialSize( QSize(320,290) ); setEscapeButton( KDialog::Close ); // QObject::connect( this, SIGNAL(closeClicked()), this, SIGNAL(closingWebcamDialog()) ); QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *topLayout = new QVBoxLayout( page ); mImageContainer = new Kopete::WebcamWidget( page ); mImageContainer->setMinimumSize(320,240); mImageContainer->setText( i18n( "No webcam image received" ) ); mImageContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); topLayout->addWidget( mImageContainer ); show(); #ifndef VIDEOSUPPORT_DISABLED mVideoDevicePool = Kopete::AV::VideoDevicePool::self(); mVideoDevicePool->open(); mVideoDevicePool->setImageSize(320, 240); mVideoDevicePool->startCapturing(); if (EXIT_SUCCESS == mVideoDevicePool->getFrame()) { mVideoDevicePool->getImage(&mImage); mPixmap=QPixmap::fromImage(mImage); if (!mPixmap.isNull()) mImageContainer->updatePixmap(mPixmap); } connect(&qtimer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) ); qtimer.setSingleShot(false); qtimer.start(0); #endif }
//BEGIN class CreateSubprojectDlg CreateSubprojectDlg::CreateSubprojectDlg( QWidget * parent ) : // KDialog( parent, "Create Subproject Dialog", true, "Create Subproject", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true ) KDialog( parent ) // , "Create Subproject Dialog", true, "Create Subproject", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true ) { setObjectName("Create Subproject Dialog"); setModal(true); setCaption(i18n("Create Subproject")); setButtons(KDialog::Ok|KDialog::Cancel); setDefaultButton(KDialog::Ok); showButtonSeparator(true); m_pWidget = new CreateSubprojectWidget(this); if ( ProjectManager::self()->currentProject() ) m_pWidget->m_targetFile->setUrl( ProjectManager::self()->currentProject()->directory() ); m_type = ProgramType; setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
DiagnosticDialog::DiagnosticDialog( const KAboutData *aboutData, QWidget *parent ) : KDialog( parent ) { if( aboutData == 0 ) aboutData = KGlobal::mainComponent().aboutData(); m_textBox = new QPlainTextEdit( generateReport( aboutData ), this ); setPlainCaption( i18nc( "%1 is the program name", "%1 Diagnostics", aboutData->programName() ) ); setButtons( Close | User1 ); setButtonText( User1, i18n( "Copy to Clipboard" ) ); m_textBox->setReadOnly( true ); setMainWidget( m_textBox ); setInitialSize( QSize( 480, 460 ) ); connect( this, SIGNAL(user1Clicked()), SLOT(slotCopyToClipboard()) ); connect( this, SIGNAL(finished()), SLOT(deleteLater()) ); }
MultilineEdit::MultilineEdit(QWidget* parent, const QString& text) : KDialogBase(parent,"multiline_edit_dialog",true,i18n("Edit Multiline Paste"), KDialogBase::User1 | KDialogBase::Ok | KDialogBase::Cancel,KDialogBase::Ok,true, KGuiItem(i18n("Add &Quotation Indicators"))) { // Create the top level widget QWidget* page=new QWidget(this); setMainWidget(page); // Add the layout to the widget QVBoxLayout* dialogLayout=new QVBoxLayout(page); dialogLayout->setSpacing(spacingHint()); // add the text editor textEditor=new MultilineTextEdit(page,"multiline_text_editor"); textEditor->setTextFormat(PlainText); textEditor->setText(text); returnText=text; dialogLayout->addWidget(textEditor); setInitialSize(Preferences::multilineEditSize()); show(); }
SieveDebugDialog::SieveDebugDialog( QWidget *parent, const char *name ) : KDialogBase( parent, name, true, i18n( "Sieve Diagnostics" ), KDialogBase::Ok, KDialogBase::Ok, true ), mSieveJob( 0 ) { // Collect all accounts AccountManager *am = kmkernel->acctMgr(); assert( am ); for ( KMAccount *a = am->first(); a; a = am->next() ) mAccountList.append( a ); mEdit = new QTextEdit( this ); mEdit->setReadOnly(true); setMainWidget( mEdit ); mEdit->setText( i18n( "Collecting diagnostic information about Sieve support...\n\n" ) ); setInitialSize( QSize( 640, 480 ) ); if ( !mAccountList.isEmpty() ) QTimer::singleShot( 0, this, SLOT( slotDiagNextAccount() ) ); }
//BEGIN class ProcessingOptionsDlg ProcessingOptionsDlg::ProcessingOptionsDlg( ProjectItem * projectItem, QWidget *parent ) : // KDialog( parent, "Processing Options Dialog", true, "Processing Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true ) KDialog( parent ) // , "Processing Options Dialog", true, "Processing Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true ) { setObjectName("Processing Options Dialog"); setModal(true); setCaption(i18n("Processing Options")); setButtons(KDialog::Ok|KDialog::Cancel); setDefaultButton(KDialog::Ok); showButtonSeparator(true); m_pProjectItem = projectItem; m_pWidget = new ProcessingOptionsWidget(this); m_pWidget->m_pMicroSelect->setEnabled( !projectItem->useParentMicroID() ); switch ( projectItem->type() ) { case ProjectItem::ProjectType: m_pWidget->m_pOutputURL->setEnabled(false); break; case ProjectItem::FileType: m_pWidget->m_pOutputURL->setEnabled(true); break; case ProjectItem::ProgramType: case ProjectItem::LibraryType: m_pWidget->m_pOutputURL->setEnabled(false); break; } m_pWidget->m_pOutputURL->setUrl( projectItem->outputURL().path() ); m_pWidget->m_pMicroSelect->setMicro( projectItem->microID() ); setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
//// A Dialog to choose a pixmap from the PixmapCollection PixmapCollectionChooser::PixmapCollectionChooser(PixmapCollection *collection, const QString &selectedItem, QWidget *parent) : KDialog(parent, "pixchoose_dialog", true, i18n("Select Pixmap From %1", collection->collectionName()), User1 | Ok | Cancel, Ok, false, KGuiItem(i18n("Edit Collection..."))) { m_collection = collection; setInitialSize(QSize(400, 200), true); m_iconView = new K3IconView(this, "pixchooser_iconView"); setMainWidget(m_iconView); m_iconView->setArrangement(Q3IconView::LeftToRight); m_iconView->setAutoArrange(true); m_iconView->setMode(K3IconView::Select); PixmapMap::ConstIterator it; PixmapMap::ConstIterator endIt = collection->m_pixmaps.constEnd(); for (it = collection->m_pixmaps.constBegin(); it != endIt; ++it) new PixmapIconViewItem(m_iconView, it.key(), getPixmap(it.key())); Q3IconViewItem *item = m_iconView->findItem(selectedItem, Qt::ExactMatch); if (item && !selectedItem.isEmpty()) m_iconView->setCurrentItem(item); }
//BEGIN class NewProjectDlg NewProjectDlg::NewProjectDlg( QWidget * parent ) : // KDialog( parent, "newprojectdlg", true, "New Project", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true ) KDialog( parent ) //, "newprojectdlg", true, "New Project", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true ) { setObjectName("newprojectdlg"); setModal(true); setCaption(i18n("New Project")); setButtons(KDialog::Ok | KDialog::Cancel); setDefaultButton(KDialog::Ok); showButtonSeparator(true); m_pWidget = new NewProjectWidget(this); connect( m_pWidget->projectNameEdit, SIGNAL(textChanged(const QString & )), this, SLOT(locationChanged(const QString& )) ); connect( m_pWidget->projectLocationURL, SIGNAL(textChanged(const QString & )), this, SLOT(locationChanged(const QString& )) ); // Check if already valid dir locationChanged( QString::null ); m_pWidget->projectLocationURL->setUrl( QDir::homePath() ); m_pWidget->projectLocationURL->setMode( KFile::Directory ); setMainWidget( m_pWidget ); setInitialSize( m_pWidget->rect().size() ); }
AboutPlugins::AboutPlugins( Config *_config, QWidget* parent, Qt::WFlags f ) : KDialog( parent, f ), config( _config ), currentPlugin( 0 ) { setCaption( i18n("About plugins") ); setWindowIcon( KIcon("preferences-plugin") ); setButtons( KDialog::Close ); setButtonFocus( KDialog::Close ); QWidget *widget = new QWidget( this ); setMainWidget( widget ); QHBoxLayout *box = new QHBoxLayout( widget ); QVBoxLayout *pluginListBox = new QVBoxLayout( widget ); box->addLayout( pluginListBox ); QLabel *installedPlugins = new QLabel( i18n("Installed plugins:"), this ); pluginListBox->addWidget( installedPlugins ); QListWidget *pluginsList = new QListWidget( this ); pluginListBox->addWidget( pluginsList ); connect( pluginsList, SIGNAL(currentTextChanged(const QString&)), this, SLOT(currentPluginChanged(const QString&)) ); QStringList pluginNames; QList<CodecPlugin*> codecPlugins = config->pluginLoader()->getAllCodecPlugins(); for( int i=0; i<codecPlugins.count(); i++ ) { pluginNames += codecPlugins.at(i)->name(); } pluginNames.sort(); pluginsList->addItems( pluginNames ); pluginNames.clear(); QList<FilterPlugin*> filterPlugins = config->pluginLoader()->getAllFilterPlugins(); for( int i=0; i<filterPlugins.count(); i++ ) { pluginNames += filterPlugins.at(i)->name(); } pluginNames.sort(); pluginsList->addItems( pluginNames ); pluginNames.clear(); QList<ReplayGainPlugin*> replaygainPlugins = config->pluginLoader()->getAllReplayGainPlugins(); for( int i=0; i<replaygainPlugins.count(); i++ ) { pluginNames += replaygainPlugins.at(i)->name(); } pluginNames.sort(); pluginsList->addItems( pluginNames ); pluginNames.clear(); QList<RipperPlugin*> ripperPlugins = config->pluginLoader()->getAllRipperPlugins(); for( int i=0; i<ripperPlugins.count(); i++ ) { pluginNames += ripperPlugins.at(i)->name(); } pluginNames.sort(); pluginsList->addItems( pluginNames ); pluginsList->setFixedWidth( 180 ); box->addSpacing( 10 ); QVBoxLayout *pluginInfoBox = new QVBoxLayout( widget ); box->addLayout( pluginInfoBox ); aboutPluginLabel = new QLabel( this ); aboutPluginLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); aboutPluginLabel->setWordWrap( true ); aboutPluginLabel->setTextFormat( Qt::RichText ); pluginInfoBox->addWidget( aboutPluginLabel ); connect( aboutPluginLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(showProblemInfo(const QString&)) ); pluginInfoBox->addStretch(); QHBoxLayout *configurePluginBox = new QHBoxLayout( widget ); pluginInfoBox->addLayout( configurePluginBox ); configurePlugin = new KPushButton( KIcon("configure"), "", widget ); configurePlugin->hide(); configurePluginBox->addWidget( configurePlugin ); configurePluginBox->addStretch(); connect( configurePlugin, SIGNAL(clicked()), this, SLOT(configurePluginClicked()) ); pluginsList->setCurrentRow(0); QListWidgetItem *currentItem = pluginsList->currentItem(); if( currentItem ) { currentPluginChanged( currentItem->text() ); } setInitialSize( QSize(500,300) ); KSharedConfig::Ptr conf = KGlobal::config(); KConfigGroup group = conf->group( "AboutPlugins" ); restoreDialogSize( group ); }