void MainWindow::installTool(Tool* controllingWidget)
{
    QAction* action = controllingWidget->action();

    action->setCheckable(true);

    tools_list.push_back(controllingWidget);

    sidebarContents->addWidget(controllingWidget);
    modeActions->addAction(action);

    connect(action, SIGNAL(triggered(bool)),
            this, SLOT(actionTriggered()));

    connect(controllingWidget, SIGNAL(activateMe()),
            this, SLOT(activateTool()));

    connect(controllingWidget, SIGNAL(showEvent(Event_model*)),
            this, SLOT(showEvent(Event_model*)));

    connect(controllingWidget, SIGNAL(showState(State_model*)),
            this, SLOT(showState(State_model*)));


    connect(controllingWidget, SIGNAL(browse()),
            this, SLOT(browse()));

    action->setWhatsThis(controllingWidget->whatsThis());
}
Exemple #2
0
//-----------------------------------------------------------------------------
void ctkPathLineEditPrivate::init()
{
  Q_Q(ctkPathLineEdit);

  QHBoxLayout* layout = new QHBoxLayout(q);
  layout->setContentsMargins(0,0,0,0);
  layout->setSpacing(0); // no space between the combobx and button

  this->createPathLineEditWidget(true);

  this->BrowseButton = new QToolButton(q);
  this->BrowseButton->setText("...");
  // Don't vertically stretch the path line edit unnecessary
  this->BrowseButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored));
  this->BrowseButton->setToolTip(ctkPathLineEdit::tr("Open a dialog"));

  QObject::connect(this->BrowseButton,SIGNAL(clicked()),
                   q, SLOT(browse()));

  layout->addWidget(this->BrowseButton);

  q->setSizePolicy(QSizePolicy(
                     QSizePolicy::Expanding, QSizePolicy::Fixed,
                     QSizePolicy::LineEdit));
}
//______________________________________________________________________________
// control all of the tree browsing is in charge of the S_part visit
// it assumes that the score is a partwise score but the strategy could
// equalli work on a timewise score, provided that the jump information
// is consistent across the different parts.
//
// Jumps are under control of fNextIterator which could be modified by the
// measure visit. Anchor points for future jumps (like segno) are stored
// at S_part level using fStoreIterator pointer.
//
// visit methods can use the fStoreIterator pointer to store the current iterator
// to any ctree<xmlelement>::literator. Using fStoreDelay allows for delayed stores.
//
void unrolled_xml_tree_browser::visitStart( S_part& elt)
{
	// first initializes the iterators used to broswe the tree
	// segno and coda are initialized to the end of the measures list
	fEndIterator = elt->elements().end();
	fSegnoIterator= fCodaIterator = fEndIterator;
	// stores the first measures and makes a provision for the forward repeat location
	ctree<xmlelement>::literator iter = elt->elements().begin();
	fFirstMeasure = fForwardRepeat = iter;
	fStoreIterator = 0;
	fStoreDelay = 0;

	reset();

	enter(*elt);			// normal visit of the part (pass thru)
	fForward = false;
	// while we're not at the end location (elements().end() is checked for safety reasons only)
	while ((iter != fEndIterator) && (iter != elt->elements().end())) {
		fNextIterator = iter;
		fNextIterator++;				// default value for next iterator is the next measure
		browse(**iter);					// browse the measure
		if (fStoreIterator) {			// check if we need to store the current iterator
			if (fStoreDelay == 0) {
				*fStoreIterator = iter;
				fStoreIterator = 0;
			}
			else fStoreDelay--;			// this is actually a delayed store
		}
		iter = fNextIterator;			// switch to next iterator (which may be changed by the measure visit)
	}
	leave(*elt);			// normal visit of the part (pass thru)
}
int main (int argc, char** argv) {
    int* matrix;
    int s_rows,s_cols;

    if (argc<3) {
        printf("Not enough parameters.\nUsage : %s s_rows n_columns\n", argv[0]);
        return 1;
	}

    s_rows=atoi(argv[1]);
    s_cols=atoi(argv[2]);

    matrix=calloc(2*s_rows*s_cols,sizeof(int));

    display(matrix,s_rows,s_cols); 
    initialize(matrix,s_rows,s_cols);
    display(matrix,s_rows,s_cols); 

    /* Actual exercise */
    browse(matrix,s_rows,s_cols); 

    destroy(matrix);

    return 0;
}
Exemple #5
0
//! [0]
Window::Window(QWidget *parent)
    : QWidget(parent)
{
    browseButton = createButton(tr("&Browse..."), SLOT(browse()));
    findButton = createButton(tr("&Find"), SLOT(find()));

    fileComboBox = createComboBox(tr("*"));
    textComboBox = createComboBox();
    directoryComboBox = createComboBox(QDir::currentPath());

    fileLabel = new QLabel(tr("Named:"));
    textLabel = new QLabel(tr("Containing text:"));
    directoryLabel = new QLabel(tr("In directory:"));
    filesFoundLabel = new QLabel;

    createFilesTable();
//! [0]

//! [1]
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(fileLabel, 0, 0);
    mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
    mainLayout->addWidget(textLabel, 1, 0);
    mainLayout->addWidget(textComboBox, 1, 1, 1, 2);
    mainLayout->addWidget(directoryLabel, 2, 0);
    mainLayout->addWidget(directoryComboBox, 2, 1);
    mainLayout->addWidget(browseButton, 2, 2);
    mainLayout->addWidget(filesTable, 3, 0, 1, 3);
    mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2);
    mainLayout->addWidget(findButton, 4, 2);
    setLayout(mainLayout);

    setWindowTitle(tr("Find Files"));
    resize(700, 300);
}
Exemple #6
0
  ImporterWizard::ImporterWizard(ScenePtr scene, QWidget* parent)
    : QWizard(parent),
      m_first(true),
      m_ui(new Ui::ImporterWizard),
      m_scene(scene),
      m_objects(0),
      m_models(0),
      m_animations(0),
      m_cameras(0),
      m_lights(0),
      m_materials(0),
      m_textures(0)
  {
    m_ui->setupUi(this);
    setButtonText(NextButton, tr("Load file >"));
    button(NextButton)->setDisabled(true);

    setAttribute(Qt::WA_DeleteOnClose);

    connect(m_ui->browse, SIGNAL(clicked()), this, SLOT(browse()));
    connect(m_ui->filename, SIGNAL(textChanged(QString)), this, SLOT(fileChanged(QString)));
    connect(this, SIGNAL(currentIdChanged(int)), SLOT(changed(int)));

    connect(m_ui->manualDrag, SIGNAL(toggled(bool)), this, SLOT(manualDragToggled(bool)));

    QSettings settings("Shaderkit", "Shaderkit");
    m_ui->autoScale->setChecked(settings.value("import/auto_scale", true).toBool());
    m_ui->manualDrag->setChecked(settings.value("import/manual_drag", false).toBool());
  }
