Beispiel #1
0
frmNapiProjektUpload::frmNapiProjektUpload(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f)
{
    ui.setupUi(this);

    setAttribute(Qt::WA_QuitOnClose, false);

    connect(ui.pbSelectDirectory, SIGNAL(clicked()), this, SLOT(selectDirectory()));
    connect(ui.leSelectDirectory, SIGNAL(textChanged(QString)), this, SLOT(leSelectDirectoryChanged()));
    connect(ui.pbScan, SIGNAL(clicked()), this, SLOT(pbScanClicked()));
    connect(&scanThread, SIGNAL(scanFinished(bool)), this, SLOT(scanFinished(bool)));
    connect(&scanThread, SIGNAL(folderChange(QString)), this, SLOT(folderChange(QString)));
    connect(ui.pbUpload, SIGNAL(clicked()), this, SLOT(pbUploadClicked()));
    connect(&uploadThread, SIGNAL(finished()), this, SLOT(uploadFinished()));
    connect(&uploadThread, SIGNAL(progressChange(int)), ui.pbProgress, SLOT(setValue(int)));
    connect(&uploadThread, SIGNAL(fileNameChange(QString)), this, SLOT(fileNameChange(QString)));
    connect(&uploadThread, SIGNAL(checkingUserPass()), this, SLOT(checkingUserPass()));
    connect(&uploadThread, SIGNAL(invalidUserPass()), this, SLOT(invalidUserPass()));

    if(QFileInfo(GlobalConfig().previousDialogPath()).isDir())
        ui.leSelectDirectory->setText(GlobalConfig().previousDialogPath());

    QRect position = frameGeometry();
    position.moveCenter(QDesktopWidget().availableGeometry().center());
    move(position.topLeft());
}
Beispiel #2
0
MagicEncoderConfig::MagicEncoderConfig( QWidget *parent, QAction *toggleEnableAction )
: QWidget( parent )
, mpUseEncoder( new QCheckBox( tr("Use This Encoder"), this ) )
, mpDirOverride( new QCheckBox( tr("Override Base Directory"), this ) )
, mpDirEdit( new QLineEdit( this ) )
, mpDotButton( new QPushButton( "...", this ) )
{
   QCompleter *completer = new QCompleter( this );
   completer->setModel( new QDirModel( QStringList(),
                                       QDir::NoDotAndDotDot | QDir::AllDirs,
                                       QDir::Name,
                                       completer ) );
   mpDirEdit->setCompleter( completer );

   /* evil hack */
   mpDotButton->setMaximumWidth( mpDotButton->height() );

   toggleEnableAction->setCheckable( true );
   connect( mpUseEncoder, SIGNAL(toggled(bool)),
            toggleEnableAction, SLOT(setChecked(bool)) );
   connect( toggleEnableAction, SIGNAL(toggled(bool)),
            mpUseEncoder, SLOT(setChecked(bool)) );
   connect( mpDotButton, SIGNAL(clicked()),
            this, SLOT(selectDirectory()) );
}
Beispiel #3
0
void ZipDialog::selectDestination()
{
    if(ui->checkBoxSeparateArchives->isChecked())
        selectDirectory();
    else
        selectArchive();
}
Beispiel #4
0
frmUpload::frmUpload(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f)
{
    ui.setupUi(this);

    setAttribute(Qt::WA_QuitOnClose, false);

    connect(ui.pbSelectDirectory, SIGNAL(clicked()), this, SLOT(selectDirectory()));
    connect(ui.leSelectDirectory, SIGNAL(textChanged(QString)), this, SLOT(leSelectDirectoryChanged()));
    connect(ui.pbScan, SIGNAL(clicked()), this, SLOT(pbScanClicked()));
    connect(&scanThread, SIGNAL(scanFinished(bool)), this, SLOT(scanFinished(bool)));
    connect(&scanThread, SIGNAL(folderChange(QString)), this, SLOT(folderChange(QString)));
    connect(ui.pbUpload, SIGNAL(clicked()), this, SLOT(pbUploadClicked()));
    connect(&uploadThread, SIGNAL(finished()), this, SLOT(uploadFinished()));
    connect(&uploadThread, SIGNAL(progressChange(int)), ui.pbProgress, SLOT(setValue(int)));
    connect(&uploadThread, SIGNAL(fileNameChange(QString)), this, SLOT(fileNameChange(QString)));
    connect(&uploadThread, SIGNAL(checkingUserPass()), this, SLOT(checkingUserPass()));
    connect(&uploadThread, SIGNAL(invalidUserPass()), this, SLOT(invalidUserPass()));

    if(QFileInfo(GlobalConfig().previousDialogPath()).isDir())
        ui.leSelectDirectory->setText(GlobalConfig().previousDialogPath());

    // workaround dla compiza?
    move((QApplication::desktop()->width() - width()) / 2, 
        (QApplication::desktop()->height() - height()) / 2);
}
PythonSelectDialog::PythonSelectDialog()
{
    QLabel *selectLabel = new QLabel("Please select a Python 3.5 directory with\nNumPy 1.10 and SciPy installed.");

    directoryLabel = new QLabel();

    QPushButton *selectButton = new QPushButton("Select Directory...");

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

    QPushButton *continueButton = new QPushButton("Continue");

    connect(continueButton, SIGNAL(clicked()), this, SLOT(accept()));
    connect(quitButton, SIGNAL(clicked()), this, SLOT(reject()));
    connect(selectButton, SIGNAL(clicked()), this, SLOT(selectDirectory()));

    QHBoxLayout *selectButtonLayout = new QHBoxLayout;
    selectButtonLayout->addStretch(1);
    selectButtonLayout->addWidget(selectButton);
    selectButtonLayout->addStretch(1);

    QHBoxLayout *buttonsLayout = new QHBoxLayout;
    buttonsLayout->addStretch(1);
    buttonsLayout->addWidget(quitButton);
    buttonsLayout->addWidget(continueButton);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(selectLabel);
    mainLayout->addLayout(selectButtonLayout);
    mainLayout->addWidget(directoryLabel);
    mainLayout->addLayout(buttonsLayout);
    setLayout(mainLayout);

    setWindowTitle("Select Python Directory");

    directoryLabel->setFixedWidth(300);
    directoryLabel->setFixedHeight(64);
    directoryLabel->setWordWrap(true);
}
Beispiel #6
0
ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) :
    QDialog(parent)
{
  setupUi(this);

  //bool is_new = (MusEGlobal::museProject == MusEGlobal::museProjectInitPath);  
  directoryPath = MusEGlobal::config.projectBaseFolder;

  QStringList filters = localizedStringListFromCharArray(MusEGlobal::project_create_file_save_pattern, "file_patterns");
  projectFileTypeCB->addItems(filters);

  QString proj_title = MusEGlobal::muse->projectTitle();
  QString proj_path  = MusEGlobal::muse->projectPath();
  QString proj_ext   = MusEGlobal::muse->projectExtension();
  
  projectNameEdit->setText(proj_title); 

  bool is_template = proj_path.startsWith(MusEGlobal::configPath + "/templates");
  
  templateCheckBox->setChecked(is_template);
  
  projDirPath = proj_path;
    
  int type_idx = 0;
  if(!proj_ext.isEmpty())
  {  
    // FIXME Imperfect. Trying to avoid adding yet another series of character strings.   p4.0.40
    type_idx = projectFileTypeCB->findText(proj_ext, Qt::MatchContains | Qt::MatchCaseSensitive);
    if(type_idx == -1)
      type_idx = 0;
  }  
  projectFileTypeCB->setCurrentIndex(type_idx);
  
  projDirToolButton->setIcon(*openIcon);
  browseDirButton->setIcon(*openIcon);
  restorePathButton->setIcon(*undoIcon);

  restorePathButton->setEnabled(false);  // Disabled at first.
  
  //createFolderCheckbox->setChecked(MusEGlobal::config.projectStoreInFolder && is_new); // Suggest no folder if not new.
  
  connect(templateCheckBox,SIGNAL(toggled(bool)), this, SLOT(templateButtonChanged(bool)));
  //connect(templateCheckBox,SIGNAL(clicked()), this, SLOT(updateDirectoryPath()));
  connect(projDirToolButton,SIGNAL(clicked()), this, SLOT(browseProjDir()));
  connect(restorePathButton,SIGNAL(clicked()), this, SLOT(restorePath()));
  connect(browseDirButton,SIGNAL(clicked()), this, SLOT(selectDirectory()));
  //connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateDirectoryPath()));
  connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateProjectName()));
  connect(createFolderCheckbox,SIGNAL(clicked()), this, SLOT(createProjFolderChanged()));
  connect(projectFileTypeCB,SIGNAL(currentIndexChanged(int)), this, SLOT(updateDirectoryPath()));
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(ok()));
#if QT_VERSION >= 0x040700
  projectNameEdit->setPlaceholderText("<Project Name>");
  // Orcan: Commented out since there is no QPlainTextEdit::setPlaceholderText()
  //        as of Qt-4.7.1
  //commentEdit->setPlaceholderText("<Add information about project here>");
