Esempio n. 1
0
ProjectOperationHandler::ProjectOperationHandler(QQmlApplicationEngine* engine, QWidget* parent)
    : m_engine{ engine }
    , m_parent{ parent }
    , m_projectName{ "" }
    , m_projectLocation{ "" }
{
    QObject* rootObject = m_engine->rootObjects().first();
    QObject* createProjectSlide = rootObject->findChild<QObject*>("createProjectMainIdName");
    m_createProjectForm = rootObject->findChild<QObject*>("createProjectForm");

    QObject::connect(
        m_createProjectForm, SIGNAL(nameChanged(QString)),
        this, SLOT(nameChanged(QString)));
    QObject::connect(
        m_createProjectForm, SIGNAL(locationChanged(QString)),
        this, SLOT(locationChanged(QString)));
    QObject::connect(
        m_createProjectForm, SIGNAL(browseClicked()),
        this, SLOT(browseClicked()));
    QObject::connect(
        m_createProjectForm, SIGNAL(cancelClicked()),
        this, SLOT(cancelClicked()));
    QObject::connect(
        m_createProjectForm, SIGNAL(createClicked()),
        this, SLOT(createClicked()));

    QObject* form = m_createProjectForm->findChild<QObject*>("projectLocationInput"); 
    form->setProperty("text", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));

    QObject* mainPageForm = rootObject->findChild<QObject*>("mainPageForm", Qt::FindChildrenRecursively);
    QObject::connect(mainPageForm, SIGNAL(openProjectLocation(QString, QString)), this, SLOT(openProject(QString, QString)));
}
Esempio n. 2
0
KWFrameDialog::KWFrameDialog(const QList<KWFrame*> &frames, KWDocument *document, KWCanvas *canvas)
        : KPageDialog(canvas)
        , m_frameConnectSelector(0)
        , m_canvas(canvas)
{
    m_state = new FrameConfigSharedState(document);
    setFaceType(Tabbed);
    m_generalFrameProperties = new KWGeneralFrameProperties(m_state);
    addPage(m_generalFrameProperties, i18n("General"));
    m_generalFrameProperties->open(frames);

    m_anchoringProperties = new KWAnchoringProperties(m_state);
    if (m_anchoringProperties->open(frames))
        addPage(m_anchoringProperties, i18n("Smart Positioning"));

    m_runAroundProperties = new KWRunAroundProperties(m_state);
    if (m_runAroundProperties->open(frames))
        addPage(m_runAroundProperties, i18n("Text Run Around"));

    if (frames.count() == 1) {
        m_frameConnectSelector = new KWFrameConnectSelector(m_state);
        KWFrame *frame = frames.first();
        m_state->setKeepAspectRatio(frame->shape()->keepAspectRatio());
        if (m_frameConnectSelector->open(frame))
            addPage(m_frameConnectSelector, i18n("Connect Text Frames"));
        else {
            delete m_frameConnectSelector;
            m_frameConnectSelector = 0;
        }
    }


    connect(this, SIGNAL(okClicked()), this, SLOT(okClicked()));
    connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelClicked()));
}
void IdleTimeDetector::informOverrun()
{
    if (!_overAllIdleDetect)
        return; // In the preferences the user has indicated that he do not
            // want idle detection.

    _timer->stop();
    start = QDateTime::currentDateTime();
    idlestart = start.addSecs(-60 * _maxIdle);
    QString backThen = KGlobal::locale()->formatTime(idlestart.time());
    // Create dialog
        KDialog *dialog=new KDialog( 0 );
        QWidget* wid=new QWidget(dialog);
        dialog->setMainWidget( wid );
        QVBoxLayout *lay1 = new QVBoxLayout(wid);
        QHBoxLayout *lay2 = new QHBoxLayout();
        lay1->addLayout(lay2);
        QString idlemsg=QString( "Desktop has been idle since %1. What do you want to do ?" ).arg(backThen);
        QLabel *label = new QLabel( idlemsg, wid );
        lay2->addWidget( label );
        connect( dialog , SIGNAL(cancelClicked()) , this , SLOT(revert()) );
        connect( wid , SIGNAL(changed(bool)) , wid , SLOT(enabledButtonApply(bool)) );
        QString explanation=i18n("Continue timing. Timing has started at %1", backThen);
        QString explanationrevert=i18n("Stop timing and revert back to the time at %1.", backThen);
        dialog->setButtonText(KDialog::Ok, i18n("Continue timing."));
        dialog->setButtonText(KDialog::Cancel, i18n("Revert timing"));
        dialog->setButtonWhatsThis(KDialog::Ok, explanation);
        dialog->setButtonWhatsThis(KDialog::Cancel, explanationrevert);
        // The user might be looking at another virtual desktop as where ktimetracker is running
        KWindowSystem::self()->setOnDesktop( dialog->winId(), KWindowSystem::self()->currentDesktop() );
        KWindowSystem::self()->demandAttention( dialog->winId() );
        kDebug(5970) << "Setting WinId " << dialog->winId() << " to deskTop " << KWindowSystem::self()->currentDesktop();
        dialog->show();
}
void RemoveRedEyesWindow::slotButtonClicked(int button)
{
    emit buttonClicked(static_cast<KDialog::ButtonCode> (button));

    switch (button)
    {
        case User2:                 // testrun
            emit user2Clicked();
            break;
        case User1:                 // correction
            emit user1Clicked();
            break;
        case Cancel:
            emit cancelClicked();
            break;
        case Close:
            emit myCloseClicked();
            break;
        case Help:
            emit helpClicked();
            break;
        case Default:
            emit defaultClicked();
            break;
    }
}
Esempio n. 5
0
void Dialog::setProgressDialogVisible(bool b)
{
  if (!b)
  {
    d->deleteProgressDialog(true);
  }
  else if(d->progressDialogTimeout >= 0)
  {
    if (d->progressDialog)
    {
      return;
    }
    d->progressDialog = new KProgressDialog(this, i18nc("@title:window", "Check Spelling"),
                                                    i18nc("progress label", "Spell checking in progress..."));
    d->progressDialog->setModal(true);
    d->progressDialog->setAutoClose(false);
    d->progressDialog->setAutoReset(false);
    // create an 'indefinite' progress box as we currently cannot get progress feedback from
    // the speller
    d->progressDialog->progressBar()->reset();
    d->progressDialog->progressBar()->setRange(0, 0);
    d->progressDialog->progressBar()->setValue(0);
    connect(d->progressDialog, SIGNAL(cancelClicked()), this, SLOT(slotCancel()));
    d->progressDialog->setMinimumDuration(d->progressDialogTimeout);
  }
}
Esempio n. 6
0
//----------------------------------------------------------------------
// Save Single File Dialog Widget
//----------------------------------------------------------------------
SaveSingleDialogWidget::SaveSingleDialogWidget(MainWindow *mainWindow, RideItem *rideItem) :
    QDialog(mainWindow, Qt::Dialog), mainWindow(mainWindow), rideItem(rideItem)
{
    setWindowTitle(tr("Save and Conversion"));
    QVBoxLayout *mainLayout = new QVBoxLayout(this);

    // Warning text
    warnText = new QLabel(tr("WARNING\n\nYou have made changes to ") + rideItem->fileName + tr(" If you want to save\nthem, we need to convert the ride to GoldenCheetah\'s\nnative format. Should we do so?\n"));
    mainLayout->addWidget(warnText);

    // Buttons
    QHBoxLayout *buttonLayout = new QHBoxLayout;
    saveButton = new QPushButton(tr("&Save and Convert"), this);
    buttonLayout->addWidget(saveButton);
    abandonButton = new QPushButton(tr("&Discard Changes"), this);
    buttonLayout->addWidget(abandonButton);
    cancelButton = new QPushButton(tr("&Cancel Save"), this);
    buttonLayout->addWidget(cancelButton);
    mainLayout->addLayout(buttonLayout);

    // Don't warn me!
    warnCheckBox = new QCheckBox(tr("Always warn me about file conversions"), this);
    warnCheckBox->setChecked(true);
    mainLayout->addWidget(warnCheckBox);

    // connect up slots
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(abandonButton, SIGNAL(clicked()), this, SLOT(abandonClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
    connect(warnCheckBox, SIGNAL(clicked()), this, SLOT(warnSettingClicked()));
}
K3b::DataMultisessionImportDialog::DataMultisessionImportDialog( QWidget* parent )
    : QDialog( parent),
      d( new Private() )
{
    setModal(true);
    setWindowTitle(i18n("Session Import"));
    QVBoxLayout* layout = new QVBoxLayout( this );

    QLabel* label = new QLabel( i18n( "Please select a session to import." ), this );
    d->sessionView = new QTreeWidget( this );
    d->sessionView->setHeaderHidden( true );
    d->sessionView->setItemsExpandable( false );
    d->sessionView->setRootIsDecorated( false );

    QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this );
    d->okButton = buttonBox->button( QDialogButtonBox::Ok );
    connect( buttonBox, SIGNAL(accepted()), SLOT(accept()) );
    connect( buttonBox, SIGNAL(rejected()), SLOT(reject()) );

    layout->addWidget( label );
    layout->addWidget( d->sessionView );
    layout->addWidget( buttonBox );

    connect( k3bappcore->mediaCache(), SIGNAL(mediumChanged(K3b::Device::Device*)),
             this, SLOT(updateMedia()) );
    connect( d->sessionView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
             this, SLOT(slotSelectionChanged()) );
    connect( d->sessionView, SIGNAL(itemActivated(QTreeWidgetItem*,int)), SIGNAL(okClicked()) );
    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
}
EnterWirelessSettingPage::EnterWirelessSettingPage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::EnterWirelessSettingPage)
{
    ui->setupUi(this);

    connect(ui->m_searchRouterPane, SIGNAL(searchRouterClicked()),
            this ,SIGNAL(searchRouterClicked()));

    connect(ui->m_wirelessSettingPane, SIGNAL(settingValidityUpdate(bool)), SLOT(onSettingValidityUpdate(bool)));

    connect(ui->m_operatePane, SIGNAL(applyClicked()), SLOT(onApplySetting()));
    connect(ui->m_operatePane, SIGNAL(cancelClicked()), this, SIGNAL(cancelClicked()));

    retranslateUi();
}
Esempio n. 9
0
TomoToolConfigDialog::TomoToolConfigDialog(QWidget *parent) : QDialog(parent) {
  labelRun = new QLabel("Runnable script");
  editRun = new QLineEdit("/work/imat/");
  hRun = new QHBoxLayout();
  hRun->addWidget(labelRun);
  hRun->addWidget(editRun);

  labelOpt = new QLabel("Command line options");
  editOpt = new QLineEdit("/work/imat");
  hOpt = new QHBoxLayout();
  hOpt->addWidget(labelOpt);

  hOpt->addWidget(editOpt);

  okButton = new QPushButton("Ok");
  cancelButton = new QPushButton("Cancel");
  hBut = new QHBoxLayout();
  hBut->insertStretch(0, 1);
  hBut->addWidget(okButton);
  hBut->addWidget(cancelButton);

  layout = new QGridLayout();
  layout->addLayout(hRun, 0, 0);
  layout->addLayout(hOpt, 1, 0);
  layout->addLayout(hOpt, 2, 0);

  connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
}
void ExportSymlinks::execute()
{
    // test the destination directory
    if (m_destinationDir->isEmpty()) {
        tracer->error(__func__, "The specified 'destinationDir' is null or empty!");
        return;
    }
    QDir dir(*m_destinationDir);
    if (!dir.exists()) {
        tracer->error(__func__, "The specified 'destinationDir' does not exist or is not a directory!");
        return;
    }
    
    // test the files to export
    if (!m_sourceFiles || m_sourceFiles->isEmpty()) {
        tracer->info(__func__, "No files to export!");
        return;
    }
    
    // setup progress dialog
    m_progressDialog = new KProgressDialog(m_parent, "exportSymlinksProgressDialog", i18n("Exporting symbolic links"), i18n("Initializing export..."), true);
    m_progressDialog->progressBar()->setTotalSteps(m_sourceFiles->count());
    m_progressDialog->setAllowCancel(true);
    connect(m_progressDialog, SIGNAL(cancelClicked()), this, SLOT(slotCancel()));
    m_progressDialog->show();
    
    // do the job
    doExport();
}
Esempio n. 11
0
ValidatorsDialog::ValidatorsDialog(QWidget *parent )
  : KPageDialog( parent)
{
  setButtons(Ok|Cancel);
  setDefaultButton(Ok);
  setModal(false);
  showButtonSeparator(true);
  setCaption(i18nc("@title:window", "Configure Validator Plugin"));
  setMinimumWidth(400);

#ifdef HAVE_TIDY
  QWidget* internalConfiguration = new QWidget();
  m_internalUi.setupUi(internalConfiguration);
  internalConfiguration->layout()->setMargin(0);
  KPageWidgetItem *internalConfigurationItem = addPage(internalConfiguration, i18n("Internal Validation"));
  internalConfigurationItem->setIcon(KIcon("validators"));
#endif

  QWidget* remoteConfiguration = new QWidget();
  m_remoteUi.setupUi(remoteConfiguration);
  remoteConfiguration->layout()->setMargin(0);
  KPageWidgetItem *remoteConfigurationItem = addPage(remoteConfiguration, i18n("Remote Validation"));
  remoteConfigurationItem->setIcon(KIcon("validators"));

  connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
  connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
  load();
}
Esempio n. 12
0
ProgressWidget::ProgressWidget(qint64 directorySizeInBytes, QDialog *parent)
    : QDialog(parent)
    , mActionState(RUNNING)
    , mDirectorySizeInBytes(directorySizeInBytes)
    , mBytesProcessed(0)
{
    setWindowTitle("Search");
    setModal(true);

    mProgressBar = new QProgressBar();
    mProgressBar->setMaximum(100);
    mProgressBar->setMinimumWidth(200);
    mProgressBar->setAlignment(Qt::AlignCenter);
    mProgressBar->setValue(0);

    mPauseOrContinueButton = new QPushButton("&Pause");
    mCancelButton = new QPushButton("&Cancel");

    QHBoxLayout* hLayout = new QHBoxLayout();
    hLayout->addWidget(mPauseOrContinueButton);
    hLayout->addWidget(mCancelButton);
    hLayout->setSpacing(6);
    hLayout->setContentsMargins(11, 11, 11, 11);

    QVBoxLayout* vLayout = new QVBoxLayout();
    vLayout->addWidget(mProgressBar);
    vLayout->addLayout(hLayout);

    connect(mPauseOrContinueButton, SIGNAL(clicked()), SLOT(pauseClicked()));
    connect(mCancelButton, SIGNAL(clicked()), SLOT(cancelClicked()));

    setLayout(vLayout);
    resize(300, 100);
}
Esempio n. 13
0
AvatarDownloadDialog::AvatarDownloadDialog(QWidget * par,const QString &szUrl)
: QDialog(par)
{
	setWindowTitle(__tr2qs_ctx("Avatar Download - KVIrc","options"));

	m_szUrl = szUrl;

	QGridLayout * g = new QGridLayout(this);

	m_pOutput = new QLabel(__tr2qs_ctx("<center>Please wait while the avatar is being downloaded</center>","options"),this);
	g->addWidget(m_pOutput,0,0,1,2);

	QPushButton * b = new QPushButton(__tr2qs_ctx("Abort","options"),this);
	g->addWidget(b,1,1);
	connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked()));

	m_pRequest = new KviHttpRequest();

	QTimer::singleShot(0,this,SLOT(startDownload()));

	g->setRowStretch(0,1);
	g->setColumnStretch(0,1);

	setMinimumSize(250,120);
}
Esempio n. 14
0
FlattenDlg::FlattenDlg( QWidget* parent, const char* name )
    : KDialog( parent )
{
    setObjectName(name);
    setModal(true);
    setCaption( i18n( "Flatten Path" ) );
    setButtons( Ok | Cancel );

    // add input fields on the left:
    QGroupBox* group = new QGroupBox( i18n( "Properties" ), this );

    QHBoxLayout* layout = new QHBoxLayout;

    layout->addWidget(new QLabel( i18n( "Flatness:" )));
    m_flatness = new KDoubleNumInput(group);
    layout->addWidget(m_flatness);

    group->setLayout(layout);
    group->setMinimumWidth( 300 );

    // signals and slots:
    connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
    connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() ) );

    setMainWidget( group );
}
void FacebookViewDialog::initUi()
{
  setButtons( KDialog::Cancel );
  setCaption( i18n( "Facebook Post" ) );
  setAttribute( Qt::WA_DeleteOnClose, true );
  
  QWidget * const widget = new QWidget( this );
  QVBoxLayout * const layout = new QVBoxLayout( widget );
  QWidget * const progressWidget = new QWidget( this );
  QHBoxLayout * const progressLayout = new QHBoxLayout( progressWidget );
  progressLayout->setMargin( 0 );
  layout->setMargin( 0 );
  setMainWidget( widget );
  mWebView = new KWebView( this );
  mWebView->setMinimumWidth(1000);
  mWebView->setMinimumHeight(500);
  
  mProgressBar = new QProgressBar( this );
  mProgressBar->setRange( 0, 100 );
  QLabel * const progressLabel = new QLabel( i18n( "Loading Page:" ), this );
  progressLayout->addWidget( progressLabel );
  progressLayout->addWidget( mProgressBar ); 
  
  layout->addWidget( progressWidget );
  layout->addWidget( mWebView );
  
  connect( this, SIGNAL(cancelClicked()), SIGNAL(canceled()) );
  connect( mWebView, SIGNAL(loadStarted()), progressWidget, SLOT(show()) );
  connect( mWebView, SIGNAL(loadFinished(bool)), progressWidget, SLOT(hide()) );
  connect( mWebView, SIGNAL(loadProgress(int)), mProgressBar, SLOT(setValue(int)) );
  connect( mWebView, SIGNAL(urlChanged(QUrl)), this, SLOT(urlChanged(QUrl)) );
}
Esempio n. 16
0
void SwWindow::slotStartTransfer()
{
    qCDebug(KIPIPLUGINS_LOG) << "slotStartTransfer invoked";

    m_transferQueue = m_widget->m_imgList->imageUrls();

    // we will not upload directories -- duh!
    for (int idx=m_transferQueue.count(); idx-->0; )
    {
        if ( QFileInfo( m_transferQueue.at(idx).path() ).isDir() )
        {
            m_widget->m_imgList->removeItemByUrl( m_transferQueue.at(idx) );
            m_transferQueue.removeAt(idx);
        }
    }

    if (m_transferQueue.isEmpty())
        return;

    m_currentAlbumID = m_widget->m_albumsCoB->itemData(m_widget->m_albumsCoB->currentIndex()).toLongLong();
    m_imagesTotal    = m_transferQueue.count();
    m_imagesCount    = 0;

    m_progressDlg    = new KProgressDialog(this, i18n("Transfer Progress"));
    m_progressDlg->setMinimumDuration(0);
    m_progressDlg->setModal(true);
    m_progressDlg->setAutoReset(true);
    m_progressDlg->setAutoClose(true);
    m_progressDlg->progressBar()->setFormat(i18n("%v / %m"));

    connect(m_progressDlg, SIGNAL(cancelClicked()),
            this, SLOT(slotTransferCancel()));

    uploadNextPhoto();
}
void
StravaUploadDialog::uploadToStrava()
{
    show();
    overwrite = true;

    if(activityId.length()>0)
    {
        overwrite = false;

        dialog = new QDialog();
        QVBoxLayout *layout = new QVBoxLayout;

        QVBoxLayout *layoutLabel = new QVBoxLayout();
        QLabel *label = new QLabel();
        label->setText(tr("This Ride is marked as already on Strava. Are you sure you want to upload it?"));
        layoutLabel->addWidget(label);

        QPushButton *ok = new QPushButton(tr("OK"), this);
        QPushButton *cancel = new QPushButton(tr("Cancel"), this);
        QHBoxLayout *buttons = new QHBoxLayout();
        buttons->addStretch();
        buttons->addWidget(cancel);
        buttons->addWidget(ok);

        connect(ok, SIGNAL(clicked()), this, SLOT(okClicked()));
        connect(cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()));

        layout->addLayout(layoutLabel);
        layout->addLayout(buttons);

        dialog->setLayout(layout);

        if (!dialog->exec()) return;
    }

    requestLogin();

    if(!loggedIn)
    {
        /*QMessageBox aMsgBox;
        aMsgBox.setText(tr("Cannot login to Strava. Check username/password"));
        aMsgBox.exec();*/
        reject();
    }
    requestUpload();

    if(!uploadSuccessful)
    {
        progressLabel->setText("Error uploading to Strava");
    }
    else
    {
        //requestVerifyUpload();
        progressLabel->setText(tr("Successfully uploaded to Strava\n")+uploadStatus);
    }
    uploadButton->setVisible(false);
    cancelButton->setText("OK");
    QApplication::processEvents();
}
Esempio n. 18
0
KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 )
{
	setFaceType( KPageDialog::List );
	setWindowTitle( i18n( "Preferences" ) );
	setButtons( Help|Default|Ok|Apply|Cancel );
	setDefaultButton( Ok );
	setModal( true );
	showButtonSeparator( true );

	// ok i need some stuff in that pref dlg...
	//setIconListAllVisible(true);

	m_viewPage = new ViewPage();
	KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) );
	item->setIcon( KIcon( "preferences-desktop-theme" ) );
	item->setHeader( i18n( "View Settings" ) );
	m_viewPage->setSettings( viewSets );

	m_diffPage = new DiffPage();
	item = addPage( m_diffPage, i18n( "Diff" ) );
	item->setIcon( KIcon( "text-x-patch" ) );
	item->setHeader( i18n( "Diff Settings" ) );
	m_diffPage->setSettings( diffSets );

