Пример #1
0
MessageConfig::MessageConfig(QWidget *parent, void *_data)
        : MessageConfigBase(parent)
{
    CoreUserData *data = (CoreUserData*)_data;
    chkWindow->setChecked(data->OpenOnReceive);
    chkOnline->setChecked(data->OpenOnOnline);
    chkStatus->setChecked(data->LogStatus);
    edtPath->setDirMode(true);
    QString incoming = QFile::encodeName(data->IncomingPath ? user_file(data->IncomingPath).c_str() : "");
    edtPath->setText(incoming);
    connect(grpAccept, SIGNAL(clicked(int)), this, SLOT(acceptClicked(int)));
    switch (data->AcceptMode){
	case 0:
		btnDialog->setChecked(true);
		break;
	case 1:
		btnAccept->setChecked(true);
		break;
	case 2:
		btnDecline->setChecked(true);
		break;
	}
    chkOverwrite->setChecked(data->OverwriteFiles);
    if (data->DeclineMessage)
        edtDecline->setText(QString::fromUtf8(data->DeclineMessage));
    acceptClicked(data->AcceptMode);
}
Пример #2
0
DccAcceptDialog::DccAcceptDialog(DccBroker * br, DccDescriptor * dcc, const QString & text, const QString & capt)
    : QWidget(nullptr), DccDialog(br, dcc)
{
	setObjectName("dcc_accept_box");
	//QVBoxLayout * vb = new QVBoxLayout(this,4,4);
	QVBoxLayout * vb = new QVBoxLayout(this);
	vb->setMargin(4);
	vb->setSpacing(4);
	QLabel * l = new QLabel(text, this);
	l->setWordWrap(true);
	vb->addWidget(l);

	//QHBoxLayout *hb = new QHBoxLayout(4);
	QHBoxLayout * hb = new QHBoxLayout();
	hb->setSpacing(4);
	vb->addLayout(hb, Qt::AlignCenter);
	QPushButton * btn = new QPushButton(__tr2qs_ctx("&Accept", "dcc"), this);
	btn->setDefault(true);
	//btn->setFocus();
	hb->addWidget(btn);
	connect(btn, SIGNAL(clicked()), this, SLOT(acceptClicked()));
	btn = new QPushButton(__tr2qs_ctx("&Reject", "dcc"), this);
	connect(btn, SIGNAL(clicked()), this, SLOT(rejectClicked()));
	hb->addWidget(btn);

	setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DccMsg))));
	setWindowTitle(capt);

	l->activateWindow();
	l->setFocus();
}
Пример #3
0
FileConfig::FileConfig(QWidget *parent, void *_data)
        : QWidget( parent)
{
    setupUi( this);
    CoreUserData *data = (CoreUserData*)_data;
    edtPath->setDirMode(true);
    QString incoming = QFile::encodeName(data->IncomingPath.ptr ? user_file(data->IncomingPath.ptr).c_str() : "");
    edtPath->setText(incoming);
    connect(grpAccept, SIGNAL(clicked(int)), this, SLOT(acceptClicked(int)));
    switch (data->AcceptMode.value){
    case 0:
        btnDialog->setChecked(true);
        break;
    case 1:
        btnAccept->setChecked(true);
        break;
    case 2:
        btnDecline->setChecked(true);
        break;
    }
    chkOverwrite->setChecked(data->OverwriteFiles.bValue);
    if (data->DeclineMessage.ptr)
        edtDecline->setText(QString::fromUtf8(data->DeclineMessage.ptr));
    acceptClicked(data->AcceptMode.value);
}
Пример #4
0
QDialogButtons::QDialogButtons(QDialog *parent, bool autoConnect, Q_UINT32 buttons,
			       Orientation orient, const char *name ) : QWidget(parent, name)
{
    init(buttons, orient);
    if(parent && autoConnect) {
	QObject::connect(this, SIGNAL(acceptClicked()), parent, SLOT(accept()));
	QObject::connect(this, SIGNAL(rejectClicked()), parent, SLOT(reject()));
    }
}
Пример #5
0
UrlInputDialog::UrlInputDialog(QWidget* parent)
: QDialog(parent)
{
    setupUi(this);

    QPushButton* openFile = buttons->addButton("Open File...", QDialogButtonBox::ActionRole);

    connect(openFile, SIGNAL(clicked()), SLOT(openFileClicked()));
    connect(buttons, SIGNAL(accepted()), SLOT(acceptClicked()));
    connect(buttons, SIGNAL(rejected()), SLOT(rejectClicked()));
}
Пример #6
0
/*
 *  Constructs a snapDialogImpl which is a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
snapDialogImpl::snapDialogImpl(QWidget* parent,  const char* name, bool modal, Qt::WFlags fl)
    : Form1( parent, name, modal, fl )
{
    // defaults
    doSnap = true;
    snapSize = 10;

    CheckBoxSnap->setChecked(doSnap);
    LineEditDst->setText(QString::number((int)snapSize));
    SliderDst->setValue(snapSize);

    connect(PushButton1,SIGNAL(clicked()),this,SLOT(acceptClicked()));
    connect(PushButton2,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    connect(LineEditDst,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &)));
}
bool QDialogButtons::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: clicked((Button)(*((Button*)static_QUType_ptr.get(_o+1)))); break;
    case 1: acceptClicked(); break;
    case 2: rejectClicked(); break;
    case 3: helpClicked(); break;
    case 4: applyClicked(); break;
    case 5: allClicked(); break;
    case 6: retryClicked(); break;
    case 7: ignoreClicked(); break;
    case 8: abortClicked(); break;
    default:
	return QWidget::qt_emit(_id,_o);
    }
    return TRUE;
}
Пример #8
0
void
QDialogButtons::handleClicked()
{
    const QObject *s = sender();
    if(!s)
	return;

    for(QMapIterator<QDialogButtons::Button, QWidget *> it = d->buttons.begin(); it != d->buttons.end(); ++it) {
	if(it.data() == s) {
	    emit clicked((QDialogButtons::Button)it.key());
	    switch(it.key()) {
	    case Retry:
		emit retryClicked();
		break;
	    case Ignore:
		emit ignoreClicked();
		break;
	    case Abort:
		emit abortClicked();
		break;
	    case All:
		emit allClicked();
		break;
	    case Accept:
		emit acceptClicked();
		break;
	    case Reject:
		emit rejectClicked();
		break;
	    case Apply:
		emit applyClicked();
		break;
	    case Help:
		emit helpClicked();
		break;
	    default:
		break;
	    }
	    return;
	}
    }
}
Пример #9
0
SetPlayerDialogImpl::SetPlayerDialogImpl(Serie* current, QWidget *parent)
    : QDialog(parent),
      m_serie(current)
{
    ui.setupUi(this);
    
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
    
    QString actplayer = m_serie->getPlayer();
    Settings* settings = Settings::Instance();
    QListIterator<QPair<QString, QString> > it(settings->getPlayerList());
    int index = 0;
    while(it.hasNext()) 
    {
        QPair<QString, QString> pair = it.next();
        ui.playerBox->addItem(pair.first);
        if(pair.first == actplayer)
            ui.playerBox->setCurrentIndex(index);
        index++;
    }
}
Пример #10
0
//------------------------------------------------------------------------
AdvDlg::AdvDlg(QWidget* parent,
	       bool &synthShortNames,
	       bool &enableCharSetXform,
	       bool &previewGmap,
	       int  &debugLevel):
  QDialog(parent),
  synthShortNames(synthShortNames),
  enableCharSetXform(enableCharSetXform),
  previewGmap(previewGmap),
  debugLevel(debugLevel)
{
  ui.setupUi(this);
  ui.synthShortNames->setChecked(synthShortNames);
  ui.enableCharSetXform->setChecked(enableCharSetXform);
  ui.previewGmap->setChecked(previewGmap);
  ui.debugCombo->setCurrentIndex(debugLevel+1);
  ui.buttonBox->button(QDialogButtonBox::Ok)->setIcon(QIcon(":images/ok"));
  ui.buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":images/cancel"));
  connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
  connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejectClicked()));
}
Пример #11
0
Preferences::Preferences(QWidget* parent, QList<Format>& formatList,
                         BabelData& bd) : QDialog(parent),
  formatList_(formatList),
  bd_(bd)
{
  ui_.setupUi(this);

  ui_.startupCheck->setChecked(bd_.startupVersionCheck);
  ui_.reportStatisticsCheck->setChecked(bd_.reportStatistics);

  connect (ui_.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
  connect (ui_.buttonBox, SIGNAL(rejected()), this, SLOT(rejectClicked()));

  connect (ui_.enableAllButton, SIGNAL(clicked()), this, SLOT(enableAllClicked()));
  connect (ui_.disableAllButton, SIGNAL(clicked()), this, SLOT(disableAllClicked()));

  for (int i = 0; i < formatList_.size(); i++) {
    FormatListEntry *item = new FormatListEntry(formatList[i]);

    ui_.enabledFormatsList->addItem(item);
  }
}
Пример #12
0
void KviTopicWidget::switchMode()
{
	int iMaxLen=-1;
	QObject * w = parent();
	QString szModes;
	bool bCanEdit = true;
	while(w)
	{
		if(w->inherits("KviChannelWindow"))
		{
			KviChannelWindow *chan = ((KviChannelWindow *)w);
			iMaxLen = chan->connection()->serverInfo()->maxTopicLen();
			chan->getChannelModeString(szModes);
			if(chan->plainChannelMode().contains('t') &&
				!( chan->isMeHalfOp(true) ||
					chan->connection()->userInfo()->hasUserMode('o') ||
					chan->connection()->userInfo()->hasUserMode('O')
				)
			)
			{
				bCanEdit=false;
			}
			break;
		}
		w = w->parent();
	}
	if(m_pInput == 0)
	{
		m_pInput = new KviInputEditor(this,m_pKviChannelWindow);
		m_pInput->setObjectName("topicw_inputeditor");
		m_pInput->setReadOnly(!bCanEdit);
		if(iMaxLen>0)
			m_pInput->setMaxBufferSize(iMaxLen);
		m_pInput->setGeometry(0,0,width() - (height() << 2)+height(),height());
		m_pInput->setText(m_szTopic);
		connect(m_pInput,SIGNAL(enterPressed()),this,SLOT(acceptClicked()));
		connect(m_pInput,SIGNAL(escapePressed()),this,SLOT(discardClicked()));
		m_pInput->installEventFilter(this);

		m_pHistory = new QPushButton(this);
		m_pHistory->setObjectName("topicw_historybutton");
		m_pHistory->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::History))));
		m_pHistory->setGeometry(width() - (height() << 2)+height(),0,height(),height());
		KviTalToolTip::add(m_pHistory,__tr2qs("History"));
		m_pHistory->show();
		connect(m_pHistory,SIGNAL(clicked()),this,SLOT(historyClicked()));

		m_pAccept = new QPushButton(this);
		m_pAccept->setObjectName("topicw_acceptbutton");
		m_pAccept->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))));
		m_pAccept->setGeometry(width() - (height() << 1),0,height(),height());
		m_pAccept->setEnabled(bCanEdit);
		m_pAccept->show();
		KviTalToolTip::add(m_pAccept,__tr2qs("Commit changes"));
		connect(m_pAccept,SIGNAL(clicked()),this,SLOT(acceptClicked()));

		m_pDiscard = new QPushButton(this);
		m_pDiscard->setObjectName("topicw_discardbutton");
		m_pDiscard->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))));
		m_pDiscard->setGeometry(width() - height(),0,height(),height());
		KviTalToolTip::add(m_pDiscard,__tr2qs("Discard changes"));
		m_pDiscard->show();
		connect(m_pDiscard,SIGNAL(clicked()),this,SLOT(discardClicked()));

		m_pInput->home();
		m_pInput->show();
		m_pInput->setFocus();

		m_pLabel->hide();
	} else {
		deactivate();
	}
}
Пример #13
0
SettingsDialogImpl::SettingsDialogImpl(QWidget *parent)
 : QDialog(parent)
{
    ui.setupUi(this);
    
    //setup the whole ui from settings
    Settings* settings = Settings::Instance();
    
    connect(ui.sortCheckBox, SIGNAL(stateChanged(int)), this, SLOT(sortStateChanged(int)));
    if(settings->getSort() == true)
        ui.sortCheckBox->setCheckState(Qt::Checked);
    else
    {
        ui.sortCheckBox->setCheckState(Qt::Unchecked);
        ui.sortOngoingCheckBox->setEnabled(false);
        ui.sortPriorCheckBox->setEnabled(false);
        ui.sortPriorLabel->setEnabled(false);
    }
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
    
    if(settings->getOngoingSort() == true)
        ui.sortOngoingCheckBox->setCheckState(Qt::Checked);
    else
		ui.sortOngoingCheckBox->setCheckState(Qt::Unchecked);
    
    if(settings->getPriorSort() == true)
        ui.sortPriorCheckBox->setCheckState(Qt::Checked);
    else
        ui.sortPriorCheckBox->setCheckState(Qt::Unchecked);
    if(settings->getReloadSort() == true)
        ui.sortReloadCheckBox->setCheckState(Qt::Checked);
    else
        ui.sortReloadCheckBox->setCheckState(Qt::Unchecked);
    
    if(settings->getConvertNames() == true)
        ui.convertnamescheckbox->setCheckState(Qt::Checked);
    else
        ui.convertnamescheckbox->setCheckState(Qt::Unchecked);
    
    if(settings->getScanMedia() == true)
        ui.scanmediabox->setCheckState(Qt::Checked);
    else
        ui.scanmediabox->setCheckState(Qt::Unchecked);
    
    ui.opacitySpinbox->setValue(settings->getOpacity());

    // qDebug() << settings->getSort() << settings->getOngoingSort() << settings->getPriorSort();
    ui.tableWidget->setColumnWidth(0,300);
    ui.tableWidget->setColumnWidth(0,200);
    
    
    QTableWidgetItem* name = new QTableWidgetItem("Player");    
    ui.tableWidget->setHorizontalHeaderItem(0,name);
    QTableWidgetItem* args = new QTableWidgetItem("Args");    
    ui.tableWidget->setHorizontalHeaderItem(1,args);
    
    
    QList<QPair<QString, QString> > players = Settings::Instance()->getPlayerList();
    for(int i=0; i<players.size(); i++)
    {
        QTableWidgetItem* playeritem = new QTableWidgetItem( players.at(i).first );
        playeritem->setFlags(Qt::ItemIsEnabled);
	
        QTableWidgetItem* argitem = new QTableWidgetItem( players.at(i).second );
        //argitem->setFlags(Qt::ItemIsEnabled);
	
        int row = ui.tableWidget->rowCount();
        ui.tableWidget->insertRow(row);
        ui.tableWidget->setItem(row, 0, playeritem);
        ui.tableWidget->setItem(row, 1, argitem);
    }
    ui.settingsfilelabel->setText(Settings::Instance()->getSettingsFilename());
}