void ProgressDialog::setupGui(const QString& heading) { QVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing(10); QWidget* headingBox = new QWidget(vbox); QHBoxLayout* hboxLayout = new QHBoxLayout(headingBox); QLabel* textLabel = new QLabel(heading, headingBox); textLabel->setMinimumWidth(textLabel->sizeHint().width()); textLabel->setFixedHeight(textLabel->sizeHint().height()); hboxLayout->addWidget(textLabel); hboxLayout->addStretch(); d->gear = new KAnimWidget(QString("kde"), 32, headingBox); d->gear->setFixedSize(32, 32); hboxLayout->addWidget(d->gear); d->resultbox = new QListBox(vbox); d->resultbox->setSelectionMode(QListBox::NoSelection); QFontMetrics fm(d->resultbox->fontMetrics()); d->resultbox->setMinimumSize(fm.width("0")*70, fm.lineSpacing()*8); resize(sizeHint()); }
MediumPluginManagerDialog::MediumPluginManagerDialog() : KDialogBase( amaroK::mainWindow(), "mediumpluginmanagerdialog", false, QString::null, Ok|Cancel, Ok ) { kapp->setTopWidget( this ); setCaption( kapp->makeStdCaption( i18n( "Manage Devices and Plugins" ) ) ); QVBox* vbox = makeVBoxMainWidget(); vbox->setSpacing( KDialog::spacingHint() ); vbox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); m_location = new QGroupBox( 1, Qt::Vertical, i18n( "Devices" ), vbox ); m_location->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); m_devicesBox = new QVBox( m_location ); m_devicesBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); m_manager = new MediumPluginManager( m_devicesBox ); QHBox *hbox = new QHBox( vbox ); KPushButton *detectDevices = new KPushButton( i18n( "Autodetect Devices" ), hbox); detectDevices->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( detectDevices, SIGNAL( clicked() ), m_manager, SLOT( redetectDevices() ) ); KPushButton *addButton = new KPushButton( i18n( "Add Device..." ), hbox ); addButton->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( addButton, SIGNAL( clicked() ), m_manager, SLOT( newDevice() ) ); }
KServiceSelectDlg::KServiceSelectDlg(const QString & /*serviceType*/, const QString & /*value*/, QWidget *parent) : KDialogBase(parent, "serviceSelectDlg", true, i18n("Add Service"), Ok | Cancel, Ok) { QVBox *vbox = new QVBox(this); vbox->setSpacing(KDialog::spacingHint()); new QLabel(i18n("Select service:"), vbox); m_listbox = new KListBox(vbox); // Can't make a KTrader query since we don't have a servicetype to give, // we want all services that are not applications....... // So we have to do it the slow way // ### Why can't we query for KParts/ReadOnlyPart as the servicetype? Should work fine! KService::List allServices = KService::allServices(); QValueListIterator< KService::Ptr > it(allServices.begin()); for(; it != allServices.end(); ++it) if((*it)->hasServiceType("KParts/ReadOnlyPart")) { m_listbox->insertItem(new KServiceListItem((*it), KServiceListWidget::SERVICELIST_SERVICES)); } m_listbox->sort(); m_listbox->setMinimumHeight(350); m_listbox->setMinimumWidth(300); connect(m_listbox, SIGNAL(doubleClicked(QListBoxItem *)), SLOT(slotOk())); setMainWidget(vbox); }
KHLogin::KHLogin(QWidget *parent ) : KDialogBase(parent, "KHLogin", true, i18n("Log in"), User1 |KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true) { QVBox *page = makeVBoxMainWidget(); page->setMargin(5); page->setLineWidth(4); page->setMidLineWidth(4); page->setFrameStyle (QFrame::Box | QFrame::Raised ); QVGroupBox *m_container = new QVGroupBox(i18n("Select your player"),page); m_selector = new KHSelectUser(m_container); m_selector->readPlayers(true); connect(m_selector, SIGNAL(playerSelected()), this, SLOT(setPlayerInformation())); QVBox *m_infoBox = new QVBox(m_container); m_labelName = new QLabel(i18n("Name: "), m_container); m_labelElo = new QLabel(i18n("Elo: "), m_container); m_labelType = new QLabel(i18n("Type: "), m_container); new KSeparator(m_container); new QLabel(i18n("Login"), m_container); m_login = new KLineEdit(m_container); new QLabel(i18n("Password"), m_container); m_password = new KLineEdit(m_container); setModal(true); setButtonGuiItem (KDialogBase::User1, KGuiItem( i18n("Create a new user"), SmallIcon("penguin"), i18n("Click to create new user"), i18n("Clicking this button you can create a new user") )); hide(); }
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())); }
QWidget *KasTaskItem::createTaskProps( QObject *target, QWidget *parent, bool recursive ) { QVBox *vb = new QVBox( parent ); vb->setSpacing( KDialog::spacingHint() ); vb->setMargin( KDialog::marginHint() ); // Create List View KListView *taskprops = new KListView( vb, "props_view" ); taskprops->setResizeMode( QListView::LastColumn ); taskprops->addColumn( i18n("Property"), 0 ); taskprops->addColumn( i18n("Type"), 0 ); taskprops->addColumn( i18n("Value") ); // Create List Items QMetaObject *mo = target->metaObject(); for ( int i = 0; i < mo->numProperties( recursive ); i++ ) { const QMetaProperty *p = mo->property(i, recursive); (void) new KListViewItem( taskprops, p->name(), p->type(), target->property( p->name() ).toString() ); } return vb; }
/**Initializes the view of this widget*/ void BibleTime::initView() { KStartupLogo::setStatusMessage(i18n("Creating BibleTime's GUI") + QString("...")); m_mainSplitter = new QSplitter(this, "mainsplitter"); m_mainSplitter->setChildrenCollapsible(false); setCentralWidget(m_mainSplitter); m_leftPaneSplitter = new QSplitter(Qt::Vertical, m_mainSplitter); m_leftPaneSplitter->setChildrenCollapsible(false); QVBox* vBox = new QVBox(m_leftPaneSplitter); vBox->setMinimumSize(100, 100); QLabel* bookshelfLabel = new QLabel( i18n("Bookshelf"), vBox ); bookshelfLabel->setMargin(5); m_mainIndex = new CMainIndex(vBox); m_infoDisplay = new CInfoDisplay(m_leftPaneSplitter); CPointers::setInfoDisplay(m_infoDisplay); m_mdi = new CMDIArea(m_mainSplitter, "mdiarea" ); m_mdi->setMinimumSize(100, 100); m_mdi->setFocusPolicy(ClickFocus); m_helpMenu = new KHelpMenu(this, KGlobal::instance()->aboutData(), true, actionCollection()); }
KHTMLImage::KHTMLImage(QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, KHTMLPart::GUIProfile prof) : KParts::ReadOnlyPart(parent, name), m_image(0) { KHTMLPart *parentPart = ::qt_cast< KHTMLPart * >(parent); setInstance(KHTMLImageFactory::instance(), prof == KHTMLPart::BrowserViewGUI && !parentPart); QVBox *box = new QVBox(parentWidget, widgetName); m_khtml = new KHTMLPart(box, widgetName, this, "htmlimagepart", prof); m_khtml->setAutoloadImages(true); m_khtml->widget()->installEventFilter(this); connect(m_khtml->view(), SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); setWidget(box); // VBox can't take focus, so pass it on to sub-widget box->setFocusProxy(m_khtml->widget()); m_ext = new KHTMLImageBrowserExtension(this, "be"); // Remove unnecessary actions. KAction *encodingAction = actionCollection()->action("setEncoding"); if(encodingAction) { encodingAction->unplugAll(); delete encodingAction; } KAction *viewSourceAction = actionCollection()->action("viewDocumentSource"); if(viewSourceAction) { viewSourceAction->unplugAll(); delete viewSourceAction; } KAction *selectAllAction = actionCollection()->action("selectAll"); if(selectAllAction) { selectAllAction->unplugAll(); delete selectAllAction; } // forward important signals from the khtml part // forward opening requests to parent frame (if existing) KHTMLPart *p = ::qt_cast< KHTMLPart * >(parent); KParts::BrowserExtension *be = p ? p->browserExtension() : m_ext; connect(m_khtml->browserExtension(), SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &)), be, SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &))); connect(m_khtml->browserExtension(), SIGNAL(popupMenu(KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t)), m_ext, SIGNAL(popupMenu(KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t))); connect(m_khtml->browserExtension(), SIGNAL(enableAction(const char *, bool)), m_ext, SIGNAL(enableAction(const char *, bool))); m_ext->setURLDropHandlingEnabled(true); }
KReferDialog::KReferDialog( KPhoneView * phv,int kcwn,QString uPrefix,QWidget *parent, const char *name ) : QDialog( parent, name, true ) { phoneView=phv; kcwNumber= kcwn; userPrefix=uPrefix; phoneBook = 0; QVBox *vbox = new QVBox( this ); vbox->setMargin( 3 ); vbox->setSpacing( 3 ); QVBoxLayout *vboxl = new QVBoxLayout( this, 5 ); vboxl->addWidget( vbox ); (void) new QLabel( tr("Refer-to URI:"), vbox ); touri = new QLineEdit( vbox ); touri->setMinimumWidth( fontMetrics().maxWidth() * 20 ); QHBoxLayout *buttonBox; buttonBox = new QHBoxLayout( vboxl, 6 ); loadUri = new QPushButton( "", this ); QIconSet icon; icon.setPixmap(SHARE_DIR "/icons/phonebook.png", QIconSet::Automatic ); loadUri->setIconSet( icon ); loadUri->setFixedWidth( loadUri->fontMetrics().maxWidth() * 2 ); buttonBox->addWidget( loadUri ); helpPushButton = new QPushButton( this, tr("help button") ); helpPushButton->setText( tr("&help...") ); helpPushButton->setEnabled( FALSE ); buttonBox->addWidget( helpPushButton ); QSpacerItem *spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); buttonBox->addItem( spacer ); okPushButton = new QPushButton( this, tr("ok button") ); okPushButton->setText( "OK" ); okPushButton->setDefault( TRUE ); buttonBox->addWidget( okPushButton ); cancelPushButton = new QPushButton( this,tr( "cancel button") ); cancelPushButton->setText( tr("Cancel") ); cancelPushButton->setAccel( Key_Escape ); buttonBox->addWidget( cancelPushButton ); connect( loadUri, SIGNAL( clicked() ), this, SLOT( getUri() ) ); connect( okPushButton, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); connect( cancelPushButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); }
NotesControl::NotesControl( QWidget *, const char * ) : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) // : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) { Config cfg("Notes"); cfg.setGroup("Options"); m_showMax = cfg.readBoolEntry("ShowMax", false); setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); m_loaded = false; m_edited = false; QVBox *vbox = new QVBox( this, "Vlayout" ); QHBox *hbox = new QHBox( this, "HLayout" ); m_editArea = new QMultiLineEdit( vbox, "OpieNotesView" ); m_notesList = new QListBox( vbox, "OpieNotesBox" ); QPEApplication::setStylusOperation( m_notesList->viewport(), QPEApplication::RightOnHold ); m_notesList->setFixedHeight( 50 ); vbox->setMargin( 6 ); vbox->setSpacing( 3 ); setFocusPolicy(QWidget::StrongFocus); newButton = new QPushButton( hbox, "newButton" ); newButton->setText(tr("New")); saveButton = new QPushButton( hbox, "saveButton" ); saveButton->setText(tr("Save")); deleteButton = new QPushButton( hbox, "deleteButton" ); deleteButton->setText(tr("Delete")); connect( m_notesList, SIGNAL( mouseButtonPressed(int,QListBoxItem*,const QPoint&)), this,SLOT( boxPressed(int,QListBoxItem*,const QPoint&)) ); connect( m_notesList, SIGNAL(highlighted(const QString&)), this, SLOT(slotBoxSelected(const QString&))); connect( &menuTimer, SIGNAL( timeout() ), SLOT( showMenu() ) ); connect( m_editArea,SIGNAL( textChanged() ), this, SLOT(slotViewEdited() ) ); connect( newButton, SIGNAL(clicked()), this, SLOT(slotNewButton()) ); connect( saveButton, SIGNAL(clicked()), this, SLOT(slotSaveButton()) ); connect( deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButton()) ); m_selected = -1; setCaption("Notes"); }
void MainWindow::initWidgets() { // includes sidebar and part stack mTopWidget = new QHBox( this ); mTopWidget->setFrameStyle( QFrame::Panel | QFrame::Sunken ); setCentralWidget( mTopWidget ); QHBox *mBox = 0; mSplitter = new QSplitter( mTopWidget ); mBox = new QHBox( mTopWidget ); mSidePane = new IconSidePane( this, mSplitter ); mSidePane->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) ); // donÄt occupy screen estate on load QValueList<int> sizes; sizes << 0; mSplitter->setSizes(sizes); mSidePane->setActionCollection( actionCollection() ); connect( mSidePane, SIGNAL( pluginSelected( Kontact::Plugin * ) ), SLOT( selectPlugin( Kontact::Plugin * ) ) ); QVBox *vBox; if ( mSplitter ) { vBox = new QVBox( mSplitter ); } else { vBox = new QVBox( mBox ); } vBox->setSpacing( 0 ); mPartsStack = new QWidgetStack( vBox ); initAboutScreen(); QString loading = i18n( "<h2 style='text-align:center; margin-top: 0px; margin-bottom: 0px'>%1</h2>" ) .arg( i18n("Loading Kontact...") ); paintAboutScreen( loading ); /* Create a progress dialog and hide it. */ KPIM::ProgressDialog *progressDialog = new KPIM::ProgressDialog( statusBar(), this ); progressDialog->hide(); mLittleProgress = new KPIM::StatusbarProgressWidget( progressDialog, statusBar() ); mStatusMsgLabel = new KRSqueezedTextLabel( i18n( " Initializing..." ), statusBar() ); mStatusMsgLabel->setAlignment( AlignLeft | AlignVCenter ); statusBar()->addWidget( mStatusMsgLabel, 10 , false ); statusBar()->addWidget( mLittleProgress, 0 , true ); mLittleProgress->show(); }
int main(int argc, char **argv) { QApplication app(argc, argv); QVBox *topWidget = new QVBox(); QPushButton *b1 = new QPushButton("Ok", topWidget); QPushButton *b2 = new QPushButton("Defaults", topWidget); QPushButton *b3 = new QPushButton("Cancel", topWidget); app.setMainWidget(topWidget); topWidget->show(); return app.exec(); }
// // ReportWriterWindow // ReportWriterWindow::ReportWriterWindow() : QMainWindow(0, tr("OpenMFG: Report Writer"), WDestructiveClose) { setIcon(QPixmap(OpenReportsIcon_xpm)); // add the workspace QVBox * vbox = new QVBox(this); vbox->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); ws = new QWorkspace(vbox); ws->setScrollBarsEnabled(TRUE); setCentralWidget(vbox); // setup the menubar fileExitAction = new QAction(tr("Exit"), tr("E&xit"),ALT+Key_F4,this,"file exit"); connect(fileExitAction, SIGNAL(activated()), this, SLOT(appExit())); handler = new ReportHandler(this, "report handler"); #ifdef NODBSUPPORT handler->setNoDatabase(true); #endif menubar = new QMenuBar(this); int sepid = handler->populateMenuBar(menubar, fileExitAction); windowMenu = new QPopupMenu(); windowMenu->setCheckable(TRUE); connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(sPrepareWindowMenu())); menubar->insertItem(tr("&Windows"), windowMenu, -1, menubar->indexOf(sepid)); // setup the toolbar handler->docToolBars(this); statusbar = new QStatusBar(this); setCaption(); dbTimerId = startTimer(60000); handler->setParentWindow(ws); connect(handler, SIGNAL(dbOpenClosed()), this, SLOT(setCaption())); connect(handler, SIGNAL(messageChanged(const QString &)), statusbar, SLOT(message(const QString &))); connect(handler, SIGNAL(messageCleared()), statusbar, SLOT(clear())); }
QWidget * DataRecorderChannelBoolean::getPropertyWidget(QWidget * parent, const char * name) { if (!m_propertyWidget) { // Setup widget QVBox * widget = new QVBox(parent,name); Q_CHECK_PTR(widget); widget->setMargin(KDialog::marginHint()); widget->setSpacing(KDialog::spacingHint()); QLabel * lab; lab = new QLabel(i18n("DataRecorder", "Channel:"), widget); Q_CHECK_PTR(lab); KSimLineEdit * conName; conName = new KSimLineEdit(widget); Q_CHECK_PTR(conName); conName->setText(getConnector()->getName()); connect(getConnector(), SIGNAL(signalSetName(const QString &)), conName, SLOT(setText(const QString &))); connect(conName, SIGNAL(changed(const QString &)), SLOT(setChannelName(const QString &))); lab->setBuddy(conName); // TODO add ToolTip ChannelPositionWidget * pos; pos = new ChannelPositionWidget(this, widget); Q_CHECK_PTR(pos); pos->setGainValue(getVerticalGain()); pos->setOffsetValue(getVerticalOffset()); connect(pos, SIGNAL(gainChanged(double)), SLOT(setVerticalGain(double))); connect(pos, SIGNAL(offsetChanged(double)), SLOT(setVerticalOffset(double))); KColorButton * color = new KColorButton(widget); Q_CHECK_PTR(color); color->setColor(getLineColor()); connect(color, SIGNAL(changed(const QColor &)), SLOT(setLineColor(const QColor &))); m_propertyWidget = widget; } else { if (parent) { KSIMDEBUG("Only one widget allowed"); } } return m_propertyWidget; }
KHTMLImage::KHTMLImage( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name ) : KParts::ReadOnlyPart( parent, name ) { setInstance( KHTMLImageFactory::instance() ); QVBox *box = new QVBox( parentWidget, widgetName ); m_khtml = new KHTMLPart( box, widgetName, this, "htmlimagepart" ); m_khtml->setAutoloadImages( true ); setWidget( box ); // VBox can't take focus, so pass it on to sub-widget box->setFocusProxy( m_khtml->widget() ); m_ext = new KHTMLImageBrowserExtension( this, "be" ); // Remove unnecessary actions. KAction *encodingAction = actionCollection()->action( "setEncoding" ); if ( encodingAction ) { encodingAction->unplugAll(); delete encodingAction; } KAction *viewSourceAction= actionCollection()->action( "viewDocumentSource" ); if ( viewSourceAction ) { viewSourceAction->unplugAll(); delete viewSourceAction; } KAction *selectAllAction= actionCollection()->action( "selectAll" ); if ( selectAllAction ) { selectAllAction->unplugAll(); delete selectAllAction; } connect( m_khtml->browserExtension(), SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ), m_ext, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ) ); connect( m_khtml->browserExtension(), SIGNAL( enableAction( const char *, bool ) ), m_ext, SIGNAL( enableAction( const char *, bool ) ) ); m_ext->setURLDropHandlingEnabled( true ); }
/** * @short Shows a popup * @author Rene Schmidt <*****@*****.**> * @version 0.1 */ void KLAidWidget::showPopUp(QString &caption, QString &text, uint &tOut) { // Tell user when the next popup will be shown QToolTip::add(tray, i18n("K Learning Aid %1").arg(VER) + "\nNext PopUp will be shown at " + aut->projectTime(aut->getInterval())); // this is a candidate for subclassing... Copied in part from kpassivepopup.cpp (c) by KDE Team KPassivePopup *pop = new KPassivePopup( tray ); pop->setPaletteForegroundColor(*tmpFgColor); pop->setPaletteBackgroundColor(*tmpBgColor); QVBox *vb = new QVBox( pop ); vb->setSpacing( KDialog::spacingHint() ); QHBox *hb=0; hb = new QHBox(vb); hb->setMargin(0); hb->setSpacing(KDialog::spacingHint() ); QLabel *ttlIcon=0; ttlIcon = new QLabel( hb, "title_icon" ); ttlIcon->setPixmap( SmallIcon("ktimer") ); ttlIcon->setAlignment( AlignLeft ); if ( !caption.isEmpty() ) { QLabel *ttl=0; ttl = new QLabel(caption, hb ? hb : vb, "title_label"); ttl->setFont( *fntCaption ); ttl->setAlignment( Qt::AlignHCenter ); if ( hb ) hb->setStretchFactor( ttl, 10 ); // enforce centering } if ( !text.isEmpty() ) { QLabel *msg=0; msg = new QLabel( text, vb, "msg_label" ); msg->setFont( *fntBody ); msg->setAlignment( AlignLeft ); } pop->setTimeout(tOut); //pop->setView( title, txt, SmallIcon("ktimer")); pop->setView(vb); pop->show(); }
Kfind::Kfind(QWidget *parent, const char *name) : QWidget(parent, name) { kdDebug() << "Kfind::Kfind " << this << endl; QBoxLayout *mTopLayout = new QBoxLayout(this, QBoxLayout::LeftToRight, KDialog::marginHint(), KDialog::spacingHint()); // create tabwidget tabWidget = new KfindTabWidget(this); mTopLayout->addWidget(tabWidget); /* * This is ugly. Might be a KSeparator bug, but it makes a small black * pixel for me which is visually distracting (GS). // create separator KSeparator * mActionSep = new KSeparator( this ); mActionSep->setFocusPolicy( QWidget::ClickFocus ); mActionSep->setOrientation( QFrame::VLine ); mTopLayout->addWidget(mActionSep); */ // create button box QVBox *mButtonBox = new QVBox(this); QVBoxLayout *lay = (QVBoxLayout *)mButtonBox->layout(); lay->addStretch(1); mTopLayout->addWidget(mButtonBox); mSearch = new KPushButton(KGuiItem(i18n("&Find"), "find"), mButtonBox); mButtonBox->setSpacing((tabWidget->sizeHint().height() - 4 * mSearch->sizeHint().height()) / 4); connect(mSearch, SIGNAL(clicked()), this, SLOT(startSearch())); mStop = new KPushButton(KGuiItem(i18n("Stop"), "stop"), mButtonBox); connect(mStop, SIGNAL(clicked()), this, SLOT(stopSearch())); mSave = new KPushButton(KStdGuiItem::saveAs(), mButtonBox); connect(mSave, SIGNAL(clicked()), this, SLOT(saveResults())); KPushButton *mClose = new KPushButton(KStdGuiItem::close(), mButtonBox); connect(mClose, SIGNAL(clicked()), this, SIGNAL(destroyMe())); // react to search requests from widget connect(tabWidget, SIGNAL(startSearch()), this, SLOT(startSearch())); mSearch->setEnabled(true); // Enable "Search" mStop->setEnabled(false); // Disable "Stop" mSave->setEnabled(false); // Disable "Save..." dirlister = new KDirLister(); }
KACLEditWidget::KACLEditWidget(QWidget *parent, const char *name) : QWidget(parent, name) { QHBox *hbox = new QHBox(parent); hbox->setSpacing(KDialog::spacingHint()); m_listView = new KACLListView(hbox, "acl_listview"); connect(m_listView, SIGNAL(selectionChanged()), this, SLOT(slotUpdateButtons())); QVBox *vbox = new QVBox(hbox); vbox->setSpacing(KDialog::spacingHint()); m_AddBtn = new QPushButton(i18n("Add Entry..."), vbox, "add_entry_button"); connect(m_AddBtn, SIGNAL(clicked()), m_listView, SLOT(slotAddEntry())); m_EditBtn = new QPushButton(i18n("Edit Entry..."), vbox, "edit_entry_button"); connect(m_EditBtn, SIGNAL(clicked()), m_listView, SLOT(slotEditEntry())); m_DelBtn = new QPushButton(i18n("Delete Entry"), vbox, "delete_entry_button"); connect(m_DelBtn, SIGNAL(clicked()), m_listView, SLOT(slotRemoveEntry())); QWidget *spacer = new QWidget(vbox); spacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); slotUpdateButtons(); }
void KonviConfigDialog::addPageInternal(QWidget *page, const QStringList &items, const QString &pixmapName, const QString &header) { if(d->shown) { kdDebug(240) << "KonviConfigDialog::addPage: can not add a page after the dialog has been shown."; return; } switch(d->type) { case TreeList: case IconList: case Tabbed: { QVBox *frame = addVBoxPage(items, header, SmallIcon(pixmapName, 16)); frame->setSpacing( 0 ); frame->setMargin( 0 ); page->reparent(((QWidget*)frame), 0, QPoint()); m_lastAddedIndex = pageIndex(frame); } break; case Swallow: { page->reparent(this, 0, QPoint()); setMainWidget(page); } break; case Plain: { QFrame *main = plainPage(); QVBoxLayout *topLayout = new QVBoxLayout( main, 0, 0 ); page->reparent(((QWidget*)main), 0, QPoint()); topLayout->addWidget( page ); } break; default: kdDebug(240) << "KonviConfigDialog::addpage: unknown type."; } }
KateSessionChooser::KateSessionChooser(QWidget *parent, const QString &lastSession) : KDialogBase(parent, "", true, i18n("Session Chooser"), KDialogBase::User1 | KDialogBase::User2 | KDialogBase::User3, KDialogBase::User2, true, KStdGuiItem::quit(), KGuiItem(i18n("Open Session"), "fileopen"), KGuiItem(i18n("New Session"), "filenew")) { QHBox *page = new QHBox(this); page->setMinimumSize(400, 200); setMainWidget(page); QHBox *hb = new QHBox(page); hb->setSpacing(KDialog::spacingHint()); QLabel *label = new QLabel(hb); label->setPixmap(UserIcon("sessionchooser")); label->setFrameStyle(QFrame::Panel | QFrame::Sunken); QVBox *vb = new QVBox(hb); vb->setSpacing(KDialog::spacingHint()); m_sessions = new KListView(vb); m_sessions->addColumn(i18n("Session Name")); m_sessions->addColumn(i18n("Open Documents")); m_sessions->setResizeMode(QListView::AllColumns); m_sessions->setSelectionMode(QListView::Single); m_sessions->setAllColumnsShowFocus(true); connect(m_sessions, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(m_sessions, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), this, SLOT(slotUser2())); KateSessionList &slist(KateSessionManager::self()->sessionList()); for(unsigned int i = 0; i < slist.count(); ++i) { KateSessionChooserItem *item = new KateSessionChooserItem(m_sessions, slist[i]); if(slist[i]->sessionFileRelative() == lastSession) m_sessions->setSelected(item, true); } m_useLast = new QCheckBox(i18n("&Always use this choice"), vb); setResult(resultNone); // trigger action update selectionChanged(); }
OptionsDialog::OptionsDialog(QWidget *parent) : QDialog(parent, 0, false, Qt::WDestructiveClose) { setCaption("QucsTranscalc "+tr("Options")); // -------- create dialog widgets ------------ vLayout = new QVBoxLayout(this); vLayout->setMargin(3); vLayout->setSpacing(3); QHGroupBox * h = new QHGroupBox(tr("Units"), this); vLayout->addWidget(h); QVBox * l = new QVBox(h); l->setSpacing(3); QLabel * lfr = new QLabel(tr("Frequency"),l); lfr->setAlignment (Qt::AlignRight); QLabel * lle = new QLabel(tr("Length"),l); lle->setAlignment (Qt::AlignRight); QLabel * lre = new QLabel(tr("Resistance"),l); lre->setAlignment (Qt::AlignRight); QLabel * lan = new QLabel(tr("Angle"),l); lan->setAlignment (Qt::AlignRight); QVBox * r = new QVBox(h); r->setSpacing(3); for (int j = 0; j < 4; j++) { units[j] = new QComboBox(r); for (int i = 0; TransUnits[j].units[i] != NULL; i++) units[j]->insertItem (TransUnits[j].units[i]); } units[0]->setCurrentItem (QucsSettings.freq_unit); units[1]->setCurrentItem (QucsSettings.length_unit); units[2]->setCurrentItem (QucsSettings.res_unit); units[3]->setCurrentItem (QucsSettings.ang_unit); QHBox * h2 = new QHBox(this); vLayout->addWidget(h2); QPushButton *ButtonSave = new QPushButton(tr("Save as Default"), h2); connect(ButtonSave, SIGNAL(clicked()), SLOT(slotSave())); QPushButton *ButtonClose = new QPushButton(tr("Dismiss"), h2); connect(ButtonClose, SIGNAL(clicked()), SLOT(slotClose())); ButtonClose->setFocus(); }
void KBabelView::showTryLaterMessageBox() { if( !_showTryLaterBox ) return; KDialogBase *dialog= new KDialogBase( i18n("Information"), KDialogBase::Yes, KDialogBase::Yes, KDialogBase::Yes, this, "information", true, true, KStdGuiItem::ok() ); QVBox *topcontents = new QVBox (dialog); topcontents->setSpacing(KDialog::spacingHint()*2); topcontents->setMargin(KDialog::marginHint()*2); QWidget *contents = new QWidget(topcontents); QHBoxLayout * lay = new QHBoxLayout(contents); lay->setSpacing(KDialog::spacingHint()*2); lay->addStretch(1); QLabel *label1 = new QLabel( contents); label1->setPixmap(QMessageBox::standardIcon(QMessageBox::Information)); lay->add( label1 ); QLabel *label2 = new QLabel( i18n("The search string has not been found yet.\n" "However, the string might be found " "in the files being searched at the moment.\n" "Please try later."), contents); label2->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak ); label2->setMinimumSize(label2->sizeHint()); lay->add( label2 ); lay->addStretch(1); QCheckBox *checkbox = new QCheckBox(i18n("Do not show in this find/replace session again"), topcontents); dialog->setMainWidget(topcontents); dialog->enableButtonSeparator(false); dialog->incInitialSize( QSize(50,0) ); dialog->exec(); _showTryLaterBox = !checkbox->isChecked(); delete dialog; }
void KTimerDialog::setMainWidget(QWidget *widget) { // yuck, here goes. QVBox *newWidget = new QVBox(this); if(widget->parentWidget() != mainWidget) { widget->reparent(newWidget, 0, QPoint(0, 0)); } else { newWidget->insertChild(widget); } timerWidget->reparent(newWidget, 0, QPoint(0, 0)); delete mainWidget; mainWidget = newWidget; KDialogBase::setMainWidget(mainWidget); }
//--------------------------------------------------------------------------- // // Constructor // AmorDialog::AmorDialog() : KDialogBase(0, "amordlg", false, i18n("Options"), Ok|Apply|Cancel, Ok ) { mConfig.read(); QVBox *mainwidget = makeVBoxMainWidget(); QHBox *hb = new QHBox(mainwidget); // Theme list QVBox *themeBox = new QVBox(hb); themeBox->setSpacing(spacingHint()); QLabel *label = new QLabel(i18n("Theme:"), themeBox); mThemeListBox = new QListBox(themeBox); connect(mThemeListBox,SIGNAL(highlighted(int)),SLOT(slotHighlighted(int))); mThemeListBox->setMinimumSize( fontMetrics().maxWidth()*20, fontMetrics().lineSpacing()*6 ); mAboutEdit = new QMultiLineEdit(themeBox); mAboutEdit->setReadOnly(true); mAboutEdit->setMinimumHeight( fontMetrics().lineSpacing()*4 ); themeBox->setStretchFactor(mThemeListBox, 4); themeBox->setStretchFactor(mAboutEdit, 1); // Animation offset QVBox *offsetBox = new QVBox(hb); offsetBox->setSpacing(spacingHint()); label = new QLabel(i18n("Offset:"), offsetBox); QSlider *slider = new QSlider(-40, 40, 5, mConfig.mOffset, QSlider::Vertical, offsetBox); connect(slider, SIGNAL(valueChanged(int)), SLOT(slotOffset(int))); // Always on top QCheckBox *checkBox = new QCheckBox(i18n("Always on top"), mainwidget); connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotOnTop(bool))); checkBox->setChecked(mConfig.mOnTop); checkBox = new QCheckBox(i18n("Show random tips"), mainwidget); connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotRandomTips(bool))); checkBox->setChecked(mConfig.mTips); // always keep this one after the connect, or the QList would not be grayed when it should checkBox = new QCheckBox(i18n("Use a random character"), mainwidget); connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotRandomTheme(bool))); checkBox->setChecked(mConfig.mRandomTheme); checkBox = new QCheckBox(i18n("Allow application tips"), mainwidget); connect(checkBox, SIGNAL(toggled(bool)), SLOT(slotApplicationTips(bool))); checkBox->setChecked(mConfig.mAppTips); readThemes(); }
ConfigDlg::ConfigDlg(QWidget *parent, const char *name) : KDialogBase(KDialogBase::TreeList, WStyle_DialogBorder, parent, name, true, "Settings", KDialogBase::Ok|KDialogBase::Cancel) { setShowIconsInTreeList(true); setMinimumSize(600,400); enableButtonSeparator(true); unfoldTreeList(); QVBox *frame; QStringList path; path << i18n("Languages"); setFolderIcon(path, BarIcon("protoeditor", KIcon::SizeSmall)); QValueList<LanguageSettings*> llist = Protoeditor::self()->settings()->languageSettingsList(); QValueList<LanguageSettings*>::iterator it; for(it = llist.begin(); it != llist.end(); ++it) { path.clear(); path << i18n("Languages") << (*it)->languageName(); frame = addVBoxPage(path, (*it)->languageName(), BarIcon((*it)->iconName(), KIcon::SizeSmall)); frame->setSpacing(0); frame->setMargin(0); m_langSettingsWidgets.append((*it)->createSettingsWidget(frame)); } path.clear(); path << i18n("Sites"); frame= addVBoxPage(path, i18n("Sites"), BarIcon("package_network", KIcon::SizeSmall)); frame->setSpacing(0); frame->setMargin(0); m_siteSettingsWidget = new SiteSettingsWidget(frame);//->reparent(((QWidget*)frame), 0, QPoint()); path.clear(); path << i18n("External Applications"); frame = addVBoxPage(path, i18n("External Applications"), BarIcon("gear", KIcon::SizeSmall)); frame->setSpacing(0); frame->setMargin(0); m_extAppSettingsWidget = new ExtAppSettingsWidget(frame, i18n("External Applications"));//->reparent(((QWidget*)frame), 0, QPoint()); resize(QSize(590, 300).expandedTo(minimumSizeHint())); }
CompletionOrderEditor::CompletionOrderEditor(KPIM::LdapSearch *ldapSearch, QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Completion Order"), Ok | Cancel, Ok, true), mConfig("kpimcompletionorder"), mDirty(false) { mItems.setAutoDelete(true); // The first step is to gather all the data, creating CompletionItem objects QValueList< LdapClient * > ldapClients = ldapSearch->clients(); for(QValueList<LdapClient *>::const_iterator it = ldapClients.begin(); it != ldapClients.end(); ++it) { //kdDebug(5300) << "LDAP: host " << (*it)->host() << " weight " << (*it)->completionWeight() << endl; mItems.append(new LDAPCompletionItem(*it)); } KABC::AddressBook *addressBook = KABC::StdAddressBook::self(true); QPtrList<KABC::Resource> resources = addressBook->resources(); for(QPtrListIterator<KABC::Resource> resit(resources); *resit; ++resit) { //kdDebug(5300) << "KABC Resource: " << (*resit)->className() << endl; ResourceABC *res = dynamic_cast<ResourceABC *>(*resit); if(res) // IMAP KABC resource { const QStringList subresources = res->subresources(); for(QStringList::const_iterator it = subresources.begin(); it != subresources.end(); ++it) { mItems.append(new KABCImapSubResCompletionItem(res, *it)); } } else // non-IMAP KABC resource { mItems.append(new SimpleCompletionItem(this, (*resit)->resourceName(), (*resit)->identifier())); } } #ifndef KDEPIM_NEW_DISTRLISTS // new distr lists are normal contact, so no separate item if using them // Add an item for distribution lists mItems.append(new SimpleCompletionItem(this, i18n("Distribution Lists"), "DistributionLists")); #endif // Now sort the items, then create the GUI mItems.sort(); QHBox *page = makeHBoxMainWidget(); mListView = new KListView(page); mListView->setSorting(-1); mListView->addColumn(QString::null); mListView->header()->hide(); for(QPtrListIterator<CompletionItem> compit(mItems); *compit; ++compit) { new CompletionViewItem(mListView, *compit); kdDebug(5300) << " " << (*compit)->label() << " " << (*compit)->completionWeight() << endl; } QVBox *upDownBox = new QVBox(page); mUpButton = new KPushButton(upDownBox, "mUpButton"); mUpButton->setIconSet(BarIconSet("up", KIcon::SizeSmall)); mUpButton->setEnabled(false); // b/c no item is selected yet mUpButton->setFocusPolicy(StrongFocus); mDownButton = new KPushButton(upDownBox, "mDownButton"); mDownButton->setIconSet(BarIconSet("down", KIcon::SizeSmall)); mDownButton->setEnabled(false); // b/c no item is selected yet mDownButton->setFocusPolicy(StrongFocus); QWidget *spacer = new QWidget(upDownBox); upDownBox->setStretchFactor(spacer, 100); connect(mListView, SIGNAL(selectionChanged(QListViewItem *)), SLOT(slotSelectionChanged(QListViewItem *))); connect(mUpButton, SIGNAL(clicked()), this, SLOT(slotMoveUp())); connect(mDownButton, SIGNAL(clicked()), this, SLOT(slotMoveDown())); }
BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) : SettingsPageBase(parent), m_addButton(0), m_removeButton(0), m_moveUpButton(0), m_moveDownButton(0) { QVBoxLayout* topLayout = new QVBoxLayout(parent, 2, KDialog::spacingHint()); const int spacing = KDialog::spacingHint(); QHBox* hBox = new QHBox(parent); hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); hBox->setSpacing(spacing); hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); m_listView = new KListView(hBox); m_listView->addColumn(i18n("Icon")); m_listView->addColumn(i18n("Name")); m_listView->addColumn(i18n("Location")); m_listView->setResizeMode(QListView::LastColumn); m_listView->setColumnAlignment(0, Qt::AlignHCenter); m_listView->setAllColumnsShowFocus(true); m_listView->setSorting(-1); connect(m_listView, SIGNAL(selectionChanged()), this, SLOT(updateButtons())); connect(m_listView, SIGNAL(pressed(QListViewItem*)), this, SLOT(slotBookmarkPressed(QListViewItem*))); connect(m_listView, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), this, SLOT(slotBookmarkDoubleClicked(QListViewItem*, const QPoint&, int))); QVBox* buttonBox = new QVBox(hBox); buttonBox->setSpacing(spacing); const QSizePolicy buttonSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); m_addButton = new KPushButton(i18n("Add..."), buttonBox); connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddButtonClicked())); m_addButton->setSizePolicy(buttonSizePolicy); m_editButton = new KPushButton(i18n("Edit..."), buttonBox); connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditButtonClicked())); m_editButton->setSizePolicy(buttonSizePolicy); m_removeButton = new KPushButton(i18n("Remove"), buttonBox); connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveButtonClicked())); m_removeButton->setSizePolicy(buttonSizePolicy); m_moveUpButton = new KPushButton(i18n("Move Up"), buttonBox); connect(m_moveUpButton, SIGNAL(clicked()), this, SLOT(slotMoveUpButtonClicked())); m_moveUpButton->setSizePolicy(buttonSizePolicy); m_moveDownButton = new KPushButton(i18n("Move Down"), buttonBox); connect(m_moveDownButton, SIGNAL(clicked()), this, SLOT(slotMoveDownButtonClicked())); m_moveDownButton->setSizePolicy(buttonSizePolicy); // Add a dummy widget with no restriction regarding a vertical resizing. // This assures that the spacing between the buttons is not increased. new QWidget(buttonBox); topLayout->addWidget(hBox); // insert all editable bookmarks. KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root(); KBookmark bookmark = root.first(); QListViewItem* prev = 0; while (!bookmark.isNull()) { QListViewItem* item = new QListViewItem(m_listView); item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon())); item->setText(NameIdx, bookmark.text()); item->setText(URLIdx, bookmark.url().prettyURL()); // add hidden column to be able to retrieve the icon name again item->setText(IconIdx, bookmark.icon()); m_listView->insertItem(item); if (prev != 0) { item->moveItem(prev); } prev = item; bookmark = root.next(bookmark); } m_listView->setSelected(m_listView->firstChild(), true); updateButtons(); }
GeneralSettingsPage::GeneralSettingsPage(QWidget* parent) : SettingsPageBase(parent), m_homeURL(0), m_startSplit(0), m_startEditable(0) { QVBoxLayout* topLayout = new QVBoxLayout(parent, 2, KDialog::spacingHint()); const int spacing = KDialog::spacingHint(); const int margin = KDialog::marginHint(); const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); DolphinSettings& settings = DolphinSettings::instance(); QVBox* vBox = new QVBox(parent); vBox->setSizePolicy(sizePolicy); vBox->setSpacing(spacing); vBox->setMargin(margin); vBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); // create 'Home URL' editor QGroupBox* homeGroup = new QGroupBox(1, Qt::Horizontal, i18n("Home URL"), vBox); homeGroup->setSizePolicy(sizePolicy); homeGroup->setMargin(margin); QHBox* homeURLBox = new QHBox(homeGroup); homeURLBox->setSizePolicy(sizePolicy); homeURLBox->setSpacing(spacing); new QLabel(i18n("Location:"), homeURLBox); m_homeURL = new QLineEdit(settings.homeURL().prettyURL(), homeURLBox); QPushButton* selectHomeURLButton = new QPushButton(SmallIcon("folder"), QString::null, homeURLBox); connect(selectHomeURLButton, SIGNAL(clicked()), this, SLOT(selectHomeURL())); QHBox* buttonBox = new QHBox(homeGroup); buttonBox->setSizePolicy(sizePolicy); buttonBox->setSpacing(spacing); QPushButton* useCurrentButton = new QPushButton(i18n("Use current location"), buttonBox); connect(useCurrentButton, SIGNAL(clicked()), this, SLOT(useCurrentLocation())); QPushButton* useDefaultButton = new QPushButton(i18n("Use default location"), buttonBox); connect(useDefaultButton, SIGNAL(clicked()), this, SLOT(useDefaulLocation())); // create 'Default View Mode' group QButtonGroup* buttonGroup = new QButtonGroup(3, Qt::Vertical, i18n("Default View Mode"), vBox); buttonGroup->setSizePolicy(sizePolicy); buttonGroup->setMargin(margin); m_iconsView = new QRadioButton(i18n("Icons"), buttonGroup); m_detailsView = new QRadioButton(i18n("Details"), buttonGroup); m_previewsView = new QRadioButton(i18n("Previews"), buttonGroup); switch (settings.defaultViewMode()) { case DolphinView::IconsView: m_iconsView->setChecked(true); break; case DolphinView::DetailsView: m_detailsView->setChecked(true); break; case DolphinView::PreviewsView: m_previewsView->setChecked(true); break; } // create 'Start with split view' checkbox m_startSplit = new QCheckBox(i18n("Start with split view"), vBox); m_startSplit->setChecked(settings.isViewSplit()); // create 'Start with editable navigation bar' checkbox m_startEditable = new QCheckBox(i18n("Start with editable navigation bar"), vBox); m_startEditable->setChecked(settings.isURLEditable()); // create 'Save view properties for each folder' checkbox m_saveView = new QCheckBox(i18n("Save view properties for each folder"), vBox); m_saveView->setChecked(settings.isSaveView()); // Add a dummy widget with no restriction regarding // a vertical resizing. This assures that the dialog layout // is not stretched vertically. new QWidget(vBox); topLayout->addWidget(vBox); }
void SimpleUI::setupCentralWidget() { QVBox *npWidget = new QVBox( this ); npWidget->setMargin( 0 ); npWidget->setSpacing( 0 ); positionLabel = new QLabel( statusBar() ); positionLabel->setAlignment( AlignVCenter | AlignCenter ); positionLabel->setFixedSize( fontMetrics().size( 0, " 00:00/00:00 " ) ); statusBar()->addWidget( positionLabel, 0, true ); video = new VideoFrame( npWidget ); connect( video, SIGNAL(adaptSize(int,int)), SLOT(slotAdaptSize(int,int)) ); connect( video, SIGNAL(rightButtonPressed(const QPoint &)), SLOT(slotContextMenu(const QPoint &)) ); QHBox *ctlFrame = new QHBox( npWidget ); ctlFrame->setFixedHeight( 38 ); ctlFrame->setFrameShape( QFrame::StyledPanel ); ctlFrame->setFrameShadow( QFrame::Raised ); ctlFrame->setMargin( 6 ); ctlFrame->setSpacing( 6 ); QPushButton *backButton = new QPushButton( ctlFrame ); backButton->setFixedSize( 24, 24 ); backButton->setPixmap( QPixmap( back_xpm ) ); QToolTip::add( backButton, i18n("Back") ); connect( backButton, SIGNAL(clicked()), napp->player(), SLOT(back()) ); stopButton = new QPushButton( ctlFrame ); stopButton->setFixedSize( 24, 24 ); stopButton->setPixmap( QPixmap( stop_xpm ) ); QToolTip::add( stopButton, i18n("Stop") ); connect( stopButton, SIGNAL(clicked()), napp->player(), SLOT(stop()) ); playButton = new QPushButton( ctlFrame ); playButton->setFixedSize( 24, 24 ); playButton->setPixmap( QPixmap( play_xpm ) ); QToolTip::add( playButton, i18n("Play / Pause") ); connect( playButton, SIGNAL(clicked()), napp->player(), SLOT(playpause()) ); QPushButton *forwButton = new QPushButton( ctlFrame ); forwButton->setFixedSize( 24, 24 ); forwButton->setPixmap( QPixmap( forward_xpm ) ); QToolTip::add( forwButton, i18n("Forward") ); connect( forwButton, SIGNAL(clicked()), napp->player(), SLOT(forward()) ); slider = new L33tSlider( 0, 1000, 10, 0, L33tSlider::Horizontal, ctlFrame ); slider->setFixedHeight( 24 ); slider->setMinimumWidth( 100 ); slider->setTickmarks( QSlider::NoMarks ); connect( slider, SIGNAL(userChanged(int)), SLOT(slotSkipTo(int)) ); connect( slider, SIGNAL(sliderMoved(int)), SLOT(slotSliderMoved(int)) ); QPushButton *playlistButton = new QPushButton( ctlFrame ); playlistButton->setFixedSize( 24, 24 ); playlistButton->setPixmap( QPixmap( playlist_xpm ) ); QToolTip::add( playlistButton, i18n("Playlist") ); connect( playlistButton, SIGNAL(clicked()), napp->player(), SLOT(toggleListView()) ); volumeButton = new QPushButton( ctlFrame ); volumeButton->setFixedSize( 24, 24 ); volumeButton->setPixmap( QPixmap( volume_xpm ) ); QToolTip::add( volumeButton, i18n("Volume") ); volumeFrame = new QVBox( this, "Volume", WStyle_Customize | WType_Popup ); volumeFrame->setFrameStyle( QFrame::PopupPanel ); volumeFrame->setMargin( 4 ); volumeLabel = new QLabel( volumeFrame ); volumeLabel->setText( "100%" ); volumeLabel->setAlignment( AlignCenter ); volumeLabel->setFixedSize( volumeLabel->sizeHint() ); QHBox *volumeSubFrame = new QHBox( volumeFrame ); volumeSlider = new L33tSlider( 0, 100, 10, 0, Vertical, volumeSubFrame ); volumeSlider->setValue( 100 - napp->player()->volume() ); volumeSlider->setFixedSize( volumeSlider->sizeHint() ); volumeFrame->resize( volumeFrame->sizeHint() ); connect( volumeSlider, SIGNAL(sliderMoved(int)), SLOT(slotVolumeSliderMoved(int)) ); connect( volumeSlider, SIGNAL(userChanged(int)), SLOT(slotVolumeSliderMoved(int)) ); connect( volumeButton, SIGNAL(clicked()), SLOT(slotVolumeFrame()) ); setCentralWidget( npWidget ); video->setMinimumSize( minimumSizeHint().width(), 1 ); // Create properties dialog propertiesDialog = new PropertiesDialog( this ); propertiesDialog->resize( 375, 285 ); }
KURLBarItemDialog::KURLBarItemDialog(bool allowGlobal, const KURL &url, const QString &description, QString icon, bool appLocal, int iconSize, QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Quick Access Entry"), Ok | Cancel, Ok, true) { QVBox *box = new QVBox(this); QString text = i18n("<qt><b>Please provide a description, URL and icon for this Quick Access entry.</b></br></qt>"); QLabel *label = new QLabel(text, box); box->setSpacing(spacingHint()); QGrid *grid = new QGrid(2, box); grid->setSpacing(spacingHint()); QString whatsThisText = i18n( "<qt>This is the text that will appear in the Quick Access panel.<p>" "The description should consist of one or two words " "that will help you remember what this entry refers to.</qt>"); label = new QLabel(i18n("&Description:"), grid); m_edit = new KLineEdit(grid, "description edit"); m_edit->setText(description.isEmpty() ? url.fileName() : description); label->setBuddy(m_edit); QWhatsThis::add(label, whatsThisText); QWhatsThis::add(m_edit, whatsThisText); whatsThisText = i18n( "<qt>This is the location associated with the entry. Any valid URL may be used. For example:<p>" "%1<br>http://www.kde.org<br>ftp://ftp.kde.org/pub/kde/stable<p>" "By clicking on the button next to the text edit box you can browse to an " "appropriate URL.</qt>") .arg(QDir::homeDirPath()); label = new QLabel(i18n("&URL:"), grid); m_urlEdit = new KURLRequester(url.prettyURL(), grid); m_urlEdit->setMode(KFile::Directory); label->setBuddy(m_urlEdit); QWhatsThis::add(label, whatsThisText); QWhatsThis::add(m_urlEdit, whatsThisText); whatsThisText = i18n( "<qt>This is the icon that will appear in the Quick Access panel.<p>" "Click on the button to select a different icon.</qt>"); label = new QLabel(i18n("Choose an &icon:"), grid); m_iconButton = new KIconButton(grid, "icon button"); m_iconButton->setIconSize(iconSize); if(icon.isEmpty()) icon = KMimeType::iconForURL(url); m_iconButton->setIcon(icon); label->setBuddy(m_iconButton); QWhatsThis::add(label, whatsThisText); QWhatsThis::add(m_iconButton, whatsThisText); if(allowGlobal) { QString appName; if(KGlobal::instance()->aboutData()) appName = KGlobal::instance()->aboutData()->programName(); if(appName.isEmpty()) appName = QString::fromLatin1(KGlobal::instance()->instanceName()); m_appLocal = new QCheckBox(i18n("&Only show when using this application (%1)").arg(appName), box); m_appLocal->setChecked(appLocal); QWhatsThis::add(m_appLocal, i18n("<qt>Select this setting if you want this " "entry to show only when using the current application (%1).<p>" "If this setting is not selected, the entry will be available in all " "applications.</qt>") .arg(appName)); } else m_appLocal = 0L; connect(m_urlEdit->lineEdit(), SIGNAL(textChanged(const QString &)), this, SLOT(urlChanged(const QString &))); m_edit->setFocus(); setMainWidget(box); }