//	frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) );

	connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) );
	connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) );
	connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
	connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
	connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) );

	adjustSize();
}
Esempio n. 19
0
SettingsWidget::SettingsWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SettingsWidget)
{
    ui->setupUi(this);
    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    // Setup values
    ui->colorVarSpin->setValue(N_COLOR_VAR);
    ui->shapeVarSpin->setValue(N_POS_VAR);
    ui->nPointsSpin->setValue(N_POLY_POINTS);
    ui->focusLeft->setValue(FOCUS_LEFT);
    ui->focusRight->setValue(FOCUS_RIGHT);
    ui->focusTop->setValue(FOCUS_TOP);
    ui->focusBottom->setValue(FOCUS_BOTTOM);
    ui->shapeOptFreqSpin->setValue(SHAPE_OPT_FREQ);
    ui->guiRefreshSpin->setValue(GUI_REFRESH_RATE);
    ui->coreSpin->setValue(N_CORES);
    ui->minPolySpin->setValue(POLYS_MIN);
    ui->maxPolySpin->setValue(POLYS_MAX);
    ui->autofocusEnable->setChecked(AUTOFOCUS_ENABLED);
    ui->autofocusSubdivs->setValue(AUTOFOCUS_SUBDIVS);
    ui->autofocusDelay->setValue(AUTOFOCUS_DELAY);
}
Esempio n. 20
0
  NetworkProxyDialog::NetworkProxyDialog(QSettings &t_settings, QWidget *t_parent = 0)
    : QDialog(t_parent), 
      m_settings(t_settings)
  {
    QGridLayout *layout = new QGridLayout(this);

    // NoProxy, DefaultProxy, Socks5Proxy, HttpProxy, HttpCachingProxy, FtpCachingProxy
    m_proxyType = new QComboBox();
    m_proxyType->addItem("No Proxy", QNetworkProxy::NoProxy);
    // Allow http only for now since that's known to be supported by ruby / aws
    // m_proxyType->addItem("Socks5 Proxy", QNetworkProxy::Socks5Proxy);
    m_proxyType->addItem("Http Proxy", QNetworkProxy::HttpProxy);

    connect(m_proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyTypeChanged(int)));

    m_hostName = new QLineEdit(this);
    m_port = new QLineEdit(this);
    m_port->setValidator(new QIntValidator(0, 65535));

    m_user = new QLineEdit(this);


    layout->addWidget(new QLabel("Proxy Type"), 0, 0);
    layout->addWidget(m_proxyType, 0, 1);
    layout->addWidget(new QLabel("Host Name"), 1, 0);
    layout->addWidget(m_hostName, 1, 1);
    layout->addWidget(new QLabel("Port"), 2, 0);
    layout->addWidget(m_port, 2, 1);
    layout->addWidget(new QLabel("User Name"), 3, 0);
    layout->addWidget(m_user, 3, 1);
    
    QHBoxLayout *buttonBox = new QHBoxLayout();

    QPushButton *saveButton = new QPushButton("Save");
    QPushButton *cancelButton = new QPushButton("Cancel");
    QPushButton *testButton = new QPushButton("Test");
   
    buttonBox->addWidget(saveButton);
    buttonBox->addWidget(cancelButton);
    buttonBox->addWidget(testButton);

    layout->addLayout(buttonBox, 4,0,1,2);

    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
    connect(testButton, SIGNAL(clicked()), this, SLOT(testClicked()));

    QNetworkProxy proxy(createProxy(t_settings));

    int type = m_proxyType->findData(proxy.type());
    QString user = proxy.user();
    QString hostname = proxy.hostName();
    int port = proxy.port();

    m_proxyType->setCurrentIndex(type>-1?type:0);
    m_user->setText(user);
    m_hostName->setText(hostname);
    m_port->setText(QString::number(port));
    proxyTypeChanged(m_proxyType->currentIndex());
  }
