TargetList::TargetList(QWidget *parent) :
    QWidget(parent)
{

    targetTable = new QTableWidget(1,3,this);
    scanLocTable = new QTableWidget(1,5,this);
    QLabel* targetTableLabel = new QLabel("&Targets");
    QLabel* scanLocTableLabel = new QLabel("ROI locations");
    QStringList ttHeaders;
    ttHeaders.append("Target Number");
    ttHeaders.append("x (um)");
    ttHeaders.append("y (um)");
    targetTable->setHorizontalHeaderLabels(ttHeaders);
    QStringList sltHeaders;
    sltHeaders.append("ROI Number");
    sltHeaders.append("x (um)");
    sltHeaders.append("y (um)");
    sltHeaders.append("x width");
    sltHeaders.append("y width");
    scanLocTable->setHorizontalHeaderLabels(sltHeaders);

    targetTableLabel->setBuddy(targetTable);


    connect(targetTable,SIGNAL(cellClicked(int,int)), this, SLOT(updateScanTable(int,int)));

    mainLayout = new QGridLayout;
    mainLayout->addWidget(targetTableLabel,0,0);
    mainLayout->addWidget(targetTable, 1,0,3,1);
    mainLayout->addWidget(scanLocTableLabel,0,1);
    mainLayout->addWidget(scanLocTable,1,2,3,2 );

    scanLocTable->adjustSize();
    targetTable->adjustSize();

    setLayout(mainLayout);
    qDebug()<<"constructed targettable";
    qDebug()<<QString::number(scanLocTable->isVisible());
    LandmarkList fakeTargetList;
    LocationSimple testLoc1;

    fakeTargetList.append(testLoc1);

    QList<LandmarkList> fakeScanLocations;
    fakeScanLocations.append(fakeTargetList);



    updateTargetTable(fakeTargetList, fakeScanLocations);

}
Exemple #2
0
PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
    setAttribute( Qt::WA_DeleteOnClose );

    setWindowTitle( qtr( "Plugins and extensions" ) );
    QGridLayout *layout = new QGridLayout( this );

    /* Main Tree for modules */
    treePlugins = new QTreeWidget;
    layout->addWidget( treePlugins, 0, 0, 1, -1 );

    /* Users cannot move the columns around but we need to sort */
    treePlugins->header()->setMovable( false );
    treePlugins->header()->setSortIndicatorShown( true );
    //    treePlugins->header()->setResizeMode( QHeaderView::ResizeToContents );
    treePlugins->setAlternatingRowColors( true );
    treePlugins->setColumnWidth( 0, 200 );

    QStringList headerNames;
    headerNames << qtr("Name") << qtr("Capability" ) << qtr( "Score" );
    treePlugins->setHeaderLabels( headerNames );

    FillTree();

    /* Set capability column to the correct Size*/
    treePlugins->resizeColumnToContents( 1 );
    treePlugins->header()->restoreState(
            getSettings()->value( "Plugins/Header-State" ).toByteArray() );

    treePlugins->setSortingEnabled( true );
    treePlugins->sortByColumn( 1, Qt::AscendingOrder );

    QLabel *label = new QLabel( qtr("&Search:"), this );
    edit = new SearchLineEdit( this );
    label->setBuddy( edit );

    layout->addWidget( label, 1, 0 );
    layout->addWidget( edit, 1, 1, 1, -1 );
    CONNECT( edit, textChanged( const QString& ),
            this, search( const QString& ) );

    QDialogButtonBox *box = new QDialogButtonBox;
    QPushButton *okButton = new QPushButton( qtr( "&Close" ), this );
    box->addButton( okButton, QDialogButtonBox::AcceptRole );
    layout->addWidget( box, 2, 2 );

    BUTTONACT( okButton, close() );

    setMinimumSize( 500, 300 );
    readSettings( "Plugins", QSize( 540, 400 ) );
}
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;	
}
KMail::ACLEntryDialog::ACLEntryDialog( IMAPUserIdFormat userIdFormat, const QString& caption, QWidget* parent )
  : KDialog( parent )
  , mUserIdFormat( userIdFormat )
{
  setCaption( caption );
  setButtons( Ok | Cancel );
  QWidget *page = new QWidget( this );
  setMainWidget(page);
  QGridLayout *topLayout = new QGridLayout( page );
  topLayout->setSpacing( spacingHint() );
  topLayout->setMargin( 0 );

  QLabel *label = new QLabel( i18n( "&User identifier:" ), page );
  topLayout->addWidget( label, 0, 0 );

  mUserIdLineEdit = new KLineEdit( page );
  topLayout->addWidget( mUserIdLineEdit, 0, 1 );
  label->setBuddy( mUserIdLineEdit );
  mUserIdLineEdit->setWhatsThis( i18n( "The User Identifier is the login of the user on the IMAP server. This can be a simple user name or the full email address of the user; the login for your own account on the server will tell you which one it is." ) );

  QPushButton* kabBtn = new QPushButton( i18n( "Se&lect..." ), page );
  topLayout->addWidget( kabBtn, 0, 2 );

  QGroupBox* groupBox = new QGroupBox( i18n( "Permissions" ), page );
  QVBoxLayout *vbox = new QVBoxLayout( groupBox );

  mButtonGroup = new QButtonGroup( groupBox );

  for ( unsigned int i = 0;
        i < sizeof( standardPermissions ) / sizeof( *standardPermissions );
        ++i ) {
    QRadioButton* cb = new QRadioButton( i18nc( "Permissions", standardPermissions[i].userString ), groupBox );
    vbox->addWidget( cb );
    // We store the permission value (bitfield) as the id of the radiobutton in the group
    mButtonGroup->addButton( cb, standardPermissions[i].permissions );
  }

  vbox->addStretch( 1 );

  topLayout->addWidget( groupBox, 1, 0, 1, 3 );
  topLayout->setRowStretch(2, 10);

  connect( mUserIdLineEdit, SIGNAL( textChanged( const QString& ) ), SLOT( slotChanged() ) );
  connect( kabBtn, SIGNAL( clicked() ), SLOT( slotSelectAddresses() ) );
  connect( mButtonGroup, SIGNAL( buttonClicked( int ) ), SLOT( slotChanged() ) );
  enableButtonOk( false );

  mUserIdLineEdit->setFocus();
  // Ensure the lineedit is rather wide so that email addresses can be read in it
  incrementInitialSize( QSize( 200, 0 ) );
}
GoGui::GoGui(QWidget *parent) :
  QDialog(parent) {
  //BoardScene *boardScene = BoardScene::createGoScene(13);
  BoardScene *boardScene = BoardScene::createHavannahScene(8);
  BoardView *boardView = new BoardView(boardScene, this);
  manager *m = new manager(boardScene, this);

  labelEdit = new QLineEdit;
  QLabel *labelLabel = new QLabel("Label");
  labelLabel->setBuddy(labelEdit);
  labelEdit->setEnabled(false);

  QComboBox *typeComboBox = new QComboBox;
  QLabel *typeLabel = new QLabel("Type");
  typeLabel->setBuddy(typeComboBox);
  typeComboBox->addItem("Black Stone");
  typeComboBox->addItem("White Stone");
  typeComboBox->addItem("Mark");
  typeComboBox->addItem("Circle");
  typeComboBox->addItem("Square");
  typeComboBox->addItem("Triangle");
  typeComboBox->addItem("Label");

  QGridLayout *layout = new QGridLayout;
  layout->addWidget(labelLabel, 0, 0);
  layout->addWidget(labelEdit, 0, 1);
  layout->addWidget(typeLabel, 1, 0);
  layout->addWidget(typeComboBox, 1, 1);

  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->addWidget(boardView);
  mainLayout->addLayout(layout);

  connect(typeComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(typeIndexChanged(const QString& )));
  connect(typeComboBox, SIGNAL(currentIndexChanged(int)), m, SLOT(setIndex(int)));
  connect(labelEdit, SIGNAL(textChanged(const QString &)), m, SLOT(setLabel(const QString&)));
  setLayout(mainLayout);
}
ConfigGuiOpie::ConfigGuiOpie(const QSync::Member &member, QWidget *parent)
    : ConfigGui(member, parent)
{
    QGridLayout *layout = new QGridLayout(topLayout());

    QLabel *label = new QLabel(i18n("Device IP:"), this);
    layout->addWidget(label, 0, 0);

    mDeviceIP = new QLineEdit(this);
    mDeviceIP->setInputMask("000.000.000.000");
    label->setBuddy(mDeviceIP);
    layout->addWidget(mDeviceIP, 0, 1);

    label = new QLabel(i18n("Device Type:"), this);
    layout->addWidget(label, 1, 0);

    mDeviceType = new QComboBox(this);
    label->setBuddy(mDeviceType);
    layout->addWidget(mDeviceType, 1, 1);

    label = new QLabel(i18n("Username:"******"Password:"******"Protocol:"), this);
    layout->addWidget(label, 4, 0);

    mConnectionType = new QComboBox(this);
    label->setBuddy(mConnectionType);
    layout->addWidget(mConnectionType, 4, 1);

    label = new QLabel(i18n("Port:"), this);
    layout->addWidget(label, 5, 0);

    mPort = new QSpinBox(this);
    mPort->setRange(0, 65335);
    label->setBuddy(mPort);
    layout->addWidget(mPort, 5, 1);

    mDeviceType->insertItem(i18n("Opie/OpenZaurus"));
    mDeviceType->insertItem(i18n("Qtopia2"));

    mConnectionType->insertItem(i18n("SCP"));
    mConnectionType->insertItem(i18n("FTP"));

    topLayout()->addStretch(1);
}
Exemple #7
0
CSendFileWidget::CSendFileWidget( QWidget* parent ) :
QWidget( parent )
{
	QLabel* serverHostLabel = new QLabel( "&Server address: ", this );
	host = new QLineEdit( this );
	serverHostLabel->setBuddy( host );

	QLabel* portLabel = new QLabel( "Server &Port:", this );
	port = new QSpinBox( this );
	port->setMinimum( 0 );
	port->setMaximum( SHRT_MAX );
	portLabel->setBuddy( port );

	QLabel* fileLabel = new QLabel( "&File:", this );
	fileName = new QLineEdit( this );

	QPushButton* openFileDialogBtn = new QPushButton( "...", this );
	QPushButton* transmit = new QPushButton( "Transmit", this );

	/*QHBoxLayout* selectFileLayout = new QHBoxLayout( this );
	selectFileLayout->addWidget( fileName );
	selectFileLayout->addWidget( openFileDialogBtn );*/

	QVBoxLayout* layout = new QVBoxLayout( this );
	layout->addWidget( serverHostLabel );
	layout->addWidget( host );
	layout->addWidget( portLabel );
	layout->addWidget( port );
	layout->addWidget( fileLabel );
	layout->addWidget( fileName );
	layout->addWidget( openFileDialogBtn );
	layout->addWidget( transmit );

	setLayout( layout );

	connect( openFileDialogBtn, SIGNAL( clicked() ), this, SLOT( onSelectFileButtonClick() ) );
	connect( transmit, SIGNAL( clicked() ), this, SLOT( onTransferButtonClick() ) );
}
Exemple #8
0
PlayabilityFilter::PlayabilityFilter(ListerDialog *dialog)
    : Filter(dialog)
{
    QHBoxLayout *minRankLayout = new QHBoxLayout;
    m_vbox->addLayout(minRankLayout);

    QLabel *minRankLabel = new QLabel(tr("&Minimum rank:"));
    minRankLayout->addWidget(minRankLabel);
    m_minRankSpinner = ListerDialog::makeSpinBox(0, 99999, 100);
    m_minRankSpinner->setSpecialValueText(tr("none"));
    minRankLabel->setBuddy(m_minRankSpinner);
    minRankLayout->addWidget(m_minRankSpinner);

    QHBoxLayout *maxRankLayout = new QHBoxLayout;
    m_vbox->addLayout(maxRankLayout);

    QLabel *maxRankLabel = new QLabel(tr("Ma&ximum rank:"));
    maxRankLayout->addWidget(maxRankLabel);
    m_maxRankSpinner = ListerDialog::makeSpinBox(0, 99999, 100);
    m_maxRankSpinner->setSpecialValueText(tr("none"));
    maxRankLabel->setBuddy(m_maxRankSpinner);
    maxRankLayout->addWidget(m_maxRankSpinner);
}
Exemple #9
0
UsbWidget::UsbWidget( QWidget *parent )
  : QWidget( parent )
{
  QGridLayout *layout = new QGridLayout( this, 3, 2, 11, 3);

  mInterface = new QSpinBox( this );
  layout->addWidget( mInterface, 0, 1 );

  QLabel *label = new QLabel( i18n( "USB Interface:" ), this );
  label->setBuddy( mInterface );
  layout->addWidget( label, 0, 0 );

  layout->setRowStretch( 2, 1 );
}
Exemple #10
0
void FontDialog::setupFontEncodingBox()
{
    QGroupBox *gb = new QGroupBox(i18n("Encoding"), mainWidget());

    QGridLayout *layout = new QGridLayout(gb);
    layout->setSpacing(KDialog::spacingHint());
    layout->setMargin(KDialog::marginHint() * 2);

    QLabel *lDefaultEncoding = new QLabel(i18n("&Default encoding:"), gb);
    layout->addWidget(lDefaultEncoding, 0, 0);
    m_defaultEncoding = new KComboBox(false, gb);
    layout->addWidget(m_defaultEncoding, 0, 1);
    QStringList encodings = KGlobal::charsets()->availableEncodingNames();
    encodings.prepend(i18n("Use Language Encoding"));
    m_defaultEncoding->insertStringList(encodings);
    lDefaultEncoding->setBuddy(m_defaultEncoding);

    QLabel *lFontSizeAdjustement = new QLabel(i18n("&Font size adjustment:"), gb);
    layout->addWidget(lFontSizeAdjustement, 1, 0);
    m_fontSizeAdjustement = new QSpinBox(-5, 5, 1, gb);
    layout->addWidget(m_fontSizeAdjustement, 1, 1);
    lFontSizeAdjustement->setBuddy(m_fontSizeAdjustement);
}
Exemple #11
0
    ChannelDialog::ChannelDialog(const QString& title, QWidget *parent, const char *name)
        : KDialogBase(Plain, title, Ok|Cancel, Ok, parent, name)
    {
        QFrame* mainWidget = plainPage();
        QGridLayout* mainLayout = new QGridLayout(mainWidget, 1, 2, 0, spacingHint());

        QLabel* channelLbl = new QLabel(i18n("C&hannel:"), mainWidget);
        m_channelEdit = new QLineEdit(mainWidget);
        m_channelEdit->setMaxLength(50);
        channelLbl->setBuddy(m_channelEdit);

        QLabel* passwordLbl = new QLabel(i18n("Pass&word:"), mainWidget);
        m_passwordEdit = new QLineEdit(mainWidget);
        m_passwordEdit->setEchoMode(QLineEdit::Password);
        passwordLbl->setBuddy(m_passwordEdit);

        mainLayout->addWidget(channelLbl, 0, 0);
        mainLayout->addWidget(m_channelEdit, 0, 1);
        mainLayout->addWidget(passwordLbl, 1, 0);
        mainLayout->addWidget(m_passwordEdit, 1, 1);

        m_channelEdit->setFocus();
    }
