Exemple #1
0
void mainWin::ProgramInit(QString ch, QString ip)
{
  // Set any warden directories
  groupDetails->setVisible(false);
  doingUpdate=false;
  lastError="";
  wDir = ch;
  wIP = ip;
  if ( ! wDir.isEmpty() )
     setWindowTitle(tr("Updates for Jail:") + " " + wIP );

  //Grab the username
  //username = QString::fromLocal8Bit(getenv("LOGNAME"));
  connect(buttonRescan, SIGNAL(clicked()), this, SLOT(slotRescanUpdates()));
  connect(pushInstallUpdates, SIGNAL(clicked()), this, SLOT(slotInstallClicked()));
  connect(pushClose, SIGNAL(clicked()), this, SLOT(slotCloseClicked()));
  connect(checkAll, SIGNAL(clicked()), this, SLOT(slotSelectAllClicked()));
  connect(listViewUpdates, SIGNAL(itemClicked(QListWidgetItem *)),this,SLOT(slotListClicked()));
  connect(listViewUpdates, SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(slotListClicked()));
  connect(listViewUpdates, SIGNAL(itemChanged(QListWidgetItem *)),this,SLOT(slotListClicked()));
  connect(listViewUpdates, SIGNAL(itemPressed(QListWidgetItem *)),this,SLOT(slotListClicked()));
  connect(listViewUpdates, SIGNAL(itemDoubleClicked(QListWidgetItem *)),this,SLOT(slotListDoubleClicked(QListWidgetItem *)));
  progressUpdate->setHidden(true);

  QTimer::singleShot(100, this, SLOT(slotRescanUpdates() ) );
}
WPUserInfo::WPUserInfo( WPContact *contact, QWidget *parent )
	: KDialog( parent ), m_contact(contact),
	  Comment(i18n("N/A")), Workgroup(i18n("N/A")), OS(i18n("N/A")), Software(i18n("N/A"))
{
	setButtons( KDialog::Close );
	setDefaultButton(KDialog::Close);
//	kDebug( 14170 ) ;

	setCaption( i18n( "User Info for %1", m_contact->nickName() ) );

	QWidget* w = new QWidget( this );
	m_mainWidget = new Ui::WPUserInfoWidget();
	m_mainWidget->setupUi( w );
	setMainWidget( w );

	m_mainWidget->sComputerName->setText( m_contact->contactId() );

//	m_mainWidget->sComment->setText(i18n("Looking"));
//	m_mainWidget->sWorkgroup->setText(i18n("Looking"));
//	m_mainWidget->sOS->setText(i18n("Looking"));
//	m_mainWidget->sServer->setText(i18n("Looking"));

	connect( this, SIGNAL(closeClicked()), this, SLOT(slotCloseClicked()) );

	noComment = true;
	startDetailsProcess(m_contact->contactId());
}
KexiFindDialog::KexiFindDialog(QWidget* parent)
        : QDialog(parent,
                  Qt::Dialog | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::Tool)
        , d(new Private())
{
    setObjectName("KexiFindDialog");
    setupUi(this);
    m_search->setCurrentIndex(
        (int)KexiSearchAndReplaceViewInterface::Options::SearchDown);
    layout()->setMargin(KDialog::marginHint());
    layout()->setSpacing(KDialog::spacingHint());
    KAction *a = KStandardAction::findNext(0, 0, 0);
    m_btnFind->setText(a->text());
    m_btnFind->setIcon(KIcon(a->icon()));
    delete a;
    m_btnClose->setText(KStandardGuiItem::close().text());
    m_btnClose->setIcon(KStandardGuiItem::close().icon());
    connect(m_btnFind, SIGNAL(clicked()), this, SIGNAL(findNext()));
    connect(m_btnClose, SIGNAL(clicked()), this, SLOT(slotCloseClicked()));
    connect(m_btnReplace, SIGNAL(clicked()), this, SIGNAL(replaceNext()));
    connect(m_btnReplaceAll, SIGNAL(clicked()), this, SIGNAL(replaceAll()));
    // clear message after the text is changed
    connect(m_textToFind, SIGNAL(editTextChanged(const QString&)), this, SLOT(updateMessage(const QString&)));
    connect(m_textToReplace, SIGNAL(editTextChanged(const QString&)), this, SLOT(updateMessage(const QString&)));

    d->replaceMode = true; //to force updating by setReplaceMode()
    setReplaceMode(false);

    setLookInColumnList(QStringList(), QStringList());
}
Exemple #4
0
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();
}
AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, QWidget *parent )
	: KDialog( parent )
{
	setCaption( i18n( "User Information on %1" ,
	                  c->displayName() ) );
	setButtons( KDialog::Cancel | KDialog::Ok );
	
	setDefaultButton(KDialog::Ok);
	showButtonSeparator(true);
	kDebug(14200) << "for contact '" << c->contactId() << "'";

	m_contact = c;
	mAccount = acc;

	QWidget* w = new QWidget( this );
	mMainWidget = new Ui::AIMUserInfoWidget();
	mMainWidget->setupUi( w );
	setMainWidget( w );

	QObject::connect(this, SIGNAL(okClicked()), this, SLOT(slotSaveClicked()));
	QObject::connect(this, SIGNAL(user1Clicked()), this, SLOT(slotUpdateClicked()));
	QObject::connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCloseClicked()));
	QObject::connect(c, SIGNAL(updatedProfile()), this, SLOT(slotUpdateProfile()));
	QObject::connect(c, SIGNAL(statusMessageChanged( Kopete::Contact* )), this, SLOT(slotUpdateProfile()));

	mMainWidget->txtScreenName->setText( c->contactId() );
	mMainWidget->txtNickName->setText( c->customName() );

	if(m_contact == mAccount->myself()) // edit own account profile
	{
		mMainWidget->lblWarnLevel->hide();
		mMainWidget->txtWarnLevel->hide();
		mMainWidget->lblIdleTime->hide();
		mMainWidget->txtIdleTime->hide();
		mMainWidget->lblOnlineSince->hide();
		mMainWidget->txtOnlineSince->hide();
		mMainWidget->txtAwayMessage->hide();
		mMainWidget->lblAwayMessage->hide();

		userInfoView=0L;
		mMainWidget->userInfoFrame->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
		QVBoxLayout *l = new QVBoxLayout(mMainWidget->userInfoFrame);
		l->setContentsMargins( 0, 0, 0, 0 );
		userInfoEdit = new KTextEdit(QString(), mMainWidget->userInfoFrame);

		AIMMyselfContact* aimmc = dynamic_cast<AIMMyselfContact*>( c );
		if ( aimmc )
			userInfoEdit->setPlainText( aimmc->userProfile() );
		else
			userInfoEdit->setPlainText( QString() );

		setButtonText(Ok, i18n("&Save Profile"));
		showButton(User1, false);
		l->addWidget(userInfoEdit);
	}
	else
	{
		userInfoEdit=0L;
		mMainWidget->userInfoFrame->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
		QVBoxLayout *l = new QVBoxLayout(mMainWidget->userInfoFrame);
		l->setContentsMargins( 0, 0, 0, 0 );
		userInfoView = new KTextBrowser(mMainWidget->userInfoFrame);
		userInfoView->setObjectName("userInfoView");
		userInfoView->setNotifyClick(true);
		QObject::connect(
			userInfoView, SIGNAL(urlClick(QString)),
			this, SLOT(slotUrlClicked(QString)));
		QObject::connect(
			userInfoView, SIGNAL(mailClick(QString,QString)),
			this, SLOT(slotMailClicked(QString,QString)));
		showButton(Cancel, false);
		setButtonText(Ok, i18n("&Close"));
		setEscapeButton(Ok);
		l->addWidget(userInfoView);

		if(m_contact->isOnline())
		{
			// Update the user view to indicate that we're requesting the user's profile
			userInfoView->setPlainText(i18n("Requesting User Profile, please wait..."));
		}
		QTimer::singleShot(0, this, SLOT(slotUpdateProfile()));
	}
}
Exemple #6
0
AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, bool modal,
                                      QWidget *parent, const char* name )
    : KDialogBase( parent, name, modal, i18n( "User Information on %1" )
                   .arg( c->property( Kopete::Global::Properties::self()->nickName() ).value().toString() ),
                   Cancel | Ok , Ok, true )
{
    kdDebug(14200) << k_funcinfo << "for contact '" << c->contactId() << "'" << endl;

    m_contact = c;
    mAccount = acc;

    mMainWidget = new AIMUserInfoWidget(this, "aimuserinfowidget");
    setMainWidget(mMainWidget);

    QObject::connect(this, SIGNAL(okClicked()), this, SLOT(slotSaveClicked()));
    QObject::connect(this, SIGNAL(user1Clicked()), this, SLOT(slotUpdateClicked()));
    QObject::connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCloseClicked()));
    QObject::connect(c, SIGNAL(updatedProfile()), this, SLOT(slotUpdateProfile()));

    mMainWidget->txtScreenName->setText( c->contactId() );

    QString nickName = c->property( Kopete::Global::Properties::self()->nickName() ).value().toString();
    if( nickName.isEmpty() )
        mMainWidget->txtNickName->setText( c->contactId() );
    else
        mMainWidget->txtNickName->setText( nickName );

    if(m_contact == mAccount->myself()) // edit own account profile
    {
        mMainWidget->lblWarnLevel->hide();
        mMainWidget->txtWarnLevel->hide();
        mMainWidget->lblIdleTime->hide();
        mMainWidget->txtIdleTime->hide();
        mMainWidget->lblOnlineSince->hide();
        mMainWidget->txtOnlineSince->hide();
        mMainWidget->txtAwayMessage->hide();
        mMainWidget->lblAwayMessage->hide();

        userInfoView=0L;
        mMainWidget->userInfoFrame->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
        QVBoxLayout *l = new QVBoxLayout(mMainWidget->userInfoFrame);
        userInfoEdit = new KTextEdit(QString::null, QString::null,
                                     mMainWidget->userInfoFrame, "userInfoEdit");
        userInfoEdit->setTextFormat(PlainText);

        AIMMyselfContact* aimmc = dynamic_cast<AIMMyselfContact*>( c );
        if ( aimmc )
            userInfoEdit->setText( aimmc->userProfile() );
        else
            userInfoEdit->setText( QString::null );

        setButtonText(Ok, i18n("&Save Profile"));
        showButton(User1, false);
        l->addWidget(userInfoEdit);
    }
    else
    {
        userInfoEdit=0L;
        mMainWidget->userInfoFrame->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
        QVBoxLayout *l = new QVBoxLayout(mMainWidget->userInfoFrame);
        userInfoView = new KTextBrowser(mMainWidget->userInfoFrame, "userInfoView");
        userInfoView->setTextFormat(AutoText);
        userInfoView->setNotifyClick(true);
        QObject::connect(
            userInfoView, SIGNAL(urlClick(const QString&)),
            this, SLOT(slotUrlClicked(const QString&)));
        QObject::connect(
            userInfoView, SIGNAL(mailClick(const QString&, const QString&)),
            this, SLOT(slotMailClicked(const QString&, const QString&)));
        showButton(Cancel, false);
        setButtonText(Ok, i18n("&Close"));
        setEscapeButton(Ok);
        l->addWidget(userInfoView);

        if(m_contact->isOnline())
        {
            // Update the user view to indicate that we're requesting the user's profile
            userInfoView->setText(i18n("Requesting User Profile, please wait..."));
        }
        QTimer::singleShot(0, this, SLOT(slotUpdateProfile()));
    }
}