Exemple #7
0
MainWindow::MainWindow(Logger* log, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    pLogger = log;

    ui->statusBar->showMessage("Ready to be used");

    // Récupération des valeur possibles pour le calcul des voies depuis l'énumération
    for (int i = 0; i < WayMethods::numMethods; i++) {
        ui->methodComboBox->addItem(WayMethods::MethodeVoies_name[i]);
    }
    ui->methodComboBox->setCurrentIndex(WayMethods::ANGLE_MIN); // valeur par défaut

    // Connexion des messages émis depuis le logger ou la database
    connect(pLogger,SIGNAL(information(QString)),this,SLOT(logInformation(QString)));
    connect(pLogger,SIGNAL(debug(QString)),this,SLOT(logDebug(QString)));
    connect(pLogger,SIGNAL(warning(QString)),this,SLOT(logWarning(QString)));
    connect(pLogger,SIGNAL(fatal(QString)),this,SLOT(logFatal(QString)));

    connect(ui->calculatePushButton,SIGNAL(clicked()),this,SLOT(calculate()));
    connect(ui->modifyPushButton,SIGNAL(clicked()),this,SLOT(modify()));

    connect(ui->browsePushButton, SIGNAL(clicked()), this, SLOT(browse()));

    connect(ui->classificationRadioButton, SIGNAL(toggled(bool)), this, SLOT(optionsModification(bool)));

}
Exemple #8
0
//! [0]
Window::Window(QWidget *parent)
    : QWidget(parent)
{
    confBrowseButton = createButton(tr("&Browse..."), SLOT(browse()));
    startButton = createButton(tr("&Start"), SLOT(goDarc()));
    startButton->setEnabled(false);
    cancelButton = createButton(tr("&Cancel"), SLOT(cancel()));

    homePath = QDir::homePath()+tr("/lotuce2/conf/");
    configFileComboBox = createComboBox(homePath);

    configFileLabel = new QLabel(tr("Darc Config File:"));

//! [0]

//! [1]
    QGridLayout *mainLayout = new QGridLayout;

    mainLayout->addWidget(configFileLabel, 0, 0);
    mainLayout->addWidget(configFileComboBox, 0, 1);
    mainLayout->addWidget(confBrowseButton, 0, 2);

    mainLayout->addWidget(cancelButton, 1, 2);
    mainLayout->addWidget(startButton, 1, 3);
    setLayout(mainLayout);

    setWindowTitle(tr("Lotuce2"));
    resize(700, 300);
}
Exemple #9
0
ImageDialog::ImageDialog(QString & p)
    : QDialog(0, "Image dialog", TRUE), path(p) {
  setCaption(TR("Image dialog"));

  QVBoxLayout * vbox = new QVBoxLayout(this);
  QHBoxLayout * hbox;
    
  vbox->setMargin(5);
  
  hbox = new QHBoxLayout(vbox); 
  hbox->setMargin(5);
  
  hbox->addWidget(new QLabel(TR("Image path :"), this));
  hbox->addWidget(edpath = new LineEdit(path, this));

  RelativeRoot = TR("Set it relative to image root");
  RelativePrj = TR("Set it relative to project");
  Absolute = TR("Set it absolute");
  
  hbox->addWidget(new QLabel("", this));
  
  QPushButton * b = new SmallPushButton(TR("Browse"), this);
  
  hbox->addWidget(b);
  connect(b, SIGNAL(clicked ()), this, SLOT(browse()));
  hbox->addWidget(new QLabel("", this));
  
  QVBox * vtab = new QVBox(this);
  
  hbox->addWidget(vtab);
  
  pathrootbutton = new SmallPushButton((path.isEmpty() || QDir::isRelativePath(path))
				       ? Absolute : RelativeRoot, vtab);
  connect(pathrootbutton, SIGNAL(clicked ()), this, SLOT(root_relative()));
  pathprjbutton = new SmallPushButton((path.isEmpty() || QDir::isRelativePath(path))
				      ? Absolute : RelativePrj, vtab);
  connect(pathprjbutton, SIGNAL(clicked ()), this, SLOT(prj_relative()));
  pathrootbutton->setEnabled(!UmlWindow::images_root_dir().isEmpty());
  hbox->addWidget(new QLabel("", this));

  //
  
  QPushButton * accept = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  accept->setDefault(TRUE);  
  accept->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox = new QHBoxLayout(vbox); 
  
  hbox->addWidget(accept);
  hbox->addWidget(cancel);
    
  connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
  
  UmlDesktop::setsize_center(this, previous_size, 0.7, 0.01);
}
CSoundPage::CSoundPage(QWidget *parent)
    : QWidget(parent)
{
    _ui.setupUi(this);

    // setup dialog the sounds gain
    _ui.gainWidget->setRange(0.f, 1.f);
    _ui.gainWidget->setWrapper(&_GainWrapper);
    _ui.gainWidget->setSchemeWrapper(&_GainWrapper);
    _ui.gainWidget->init();

    // setup dialog the sounds pitch
    _ui.pitchWidget->setRange(0.001f, 5.f);
    _ui.pitchWidget->setWrapper(&_PitchWrapper);
    _ui.pitchWidget->setSchemeWrapper(&_PitchWrapper);
    _ui.pitchWidget->init();

    // setup dialog the percent of sound emissions
    _ui.emissionWidget->setRange(0.f, 1.f);
    _ui.emissionWidget->setWrapper(&_EmissionPercentWrapper);

    connect(_ui.browsePushButton ,SIGNAL(clicked()), this, SLOT(browse()));
    connect(_ui.playPushButton ,SIGNAL(clicked()), this, SLOT(play()));
    connect(_ui.spawnCheckBox ,SIGNAL(toggled(bool)), this, SLOT(setSpawn(bool)));
    connect(_ui.muteCheckBox ,SIGNAL(toggled(bool)), this, SLOT(setMute(bool)));
    connect(_ui.keepPitchCheckBox ,SIGNAL(toggled(bool)), this, SLOT(setKeepPitch(bool)));
    connect(_ui.soundNameLineEdit ,SIGNAL(textChanged(QString)), this, SLOT(setSoundName(QString)));
}
NewProjectDialog::NewProjectDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::NewProjectDialog)
{
    ui->setupUi(this);

    /* Getting the default directory from the application settings */
    QSettings settings;
    settings.beginGroup("NewProjectDialog");

    ui->locationBox->setText(settings.value("defaultDir",
                                            QDir::home().absolutePath())
                             .toString());

    settings.endGroup();

    /* Populating the target box */
    TargetData targets;
    for(int i = 0; i < targets.count(); i++)
    {
        ui->targetBox->insertItem(i, QIcon(), targets.name(i), targets.id(i));
    }
    targetChange(0);

    /* Connecting the browse button and target box */
    QObject::connect(ui->browseButton, SIGNAL(clicked()),
                     this, SLOT(browse()));
    QObject::connect(ui->targetBox, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(targetChange(int)));
}
MainWindow::MainWindow(QWidget *parent) :
    QWidget(parent)
{
    renderArea = new RenderArea;

    qEdit1 = new QLineEdit(tr("Path..."));
    //qEdit1->text(tr("Path..."));

    qLabel1 = new QLabel(tr("&Input file:"));
    qLabel1->setBuddy(qEdit1);

    qButton1 = new QPushButton(tr("&Browse"));
    connect(qButton1, SIGNAL(clicked()), this, SLOT(browse()));

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->setColumnStretch(0, 1);
    mainLayout->setColumnStretch(3, 1);
    mainLayout->setRowMinimumHeight(1, 6);
    mainLayout->addWidget(qLabel1, 2, 1, Qt::AlignRight);
    mainLayout->addWidget(qEdit1, 2, 2, Qt::AlignRight);
    mainLayout->addWidget(qButton1, 2, 3, Qt::AlignRight);
    mainLayout->addWidget(renderArea, 3, 0, 1, 4);

    setLayout(mainLayout);

    setWindowTitle(tr("L6V14_oapsois"));

    this->setMinimumHeight(100);
    this->setMinimumWidth(300);

    mLogic = new MLogic();
}
Exemple #13
0
Reader::Reader(WorkSpace *ws) : GuiWsItem(ws)
{
  connect(m_Dlg.ui.apply_pb,  SIGNAL(clicked()), this, SLOT(apply()));
  connect(m_Dlg.ui.help_pb,   SIGNAL(clicked()), this, SLOT(help()));
  connect(m_Dlg.ui.browse_pb, SIGNAL(clicked()), this, SLOT(browse()));
  m_Formats = "";
}
Exemple #14
0
QSimpleDownloader::QSimpleDownloader(QWidget *parent)
    : QWidget(parent)
{
    labelUrl = new QLabel(tr("&URL:"));
    labelUrl->setFixedWidth(60);
    labelUrl->setAlignment(Qt::AlignRight);
    editUrl = new QLineEdit();
    labelUrl->setBuddy(editUrl);
    QHBoxLayout *topLayout = new QHBoxLayout();
    topLayout->addWidget(labelUrl);
    topLayout->addWidget(editUrl);

    labelSaveTo = new QLabel(tr("&Save To:"));
    labelSaveTo->setFixedWidth(60);
    labelSaveTo->setAlignment(Qt::AlignRight);
    editSaveTo = new QLineEdit();
    labelSaveTo->setBuddy(editSaveTo);
    btnBrowse = new QPushButton(tr("&Browse..."));
    QHBoxLayout *midLayout = new QHBoxLayout();
    midLayout->addWidget(labelSaveTo);
    midLayout->addWidget(editSaveTo);
    midLayout->addWidget(btnBrowse);

    btnSetting = new QPushButton(tr("Se&tting..."));
    btnAbout = new QPushButton(tr("&About..."));
    btnAboutQt = new QPushButton(tr("About &Qt..."));
    btnAboutQt->setStatusTip(tr("Show the Qt library's About box"));
    btnDownload = new QPushButton(tr("&Download"));
    btnExit = new QPushButton(tr("E&xit"));
    QHBoxLayout *midLayout2 = new QHBoxLayout();
    midLayout2->addWidget(btnSetting);
    midLayout2->addWidget(btnAbout);
    midLayout2->addWidget(btnAboutQt);
    midLayout2->addStretch();
    midLayout2->addWidget(btnDownload);
    midLayout2->addWidget(btnExit);

    outputList = new QListWidget();

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addLayout(topLayout);
    mainLayout->addLayout(midLayout);
    mainLayout->addLayout(midLayout2);
    mainLayout->addWidget(outputList);
    setLayout(mainLayout);

    setWindowTitle(tr("Qt Simple Downloader"));
    this->resize(600, 480);

    optionDlg = new OptionDlg(this);
    optionDlg->setWindowTitle(tr("Option"));
    optionDlg->resize(480, 320);

    connect(btnBrowse, SIGNAL(clicked()), this, SLOT(browse()));
    connect(btnSetting, SIGNAL(clicked()), this, SLOT(setting()));
    connect(btnAbout, SIGNAL(clicked()), this, SLOT(about()));
    connect(btnAboutQt, SIGNAL(clicked()), qApp, SLOT(aboutQt()));
    connect(btnDownload, SIGNAL(clicked()), this, SLOT(download()));
    connect(btnExit, SIGNAL(clicked()), this, SLOT(close()));
}
Exemple #15
0
smbresultlist* runtarget(char *target, int maxdepth) {
	SMBCCTX         *context;
	char            buf[256];
	smbresultlist   *res = NULL;

	//Try to create a context, if it's null that means we failed, so let the user know.
	if((context = create_context()) == NULL) {
		smbresult *tmp = createSMBResultEmpty();
		parse_smburl(target, &tmp->host, &tmp->share, &tmp->object);
		tmp->statuscode = errno;
		smbresultlist_push(&res, tmp);
		return res;
	}

	//Check to see if the target has smb:// in front, if not add it.
	if(strncmp("smb://", target, 6) != 0) {
		snprintf(buf, sizeof(buf), "smb://%s", target);
	} else {
		strncpy(buf, target, strlen(target) + 1);
	}

	//Browse to our file and get the goods
	res = browse(context, buf, maxdepth, 0);

	//Delete our context, so there's less segfaults.
	delete_context(context);
	return res;
}
int DialogSiteGrabber::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: runProject((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3])),(*reinterpret_cast< QStringList(*)>(_a[4]))); break;
        case 1: next(); break;
        case 2: back(); break;
        case 3: run(); break;
        case 4: cancel(); break;
        case 5: addFilter(); break;
        case 6: browse(); break;
        case 7: pageChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 8: typeChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 9: lePNameChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 10: lePDirChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 11: lePURLChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 12: leFTPURLChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 13;
    }
    return _id;
}
void BitmapWidget::setUpForm()
{        
  mpBrowseBox = new QLineEdit;

  mpBrowseButton = new QPushButton(Helper::browse);
  mpBrowseButton->setAutoDefault(true);
  connect(mpBrowseButton, SIGNAL(clicked()), this, SLOT(browse()));

  mpCheckBox = new QCheckBox(tr("Store picture in model"), this);

  mpOkButton = new QPushButton(Helper::ok);
  mpOkButton->setAutoDefault(false);
  connect(mpOkButton, SIGNAL(clicked()), this, SLOT(edit()));

  mpCancelButton = new QPushButton(Helper::cancel);
  mpCancelButton->setAutoDefault(false);
  connect(mpCancelButton, SIGNAL(clicked()), this, SLOT(reject()));

  mpButtonBox = new QDialogButtonBox(Qt::Horizontal);
  mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole);
  mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);

  QGridLayout *mainLayout = new QGridLayout;

  mainLayout->addWidget(mpBrowseBox, 0, 0);
  mainLayout->addWidget(mpBrowseButton, 0, 1);
  mainLayout->addWidget(mpCheckBox, 2, 0);
  mainLayout->addWidget(mpButtonBox, 3, 0);

  setLayout(mainLayout);
}
SelectSoundDialog::SelectSoundDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SelectSoundDialog)
{

    ui->setupUi(this);
    connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(browse()));

    QSettings settings("KitchenAlert","KitchenAlert");
    QString filename = settings.value("soundfile").toString();
    ui->lineEdit->setText(filename);

    bool useDefaultSoundFile = settings.value("UseDefaultSound",true).toBool();
    if (useDefaultSoundFile == true)
    {
        ui->DefaultSoundRadioButton->setChecked(true);
        ui->browseButton->setDisabled(true);
        ui->lineEdit->setDisabled(true);
    }
    else ui->CustomSoundRadioButton->setChecked(true);
