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

IconSettings::IconSettings ( QString  prefix_name,
QString  dir_name,
QString  icon_name = "",
QWidget *  parent = 0,
Qt::WFlags  f = 0 
)

This is class constructor.

Parameters:
prefix_name Current prefix name.
dir_name Current directory name.
icon_name Current directory name.

Definition at line 22 of file iconsettings.cpp.

References cbUseConsole_stateChanged(), cmdAdd_Click(), cmdCancel_Click(), cmdGetIcon_Click(), cmdGetProgram_Click(), cmdGetWorkDir_Click(), cmdHelp_Click(), cmdOk_Click(), db_prefix, Prefix::getByName(), getIconReccord(), Prefix::getMountPoint(), libq4wine, prefix_urls, and ResizeContent().

                                                                                                                 : QDialog(parent, f)
{
      /*
       ** This functions is constructor for IconSettings dialog
       *
       * Args:
       * @newIcon -- This define which type of dialog we'l use "New Icon" or "Edit Icon"
       * @p_id    -- PrefixId
       * @p_id    -- PrefixId
       */
      setupUi(this);

      // 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->prefix_name = prefix_name;
      this->dir_name = dir_name;
      this->icon_name = icon_name;
    this->prefix_path = db_prefix.getByName(this->prefix_name).value("path");
      if (this->prefix_path.isEmpty()){
              this->prefix_path = QDir::homePath();
              this->prefix_path.append("/.wine/drive_c/");
      } else {
              this->prefix_path.append("/drive_c/");
      }


      // Creating side bar urls
      prefix_urls << QUrl::fromLocalFile(QDir::rootPath());
      prefix_urls << QUrl::fromLocalFile(QDir::homePath());

      if (QDir(this->prefix_path).exists())
         prefix_urls << QUrl::fromLocalFile(this->prefix_path);

    QString cd_mount = db_prefix.getMountPoint(this->prefix_name);

      if (!cd_mount.isEmpty())
        if (QDir().exists(cd_mount))
              prefix_urls << QUrl::fromLocalFile(cd_mount);

      this->loadThemeIcons();


    QString res;
      switch (icon_name.isEmpty()){
            case TRUE:
                  lblCaption->setText(tr("Adding new icon"));
                  setWindowTitle(tr("Adding new icon"));

            res = CoreLib->getSetting("advanced", "defaultDesktopSize", false, "").toString();
            if (res.isEmpty()){
                cboxDesktopSize->setCurrentIndex(0);
            } else {
                cboxDesktopSize->setCurrentIndex(cboxDesktopSize->findText(res));
            }
            break;
            case FALSE:
                  lblCaption->setText(tr("Icon settings"));
                  setWindowTitle(tr("Icon settings"));
                  getIconReccord();
            break;
      }

      connect(twbGeneral, SIGNAL(currentChanged(int)), this, SLOT(ResizeContent(int)));
      connect(cmdAdd, SIGNAL(clicked()), this, SLOT(cmdAdd_Click()));
      connect(cmdGetProgram, SIGNAL(clicked()), this, SLOT(cmdGetProgram_Click()));
      connect(cmdGetWorkDir, SIGNAL(clicked()), this, SLOT(cmdGetWorkDir_Click()));
      connect(cmdGetIcon, SIGNAL(clicked()), this, SLOT(cmdGetIcon_Click()));
      connect(cmdCancel, SIGNAL(clicked()), this, SLOT(cmdCancel_Click()));
      connect(cmdOk, SIGNAL(clicked()), this, SLOT(cmdOk_Click()));
      connect(cmdHelp, SIGNAL(clicked()), this, SLOT(cmdHelp_Click()));

      connect(cbUseConsole, SIGNAL(stateChanged(int)), this, SLOT(cbUseConsole_stateChanged(int)));

      twDlls->installEventFilter(this);

    cboxDlls->addItems(CoreLib->getWineDlls(db_prefix.getByName(prefix_name).value("libs")));
      cboxDlls->setMaxVisibleItems (10);

      cmdOk->setFocus(Qt::ActiveWindowFocusReason);

      return;
}


Generated by  Doxygen 1.6.0   Back to index