Пример #1
0
ChannelModifierEditor::ChannelModifierEditor(Doc *doc, QString modifier, QWidget *parent)
    : QDialog(parent)
    , m_doc(doc)
{
    Q_ASSERT(doc != NULL);

    setupUi(this);

    m_view = new ChannelModifierGraphicsView(this);
    m_view->setRenderHint(QPainter::Antialiasing);
    m_view->setAcceptDrops(true);
    m_view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
    m_view->setBackgroundBrush(QBrush(QColor(11, 11, 11, 255), Qt::SolidPattern));

    m_mainGrid->addWidget(m_view, 2, 0);

    m_origDMXSpin->setEnabled(false);
    m_modifiedDMXSpin->setEnabled(false);
    m_deleteHandlerButton->setEnabled(false);

    connect(m_view, SIGNAL(itemClicked(uchar,uchar)),
            this, SLOT(slotHandlerClicked(uchar,uchar)));
    connect(m_view, SIGNAL(itemDMXMapChanged(uchar,uchar)),
            this, SLOT(slotItemDMXChanged(uchar,uchar)));
    connect(m_view, SIGNAL(viewClicked(QMouseEvent*)),
            this, SLOT(slotViewClicked()));

    connect(m_templatesTree, SIGNAL(itemSelectionChanged()),
            this, SLOT(slotItemSelectionChanged()));

    connect(m_origDMXSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotOriginalDMXValueChanged(int)));
    connect(m_modifiedDMXSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotModifiedDMXValueChanged(int)));

    connect(m_addHandlerButton, SIGNAL(clicked()),
            this, SLOT(slotAddHandlerClicked()));
    connect(m_deleteHandlerButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveHandlerClicked()));
    connect(m_saveButton, SIGNAL(clicked()),
            this, SLOT(slotSaveClicked()));

    connect(m_unsetButton, SIGNAL(clicked()),
            this, SLOT(slotUnsetClicked()));

    updateModifiersList(modifier);
}
Пример #2
0
void K3bInteractionDialog::initConnections()
{
  if( m_buttonStart ) {
    connect( m_buttonStart, SIGNAL(clicked()),
	     this, SLOT(slotStartClickedInternal()) );
  }
  if( m_buttonSave ) {
//     connect( m_buttonSave, SIGNAL(clicked()),
// 	     this, SLOT(slotSaveLastSettings()) );
    connect( m_buttonSave, SIGNAL(clicked()),
	     this, SLOT(slotSaveClicked()) );
  }
  if( m_buttonCancel )
    connect( m_buttonCancel, SIGNAL(clicked()),
	     this, SLOT(slotCancelClicked()) );

  if( !m_configGroup.isEmpty() ) {
    connect( m_buttonSaveSettings, SIGNAL(clicked()),
	     this, SLOT(slotSaveUserDefaults()) );
  }
}
Пример #3
0
bool K3bInteractionDialog::eventFilter( QObject* o, QEvent* ev )
{
  if( dynamic_cast<K3bInteractionDialog*>(o) == this &&
      ev->type() == QEvent::KeyPress ) {

    QKeyEvent* kev = dynamic_cast<QKeyEvent*>(ev);

    switch ( kev->key() ) {
    case Key_Enter:
    case Key_Return:
      // if the process finished this closes the dialog
      if( m_defaultButton == START_BUTTON ) {
	if( m_buttonStart->isEnabled() )
	  slotStartClickedInternal();
      }
      else if( m_defaultButton == CANCEL_BUTTON ) {
	if( m_buttonCancel->isEnabled() )
	  slotCancelClicked();
      }
      else if( m_defaultButton == SAVE_BUTTON ) {
	if( m_buttonSave->isEnabled() )
	  slotSaveClicked();
      }
      return true;

    case Key_Escape:
      // simulate button clicks
      if( m_buttonCancel ) {
	if( m_buttonCancel->isEnabled() )
	  slotCancelClicked();
      }
      return true;
    }
  }

  return KDialog::eventFilter( o, ev );
}
Пример #4
0
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()));
	}
}
Пример #5
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()));
    }
}
Пример #6
0
void dialogEditIP::programInit(QString name)
{
  JailDir = pcbsd::Utils::getValFromPCConf("/usr/local/etc/warden.conf", "JDIR");
  jailName = name;
  QFile file;
  QString tmp;

  // Is VNET enabled?
  file.setFileName( JailDir + "/." + jailName + ".meta/vnet" );
  if ( file.exists() )
    checkVNET->setChecked(true);

  // Lets start loading IP addresses
  file.setFileName( JailDir + "/." + jailName + ".meta/ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv4->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/bridge-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIPBridge->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv4Bridge->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/defaultrouter-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIPRouter->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv4Router->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP6->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv6->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/bridge-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP6Bridge->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv6Bridge->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/defaultrouter-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP6Router->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv6Router->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv4Alias << stream.readLine();
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-bridge-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv4AliasBridge << stream.readLine();
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv6Alias << stream.readLine();
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-bridge-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv6AliasBridge << stream.readLine();
     file.close();
  }

  // Our buttons / slots
  connect( checkVNET, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv4, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv4Bridge, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv4Router, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv6, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv6Bridge, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv6Router, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );

  connect( comboIPType, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotComboIPChanged() ) );

  connect( pushSave, SIGNAL( clicked() ), this, SLOT( slotSaveClicked() ) );
  connect( pushCancel, SIGNAL( clicked() ), this, SLOT( slotCancelClicked() ) );
  connect( pushAdd, SIGNAL( clicked() ), this, SLOT( slotAddClicked() ) );
  connect( pushRemove, SIGNAL( clicked() ), this, SLOT( slotRemClicked() ) );

  slotCheckChecks();
  slotComboIPChanged();
  loadPerms();
}