#endif
  updateDirectoryPath();
  projectNameEdit->setFocus();
  show();
}
Beispiel #7
0
MainWindow::MainWindow(QAction* actionQuit, QAction* actionNewTab, QAction* actionFullscreen, QAction* actionLoadSession, QAction* actionSaveSession, QWidget* parent)
    : QMainWindow(parent),
    ui(new Ui::MainWindow),
    fetcher(new Fetcher),
    local(new LocalFetcher),
    source(IMAGE_SOURCE_UNKNOWN)
{
    ui->setupUi(this);

    QStringList  sources;
    sources.append("Google");
    sources.append("Local file");
//    sources.append("Picsearch");
    ui->cbSource->addItems(sources);
    ui->cbSource->setCurrentIndex(IMAGE_SOURCE_GOOGLE);

    fetcher->hide();
    local->hide();

    ui->menuFile->addAction(actionNewTab);
    ui->menuFile->addAction(actionLoadSession);
    ui->menuFile->addAction(actionSaveSession);
    ui->menuFile->addAction(actionQuit);
    ui->menuView->insertAction(ui->actionResetTransforms,actionFullscreen);

    ui->tbFullScreen->setDefaultAction(actionFullscreen);
    ui->tbNewTab->setDefaultAction(actionNewTab);
    ui->tbResetTransform->setDefaultAction(ui->actionResetTransforms);
    ui->tbSave->setDefaultAction(actionSaveSession);

    ui->glTools->addWidget(fetcher,0,6,2,1);
    ui->glTools->addWidget(local,0,6,2,1);

    updateSource();

    connect(ui->cbSource,SIGNAL(currentIndexChanged(int)),this,SLOT(updateSource()));

    ui->actionViewOnlyMode->setShortcut(Qt::Key_Tab);
    QList<QKeySequence> keys;
    keys << Qt::Key_Delete << Qt::Key_Backspace;
    ui->actionDeleteSelected->setShortcuts(keys);
    // These are necessary if the actions are to remain accessible when the menubar is hidden:
    this->addAction(ui->actionViewOnlyMode);
    this->addAction(ui->actionResetTransforms);
    this->addAction(ui->actionZoomToFit);
    this->addAction(ui->actionIntroduction);
    this->addAction(ui->actionTips);
    this->addAction(ui->actionOpenDirectory);
    this->addAction(ui->actionOpenFile);

    this->addAction(ui->actionDeleteSelected);
    this->addAction(ui->actionUncropSelected);
    this->addAction(ui->actionCentreInView);
    this->addAction(ui->actionResetRotation);
    this->addAction(ui->actionResetScale);
    this->addAction(ui->actionScaleToFit);

    this->addAction(actionFullscreen);
    this->addAction(actionLoadSession);
    this->addAction(actionSaveSession);
    this->addAction(actionNewTab);
    this->addAction(actionQuit);

    connect(ui->actionIntroduction,SIGNAL(triggered()),this,SLOT(showHelp()));
    connect(ui->actionTips,SIGNAL(triggered()),this,SLOT(showTips()));
    connect(ui->actionViewOnlyMode,SIGNAL(triggered(bool)),this,SLOT(enterViewOnlyMode(bool)));
    connect(ui->actionPreferences,SIGNAL(triggered()),this,SLOT(showPreferences()));

    connect(fetcher,SIGNAL(queryChanged(QString)),this,SIGNAL(queryChanged(QString)));
    connect(fetcher,SIGNAL(imageResult(QUrl,QUrl,bool)),this,SLOT(processImageResult(QUrl,QUrl,bool)));
    connect(local,SIGNAL(imageResult(QUrl,QUrl,bool)),this,SLOT(processImageResult(QUrl,QUrl,bool)));
    connect(local,SIGNAL(queryChanged(QString)),this,SIGNAL(queryChanged(QString)));

    initBlacklistDocker();
    initInfoDocker();

    initView(parent);
    dlDir = QString(DEFAULT_DOWNLOAD_DIRECTORY);
    dlMgr = new QNetworkAccessManager(this);


    connect(ui->actionResetTransforms,SIGNAL(triggered()),gvMain,SLOT(resetTransforms()));
    connect(ui->actionZoomToFit,SIGNAL(triggered()),gvMain,SLOT(zoomToFit()));
    connect(ui->actionOpenDirectory,SIGNAL(triggered()),local,SLOT(selectDirectory()));
    connect(ui->actionOpenFile,SIGNAL(triggered()),local,SLOT(selectFile()));

    connect(ui->actionDeleteSelected,SIGNAL(triggered()),gsMain,SLOT(deleteSelected()));
    connect(ui->actionUncropSelected,SIGNAL(triggered()),gsMain,SLOT(uncropSelected()));
    connect(ui->actionCentreInView,SIGNAL(triggered()),gsMain,SLOT(centreSelection()));
    connect(ui->actionResetRotation,SIGNAL(triggered()),gsMain,SLOT(resetSelectionRotation()));
    connect(ui->actionResetScale,SIGNAL(triggered()),gsMain,SLOT(resetSelectionScale()));
    connect(ui->actionScaleToFit,SIGNAL(triggered()),this,SLOT(scaleSelectedToFit()));

    ui->verticalLayout->removeWidget(ui->toolWidget);
    ui->toolBar->addWidget(ui->toolWidget);
    setCentralWidget(gvMain);
    ui->thumbBar->addWidget(gvCarousel);

    ui->statusBar->addWidget(fetcher->getStatusText(),0);
    ui->statusBar->addWidget(fetcher->getProgressBar(),1);

    connect(this,SIGNAL(settingsChanged()),this,SLOT(loadSettings()));
    loadSettings();
}