WaresSearchPathsWidget::WaresSearchPathsWidget(QWidget* Parent):
  QWidget(Parent), ui(new Ui::WaresSearchPathsWidget)
{
  ui->setupUi(this);

  connect(ui->UserPathsWidget,SIGNAL(pathsUpdated()),this,SLOT(processUserPathsUpdate()));
}
void PathsManagementWidget::addPath()
{
  QString SelectedDir = QFileDialog::getExistingDirectory(this,tr("Select search path"));

  if (SelectedDir !=  "")
  {
    ui->PathsListWidget->addItem(QDir::toNativeSeparators(SelectedDir));
    emit pathsUpdated();
  }
}
void PathsManagementWidget::removePath()
{
  if (!m_AllowEmpty && ui->PathsListWidget->count() < 2) return;

  if (ui->PathsListWidget->currentRow() >= 0)
  {
    delete ui->PathsListWidget->takeItem(ui->PathsListWidget->currentRow());
    emit pathsUpdated();
  }
}
void PathsManagementWidget::movedownPath()
{
  int Index = ui->PathsListWidget->currentRow();

  if (Index < ui->PathsListWidget->count())
  {
    QListWidgetItem *Item = ui->PathsListWidget->takeItem(Index);
    ui->PathsListWidget->insertItem(Index+1, Item);
    ui->PathsListWidget->setCurrentRow(Index+1);
    emit pathsUpdated();
  }
}
Ejemplo n.º 5
0
ModulesManagementWidget::ModulesManagementWidget(ModulesManagement *nmodulesMgmt, QWidget *parent) :
    QWidget(parent)
{
    ui = new(std::nothrow) Ui::ModulesManagementWidget();
    if (ui == NULL) {
        qFatal("Cannot allocate memory for Ui::ModulesManagementWidget X{");
    }
    modulesMgmt = nmodulesMgmt;
    moduleTitle = modulesMgmt->getLangName();

    ui->setupUi(this);
    ui->infoLabel->setText(modulesMgmt->getInfos());
    connect(modulesMgmt,SIGNAL(modulesUpdated()), this, SLOT(loadModules()));
    connect(modulesMgmt,SIGNAL(pathsUpdated()), this, SLOT(loadPaths()));
    connect(ui->modulesListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onModuleSelected(QListWidgetItem*)));
    connect(ui->loadPushButton, SIGNAL(clicked()), this, SLOT(onManualClicked()));

    loadPaths();
    loadModules();
    qDebug() << this << "created";
}