StocksDialog::StocksDialog (QString p, DbPlugin *d, DBIndex *i) : Q3TabDialog (0, "StocksDialog", TRUE)
{
    helpFile = p;
    db = d;
    index = i;
    reloadFlag = FALSE;
    currentDate = QDateTime::currentDateTime();

    setCaption(tr("Qtstalker: Edit Stock"));

    QString s;
    d->getSymbol(s);
    QFileInfo fi(s);
    symbol = fi.fileName();

    createDetailsPage();
    createDataPage();
    createFundamentalsPage();
    createSplitPage();

    setOkButton(tr("&OK"));
    setCancelButton(tr("&Cancel"));
    connect(this, SIGNAL(applyButtonPressed()), this, SLOT(saveChart()));

    setHelpButton();
    QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));

    RcFile rcfile;
    QSize sz;
    rcfile.loadSize(RcFile::EditStockWindowSize, sz);
    resize(sz);
}
Preferences::Preferences(QWidget *w) : Q3TabDialog(w, "Preferences", FALSE, Qt::WDestructiveClose)
{
  helpFile = "preferences.html";

  setCaption(tr("Edit Prefs"));

  loadSettings();
  createGeneralPage();
  createColorPage();
  createFontPage();
  createMTPage(); // main tool bar
  createCTPage(); // chart tool bar
  createETPage(); // extra tool bar

  setApplyButton(tr("&Apply"));
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(slotSave()));

  setCancelButton(tr("&Ok"));
  //connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog()));

  setOkButton(QString::null);

  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp()));
  resize(sz);

}
Beispiel #3
0
TabDialog::TabDialog( QWidget *parent, const char *name, const QString &_filename )
    : QTabDialog( parent, name ), filename( _filename ), fileinfo( filename )
{
    setupTab1();
    setupTab2();
    setupTab3();

    connect( this, SIGNAL( applyButtonPressed() ), qApp, SLOT( quit() ) );
}
ZLQtOptionsDialog::ZLQtOptionsDialog(const ZLResource &resource, shared_ptr<ZLRunnable> applyAction, bool showApplyButton) : QTabDialog(0, 0, true), ZLDesktopOptionsDialog(resource, applyAction) {
	setCaption(::qtString(ZLOptionsDialog::caption()));
	setOkButton(::qtButtonName(ZLDialogManager::OK_BUTTON));
	setHelpButton(::qtButtonName(ZLDialogManager::CANCEL_BUTTON));
	connect(this, SIGNAL(helpButtonPressed()), this, SLOT(reject()));
	if (showApplyButton) {
		setApplyButton(::qtButtonName(ZLDialogManager::APPLY_BUTTON));
		connect(this, SIGNAL(applyButtonPressed()), this, SLOT(apply()));
	}
}
Beispiel #5
0
TabDialog::TabDialog( QWidget *parent, const char *name )
    : QTabDialog( parent, name )
{
  setupTab5();
  
  QDialog::resize(350,380);
  setApplyButton("&Apply");

  connect( this, SIGNAL( defaultButtonPressed() ), this, SLOT( ok() ) );
  connect( this, SIGNAL( applyButtonPressed() ), this, SLOT( apply() ) );
}
Beispiel #6
0
ImageWindow::ImageWindow(QApplication* app, QWidget *parent) : KDialog(parent)
{
	m_app = app;
	m_browser = new BrowseWidget(this);

	setCaption("decKreator");
	setButtons(KDialog::Apply | KDialog::Cancel);
	enableButton(KDialog::Apply, false);
        
	this->setMainWidget(m_browser);
        connect(this, SIGNAL(applyClicked()), this, SLOT(applyButtonPressed()));
        connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelButtonPressed()));
	connect(m_browser, SIGNAL(nameChanged()), this, SLOT(enableApply()));
}
bool QTabDialog::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: aboutToShow(); break;
    case 1: applyButtonPressed(); break;
    case 2: cancelButtonPressed(); break;
    case 3: defaultButtonPressed(); break;
    case 4: helpButtonPressed(); break;
    case 5: currentChanged((QWidget*)static_QUType_ptr.get(_o+1)); break;
    case 6: selected((const QString&)static_QUType_QString.get(_o+1)); break;
    default:
	return QDialog::qt_emit(_id,_o);
    }
    return TRUE;
}
Beispiel #8
0
KfOptions::KfOptions( QWidget *parent, const char *name ):QTabDialog( parent, name) 
  {
    resize(400,330);
    insertPages();

    setOKButton( i18n("OK"));
    setCancelButton( i18n("Cancel"));
    setCaption(i18n("Preferences"));
    
    this->setMinimumSize(400,330);
    this->setMaximumSize(400,330);
 
    connect(this,SIGNAL(applyButtonPressed()),this,SLOT(applyChanges()));
 
  };