//    qDebug() << "UseDefaultSoundfile is " << useDefaultSoundFile;



    isTesting_ = false;
    connect(ui->TestButton,SIGNAL(clicked()),this,SLOT(testSound()));
}
Exemple #19
0
RssRegexpDlg::RssRegexpDlg(QWidget* parent)
: QDialog(parent)
{
	setupUi(this);
	
	m_regexp.tvs = RssRegexp::None;
	
	connect(lineText, SIGNAL(textChanged(const QString&)), this, SLOT(test()));
	connect(lineExpression, SIGNAL(textChanged(const QString&)), this, SLOT(test()));
	connect(toolBrowse, SIGNAL(clicked()), this, SLOT(browse()));
	
	connect(radioTVSNone, SIGNAL(toggled(bool)), this, SLOT(updateTVS()));
	connect(radioTVSSeason, SIGNAL(toggled(bool)), this, SLOT(updateTVS()));
	connect(radioTVSEpisode, SIGNAL(toggled(bool)), this, SLOT(updateTVS()));
	connect(radioTVSDate, SIGNAL(toggled(bool)), this, SLOT(updateTVS()));
	connect(radioParsingNone, SIGNAL(toggled(bool)), this, SLOT(updateParsing()));
	connect(radioParsingExtract, SIGNAL(toggled(bool)), this, SLOT(updateParsing()));
	
	connect(labelManage, SIGNAL(linkActivated(const QString&)), this, SLOT(linkClicked(const QString&)));
	
	m_regexp.includeRepacks = true;
	m_regexp.excludeManuals = true;
	m_regexp.includeTrailers = false;
	m_regexp.addPaused = false;
}
DistributorDialog::DistributorDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DistributorDialog)
{
    ui->setupUi(this);

    QString appData(getenv("APPDATA"));
    dataFileName = appData.append("\\FileDistributor\\settings.dat");
    copier = new Copier();
    copier->moveToThread(&workerThread);
    dirsModel = new QStringListModel(copier->getDestDirs(), this);

    load();
    icon = new QSystemTrayIcon(QIcon(":/res/FD.ico"), this);
    iconMenu = new QMenu(this);
    iconMenu->addAction("Settings", this, SLOT(show()));
    iconMenu->addSeparator();
    iconMenu->addAction("Close", this, SLOT(quit()));
    icon->setContextMenu(iconMenu);
    icon->show();
    displayMessage("", "FileDistributor is running");
    timer = new QTimer(this);

    connect(icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
    connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(save()));
    connect(ui->sourceDirBrowse, SIGNAL(clicked()), this, SLOT(browse()));
    connect(ui->addDirB, SIGNAL(clicked()), this, SLOT(addDest()));
    connect(ui->removeDirB, SIGNAL(clicked()), this, SLOT(removeDest()));
    connect(timer, SIGNAL(timeout()), copier, SLOT(startCopy()));
    connect(this, SIGNAL(startCopy()), copier, SLOT(startCopy()));
    connect(copier, SIGNAL(copyStarted()), this, SLOT(copyStarted()));
    workerThread.start();
    emit startCopy();
    timer->start(1000*copier->getRefreshRateSeconds());
}
SelectPictureDialog::SelectPictureDialog(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::SelectPictureDialog)
{
	ui->setupUi(this);

	connect(ui->browse, SIGNAL(clicked()), this, SLOT(browse()));
}
Exemple #22
0
CMountPointDialog::CMountPointDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CMountPointDialog)
{
    ui->setupUi(this);
    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
    connect(ui->browseBtn, SIGNAL(clicked()), this, SLOT(browse()));
}
void unrolled_xml_tree_browser::visitStart( Sxmlelement& elt)
{
	bool forward = fForward;
	if (forward) enter(*elt);
	ctree<xmlelement>::literator iter;
	for (iter = elt->lbegin(); iter != elt->lend(); iter++)
		browse(**iter);
	if (forward) leave(*elt);
}
Exemple #24
0
G_MODULE_EXPORT
void
on_treeview2_row_activated             (GtkTreeView     *treeview,
GtkTreePath     *path,
GtkTreeViewColumn *column,
gpointer         user_data)
{
  browse(2, treeview);
}
Exemple #25
0
 void ImporterWizard::setVisible(bool visible)
 {
   QWizard::setVisible(visible);
   if (visible && m_first) {
     m_first = false;
     if (m_ui->filename->text().isEmpty())
       browse();
   }
 }
