Example #1
0
shipToList::shipToList(QWidget * parent, const char *name, bool modal, Qt::WFlags fl) :
  QDialog( parent, name, modal, fl )
{
  setWindowTitle(tr("Ship To's"));

  _shiptoid = -1;

  if (!name)
    setObjectName("shipToList");

  QVBoxLayout *shipToListLayout = new QVBoxLayout( this, 5, 5, "shipToListLayout"); 
  QHBoxLayout *Layout54 = new QHBoxLayout( 0, 0, 7, "Layout54"); 
  QHBoxLayout *Layout53 = new QHBoxLayout( 0, 0, 5, "Layout53"); 
  QVBoxLayout *Layout51 = new QVBoxLayout( 0, 0, 5, "Layout51"); 
  QVBoxLayout *Layout49 = new QVBoxLayout( 0, 0, 0, "Layout49"); 
  QVBoxLayout *Layout52 = new QVBoxLayout( 0, 0, 5, "Layout52"); 
  QVBoxLayout *Layout50 = new QVBoxLayout( 0, 0, 0, "Layout50"); 
  QHBoxLayout *Layout6 = new QHBoxLayout( 0, 0, 0, "Layout6"); 
  QVBoxLayout *Layout2 = new QVBoxLayout( 0, 0, 5, "Layout2"); 
  QVBoxLayout *Layout55 = new QVBoxLayout( 0, 0, 0, "Layout55"); 

    QLabel *_custNumberLit = new QLabel(tr("Customer #:"), this, "_custNumberLit");
    _custNumberLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout49->addWidget( _custNumberLit );

    QLabel *_custNameLit = new QLabel(tr("Cust Name:"), this, "_custNameLit");
    _custNameLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout49->addWidget( _custNameLit );

    QLabel *_custAddressLit = new QLabel(tr("Cust Address:"), this, "_custAddressLit");
    _custAddressLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout49->addWidget( _custAddressLit );
    Layout51->addLayout( Layout49 );

    QLabel *_searchForLit = new QLabel(tr("Search For:"), this, "_searchForLit");
    _searchForLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout51->addWidget( _searchForLit );
    Layout53->addLayout( Layout51 );

    _custNumber = new QLabel( this, "_custNumber" );
    Layout6->addWidget( _custNumber );

    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout6->addItem( spacer );
    Layout50->addLayout( Layout6 );

    _custName = new QLabel( this, "_custName" );
    Layout50->addWidget( _custName );

    _custAddress = new QLabel( this, "_custAddress" );
    Layout50->addWidget( _custAddress );
    Layout52->addLayout( Layout50 );

    _searchFor = new QLineEdit( this, "_searchFor" );
    Layout52->addWidget( _searchFor );
    Layout53->addLayout( Layout52 );
    Layout54->addLayout( Layout53 );

    _close = new QPushButton(tr("&Cancel"), this, "_close");
    Layout2->addWidget( _close );

    _select = new QPushButton(tr("&Select"), this, "_select");
    _select->setDefault( TRUE );
    Layout2->addWidget( _select );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
    Layout2->addItem( spacer_2 );
    Layout54->addLayout( Layout2 );
    shipToListLayout->addLayout( Layout54 );

    _shipTosList = new QLabel(tr("Ship To's:"), this, "_shipTosList");
    Layout55->addWidget( _shipTosList );

    _shipto = new XTreeWidget(this);
    _shipto->setObjectName("_shipto");
    Layout55->addWidget( _shipto );
    shipToListLayout->addLayout( Layout55 );

    resize( QSize(580, 365).expandedTo(minimumSizeHint()) );
    //clearWState( WState_Polished );

    // signals and slots connections
    connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
    connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
    connect( _searchFor, SIGNAL( textChanged(const QString&) ), this, SLOT( sSearch(const QString&) ) );
    connect( _shipto, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );

  _shipto->addColumn(tr("Number"),           70, Qt::AlignLeft, true, "shipto_num");
  _shipto->addColumn(tr("Name"),            150, Qt::AlignLeft, true, "shipto_name");
  _shipto->addColumn(tr("Address"),         150, Qt::AlignLeft, true, "shipto_address1");
  _shipto->addColumn(tr("City, State, Zip"), -1, Qt::AlignLeft, true, "csz");
  _shipto->sortByColumn(1, Qt::AscendingOrder);
}
Example #2
0
TQSize KJanusWidget::sizeHint() const
{
  return minimumSizeHint();
}
Example #3
0
/*!
\fn About::About( QWidget* parent, AboutMode diaMode )
\author Franz Schmid
\date
\brief Constructor for About dialog box
\param parent QWidget pointer to parent window
\param diaMode a dialog mode. See AboutMode.
\retval About dialog
*/
About::About( QWidget* parent, AboutMode diaMode ) : QDialog( parent )
{
	m_mode = diaMode;
	m_firstShow = true;
	setWindowTitle( tr("About Scribus %1").arg(VERSION) );
	setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png", true));
	setModal(true);
	aboutLayout = new QVBoxLayout( this );
	aboutLayout->setSpacing( 6 );
	aboutLayout->setMargin( 10 );
	tabWidget2 = new QTabWidget( this );
//	tabWidget2->setMinimumSize( QSize( 438, 258 ) );
	tab = new QWidget( tabWidget2 );
	tabLayout1 = new QVBoxLayout( tab );
	tabLayout1->setSpacing( 6 );
	tabLayout1->setMargin( 15 );
	pixmapLabel1 = new QLabel( tab );
	pixmapLabel1->setPixmap(IconManager::instance()->loadPixmap("scribus_splash.png", true));
	pixmapLabel1->setFixedSize(QSize(pixmapLabel1->pixmap()->width(), pixmapLabel1->pixmap()->height()));
	pixmapLabel1->setAlignment(Qt::AlignCenter);
	tabLayout1->addWidget( pixmapLabel1 );
	buildID = new QLabel( tab );
	buildID->setAlignment(Qt::AlignCenter);
	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
	QString BUILD_DAY = "18";
	QString BUILD_MONTH = CommonStrings::may;
	QString BUILD_YEAR = "2016";
	QString BUILD_TIME = "";
	QString BUILD_TZ = "";
	QString BUILD_NAME = "";

	QString built = tr("%1 %2 %3").arg(BUILD_DAY).arg(BUILD_MONTH).arg(BUILD_YEAR);
	QString version = VERSION;
	if (BUILD_NAME != "")
		version += " \"" + BUILD_NAME + "\"";
	if (BUILD_NAME == "BleedingEdge")
		built = tr("%3-%2-%1 %4 %5").arg(BUILD_DAY).arg(BUILD_MONTH).arg(BUILD_YEAR).arg(BUILD_TIME).arg(BUILD_TZ);

#if defined(HAVE_SVNVERSION) && defined(SVNVERSION)
	QString revText;
	revText=QString(tr("SVN Revision: %1")).arg(SVNVERSION);
	built+=" - ";
	built+=revText;
#endif
	QString bu;
	bu += "C";
	bu += "-";
	bu += "-";
	bu += "T";
	bu += "-";
#ifdef HAVE_FONTCONFIG
	bu += "F";
#else
	bu += "*";
#endif
	bu += "-";
	bu += "C";
	bu += cairo_version_string();

// Some more information if we are not on a 32bit little endian Unix machine
#if defined(Q_OS_WIN)
	bu += "-Windows";
#elif defined(Q_OS_MAC)
	bu += "-Mac/";
#elif defined(Q_OS_DARWIN)
	// dunno if anyone uses this...
	bu += "-Darwin";
#endif
	if (QSysInfo::WordSize != 32)
		bu += QString("-%1bit").arg(QSysInfo::WordSize);
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
	if (QSysInfo::ByteOrder==QSysInfo::BigEndian)
		bu += "-Big";
#endif
	QString gsver(getGSVersion());
	if (!gsver.isEmpty())
		gsver = tr("Using Ghostscript version %1").arg(gsver);
	else
		gsver = tr("No Ghostscript version available");
	buildID->setText( tr("<p align=\"center\"><b>%1 %2</b></p><p align=\"center\">%3<br>%4 %5<br>%6</p>").arg( tr("Scribus Version")).arg(version).arg(built).arg( tr("Build ID:")).arg(bu).arg(gsver));
	tabLayout1->addWidget( buildID, 0, Qt::AlignHCenter );
	tabWidget2->addTab( tab, tr( "&About" ) );

	/*! AUTHORS tab */
	tab_2 = new QWidget( tabWidget2 );
	tabLayout = new QHBoxLayout( tab_2 );
	tabLayout->setSpacing( 6 );
	tabLayout->setMargin( 10 );
	authorView = new QTextBrowser( tab_2 );
	authorView->setHtml(About::parseAuthorFile(ScPaths::instance().docDir() + "AUTHORS"));
	tabLayout->addWidget( authorView );
	tabWidget2->addTab( tab_2, tr("A&uthors"));

	/*! TRANSLATION tab */
	tab_3 = new QWidget( tabWidget2 );
	tabLayout_2 = new QHBoxLayout( tab_3 );
	tabLayout_2->setSpacing( 6 );
	tabLayout_2->setMargin( 10 );
	transView = new QTextBrowser( tab_3);
	transView->setHtml(About::parseTranslationFile(ScPaths::instance().docDir() + "TRANSLATION"));
	tabLayout_2->addWidget( transView );
	tabWidget2->addTab( tab_3, tr( "&Translations" ) );

	/*! ONLINE tab (03/04/2004 petr vanek) */
	tab_4 = new QWidget( tabWidget2 );
	onlineView = new QTextBrowser( tab_4 );
	onlineView->setHtml(About::parseLinksFile(ScPaths::instance().docDir() + "LINKS"));
	onlineView->setOpenExternalLinks(true);
	tabLayout_4 = new QHBoxLayout( tab_4 );
	tabLayout_4->setSpacing( 6 );
	tabLayout_4->setMargin( 10 );
	tabLayout_4->addWidget( onlineView );
	tabWidget2->addTab( tab_4, tr( "&Online" ) );


	/*! UPDATE tab */
	tab_5 = new QWidget( tabWidget2 );
	tabWidget2->addTab( tab_5, tr( "&Updates" ) );
	updateLayout = new QVBoxLayout( tab_5 );
	updateLayout->setSpacing( 6 );
	updateLayout->setMargin( 10 );
	checkForUpdateButton = new QPushButton( tr( "Check for Updates" ), tab_5 );
	updateView = new QTextBrowser( tab_5);
	updateLayout->addWidget( checkForUpdateButton );
	updateLayout->addWidget( updateView );
	
	/*! LICENCE tab */
	tab_Licence = new QWidget( tabWidget2 );
	tabWidget2->addTab( tab_Licence, tr( "&Licence" ) );
	licenceLayout = new QVBoxLayout( tab_Licence );
	licenceLayout->setSpacing( 6 );
	licenceLayout->setMargin( 10 );
	textViewLicence = new QTextBrowser( tab_Licence);
	licenceLayout->addWidget( textViewLicence );
	
	QFile licenceFile(ScPaths::instance().docDir() + "/COPYING");
	if (!licenceFile.open(QIODevice::ReadOnly | QIODevice::Text))
		textViewLicence->setPlainText(tr("Unable to open licence file. Please check your install directory or the Scribus website for licencing information.") );
	else
	{
		QTextStream inTS(&licenceFile);
		inTS.setAutoDetectUnicode(true);
		inTS.setCodec("UTF-8");
		QString licenceText = inTS.readAll();
		textViewLicence->setPlainText(licenceText);
	} 

	//Add tab widget to about window
	aboutLayout->addWidget( tabWidget2 );

	layout2 = new QHBoxLayout;
	layout2->setSpacing( 6 );
	layout2->setMargin( 0 );
	QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
	layout2->addItem( spacer );
	okButton = new QPushButton( tr( "&Close" ), this );
	okButton->setDefault( true );
	layout2->addWidget( okButton );
	aboutLayout->addLayout( layout2 );
	setMaximumSize(sizeHint());


	//tooltips
	buildID->setToolTip( "<qt>" + tr( "This panel shows the version, build date and compiled in library support in Scribus.")+"<br>"
	+ tr("The C-C-T-F equates to C=littlecms C=CUPS T=TIFF support F=Fontconfig support.Last Letter is the renderer C=cairo or Q=Qt")+"<br>"
	+ tr("Missing library support is indicated by a *. This also indicates the version of Ghostscript which Scribus has detected.")+"<br>"
	+ tr("The Windows version does not use fontconfig or CUPS libraries." ) + "</qt>" );
	checkForUpdateButton->setToolTip( "<qt>" + tr( "Check for updates to Scribus. No data from your machine will be transferred off it." ) + "</qt>" );
	// signals and slots connections
	connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
	connect( checkForUpdateButton, SIGNAL( clicked() ), this, SLOT( runUpdateCheck() ) );
	resize(minimumSizeHint());
}
QSize XSDReferenceDialog::sizeHint() const {
	return QSize(400, 300).expandedTo(minimumSizeHint());
}
SliceViewer::SliceViewer(QWidget *parent,Qt::WindowFlags f )
:QWidget(parent,f)
{

setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);	
mLayout = new QHBoxLayout( this); 
mRadius=2;
mButton=-1;
mPlaneWidget=NULL;
mPlaneWidget2=NULL;
mPlaneWidget3=NULL;
mZoomFactor = 1.0;
mColor[0]=0.0;
mColor[1]=0.0;
mColor[2]=0.0;
//mColor[0]=0.674509;
//mColor[1]=0.6588;
//mColor[2]=0.6;
mCoef[0]=1.0;//0.30;
mCoef[1]=0.0;//0.59;
mCoef[2]=0.0;//0.11;