FilterSelectionWidget::FilterSelectionWidget( QWidget *parent )
  : KHBox( parent )
{
  setSpacing( KDialog::spacingHint() );

  QLabel *label = new QLabel( i18n( "Filter:" ), this );
  label->setObjectName( "kde toolbar widget" );

  mFilterCombo = new KComboBox( this );
  mFilterCombo->setMaximumWidth( 200 );
  label->setBuddy( mFilterCombo );
  connect( mFilterCombo, SIGNAL( activated( int ) ),
           this, SIGNAL( filterActivated( int ) ) );
}
    LoginDialog(QWidget *parent = 0)
        : QDialog(parent)
    {
        QGridLayout *gl = new QGridLayout;
        setLayout(gl);

        QLabel *l;

        l = new QLabel("&Login:"******"&Password:"******"&Ok");
        connect(pb, SIGNAL(clicked()), this, SLOT(accept()));
        hboxlayout->addWidget(pb);

        pb = new QPushButton("&Cancel");
        connect(pb, SIGNAL(clicked()), this, SLOT(reject()));
        hboxlayout->addWidget(pb);

        hbox->setLayout(hboxlayout);
    }
Exemple #14
0
void LoginDialog::setupGUI() {
    // setup a grid layout
    QGridLayout* formGridLayout = new QGridLayout(this);
 
    _usernameLineEdit = new QLineEdit(this);
    
    QLabel* usernameLabel = new QLabel(this);
    usernameLabel->setText("Username");
    usernameLabel->setBuddy(_usernameLineEdit);
    
    formGridLayout->addWidget(usernameLabel, 0, 0);
    formGridLayout->addWidget(_usernameLineEdit, 1, 0);
    
    _passwordLineEdit = new QLineEdit(this);
    _passwordLineEdit->setEchoMode(QLineEdit::Password);

    QLabel* passwordLabel = new QLabel(this);
    passwordLabel->setText("Password");
    passwordLabel->setBuddy(_passwordLineEdit);
    
    formGridLayout->addWidget(passwordLabel, 2, 0);
    formGridLayout->addWidget(_passwordLineEdit, 3, 0);
    
    QDialogButtonBox* buttons = new QDialogButtonBox(this);
    
    QPushButton* okButton = buttons->addButton(QDialogButtonBox::Ok);
    QPushButton* cancelButton = buttons->addButton(QDialogButtonBox::Cancel);
    
    okButton->setText("Login");
    
    connect(cancelButton, &QPushButton::clicked, this, &QDialog::close);
    connect(okButton, &QPushButton::clicked, this, &LoginDialog::loginButtonClicked);
    
    formGridLayout->addWidget(buttons, 4, 0, 1, 2);
    
    setLayout(formGridLayout);
}
//// A dialog to load a KDE icon by its name
LoadIconDialog::LoadIconDialog(QWidget *parent)
        : KDialog(parent, "loadicon_dialog", true, i18n("Load KDE Icon by Name"), Ok | Cancel, Ok, false)
{
    QFrame *frame = makeMainWidget();
    QGridLayout *l = new QGridLayout(frame);

    // Name input
    QLabel *name = new QLabel(i18n("&Name:"), frame);
    l->addWidget(name, 0, 0);
    name->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_nameInput = new KLineEdit("kexi", frame);
    l->addWidget(m_nameInput, 0, 1);
    name->setBuddy(m_nameInput);

    // Choose size
    QLabel *size = new QLabel(i18n("&Size:"), frame);
    l->addWidget(size, 1, 0);
    size->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

    KComboBox *combo = new KComboBox(frame);
    l->addWidget(combo, 1, 1);
    size->setBuddy(combo);
    QStringList list;
    list << i18n("Small") << i18n("Medium") << i18n("Large") << i18n("Huge");
    combo->insertStringList(list);
    combo->setCurrentItem(2);
    connect(combo, SIGNAL(activated(int)), this, SLOT(changeIconSize(int)));


    // Icon chooser button
    m_button = new KIconButton(frame);
    m_button->setIcon(koIconName("calligrakexi"));
    m_button->setIconSize(KIconLoader::SizeMedium);
    l->addWidget(m_button, 0, 2, 2, 1);
    connect(m_button, SIGNAL(iconChanged(QString)), this, SLOT(updateIconName(QString)));
    connect(m_nameInput, SIGNAL(textChanged(QString)), this, SLOT(setIcon(QString)));
}
Exemple #16
0
void DiffPage::addFormatTab()
{
	QWidget* page   = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	// add diff modes
	m_modeButtonGroup = new QButtonGroup( page );
        QGroupBox *box = new QGroupBox( page );
	box->setWhatsThis( i18n( "Select the format of the output generated by diff. Unified is the one that is used most frequently because it is very readable. The KDE developers like this format the best so use it for sending patches." ) );
	layout->addWidget( box );
	QVBoxLayout* bgLayout = new QVBoxLayout( box );
	box->setTitle( i18n( "Output Format" ) );
	//m_modeButtonGroup->setMargin( KDialog::marginHint() );

        QRadioButton *radioButton = new QRadioButton( i18n( "Context" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Context);
	bgLayout->addWidget( radioButton );
        radioButton = new QRadioButton( i18n( "Normal" ),  box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Normal);
        bgLayout->addWidget( radioButton );
        radioButton =  new QRadioButton( i18n( "Unified" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Unified);
        bgLayout->addWidget( radioButton );

	// #lines of context (loc)
	QGroupBox* groupBox = new QGroupBox( page );
        QHBoxLayout *groupLayout = new QHBoxLayout;
        groupBox->setLayout( groupLayout );
	layout->addWidget( groupBox );
	groupBox->setTitle( i18n( "Lines of Context" ) );
	groupBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	//groupBox->setMargin( KDialog::marginHint() );

	QLabel* label = new QLabel( i18n( "Number of context lines:" ));
        groupLayout->addWidget( label );
	label->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	m_locSpinBox = new QSpinBox( groupBox );
	m_locSpinBox->setRange( 0, 100 );
	groupLayout->addWidget( m_locSpinBox );
	m_locSpinBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	label->setBuddy( m_locSpinBox );

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	m_tabWidget->addTab( page, i18n( "Format" ) );
}
SoundPicker::SoundPicker(QWidget* parent)
    : QFrame(parent),
      mRevertType(false)
{
    QHBoxLayout* soundLayout = new QHBoxLayout(this);
    soundLayout->setMargin(0);
    soundLayout->setSpacing(KDialog::spacingHint());
    mTypeBox = new KHBox(this);    // this is to control the QWhatsThis text display area
    mTypeBox->setMargin(0);
    mTypeBox->setSpacing(KDialog::spacingHint());

    QLabel* label = new QLabel(i18n_label_Sound(), mTypeBox);
    label->setFixedSize(label->sizeHint());

    // Sound type combo box
    // The order of combo box entries must correspond with the 'Type' enum.
    if (indexes.isEmpty())
    {
        indexes[Preferences::Sound_None]     = 0;
        indexes[Preferences::Sound_Beep]     = 1;
        indexes[Preferences::Sound_File] = 2;
        indexes[Preferences::Sound_Speak]    = 3;
    }

    mTypeCombo = new ComboBox(mTypeBox);
    mTypeCombo->addItem(i18n_combo_None());     // index None
    mTypeCombo->addItem(i18n_combo_Beep());     // index Beep
    mTypeCombo->addItem(i18n_combo_File());     // index PlayFile
    mSpeakShowing = !theApp()->speechEnabled();
    showSpeak(!mSpeakShowing);            // index Speak (only displayed if appropriate)
    connect(mTypeCombo, SIGNAL(activated(int)), SLOT(slotTypeSelected(int)));
    connect(mTypeCombo, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
    label->setBuddy(mTypeCombo);
    soundLayout->addWidget(mTypeBox);

    // Sound file picker button
    mFilePicker = new PushButton(this);
    mFilePicker->setIcon(KIcon(SmallIcon("audio-x-generic")));
    int size = mFilePicker->sizeHint().height();
    mFilePicker->setFixedSize(size, size);
    connect(mFilePicker, SIGNAL(clicked()), SLOT(slotPickFile()));
    mFilePicker->setToolTip(i18nc("@info:tooltip", "Configure sound file"));
    mFilePicker->setWhatsThis(i18nc("@info:whatsthis", "Configure a sound file to play when the alarm is displayed."));
    soundLayout->addWidget(mFilePicker);

    // Initialise the file picker button state and tooltip
    mTypeCombo->setCurrentIndex(indexes[Preferences::Sound_None]);
    mFilePicker->setEnabled(false);
}
Exemple #18
0
void KTreeWidgetSearchLineWidget::createWidgets()
{
  QLabel *label = new QLabel( i18n("S&earch:"), this );

  searchLine()->show();

  label->setBuddy( d->searchLine );
  label->show();

  QHBoxLayout* layout = new QHBoxLayout( this );
  layout->setMargin( 0 );
  layout->addWidget( label );
  layout->addWidget( d->searchLine );
  setFocusProxy( searchLine() );
}
Exemple #19
0
QWidget*
Dynamic::WeeklyTopBias::widget( QWidget* parent )
{
    QWidget *widget = new QWidget( parent );
    QVBoxLayout *layout = new QVBoxLayout( widget );

    QLabel *label = new QLabel( i18nc( "in WeeklyTopBias. Label for the date widget", "from:" ) );
    QDateTimeEdit *fromEdit = new QDateTimeEdit( QDate::currentDate().addDays( -7 ) );
    fromEdit->setMinimumDate( QDateTime::fromTime_t( 1111320001 ).date() ); // That's the first week in last fm
    fromEdit->setMaximumDate( QDate::currentDate() );
    fromEdit->setCalendarPopup( true );
    if( m_range.from.isValid() )
        fromEdit->setDateTime( m_range.from );

    connect( fromEdit, SIGNAL( dateTimeChanged( const QDateTime& ) ),
             this, SLOT( fromDateChanged( const QDateTime& ) ) );
    label->setBuddy( fromEdit );
    layout->addWidget( label );
    layout->addWidget( fromEdit );

    label = new QLabel( i18nc( "in WeeklyTopBias. Label for the date widget", "to:" ) );
    QDateTimeEdit *toEdit = new QDateTimeEdit( QDate::currentDate().addDays( -7 ) );
    toEdit->setMinimumDate( QDateTime::fromTime_t( 1111320001 ).date() ); // That's the first week in last fm
    toEdit->setMaximumDate( QDate::currentDate() );
    toEdit->setCalendarPopup( true );
    if( m_range.to.isValid() )
        toEdit->setDateTime( m_range.to );

    connect( toEdit, SIGNAL( dateTimeChanged( const QDateTime& ) ),
             this, SLOT( toDateChanged( const QDateTime& ) ) );
    label->setBuddy( toEdit );
    layout->addWidget( label );
    layout->addWidget( toEdit );

    return widget;
}
void *FormBase::setupGridLineEdit(QWidget *parent, QStringList texts, int lineEditWidth)
{
	QGridLayout *layout = new QGridLayout(parent, texts.count(), 2, 5, 5);
	
	for (uint i = 0; i < texts.count(); i++)
	{
		QLabel *labTmp = new QLabel(texts[i], parent);
		KLineEdit *lineEditTmp = new KLineEdit(parent);
		lineEditTmp->setMaximumWidth(lineEditWidth);
		lineEditTmp->resize( lineEditTmp->height(), lineEditWidth);
		labTmp->setBuddy(lineEditTmp);
		layout->addWidget(labTmp, i, 0);
		layout->addWidget(lineEditTmp, i, 1);
	}
}
// Borrowed&modified from KBookmarkMenu...
BookmarkEditDialog::BookmarkEditDialog(const QString& title, const QString& url,
                                       QWidget * parent, const char * name, const QString& caption )
  : KDialog( parent ),
    m_title(0), m_location(0)
{
    setObjectName( name );
    setModal( true );
    setCaption( caption );
    setButtons( Ok|Cancel );

    setButtonText( Ok, i18n( "&Update" ) );

    QWidget *main = new QWidget( this );
    setMainWidget( main );

    bool folder = url.isNull();
    QGridLayout *grid = new QGridLayout( main );

    QLabel *nameLabel = new QLabel(i18n("Name:"), main);
    nameLabel->setObjectName( QLatin1String("title label" ));
    grid->addWidget(nameLabel, 0, 0);
    m_title = new KLineEdit(main);
    m_title->setText(title);
    nameLabel->setBuddy(m_title);
    grid->addWidget(m_title, 0, 1);
    if(!folder) {
        QLabel *locationLabel = new QLabel(i18n("Location:"), main);
        locationLabel->setObjectName( QLatin1String("location label" ));
        grid->addWidget(locationLabel, 1, 0);
        m_location = new KLineEdit(main);
        m_location->setText(url);
        locationLabel->setBuddy(m_location);
        grid->addWidget(m_location, 1, 1);
    }
    main->setMinimumSize( 300, 0 );
}
Exemple #22
0
AddrDlg::AddrDlg(QWidget *parent)
: QDialog(parent)
{
   QLabel * hostLabel = new QLabel(tr("&Server name:"));
   QLabel * portLabel = new QLabel(tr("S&erver port:"));

   hostLineEdit = new QLineEdit("127.0.0.1");
   portLineEdit = new QLineEdit("9999");
   portLineEdit->setValidator(new QIntValidator(1, 65535, this));

   hostLabel->setBuddy(hostLineEdit);
   portLabel->setBuddy(portLineEdit);

   QPushButton * connectButton = new QPushButton(tr("Connect"));
   connectButton->setDefault(true);

   QPushButton * quitButton = new QPushButton(tr("Quit"));

   QDialogButtonBox * buttonBox = new QDialogButtonBox;
   buttonBox->addButton(connectButton, QDialogButtonBox::AcceptRole);
   buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);

   connect(connectButton, SIGNAL(clicked()), this, SLOT(accept()));
   connect(quitButton, SIGNAL(clicked()), this, SLOT(reject()));
   
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(hostLabel, 0, 0);
    mainLayout->addWidget(hostLineEdit, 0, 1);
    mainLayout->addWidget(portLabel, 1, 0);
    mainLayout->addWidget(portLineEdit, 1, 1);
    mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
    setLayout(mainLayout);

    setWindowTitle(tr("Lamp Server Address"));
    portLineEdit->setFocus();
}
  NewFileChooser::NewFileChooser(QWidget * parent) :
    KDialogBase(KDialogBase::Plain, i18n("New file dialog (title)", "New File"), KDialogBase::Ok|KDialogBase::Cancel,
                KDialogBase::Ok, parent, "New file", true)
  {
      QVBoxLayout* lay = new QVBoxLayout( plainPage(), 5, 5 );

      lay->addWidget( new QLabel( i18n("<b>New File Creation</b>"), plainPage() ) );

      QGridLayout* grid = new QGridLayout(lay, 2, 2, 5 );
      QLabel * l = new QLabel(i18n("&Directory:"), plainPage() );
      grid->addWidget(l, 0, 0);
      m_urlreq = new KURLRequester( plainPage(), "url request" );
      grid->addWidget(m_urlreq, 0, 1);
      l->setBuddy(m_urlreq);
      l = new QLabel(i18n("&File name:"), plainPage() );
      grid->addWidget(l, 1, 0);
      m_filename = new KLineEdit( plainPage() );
      grid->addWidget(m_filename, 1, 1);
      l->setBuddy(m_filename);
//      lay->addWidget( grid );

      QHBoxLayout* hbox = new QHBoxLayout( lay, 5 );
      m_filetypes = new KComboBox( plainPage(), "combo" );
      hbox->addWidget(m_filetypes);
      m_addToProject = new QCheckBox( i18n("Add to project (on checkbox)", "&Add to project"), plainPage(), "addproject" );
      hbox->addWidget(m_addToProject);

      lay->addStretch(20);

      m_filename->setFocus();
      m_addToProject->setChecked( true );

      m_urlreq->setMode((int) KFile::Directory);
      connect( m_filename,  SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotFileNameChanged(const QString & ) ) );
      slotFileNameChanged( m_filename->text() );
  }
Exemple #24
0
OAuthFirstPage::OAuthFirstPage(QWidget* parent) :
  QWizardPage(parent)
{
  setTitle(tr("Welcome to Pumpa!"));

  QVBoxLayout* layout = new QVBoxLayout(this);

  QLabel* infoLabel = 
    new QLabel(tr("<p>In order to use pump.io you need to first register an "
                  "account with a pump.io server. If you haven't done this yet "
                  "you can do it now by trying out one of the existing public "
                  "servers: <br /><a href=\"http://pump.io/tryit.html\">"
                  "http://pump.io/tryit.html</a>.</p>"
                  "<p>When you are done enter your new pump.io account id "
                  "below in the form of <b>username@servername</b>.</p>"),
               this);
  infoLabel->setOpenExternalLinks(true);
  infoLabel->setTextInteractionFlags(Qt::TextSelectableByMouse |
                                     Qt::LinksAccessibleByMouse);
  infoLabel->setWordWrap(true);
  layout->addWidget(infoLabel);
  layout->addStretch();

  m_messageLabel = new QLabel(this);
  layout->addWidget(m_messageLabel);

  QLabel* accountIdLabel =
    new QLabel(tr("<b>Your pump.io account id:</b>"), this);
  QLineEdit* accountIdEdit = new QLineEdit(EXAMPLE_ACCOUNT_ID, this);
  accountIdLabel->setBuddy(accountIdEdit);
  connect(accountIdEdit, SIGNAL(textEdited(const QString&)),
          this, SIGNAL(completeChanged()));

  QCheckBox* sslCheckBox =
    new QCheckBox(tr("Use secure connection (recommended)"), this);
  sslCheckBox->setChecked(true);

  layout->addWidget(accountIdLabel);
  layout->addWidget(accountIdEdit);
  layout->addWidget(sslCheckBox);

  registerField("accountId*", accountIdEdit);
  registerField("useSsl*", sslCheckBox);

  setButtonText(QWizard::CommitButton, tr("Next"));
  setCommitPage(true);
  setLayout(layout);
}
IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
    : QWidget( parent )
{
  setObjectName( name );
  QHBoxLayout *layout = new QHBoxLayout( this );
  layout->setSpacing( KDialog::spacingHint() );
  layout->setMargin( 2 );

  mSearchText = new KLineEdit( this );
  mSearchText->setClearButtonShown(true);
  mSearchText->setClickMessage( i18nc( "Search for contacts in the address book", "Search" ) );
  mSearchText->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
  mSearchText->setWhatsThis( i18n( "The incremental search<p>Enter some text here will start the search for the contact, which matches the search pattern best. The part of the contact, which will be used for matching, depends on the field selection.</p>" ) );
  layout->addWidget( mSearchText );

  QLabel *label = new QLabel( i18nc( "as in 'Search in:'", "&in:" ), this );
  label->setObjectName( "kde toolbar widget" );
  label->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
  layout->addWidget( label );

  mFieldCombo = new KComboBox( this );
  mFieldCombo->setEditable( false );
  layout->addWidget( mFieldCombo );
  label->setBuddy(mFieldCombo);

  mFieldCombo->setToolTip( i18n( "Select incremental search field" ) );
  mFieldCombo->setWhatsThis( i18n( "Here you can choose the field, which shall be used for incremental search." ) );

  mInputTimer = new QTimer( this );
  mInputTimer->setSingleShot( true );

  connect( mInputTimer, SIGNAL( timeout() ),
           SLOT( timeout() ) );
  connect( mSearchText, SIGNAL( textChanged( const QString& ) ),
           SLOT( announceDoSearch() ) );
  connect( mSearchText, SIGNAL( returnPressed() ),
           SLOT( announceDoSearch() ) );
  connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
           SLOT( announceDoSearch() ) );
  connect( mSearchText, SIGNAL( clearButtonClicked() ),
           SLOT( announceDoSearch() ) );

  initFields();

  mSearchText->installEventFilter( this );

  setFocusProxy( mSearchText );
}
Exemple #26
0
void KTreeViewSearchLineWidget::createWidgets()
{
  QLabel *label = new QLabel( i18n("S&earch:"), this );
  label->setObjectName( QStringLiteral("kde toolbar widget") );

  searchLine()->show();

  label->setBuddy( d->searchLine );
  label->show();

  QHBoxLayout* layout = new QHBoxLayout( this );
  layout->setSpacing( 5 );
  layout->setMargin( 0 );
  layout->addWidget( label );
  layout->addWidget( d->searchLine );
}
Exemple #27
0
FreeBusyWidget::FreeBusyWidget( KABC::AddressBook *ab, QWidget *parent, const char *name )
  : KAB::ContactEditorWidget( ab, parent, name )
{
  QHBoxLayout *layout = new QHBoxLayout( this, KDialog::marginHint(),
                                         KDialog::spacingHint() );

  QLabel *label = new QLabel( i18n( "Location of Free/Busy information:" ), this );
  layout->addWidget( label );

  mURL = new KURLRequester( this );
  label->setBuddy( mURL );
  layout->addWidget( mURL );

  connect( mURL, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( setModified() ) );
}
ClassWidget::ClassWidget(QWidget* parent, ClassBrowserPlugin* plugin)
  : QWidget(parent)
  , m_plugin(plugin)
  , m_model(new ClassModel())
  , m_tree(new ClassTree(this, plugin))
  , m_searchLine(new KLineEdit(this))
{
  setObjectName("Class Browser Tree");
  setWindowTitle(i18n("Classes"));
  setWindowIcon(SmallIcon("code-class"));

  // Set tree in the plugin
  m_plugin->setActiveClassTree(m_tree);

  // Set model in the tree view
  m_tree->setModel(m_model);
  m_tree->header()->setResizeMode(0, QHeaderView::ResizeToContents);
  m_tree->header()->setStretchLastSection(false);

  // We need notification in the model for the collapse/expansion of nodes.
  connect(m_tree, SIGNAL(collapsed(const QModelIndex&)),
          m_model, SLOT(collapsed(const QModelIndex&)));
  connect(m_tree, SIGNAL(expanded(const QModelIndex&)),
          m_model, SLOT(expanded(const QModelIndex&)));

  // Init search box
  m_searchLine->setClearButtonShown( true );
  connect(m_searchLine, SIGNAL(textChanged(QString)), m_model, SLOT(updateFilterString(QString)));
  QLabel *searchLabel = new QLabel( i18n("S&earch:"), this );
  searchLabel->setBuddy( m_searchLine );

  QHBoxLayout* layout = new QHBoxLayout();
  layout->setSpacing( 5 );
  layout->setMargin( 0 );
  layout->addWidget(searchLabel);
  layout->addWidget(m_searchLine);

  setFocusProxy( m_searchLine );

  QVBoxLayout* vbox = new QVBoxLayout(this);
  vbox->setMargin(0);
  vbox->addLayout(layout);
  vbox->addWidget(m_tree);
  setLayout( vbox );

  setWhatsThis( i18n( "Class Browser" ) );
}
Exemple #29
0
Slider::Slider(int minValue, int maxValue, int pageStep, int tickStep,
        int value, Qt::Orientation orientation, const QString& label,
        QWidget * parent): QWidget(parent)
{
    slider = new QSlider(orientation, parent);
    slider->setTickInterval(tickStep);
    slider->setTickPosition(QSlider::TicksLeft);
    slider->setRange(minValue, maxValue);
    slider->setSingleStep(pageStep);
    slider->setValue(value);
    if (orientation == Qt::Vertical) {
        slider->setMinimumHeight(150);
    }
    else {
        slider->setMinimumWidth(150);
    }
    connect(slider, SIGNAL(valueChanged(int)), this, SLOT(updateSpinBox(int)));
    connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(fillSpinBox(int)));

    sliderSpin = new QSpinBox(this);
    sliderSpin->setRange(minValue, maxValue);
    sliderSpin->setValue(value);
    sliderSpin->setKeyboardTracking(false);
    connect(sliderSpin, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
    connect(sliderSpin, SIGNAL(editingFinished()), this, SLOT(emitAsMoved()));

    QLabel* sliderLabel = new QLabel(this);
    sliderLabel->setText(label);
    sliderLabel->setBuddy(sliderSpin);
    sliderLabel->setMinimumWidth(5*sliderLabel->fontMetrics().maxWidth());
    QBoxLayout *sliderLayout = new QBoxLayout(QBoxLayout::LeftToRight,this);
    sliderLayout->setMargin(0);
    sliderLayout->addWidget(sliderLabel);
    sliderLayout->addWidget(slider);
    sliderLayout->addSpacing(2);
    sliderLayout->addWidget(sliderSpin);
    if (orientation == Qt::Vertical) {
        sliderLayout->setDirection(QBoxLayout::TopToBottom);
        sliderLayout->setAlignment(Qt::AlignHCenter);
    }
    else {
        sliderLayout->setDirection(QBoxLayout::LeftToRight);
        sliderLayout->setAlignment(Qt::AlignTop);
    }
    setMinimumWidth(155 + sliderLabel->width() + sliderLabel->fontMetrics().maxWidth() * 3);
    setLayout(sliderLayout);
}
Exemple #30
0
void MediaBrowser::indexSingleClicked(const QModelIndex &idx)
{
	QFileInfo info = m_fsModel->fileInfo(idx);
	m_btnBase->setEnabled(idx.isValid() && !info.isDir());

	m_viewer->setStartBackgroundVideoPausedInPreview(!m_autoPlayVideo);
	if(SlideGroup::canUseBackground(info))
		m_viewer->slideGroup()->changeBackground(info);
	else
		m_viewer->slideGroup()->changeBackground(AbstractVisualItem::Solid,"#000");
		
	if(m_controlWidget)
	{
		m_viewerLayout->removeWidget(m_controlWidget);
		delete m_controlWidget; //->deleteLater();
		m_controlWidget = 0;
	}
	
	if(MediaBrowser::isVideo(info.suffix()))
	{
		QList<QWidget*> widgets = m_viewer->controlWidgets();
		if(!widgets.isEmpty())
		{
			m_controlWidget = widgets.takeFirst();
			
			
			m_autoPlayCheckbox = new QCheckBox(m_controlWidget);
			m_autoPlayCheckbox->setChecked(m_autoPlayVideo);
			
			QLabel *label = new QLabel("Auto-play",m_controlWidget);
			label->setBuddy(m_autoPlayCheckbox);
			connect(m_autoPlayCheckbox, SIGNAL(toggled(bool)), this, SLOT(setAutoPlayVideo(bool)));
			
			
			QHBoxLayout *layout = dynamic_cast<QHBoxLayout*>(m_controlWidget->layout());
			if(layout)
			{
				//m_controlWidget->setStyleSheet("QLabel{display:none}"
				layout->itemAt(0)->widget()->setVisible(false);
				layout->addStretch(1);
				layout->addWidget(m_autoPlayCheckbox);
				layout->addWidget(label);
			}
			
			m_controlWidget->setParent(m_viewerBase);
			m_viewerLayout->addWidget(m_controlWidget);
		}