ScriptEditorWidgetColorOptions::ScriptEditorWidgetColorOptions(QWidget * pParent)
: QDialog(pParent)
{
	m_pSelectorInterfaceList = new KviPointerList<KviSelectorInterface>;
	m_pSelectorInterfaceList->setAutoDelete(false);
	setWindowTitle(__tr2qs_ctx("Preferences","editor"));
	QGridLayout * g = new QGridLayout(this);
	KviTalVBox * box = new KviTalVBox(this);
	g->addWidget(box,0,0);
	box->setMargin(0);
	box->setSpacing(0);
	KviFontSelector * f = new KviFontSelector(box,__tr2qs_ctx("Font:","editor"),&g_fntNormal,true);
	m_pSelectorInterfaceList->append(f);
	KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs_ctx("Colors","editor"),box);
	gbox->setInsideSpacing(0);

	addColorSelector(gbox,__tr2qs_ctx("Background:","editor"),&g_clrBackground,true);
	addColorSelector(gbox,__tr2qs_ctx("Normal text:","editor"),&g_clrNormalText,true);
	addColorSelector(gbox,__tr2qs_ctx("Brackets:","editor"),&g_clrBracket,true);
	addColorSelector(gbox,__tr2qs_ctx("Comments:","editor"),&g_clrComment,true);
	addColorSelector(gbox,__tr2qs_ctx("Functions:","editor"),&g_clrFunction,true);
	addColorSelector(gbox,__tr2qs_ctx("Keywords:","editor"),&g_clrKeyword,true);
	addColorSelector(gbox,__tr2qs_ctx("Variables:","editor"),&g_clrVariable,true);
	addColorSelector(gbox,__tr2qs_ctx("Punctuation:","editor"),&g_clrPunctuation,true);
	addColorSelector(gbox,__tr2qs_ctx("Find:","editor"),&g_clrFind,true);

	KviTalHBox * hbox = new KviTalHBox(box);

	QPushButton * b = new QPushButton(__tr2qs_ctx("OK","editor"),hbox);
	b->setDefault(true);
	connect(b,SIGNAL(clicked()),this,SLOT(okClicked()));

	b = new QPushButton(__tr2qs_ctx("Cancel","editor"),hbox);
	connect(b,SIGNAL(clicked()),this,SLOT(reject()));
}
OptionsWidget_privmsg::OptionsWidget_privmsg(QWidget * parent)
: KviOptionsWidget(parent)
{
	setObjectName("privmsg_options_widget");
	createLayout();

	KviTalGroupBox * g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("General","options"));

	addBoolSelector(g,__tr2qs_ctx("Show message icons","options"),KviOption_boolIrcViewShowImages);
	addBoolSelector(g,__tr2qs_ctx("Draw some emoticons (smileys) as pictures","options"),KviOption_boolDrawEmoticons);
	addBoolSelector(g,__tr2qs_ctx("Don't show colors in user messages","options"),KviOption_boolStripMircColorsInUserMessages);

	g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Nicknames","options"));

	m_pUseSmartColorSelector = addBoolSelector(g,__tr2qs_ctx("\"Smart\" nickname colors","options"),KviOption_boolColorNicks);

	KviTalHBox * hb = new KviTalHBox(g);
	hb->setSpacing(4);
	m_pSpecialSmartColorSelector = addBoolSelector(hb,__tr2qs_ctx("Use specified colors for own nick:","options"),KviOption_boolUseSpecifiedSmartColorForOwnNick,KVI_OPTION_BOOL(KviOption_boolColorNicks));

	m_pSmartColorSelector = addMircTextColorSelector(hb,"",KviOption_uintUserIrcViewOwnForeground,KviOption_uintUserIrcViewOwnBackground,KVI_OPTION_BOOL(KviOption_boolColorNicks) && KVI_OPTION_BOOL(KviOption_boolUseSpecifiedSmartColorForOwnNick));

	connect(m_pSpecialSmartColorSelector,SIGNAL(toggled(bool)),this,SLOT(enableDisableSmartColorSelector(bool)));
	connect(m_pUseSmartColorSelector,SIGNAL(toggled(bool)),m_pSpecialSmartColorSelector,SLOT(setEnabled(bool)));

	KviBoolSelector * b2 = addBoolSelector(g,__tr2qs_ctx("Use same colors as in the userlist","options"),KviOption_boolUseUserListColorsAsNickColors,!KVI_OPTION_BOOL(KviOption_boolColorNicks));
	connect(m_pUseSmartColorSelector,SIGNAL(toggled(bool)),b2,SLOT(setNotEnabled(bool)));

	addBoolSelector(g,__tr2qs_ctx("Show nicknames in bold","options"),KviOption_boolBoldedNicks);
	addBoolSelector(g,__tr2qs_ctx("Show user and host","options"),KviOption_boolShowUserAndHostInPrivmsgView);
	addBoolSelector(g,__tr2qs_ctx("Show channel mode prefix","options"),KviOption_boolShowChannelUserFlagInPrivmsgView);
	KviBoolSelector * b = addBoolSelector(g,__tr2qs_ctx("User-defined prefix and postfix","options"),KviOption_boolUseExtendedPrivmsgView);

	QLabel * l = addLabel(g,__tr2qs_ctx("[PREFIX]nickname[!user@host][POSTFIX] message","options"));

	l->setEnabled(KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView));
	connect(b,
		SIGNAL(toggled(bool)),
		l,
		SLOT(setEnabled(bool)));

	KviTalVBox * vb = new KviTalVBox(g);
	vb->setSpacing(5);

	connect(
		b,
		SIGNAL(toggled(bool)),
		addStringSelector(vb,__tr2qs_ctx("Prefix:","options"),KviOption_stringExtendedPrivmsgPrefix,KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)),
		SLOT(setEnabled(bool)));
	connect(
		b,
		SIGNAL(toggled(bool)),
		addStringSelector(vb,__tr2qs_ctx("Postfix:","options"),KviOption_stringExtendedPrivmsgPostfix,KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)),
		SLOT(setEnabled(bool)));
	addRowSpacer(0,3,0,3);
}
RegisteredUserPropertiesDialog::RegisteredUserPropertiesDialog(QWidget * p,KviPointerHashTable<QString,QString> * dict)
: QDialog(p)
{
	setObjectName("property_editor");
	setWindowModality(Qt::WindowModal);
	m_pPropertyDict = dict;

	setWindowTitle(__tr2qs_ctx("Property Editor","register"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));

	QGridLayout * g = new QGridLayout(this);

	m_pTable = new QTableWidget(this);
	//g->addMultiCellWidget(m_pTable,0,1,0,1);
	g->addWidget(m_pTable,0,0);
	m_pTable->setColumnCount(2);
	m_pTable->setSelectionMode(QAbstractItemView::SingleSelection);
	m_pTable->setSelectionBehavior(QAbstractItemView::SelectRows);

	QStringList header;
	header.append(__tr2qs_ctx("Property","register"));
	header.append(__tr2qs_ctx("Value","register"));
	m_pTable->setHorizontalHeaderLabels(header);

	m_pTable->setMinimumSize(250,250);
	//connect(m_pTable,SIGNAL(valueChanged(int,int)),this,SLOT(propertyValueChanged(int,int)));

	KviTalVBox * vb = new KviTalVBox(this);
	vb->setSpacing(4);
	g->addWidget(vb,0,1,0,3);

	m_pAddButton = new QPushButton(__tr2qs_ctx("&New","register"),vb);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pDelButton = new QPushButton(__tr2qs_ctx("&Remove","register"),vb);
	connect(m_pDelButton,SIGNAL(clicked()),this,SLOT(delClicked()));
	m_pDelButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));

	KviTalHBox * b = new KviTalHBox(this);
	b->setSpacing(4);
	//g->addMultiCellWidget(b,2,2,1,2);
	g->addWidget(b,1,1);
	QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK","register"),b);
	connect(pb,SIGNAL(clicked()),this,SLOT(okClicked()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));

	pb = new QPushButton(__tr2qs_ctx("Cancel","register"),b);
	connect(pb,SIGNAL(clicked()),this,SLOT(reject()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));

	g->setRowStretch(1,1);
	g->setColumnStretch(0,1);

	fillData();
}
Beispiel #4
0
KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircServersIniImport * f)
: KviTalWizard(0)
{
	QString capt = __tr2qs("Remote mIRC servers.ini - Import Wizard");
	setWindowTitle(capt);

	setModal(true);

	m_pRequest = 0;
	m_pFilter = f;

	QLabel * l = new QLabel(this);
	l->setWordWrap(true);
	l->setText(__tr2qs("<center><b>Welcome!</b><br><br>This wizard will guide you in the process of " \
			"downloading a list of IRC servers. Please click \"<b>Next</b>\" to begin the operation.</center>"));
	addPage(l,capt);


	KviTalVBox * vb = new KviTalVBox(this);
	l = new QLabel(vb);
	l->setWordWrap(true);
	l->setText(__tr2qs("<center>Here you can modify the URL that the list will be downloaded from. In most cases the default URL is acceptable.</center>"));

	vb->setStretchFactor(l,1);

	m_pUrlEdit = new QLineEdit(vb);
	m_pUrlEdit->setText(KVI_WWWMIRCCOUK_SERVERSINI);

	addPage(vb,__tr2qs("URL Selection"));

	vb = new KviTalVBox(this);

	l = new QLabel(__tr2qs("Please wait while the list is being downloaded"),vb);
	vb->setStretchFactor(l,1);

	m_pOutput = new QLabel(vb);
	m_pOutput->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);

	addPage(vb,__tr2qs("List Download"));

	setBackEnabled(vb,false);
	setNextEnabled(vb,false);
	setFinishEnabled(vb,true);

	connect(this,SIGNAL(pageChanged(const QString &)),this,SLOT(pageSelected(const QString &)));
}
Beispiel #5
0
RawEditorWidget::RawEditorWidget(QWidget * par)
: QWidget(par)
{
	setObjectName("raw_event_editor");
	QGridLayout * l = new QGridLayout(this);
	QSplitter * spl = new QSplitter(Qt::Horizontal,this);
	spl->setObjectName("raweditor_splitter");
	spl->setChildrenCollapsible(false);

	l->addWidget(spl,0,0);

	KviTalVBox * boxi = new KviTalVBox(spl);
	boxi->setMaximumWidth(200);
	m_pTreeWidget = new RawTreeWidget(boxi);



	m_pTreeWidget->setColumnCount(1);
	m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("RAW Event","editor"));