mLum=NULL;
mVolume=NULL;
mColorTable=NULL;
mSliceNumber=-1;
mOrientation=2;
mID=0;
mRegionGrow=false;
mContour=vtkPoints::New();
mView=new QVTKWidget(this);

vtkRenderWindow* win=vtkRenderWindow::New();

//win->StereoCapableWindowOff();
//
//win->SetStereoTypeToDresden();
//win->SetStereoTypeToRedBlue();
//win->StereoRenderOn(); 
//win->SetStereoTypeToCrystalEyes();
//win->SetStereoTypeToInterlaced(); 

 
mView->SetRenderWindow(win);
win->Delete();

mView->show();
mView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
mLayout->addWidget(mView);

mRenderer = vtkRenderer::New();
mRenderer->SetBackground(mColor[0],mColor[1],mColor[2]);
mRenderer->SetBackingStore(false);
mView->GetRenderWindow()->AddRenderer(mRenderer);
mRenderer->Delete();

mView->GetInteractor()->SetInteractorStyle(vtkInteractorStyleImage::New());
//mView->GetInteractor()->SetInteractorStyle(vtkInteractorStyleTrackballCamera::New());
//mView->GetInteractor()->SetInteractorStyle(vtkInteractorStyleRubberBandZoom::New());

mView->installEventFilter(this);
mTextActor=vtkTextActor::New();
resize( QSize(300, 300).expandedTo(minimumSizeHint()) );

}
Example #6
0
//***************************************************************************
QSize Kwave::AboutContributor::sizeHint(void) const
{
    return minimumSizeHint();
}
Example #7
0
QSize KNumInput::sizeHint() const
{
    return minimumSizeHint();
}
Example #8
0
void AccountModifyDlg::init() 
{
	//connect(pa->psi(), SIGNAL(pgpToggled(bool)), SLOT(pgpToggled(bool)));
	if (pa)
		pa->dialogRegister(this);

	setWindowTitle(CAP(windowTitle()));
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/account").icon());
#endif

	le_pass->setEnabled(true);
	le_host->setEnabled(false);
	lb_host->setEnabled(false);
	le_port->setEnabled(false);
	lb_port->setEnabled(false);

	// FIXME: Temporarily removing security level settings
	ck_req_mutual->hide();
	cb_security_level->hide();
	lb_security_level->hide();

	connect(ck_host, SIGNAL(toggled(bool)), SLOT(hostToggled(bool)));
	connect(pb_key, SIGNAL(clicked()), SLOT(chooseKey()));
	connect(pb_keyclear, SIGNAL(clicked()), SLOT(clearKey()));
	connect(buttonBox->button(QDialogButtonBox::Save), SIGNAL(clicked()), SLOT(save()));
	connect(ck_automatic_resource, SIGNAL(toggled(bool)), le_resource, SLOT(setDisabled(bool)));
	connect(ck_automatic_resource, SIGNAL(toggled(bool)), lb_resource, SLOT(setDisabled(bool)));

	gb_pgp->setEnabled(false);

	if (pa) {
		connect(pb_vcard, SIGNAL(clicked()), SLOT(detailsVCard()));
		connect(pb_changepw, SIGNAL(clicked()), SLOT(detailsChangePW()));
	}
	else {
		pb_vcard->setEnabled(false);
		pb_changepw->setEnabled(false);
	}

	// Hide the name if necessary
	le_name->setText(acc.name);
	le_jid->setText(JIDUtil::accountToString(acc.jid,false));

	cb_ssl->addItem(tr("Always"),UserAccount::SSL_Yes);
	cb_ssl->addItem(tr("When available"),UserAccount::SSL_Auto);
	cb_ssl->addItem(tr("Never"), UserAccount::SSL_No);
	cb_ssl->addItem(tr("Legacy SSL"), UserAccount::SSL_Legacy);
	cb_ssl->setCurrentIndex(cb_ssl->findData(acc.ssl));
	connect(cb_ssl, SIGNAL(activated(int)), SLOT(sslActivated(int)));
	
	cb_plain->addItem(tr("Always"),ClientStream::AllowPlain);
	cb_plain->addItem(tr("Over encrypted connection"), ClientStream::AllowPlainOverTLS);
	cb_plain->addItem(tr("Never"), ClientStream::NoAllowPlain);
	cb_plain->setCurrentIndex(cb_plain->findData(acc.allow_plain));
	
	if (acc.opt_pass)
		le_pass->setText(acc.pass);

	ck_host->setChecked(acc.opt_host);
	le_host->setText(acc.host);
	le_port->setText(QString::number(acc.port));
	ck_req_mutual->setChecked(acc.req_mutual_auth);
	ck_legacy_ssl_probe->setChecked(acc.legacy_ssl_probe);

	ck_automatic_resource->setChecked(acc.opt_automatic_resource);
	le_resource->setText(acc.resource);
	le_priority->setText(QString::number(acc.priority));

	connect(ck_custom_auth,SIGNAL(toggled(bool)), lb_authid, SLOT(setEnabled(bool)));
	connect(ck_custom_auth,SIGNAL(toggled(bool)), le_authid, SLOT(setEnabled(bool)));
	connect(ck_custom_auth,SIGNAL(toggled(bool)), lb_realm, SLOT(setEnabled(bool)));
	connect(ck_custom_auth,SIGNAL(toggled(bool)), le_realm, SLOT(setEnabled(bool)));
	ck_custom_auth->setChecked(acc.customAuth);
	le_authid->setText(acc.authid);
	le_realm->setText(acc.realm);
		
	ck_compress->setChecked(acc.opt_compress);
	ck_auto->setChecked(acc.opt_auto);
	ck_reconn->setChecked(acc.opt_reconn);
	ck_connectAfterSleep->setChecked(acc.opt_connectAfterSleep);
	ck_log->setChecked(acc.opt_log);
	ck_keepAlive->setChecked(acc.opt_keepAlive);
	le_dtProxy->setText(acc.dtProxy.full());
	le_stunHost->setText(acc.stunHost);
	le_stunPort->setText(QString::number(acc.stunPort));

	key = acc.pgpSecretKey;
	updateUserID();
	PGPUtil::instance().clearPGPAvailableCache();
	if(PGPUtil::instance().pgpAvailable()) {
		gb_pgp->setEnabled(true);
	}

	pc = psi->proxy()->createProxyChooser(tab_connection);
	replaceWidget(lb_proxychooser, pc);
	pc->setCurrentItem(acc.proxyID);

	// Security level
	cb_security_level->addItem(tr("None"),QCA::SL_None);
	cb_security_level->addItem(tr("Integrity"),QCA::SL_Integrity);
	cb_security_level->addItem(tr("Baseline"),QCA::SL_Baseline);
	cb_security_level->addItem(tr("High"),QCA::SL_High);
	cb_security_level->addItem(tr("Highest"),QCA::SL_Highest);
	cb_security_level->setCurrentIndex(cb_security_level->findData(acc.security_level));

	// Name
	if(le_name->text().isEmpty())
		le_name->setFocus();
	else if(le_jid->text().isEmpty())
		le_jid->setFocus();
	else
		buttonBox->button(QDialogButtonBox::Save)->setFocus();

	// Privacy
	privacyInitialized = false;
	lb_customPrivacy->hide();
	privacyBlockedModel.setSourceModel(&privacyModel);
	lv_blocked->setModel(&privacyBlockedModel);
	if (pa) {
		connect(pa->privacyManager(),SIGNAL(defaultListAvailable(const PrivacyList&)),SLOT(updateBlockedContacts(const PrivacyList&)));
		connect(pa->privacyManager(),SIGNAL(defaultListError()),SLOT(getDefaultList_error()));
		connect(pa->privacyManager(),SIGNAL(changeList_error()),SLOT(changeList_error()));
		connect(pa,SIGNAL(updatedActivity()),SLOT(updatePrivacyTab()));
	}
	connect(tab_main,SIGNAL(currentChanged(int)),SLOT(tabChanged(int)));
	connect(pb_privacy, SIGNAL(clicked()), SLOT(privacyClicked()));
	connect(pb_removeBlock, SIGNAL(clicked()), SLOT(removeBlockClicked()));
	connect(pb_addBlock, SIGNAL(clicked()), SLOT(addBlockClicked()));
	// FIXME: Temporarily disabling blocking
	pb_removeBlock->hide();
	pb_addBlock->hide();

	// QWhatsThis helpers
	cb_plain->setWhatsThis(
		tr("Normally, Psi logs in using the <i>digest</i> authentication "
		"method.  Check this box to force a plain text login "
		"to the Jabber server. Use this option only if you have "
		"problems connecting with the normal login procedure, as it "
		"makes your connection potentially vulnerable to "
		"attacks."));
	ck_auto->setWhatsThis(
		tr("Automatically login to this account on Psi startup.  Useful if "
		"you have Psi automatically launched when an Internet "
		"connection is detected."));
	ck_connectAfterSleep->setWhatsThis(
		tr("Makes Psi try to connect when the computer resumes "
		"after a sleep."));
	ck_reconn->setWhatsThis(
		tr("Makes Psi try to reconnect if the connection was broken.  "
		"Useful, if you have an unstable connection and have to "
		"reconnect often."));
	ck_log->setWhatsThis(
		tr("Keep a log of message history.  Disable this "
		"option if you want to conserve disk space or if you need "
		"maximum security."));
	ck_keepAlive->setWhatsThis(
		tr("Sends so called \"Keep-alive\" packets periodically.  "
		"It is useful if your connection is set to be "
		"automatically disconnected after a certain period of "
		"inactivity (for example, by your ISP) and you want to keep it "
		"up all the time."));
	cb_ssl->setWhatsThis(
		tr("Check this option to use an encrypted SSL connection to "
		"the Jabber server.  You may use this option if your "
		"server supports it and if you have the necessary QCA-OpenSSL "
		"plugin installed.  For more information, check the "
		"Peachnote homepage."));
	ck_compress->setWhatsThis(
		tr("Check this option to use a compressed connection to "
		"the Jabber server, if the server supports it."));
	ck_host->setWhatsThis(
		tr("Use this option for manual configuration of your Jabber host "
		"if it is not the same as the host you are connecting to.  This option is mostly useful "
		"if you have some sort of proxy route on your "
		"local machine (i.e. you connect to localhost), but your "
		"account is registered on an external server."));
	le_resource->setWhatsThis(
		tr("You can have multiple clients connected to the Jabber server "
		"with your single account.  Each login is distinguished by a \"resource\" "
		"name, which you can specify in this field."));
	ck_custom_auth->setWhatsThis(
		tr("This option sets the user (and realm) you want to "
			"authenticate as. This overrides the Jabber ID you are logging in "
			"as."));
	le_priority->setWhatsThis(
		tr("<p>You can have multiple clients connected to the Jabber "
		"server with your single account.  In such a situation, "
		"the client with the highest priority (that is specified in "
		"this field) will be the one that will receive "
		"all incoming events.</p>"
		"<p>For example, if you have a permanent connection "
		"to the Internet at your work location, and have a dial-up at home, "
		"you can have your Jabber client permanently running at work "
		"with a low priority, and you can still use the same account "
		"from home, using a client with higher priority to "
		"temporary \"disable\" the lower priority client at work.</p>"));

	// Hiding of UI components
	if ((!pa && acc.name.isEmpty()) || PsiOptions::instance()->getOption("options.ui.account.single").toBool()) {
		le_name->hide();
		lb_name->hide();
	}
	
	if (!PsiOptions::instance()->getOption("options.account.domain").toString().isEmpty()) {
		lb_example->hide();
		lb_jid->setText(tr("Username:"));
	}
	
	if (!PsiOptions::instance()->getOption("options.pgp.enable").toBool()) {
		gb_pgp->hide();
	}
	
	if (!PsiOptions::instance()->getOption("options.ui.account.privacy.show").toBool()) 
		tab_main->removeTab(tab_main->indexOf(tab_privacy));
	
	if (!PsiOptions::instance()->getOption("options.ui.account.proxy.show").toBool()) {
		lb_proxy->hide();
		// keep comment for the midi "options -> account setup"
	//	lb_proxychooser->hide();
	}

	if (!PsiOptions::instance()->getOption("options.ui.account.manual-host").toBool()) {
		ck_host->hide();
		lb_host->hide();
		le_host->hide();
		lb_port->hide();
		le_port->hide();
	}
	
	if (!PsiOptions::instance()->getOption("options.ui.account.keepalive").toBool()) 
		ck_keepAlive->hide();
	
	if (!PsiOptions::instance()->getOption("options.ui.account.legacy-ssl-probe").toBool()) 
		ck_legacy_ssl_probe->hide();

	if (!PsiOptions::instance()->getOption("options.ui.account.security.show").toBool()) {
		lb_plain->hide();
		cb_plain->hide();
		ck_req_mutual->hide();
		lb_security_level->hide();
		cb_security_level->hide();
	}

	if (!PsiOptions::instance()->getOption("options.ui.account.security.show").toBool() && !PsiOptions::instance()->getOption("options.ui.account.legacy-ssl-probe").toBool() && !PsiOptions::instance()->getOption("options.ui.account.keepalive").toBool() && !PsiOptions::instance()->getOption("options.ui.account.manual-host").toBool() && !PsiOptions::instance()->getOption("options.ui.account.proxy.show").toBool()) {
		tab_main->removeTab(tab_main->indexOf(tab_connection));
	}
	
	if (!PsiOptions::instance()->getOption("options.ui.account.resource").toBool()) {
		ck_automatic_resource->hide();
		lb_resource->hide();
		le_resource->hide();
	}
	
	if (!PsiOptions::instance()->getOption("options.ui.account.custom-authid").toBool()) {
		ck_custom_auth->hide();
		lb_authid->hide();
		le_authid->hide();
		lb_realm->hide();
		le_realm->hide();
	}
	
	if (!PsiOptions::instance()->getOption("options.ui.account.priority").toBool()) {
		lb_priority->hide();
		le_priority->hide();
	}
	
	if (!PsiOptions::instance()->getOption("options.ui.account.data-proxy").toBool()) {
		lb_dtProxy->hide();
		le_dtProxy->hide();
	}

	if (!PsiOptions::instance()->getOption("options.ui.account.resource").toBool() && !PsiOptions::instance()->getOption("options.ui.account.priority").toBool() && !PsiOptions::instance()->getOption("options.ui.account.data-proxy").toBool()) {
		tab_main->removeTab(tab_main->indexOf(tab_misc));
	}
	
	resize(minimumSizeHint());
}
/*
 *  Constructs a PaletteEditorBase as 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.
 */