CoverPicker::CoverPicker(QString album, QString path, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CoverPicker)
{
    ui->setupUi(this);
    ui->locationButton->setIcon(QIcon::fromTheme("filemanager_folder_up"));

    this->album = album;

    connect(ui->fileList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(onItemActivated(QListWidgetItem*)));
    connect(ui->locationButton, SIGNAL(clicked()), this, SLOT(browse()));

    QStringList filters;
    dir.setNameFilters(filters << "*.jpg");
    dir.setFilter(QDir::AllDirs | QDir::AllEntries | QDir::Hidden | QDir::NoDotAndDotDot);
    dir.setSorting(QDir::DirsFirst | QDir::Name | QDir::IgnoreCase);

    browse(path);
}
Exemple #27
0
void FileScrapDropDlg::OnFileScrapMove(void) 
{
    xpr_tchar_t sTarget[XPR_MAX_PATH + 1];
    if (browse(sTarget) == XPR_TRUE)
    {
        FileScrap &sFileScrap = FileScrap::instance();

        xpr_uint_t sGroupId = sFileScrap.getCurGroupId();
        sFileScrap.moveOperation(sGroupId, sTarget);
    }
}
Exemple #28
0
//-----------------------------------------------------------------------------
void ctkDirectoryButtonPrivate::init()
{
  Q_Q(ctkDirectoryButton);
  this->PushButton = new QPushButton(q);
  QObject::connect(this->PushButton, SIGNAL(clicked()), q, SLOT(browse()));
  QHBoxLayout* l = new QHBoxLayout(q);
  l->addWidget(this->PushButton);
  l->setContentsMargins(0,0,0,0);
  q->setLayout(l);
  q->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::ButtonBox));
}
Exemple #29
0
int wget_vector_browse(const wget_vector_t *v, int (*browse)(void *ctx, void *elem), void *ctx)
{
	if (v) {
		int it, ret;

		for (it = 0; it < v->cur; it++)
			if ((ret = browse(ctx, v->entry[it])) != 0)
				return ret;
	}

	return 0;
}
SaveAsImageDialog::SaveAsImageDialog(MapEditor *MapEditor, 
                                     const QString &fileName, 
                                     qreal currentScale, 
                                     QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SaveAsImageDialog),
    mMapEditor(MapEditor),
    mCurrentScale(currentScale)
{
    ui->setupUi(this);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    
    QString suggestion = mPath;
    
    if (!fileName.isEmpty()) {
        QFileInfo fileInfo(fileName);
        const QString path = fileInfo.path();
        const QString baseName = fileInfo.completeBaseName();

        if (suggestion.isEmpty())
            suggestion = path;

        suggestion += QLatin1Char('/');
        suggestion += baseName;
        suggestion += QLatin1String(".png");
    } else {
        suggestion += QLatin1Char('/');
        suggestion += QLatin1String("map.png");
    }
    
    if (suggestion.contains(".amp")) {
        suggestion.remove(".amp");
    }
    
    ui->name->setText(suggestion);
    
    QSettings *s = Preferences::instance()->settings();
    const bool visibleLayersOnly =
            s->value(QLatin1String(VISIBLE_ONLY_KEY), true).toBool();
    const bool useCurrentScale =
            s->value(QLatin1String(CURRENT_SCALE_KEY), true).toBool();
    const bool drawTileGrid =
            s->value(QLatin1String(DRAW_GRID_KEY), false).toBool();
    
    ui->visibleLayers->setChecked(visibleLayersOnly);
    ui->currentZoomLevel->setChecked(useCurrentScale);
    ui->showGrid->setChecked(drawTileGrid);
    
    connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browse()));
    connect(ui->name, SIGNAL(textChanged(QString)), this, SLOT(updateAcceptEnabled()));
    
    Utils::restoreGeometry(this);
}