Logo Search packages:      
Sourcecode: q4wine version File versions  Download package

PrefixSettings::PrefixSettings ( QString  prefix_name,
QWidget *  parent = 0,
Qt::WFlags  f = 0 
)

This is class constructor.

Parameters:
prefix_name Current prefix name.

Definition at line 22 of file prefixsettings.cpp.

References cmdCancel_Click(), cmdHelp_Click(), cmdOk_Click(), db_prefix, Prefix::getByName(), libq4wine, loadThemeIcons(), and prefix_id.

                                                                                : QDialog(parent, f)
{
      // Setup base UI
      setupUi(this);

      // Setting class prefix name
      this->prefix_name=prefix_name;

      // Loading libq4wine-core.so
      libq4wine.setFileName("libq4wine-core");

      if (!libq4wine.load()){
            libq4wine.load();
      }

      // Getting corelib calss pointer
      CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib");
      CoreLib.reset((corelib *)CoreLibClassPointer(true));

    this->addNew=false;
      this->loadThemeIcons();

    QHash<QString,QString> result = db_prefix.getByName(prefix_name);
    if (result.value("id").isEmpty())
            return;

    prefix_id=result.value("id");

      //comboDeviceList
    txtMountPoint->setText(result.value("mount"));

      if (prefix_name=="Default"){
            txtPrefixName->setEnabled(FALSE);
            txtPrefixPath->setEnabled(FALSE);

            cmdGetPrefixPath->setEnabled(FALSE);

        txtWineLibs->setEnabled(FALSE);
        txtWineLoaderBin->setEnabled(FALSE);
        txtWineServerBin->setEnabled(FALSE);
        txtWineBin->setEnabled(FALSE);

        cmdGetWineLibs->setEnabled(FALSE);
        cmdGetWineLoaderBin->setEnabled(FALSE);
        cmdGetWineServerBin->setEnabled(FALSE);
        cmdGetWineBin->setEnabled(FALSE);

        txtWineLibs->setText("");
        txtWineLoaderBin->setText("");
        txtWineServerBin->setText("");
        txtWineBin->setText("");
      } else {
            cmdGetPrefixPath->installEventFilter(this);
        cmdGetWineBin->installEventFilter(this);
        cmdGetWineServerBin->installEventFilter(this);
        cmdGetWineLoaderBin->installEventFilter(this);
        cmdGetWineLibs->installEventFilter(this);

        txtWineLibs->setText(result.value("libs"));
        txtWineLoaderBin->setText(result.value("loader"));
        txtWineServerBin->setText(result.value("server"));
        txtWineBin->setText(result.value("bin"));
      }

      txtPrefixName->setText(prefix_name);
    txtPrefixPath->setText(result.value("path"));

      comboDeviceList->addItems(CoreLib->getCdromDevices());
    if (!result.value("drive").isEmpty()){
        comboDeviceList->setCurrentIndex (comboDeviceList->findText(result.value("drive")));
            if (comboDeviceList->currentText().isEmpty())
                  comboDeviceList->setCurrentIndex (0);
      } else {
            comboDeviceList->setCurrentIndex (0);
      }

      connect(cmdCancel, SIGNAL(clicked()), this, SLOT(cmdCancel_Click()));
      connect(cmdOk, SIGNAL(clicked()), this, SLOT(cmdOk_Click()));
      connect(cmdHelp, SIGNAL(clicked()), this, SLOT(cmdHelp_Click()));

      cmdGetMountPoint->installEventFilter(this);

      cmdOk->setFocus(Qt::ActiveWindowFocusReason);
      return;
}


Generated by  Doxygen 1.6.0   Back to index