コード例 #1
0
ファイル: NamedAreaDialog.cpp プロジェクト: KDE/koffice
EditNamedAreaDialog::EditNamedAreaDialog(QWidget* parent, Selection* selection)
        : KDialog(parent)
        , m_selection(selection)
{
    setButtons(Ok | Cancel);
    setModal(true);
    setObjectName("EditNamedAreaDialog");
    enableButtonOk(false);

    QWidget *page = new QWidget();
    setMainWidget(page);

    QGridLayout * gridLayout = new QGridLayout(page);
    gridLayout->setMargin(KDialog::marginHint());
    gridLayout->setSpacing(KDialog::spacingHint());

    QLabel * textLabel4 = new QLabel(page);
    textLabel4->setText(i18n("Cells:"));
    gridLayout->addWidget(textLabel4, 2, 0);

    m_cellRange = new KLineEdit(page);
    gridLayout->addWidget(m_cellRange, 2, 1);

    QLabel * textLabel1 = new QLabel(page);
    textLabel1->setText(i18n("Sheet:"));
    gridLayout->addWidget(textLabel1, 1, 0);

    m_sheets = new KComboBox(page);
    gridLayout->addWidget(m_sheets, 1, 1);

    QLabel * textLabel2 = new QLabel(page);
    textLabel2->setText(i18n("Area name:"));
    gridLayout->addWidget(textLabel2, 0, 0);

    m_areaNameEdit = new KLineEdit(page);
    gridLayout->addWidget(m_areaNameEdit, 0, 1);

    const QList<KCSheet*> sheetList = m_selection->activeSheet()->map()->sheetList();
    for (int i = 0; i < sheetList.count(); ++i) {
        KCSheet* sheet = sheetList.at(i);
        if (!sheet)
            continue;
        m_sheets->insertItem(i, sheet->sheetName());
    }

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(m_areaNameEdit, SIGNAL(textChanged(const QString&)),
            this, SLOT(slotAreaNameModified(const QString&)));
}
コード例 #2
0
ファイル: purchaseeditor.cpp プロジェクト: adlh/lemonpos
PurchaseEditor::PurchaseEditor( QWidget *parent )
: KDialog( parent )
{
    ui = new PurchaseEditorUI( this );
    setMainWidget( ui );
    setCaption( i18n("Purchase") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    setDefaultButton(KDialog::None);
    ui->btnAddItem->setDefault(true);

    //Set Validators for input boxes
    QRegExp regexpC("[0-9]{1,13}"); //(EAN-13 y EAN-8) .. y productos sin codigo de barras?
    QRegExpValidator * validatorEAN13 = new QRegExpValidator(regexpC, this);
    ui->editCode->setValidator(validatorEAN13);
    ui->editTax->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3,ui->editTax));
    ui->editExtraTaxes->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3,ui->editExtraTaxes));
    ui->editCost->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3, ui->editCost));
    ui->editPoints->setValidator(new QIntValidator(0,999999999, ui->editPoints));
    ui->editFinalPrice->setValidator(new QDoubleValidator(0.00,999999999999.99, 3, ui->editFinalPrice));
    ui->editItemsPerBox->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editItemsPerBox));
    ui->editPricePerBox->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editPricePerBox));
    ui->editQty->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editQty));

    connect( ui->btnPhoto          , SIGNAL( clicked() ), this, SLOT( changePhoto() ) );
    connect( ui->btnCalculatePrice , SIGNAL( clicked() ), this, SLOT( calculatePrice() ) );
    connect( ui->editItemsPerBox , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editPricePerBox , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editCost , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editTax , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editExtraTaxes , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editUtility , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editCode, SIGNAL(textEdited(const QString &)), SLOT(checkIfCodeExists()));
    connect( ui->editCode, SIGNAL(returnPressed()), ui->editQty, SLOT(setFocus()));
    connect( ui->btnAddItem, SIGNAL( clicked() ), this, SLOT( addItemToList() ) );
    connect(ui->groupBoxedItem, SIGNAL(toggled(bool)), this, SLOT(focusItemsPerBox(bool)) );

    connect(ui->btnRemoveItem, SIGNAL( clicked() ), SLOT( deleteSelectedItem() ) );

    ui->chIsAGroup->setDisabled(true);
    

    status = estatusNormal;
    productExists = false;
    productsHash.clear();
    resetEdits();
    totalBuy = 0.0;
    itemCount = 0.0;
    QTimer::singleShot(500, this, SLOT(setupTable()));
}
コード例 #3
0
K3bMovixView::K3bMovixView( K3bMovixDoc* doc, QWidget* parent, const char* name )
  : K3bView( doc, parent, name ),
    m_doc(doc)
{
  m_listView = new K3bMovixListView( m_doc, this );
  setMainWidget( m_listView );

  connect( m_listView, SIGNAL(contextMenuRequested( QListViewItem*, const QPoint& , int )),
	   this, SLOT(slotContextMenuRequested(QListViewItem*, const QPoint& , int )) );


  // setup actions
  m_actionProperties = new KAction( i18n("Properties"), "misc",
				    0, this, SLOT(showPropertiesDialog()),
				    actionCollection(), "movix_show_props" );
  m_actionRemove = new KAction( i18n( "Remove" ), "editdelete",
				Key_Delete, this, SLOT(slotRemoveItems()),
				actionCollection(), "movix_remove_item" );
  m_actionRemoveSubTitle = new KAction( i18n( "Remove Subtitle File" ), "editdelete",
					0, this, SLOT(slotRemoveSubTitleItems()),
					actionCollection(), "movix_remove_subtitle_item" );
  m_actionAddSubTitle = new KAction( i18n("Add Subtitle File..."), "",
				     0, this, SLOT(slotAddSubTitleFile()),
				     actionCollection(), "movix_add_subtitle" );

  m_popupMenu = new KPopupMenu( this );
  m_actionRemove->plug( m_popupMenu );
  m_actionRemoveSubTitle->plug( m_popupMenu );
  m_actionAddSubTitle->plug( m_popupMenu );
  m_popupMenu->insertSeparator();
  m_actionProperties->plug( m_popupMenu );
  m_popupMenu->insertSeparator();
  //  k3bMain()->actionCollection()->action("file_burn")->plug( m_popupMenu );


  addPluginButtons( K3bProjectPlugin::MOVIX_CD );

  toolBox()->addStretch();

  m_volumeIDEdit = new QLineEdit( doc->isoOptions().volumeID(), toolBox() );
  toolBox()->addLabel( i18n("Volume Name:") );
  toolBox()->addSpacing();
  toolBox()->addWidget( m_volumeIDEdit );
  connect( m_volumeIDEdit, SIGNAL(textChanged(const QString&)), 
	   m_doc,
	   SLOT(setVolumeID(const QString&)) );

  connect( m_doc, SIGNAL(changed()), this, SLOT(slotDocChanged()) );
}
コード例 #4
0
TextFileImportDialog::TextFileImportDialog(QWidget *parent)
        : KDialog(parent)
{
    QWidget *page = new QWidget(this);
    QVBoxLayout *topLayout = new QVBoxLayout(page);

    // KDialog options
    setCaption(i18n("Import Text File"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setObjectName("ImportTextFile");
    setModal(true);
    showButtonSeparator(false);


    m_choices = new QGroupBox(i18n("Format of the Text File"), page);
    m_choiceLayout = new QVBoxLayout;
    m_choices->setLayout(m_choiceLayout);

    m_emptyline_choice = new QRadioButton(i18n("Notes separated by an &empty line"), m_choices);
    m_newline_choice = new QRadioButton(i18n("One &note per line"),                  m_choices);
    m_dash_choice = new QRadioButton(i18n("Notes begin with a &dash (-)"),           m_choices);
    m_star_choice = new QRadioButton(i18n("Notes begin with a &star (*)"),           m_choices);
    m_anotherSeparator = new QRadioButton(i18n("&Use another separator:"),           m_choices);

    m_choiceLayout->addWidget(m_emptyline_choice);
    m_choiceLayout->addWidget(m_newline_choice);
    m_choiceLayout->addWidget(m_dash_choice);
    m_choiceLayout->addWidget(m_star_choice);
    m_choiceLayout->addWidget(m_anotherSeparator);

    QWidget *indentedTextEdit = new QWidget(m_choices);
    m_choiceLayout->addWidget(indentedTextEdit);

    QHBoxLayout *hLayout = new QHBoxLayout(indentedTextEdit);
    hLayout->addSpacing(20);
    m_customSeparator = new KTextEdit(indentedTextEdit);
    hLayout->addWidget(m_customSeparator);

    m_all_in_one_choice = new QRadioButton(i18n("&All in one note"),                  m_choices);
    m_choiceLayout->addWidget(m_all_in_one_choice);

    m_emptyline_choice->setChecked(true);
    topLayout->addWidget(m_choices);

    connect(m_customSeparator, SIGNAL(textChanged()), this, SLOT(customSeparatorChanged()));

    setMainWidget(page);
}
コード例 #5
0
ファイル: login.cpp プロジェクト: ruphy/kipi-plugins
FlickrLogin::FlickrLogin(QWidget* parent, const QString& header,
                         const QString& _name, const QString& _passwd)
           : KDialog(parent)
{
    setWindowTitle(header);
    setButtons(Help|Ok|Cancel);
    setDefaultButton(Ok);
    setModal(false);

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

    QVBoxLayout* vbox = new QVBoxLayout(widget);
    m_headerLabel     = new QLabel(widget);
    m_headerLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
    m_headerLabel->setText(header);

    KSeparator *hline = new KSeparator(Qt::Horizontal, widget);

    QGridLayout* centerLayout = new QGridLayout();

    m_nameEdit   = new KLineEdit(widget);
    m_passwdEdit = new KLineEdit(widget);
    m_passwdEdit->setEchoMode(KLineEdit::Password);

    QLabel* nameLabel = new QLabel(widget);
    nameLabel->setText(i18n("Username:"******"Password:"));

    centerLayout->addWidget(m_nameEdit,   0, 1);
    centerLayout->addWidget(m_passwdEdit, 1, 1);
    centerLayout->addWidget(nameLabel,    0, 0);
    centerLayout->addWidget(passwdLabel,  1, 0);
    centerLayout->setMargin(KDialog::spacingHint());
    centerLayout->setSpacing(KDialog::spacingHint());

    vbox->addWidget(m_headerLabel);
    vbox->addWidget(hline);
    vbox->addLayout(centerLayout);
    vbox->setMargin(0);
    vbox->setSpacing(KDialog::spacingHint());

    resize( QSize(300, 150).expandedTo(minimumSizeHint()) );

    m_nameEdit->setText(_name);
    m_passwdEdit->setText(_passwd);
}
コード例 #6
0
ファイル: exportdialog.cpp プロジェクト: KDE/koffice
ExportDialog::ExportDialog(QWidget *parent)
        : KDialog(parent), m_mainwidget(new ExportWidget(this))
{
    setCaption(i18n("Export Sheet to HTML"));
    setButtons(Ok | Cancel);
    setDefaultButton(KDialog::Cancel);
    kapp->restoreOverrideCursor();

    connect(m_mainwidget->mCustomButton, SIGNAL(toggled(bool)),
            m_mainwidget->mCustomURL, SLOT(setEnabled(bool)));
    m_mainwidget->mEncodingBox->addItem(i18n("Recommended: UTF-8"));
    m_mainwidget->mEncodingBox->addItem(i18n("Locale (%1)", QString::fromLatin1(KGlobal::locale()->codecForEncoding()->name())));
    m_mainwidget->mCustomURL->setMode(KFile::ExistingOnly);
    setMainWidget(m_mainwidget);
}
コード例 #7
0
MessagePropertyDialog::MessagePropertyDialog(QWidget *parent, KTNEFMessage *msg)
    : KDialogBase(parent, "MessagePropertyDialog", true, i18n("Message Properties"),
                  KDialogBase::Close | KDialogBase::User1, KDialogBase::Close, false,
                  KStdGuiItem::save())
{
    m_message = msg;

    m_listview = new KListView(this);
    m_listview->addColumn(i18n("Name"));
    m_listview->addColumn(i18n("Value"));
    m_listview->setAllColumnsShowFocus(true);
    setMainWidget(m_listview);

    formatPropertySet(m_message, m_listview);
}
コード例 #8
0
ValgrindDialog::ValgrindDialog( Type type, QWidget* parent )
  : KDialogBase( parent, "valgrind dialog", true, i18n("Valgrind Memory Check"), Ok|Cancel ),
  m_type(type)
{
  w = new DialogWidget( this );
  w->valExecutableEdit->setURL( "valgrind" );
  w->executableEdit->setFocus();
  w->stack->raiseWidget(m_type);
  setMainWidget( w );
  connect( w->executableEdit->lineEdit(),  SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  connect( w->valExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  connect( w->ctExecutableEdit->lineEdit(),  SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  connect( w->kcExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  enableButtonOK( false );
}
コード例 #9
0
ファイル: klistboxdialog.cpp プロジェクト: KDE/kde-baseapps
KListBoxDialog::KListBoxDialog(const QString &text, QWidget *parent)
    : KDialog( parent )
{
  setModal(true);
  setButtons( Ok | Cancel );

  KVBox *page = new KVBox(this);
  setMainWidget(page);

  label = new QLabel(text, page);
  label->setAlignment(Qt::AlignCenter);

  table = new QListWidget(page);
  table->setFocus();
}
コード例 #10
0
ファイル: Splasher.cpp プロジェクト: fatinbrain/reList455
void Splasher::createUI() {
	vlMain = new VerticalLayout;
	vlMain->setBackgroundColor(0xcccccc);
	vlMain->fillSpaceHorizontally();
	vlMain->fillSpaceVertically();

	imgSplash = new Image();
	imgSplash->setScaleMode(IMAGE_SCALE_PRESERVE_ASPECT);
	imgSplash->fillSpaceHorizontally();
	imgSplash->fillSpaceVertically();
	imgSplash->setImage(LOGO);
	vlMain->addChild(imgSplash);

	setMainWidget(vlMain);
}
コード例 #11
0
KPrinterPropertyDialog::KPrinterPropertyDialog(KMPrinter *p, QWidget *parent, const char *name)
: KDialogBase(parent, name, true, QString::null, KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::User1, KDialogBase::Ok, false, KStdGuiItem::save()),
  m_printer(p), m_driver(0), m_current(0)
{
	m_pages.setAutoDelete(false);

	// set a margin
	m_tw = new QTabWidget(this);
	m_tw->setMargin(10);
	connect(m_tw,SIGNAL(currentChanged(QWidget*)),SLOT(slotCurrentChanged(QWidget*)));
	setMainWidget(m_tw);

	if (m_printer)
		m_options = (m_printer->isEdited() ? m_printer->editedOptions() : m_printer->defaultOptions());
}
コード例 #12
0
ファイル: annotatedlg.cpp プロジェクト: serghei/kde-kdesdk
AnnotateDialog::AnnotateDialog(KConfig& cfg, QWidget *parent, const char *name)
    : KDialogBase(parent, name, false, QString::null,
                  Close | Help, Close, true)
    , partConfig(cfg)
{
    annotate = new AnnotateView(partConfig, this);
    setMainWidget(annotate);

    setHelp("annotate");

    setWFlags(Qt::WDestructiveClose | getWFlags());

    QSize size = configDialogSize(partConfig, "AnnotateDialog");
    resize(size);
}
コード例 #13
0
JamendoSettingsDialog::JamendoSettingsDialog(QWidget *parent)
    : Dialog(parent)
{
    setButtons(Ok|Cancel);
    setCaption(tr("Jamendo Settings"));
    QWidget *mw=new QWidget(this);
    QFormLayout *layout=new QFormLayout(mw);
    fmt=new QComboBox(mw);
    fmt->insertItem(0, tr("MP3"));
    fmt->insertItem(1, tr("Ogg"));
    layout->setWidget(0, QFormLayout::LabelRole, new BuddyLabel(tr("Streaming format:"), mw, fmt));
    layout->setWidget(0, QFormLayout::FieldRole, fmt);
    layout->setMargin(0);
    setMainWidget(mw);
}
コード例 #14
0
SensorLoggerSettings::SensorLoggerSettings( QWidget *parent, const char *name )
    : KDialog( parent )
{
  setObjectName( name );
  setModal( true );
  setCaption( i18n( "Sensor Logger Settings" ) );
  setButtons( Ok|Cancel );

  QWidget *widget = new QWidget( this );

  m_settingsWidget = new Ui_SensorLoggerSettingsWidget;
  m_settingsWidget->setupUi( widget );

  setMainWidget( widget );
}
コード例 #15
0
ファイル: exportdialog.cpp プロジェクト: ShermanHuang/kdesdk
ExportDialog::ExportDialog( const QString& remoteTypeName,
                            AbstractModelExporterConfigEditor* configEditor,
                            QWidget* parent )
  : KDialog( parent ),
    mConfigEditor( configEditor )
{
    setCaption( i18nc("@title:window","Export") );
    setButtons( Ok | Cancel );
    setButtonGuiItem( Ok, KGuiItem(i18nc("@action:button","&Export to File..."), QLatin1String("document-export"),
                      i18nc("@info:tooltip","Export the selected data to a file."),
                      i18nc("@info:whatsthis","If you press the <interface>Export to file</interface> "
                            "button, the selected data will be copied to a file "
                            "with the settings you entered above.")) );
    setDefaultButton( Ok );

    QSplitter* splitter = new QSplitter( this );

    setMainWidget( splitter );

    // config editor
    QWidget* editorPage = new QWidget( splitter );
    QVBoxLayout* editorPageLayout = new QVBoxLayout( editorPage );
    QLabel* editorLabel = new QLabel( remoteTypeName );
    QFont font = editorLabel->font();
    font.setBold( true );
    editorLabel->setFont( font );
    editorPageLayout->addWidget( editorLabel );
    editorPageLayout->addWidget( mConfigEditor );
    editorPageLayout->addStretch();

    splitter->addWidget( editorPage );
    splitter->setCollapsible( 0, false );

    mPreviewView = configEditor->createPreviewView();

    if( mPreviewView )
    {
        QGroupBox* previewBox = new QGroupBox( i18nc("@title:group","Preview"), this );
        splitter->addWidget( previewBox );

        QHBoxLayout* previewBoxLayout = new QHBoxLayout( previewBox );

        previewBoxLayout->addWidget( mPreviewView->widget() );
    }

    enableButtonOk( configEditor->isValid() );
    connect( configEditor, SIGNAL(validityChanged(bool)), SLOT(enableButtonOk(bool)) );
}
コード例 #16
0
SocketConfig::SocketConfig(KMWSocketUtil *util, QWidget *parent, const char *name)
    : KDialogBase(parent, name, true, QString::null, Ok | Cancel, Ok, true)
{
    QWidget *dummy = new QWidget(this);
    setMainWidget(dummy);
    KIntValidator *val = new KIntValidator(this);
    QLabel *masklabel = new QLabel(i18n("&Subnetwork:"), dummy);
    QLabel *portlabel = new QLabel(i18n("&Port:"), dummy);
    QLabel *toutlabel = new QLabel(i18n("&Timeout (ms):"), dummy);
    QLineEdit *mm = new QLineEdit(dummy);
    mm->setText(QString::fromLatin1(".[0-255]"));
    mm->setReadOnly(true);
    mm->setFixedWidth(fontMetrics().width(mm->text()) + 10);

    mask_ = new QLineEdit(dummy);
    mask_->setAlignment(Qt::AlignRight);
    port_ = new QComboBox(true, dummy);
    if(port_->lineEdit())
        port_->lineEdit()->setValidator(val);
    tout_ = new QLineEdit(dummy);
    tout_->setValidator(val);

    masklabel->setBuddy(mask_);
    portlabel->setBuddy(port_);
    toutlabel->setBuddy(tout_);

    mask_->setText(util->root_);
    port_->insertItem("631");
    port_->insertItem("9100");
    port_->insertItem("9101");
    port_->insertItem("9102");
    port_->setEditText(QString::number(util->port_));
    tout_->setText(QString::number(util->timeout_));

    QGridLayout *main_ = new QGridLayout(dummy, 3, 2, 0, 10);
    QHBoxLayout *lay1 = new QHBoxLayout(0, 0, 5);
    main_->addWidget(masklabel, 0, 0);
    main_->addWidget(portlabel, 1, 0);
    main_->addWidget(toutlabel, 2, 0);
    main_->addLayout(lay1, 0, 1);
    main_->addWidget(port_, 1, 1);
    main_->addWidget(tout_, 2, 1);
    lay1->addWidget(mask_, 1);
    lay1->addWidget(mm, 0);

    resize(250, 130);
    setCaption(i18n("Scan Configuration"));
}
コード例 #17
0
ファイル: listselector.cpp プロジェクト: fagu/kileip
KileListSelectorBase::KileListSelectorBase(const QStringList &list, const QString &caption, const QString &select, bool sort,
                                           QWidget *parent, const char *name)
: KDialog(parent)
{
	setObjectName(name);
	setCaption(caption);
	setModal(true);
	setButtons(Ok | Cancel);
	setDefaultButton(Ok);
	showButtonSeparator(true);

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

	QVBoxLayout *layout = new QVBoxLayout();
	layout->setMargin(0);
	layout->setSpacing(KDialog::spacingHint());
	page->setLayout(layout);

	layout->addWidget(new QLabel(select, page));

	m_listView = new QTreeWidget(page);
	m_listView->setHeaderLabel(i18n("Files"));
	m_listView->setSortingEnabled(false);
	m_listView->setAllColumnsShowFocus(true);
	m_listView->setRootIsDecorated(false);

	layout->addWidget(m_listView);

	layout->addWidget(new QLabel(i18np("1 item found.", "%1 items found.", list.size())));

	m_listView->setSortingEnabled(sort);
	if(sort) {
		m_listView->sortByColumn(0, Qt::AscendingOrder);
	}

	insertStringList(list);

	m_listView->clearSelection();
	connect(m_listView, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(accept()));
	QItemSelectionModel *selectionModel = m_listView->selectionModel();
	if(selectionModel) { // checking just to be safe
		connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
		        this, SLOT(handleSelectionChanged(const QItemSelection&,const QItemSelection&)));
	}

	enableButtonOk(false);
}
コード例 #18
0
ファイル: password.cpp プロジェクト: KrissN/basket
PasswordDlg::PasswordDlg(QWidget *parent)
        : KDialog(parent)
        , w(0)
{
    // KDialog options
    setWindowTitle(i18n("Password Protection"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setModal(true);
    showButtonSeparator(true);

    setMainWidget(new QWidget(this));
    QHBoxLayout* toplayout = new QHBoxLayout(mainWidget());
    w = new Password;
    toplayout->addWidget(w, 1);
}
コード例 #19
0
Verifier::Verifier(QWidget *parent)
 : KDialog(parent),
   m_verifier(0)
{
  //, name, true, i18n("Checksum verifier"), Cancel, Cancel, true
  QWidget *widget = new QWidget(this);
  ui.setupUi(widget);
  setMainWidget(widget);
  
  // Create columns
  ui.fileList->addColumn(i18n("Filename"));
  ui.fileList->addColumn(i18n("Checksum"), 100);
  
  ui.fileList->setAllColumnsShowFocus(true);
  ui.fileList->header()->setStretchEnabled(true, 0);
}
コード例 #20
0
ファイル: runnerdialog.cpp プロジェクト: CDrummond/carbon
RunnerDialog::RunnerDialog(QWidget *parent)
    : Dialog(parent)
    , process(0) {
    QWidget *mainWidget = new QWidget(this);

    setupUi(mainWidget);
    setMainWidget(mainWidget);
    setButtons(Cancel);
    output->setReadOnly(true);
    output->setVisible(false);
    setMinimumWidth(500);
    connect(detailsButton, SIGNAL(toggled(bool)), this, SLOT(showDetails(bool)));
#ifdef QT_QTDBUS_FOUND
    unityMessage = QDBusMessage::createSignal("/Carbon", "com.canonical.Unity.LauncherEntry", "Update");
#endif
}
コード例 #21
0
ファイル: projectdlgs.cpp プロジェクト: zoltanp/ktechlab-0.3
//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() );
}
コード例 #22
0
ファイル: dlg_compose.cpp プロジェクト: KDE/calligra-history
DlgCompose::DlgCompose(KisImageWSP image, QWidget *  parent)
    : KDialog(parent),
      m_image(image)
{
    setCaption(i18n("compose Layer"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);

    m_page = new WdgCompose(this);
    Q_CHECK_PTR(m_page);
    setMainWidget(m_page);
    resize(m_page->sizeHint());

    connect(this, SIGNAL(okClicked()),
            this, SLOT(okClicked()));
}
コード例 #23
0
ファイル: resume.cpp プロジェクト: dcchivela/RaspberryPOS
ResumeDialog::ResumeDialog( QWidget *parent )
: KDialog( parent )
{
    m_modelAssigned = false;
    trNumber = 0;
    userId = 0;

    ui = new ResumeDialogUI( this );
    setMainWidget( ui );
    setCaption( i18n("Resume Sale") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    enableButtonOk(false);

    connect(ui->tableWidget, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    setDefaultButton(KDialog::Ok);
}
コード例 #24
0
StringListSAndRSetDialog::StringListSAndRSetDialog
(QWidget* parent, const char* text, bool modal)
  : DialogBase(parent, text, modal),
    sar(new StringListSelectAndReorderSet(this)),
    sizeIsFixed(false)
{
  // ############################################################################
  // ----- manage subwidgets:
  // buttonOK->setText(i18n("OK"));
  // buttonCancel->setText(i18n("Cancel"));
  enableButtonApply(false);
  setMainWidget(sar);
  // ----- set up geometry:
  resize(minimumSize());
  // ############################################################################
}
コード例 #25
0
InsertFileDialog::InsertFileDialog( Project &project, Node *currentNode, QWidget *parent )
    : KDialog(parent)
{
    setCaption( i18n("Insert File") );
    setButtons( KDialog::Ok | KDialog::Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );
    
    m_panel = new InsertFilePanel( project, currentNode, this );

    setMainWidget( m_panel );
    
    enableButtonOk(false);

    connect( m_panel, SIGNAL( enableButtonOk( bool ) ), SLOT( enableButtonOk( bool ) ) );
}
コード例 #26
0
KEdGotoLine::KEdGotoLine( QWidget *parent, const char *name, bool modal )
  :KDialogBase( parent, name, modal, i18n("Go to Line"), modal ? Ok|Cancel : Ok|Close, Ok, false )
{
  QWidget *page = new QWidget( this );
  setMainWidget(page);
  QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );

  lineNum = new KIntNumInput( 1, page);
  lineNum->setRange(1, 1000000, 1, false);
  lineNum->setLabel(i18n("Go to line:"), AlignVCenter | AlignLeft);
//  lineNum->setMinimumWidth(fontMetrics().maxWidth()*20);
  topLayout->addWidget( lineNum );

  topLayout->addStretch(10);
  lineNum->setFocus();
}
コード例 #27
0
PackageSettingsDialog::PackageSettingsDialog(WorkPackage &p, QWidget *parent)
    : KDialog(parent)
{
    setCaption( i18n("Work Package Settings") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );
    //kDebug(planworkDbg())<<&p;

    dia = new PackageSettingsPanel(p, this);

    setMainWidget(dia);
    enableButtonOk(false);

    connect(dia, SIGNAL(changed(bool)), SLOT(enableButtonOk(bool)));
}
コード例 #28
0
RestartOrBack::RestartOrBack (QWidget *parent)
	: KDialogBase (parent, "rbDialog", true, 0, KDialogBase::User1 | KDialogBase::User2, KDialogBase::User2, false, i18n("&Restart"), i18n("&Back") )
{
	setPlainCaption( i18n("Finished Execution") );
	setButtonWhatsThis( KDialogBase::User1, i18n("Click here to restart the current logo program.") );
	setButtonWhatsThis( KDialogBase::User2, i18n("Click here to switch back to the edit mode.") );
	QWidget *baseWidget = new QWidget(this);
	setMainWidget(baseWidget);
	baseLayout = new QVBoxLayout(baseWidget);
	
	label = new QLabel(baseWidget);
	label->setText( i18n("Execution was finished without errors.\nWhat do you want to do next?") );
	label->setScaledContents(true);
	baseLayout->addWidget(label);
	disableResize();
}
コード例 #29
0
KonqSessionDlg::KonqSessionDlg( KonqViewManager *manager, QWidget *parent )
    : KDialog( parent )
    , d( new KonqSessionDlgPrivate( manager, this ) )
{
    d->layout()->setMargin( 0 );
    setMainWidget( d );
    
    setObjectName( QLatin1String( "konq_session_dialog" ) );
    setModal( true );
    setCaption( i18nc( "@title:window", "Manage Sessions" ) );
    setButtons( BTN_OPEN | Close );
    setDefaultButton( Close );
    
    setButtonGuiItem( BTN_OPEN, KGuiItem( i18n( "&Open" ), "document-open" ) );
    d->m_pSaveCurrentButton->setIcon(KIcon("document-save"));
    d->m_pRenameButton->setIcon(KIcon("edit-rename"));
    d->m_pDeleteButton->setIcon(KIcon("edit-delete"));
    d->m_pNewButton->setIcon(KIcon("document-new"));
    
    QString dir = KStandardDirs::locateLocal("appdata", "sessions/");
    
    d->m_pModel = new KDirModel(d->m_pListView);
    d->m_pModel->sort(QDir::Name);
    d->m_pModel->dirLister()->setDirOnlyMode(true);
    d->m_pModel->dirLister()->openUrl(dir);
    d->m_pListView->setModel(d->m_pModel);
    
    d->m_pListView->setMinimumSize( d->m_pListView->sizeHint() );
    
    connect( d->m_pListView->selectionModel(), SIGNAL( selectionChanged(
        const QItemSelection  &, const QItemSelection &) ), this, SLOT(
        slotSelectionChanged() ) );
    
    enableButton( BTN_OPEN, d->m_pListView->currentIndex().isValid() );
    slotSelectionChanged();

    d->m_pOpenTabsInsideCurrentWindow->setChecked(
	KonqSettings::openTabsInsideCurrentWindow());

    connect( this,SIGNAL(user1Clicked()),SLOT(slotOpen()));
    connect( d->m_pNewButton, SIGNAL(clicked()),SLOT(slotNew()));
    connect( d->m_pSaveCurrentButton, SIGNAL(clicked()),SLOT(slotSave()));
    connect( d->m_pRenameButton, SIGNAL(clicked()),SLOT(slotRename()));
    connect( d->m_pDeleteButton, SIGNAL(clicked()),SLOT(slotDelete()));
    
    resize( sizeHint() );
}
コード例 #30
0
ファイル: main.cpp プロジェクト: Ginox/MoSync
SettingsScreen::SettingsScreen() {
	setProperty("title", "Settings");

	mListView = new Widget("ListView");
	mListView->setProperty("width", "-1");
	mListView->setProperty("height", "-1");

	Widget* shadingItem = new Widget("ListViewItem");
	shadingItem->setProperty("text", "Shading enabled");

	Widget *horizontalLayout = new Widget("HorizontalLayout");
	horizontalLayout->setProperty("width", "-1");
	horizontalLayout->setProperty("height", "-1");
	horizontalLayout->setProperty("childVerticalAlignment", "center");

	Widget *padding = new Widget("RelativeLayout");
	padding->setProperty("width", "-1");
	padding->setProperty("height", "-1");
	horizontalLayout->addChild(padding);

	mShadingCheckBox = new Widget("CheckBox");
	mShadingCheckBox->setProperty("width", "-2");
	mShadingCheckBox->setProperty("height", "-2");
	mShadingCheckBox->setProperty("checked", "true");
	horizontalLayout->addChild(mShadingCheckBox);

	shadingItem->addChild(horizontalLayout);

	mListView->addChild(shadingItem);

	mSetResolutionItem = new Widget("ListViewItem");
	mSetResolutionItem->setProperty("text", "Grid resolution");
	mSetResolutionItem->setProperty("accessoryType", "hasChildren");
	mListView->addChild(mSetResolutionItem);

	Widget* helpItem = new Widget("ListViewItem");
	helpItem->setProperty("text", "Help");
	helpItem->setProperty("accessoryType", "hasChildren");
	mListView->addChild(helpItem);

	Widget* aboutItem = new Widget("ListViewItem");
	aboutItem->setProperty("text", "About");
	aboutItem->setProperty("accessoryType", "hasChildren");
	mListView->addChild(aboutItem);

	setMainWidget(mListView);
}