Beispiel #9
0
//***********************************************
Options::Options( QWidget *parent, const char *name)
    : Q3TabDialog( parent, name)
{

  setCaption("Settings");

  set_general();
  set_directories();
  set_logedit();
  set_interpreter();

  connect( this, SIGNAL( applyButtonPressed() ), SLOT( apply() ) );
  setDefaultButton();
  connect( this, SIGNAL( defaultButtonPressed() ), SLOT( defaults() ) );
  setCancelButton();
  set_settings();

}
AppTabDialog::AppTabDialog( QWidget *p_parent, const QString &captionKey,
        const char *p_name, const QString &acceptKey, const QString &rejectKey ) :
    QTabDialog( p_parent, p_name, true,
        WStyle_Customize |          // Use following flags
        WStyle_SysMenu |            // System menu in upper left
        WStyle_Title |              // Window title
        WStyle_MinMax |             // Min/max in system menu
        WStyle_Dialog |             // Modal toplevel window
        WStyle_NormalBorder ),      // Resizeable corners
    m_contextMenu(0)
{
    // Set the dialog caption
    QString l_caption("");
    translate( l_caption, captionKey );
    setCaption( appWindow()->m_program + " "
              + appWindow()->m_version + " " + l_caption );

    // Add the standard QTabDialog Ok button.
    QString text("");
    translate( text, acceptKey );
    setOkButton( text );
    connect( this, SIGNAL( applyButtonPressed() ),
             this, SLOT( store() ) );

    // Optionally add the QTabDialog cancel button.
    if ( ! rejectKey.isNull() && ! rejectKey.isEmpty() )
    {
        translate( text, rejectKey );
        setCancelButton( text );
        connect( this, SIGNAL( cancelButtonPressed() ),
                 this, SLOT( reject() ) );
    }
    // Create the context menu.
    m_contextMenu = new QPopupMenu( this, "m_contextMenu" );
    Q_CHECK_PTR( m_contextMenu );
    translate( text, "AppDialog:ContextMenu:Print" );
    int mid = m_contextMenu->insertItem( text );
    m_contextMenu->setItemParameter( mid, ContextPrintDialog );
    return;
}
Beispiel #11
0
/**
 * Constructs the dialog.
 */