Esempio n. 21
0
void SqliteVacuum::dumpProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
    //sqliteDebug() << exitCode << exitStatus;
    if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
        cancelClicked();
        m_result.setCode(ERR_OTHER);
    }

    if (m_dlg) {
        m_dlg->close();
    }

    if (m_result.isError() || m_canceled) {
        return;
    }
    QFileInfo fi(m_filePath);
    const qint64 origSize = fi.size();

    const QByteArray oldName(QFile::encodeName(m_tmpFilePath)), newName(QFile::encodeName(fi.absoluteFilePath()));
    if (0 != ::rename(oldName.constData(), newName.constData())) {
        m_result.setMessage(tr("Could not rename file \"%1\" to \"%2\".")
                            .arg(m_tmpFilePath, fi.absoluteFilePath()));
        sqliteWarning() << m_result;
    }

    if (!m_result.isError()) {
        const qint64 newSize = QFileInfo(m_filePath).size();
        const qint64 decrease = 100 - 100 * newSize / origSize;
        QMessageBox::information(0, QString(), // krazy:exclude=qclasses
            tr("The database has been compacted. Current size decreased by %1% to %2 MB.")
               .arg(decrease).arg(QLocale().toString(double(newSize)/1000000.0, 'f', 2)));
    }
}
Esempio n. 22
0
void QModernProgressDialog::createWidgets() {
    setWindowTitle(tr("Progress"));
    setWindowIcon(QIcon());
    m_wasCancel=false;
    label=new QLabel(this);
    longmessage=new QTextEdit(this);
    longmessage->setVisible(false);
    progress=new QModernProgressWidget(this);
    progress->setMinimumSize(QSize(48,48));
    cancel=new QPushButton(tr("Cancel"), this);
    connect(cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    QVBoxLayout* vbl=new QVBoxLayout;
    setLayout(vbl);
    QHBoxLayout* hbl=new QHBoxLayout;
    hbl->addWidget(progress);
    hbl->addWidget(label);
    hbl->addStretch();
    vbl->addLayout(hbl);
    vbl->addWidget(longmessage);
    hbl=new QHBoxLayout;
    hbl->addStretch();
    hbl->addWidget(cancel);
    vbl->addLayout(hbl);
    connect(&timerDelay, SIGNAL(timeout()), this, SLOT(open()));

    QDesktopWidget desktopWidget;
    QRect desktopRect(desktopWidget.availableGeometry(desktopWidget.primaryScreen()));
    QRect widgetRect=rect();
    move(desktopRect.center() - widgetRect.center());
}
Esempio n. 23
0
QTORGANIZER_USE_NAMESPACE

AddCalendarPage::AddCalendarPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *okButton = new QPushButton("Save", this);
    connect(okButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
    hbLayout->addWidget(okButton);
    QPushButton *cancelButton = new QPushButton("Cancel", this);
    connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    hbLayout->addWidget(cancelButton);

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addStretch();
    scrollAreaLayout->addLayout(hbLayout);

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);
}
Esempio n. 24
0
ComSettings::ComSettings(QWidget *parent) : QWidget(parent)
{
	ui.setupUi(this);
	connect(ui.cancelPushButton,SIGNAL(clicked()),this,SIGNAL(cancelClicked()));
	connect(ui.savePushButton,SIGNAL(clicked()),this,SIGNAL(saveClicked()));
	connect(ui.datalogLocationBrowseButton,SIGNAL(clicked()),this,SLOT(browseLogFolderClicked()));
}
Esempio n. 25
0
AddCatDialog::AddCatDialog( KStars *_ks )
        : KDialog( ( QWidget* )_ks ),  ks( _ks )
{
    QDir::setCurrent( QDir::homePath() );
    acd = new AddCatDialogUI(this);
    setMainWidget(acd);
    setCaption( i18n( "Import Catalog" ) );
    setButtons( KDialog::Help|KDialog::Ok|KDialog::Cancel );

    connect( acd->DataURL->lineEdit(), SIGNAL( lostFocus() ), this, SLOT( slotShowDataFile() ) );
    connect( acd->DataURL, SIGNAL( urlSelected( const KUrl & ) ),
             this, SLOT( slotShowDataFile() ) );
    connect( acd->PreviewButton, SIGNAL( clicked() ), this, SLOT( slotPreviewCatalog() ) );
    connect( this, SIGNAL( okClicked() ), this, SLOT( slotCreateCatalog() ) );
//    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
    connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));

    acd->FieldList->addItem( i18n( "ID Number" ) );
    acd->FieldList->addItem( i18n( "Right Ascension" ) );
    acd->FieldList->addItem( i18n( "Declination" ) );
    acd->FieldList->addItem( i18n( "Object Type" ) );

    acd->FieldPool->addItem( i18n( "Common Name" ) );
    acd->FieldPool->addItem( i18n( "Magnitude" ) );
    acd->FieldPool->addItem( i18n( "Flux" ) );
    acd->FieldPool->addItem( i18n( "Major Axis" ) );
    acd->FieldPool->addItem( i18n( "Minor Axis" ) );
    acd->FieldPool->addItem( i18n( "Position Angle" ) );
    acd->FieldPool->addItem( i18n( "Ignore" ) );
}
Esempio n. 26
0
ActionEditorWindow::ActionEditorWindow()
: KviWindow(KviWindow::ScriptEditor,"actioneditor",0)
{
	g_pActionEditorWindow = this;
	setFixedCaption(__tr2qs_ctx("Action Editor","editor"));

	QGridLayout * g = new QGridLayout();

	m_pEditor = new ActionEditor(this);
	g->addWidget(m_pEditor,0,0,1,4);

	QPushButton * btn = new QPushButton(__tr2qs_ctx("OK","editor"),this);
	connect(btn,SIGNAL(clicked()),this,SLOT(okClicked()));
	btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	g->addWidget(btn,1,1);

	btn = new QPushButton(__tr2qs_ctx("Apply","editor"),this);
	connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked()));
	btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	g->addWidget(btn,1,2);

	btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this);
	connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked()));
	btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
	g->addWidget(btn,1,3);

	g->setRowStretch(0,1);
	g->setColumnStretch(0,1);
	setLayout(g);
}
NotificationItem::NotificationItem(QString progressName, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::NotificationItem)
{
    ui->setupUi(this);
    connect(this->ui->pushButton, SIGNAL(clicked()), this, SIGNAL(cancelClicked()));
    this->ui->label->setText(progressName);
}
Esempio n. 28
0
keyconfigdialog::keyconfigdialog(QWidget *parent)
    : QWidget(parent)
{
	ui.setupUi(this);
	
	connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
	round = 0;
}
Esempio n. 29
0
ProfileAddDialog::ProfileAddDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ProfileAddDialog) {
    ui->setupUi(this);

    clientSettings = ClientSettings::Instance();

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
}
void QFRDRImagingFCSThreadProgress::on_btnCancel_clicked() {
   // if (m_isDone) {
        m_wasCanceled=true;
        ui->labCanceling->setVisible(m_wasCanceled);
        emit cancelClicked();
    /*} else {
        emit closeClicked();
    }*/
}