PaletteEditorBase::PaletteEditorBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "PaletteEditorBase" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    PaletteEditorBaseLayout = new QVBoxLayout( this, 11, 6, "PaletteEditorBaseLayout"); 

    groupAutoPalette = new QGroupBox( this, "groupAutoPalette" );
    groupAutoPalette->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)4, 0, 0, groupAutoPalette->sizePolicy().hasHeightForWidth() ) );
    groupAutoPalette->setAlignment( int( QGroupBox::AlignAuto ) );
    groupAutoPalette->setColumnLayout(0, Qt::Vertical );
    groupAutoPalette->layout()->setSpacing( 6 );
    groupAutoPalette->layout()->setMargin( 11 );
    groupAutoPaletteLayout = new QHBoxLayout( groupAutoPalette->layout() );
    groupAutoPaletteLayout->setAlignment( Qt::AlignTop );

    labelMainColor = new QLabel( groupAutoPalette, "labelMainColor" );
    labelMainColor->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, labelMainColor->sizePolicy().hasHeightForWidth() ) );
    labelMainColor->setMinimumSize( QSize( 50, 0 ) );
    labelMainColor->setLineWidth( 1 );
    labelMainColor->setMargin( 0 );
    labelMainColor->setMidLineWidth( 0 );
    labelMainColor->setAlignment( int( QLabel::AlignAuto | QLabel::AlignVCenter ) );
    groupAutoPaletteLayout->addWidget( labelMainColor );

    buttonMainColor = new StyledButton( groupAutoPalette, "buttonMainColor" );
    buttonMainColor->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, buttonMainColor->sizePolicy().hasHeightForWidth() ) );
    buttonMainColor->setFocusPolicy( StyledButton::StrongFocus );
    buttonMainColor->setProperty( "scale", QVariant( FALSE, 0 ) );
    groupAutoPaletteLayout->addWidget( buttonMainColor );

    labelMainColor2 = new QLabel( groupAutoPalette, "labelMainColor2" );
    labelMainColor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, labelMainColor2->sizePolicy().hasHeightForWidth() ) );
    labelMainColor2->setMinimumSize( QSize( 50, 0 ) );
    labelMainColor2->setLineWidth( 1 );
    labelMainColor2->setMargin( 0 );
    labelMainColor2->setMidLineWidth( 0 );
    labelMainColor2->setAlignment( int( QLabel::AlignAuto | QLabel::AlignVCenter ) );
    groupAutoPaletteLayout->addWidget( labelMainColor2 );

    buttonMainColor2 = new StyledButton( groupAutoPalette, "buttonMainColor2" );
    buttonMainColor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, buttonMainColor2->sizePolicy().hasHeightForWidth() ) );
    buttonMainColor2->setFocusPolicy( StyledButton::StrongFocus );
    buttonMainColor2->setProperty( "scale", QVariant( FALSE, 0 ) );
    groupAutoPaletteLayout->addWidget( buttonMainColor2 );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    groupAutoPaletteLayout->addItem( Spacer1 );

    btnAdvanced = new QPushButton( groupAutoPalette, "btnAdvanced" );
    groupAutoPaletteLayout->addWidget( btnAdvanced );
    PaletteEditorBaseLayout->addWidget( groupAutoPalette );

    GroupBox126 = new QGroupBox( this, "GroupBox126" );
    GroupBox126->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, GroupBox126->sizePolicy().hasHeightForWidth() ) );
    GroupBox126->setColumnLayout(0, Qt::Vertical );
    GroupBox126->layout()->setSpacing( 6 );
    GroupBox126->layout()->setMargin( 11 );
    GroupBox126Layout = new QVBoxLayout( GroupBox126->layout() );
    GroupBox126Layout->setAlignment( Qt::AlignTop );

    Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); 

    TextLabel1 = new QLabel( GroupBox126, "TextLabel1" );
    Layout2->addWidget( TextLabel1 );

    paletteCombo = new QComboBox( FALSE, GroupBox126, "paletteCombo" );
    Layout2->addWidget( paletteCombo );
    GroupBox126Layout->addLayout( Layout2 );

    previewFrame = new PreviewFrame( GroupBox126, "previewFrame" );
    previewFrame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, previewFrame->sizePolicy().hasHeightForWidth() ) );
    GroupBox126Layout->addWidget( previewFrame );
    PaletteEditorBaseLayout->addWidget( GroupBox126 );

    Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3"); 

    buttonHelp = new QPushButton( this, "buttonHelp" );
    buttonHelp->setAutoDefault( TRUE );
    Layout3->addWidget( buttonHelp );
    Horizontal_Spacing11 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout3->addItem( Horizontal_Spacing11 );

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    Layout3->addWidget( buttonOk );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );
    Layout3->addWidget( buttonCancel );
    PaletteEditorBaseLayout->addLayout( Layout3 );
    languageChange();
    resize( QSize(449, 443).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonMainColor2, SIGNAL( clicked() ), this, SLOT( onChoose2ndMainColor() ) );
    connect( paletteCombo, SIGNAL( activated(int) ), this, SLOT( paletteSelected(int) ) );
    connect( btnAdvanced, SIGNAL( clicked() ), this, SLOT( onTune() ) );
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( buttonMainColor, SIGNAL( changed() ), this, SLOT( onChooseMainColor() ) );
    connect( buttonMainColor, SIGNAL( clicked() ), this, SLOT( onChooseMainColor() ) );
    connect( buttonMainColor2, SIGNAL( changed() ), this, SLOT( onChoose2ndMainColor() ) );

    // tab order
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, buttonMainColor );
    setTabOrder( buttonMainColor, buttonMainColor2 );
    setTabOrder( buttonMainColor2, btnAdvanced );
    setTabOrder( btnAdvanced, paletteCombo );
    setTabOrder( paletteCombo, buttonHelp );

    // buddies
    labelMainColor->setBuddy( buttonMainColor );
    labelMainColor2->setBuddy( buttonMainColor2 );
    TextLabel1->setBuddy( paletteCombo );
    init();
}
Example #10
0
/*!
  \return a size hint
*/
QSize QwtScaleWidget::sizeHint() const
{
    return minimumSizeHint();
}
Example #11
0
void coEditorTextValueWidget::setValue(const QString &valueName, const QString &value,
                                       const QString &readableAttrRule,
                                       const QString &attributeDescription,
                                       bool, const QRegExp &rx)
{
    fvariable = valueName;
    fvalue = value;

    QHBoxLayout *layout;
    QLabel *valueLabel;
    QSpacerItem *spacerItem;

    setObjectName(widgetName);
    setMaximumSize(QSize(16777215, 100));
    setBaseSize(QSize(400, 25));
    setToolTip(attributeDescription);

    layout = new QHBoxLayout(this);
    layout->setSpacing(0);
    layout->setMargin(0);
    layout->setObjectName(QString::fromUtf8("layout"));
    valueLabel = new QLabel(this);
    valueLabel->setText(valueName);
    valueLabel->setObjectName(QString::fromUtf8("valueLabel"));
    valueLabel->setBaseSize(QSize(150, 22));

    QSizePolicy labelSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    labelSizePolicy.setHorizontalStretch(1);
    labelSizePolicy.setVerticalStretch(0);
    labelSizePolicy.setHeightForWidth(valueLabel->sizePolicy().hasHeightForWidth());
    valueLabel->setSizePolicy(labelSizePolicy);

    spacerItem = new QSpacerItem(30, 20, QSizePolicy::Preferred, QSizePolicy::Minimum);

    valueLineEdit = new coEditorValidatedQLineEdit(this);
    valueLineEdit->setObjectName(valueName);
    valueLineEdit->setStatusTip(readableAttrRule);
    QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(0));
    sizePolicy.setHorizontalStretch(2);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(valueLineEdit->sizePolicy().hasHeightForWidth());
    valueLineEdit->setSizePolicy(sizePolicy);
    valueLineEdit->setMaximumSize(QSize(16777215, 22));
    valueLineEdit->setBaseSize(QSize(200, 22));
    valueLineEdit->setAlignment(Qt::AlignRight);
    valueLineEdit->setDragEnabled(true);

    if (!rx.isEmpty())
    {
        QValidator *validator = new QRegExpValidator(rx, this);
        valueLineEdit->setValidator(validator);
    }
    // returnPressed is only send, if expression is valid. then we need to call coConfigEntry->setValue
    // connect(valueLineEdit, SIGNAL(returnPressed()), this, SLOT(commitNewEntryValueData()));
    valueLineEdit->setText(value); //setText does not call validate
    valueLineEdit->setModified(false);

    //create Contextmenu - Delete value
    deleteValueAction = new QAction(tr("Delete this Value ?"), valueLabel);
    deleteValueAction->setStatusTip(tr("Delete this value ?"));
    addAction(deleteValueAction);
    setContextMenuPolicy(Qt::ActionsContextMenu);

    if (getType() == coEditorValueWidget::Info || getType() == coEditorValueWidget::InfoName
                                                  /*value.isEmpty() &&*/ /*&& !required*/)
    {
        defaultValue = value;
        //
        valueLineEdit->setStyleSheet("background-color: aliceblue");
        connect(deleteValueAction, SIGNAL(triggered()), this, SLOT(explainShowInfoButton()));
    }
    else
    {
        //is valid checks, and sets background color to red if check fails
        /* if (!empty)*/
        valueLineEdit->isValid();
        connect(deleteValueAction, SIGNAL(triggered()), this, SLOT(suicide()));
    }

    valueLineEdit->adjustSize();

    QSize size(250, 45);
    size = size.expandedTo(minimumSizeHint());
    resize(size);

    //connect to save
    connect(valueLineEdit, SIGNAL(editingFinished()), this, SLOT(save()));
    //    connect ( valueLineEdit, SIGNAL (returnPressed() ), this, SLOT (save() ) );
    //NOTE if we want a nasty nagscreen, connect it here
    //connect ( valueLineEdit, SIGNAL (notValid() ),  , SLOT ( ) );
    connect(valueLineEdit, SIGNAL(notValid()), this, SIGNAL(notValid()));

    layout->addWidget(valueLabel);
    layout->addItem(spacerItem);
    layout->addWidget(valueLineEdit);

    setLayout(layout);
}
Example #12
0
TQSize KRichTextLabel::sizeHint() const
{
  return minimumSizeHint();
}
void BtSearchOptionsArea::initView() {
    namespace DU = util::directory;

    QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    this->setSizePolicy(sizePolicy);
    hboxLayout = new QHBoxLayout(this);

    searchGroupBox = new QGroupBox(this);

    gridLayout = new QGridLayout(searchGroupBox);

    gridLayout->setHorizontalSpacing(3);

    // ******** label for search text editor***********
    m_searchTextLabel = new QLabel(tr("Search for:"), searchGroupBox);
    m_searchTextLabel->setWordWrap(false);
    gridLayout->addWidget(m_searchTextLabel, 0, 0);

    // **********Buttons******************

    m_searchButton = new QPushButton(this);
    m_searchButton->setText(tr("&Search"));
    m_searchButton->setIcon(DU::getIcon(CResMgr::searchdialog::icon));
    m_searchButton->setToolTip(tr("Start to search the text in the chosen works"));
    gridLayout->addWidget(m_searchButton, 0, 2);

    m_chooseModulesButton = new QPushButton(tr("Ch&oose..."), searchGroupBox);
    m_chooseModulesButton->setIcon(DU::getIcon(CResMgr::searchdialog::chooseworks_icon));
    m_chooseModulesButton->setToolTip( tr("Choose works for the search"));
    gridLayout->addWidget(m_chooseModulesButton, 2, 2);

    m_chooseRangeButton = new QPushButton(tr("S&etup..."), searchGroupBox);
    m_chooseRangeButton->setIcon(DU::getIcon(CResMgr::searchdialog::setupscope_icon));
    m_chooseRangeButton->setToolTip(tr("Configure predefined scopes for search"));
    gridLayout->addWidget(m_chooseRangeButton, 3, 2);

    // ************* Search type (AND/OR) selector ***************************************
    QHBoxLayout* typeSelectorLayout = new QHBoxLayout();
    int tsLeft, tsTop, tsRight, tsBottom;
    // Added space looks nicer and enhances readability
    typeSelectorLayout->getContentsMargins(&tsLeft, &tsTop, &tsRight, &tsBottom);
    typeSelectorLayout->setContentsMargins(tsLeft, 0, tsRight, tsBottom + util::tool::mWidth(this, 1) );
    typeSelectorLayout->setSpacing(typeSelectorLayout->spacing() + util::tool::mWidth(this, 1));
    QHBoxLayout* fullButtonLayout = new QHBoxLayout();
    fullButtonLayout->setSpacing(util::tool::mWidth(this, 1) / 2);
    m_typeAndButton = new QRadioButton(tr("All words"));
    m_typeAndButton->setChecked(true);
    m_typeOrButton = new QRadioButton(tr("Some words"));
    m_typeFreeButton = new QRadioButton(tr("Free"));

    m_typeAndButton->setToolTip(tr("All of the words (AND is added between the words)"));
    m_typeOrButton->setToolTip(tr("Some of the words (OR is added between the words)"));
    m_typeFreeButton->setToolTip(tr("Full lucene syntax"));

    m_helpLabel = new QLabel(tr(" (<a href='syntax_help'>full syntax</a>)"));
    m_helpLabel->setToolTip(tr("Click the link to get help for search syntax"));

    typeSelectorLayout->addWidget(m_typeAndButton);
    typeSelectorLayout->addWidget(m_typeOrButton);
    fullButtonLayout->addWidget(m_typeFreeButton);
    fullButtonLayout->addWidget(m_helpLabel);
    typeSelectorLayout->addLayout(fullButtonLayout);
    gridLayout->addLayout(typeSelectorLayout, 1, 1, 1, -1, Qt::AlignLeft | Qt::AlignTop);

    // ************* Label for search range/scope selector *************
    m_searchScopeLabel = new QLabel(tr("Scope:"), searchGroupBox);
    m_searchScopeLabel->setWordWrap(false);
    gridLayout->addWidget(m_searchScopeLabel, 3, 0);

    // ***********Range/scope selector combo box***********
    m_rangeChooserCombo = new QComboBox(searchGroupBox);
    QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed);
    sizePolicy2.setHorizontalStretch(0);
    sizePolicy2.setVerticalStretch(0);
    sizePolicy2.setHeightForWidth(m_rangeChooserCombo->sizePolicy().hasHeightForWidth());
    m_rangeChooserCombo->setSizePolicy(sizePolicy2);
    m_rangeChooserCombo->setToolTip(tr("Choose the scope (books/chapters/verses to search in).<br />Applicable for Bibles and commentaries."));
    gridLayout->addWidget(m_rangeChooserCombo, 3, 1);

    // ************* Search text combo box *******************
    m_searchTextCombo = new CHistoryComboBox(searchGroupBox);
    sizePolicy2.setHeightForWidth(m_searchTextCombo->sizePolicy().hasHeightForWidth());
    m_searchTextCombo->setSizePolicy(sizePolicy2);
    m_searchTextCombo->setFocusPolicy(Qt::WheelFocus);
    m_searchTextCombo->setProperty("sizeLimit", QVariant(25));
    m_searchTextCombo->setProperty("duplicatesEnabled", QVariant(false));
    m_searchTextCombo->setToolTip(tr("The text you want to search for"));
    m_searchTextCombo->setInsertPolicy(QComboBox::NoInsert);
    gridLayout->addWidget(m_searchTextCombo, 0, 1);

    m_modulesLabel = new QLabel(tr("Works:"), searchGroupBox);
    gridLayout->addWidget(m_modulesLabel, 2, 0);

    m_modulesCombo = new QComboBox(searchGroupBox);
    m_modulesCombo->setDuplicatesEnabled(false);
    gridLayout->addWidget(m_modulesCombo, 2, 1);

    hboxLayout->addWidget(searchGroupBox);

    // Set the minimum size before the widgets are populated with data.
    // Otherwise we will get problems with sizing.
    setMinimumSize(minimumSizeHint());

    refreshRanges();
    //set the initial focus
    m_searchTextCombo->setFocus();
    // event filter to prevent the Return/Enter presses in the combo box doing something
    // in the parent widget
    m_searchTextCombo->installEventFilter(this);
}
Example #14
0
PicasawebLogin::PicasawebLogin(QWidget* parent, const QString& header,
                               const QString& _name, const QString& _passwd)
              : QDialog(parent)
{
    setSizeGripEnabled(false);

    QVBoxLayout* vbox = new QVBoxLayout(this);

    m_headerLabel = new QLabel(this);
    m_headerLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
    m_headerLabel->setText(header);

    QFrame* hline = new QFrame(this);
    hline->setObjectName("hline");
    hline->setFrameShape( QFrame::HLine );
    hline->setFrameShadow( QFrame::Sunken );
    hline->setFrameShape( QFrame::HLine );

    QGridLayout* centerLayout = new QGridLayout();

    m_nameEdit   = new KLineEdit(this);
    m_passwdEdit = new KLineEdit(this);
    m_passwdEdit->setEchoMode(KLineEdit::Password);

    QLabel* nameLabel = new QLabel(this);
    nameLabel->setText(i18n( "Google Login:" ));
    // centerLayout->addWidget(nameLabel, 0, 0);

    QLabel* passwdLabel = new QLabel(this);
    passwdLabel->setText(i18n("Password:"));

    centerLayout->addWidget(m_nameEdit,   0, 1);
    centerLayout->addWidget(m_passwdEdit, 1, 1);
    centerLayout->addWidget(nameLabel,    0, 0);
    centerLayout->addWidget(passwdLabel,  1, 0);

    QHBoxLayout* btnLayout = new QHBoxLayout();
    QPushButton *okBtn     = new QPushButton(this);
    okBtn->setAutoDefault(true);
    okBtn->setDefault(true);
    okBtn->setText(i18n("&OK"));

    QPushButton *cancelBtn = new QPushButton(this);
    cancelBtn->setText(i18n("&Cancel"));

    btnLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
    btnLayout->addWidget(okBtn);
    btnLayout->addWidget(cancelBtn);
    btnLayout->setMargin(0);
    btnLayout->setSpacing(5);

    vbox->setMargin(5);
    vbox->setSpacing(5);
    vbox->setObjectName("vbox");
    vbox->addWidget(m_headerLabel);
    vbox->addWidget(hline);
    vbox->addLayout(centerLayout);
    vbox->addLayout(btnLayout);

    resize(QSize(300, 150).expandedTo(minimumSizeHint()));

    //TODO: KDE4PORT
    //clearWState( WState_Polished );

    m_nameEdit->setText(_name);
    m_passwdEdit->setText(_passwd);

    // signals and slots connections

    connect(okBtn, SIGNAL(clicked()),
            this, SLOT(accept()));

    connect(cancelBtn, SIGNAL(clicked()),
            this, SLOT(reject()));
}
Example #15
0
comment::comment( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) :
  QDialog( parent, name, modal, fl )
{
  setWindowTitle(tr("Comment"));

  _commentid = -1;
  _targetId = -1;
  _mode = cNew;

  if (!name)
    setObjectName("comment");

  QHBoxLayout *commentLayout = new QHBoxLayout( this, 5, 7, "commentLayout"); 
  QVBoxLayout *layout11  = new QVBoxLayout( 0, 0, 5, "layout11"); 
  QHBoxLayout *layout9   = new QHBoxLayout( 0, 0, 0, "layout9"); 
  QBoxLayout *layout8    = new QHBoxLayout( 0, 0, 5, "layout8"); 
  QVBoxLayout *Layout181 = new QVBoxLayout( 0, 0, 0, "Layout181"); 
  QVBoxLayout *Layout180 = new QVBoxLayout( 0, 0, 5, "Layout180"); 

  QLabel *_cmnttypeLit = new QLabel(tr("Comment Type:"), this, "_cmnttypeLit");
  layout8->addWidget( _cmnttypeLit );

  _cmnttype = new XComboBox( FALSE, this, "_cmnttype" );
  layout8->addWidget( _cmnttype );
  layout9->addLayout( layout8 );

  QSpacerItem* spacer = new QSpacerItem( 66, 10, QSizePolicy::Expanding, QSizePolicy::Minimum );
  layout9->addItem( spacer );
  layout11->addLayout( layout9 );

  _comment = new QTextEdit( this, "_comment" );
  layout11->addWidget( _comment );
  commentLayout->addLayout( layout11 );

  _close = new QPushButton(tr("&Cancel"), this, "_close");
  Layout180->addWidget( _close );

  _save = new QPushButton(tr("&Save"), this, "_save");
  Layout180->addWidget( _save );

  _prev = new QPushButton(tr("&Previous"), this, "_prev");
  Layout180->addWidget( _prev );

  _next = new QPushButton(tr("&Next"), this, "_next");
  Layout180->addWidget( _next );

  Layout181->addLayout( Layout180 );
  QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
  Layout181->addItem( spacer_2 );
  commentLayout->addLayout( Layout181 );

  resize( QSize(524, 270).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

// signals and slots connections
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_next, SIGNAL(clicked()), this, SLOT(sNextComment()));
  connect(_prev, SIGNAL(clicked()), this, SLOT(sPrevComment()));

// tab order
  setTabOrder( _cmnttype, _comment );
  setTabOrder( _comment, _save );
  setTabOrder( _save, _close );

  _source = Comments::Uninitialized;
  _cmnttype->setAllowNull(TRUE);
}
Example #16
0
DialogGLInject::DialogGLInject(PageInput* parent)
	: QDialog(parent) {

	m_parent = parent;

	setWindowTitle(tr("OpenGL Settings"));

	QLabel *label_info = new QLabel(this);
	label_info->setText(tr("<p>Warning: OpenGL recording works by injecting a library into the program that will be recorded. "
						   "This library will override some system functions in order to capture the frames before they are "
						   "displayed on the screen. If you are trying to record a game that tries to detect hacking attempts "
						   "on the client side, it's (theoretically) possible that the game will consider this a hack. This "
						   "might even get you banned, so it's a good idea to make sure that the program you want to record "
						   "won't ban you, *before* you try to record it. You've been warned :).</p>\n\n"
						   "<p>Another warning: OpenGL recording is experimental, it may not work or even crash the program you "
						   "are recording. If you are worried about losing program data, make a backup first!</p>\n\n"
						   "<p>If you want to record Steam games, <a href=\"http://www.maartenbaert.be/simplescreenrecorder/recording-steam-games/\">read this first</a>.</p>"));
	label_info->setWordWrap(true);
	label_info->setTextFormat(Qt::RichText);
	label_info->setTextInteractionFlags(Qt::TextBrowserInteraction);
	label_info->setOpenExternalLinks(true);

	QGroupBox *groupbox_channel = new QGroupBox(tr("Choose channel"), this);
	{
		QLabel *label_channel = new QLabel(tr("Channel name:"), groupbox_channel);
		m_lineedit_channel = new QLineEdit(m_parent->GetGLInjectChannel(), groupbox_channel);
		m_lineedit_channel->setToolTip(tr("Channel names are used to identify applications. You only need to use this if you want to record multiple applications at the same time.\n"
										  "If you leave this empty, the default name 'channel-YOURUSERNAME' will be used."));
		m_checkbox_relax_permissions = new QCheckBox(tr("Relax shared memory permissions (insecure)"), groupbox_channel);
		m_checkbox_relax_permissions->setToolTip(tr("If checked, other users on the same machine will be able to attach to the shared memory that's used for communication with the OpenGL program.\n"
													"This means other users can (theoretically) see what you are recording, modify the frames, inject their own frames, or simply disrupt the communication.\n"
													"This even applies to users that are logged in remotely (ssh). You should only enable this if you need to record a program that runs as a different user."));
		m_checkbox_relax_permissions->setChecked(m_parent->GetGLInjectRelaxPermissions());

		QVBoxLayout *layout = new QVBoxLayout(groupbox_channel);
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(label_channel, 0, 0);
			layout2->addWidget(m_lineedit_channel, 0, 1);
		}
		layout->addWidget(m_checkbox_relax_permissions);
	}

	QGroupBox *groupbox_launch = new QGroupBox(tr("Launch application"), this);
	{
		QLabel *label_command = new QLabel(tr("Command:"), groupbox_launch);
		m_lineedit_command = new QLineEdit(m_parent->GetGLInjectCommand(), groupbox_launch);
		m_lineedit_command->setToolTip(tr("This command will be executed to start the program that should be recorded."));
		m_lineedit_command->setMinimumWidth(300);
		QLabel *label_working_directory = new QLabel(tr("Working directory:"), groupbox_launch);
		m_lineedit_working_directory = new QLineEdit(m_parent->GetGLInjectWorkingDirectory(), groupbox_launch);
		m_lineedit_working_directory->setToolTip(tr("The command will be executed in this directory. If you leave this empty, the working directory won't be changed."));
		m_lineedit_working_directory->setMinimumWidth(300);
		m_checkbox_auto_launch = new QCheckBox(tr("Launch automatically"), this);
		m_checkbox_auto_launch->setToolTip(tr("If checked, the application will be launched automatically once you go to the recording page. If not checked, you have to start it manually."));
		m_checkbox_auto_launch->setChecked(m_parent->GetGLInjectAutoLaunch());
		QPushButton *pushbutton_launch = new QPushButton(tr("Launch now"), this);

		connect(pushbutton_launch, SIGNAL(clicked()), this, SLOT(OnLaunchNow()));

		QVBoxLayout *layout = new QVBoxLayout(groupbox_launch);
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(label_command, 0, 0);
			layout2->addWidget(m_lineedit_command, 0, 1);
			layout2->addWidget(label_working_directory, 1, 0);
			layout2->addWidget(m_lineedit_working_directory, 1, 1);
		}
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_checkbox_auto_launch);
			layout2->addWidget(pushbutton_launch);
		}
	}

	QGroupBox *groupbox_stream = new QGroupBox(tr("Stream settings"), this);
	{
		m_checkbox_limit_fps = new QCheckBox(tr("Limit application frame rate"), this);
		m_checkbox_limit_fps->setToolTip(tr("If checked, the injected library will slow down the application so the frame rate doesn't become higher than the recording frame rate.\n"
											"This stops the application from wasting CPU time for frames that won't be recorded, and sometimes results in smoother video\n"
											"(this depends on the application)."));
		m_checkbox_limit_fps->setChecked(m_parent->GetGLInjectLimitFPS());

		QVBoxLayout *layout = new QVBoxLayout(groupbox_stream);
		layout->addWidget(m_checkbox_limit_fps);
	}

	QPushButton *pushbutton_close = new QPushButton(tr("Close"), this);
	pushbutton_close->setDefault(true);

	connect(pushbutton_close, SIGNAL(clicked()), this, SLOT(accept()));
	connect(this, SIGNAL(accepted()), this, SLOT(OnWriteBack()));
	connect(this, SIGNAL(rejected()), this, SLOT(OnWriteBack()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(label_info);
	layout->addWidget(groupbox_channel);
	layout->addWidget(groupbox_launch);
	layout->addWidget(groupbox_stream);
	layout->addStretch();
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addStretch();
		layout2->addWidget(pushbutton_close);
		layout2->addStretch();
	}

	setMinimumSize(minimumSizeHint()); // workaround for Qt bug

}
Example #17
0
void pDockWidgetTitleBar::paintEvent( QPaintEvent* event )
{
	Q_UNUSED( event );
	
	QRect rect = this->rect();
	QPainter painter( this );
	
	// native background paint for not common style / native paint
	if ( ( mUseNativePaint || style()->inherits( "QMacStyle" ) || style()->inherits( "Oxygen::Style" ) ) && qobject_cast<pDockWidget*>( mDock ) ) {
		QStyleOptionDockWidgetV2 optionDw;
		((pDockWidget*)mDock)->initStyleOption( &optionDw );
		optionDw.title.clear();
		optionDw.closable = false;
		optionDw.floatable = false;
		optionDw.movable = false;
		optionDw.rect = rect;
		
		style()->drawControl( QStyle::CE_DockWidgetTitle, &optionDw, &painter, mDock );
	}
	// custom background
	else {
		QColor topColor = palette().color( QPalette::Highlight ).lighter( 130 );
		QColor bottomColor = palette().color( QPalette::Highlight ).darker( 130 );
		QLinearGradient gradient( rect.topLeft(), rect.bottomLeft() );
		
		topColor.setAlphaF( .7 );
		bottomColor.setAlphaF( .7 );
		
		gradient.setColorAt( 0, topColor );
		gradient.setColorAt( 1, bottomColor );
		
		if ( mDock->features() & QDockWidget::DockWidgetVerticalTitleBar ) {
			gradient.setFinalStop( rect.topRight() );
		}
		
		painter.setPen( Qt::NoPen );
		painter.setBrush( gradient );
		painter.drawRect( rect );
		
		painter.setPen( bottomColor.darker( 130 ) );
		painter.setBrush( Qt::NoBrush );
		painter.drawRect( rect.adjusted( 0, 0, -1, -1 ) );
	}
	
	if ( mDock->features() & QDockWidget::DockWidgetVerticalTitleBar ) {
		QTransform transform;
		
		rect.setSize( QSize( rect.height(), rect.width() ) );
		transform.rotate( -90 );
		transform.translate( -rect.width(), 0 );
		
		painter.setTransform( transform );
	}
	
	// icon / title
	QStyleOptionButton optionB;
	optionB.initFrom( mDock );
	optionB.rect = rect.adjusted( 2, 0, -( orientation() == Qt::Horizontal ? minimumSizeHint().width() : minimumSizeHint().height() ), 0 );
	optionB.text = mDock->windowTitle();
	optionB.iconSize = windowIconSize();
	optionB.icon = icon();
	
	style()->drawControl( QStyle::CE_PushButtonLabel, &optionB, &painter, mDock );
}
Example #18
0
QSize K3bTimeoutWidget::sizeHint() const
{
  return minimumSizeHint();
}
Example #19
0
QSize Button::sizeHint() const {
	return minimumSizeHint();
}
Example #20
0
/*!
    Returns the recommended size of this widget.
*/
QSize UiAnalogGroup::sizeHint() const
{
    return minimumSizeHint();
}
Example #21
0
plannedOrderList::plannedOrderList(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) :
  QDialog( parent, name, modal, fl )
{
  setWindowTitle(tr("Planned Orders"));

  _planordid = -1;

  if ( !name )
    setObjectName( "plannedOrderList" );

  QVBoxLayout *plannedOrderListLayout = new QVBoxLayout( this, 5, 5, "plannedOrderListLayout"); 
  QHBoxLayout *layout6387 = new QHBoxLayout( 0, 0, 7, "layout6387"); 
  QVBoxLayout *layout6385 = new QVBoxLayout( 0, 0, 0, "layout6385"); 
  QHBoxLayout *layout6384 = new QHBoxLayout( 0, 0, 5, "layout6384"); 
  QVBoxLayout *Layout183 = new QVBoxLayout( 0, 0, 5, "Layout183"); 
  QVBoxLayout *Layout185 = new QVBoxLayout( 0, 0, 0, "Layout185"); 
  QHBoxLayout *layout6386 = new QHBoxLayout( 0, 0, 0, "layout6386"); 

    _warehouseGroup = new QGroupBox( this );
    QVBoxLayout *_warehouseGroupLayout = new QVBoxLayout( _warehouseGroup );
    _warehouseGroupLayout->setSpacing( 0 );
    _warehouseGroupLayout->setMargin( 5 );
    _warehouseGroupLayout->setAlignment( Qt::AlignTop );

    _allWarehouses = new QRadioButton(tr("&All Sites"), _warehouseGroup, "_allWarehouses");
    _allWarehouses->setChecked( TRUE );
    _warehouseGroupLayout->addWidget( _allWarehouses );

    _selectedWarehouse = new QRadioButton(tr("Site:"), _warehouseGroup, "_selectedWarehouse");
    _selectedWarehouse->setChecked( FALSE );
    layout6384->addWidget( _selectedWarehouse );

    _warehouse = new WComboBox( _warehouseGroup, "_warehouse" );
    _warehouse->setEnabled( FALSE );
    layout6384->addWidget( _warehouse );
    _warehouseGroupLayout->addLayout( layout6384 );
    layout6385->addWidget( _warehouseGroup );
    _warehouseGroup->setLayout( _warehouseGroupLayout );

    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
    layout6385->addItem( spacer );
    layout6387->addLayout( layout6385 );

    QSpacerItem* spacer_2 = new QSpacerItem( 223, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout6386->addItem( spacer_2 );

    _close = new QPushButton(tr("&Cancel"), this, "_close");
    Layout183->addWidget( _close );

    _select = new QPushButton(tr("&Select"), this, "_select");
    _select->setAutoDefault( TRUE );
    _select->setDefault( TRUE );
    Layout183->addWidget( _select );
    layout6386->addLayout( Layout183 );
    layout6387->addLayout( layout6386 );
    plannedOrderListLayout->addLayout( layout6387 );

    QLabel *_plannedOrdersLit = new QLabel(tr("Planned Orders:"), this, "_plannedOrdersLit");
    Layout185->addWidget( _plannedOrdersLit );

    _planord = new XTreeWidget( this);
    _planord->setObjectName("_planord" );
    Layout185->addWidget( _planord );
    plannedOrderListLayout->addLayout( Layout185 );

    resize( QSize(496, 360).expandedTo(minimumSizeHint()) );
    //clearWState( WState_Polished );

    // signals and slots connections
    connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
    connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
    connect( _planord, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
    connect( _selectedWarehouse, SIGNAL( toggled(bool) ), this, SLOT( sFillList() ) );
    connect( _warehouse, SIGNAL( newID(int) ), this, SLOT( sFillList() ) );
    connect( _selectedWarehouse, SIGNAL( toggled(bool) ), _warehouse, SLOT( setEnabled(bool) ) );

  setTabOrder(_allWarehouses, _selectedWarehouse);
  setTabOrder(_selectedWarehouse, _warehouse);
  setTabOrder(_warehouse, _planord);
  setTabOrder(_planord, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _allWarehouses);
  _planord->setFocus();

  _planord->addColumn(tr("PL/O #"),    _orderColumn, Qt::AlignLeft,  true, "number");
  _planord->addColumn(tr("Firmed"),              40, Qt::AlignCenter,true, "planord_firm");
  _planord->addColumn(tr("Whs."),        _whsColumn, Qt::AlignCenter,true, "warehous_code");
  _planord->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft,  true, "item_number");
  _planord->addColumn(tr("Description"),         -1, Qt::AlignLeft,  true, "descrip");

  sFillList();
}
Example #22
0
QSize TitleBar::sizeHint() const
{
    return minimumSizeHint();
}
Example #23
0
QSize OrientationWidget::sizeHint() const
{
	return minimumSizeHint();
}
Example #24
0
    _newAct->setShortcutContext(Qt::WidgetWithChildrenShortcut);
    _newAct->setToolTip(tr("Create new record"));
    _newAct->setEnabled(false);
    connect(_newAct, SIGNAL(triggered()), this, SLOT(sNew()));
    addAction(_newAct);

    connect(this, SIGNAL(valid(bool)), _infoAct, SLOT(setEnabled(bool)));

    _menuLabel = new QLabel(this);
    // Menu set up

    _menu = 0;
    _menuLabel->setPixmap(QPixmap(":/widgets/images/magnifier.png"));
    _menuLabel->installEventFilter(this);

    int height = minimumSizeHint().height();
    QString sheet = QLatin1String("QLineEdit{ padding-right: ");
    sheet += QString::number(_menuLabel->pixmap()->width() + 6);
    sheet += QLatin1String(";}");
    setStyleSheet(sheet);
    // Little hack. Somehow style sheet makes widget short. Put back height.
    setMinimumHeight(height);

    // Set default menu with standard actions
    QMenu* menu = new QMenu;
    menu->addAction(_listAct);
    menu->addAction(_searchAct);
    menu->addSeparator();
    menu->addAction(_infoAct);
    setMenu(menu);
Example #25
0
/* Network page details constructor: */
UIGlobalSettingsNetworkDetails::UIGlobalSettingsNetworkDetails(QWidget *pParent)
    : QIWithRetranslateUI2<QIDialog>(pParent
#ifdef Q_WS_MAC
    ,Qt::Sheet
#endif /* Q_WS_MAC */
    )
    , m_pItem(0)
{
    /* Apply UI decorations: */
    Ui::UIGlobalSettingsNetworkDetails::setupUi(this);

    /* Setup dialog: */
    setWindowIcon(QIcon(":/guesttools_16px.png"));

    /* Setup validators: */
    QString strTemplateIPv4("([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
                            "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
                            "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
                            "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])");
    QString strTemplateIPv6("[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
                            "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
                            "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
                            "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}");

    m_pIPv4Editor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv4), this));
    m_pNMv4Editor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv4), this));
    m_pIPv6Editor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv6), this));
    m_pNMv6Editor->setValidator(new QRegExpValidator(QRegExp("[1-9][0-9]|1[0-1][0-9]|12[0-8]"), this));
    m_pDhcpAddressEditor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv4), this));
    m_pDhcpMaskEditor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv4), this));
    m_pDhcpLowerAddressEditor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv4), this));
    m_pDhcpUpperAddressEditor->setValidator(new QRegExpValidator(QRegExp(strTemplateIPv4), this));

    /* Setup widgets */
    m_pIPv6Editor->setFixedWidthByText(QString().fill('X', 32) + QString().fill(':', 7));