//	m_pTreeWidget->setMultiSelection(false);
	m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
//	m_pTreeWidget->setShowSortIndicator(true);
	m_pTreeWidget->setRootIsDecorated(true);
	m_pContextPopup = new QMenu(this);
	m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)));

	connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)),this,SLOT(customContextMenuRequested(const QPoint &)));

	QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...","editor"),boxi);
	connect(pb,SIGNAL(clicked()),this,SLOT(exportAllEvents()));

	KviTalVBox * box = new KviTalVBox(spl);
	m_pNameEditor = new QLineEdit(box);
	m_pNameEditor->setToolTip(__tr2qs_ctx("Edit the RAW event handler name.","editor"));
	m_pEditor = KviScriptEditor::createInstance(box);

	m_bOneTimeSetupDone = false;
	m_pLastEditedItem = 0;
}
EventEditor::EventEditor(QWidget * par)
: QWidget(par)
{
	setObjectName("event_editor");

	QGridLayout * l = new QGridLayout(this);

	QSplitter * spl = new QSplitter(Qt::Horizontal,this);
	spl->setChildrenCollapsible(false);

	l->addWidget(spl,0,0);

	KviTalVBox * vbox = new KviTalVBox(spl);
	vbox->setSpacing(0);
	vbox->setMargin(0);

	m_pTreeWidget = new EventEditorTreeWidget(vbox);

	QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All To...","editor"),vbox);
	connect(pb,SIGNAL(clicked()),this,SLOT(exportAllEvents()));

	KviTalVBox * box = new KviTalVBox(spl);
	spl->setStretchFactor (0,20);
	spl->setStretchFactor (1,80);

	box->setSpacing(0);
	box->setMargin(0);

	m_pNameEditor = new QLineEdit(box);
	m_pNameEditor->setToolTip(__tr2qs_ctx("Edit the event handler name.","editor"));

	m_pEditor = KviScriptEditor::createInstance(box);
	m_pEditor->setFocus();
	m_bOneTimeSetupDone = false;
	m_pLastEditedItem = 0;
}
Beispiel #7
0
ActionEditor::ActionEditor(QWidget * par)
: QWidget(par)
{

	QGridLayout * l = new QGridLayout(this);
	m_pSplitter = new QSplitter(Qt::Horizontal,this);
	m_pSplitter->setChildrenCollapsible(false);
	l->addWidget(m_pSplitter,0,0);


	KviTalVBox * box = new KviTalVBox(m_pSplitter);
	m_pTreeWidget = new ActionEditorTreeView(box);
	KviTalIconAndRichTextItemDelegate *itemDelegate=new KviTalIconAndRichTextItemDelegate(m_pTreeWidget);
	m_pTreeWidget->setItemDelegate(itemDelegate);
	//m_pTreeWidget->setShowSortIndicator(true);
	m_pTreeWidget->setFocusPolicy(Qt::StrongFocus);
	connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)));

	m_pNewActionButton = new QPushButton(__tr2qs_ctx("New Action","editor"),box);
	connect(m_pNewActionButton,SIGNAL(clicked()),this,SLOT(newAction()));

	m_pDeleteActionsButton = new QPushButton(__tr2qs_ctx("Delete Actions","editor"),box);
	connect(m_pDeleteActionsButton,SIGNAL(clicked()),this,SLOT(deleteActions()));

	m_pExportActionsButton = new QPushButton(__tr2qs_ctx("Export Actions...","editor"),box);
	connect(m_pExportActionsButton,SIGNAL(clicked()),this,SLOT(exportActions()));

	box->setSpacing(1);

	m_pSingleActionEditor = new SingleActionEditor(m_pSplitter,this);

	ActionEditorTreeWidgetItem * last = 0;
	ActionEditorTreeWidgetItem * first = 0;

	KviPointerHashTableIterator<QString,KviAction> it(*(KviActionManager::instance()->actions()));
	while(KviAction * a = it.current())
	{
		if(a->isKviUserActionNeverOverrideThis())
		{
			ActionData * ad = new ActionData(
					a->name(),
					((KviKvsUserAction *)a)->scriptCode(),
					((KviKvsUserAction *)a)->visibleNameCode(),
					((KviKvsUserAction *)a)->descriptionCode(),
					a->category() ? a->category()->name() : KviActionManager::categoryGeneric()->name(),
					a->bigIconId(),
					a->smallIconId(),
					a->flags(),
					a->keySequence(),
					0
				);
			ActionEditorTreeWidgetItem * lvi = new ActionEditorTreeWidgetItem(m_pTreeWidget,ad);
			ad->m_pItem = lvi;
			if(ad->m_szName == g_szLastEditedAction)
				last = lvi;
			if(!first)
				first = lvi;
		}
		++it;
	}

	if(!last)last = first; // try to sleect the first one then

	if(last)
	{
		m_pTreeWidget->setCurrentItem(last);
		currentItemChanged(last,last);
	} else {
		currentItemChanged(0,0);
	}

}
RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUser * r,bool bModal)
: KviTalTabDialog(p,"reguser_entry_editor",bModal)
{
	m_pUser = r;
	m_pCustomColor = new QColor();

	if(r)
	{
		QString col=r->getProperty("customColor");
		KviStringConversion::fromString(col,(*m_pCustomColor));
	}

	m_pPropertyDict = new KviPointerHashTable<QString,QString>(17,false);
	m_pPropertyDict->setAutoDelete(true);

	//setMinimumSize(400,450);

	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));
	setWindowTitle(__tr2qs_ctx("Registered User Entry","register"));

	QWidget * p1 = new QWidget(this);

	QGridLayout * g = new QGridLayout(p1);

	QLabel * l = new QLabel(__tr2qs_ctx("Name:","register"),p1);
	g->addWidget(l,0,0);

	m_pNameEdit = new QLineEdit(p1);
	g->addWidget(m_pNameEdit,0,1);

	l = new QLabel(__tr2qs_ctx("Comment:","register"),p1);
	g->addWidget(l,1,0);

	m_pCommentEdit = new QLineEdit(p1);
	g->addWidget(m_pCommentEdit,1,1);

	QFrame * f = new QFrame(p1);
	g->addWidget(f,2,0,1,2);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);

	l = new QLabel(__tr2qs_ctx("Masks:","register"),p1);
	g->addWidget(l,3,0,1,2);

	m_pMaskListBox = new QListWidget(p1);
	connect(m_pMaskListBox,SIGNAL(itemSelectionChanged()),this,SLOT(maskCurrentChanged()));
	m_pMaskListBox->setMinimumSize(300,200);

	g->addWidget(m_pMaskListBox,4,0,1,2);

	KviTalHBox * b = new KviTalHBox(p1);
	g->addWidget(b,5,0,1,2);
	b->setSpacing(4);

	m_pAddMaskButton = new QPushButton(__tr2qs_ctx("&Add...","register"),b);
	connect(m_pAddMaskButton,SIGNAL(clicked()),this,SLOT(addMaskClicked()));
	m_pAddMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pDelMaskButton = new QPushButton(__tr2qs_ctx("Re&move","register"),b);
	m_pDelMaskButton->setEnabled(false);
	connect(m_pDelMaskButton,SIGNAL(clicked()),this,SLOT(delMaskClicked()));
	m_pDelMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));

	m_pEditMaskButton = new QPushButton(__tr2qs_ctx("&Edit","register"),b);
	m_pEditMaskButton->setEnabled(false);
	connect(m_pEditMaskButton,SIGNAL(clicked()),this,SLOT(editMaskClicked()));
	m_pEditMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem)));

	g->setRowStretch(4,1);
	g->setColumnStretch(1,1);

	addTab(p1,__tr2qs_ctx("Identity","register"));

	QWidget * p2 = new QWidget(this);

	g = new QGridLayout(p2);

	m_pNotifyCheck = new QCheckBox(__tr2qs_ctx("Notify when user is online","register"),p2);
	g->addWidget(m_pNotifyCheck,0,0,1,3);

	m_pNotifyLabel = new QLabel(__tr2qs_ctx("Notify nicknames:","register"),p2);
	m_pNotifyLabel->setEnabled(m_pNotifyCheck->isChecked());
	g->addWidget(m_pNotifyLabel,1,0);
	m_pNotifyCheck->setToolTip(__tr2qs_ctx("<center>You can enter a space separated list of nicknames.</center>","register"));


	m_pNotifyNick = new QLineEdit(p2);
	m_pNotifyNick->setEnabled(false);

	g->addWidget(m_pNotifyNick,1,1,1,2);
	connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckClicked(bool)));


	f = new QFrame(p2);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	g->addWidget(f,2,0,1,3);

	m_pAvatar = 0;
	if(r)
	{
		const QString av = r->getProperty("avatar");
		if(!av.isEmpty())
		{
			m_pAvatar = new KviPixmap(av.toUtf8().data());
		}
	}
	if(!m_pAvatar)m_pAvatar = new KviPixmap();

	m_pAvatarSelector = new KviPixmapSelector(p2,__tr2qs_ctx("Avatar","register"),m_pAvatar,true);
	g->addWidget(m_pAvatarSelector,3,0,1,3);

	f = new QFrame(p2);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	g->addWidget(f,4,0,1,3);

	m_pCustomColorCheck = new QCheckBox(__tr2qs_ctx("Use custom color in userlist","register"),p2);
	if(r)
		m_pCustomColorCheck->setChecked(r->getBoolProperty("useCustomColor"));
	g->addWidget(m_pCustomColorCheck,5,0,1,2);

	m_pCustomColorSelector = new KviColorSelector(p2,QString(),m_pCustomColor,1);
	g->addWidget(m_pCustomColorSelector,5,2);

	QPushButton * pb = new QPushButton(__tr2qs_ctx("All Properties...","register"),p2);
	connect(pb,SIGNAL(clicked()),this,SLOT(editAllPropertiesClicked()));
	g->addWidget(pb,6,2);

	g->setColumnStretch(1,1);
	g->setRowStretch(3,1);

	addTab(p2,__tr2qs_ctx("Properties","register"));

	// Ignore TAB
	KviTalVBox * vb = new KviTalVBox(this);
	vb->setMargin(10);

	m_pIgnoreEnabled = new QCheckBox(__tr2qs_ctx("Enable ignore for this user","register"),vb);

	QGroupBox * gb = new QGroupBox(__tr2qs_ctx("Ignore features","register"),vb);
	connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),gb,SLOT(setEnabled(bool)));

	QVBoxLayout * layout = new QVBoxLayout(gb);
	layout->setMargin(20);
	layout->setSpacing(3);

	m_pIgnoreQuery = new QCheckBox(__tr2qs_ctx("Ignore query messages","register"),gb);
	layout->addWidget(m_pIgnoreQuery);

	m_pIgnoreChannel = new QCheckBox(__tr2qs_ctx("Ignore channel messages","register"),gb);
	layout->addWidget(m_pIgnoreChannel);

	m_pIgnoreNotice = new QCheckBox(__tr2qs_ctx("Ignore notice messages","register"),gb);
	layout->addWidget(m_pIgnoreNotice);

	m_pIgnoreCtcp = new QCheckBox(__tr2qs_ctx("Ignore CTCP messages","register"),gb);
	layout->addWidget(m_pIgnoreCtcp);

	m_pIgnoreInvite = new QCheckBox(__tr2qs_ctx("Ignore invites","register"),gb);
	layout->addWidget(m_pIgnoreInvite);

	m_pIgnoreDcc = new QCheckBox(__tr2qs_ctx("Ignore DCCs","register"),gb);
	layout->addWidget(m_pIgnoreDcc);

	QWidget *w = new QWidget(vb);
	w->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);

	addTab(vb,__tr2qs_ctx("Ignore","register"));

	setCancelButton(__tr2qs_ctx("Cancel","register"));
	setOkButton(__tr2qs_ctx("&OK","register"));
	connect(this,SIGNAL(applyButtonPressed()),this,SLOT(okClicked()));
	connect(this,SIGNAL(cancelButtonPressed()),this,SLOT(reject()));

	if(r)
	{
		m_pNameEdit->setText(r->name());
		m_pCommentEdit->setText(r->getProperty("comment"));
		for(KviIrcMask * m = r->maskList()->first();m;m = r->maskList()->next())
		{
			QString mk = m->nick();
			mk += QChar('!');
			mk += m->user();
			mk += QChar('@');
			mk += m->host();
			m_pMaskListBox->addItem(mk);
		}

		QString szNotifyNicks = r->getProperty("notify");
		if(!szNotifyNicks.isEmpty())
		{
			m_pNotifyCheck->setChecked(true);
			m_pNotifyNick->setText(szNotifyNicks);
			m_pNotifyNick->setEnabled(true);
		}

		if(r->propertyDict())
		{
			KviPointerHashTableIterator<QString,QString> it(*(r->propertyDict()));
			while(QString *s = it.current())
			{
				m_pPropertyDict->insert(it.currentKey(),new QString(*s));
				++it;
			}
		}

		m_pIgnoreEnabled->setChecked(r->ignoreEnagled());

		gb->setEnabled(r->ignoreEnagled());

		m_pIgnoreQuery->setChecked(r->ignoreFlags() & KviRegisteredUser::Query);
		m_pIgnoreChannel->setChecked(r->ignoreFlags() & KviRegisteredUser::Channel);
		m_pIgnoreNotice->setChecked(r->ignoreFlags() & KviRegisteredUser::Notice);
		m_pIgnoreCtcp->setChecked(r->ignoreFlags() & KviRegisteredUser::Ctcp);
		m_pIgnoreInvite->setChecked(r->ignoreFlags() & KviRegisteredUser::Invite);
		m_pIgnoreDcc->setChecked(r->ignoreFlags() & KviRegisteredUser::Dcc);
	} else {
		// default values
		if(!m_pIgnoreEnabled->isChecked())
		{
			gb->setEnabled(false);
		}
	}
}
Beispiel #9
0
DccVoiceWindow::DccVoiceWindow(DccDescriptor * dcc,const char * name)
    : DccWindow(KviWindow::DccVoice,name,dcc)
{
    m_pDescriptor = dcc;
    m_pSlaveThread = 0;

    m_pSplitter = new KviTalSplitter(Qt::Horizontal,this);
    m_pSplitter->setObjectName("dcc_window_splitter");
    m_pIrcView = new KviIrcView(m_pSplitter,this);

    m_pHBox = new KviTalHBox(this);

    KviTalVBox * vbox = new KviTalVBox(m_pHBox);

    m_pInputLabel = new QLabel(__tr2qs_ctx("Input buffer","dcc"),vbox);
    m_pInputLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    m_pOutputLabel = new QLabel(__tr2qs_ctx("Output buffer","dcc"),vbox);
    m_pOutputLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    vbox->setSpacing(1);

    KviTalVBox * vbox2 = new KviTalVBox(m_pHBox);

    m_pRecordingLabel = new QLabel(vbox2);
    m_pRecordingLabel->setPixmap(*(g_pIconManager->getSmallIcon(KviIconManager::Record)));
    m_pRecordingLabel->setEnabled(false);
    m_pRecordingLabel->setFrameStyle(QFrame::Raised | QFrame::Panel);

    m_pPlayingLabel = new QLabel(vbox2);
    m_pPlayingLabel->setPixmap(*(g_pIconManager->getSmallIcon(KviIconManager::Play)));
    m_pPlayingLabel->setEnabled(false);
    m_pPlayingLabel->setFrameStyle(QFrame::Raised | QFrame::Panel);

    vbox2->setSpacing(1);

    //#warning "The volume slider should be enabled only when receiving data"
    //m_pVolumeSlider = new QSlider(-100, 0, 10, 0, Qt::Vertical, m_pHBox, "dcc_voice_volume_slider");
    m_pVolumeSlider = new QSlider(Qt::Vertical,m_pHBox);
    m_pVolumeSlider->setObjectName("dcc_voice_volume_slider");
    m_pVolumeSlider->setMinimum(-100);
    m_pVolumeSlider->setMaximum(0);
    m_pVolumeSlider->setPageStep(10);
    m_pVolumeSlider->setValue(0);

    m_pVolumeSlider->setValue(getMixerVolume());
    /* Update the tooltip */
    setMixerVolume(m_pVolumeSlider->value());
    m_pVolumeSlider->setMaximumWidth(16);
    m_pVolumeSlider->setMaximumHeight(2*m_pPlayingLabel->height());
    connect(m_pVolumeSlider, SIGNAL(valueChanged(int)), this, SLOT(setMixerVolume(int)));

    m_pTalkButton = new QToolButton(m_pHBox);
    m_pTalkButton->setEnabled(false);
    m_pTalkButton->setCheckable(true);
    QIcon iset;
    iset.addPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)),QIcon::Normal,QIcon::Off);
    iset.addPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED)),QIcon::Normal,QIcon::On);
    m_pTalkButton->setIcon(iset);
    m_pTalkButton->setIconSize(QSize(32,32));
    connect(m_pTalkButton,SIGNAL(toggled(bool)),this,SLOT(startOrStopTalking(bool)));

    m_pHBox->setStretchFactor(vbox,1);
    m_pHBox->setMargin(2);
    m_pHBox->setSpacing(1);

    //setFocusHandler(m_pIrcView,this);

    m_pMarshal = new DccMarshal(this);
    connect(m_pMarshal,SIGNAL(error(KviError::Code)),this,SLOT(handleMarshalError(KviError::Code)));
    connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected()));
    connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress()));

    m_pUpdateTimer = new QTimer();

    startConnection();
}
Beispiel #10
0
OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal)
    : QDialog(par)
{
    setObjectName("general_options_dialog");

    setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::KVIrc)));

    m_szGroup = szGroup;

    QString szDialogTitle;

    if(szGroup.isEmpty() || KviQString::equalCI(szGroup,"general"))
    {
        szDialogTitle = __tr2qs_ctx("General Preferences","options");
    } else if(KviQString::equalCI(szGroup,"theme"))
    {
        szDialogTitle = __tr2qs_ctx("Theme Preferences","options");
    } else {
        szDialogTitle = __tr2qs_ctx("KVIrc Preferences","options");
    }

    QString szDialog = __tr2qs_ctx("This dialog contains a set of KVIrc settings.<br> Use the icons " \
                                   "on the left to navigate through the option pages. The text box in the " \
                                   "bottom left corner is a small search engine. It will highlight the " \
                                   "pages that contain options related to the search term you have entered.","options");


    QString szInfoTips;
    szInfoTips = __tr2qs_ctx("Many settings have tooltips that can be shown by holding " \
                             "the cursor over their label for a few seconds.","options");

    QString szOkCancelButtons = __tr2qs_ctx("When you have finished, click \"<b>OK</b>\" to accept your changes " \
                                            "or \"<b>Cancel</b>\" to discard them. Clicking \"<b>Apply</b>\" will commit your " \
                                            "changes without closing the window.","options");

    QString szFrontText = QString(
                              "<table width=\"100%\" height=\"100%\" valign=\"top\" align=\"center\" cellpadding=\"4\">" \
                              "<tr>" \
                              "<td bgcolor=\"#303030\" valign=\"top\">" \
                              "<center><h1><font color=\"#FFFFFF\">%1</font></h1></center>" \
                              "</td>" \
                              "</tr>" \
                              "<tr>" \
                              "<td valign=\"bottom\">" \
                              "<p>" \
                              "%2" \
                              "</p>" \
                              "<br style=\"line-height:5px;\"/>" \
                              "<p>" \
                              "%3" \
                              "</p>" \
                              "<br style=\"line-height:5px;\"/>" \
                              "<p>" \
                              "%4" \
                              "</p>" \
                              "</td>" \
                              "</tr>" \
                              "</table>"
                          ).arg(szDialogTitle, szDialog, szInfoTips, szOkCancelButtons);

    QString szCaption = szDialogTitle + " - KVIrc";
    setWindowTitle(szCaption);

    QGridLayout * g1 = new QGridLayout(this);
    QSplitter * spl = new QSplitter(Qt::Horizontal,this);
    spl->setChildrenCollapsible(false);

    g1->addWidget(spl,0,0,1,5);

    KviTalVBox * vbox = new KviTalVBox(spl);
    vbox->setSpacing(2);
    vbox->setMargin(3);

    // Controlling list view
    m_pTreeWidget = new QTreeWidget(vbox);

    m_pTreeWidget->header()->hide();
    m_pTreeWidget->setRootIsDecorated(true);
    m_pTreeWidget->setSortingEnabled(false);
    m_pTreeWidget->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
    m_pTreeWidget->setCurrentItem(NULL);

    connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem *)),this,SLOT(treeWidgetItemSelectionChanged(QTreeWidgetItem *, QTreeWidgetItem *)));

    KviTalHBox * hbox = new KviTalHBox(vbox);
    hbox->setSpacing(2);
    hbox->setMargin(3);

    m_pSearchLineEdit = new QLineEdit(hbox);
    connect(m_pSearchLineEdit,SIGNAL(returnPressed()),this,SLOT(searchClicked()));
    m_pSearchButton = new QToolButton(hbox);
    m_pSearchButton->setIconSize(QSize(16,16));
    m_pSearchButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Search)));
    connect(m_pSearchButton,SIGNAL(clicked()),this,SLOT(searchClicked()));
    connect(m_pSearchLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(searchLineEditTextChanged(const QString &)));

    QString szTip = __tr2qs_ctx("<p>This is the search tool for this options dialog.</p>" \
                                "<p>You can enter a search term either in your native " \
                                "language or in English and press the button on the right. " \
                                "The pages that contain some options related to the " \
                                "search term will be highlighted and you will be able " \
                                "to quickly find them.</p><p>Try \"nickname\" for example.</p>","options");
    KviTalToolTip::add(m_pSearchLineEdit,szTip);
    KviTalToolTip::add(m_pSearchButton,szTip);

    vbox = new KviTalVBox(spl);
    vbox->setSpacing(2);
    vbox->setMargin(3);

    m_pCategoryLabel = new QLabel("<b>&nbsp;</b>",vbox);
    m_pCategoryLabel->setObjectName("labgeneraloptions");

    QFrame * f = new QFrame(vbox);
    f->setFrameStyle(QFrame::HLine | QFrame::Sunken);

    // Widget stack
    m_pWidgetStack = new QStackedWidget(vbox);
    vbox->setStretchFactor(m_pWidgetStack,1);

    // First widget visible
    m_pFrontWidget = new OptionsDialogFrontWidget(m_pWidgetStack,szFrontText);
    m_pWidgetStack->addWidget(m_pFrontWidget);

    int idx = m_pWidgetStack->indexOf(m_pFrontWidget);
    m_pWidgetStack->widget(idx)->raise();

    //  Ok,Cancel,Help
    QPushButton * b = new QPushButton(__tr2qs_ctx("&OK","options"),this);
    b->setObjectName("btnok");
    KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, accepting all changes.","options"));
    connect(b,SIGNAL(clicked()),this,SLOT(okClicked()));
    //b->setMinimumWidth(whatIsThisWidth);
    b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
    g1->addWidget(b,1,2);

    b = new QPushButton(__tr2qs_ctx("&Apply","options"),this);
    b->setObjectName("btnapply");
    KviTalToolTip::add(b,__tr2qs_ctx("Commit all changes immediately.","options"));
    connect(b,SIGNAL(clicked()),this,SLOT(applyClicked()));
    b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
    g1->addWidget(b,1,3);

    b = new QPushButton(__tr2qs_ctx("Cancel","options"),this);
    b->setObjectName("btncancel");
    KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, discarding all changes.","options"));
    b->setDefault(true);
    //b->setMinimumWidth(whatIsThisWidth);
    connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
    g1->addWidget(b,1,4);

    g1->setRowStretch(0,1);
    g1->setColumnStretch(1,1);


    fillTreeWidget(0,g_pOptionsInstanceManager->instanceEntryTree(),szGroup);

    if(!parent())
    {
        if(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y() < 5)
            KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).setY(5);

        //setGeometry(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry));
        resize(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).width(),
               KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).height());
        move(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).x(),
             KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y());
    }

    new QShortcut(Qt::Key_Escape,this,SLOT(close()));

    if(bModal)
        setWindowModality(par ? Qt::WindowModal : Qt::ApplicationModal);
}
RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par)
: QWidget(par)
{
	g_pRegisteredUsersDialog = this;

	g_pLocalRegisteredUserDataBase = new KviRegisteredUserDataBase();
	g_pLocalRegisteredUserDataBase->copyFrom(g_pRegisteredUserDataBase);

	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::RegUsers)));
	setWindowTitle(__tr2qs_ctx("Registered Users - KVIrc","register"));

	QGridLayout * g = new QGridLayout(this);


	m_pListView = new KviRegisteredUsersListView(this);
	m_pListView->setItemDelegate(new RegisteredUsersDialogItemDelegate());

	connect(m_pListView,SIGNAL(itemPressed(QTreeWidgetItem *,int)),this,SLOT(itemPressed(QTreeWidgetItem *,int)));
	connect(m_pListView,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *, int)));

	g->addWidget(m_pListView,0,0,2,2);

	KviTalVBox * vbox = new KviTalVBox(this);
	vbox->setSpacing(4);
	g->addWidget(vbox,0,2);

	m_pWizardAddButton = new QPushButton(__tr2qs_ctx("Add (Wizard)...","register"),vbox);
	connect(m_pWizardAddButton,SIGNAL(clicked()),this,SLOT(addWizardClicked()));
	m_pWizardAddButton->setToolTip(__tr2qs_ctx("Add a registered user by means of a user-friendly wizard.","register"));
	m_pWizardAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItemByWizard)));


	m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","register"),vbox);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pAddButton->setToolTip(__tr2qs_ctx("Open the edit dialog to create a new user entry.","register"));
	m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pAddGroupButton = new QPushButton(__tr2qs_ctx("&Add Group...","register"),vbox);
	connect(m_pAddGroupButton,SIGNAL(clicked()),this,SLOT(addGroupClicked()));
	m_pAddGroupButton->setToolTip(__tr2qs_ctx("Adds a new group","register"));
	m_pAddGroupButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","register"),vbox);
	connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked()));
	m_pRemoveButton->setEnabled(false);
	m_pRemoveButton->setToolTip(__tr2qs_ctx("Remove the currently selected entries.","register"));
	m_pRemoveButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));


	m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit...","register"),vbox);
	connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked()));
	m_pEditButton->setEnabled(false);
	m_pEditButton->setToolTip(__tr2qs_ctx("Edit the first selected entry.","register"));
	m_pEditButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem)));

	QFrame * f = new QFrame(vbox);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);

	m_pSelectAllButton = new QPushButton(__tr2qs_ctx("Select all","register"),vbox);
	connect(m_pSelectAllButton,SIGNAL(clicked()),this,SLOT(selectAllClicked()));
	m_pSelectAllButton->setToolTip(__tr2qs_ctx("Select all the entries","register"));
	m_pSelectAllButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Plus)));

	m_pExportButton = new QPushButton(__tr2qs_ctx("Export To...","register"),vbox);
	m_pExportButton->setEnabled(false);
	connect(m_pExportButton,SIGNAL(clicked()),this,SLOT(exportClicked()));
	m_pExportButton->setToolTip(__tr2qs_ctx("Export the selected entries to a file.<br>All the data associated with the selected registered users will be exported.<br>You (or anyone else) can later import the entries by using the \"Import\" button.","register"));
	m_pExportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Floppy)));


	m_pImportButton = new QPushButton(__tr2qs_ctx("Import From...","register"),vbox);
	connect(m_pImportButton,SIGNAL(clicked()),this,SLOT(importClicked()));
	m_pImportButton->setToolTip(__tr2qs_ctx("Import entries from a file exported earlier by the \"export\" function of this dialog.","register"));
	m_pImportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Folder)));


	KviTalHBox * hbox = new KviTalHBox(this);
	hbox->setSpacing(4);
	g->addWidget(hbox,3,1,1,2);

	QPushButton * b;


	b = new QPushButton(__tr2qs_ctx("&OK","register"),hbox);
	connect(b,SIGNAL(clicked()),this,SLOT(okClicked()));
	b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	//b->setMinimumWidth(120);

	b = new QPushButton(__tr2qs_ctx("Cancel","register"),hbox);
	connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked()));
	b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
	//b->setMinimumWidth(120);

	g->addItem(new QSpacerItem(0, 15), 2, 0);
	g->setColumnStretch(0,1);
	g->setRowStretch(1,1);

	connect(m_pListView,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged()));
	connect(m_pListView,SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)),this,SLOT(rightButtonPressed(QTreeWidgetItem *, QPoint)));

	new QShortcut(Qt::Key_Escape, this, SLOT(cancelClicked()));

	fillList();

	if(!parent())
	{
		if(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).y() < 5)
			KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).setY(5);

		//setGeometry(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry));
		resize(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width(),
			KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height());

		QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow);
		move(rect.x() + ((rect.width() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width())/2),rect.y() + ((rect.height() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height())/2));

	}
}