SettingsDialog::SettingsDialog(int tabIndex, QWidget* parent,
                               const char* name, bool modal,
                               WFlags fl)
    : QTabDialog(parent, name, modal, fl)
{
    setCaption(tr("Settings"));
    setApplyButton(tr("Apply"));
    setCancelButton(tr("Cancel"));
    setOkButton(tr("OK"));
    setHelpButton(tr("Help"));

    this->addTab(createGeneralTab(), tr("General"));
    this->addTab(createPathTab(), tr("Paths"));
    this->addTab(createDownloadTab(), tr("Download"));
    setup();

    if (tabIndex >= 0 && tabIndex < tabBar()->count()) {
        tabBar()->setCurrentTab(tabIndex);
    }

    resize(sizeHint());//resize(400, 400);

    connect(this, SIGNAL(applyButtonPressed()), this, SLOT(applySettings()));
}
FuturesDialog::FuturesDialog (QString p, DbPlugin *d, DBIndex *i) : Q3TabDialog (0, "FuturesDialog", TRUE)
{
  helpFile = p;
  db = d;
  index = i;
  reloadFlag = FALSE;
  currentDate = QDateTime::currentDateTime();

  setCaption(tr("Qtstalker: Edit Futures"));

  QString s;
  d->getSymbol(s);
  QFileInfo fi(s);
  symbol = fi.fileName();

  createDetailsPage();
  createDataPage();

  setOkButton(tr("&OK"));
  setCancelButton(tr("&Cancel"));
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(saveChart()));
  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));
}
Beispiel #13
0
ConfigDlg::ConfigDlg(QWidget *parent, const char *name,
		     KApplication *mykapp, DefStruct *defstruct)
  : QDialog(parent, name)
{

  mykapp = kapp;
  defst = defstruct;

  box = new QGroupBox(this, "box");
  box->setGeometry(10,10,320,260);
  box->setTitle(i18n("Defaults"));

  label1 = new QLabel(this);
  label1->setGeometry(20,30,135,25);
  label1->setText(klocale->translate("Text Color:"));

  qframe1 = new QFrame(this);
  qframe1->setGeometry(155,30,30,25);	
  qframe1->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
  qframe1->setBackgroundColor(defst->forecolor);

  button1 = new QPushButton(this);
  button1->setGeometry(205,30,100,25);
  button1->setText(klocale->translate("Change"));
  connect(button1,SIGNAL(clicked()),this,SLOT(set_fore_color()));

  label2 = new QLabel(this);
  label2->setGeometry(20,65,135,25);
  label2->setText(klocale->translate("Background Color:"));

  qframe2 = new QFrame(this);
  qframe2->setGeometry(155,65,30,25);	
  qframe2->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
  qframe2->setBackgroundColor(defst->backcolor);

  button2 = new QPushButton(this);
  button2->setGeometry(205,65,100,25);
  button2->setText(klocale->translate("Change"));
  connect(button2,SIGNAL(clicked()),this,SLOT(set_background_color()));

  /*  button3 = new QPushButton(this);
  button3->setGeometry(255,240,70,25);
  button3->setText(klocale->translate("Help"));
  connect(button3,SIGNAL(clicked()),this,SLOT(help()));
  */
  label5 = new QLabel(this);
  label5->setGeometry(20,105,50,25);
  label5->setText(klocale->translate("Width:"));

  width = new KIntLineEdit(this);
  width->setGeometry(70,105,60,23);
  QString string;
  string.setNum(defst->width);
  width->setText(string);

  label6 = new QLabel(this);
  label6->setGeometry(20,145,50,25);
  label6->setText(klocale->translate("Height:"));

  height = new KIntLineEdit(this);
  height->setGeometry(70,145,60,23);

  QString string2;
  string2.setNum(defst->height);
  height->setText(string2);
  
  label7 = new QLabel(this);
  label7->setGeometry(20,185,100,25);
  label7->setText(klocale->translate("Print Command:"));

  print = new QLineEdit(this);
  print->setGeometry(130,185,180,23);
  print->setText(defst->printcommand.data());

  label8 = new QLabel(this);
  label8->setGeometry(20,225,100,25);
  label8->setText(klocale->translate("Mail Command:"));

  mail = new QLineEdit(this);
  mail->setGeometry(130,225,180,23);
  mail->setText(defst->mailcommand.data());

  QGroupBox *gbox;

  gbox = new QGroupBox(this);
  gbox->setGeometry(150,105,160,65);

  check1 = new QCheckBox( klocale->translate("3d Frame"), gbox );
  check1->setGeometry( 10, 5, 100, 25 );
  check1->setChecked( defst->frame3d );
  connect( check1, SIGNAL( toggled( bool ) ), SLOT( frame3d_slot( bool ) ) );

  check2 = new QCheckBox( klocale->translate("Auto Indent"), gbox );
  check2->setGeometry( 10, 35, 130, 25 );
  check2->setChecked( defst->autoindent );
  connect( check2, SIGNAL( toggled( bool ) ), SLOT( indent_slot( bool ) ) );

  connect(parent,SIGNAL(applyButtonPressed()),SLOT(okButton()));

}
Beispiel #14
0
FontDlg::FontDlg(QWidget *parent, const char *name,
		     KApplication *mykapp,DefStruct *defstruct)
  : QDialog(parent, name)
{

  mykapp = kapp;
  defst = defstruct;

  box = new QGroupBox(this, "box");
  box->setGeometry(10,10,320,260);
  box->setTitle(klocale->translate("Set Default Font"));

  button = new QPushButton(this);
  button->setGeometry(235,225,80,25);
  button->setText(klocale->translate("Change"));
  connect(button,SIGNAL(clicked()),this,SLOT(setFont()));

  familylabel = new QLabel(this);
  familylabel->setGeometry(20,65,135,25);
  familylabel->setText(klocale->translate("Family:"));

  familylabeldisp = new QLabel(this);
  familylabeldisp->setGeometry(130,65,150,25);	
  familylabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
  familylabeldisp->setText(defst->font.family());


  sizelabel = new QLabel(this);
  sizelabel->setGeometry(20,105,100,25);
  sizelabel->setText(klocale->translate("Point Size:"));

  sizelabeldisp = new QLabel(this);
  sizelabeldisp->setGeometry(130,105,60,25);	
  sizelabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
  QString size;
  size.setNum(defst->font.pointSize());
  sizelabeldisp->setText(size);

  stylelabel = new QLabel(this);
  stylelabel->setGeometry(20,140,80,25);
  stylelabel->setText(klocale->translate("Style:"));

  stylelabeldisp = new QLabel(this);
  stylelabeldisp->setGeometry(130,145,80,23);
  stylelabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
  if(defst->font.italic())
    stylelabeldisp->setText(klocale->translate("Italic"));
  else
    stylelabeldisp->setText(klocale->translate("Roman"));

  weightlabel = new QLabel(this);
  weightlabel->setGeometry(20,180,80,25);
  weightlabel->setText(klocale->translate("Weight:"));

  weightlabeldisp = new QLabel(this);
  weightlabeldisp->setGeometry(130,185,80,23);
  weightlabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
  if(defst->font.bold())
    weightlabeldisp->setText(klocale->translate("Bold"));
  else
    weightlabeldisp->setText(klocale->translate("Normal"));

  connect(parent,SIGNAL(applyButtonPressed()),SLOT(okButton()));

}
Beispiel #15
0
Scanner::Scanner (QString n, DBIndex *i) : QTabDialog (0, 0, FALSE)
{
  chartIndex = i;
  scannerName = n;
  
  QString s = "Qtstalker Scanner";
  s.append(": ");
  s.append(scannerName);
  setCaption (s);

  QWidget *w = new QWidget(this);
  
  QVBoxLayout *vbox = new QVBoxLayout(w);
  vbox->setMargin(5);
  vbox->setSpacing(5);
  
  QHGroupBox *gbox = new QHGroupBox(tr("Symbol Selection"), w);  
  vbox->addWidget(gbox);

  allSymbols = new QCheckBox(tr("All symbols"), gbox);
  connect(allSymbols, SIGNAL(toggled(bool)), this, SLOT(allSymbolsToggled(bool)));

  fileButton = new QPushButton(tr("0 Symbols"), gbox);
  connect(fileButton, SIGNAL(clicked()), this, SLOT(getSymbols()));

  basePath = new QComboBox(gbox);
  basePath->insertItem(tr("Chart"), -1);
  basePath->insertItem(tr("Group"), -1);

  QGridLayout *grid = new QGridLayout(vbox, 1, 2);
  grid->setColStretch(1, 1);

  QLabel *label = new QLabel(tr("Bar Length"), w);
  grid->addWidget(label, 0, 0);

  BarData bd(scannerName);
  period = new QComboBox(w);
  bd.getBarLengthList(barLengthList);
  period->insertStringList(barLengthList, -1);
  period->setCurrentText("Daily");
  grid->addWidget(period, 0, 1);

  label = new QLabel(tr("Bars"), w);
  grid->addWidget(label, 1, 0);

  bars = new QSpinBox(1, 99999999, 1, w);
  bars->setValue(100);
  grid->addWidget(bars, 1, 1);
  
  list = new FormulaEdit(w, FormulaEdit::Logic);
  vbox->addWidget(list);
  
  setDefaultButton(tr("&Scan"));
  connect(this, SIGNAL(defaultButtonPressed()), this, SLOT(scan()));
  
  setApplyButton(tr("&Apply"));  
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(saveRule()));
  
  setCancelButton(tr("&Cancel"));  
  connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog()));
  
  setOkButton(QString::null);  
  
  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp()));
  
  addTab(w, tr("Parms"));

  loadRule();
}
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 #17
0
AboutDialog::AboutDialog()
: KviTalTabDialog(0)
{
	setWindowTitle(__tr2qs_ctx("About KVIrc...","about"));
	setOkButton(__tr2qs_ctx("Close","about"));

	// About tab
	QString buffer;
	g_pApp->findImage(buffer,"kvi_release_art.png");

	QPixmap pix(buffer);

	QWidget * w = new QWidget(this);
	QGridLayout * g = new QGridLayout(w);

	QLabel * l = new QLabel(w);
	l->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
	QPalette p = l->palette();
	p.setColor(backgroundRole(), Qt::black);
	l->setPalette(p);
	l->setAlignment(Qt::AlignCenter);
	l->setPixmap(pix);

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

	QString aboutString= "<b>KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'</b><br>";
	aboutString += __tr2qs_ctx("Forged by the <b>KVIrc Development Team</b>","about");

	l = new QLabel(aboutString,w);
	l->setAlignment(Qt::AlignCenter);
	g->addWidget(l,1,0);

	addTab(w,__tr2qs_ctx("About","about"));


	// Info tab
	w = new QWidget(this);
	g = new QGridLayout(w);

	QTextEdit * v = new QTextEdit(w);
	v->setReadOnly(true);
	g->addWidget(v,0,0);

	// Get info
	QString infoString = "<b>KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'</b><br><br>";
	infoString += "<b>";
	infoString += __tr2qs_ctx("Runtime Info","about");
	infoString += ":</b><br>";
	infoString += __tr2qs_ctx("System name","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::name();
#ifndef COMPILE_ON_MAC
	infoString += " ";
	infoString += KviRuntimeInfo::release();
#endif
	infoString += "<br>";
	infoString += __tr2qs_ctx("System version","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::version();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Architecture","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::machine();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Qt version","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::qtVersion();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Qt theme","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::qtTheme();
	infoString += "<br><br>";
	infoString += "<b>";
	infoString += __tr2qs_ctx("Build Info","about");
	infoString += ":</b><br>";
	infoString += __tr2qs_ctx("Build date","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildDate();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Sources date","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildSourcesDate();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Revision number","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildRevision();
	infoString += "<br>";
	infoString += __tr2qs_ctx("System name","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildSystem();
	infoString += "<br>";
	infoString += __tr2qs_ctx("CPU name","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCPU();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Build command","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCommand();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Build flags","about");
	infoString += ": <br>&nbsp;&nbsp;&nbsp;";
	QString flags = KviBuildInfo::buildFlags();
	infoString += flags.replace(QRegExp(";"),"<br>&nbsp;&nbsp;&nbsp;");
	infoString += "<br>";
	infoString += __tr2qs_ctx("Compiler name","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCompiler();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Compiler flags","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCompilerFlags();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Qt version","about");
	infoString += ": ";
	infoString += KviBuildInfo::qtVersion();

	v->setText(infoString);

	addTab(w,__tr2qs_ctx("Executable Information","about"));


	// Honor & Glory tab
	w = new QWidget(this);
	g = new QGridLayout(w);

	v = new QTextEdit(w);
	v->setReadOnly(true);
	g->addWidget(v,0,0);

	v->setText(g_szAboutText);

	addTab(w,__tr2qs_ctx("Honor && Glory","about"));


	// License tab
	w = new QWidget(this);
	g = new QGridLayout(w);

	v = new QTextEdit(w);
	v->setReadOnly(true);
	v->setWordWrapMode(QTextOption::NoWrap);
	g->addWidget(v,0,0);

	QString szLicense;

	QString szLicensePath;
	g_pApp->getGlobalKvircDirectory(szLicensePath,KviApplication::License,"COPYING");

	if(!KviFileUtils::loadFile(szLicensePath,szLicense))
	{
		szLicense = __tr2qs_ctx("Oops! Can't find the license file.\n" \
			"It MUST be included in the distribution...\n" \
			"Please report to <pragma at kvirc dot net>","about");
	}

	v->setText(szLicense);

	addTab(w,__tr2qs_ctx("License","about"));


	connect(this,SIGNAL(applyButtonPressed()),this,SLOT(closeButtonPressed()));
}
IndexDialog::IndexDialog (QString &nam, QString &l) : QTabDialog (0, "IndexDialog", TRUE)
{
  helpFile = "indexes.html";

  QWidget *w = new QWidget(this);
  
  QVBoxLayout *vbox = new QVBoxLayout(w);
  vbox->setMargin(5);
  vbox->setSpacing(5);
    
  QGridLayout *grid = new QGridLayout(vbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);
  
  QLabel *label = new QLabel(tr("Name"), w);
  grid->addWidget(label, 0, 0);
  
  name = new QLineEdit(nam, w);
  grid->addWidget(name, 0, 1);
  
  QHBoxLayout *hbox = new QHBoxLayout(vbox);
  hbox->setSpacing(2);
  
  list = new QListView(w);
  list->addColumn(tr("Symbol"), 200);
  list->addColumn(tr("Weight"), -1);
  QObject::connect(list, SIGNAL(selectionChanged()), this, SLOT(buttonStatus()));
  hbox->addWidget(list);
  
  toolbar = new Toolbar(w, Toolbar::Vertical);
  hbox->addWidget(toolbar);

  QString s = "add";
  QString s2 = tr("Add Item");
  toolbar->addButton(s, insert, s2);
  QObject::connect(toolbar->getButton(s), SIGNAL(clicked()), this, SLOT(addItem()));
  
  s = "edit";
  s2 = tr("Edit");
  toolbar->addButton(s, edit, s2);
  QObject::connect(toolbar->getButton(s), SIGNAL(clicked()), this, SLOT(editItem()));
  
  s = "delete";
  s2 = tr("Delete");
  toolbar->addButton(s, deleteitem, s2);
  QObject::connect(toolbar->getButton(s), SIGNAL(clicked()), this, SLOT(deleteItem()));

  vbox->insertStretch(-1, 1);
  
  addTab(w, tr("Details"));

  setOkButton(tr("&OK"));
  setCancelButton(tr("&Cancel"));
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(accept()));

  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));

  setList(l);
    
  resize(325, 250);
}