#if 0 /* defined (Q_WS_WIN) */
    QStyleOption options1;
    options1.initFrom(m_pEnableManualCheckbox);
    QGridLayout *playout1 = qobject_cast<QGridLayout*>(m_pDetailsTabWidget->widget(0)->layout());
    int iWid1 = m_pEnableManualCheckbox->style()->pixelMetric(QStyle::PM_IndicatorWidth, &options1, m_pEnableManualCheckbox) +
                m_pEnableManualCheckbox->style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, &options1, m_pEnableManualCheckbox) -
                playout1->spacing() - 1;
    QSpacerItem *spacer1 = new QSpacerItem(iWid1, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
    playout1->addItem(spacer1, 1, 0, 4);
#else
    m_pEnableManualCheckbox->setVisible(false);
#endif

    QStyleOption options2;
    options2.initFrom(m_pEnabledDhcpServerCheckbox);
    QGridLayout *pLayout2 = qobject_cast<QGridLayout*>(m_pDetailsTabWidget->widget(1)->layout());
    int wid2 = m_pEnabledDhcpServerCheckbox->style()->pixelMetric(QStyle::PM_IndicatorWidth, &options2, m_pEnabledDhcpServerCheckbox) +
               m_pEnabledDhcpServerCheckbox->style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, &options2, m_pEnabledDhcpServerCheckbox) -
               pLayout2->spacing() - 1;
    QSpacerItem *pSpacer2 = new QSpacerItem(wid2, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
    pLayout2->addItem(pSpacer2, 1, 0, 4);

    /* Setup connections: */
    connect(m_pEnableManualCheckbox, SIGNAL(stateChanged(int)), this, SLOT (sltDhcpClientStatusChanged()));
    connect(m_pEnabledDhcpServerCheckbox, SIGNAL(stateChanged (int)), this, SLOT(sltDhcpServerStatusChanged()));

    /* Apply language settings: */
    retranslateUi();

    /* Fix minimum possible size: */
    resize(minimumSizeHint());
    qApp->processEvents();
    setFixedSize(minimumSizeHint());
}
FeaturedExchangesDialog::FeaturedExchangesDialog()
	: QDialog()
{
	exchangeNum=-1;
	ui.setupUi(this);
	ui.okButton->setEnabled(false);
	setWindowFlags(Qt::WindowCloseButtonHint);
    setWindowTitle("Qt Bitcoin Trader v"+baseValues.appVerStr+" - "+julyTr("FEATURED_EXCHANGES","Featured Exchanges"));

	QSettings listSettings(":/Resources/Exchanges/List.ini",QSettings::IniFormat);
	allExchangesList=listSettings.childGroups();

    {
    JulyHttp *httpGet=new JulyHttp("qbtapi.centrabit.com",0,this,true,false);
    connect(httpGet,SIGNAL(dataReceived(QByteArray,int)),this,SLOT(dataReceived(QByteArray,int)));
    httpGet->noReconnect=true;
    httpGet->sendData(145,"GET /?Object=General&Method=FeaturedExchanges");

	QElapsedTimer elapsedRequest;
	elapsedRequest.restart();
    int counter=0;
    while(cacheData.isEmpty()&&counter++<30&&elapsedRequest.elapsed()<3000)
    {
        QEventLoop loop;
        QTimer::singleShot(100,&loop,SLOT(quit()));
        loop.exec();
	}
    delete httpGet;
    featuredExchangesList=QString(mainWindow.getMidData("Exchanges\":[","]",&cacheData)).split(",");

    cacheData.clear();
    }

    for(int n=featuredExchangesList.count()-1;n>=0;n--)
    {
        if(featuredExchangesList.at(n).isEmpty())featuredExchangesList.removeAt(n);
    }
    if(featuredExchangesList.isEmpty())
    {
        QSettings settings(appDataDir+"/QtBitcoinTrader.cfg",QSettings::IniFormat);
        featuredExchangesList=settings.value("LastFeaturedExchanges",featuredExchangesList).toStringList();
    }
    else
    {
        QSettings settings(appDataDir+"/QtBitcoinTrader.cfg",QSettings::IniFormat);
        settings.setValue("LastFeaturedExchanges",featuredExchangesList);
    }

    for(int n=featuredExchangesList.count()-1;n>=0;n--)
    {
        if(featuredExchangesList.at(n).isEmpty())featuredExchangesList.removeAt(n);
        else
        if(featuredExchangesList.at(n).length()<2)featuredExchangesList[n].prepend("0");
    }

    if(featuredExchangesList.count()==0)
    {
        exchangeNum=-2;
        return;
    }

    removeNotValidExchanges();

	quint32 countCol=3;
	if(featuredExchangesList.count()<=4)countCol=2;
	for(int i=0;i<featuredExchangesList.count();i++)
	{
		QString currentName=listSettings.value(featuredExchangesList.at(i)+"/Name").toString();
		QString currentLogo=fixLogo(listSettings.value(featuredExchangesList.at(i)+"/Logo").toString());
        QString currentURL =fixURL(listSettings.value(featuredExchangesList.at(i)+"/GetApiUrl").toString());
		if(currentName.isEmpty()||currentLogo.isEmpty()||currentURL.isEmpty())continue;

		ExchangeButton *exchangeItem = new ExchangeButton(currentLogo,loadCurrencies(currentName),currentURL,featuredExchangesListIndex.at(i),this);

		if(countCol==3 && i==featuredExchangesList.count()-1 && (i-qFloor(i/countCol)*countCol)==0)i++;
		ui.gridLayoutExchange->addWidget(exchangeItem,qFloor(i/countCol),i-qFloor(i/countCol)*countCol,Qt::AlignCenter);
	}

    julyTranslator.translateUi(this);
	setFixedSize(minimumSizeHint());
}
Example #27
0
/*
 *  Constructs a Options1 as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
Options1::Options1( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "General" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    GeneralLayout = new QVBoxLayout( this, 0, 6, "GeneralLayout"); 

    generalBox = new QGroupBox( this, "generalBox" );
    generalBox->setMargin( 0 );
    generalBox->setColumnLayout(0, Qt::Vertical );
    generalBox->layout()->setSpacing( 6 );
    generalBox->layout()->setMargin( 11 );
    generalBoxLayout = new QVBoxLayout( generalBox->layout() );
    generalBoxLayout->setAlignment( Qt::AlignTop );

    kcfg_ShowSplashscreen = new QCheckBox( generalBox, "kcfg_ShowSplashscreen" );
    generalBoxLayout->addWidget( kcfg_ShowSplashscreen );

    kcfg_ShowTrayIcon = new QCheckBox( generalBox, "kcfg_ShowTrayIcon" );
    generalBoxLayout->addWidget( kcfg_ShowTrayIcon );

    layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); 
    spacer3_2 = new QSpacerItem( 16, 21, QSizePolicy::Fixed, QSizePolicy::Minimum );
    layout5->addItem( spacer3_2 );

    kcfg_AnimateTrayIcon = new QCheckBox( generalBox, "kcfg_AnimateTrayIcon" );
    kcfg_AnimateTrayIcon->setEnabled( FALSE );
    layout5->addWidget( kcfg_AnimateTrayIcon );
    generalBoxLayout->addLayout( layout5 );

    kcfg_ShowPlayerWindow = new QCheckBox( generalBox, "kcfg_ShowPlayerWindow" );
    generalBoxLayout->addWidget( kcfg_ShowPlayerWindow );

    layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); 

    textLabel1 = new QLabel( generalBox, "textLabel1" );
    layout4->addWidget( textLabel1 );

    kcfg_CoverPreviewSize = new QSpinBox( generalBox, "kcfg_CoverPreviewSize" );
    kcfg_CoverPreviewSize->setMaxValue( 150 );
    kcfg_CoverPreviewSize->setMinValue( 50 );
    kcfg_CoverPreviewSize->setValue( 100 );
    layout4->addWidget( kcfg_CoverPreviewSize );
    spacer7 = new QSpacerItem( 30, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout4->addItem( spacer7 );
    generalBoxLayout->addLayout( layout4 );

    layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 

    textLabel1_2 = new QLabel( generalBox, "textLabel1_2" );
    textLabel1_2->setMinimumSize( QSize( 150, 0 ) );
    layout7->addWidget( textLabel1_2 );

    kComboBox_browser = new KComboBox( FALSE, generalBox, "kComboBox_browser" );
    kComboBox_browser->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kComboBox_browser->sizePolicy().hasHeightForWidth() ) );
    kComboBox_browser->setMinimumSize( QSize( 150, 0 ) );
    layout7->addWidget( kComboBox_browser );
    spacer7_2 = new QSpacerItem( 50, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer7_2 );
    generalBoxLayout->addLayout( layout7 );

    layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); 

    checkBox_customBrowser = new QCheckBox( generalBox, "checkBox_customBrowser" );
    checkBox_customBrowser->setEnabled( TRUE );
    checkBox_customBrowser->setMinimumSize( QSize( 150, 0 ) );
    layout8->addWidget( checkBox_customBrowser );

    kLineEdit_customBrowser = new KLineEdit( generalBox, "kLineEdit_customBrowser" );
    kLineEdit_customBrowser->setEnabled( FALSE );
    kLineEdit_customBrowser->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kLineEdit_customBrowser->sizePolicy().hasHeightForWidth() ) );
    kLineEdit_customBrowser->setMinimumSize( QSize( 150, 0 ) );
    layout8->addWidget( kLineEdit_customBrowser );
    spacer7_2_3 = new QSpacerItem( 50, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout8->addItem( spacer7_2_3 );
    generalBoxLayout->addLayout( layout8 );
    GeneralLayout->addWidget( generalBox );

    componentsBox = new QGroupBox( this, "componentsBox" );
    componentsBox->setMargin( 0 );
    componentsBox->setColumnLayout(0, Qt::Vertical );
    componentsBox->layout()->setSpacing( 6 );
    componentsBox->layout()->setMargin( 11 );
    componentsBoxLayout = new QVBoxLayout( componentsBox->layout() );
    componentsBoxLayout->setAlignment( Qt::AlignTop );

    kcfg_UseScores = new QCheckBox( componentsBox, "kcfg_UseScores" );
    kcfg_UseScores->setChecked( FALSE );
    componentsBoxLayout->addWidget( kcfg_UseScores );

    kcfg_UseRatings = new QCheckBox( componentsBox, "kcfg_UseRatings" );
    componentsBoxLayout->addWidget( kcfg_UseRatings );
    GeneralLayout->addWidget( componentsBox );

    groupBox2 = new QGroupBox( this, "groupBox2" );
    groupBox2->setMargin( 0 );
    groupBox2->setColumnLayout(0, Qt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new QVBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( Qt::AlignTop );

    kcfg_SavePlaylist = new QCheckBox( groupBox2, "kcfg_SavePlaylist" );
    groupBox2Layout->addWidget( kcfg_SavePlaylist );

    kcfg_RelativePlaylist = new QCheckBox( groupBox2, "kcfg_RelativePlaylist" );
    groupBox2Layout->addWidget( kcfg_RelativePlaylist );
    GeneralLayout->addWidget( groupBox2 );
    spacer5 = new QSpacerItem( 20, 152, QSizePolicy::Minimum, QSizePolicy::Expanding );
    GeneralLayout->addItem( spacer5 );
    languageChange();
    resize( QSize(417, 686).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_ShowTrayIcon, SIGNAL( toggled(bool) ), kcfg_AnimateTrayIcon, SLOT( setEnabled(bool) ) );
    connect( checkBox_customBrowser, SIGNAL( toggled(bool) ), kComboBox_browser, SLOT( setDisabled(bool) ) );
    connect( checkBox_customBrowser, SIGNAL( toggled(bool) ), kLineEdit_customBrowser, SLOT( setEnabled(bool) ) );

    // buddies
    textLabel1->setBuddy( kcfg_CoverPreviewSize );
    textLabel1_2->setBuddy( kComboBox_browser );
    init();
}
Example #28
0
QSize K3b::FillStatusDisplayWidget::sizeHint() const
{
    return minimumSizeHint();
}
/*
 *  Constructs a ConfigToolboxDialog as 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.
 */
