コード例 #1
0
ファイル: mainWin.cpp プロジェクト: heliocentric/pcbsd
void mainWin::ProgramInit(QString ch)
{
  // Set any warden directories
  lastError="";
  wDir = ch;
	
  //Grab the username
  //username = QString::fromLocal8Bit(getenv("LOGNAME"));
  connect(pushUpdatePkgs, SIGNAL(clicked()), this, SLOT(slotUpdatePkgsClicked()));
  connect(pushClose, SIGNAL(clicked()), this, SLOT(slotCloseClicked()));
  connect(pushCloseAdv, SIGNAL(clicked()), this, SLOT(slotCloseAdvClicked()));
  connect(buttonRescanPkgs, SIGNAL(clicked()), this, SLOT(slotRescanPkgsClicked()));
  connect(pushPkgApply, SIGNAL( clicked() ), this, SLOT( slotApplyClicked() ) );
  connect(action_Quit, SIGNAL( triggered(bool) ), this, SLOT( slotCloseClicked() ) );
  connect(tool_search, SIGNAL( clicked() ), this, SLOT( slotSearchPackages() ) );
  connect(line_search, SIGNAL( returnPressed()), this, SLOT( slotSearchPackages()) );
	
  // Setup the action group
  viewGroup = new QActionGroup(this);
  viewGroup->addAction(action_Basic);
  viewGroup->addAction(action_Advanced);

  treeMetaPkgs->setContextMenuPolicy(Qt::CustomContextMenu);
  connect(treeMetaPkgs, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotMetaRightClick()) );

  QSettings settings("PC-BSD", "PackageManager");
  QString curMode = settings.value("view/mode").toString();
  if ( curMode == "Advanced" )
  {
     stackedPkgView->setCurrentIndex(1);
     action_Basic->setChecked(false);
     action_Advanced->setChecked(true);
  }

  // If we are running on a chroot, only do advanced mode
  if ( !wDir.isEmpty() )
  {
     stackedPkgView->setCurrentIndex(1);
     action_Basic->setChecked(false);
     action_Basic->setEnabled(false);
     action_Advanced->setChecked(true);
     action_Advanced->setEnabled(false);
  } else {
    // Connect our view modes only when not running via in a chroot
    connect(action_Basic, SIGNAL( triggered(bool) ), this, SLOT( slotViewChanged() ) );
    connect(action_Advanced, SIGNAL( triggered(bool) ), this, SLOT( slotViewChanged() ) );
  }

  initMetaWidget();
}
コード例 #2
0
ファイル: setup.cpp プロジェクト: NathanDM/kipi-plugins
Setup::Setup(QWidget* const parent)
  : KPageDialog(parent), d(new Private())
{
    setCaption(i18n("Configure"));
    setButtons(Apply|Ok|Cancel);
    setDefaultButton(Ok);
    setModal(true);

    d->setupGeneral = new SetupGeneral(this);
    d->pageGeneral = addPage(d->setupGeneral, i18nc("General setup", "General"));

    connect(this, SIGNAL(applyClicked()),
            this, SLOT(slotApplyClicked()));

    connect(this, SIGNAL(okClicked()),
            this, SLOT(slotOkClicked()));
}
コード例 #3
0
ファイル: setup.cpp プロジェクト: NathanDM/kipi-plugins
void Setup::slotOkClicked()
{
    slotApplyClicked();
    accept();
}