ConfigToolboxDialog::ConfigToolboxDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ConfigToolboxDialog" );
    ConfigToolboxDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "ConfigToolboxDialogLayout"); 

    Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); 
    Spacer2 = new QSpacerItem( 342, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout2->addItem( Spacer2 );

    PushButton3 = new QPushButton( this, "PushButton3" );
    PushButton3->setDefault( TRUE );
    Layout2->addWidget( PushButton3 );

    PushButton4 = new QPushButton( this, "PushButton4" );
    Layout2->addWidget( PushButton4 );

    ConfigToolboxDialogLayout->addMultiCellLayout( Layout2, 1, 1, 0, 1 );

    Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4"); 

    buttonAdd = new QPushButton( this, "buttonAdd" );
    buttonAdd->setEnabled( FALSE );

    Layout4->addWidget( buttonAdd, 1, 1 );
    Spacer3 = new QSpacerItem( 111, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout4->addItem( Spacer3, 1, 0 );

    listViewTools = new QListView( this, "listViewTools" );
    listViewTools->addColumn( tr( "Available Tools" ) );
    listViewTools->setSelectionMode( QListView::Extended );
    listViewTools->setResizeMode( QListView::LastColumn );

    Layout4->addMultiCellWidget( listViewTools, 0, 0, 0, 1 );

    ConfigToolboxDialogLayout->addLayout( Layout4, 0, 0 );

    Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5"); 

    buttonRemove = new QPushButton( this, "buttonRemove" );
    buttonRemove->setEnabled( FALSE );

    Layout5->addWidget( buttonRemove, 1, 0 );

    listViewCommon = new QListView( this, "listViewCommon" );
    listViewCommon->addColumn( tr( "Common Widgets Page" ) );
    listViewCommon->setSelectionMode( QListView::Extended );
    listViewCommon->setResizeMode( QListView::LastColumn );

    Layout5->addMultiCellWidget( listViewCommon, 0, 0, 0, 3 );

    buttonDown = new QToolButton( this, "buttonDown" );
    buttonDown->setEnabled( FALSE );
    buttonDown->setPixmap( QPixmap::fromMimeSource( "designer_s_down.png" ) );

    Layout5->addWidget( buttonDown, 1, 3 );
    Spacer4 = new QSpacerItem( 41, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout5->addItem( Spacer4, 1, 1 );

    buttonUp = new QToolButton( this, "buttonUp" );
    buttonUp->setEnabled( FALSE );
    buttonUp->setPixmap( QPixmap::fromMimeSource( "designer_s_up.png" ) );

    Layout5->addWidget( buttonUp, 1, 2 );

    ConfigToolboxDialogLayout->addLayout( Layout5, 0, 1 );
    languageChange();
    resize( QSize(403, 467).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addTool() ) );
    connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( removeTool() ) );
    connect( buttonUp, SIGNAL( clicked() ), this, SLOT( moveToolUp() ) );
    connect( buttonDown, SIGNAL( clicked() ), this, SLOT( moveToolDown() ) );
    connect( listViewTools, SIGNAL( clicked(QListViewItem*) ), this, SLOT( currentToolChanged(QListViewItem*) ) );
    connect( listViewCommon, SIGNAL( clicked(QListViewItem*) ), this, SLOT( currentCommonToolChanged(QListViewItem*) ) );
    connect( PushButton3, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( PushButton4, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( PushButton3, SIGNAL( clicked() ), this, SLOT( ok() ) );
    connect( listViewTools, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( addTool() ) );
    init();
}
Example #30
0
IngredientParserDialog::IngredientParserDialog( const UnitList &units, QWidget* parent, const char* name )
		: KDialog( parent ),
		m_unitList(units)
{
	//setButtonBoxOrientation( Qt::Vertical );
	setObjectName( name );
	setCaption(i18nc( "@title:window", "Ingredient Parser" ));
	setButtons(KDialog::Ok | KDialog::Cancel);
	setDefaultButton(KDialog::Ok);
	setModal( true );

	KVBox *page = new KVBox( this );
	setMainWidget( page );

	textLabel1 = new QLabel( page );
	textLabel1->setObjectName( "textLabel1" );
	textLabel1->setTextFormat( Qt::RichText );

	ingredientTextEdit = new KTextEdit( page );
	ingredientTextEdit->setObjectName( "ingredientTextEdit" );
	ingredientTextEdit->setAcceptRichText( false );

	parseButton = new KPushButton( page );

	previewLabel = new QLabel( page );
	previewLabel->setObjectName( "previewLabel" );
	previewLabel->setTextFormat( Qt::RichText );

	previewIngView = new K3ListView( page );
	previewIngView->setSorting(-1);
	previewIngView->addColumn( i18nc( "@title:column", "Ingredient" ) );
	previewIngView->addColumn( i18nc( "@title:column", "Amount" ) );
	previewIngView->addColumn( i18nc( "@title:column", "Unit" ) );
	previewIngView->addColumn( i18nc( "@title:column", "Preparation Method" ) );

	languageChange();
	setInitialSize( QSize(577, 371).expandedTo(minimumSizeHint()) );

	previewIngView->setItemsRenameable( true );
	previewIngView->setRenameable( 0, true );
	previewIngView->setRenameable( 1, true );
	previewIngView->setRenameable( 2, true );
	previewIngView->setRenameable( 3, true );

	previewIngView->setSelectionMode( Q3ListView::Extended );

	ingredientTextEdit->setText( QApplication::clipboard()->text() );
	ingredientTextEdit->selectAll();

	QWidget *buttonWidget = new QWidget( page );
	QHBoxLayout *buttonBox = new QHBoxLayout(buttonWidget);
	QSpacerItem *horizontalSpacing = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
	buttonGroup = new QPushButton( i18nc("@action:button", "Set &Header"), buttonWidget );
	buttonGroup->setWhatsThis( i18nc( "@info:whatsthis", "If an ingredient header is detected as an ingredient, select it and click this button so that Krecipes will recognize it as a header.  All the ingredients below the header will be included within that group.\n\nAlternatively, if you select multiple ingredients and click this button, those ingredients will be grouped together.") );
	buttonBox->addWidget( buttonGroup );
	buttonBox->addItem( horizontalSpacing );

	KMenu *kpop = new KMenu( previewIngView );
	kpop->addAction( i18nc( "@item:inmenu", "&Delete" ), this, SLOT( removeIngredient() ), Qt::Key_Delete );
	kpop->addAction( i18nc( "@item:inmenu", "Set &Header") , this, SLOT( convertToHeader() ) );

	connect( parseButton, SIGNAL(clicked()), this, SLOT(parseText()) );
	connect( buttonGroup, SIGNAL(clicked()), this, SLOT(convertToHeader()) );
}