Esempio n. 1
0
QFrame *DialogFrame::line()
{
  QFrame *frame = new QFrame(this);
  frame->setMinimumHeight(1);
  frame->setStyleSheet(LS("border:1px solid #e5e5e5;"));
  return frame;
}
Esempio n. 2
0
//!
//! Constructor of the TimelinePanel class.
//!
//! \param parent The parent widget the created instance will be a child of.
//! \param flags Extra widget options.
//!
TimelinePanel::TimelinePanel ( QWidget *parent /* = 0 */, Qt::WindowFlags flags /* = 0 */ ) :
    ViewPanel(ViewPanel::T_Timeline, parent, flags),
    m_scaleScrollBar(0),
    m_timelineWidget(0),
    m_controlToolBar(0)
{
    setupUi(this);

    // create the timeline widget as a child of the scroll area
    m_timelineWidget = new TimelineWidget(ui_scrollArea);
    ui_scrollArea->setWidget(m_timelineWidget);

    // set up signal relay connections from the timeline widget
    connect(m_timelineWidget, SIGNAL(currentFrameSet(int)), SIGNAL(currentFrameSet(int)));
    connect(m_timelineWidget, SIGNAL(startFrameSet(int)), SIGNAL(startFrameSet(int)));
    connect(m_timelineWidget, SIGNAL(endFrameSet(int)), SIGNAL(endFrameSet(int)));
    connect(m_timelineWidget, SIGNAL(inFrameSet(int)), SIGNAL(inFrameSet(int)));
    connect(m_timelineWidget, SIGNAL(outFrameSet(int)), SIGNAL(outFrameSet(int)));

    // set up action connections
    connect(ui_autoScrollAction, SIGNAL(toggled(bool)), m_timelineWidget, SLOT(setAutoScroll(bool)));

    // create the tool bar for timeline controls
    m_controlToolBar = new QToolBar("Timeline Controls", this);
    m_controlToolBar->setStyleSheet(
        "QToolButton {"
        "    max-height: 24px;"
        "}"
    );
    ui_horizontalLayout->insertWidget(2, m_controlToolBar);

    // set the special value text for the frame step spin box to an empty string that is displayed instead of "1st"
    ui_frameStepSpinBox->setSpecialValueText(" ");

	// Give a little space to the keyframe widget
	QWidget *spacerWidget = new QWidget();
    spacerWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
	spacerWidget->setMinimumHeight(5);
	spacerWidget->setMaximumHeight(5);
	ui_verticalLayout->insertWidget(0, spacerWidget);

	// insert border widget to ui_verticalLayout at index 1 just over toolbar vbox
	QString borderStyle ( "border-top: 1px solid #393939; border-bottom: 1px solid #959595" );
	QFrame *borderFrame = new QFrame(this);
	borderFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	borderFrame->setMinimumHeight(2);
	borderFrame->setMaximumHeight(2);
	borderFrame->setStyleSheet(borderStyle);
	ui_verticalLayout->insertWidget(2, borderFrame);

	// insert border widget to ui_verticalLayout at index 1 just over toolbar vbox
	QFrame *borderFrame2 = new QFrame(this);
	borderFrame2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	borderFrame2->setMinimumHeight(2);
	borderFrame2->setMaximumHeight(2);
	borderFrame2->setStyleSheet(borderStyle);
	ui_verticalLayout->insertWidget(4, borderFrame2);

}
Esempio n. 3
0
//BEGIN class PinMapEditor
PinMapEditor::PinMapEditor( PinMapping * pinMapping, MicroInfo * picInfo, QWidget * parent, const char * name )
	: //KDialog( parent, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
	  KDialog( parent ) //, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
{
    setName(name);
    setModal(true);
    setCaption(i18n("Pin Map Editor"));
    setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel);
    setDefaultButton(KDialog::Ok);
    showButtonSeparator(true);

	m_pPinMapping = pinMapping;
	
	m_pPinMapDocument = new PinMapDocument();
	
	Q3Accel * accel = new Q3Accel( this );
	accel->connectItem( accel->insertItem( Qt::Key_Delete ),
						m_pPinMapDocument,
						SLOT(deleteSelection()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::selectAll().primary() ),
						m_pPinMapDocument,
						SLOT(selectAll()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::undo().primary() ),
						m_pPinMapDocument,
						SLOT(undo()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::redo().primary() ),
						m_pPinMapDocument,
						SLOT(redo()) );
	
	
	QFrame * f = new QFrame(this);
	f->setMinimumWidth( 480 );
	f->setMinimumHeight( 480 );
	
	f->setFrameShape( QFrame::Box );
	f->setFrameShadow( QFrame::Plain );
	QVBoxLayout * fLayout = new QVBoxLayout( f, 1, 0, "fLayout" );

	ViewContainer * vc = new ViewContainer( 0, f );
	fLayout->addWidget( vc );
	
	m_pPinMapView = static_cast<PinMapView*>(m_pPinMapDocument->createView( vc, 0 ));
	
	//qApp->processEvents(); // 2015.07.07 - do not process events, if it is not urgently needed; might generate crashes?
	
	m_pPinMapDocument->init( *m_pPinMapping, picInfo );
	
    showButtonSeparator( false );
	// enableButtonSeparator( false );

	setMainWidget(f);
}
Esempio n. 4
0
SaveScm::SaveScm( QWidget *parent, const char *name )
	: QDialog( parent, name, TRUE )
{
	setFocusPolicy(QWidget::StrongFocus);
	setCaption( i18n("Add a color scheme"));
	
	QBoxLayout *topLayout = new QVBoxLayout( this, 10 );

	QBoxLayout *stackLayout = new QVBoxLayout( 3 );
	topLayout->addLayout( stackLayout );

	nameLine = new QLineEdit( this );
	nameLine->setFocus();
	nameLine->setMaxLength(18);
	nameLine->setFixedHeight( nameLine->sizeHint().height() );
	
	QLabel* tmpQLabel;
	tmpQLabel = new QLabel( nameLine, 
			i18n( "&Enter a name for the new color scheme\n"\
					"to be added to your personal list.\n\n"\
					"The colors currently used in the preview will\n"\
					"be copied into this scheme to begin with." ), this );
	tmpQLabel->setAlignment( AlignLeft | AlignBottom | ShowPrefix );
	tmpQLabel->setFixedHeight( tmpQLabel->sizeHint().height() );
	tmpQLabel->setMinimumWidth( tmpQLabel->sizeHint().width() );
	
	stackLayout->addStretch( 10 );
	stackLayout->addWidget( tmpQLabel );
	stackLayout->addWidget( nameLine );
	
	QFrame* tmpQFrame;
	tmpQFrame = new QFrame( this );
	tmpQFrame->setFrameStyle( QFrame::HLine | QFrame::Sunken );
	tmpQFrame->setMinimumHeight( tmpQFrame->sizeHint().height() );
	
	topLayout->addWidget( tmpQFrame );
	
	KButtonBox *bbox = new KButtonBox( this );
	bbox->addStretch( 10 );
	
	QPushButton *ok = bbox->addButton( i18n( "&OK" ) );
	connect( ok, SIGNAL( clicked() ), SLOT( accept() ) );
	
	QPushButton *cancel = bbox->addButton( i18n( "&Cancel" ) );
	connect( cancel, SIGNAL( clicked() ), SLOT( reject() ) );
	
	bbox->layout();
	topLayout->addWidget( bbox );

    topLayout->activate();
	
	resize( 250, 0 );
}
Esempio n. 5
0
QGctpBox::QGctpBox( QWidget* parent, const char* name )
   : QVBox( parent, name )
{
   QFrame *line = new QFrame( this );
   line->setMinimumHeight( 5 );
   label = new QLabel( this, "label" );
   lineEdit = new QLineEdit( "0.000000", this, "lineEdit" );
   lineEdit->setValidator( new QDoubleValidator( 0.0, 1000000.0, 6, lineEdit ) );
   spinBox = new QSpinBox( this, "spinBox" );
   spinBox->setValue( 0 );
   dmsEdit = new QDmsEdit( this, "dmsEdit" );
   dmsEdit->setValue( 0 );

   activeEdit = NULL;
   name = QString::null;

   hide();
   initializeHoldValues();
}
Esempio n. 6
0
AccountWidget::AccountWidget( QWidget* parent )
    : QWidget( parent )
    , TomahawkUtils::DpiScaler( this )
{
    QHBoxLayout *mainLayout = new QHBoxLayout();
    TomahawkUtils::unmarginLayout( mainLayout );
    setLayout( mainLayout );
    setContentsMargins( 0, scaledY( 8 ), 0, scaledY( 8 ) );

    m_imageLabel = new QLabel( this );
    mainLayout->addWidget( m_imageLabel );
    mainLayout->setSpacing( scaledX( 4 ) );

    QGridLayout* vLayout = new QGridLayout();
    vLayout->setSpacing( 8 );
    mainLayout->addLayout( vLayout );

    QFrame* idContainer = new QFrame( this );
    idContainer->setAttribute( Qt::WA_TranslucentBackground, false );
    vLayout->addWidget( idContainer, 0, 0 );

    QHBoxLayout* idContLayout = new QHBoxLayout();
    idContainer->setLayout( idContLayout );
    idContainer->setContentsMargins( 0, 0, 0, 0 );
    idContLayout->setMargin( 2 );

    m_idLabel = new ElidedLabel( idContainer );
    m_idLabel->setElideMode( Qt::ElideRight );
    m_idLabel->setContentsMargins( 3, 0, 3, 0 );
    m_idLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
    m_idLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    idContLayout->addWidget( m_idLabel );

    m_spinnerWidget = new QWidget( idContainer );
    QSize spinnerSize = 16 > TomahawkUtils::defaultFontHeight()  ?
                            QSize( 16, 16 ) :
                            QSize( TomahawkUtils::defaultFontHeight(),
                                   TomahawkUtils::defaultFontHeight() );
    m_spinnerWidget->setFixedSize( spinnerSize );
    idContLayout->addWidget( m_spinnerWidget );
    m_spinnerWidget->setContentsMargins( 0, 1, 0, 0 );
    m_spinner = new AnimatedSpinner( m_spinnerWidget->size() - QSize( 2, 2 ), m_spinnerWidget );

    idContainer->setStyleSheet( QString( "QFrame {"
                                "border: 1px solid #e9e9e9;"
                                "border-radius: %1px;"
                                "background: #e9e9e9;"
                                "}" ).arg( idContainer->sizeHint().height() / 2 + 1 ) );
    idContainer->setMinimumHeight( spinnerSize.height() + 6 /*margins*/ );

    m_statusToggle = new SlideSwitchButton( this );
    m_statusToggle->setContentsMargins( 0, 0, 0, 0 );
    m_statusToggle->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
    m_statusToggle->setFixedSize( m_statusToggle->sizeHint() );
    QHBoxLayout *statusToggleLayout = new QHBoxLayout();
    vLayout->addLayout( statusToggleLayout, 0, 1, 1, 1 );
    statusToggleLayout->addStretch();
    statusToggleLayout->addWidget( m_statusToggle );

    m_inviteContainer = new QFrame( this );
    m_inviteContainer->setObjectName( "inviteContainer" );
    vLayout->addWidget( m_inviteContainer, 1, 0 );
    m_inviteContainer->setStyleSheet( QString( "QWidget { background: white; } QFrame#%1 { border: 1px solid %2; }" ).arg( m_inviteContainer->objectName() ).arg( TomahawkStyle::BORDER_LINE.name() ) );
    m_inviteContainer->setMinimumWidth( m_inviteContainer->logicalDpiX() * 2 );
    m_inviteContainer->setContentsMargins( 1, 1, 1, 2 );
    m_inviteContainer->setAttribute( Qt::WA_TranslucentBackground, false );

    QHBoxLayout* containerLayout = new QHBoxLayout();
    m_inviteContainer->setLayout( containerLayout );
    TomahawkUtils::unmarginLayout( containerLayout );
    containerLayout->setContentsMargins( 1, 1, 0, 0 );

    m_addAccountIcon = new QLabel( m_inviteContainer );
    m_addAccountIcon->setContentsMargins( 1, 0, 0, 0 );
    m_addAccountIcon->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::AddContact, TomahawkUtils::Original, QSize( 16, 16 ) ) );
    m_addAccountIcon->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding );
    m_addAccountIcon->setAlignment( Qt::AlignCenter );
    containerLayout->addWidget( m_addAccountIcon );

    m_inviteEdit = new QLineEdit( m_inviteContainer );
    m_inviteEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
    containerLayout->addWidget( m_inviteEdit );
    m_inviteEdit->setFrame( false );

    m_inviteButton = new QPushButton( this );
    m_inviteButton->setMinimumWidth( m_inviteButton->logicalDpiX() * 0.8 );
    m_inviteButton->setText( AccountWidget::tr( "Invite" ) );
    m_inviteButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred );
    vLayout->addWidget( m_inviteButton, 1, 1 );
    vLayout->setColumnStretch( 0, 1 );

#ifdef Q_OS_MAC
    layout()->setContentsMargins( 0, 0, 0, 0 );
#endif

    setInviteWidgetsEnabled( false );
}
Esempio n. 7
0
Zoom::Zoom( QWidget *parent, const char *name )
      : QDialog( parent, name)
{
      setFocusPolicy(QWidget::StrongFocus);
      
      mag = 1;
      
      int border = 10;
      
      QBoxLayout *topLayout = new QVBoxLayout( this, border );
      
      topLayout->addStretch( 10 );

      //sbMag = new KSpinBox( this );
      sbMag = new QComboBox (false, this);

      // (2.0) make this configurable if needed -- at least don't hard code!

      unsigned int i;
      mags = new int [21];
      for (i = 1; i <= 10; i++)
	mags [i] = (int) (100*i/(10));

      for (i = 1; i <= 10; i++)
	mags [i+10] = (int)(100+200*i/(10));

      for (i = 1; i <= 20; i++)
	sbMag->insertItem( withPercent (mags[i]) );

      //      sbMag->adjustSize();
      sbMag->setMinimumSize( sbMag->size() );
      //      connect ( sbMag, SIGNAL (valueIncreased()),		SLOT (slotValueIncreased()) );
      //      connect ( sbMag, SIGNAL (valueDecreased()),		SLOT (slotValueDecreased()) );
      connect (sbMag, SIGNAL (activated (const char *)),
	       SLOT (slotZoom (const char *)) );

      QLabel* tmpQLabel;
      tmpQLabel = new QLabel( sbMag, i18n("&Zoom factor"), this );
      tmpQLabel->setMinimumSize( tmpQLabel->sizeHint() );
      
      topLayout->addWidget( tmpQLabel );
      topLayout->addWidget( sbMag );
      
      QFrame* tmpQFrame;
      tmpQFrame = new QFrame( this );
      tmpQFrame->setFrameStyle( QFrame::HLine | QFrame::Sunken );
      tmpQFrame->setMinimumHeight( tmpQFrame->sizeHint().height() );
      
      topLayout->addWidget( tmpQFrame );
      
      // CREATE BUTTONS
      
      KButtonBox *bbox = new KButtonBox( this );
      bbox->addStretch( 10 );
      
      /*
      okButton = bbox->addButton( i18n("&OK") );
      connect( okButton, SIGNAL(clicked()), SLOT(slotOk ()) );
      okButton->setEnabled (false);

      apply = bbox->addButton( i18n("&Apply") );
      connect( apply, SIGNAL(clicked()), SLOT(applyZoom()) );
      apply->setEnabled (false);
      */
      QButton *close = bbox->addButton( i18n("&Close") );
      connect( close, SIGNAL(clicked()), SLOT(reject()) );
              
      bbox->layout();
      topLayout->addWidget( bbox );

      topLayout->activate();
      
      resize( 200,0 );
}
Esempio n. 8
0
PasswordDialog::PasswordDialog(const char *head, QWidget* parent, const char* name, bool modal, WFlags wflags)
   : QDialog(parent, name, modal, wflags)
{
    debugT("Here we go!!\n");
    
   _head = head;

   // (David) Layout management
   QVBoxLayout *vLay = new QVBoxLayout(this, 10 /* border */, 5);

   //
   // Bei Bedarf einen kleinen Kommentar als Label einfuegen
   // English please !!! David.
   if (_head)
   {
      QLabel *l;
      
      l = new QLabel(_head, this);
      l->adjustSize();
      l->setMinimumSize(l->size());
      vLay->addWidget(l);
      // l->setGeometry( 10, 10, 200, 20 );
   }

   // The horizontal layout for label + lineedit
   QHBoxLayout *hLay = new QHBoxLayout(5);
   vLay->addLayout(hLay);
   //
   // Die eine oder zwei Zeile(n) mit der Passwortabfrage
   //
   QLabel *l_password = new QLabel(klocale->translate("Password"), this);
   l_password->adjustSize();
   l_password->setMinimumSize(l_password->size());
   hLay->addWidget(l_password,0);
   //l_password->setGeometry( 10, 40, 80, 30 );
   
   _w_password = new QLineEdit( this );
   //_w_password->setGeometry( 90, 40, 100, 30 );
   _w_password->setEchoMode( QLineEdit::Password );
   _w_password->adjustSize();
   _w_password->setFixedHeight(_w_password->height());
   hLay->addWidget(_w_password,10);
   
   //
   // Connect vom LineEdit herstellen und Accelerator
   //
   QAccel *ac = new QAccel(this);
   ac->connectItem( ac->insertItem(Key_Escape), this, SLOT(reject()) );
   
   connect( _w_password, SIGNAL(returnPressed()), SLOT(accept()) );
   
   //
   // Eine vertikale Linie erzeugen
   //
   QFrame *f = new QFrame(this);
   f->setLineWidth(1);
   f->setMidLineWidth(1);
   f->setFrameStyle( QFrame::HLine|QFrame::Raised);
   //f->setGeometry( 10, 80, 180, 2 );
   f->setMinimumHeight(5);
   vLay->addWidget(f,0);
   
   //
   // Die Buttons "OK" & "Cancel" erzeugen
   //
   QHBoxLayout *hBLay = new QHBoxLayout(5);
   vLay->addLayout(hBLay);

   hBLay->addStretch();

   QPushButton *b1, *b2;
   b1 = new QPushButton(klocale->translate("OK"), this);
   //b1->setGeometry( 10, 90, 80, 30 );
   b1->adjustSize();
   b1->setFixedSize(b1->size());   
   hBLay->addWidget(b1);

   hBLay->addStretch();
   //or hBLay->addSpacing(10);
   
   b2 = new QPushButton(klocale->translate("Cancel"), this);
   //b2->setGeometry( 110, 90, 80, 30 );
   b2->adjustSize();
   b2->setFixedSize(b2->size());   
   hBLay->addWidget(b2);

   hBLay->addStretch();
   
   // Buttons mit Funktionaliataet belegen
   connect( b1, SIGNAL(clicked()), SLOT(accept()) );
   connect( b2, SIGNAL(clicked()), SLOT(reject()) );
   
   // Fenstertitel
   setCaption(klocale->translate("Password"));
   
   // Focus
   _w_password->setFocus();
   
   vLay->activate();
   setMinimumSize(200, 50);
   setMaximumSize(300, 100);

   debugT("Hi folks, thats it\n");
}
ConfigureThemesDialog::ConfigureThemesDialog( QWidget *parent )
  : KDialog( parent ), d( new Private( this ) )
{
  setAttribute( Qt::WA_DeleteOnClose );
  setWindowModality( Qt::ApplicationModal ); // FIXME: Sure ?
  setButtons( Ok | Cancel );
  setWindowTitle( i18n( "Customize Themes" ) );

  QWidget * base = new QWidget( this );
  setMainWidget( base );

  QGridLayout * g = new QGridLayout( base );

  d->mThemeList = new ThemeListWidget( base );
  d->mThemeList->setSortingEnabled( true );
  g->addWidget( d->mThemeList, 0, 0, 5, 1 );

  connect( d->mThemeList, SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ),
           SLOT( themeListCurrentItemChanged( QListWidgetItem *, QListWidgetItem * ) ) );

  d->mNewThemeButton = new QPushButton( i18n( "New Theme" ), base );
  d->mNewThemeButton->setIcon( KIcon( QLatin1String( "document-new" ) ) );
  d->mNewThemeButton->setIconSize( QSize( KIconLoader::SizeSmall, KIconLoader::SizeSmall ) );
  g->addWidget( d->mNewThemeButton, 0, 1 );

  connect( d->mNewThemeButton, SIGNAL( clicked() ),
           SLOT( newThemeButtonClicked() ) );

  d->mCloneThemeButton = new QPushButton( i18n( "Clone Theme" ), base );
  d->mCloneThemeButton->setIcon( KIcon( QLatin1String( "edit-copy" ) ) );
  d->mCloneThemeButton->setIconSize( QSize( KIconLoader::SizeSmall, KIconLoader::SizeSmall ) );
  g->addWidget( d->mCloneThemeButton, 1, 1 );

  connect( d->mCloneThemeButton, SIGNAL( clicked() ),
           SLOT( cloneThemeButtonClicked() ) );

  QFrame * f = new QFrame( base );
  f->setFrameStyle( QFrame::Sunken | QFrame::HLine );
  f->setMinimumHeight( 24 );
  g->addWidget( f, 2, 1, Qt::AlignVCenter );

  d->mDeleteThemeButton = new QPushButton( i18n( "Delete Theme" ), base );
  d->mDeleteThemeButton->setIcon( KIcon( QLatin1String( "edit-delete" ) ) );
  d->mDeleteThemeButton->setIconSize( QSize( KIconLoader::SizeSmall, KIconLoader::SizeSmall ) );
  g->addWidget( d->mDeleteThemeButton, 3, 1 );

  connect( d->mDeleteThemeButton, SIGNAL( clicked() ),
           SLOT( deleteThemeButtonClicked() ) );

  d->mEditor = new ThemeEditor( base );
  g->addWidget( d->mEditor, 5, 0, 1, 2 );

  connect( d->mEditor, SIGNAL( themeNameChanged() ),
           SLOT( editedThemeNameChanged() ) );

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

  connect( this, SIGNAL( okClicked() ),
           SLOT( okButtonClicked() ) );

  d->fillThemeList();
}
Esempio n. 10
0
//!
//! Constructor of the PanelFrame class.
//!
//! \param panelType The type of the panel to create.
//! \param parent A widget the created instance will be child of.
//! \param flags Extra widget options.
//! \param showToolBars Flag to control whether to display tool bars in the panel frame.
//!
PanelFrame::PanelFrame ( Panel::Type panelType, QWidget *parent /* = 0 */, Qt::WindowFlags flags /* = 0 */, bool showToolBars /* = 0 */ ) :
    QFrame(parent, flags),
    m_mainToolBar(0),
    m_panelToolBar(0),
    m_panelType(Panel::T_Uninitialized),
    m_panel(0),
    m_label(0)
{
    // create gui elements defined in the Ui_Panel class
    setupUi(this);
    setFrameShape(QFrame::Panel);
	setFrameShadow(QFrame::Plain);

    // set the style sheet to use for tool bars
	/*
    QString toolBarStyleSheet (
        "QToolBar {"
        "    border: none;"
        "    margin: 0px;"
        "    spacing: 1px;"
        "}"
        "QToolBar::separator {"
        "    width: 6px;"
        "    background-image: url(:/toolbarSeparatorIcon);"
        "    background-repeat: no-repeat;"
        "    background-origin: content;"
        "    background-position: center center;"
        "}"
        "QToolButton {"
        "    max-height: 22px;"
        "    max-width: 22px;"
        "}"
        "QToolButton[popupMode=\"1\"] {"
        "    max-width: 32px;"
        "}"
    );
	
	QString frameStyleSheet (
        "QFrame {"
        "    border: 1px solid #737373;"
        "    background: #595959;"
        "}"
	);
	setStyleSheet(frameStyleSheet);
	*/

    // create the panel's main tool bar
    m_mainToolBar = new QToolBar(this);
    m_mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
    m_mainToolBar->setIconSize(QSize(16, 16));
    m_mainToolBar->setMinimumHeight(18);
    m_mainToolBar->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    // m_mainToolBar->setStyleSheet(toolBarStyleSheet);

    // create the panel's main tool bar
    m_panelToolBar = new QToolBar(this);
    m_panelToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
    m_panelToolBar->setIconSize(QSize(16, 16));
    m_panelToolBar->setMinimumHeight(18);
    m_panelToolBar->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    // m_panelToolBar->setStyleSheet(toolBarStyleSheet);

    if (!showToolBars) {
        m_mainToolBar->hide();
        m_panelToolBar->hide();
        ui_panelTypeComboBox->hide();
        //ui_vboxLayout->removeItem(ui_hboxLayout);
    }

    // insert the panel's main tool bar after the spacer behind the panel type combo box
	// Give a little space to the keyframe widget
	QWidget *spacerWidget = new QWidget();
    spacerWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
	spacerWidget->setMinimumWidth(5);
	spacerWidget->setMaximumWidth(5);
	ui_hboxLayout->insertWidget(0, spacerWidget);

    ui_hboxLayout->insertWidget(3, m_mainToolBar);
    ui_hboxLayout->insertWidget(4, m_panelToolBar);

    // fill panel type combo box with panel type names
    ui_panelTypeComboBox->blockSignals(true);
    for (int i = 0; i < Panel::T_NumTypes; ++i) {
        Panel::Type panelType = (Panel::Type) i;
        QString panelTypeName = Panel::getTypeName(panelType);
        QString panelTypeIconName = Panel::getTypeIconName(panelType);
        if (panelTypeIconName.isEmpty())
            ui_panelTypeComboBox->addItem(panelTypeName);
        else
            ui_panelTypeComboBox->addItem(QIcon(panelTypeIconName), panelTypeName);
    }

	// fill the panel type combo box with dynamic type names
	for(int i = 0; i < PanelFactory::m_panelTypeMap.keys().length(); ++i){
		QString PlugInName = PanelFactory::m_panelPluginNames.at(i);
		QIcon PlugInIcon = QIcon(PanelFactory::m_panelPluginIcons.at(i));
		ui_panelTypeComboBox->addItem(PlugInIcon, PlugInName);
	}

    ui_panelTypeComboBox->blockSignals(false);

    // relay the viewPanelCreated signal to the window that this panel frame is contained in
    connect(this, SIGNAL(viewPanelCreated(ViewPanel *)), window(), SIGNAL(viewPanelCreated(ViewPanel *)));

    // initialize the panel frame's panel type
    setPanelType(panelType);

    // create the panel drop-down menu
    QMenu *panelMenu = new QMenu("Panel Menu", this);
    panelMenu->addAction(ui_splitHorizontallyAction);
    panelMenu->addAction(ui_splitVerticallyAction);
    panelMenu->addSeparator();
    panelMenu->addAction(ui_maximizeAction);
    panelMenu->addAction(ui_restoreAction);
    panelMenu->addAction(ui_maximizeHorizontallyAction);
    panelMenu->addAction(ui_restoreHorizontallyAction);
    panelMenu->addAction(ui_maximizeVerticallyAction);
    panelMenu->addAction(ui_restoreVerticallyAction);
    panelMenu->addAction(ui_minimizeAction);
    panelMenu->addSeparator();
    panelMenu->addAction(ui_maximizeRowAction);
    panelMenu->addAction(ui_minimizeRowAction);
    panelMenu->addAction(ui_maximizeColumnAction);
    panelMenu->addAction(ui_minimizeColumnAction);
    panelMenu->addSeparator();
    panelMenu->addAction(ui_duplicateAction);
    panelMenu->addAction(ui_extractAction);
    panelMenu->addSeparator();
    panelMenu->addAction(ui_closeRowAction);
    panelMenu->addAction(ui_closeColumnAction);
    panelMenu->addAction(ui_closeAction);
    ui_panelMenuAction->setMenu(panelMenu);

    ui_maximizeAction->setVisible(false);
    ui_restoreAction->setVisible(false);
    ui_maximizeHorizontallyAction->setVisible(false);
    ui_restoreHorizontallyAction->setVisible(false);
    ui_maximizeVerticallyAction->setVisible(false);
    ui_restoreVerticallyAction->setVisible(false);
    ui_maximizeColumnAction->setVisible(false);
    ui_minimizeColumnAction->setVisible(false);
    ui_maximizeRowAction->setVisible(false);
    ui_minimizeRowAction->setVisible(false);
    ui_closeRowAction->setVisible(false);
    ui_closeColumnAction->setVisible(false);

    // set up external signal/slot connections
    connect(this, SIGNAL(panelTypeChanged(const QString &)), window(), SLOT(updateWindowTitle(const QString &)));
    connect(this, SIGNAL(duplicateRequested(PanelFrame *)), window(), SLOT(duplicatePanelFrame(PanelFrame *)));
    connect(this, SIGNAL(extractRequested(PanelFrame *)), window(), SLOT(extractPanelFrame(PanelFrame *)), Qt::QueuedConnection);
    connect(this, SIGNAL(closeRequested(PanelFrame *)), window(), SLOT(closePanelFrame(PanelFrame *)), Qt::QueuedConnection);

	// insert border widget to ui_vboxLayout at index 1 just after toolbar vbox
	QString borderStyle ( "border-top: 1px solid #393939; border-bottom: 1px solid #959595" );
	QFrame *borderFrame = new QFrame(this);
	borderFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	borderFrame->setMinimumHeight(2);
	borderFrame->setMaximumHeight(2);
	borderFrame->setStyleSheet(borderStyle);
	ui_vboxLayout->insertWidget(1, borderFrame);
}
BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    unlockWalletAction(0),
    lockWalletAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    setMinimumSize(1000,550);
    resize(1040, 650); //setFixedSize(970, 550);
    setWindowTitle(tr("WhiteCoin") + " " + tr("Wallet"));
    qApp->setStyleSheet(
                    "QMainWindow { background:white url(:/images/wallet_logo_background) no-repeat right bottom; background-origin: border; font-family:'Open Sans,sans-serif'; } "
                    "QLineEdit { border: 4px solid rgb(14,105,162); } "
                    "#frame { } QToolBar QLabel { padding-top:15px; padding-bottom:10px; margin:0px; border: 0px; border-color: yellow;} "
                    "#spacer { background: rgb(14,105,162); border:none; } "
                    "#toolbar { height:100%; padding-top:20px; background: white; text-align: left; min-width:220px; max-width:220px; border: none;} "
                    "QToolBar QToolButton { font-family:Open Sans; padding-left:0px; padding-top:10px; padding-bottom:10px; width:220px; color: white; text-align: left; background-color: rgb(14,105,162) } "
                    "QToolBar QToolButton:hover { color: black; background-color: white; border: none; } "
                    "QToolBar QToolButton:pressed {color: black; background-color: white; border: none; } "
                    "QToolBar QToolButton:checked { color: black; background-color: white; border: none; } "
                    "#labelMiningIcon { padding-left:5px; font-family:Open Sans; width:100%;font-size:10px; text-align:center; color:grey; } "
                    "QMenu { background: rgb(255,255,255); color:black; padding-bottom:10px; } "
                    "QMenu::item { color:grey; background-color: transparent; } "
                    "QMenu::item:selected { color: white; background-color: rgb(14,105,162); } "
                    "QMenuBar { background: rgb(255,255,255); color:black; } "
                    "QMenuBar::item { font-size:12px; padding-bottom:12px; padding-top:12px; padding-left:15px; padding-right:15px; color:grey; background-color: transparent; border:none;} "
                    "QMenuBar::item:selected { color: white; background-color:rgb(14,105,162); border:none;}"
                    "QRadionButton::indicator { background-color: rgb(14,105,162); } "
                    "QIcon {}"
                    "QTabWidget { background-color: rbg(14,105,162); }"
                    "#debug QLabel {color: white; }"
                    "QLineEdit { border: 1px solid rbg(14,105,162); border-radius: 4px; }"
                    "#scrollArea { border-color: transparent; } "
                    "QPushButton {}"
                    "QStackedWidget {}"
                    "QDateTime {}"
    );
#ifndef Q_OS_MAC
    QApplication::setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    createActions();

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create the tray icon (or setup the dock icon)
    createTrayIcon();

    // Create tabs
    overviewPage = new OverviewPage();
    statisticsPage = new StatisticsPage(this);

    blockBrowser = new BlockBrowser(this);
    poolBrowser = new PoolBrowser(this);

    transactionsPage = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout();
    transactionView = new TransactionView(this);
    vbox->addWidget(transactionView);
    transactionsPage->setLayout(vbox);

    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);

    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);

    sendCoinsPage = new SendCoinsDialog(this);

    signVerifyMessageDialog = new SignVerifyMessageDialog(this);

    //QVBoxLayout *vboxcentral = new QVBoxLayout();
    //QWidget *centralWidgetWrapper = new QWidget(this);


    //centralWidgetWrapper->setStyleSheet("QStackedWidget{border:1px solid #555;}");

    //centralWidget = new QStackedWidget(centralWidgetWrapper);
    centralWidget = new QStackedWidget(this);

    centralWidget->setStyleSheet("QStackedWidget{border:0px solid #000;}");

    centralWidget->addWidget(overviewPage);
    centralWidget->addWidget(statisticsPage);
    centralWidget->addWidget(blockBrowser);
    centralWidget->addWidget(poolBrowser);
    centralWidget->addWidget(transactionsPage);
    centralWidget->addWidget(addressBookPage);
    centralWidget->addWidget(receiveCoinsPage);
    centralWidget->addWidget(sendCoinsPage);

    //vboxcentral->addWidget(centralWidget);
    //centralWidgetWrapper->setLayout(vboxcentral);

//    setCentralWidget(centralWidgetWrapper);
    setCentralWidget(centralWidget);

    // create status bar
//    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setStyleSheet("frameBlocks { background: rgb(255,255,255); }");
    frameBlocks->setContentsMargins(0,0,0,0);

    frameBlocks->setMinimumHeight(26);
    frameBlocks->setMaximumHeight(26);
    frameBlocks->setMaximumWidth(96);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(0,1,0,1);
    frameBlocksLayout->setSpacing(-1);
    labelEncryptionIcon = new QLabel();
    labelStakingIcon = new QLabel();
    labelConnectionsIcon = new QLabel();
    labelBlocksIcon = new QLabel();
    frameBlocksLayout->addWidget(labelEncryptionIcon);
    frameBlocksLayout->addWidget(labelStakingIcon);
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    if (!GetBoolArg("-posmint", false))
    {
        QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
        connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
        timerStakingIcon->start(30 * 1000);
        updateStakingIcon();
    }

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(false);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(false);
    progressBar->setOrientation(Qt::Horizontal);
    progressBar->setObjectName("progress");
    progressBar->setStyleSheet("QProgressBar { background-color: white; border: 0px solid grey; border-radius: 5px; padding: 1px; text-align: center;} "
                               "QProgressBar::chunk { background: #0E69A2; border-radius: 5px; margin: 0px; }");
    frameBlocks->setObjectName("frame");

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = QApplication::style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: white; border: 0px solid grey; border-radius: 5px; padding: 1px; text-align: center;} "
                                   "QProgressBar::chunk { background: #0E69A2; border-radius: 5px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);



    syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);

    // Clicking on a transaction on the overview page simply sends you to transaction history page
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));

    // Double-clicking on a transaction on the transaction history page shows details
    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));

    rpcConsole = new RPCConsole(this);
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));

    // Clicking on "Verify Message" in the address book sends you to the verify message tab
    connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
    // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
    connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));

    gotoOverviewPage();
}
Esempio n. 12
0
PrintSetup::PrintSetup( QWidget *parent, const char *name, QString pname,
				QString spooler, QString variable )
	: QDialog( parent, name, TRUE )
{
	setFocusPolicy(QWidget::StrongFocus);
	setCaption( i18n( "Printer setup" ) );
	
	int border = 10;
	
	QBoxLayout *topLayout = new QVBoxLayout( this, border );
	
	topLayout->addStretch( 10 );
	
	QGridLayout *grid = new QGridLayout( 7, 2, 5 );
	topLayout->addLayout( grid );
	

	grid->addRowSpacing(2,5);
	grid->addRowSpacing(4,5);

	grid->setColStretch(0,10);
	grid->setColStretch(1,100);
	
	leName = new QLineEdit( this );
	leName->setFocus();
	leName->setFixedHeight( leName->sizeHint().height() );
	leName->setText( pname );
	
	grid->addWidget( leName, 1, 1 );
	
	QLabel* tmpQLabel;
	tmpQLabel = new QLabel( leName, i18n("&Printer name"), this );
	tmpQLabel->setAlignment( AlignRight | AlignVCenter | ShowPrefix );
	tmpQLabel->setMinimumSize( tmpQLabel->sizeHint() );
	
	grid->addWidget( tmpQLabel, 1, 0 );
	
	leSpool = new QLineEdit( this );
	leSpool->setFixedHeight( leName->sizeHint().height() );
	leSpool->setText( spooler );
	
	grid->addWidget( leSpool, 3, 1 );
	
	tmpQLabel = new QLabel( leSpool, i18n("&Spooler command"), this );
	tmpQLabel->setAlignment(  AlignRight | AlignVCenter | ShowPrefix );
	tmpQLabel->setMinimumSize( tmpQLabel->sizeHint() );
	
	grid->addWidget( tmpQLabel, 3, 0 );
	
	leVar = new QLineEdit( this );
	leVar->setFixedHeight( leName->sizeHint().height() );
	leVar->setText( variable );
	
	grid->addWidget( leVar, 5, 1 );
	
	tmpQLabel = new QLabel( leVar, i18n("&Environment variable"), this );
	tmpQLabel->setAlignment(  AlignRight | AlignVCenter | ShowPrefix );
	tmpQLabel->setMinimumSize( tmpQLabel->sizeHint() );
	
	grid->addWidget( tmpQLabel, 5, 0 );
	
	QFrame* tmpQFrame;
	tmpQFrame = new QFrame( this );
	tmpQFrame->setFrameStyle( QFrame::HLine | QFrame::Sunken );
	tmpQFrame->setMinimumHeight( tmpQFrame->sizeHint().height() );
	
	topLayout->addWidget( tmpQFrame );
	
	// CREATE BUTTONS
	
	KButtonBox *bbox = new KButtonBox( this );
	bbox->addStretch( 10 );
		
	QPushButton* ok = bbox->addButton( i18n("&OK") );
	connect( ok, SIGNAL(clicked()), SLOT(accept()) );
	
	QPushButton* cancel = bbox->addButton( i18n("&Cancel") );
	connect( cancel, SIGNAL(clicked()), SLOT(reject()) );
		
	bbox->layout();
	topLayout->addWidget( bbox );

	topLayout->activate();
	
	resize( 300,0 );
}
Esempio n. 13
0
PrintDialog::PrintDialog( QWidget *parent, const char *name, int maxPages,
							bool marked )		
	: QDialog( parent, name, TRUE )
{
	setFocusPolicy(QWidget::StrongFocus);
	
	pgMode = All;
	/*
	printerName.sprintf( "" ); // default printer will be chosen.
	spoolerCommand.sprintf( "lpr" );
	printerVariable.sprintf( "PRINTER" );
	*/

	KConfig *config = KApplication::getKApplication()->getConfig();
	/* Read in the default options. */
	config->setGroup( "Print" );
	printerName=config->readEntry ("Name","");
	spoolerCommand=config->readEntry ("Spool","lpr");
	printerVariable=config->readEntry ("Variable","PRINTER");


	pgMax = maxPages;
	pgStart=0; pgEnd=0;
	
	int border = 10;
	
	QBoxLayout *topLayout = new QVBoxLayout( this, border );
	
	cbFile = new QCheckBox( i18n("Print to file"), this );
	cbFile->setFixedHeight( cbFile->sizeHint().height() );
	
	topLayout->addWidget( cbFile );
	
	QGroupBox *group = new QGroupBox( i18n( "Pages" ), this );
	topLayout->addWidget( group, 10 );
	
	QGridLayout *grid = new QGridLayout( group, 5, 7, 5 );
	
	grid->setRowStretch( 0, 10 );
	grid->setRowStretch( 1, 100 );
	grid->setRowStretch( 2, 0 );
	grid->setRowStretch( 3, 100 );
	grid->setRowStretch( 4, 10 );
	
	grid->setColStretch( 0, 0 );
	grid->setColStretch( 1, 100 );
	grid->setColStretch( 2, 100 );
	grid->setColStretch( 3, 100 );
	grid->setColStretch( 4, 0 );
	grid->setColStretch( 5, 100 );
	grid->setColStretch( 6, 0 );
		
	pgGroup = new QButtonGroup( group );
	pgGroup->hide();
	pgGroup->setExclusive( true );
	connect( pgGroup, SIGNAL( clicked( int ) ), SLOT( slotPageMode( int ) ) );
	
	int widest = 0;
	
	QRadioButton *arb = new QRadioButton( i18n("&All"), group );
	arb->setFixedHeight( arb->sizeHint().height()+6 );
	arb->setChecked( true );
	pgGroup->insert( arb, All );
	
	grid->addWidget( arb, 1, 1 );
	
	if ( arb->sizeHint().width() > widest )
	  widest = arb->sizeHint().width();
	
	QRadioButton *rb = new QRadioButton( i18n("&Current"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	pgGroup->insert( rb, Current );
	
	grid->addWidget( rb, 1, 2 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	rb = new QRadioButton( i18n("&Marked"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	if ( !marked )
	  rb->setEnabled( false );
	else
	  {
	    arb->setChecked ( false );
	    rb->setChecked ( true );
	  }

	pgGroup->insert( rb, Marked );
	
	grid->addWidget( rb, 3, 1 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	rb = new QRadioButton( i18n("&Range"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	pgGroup->insert( rb, Range );
	
	grid->addWidget( rb, 3, 2 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	leStart = new QLineEdit( group );
	leStart->setFixedHeight( rb->sizeHint().height()+6 );
	
	grid->addWidget( leStart, 3, 3 );
	
	lTo = new QLabel( group );
	lTo->setText( i18n("to") );
	lTo->setAlignment( AlignCenter );
	lTo->setMinimumSize( lTo->sizeHint() );
	
	grid->addWidget( lTo, 3, 4 );
	
	leEnd = new QLineEdit( group );
	leEnd->setFixedHeight( rb->sizeHint().height()+6 );
	
	grid->addWidget( leEnd, 3, 5 );
	
	group->setMinimumSize( QSize( 4*widest+25, 4*(rb->sizeHint().height()+6) ) );
	
	cbOrder = new QCheckBox( i18n("Print document in re&verse order"), this );
	cbOrder->setFixedHeight( cbOrder->sizeHint().height() );
	
	topLayout->addWidget( cbOrder );
	
	
	QFrame* tmpQFrame;
	tmpQFrame = new QFrame( this );
	tmpQFrame->setFrameStyle( QFrame::HLine | QFrame::Sunken );
	tmpQFrame->setMinimumHeight( tmpQFrame->sizeHint().height() );
	
	topLayout->addWidget( tmpQFrame );
	
	// CREATE BUTTONS
	
	KButtonBox *bbox = new KButtonBox( this );
	
	QPushButton* setup = bbox->addButton( i18n("&Setup ...") );
	connect( setup, SIGNAL(clicked()), SLOT( setup()) );
	
	
	bbox->addStretch( 10 );

	QPushButton* ok = bbox->addButton( i18n("&OK") );
	connect( ok, SIGNAL(clicked()), SLOT( checkRange() ) );

	QPushButton* cancel = bbox->addButton( i18n("&Cancel") );
	connect( cancel, SIGNAL(clicked()), SLOT(reject()) );

	bbox->layout();
	topLayout->addWidget( bbox );
	
	topLayout->activate();
	
	if ( marked )
	  slotPageMode( Marked );
	else
	  slotPageMode( All );

	resize( 250, 0 );
	
}
Esempio n. 14
0
VW::VW( QWidget * parent, const char * name )
    : QWidget( parent, name )
{
    QHBoxLayout * hb;

    hb = new QHBoxLayout( this, 10 );

    QGroupBox * box;
    box = new QGroupBox( this, "input box" );
    hb->addWidget( box, 0, AlignTop );

    QVBoxLayout * b;

    // set up the input box
    b = new QVBoxLayout( box, 12 );

    QLabel * l = new QLabel( "Enter Vehicle Details", box, "header" );
    l->setMinimumSize( l->sizeHint() );
    b->addWidget( l );
    QFrame * f = new QFrame( box, "horizontal divider" );
    f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
    f->setMinimumHeight( 12 );
    b->addWidget( f );

    QGridLayout *grid = new QGridLayout( 3, 2 );
    b->addLayout( grid );

    // here we start on the input grid, with labels and other widget
    // neatly arranged. the variable names are reused all over the
    // place.

    QComboBox * model = new QComboBox( FALSE, box, "model selection" );
    model->insertItem( "Type 1 Beetle" );
    model->insertItem( "Camper" );
    model->insertItem( "Van" );
    model->insertItem( "Fastback" );
    model->insertItem( "Squareback" );
    model->insertItem( "Notchback" );
    model->insertItem( "411" );
    model->setCurrentItem( model->count() - 1 ); // I like the 411
    currentModel = "411";
    model->insertItem( "412" );
    model->insertItem( "Karmann Ghia" );
    model->insertItem( "Thing" );
    model->insertItem( "Safari" );
    model->insertItem( "Kubelwagen" );
    model->insertItem( "Trekker" );
    model->insertItem( "Baja" );
    model->setMinimumSize( model->sizeHint() );
    model->setMaximumHeight( model->minimumSize().height() );
    grid->addWidget( model, 0, 1 );

    l = new QLabel( model, "Model:", box, "model label" );
    l->setMinimumSize( l->sizeHint() );
    grid->addWidget( l, 0, 0 );

    QSpinBox * motor = new QSpinBox( 1000, 1600, 100, 
				     box, "motor size selection" );
    motor->setValue( 1000 );
    currentMotorSize = 1000;
    motor->setMinimumSize( motor->sizeHint() );
    motor->setMaximumHeight( motor->minimumSize().height() );
    grid->addWidget( motor, 1, 1 );

    l = new QLabel( motor, "Motor size (cc):", box, "motor size label" );
    l->setMinimumSize( l->sizeHint() );
    grid->addWidget( l, 1, 0 );

    QSpinBox * year = new QSpinBox( box, "model year" );
    year->setRange( 1949, 1981 );
    year->setValue( 1949 );
    currentYear = 1949;
    year->setMinimumSize( year->sizeHint() );
    year->setMaximumHeight( year->minimumSize().height() );
    grid->addWidget( year, 2, 1 );

    l = new QLabel( year, "Model:", box, "model year label" );
    l->setMinimumSize( l->sizeHint() );
    grid->addWidget( l, 2, 0 );

    b->addStretch( 1 );

    b->activate();

    // output box

    box = new QGroupBox( this, "output box" );
    hb->addWidget( box, 0, AlignTop );

    b = new QVBoxLayout( box, 12 );

    l = new QLabel( "Resulting Limousine:", box, "header" );
    l->setMinimumSize( l->sizeHint() );
    b->addWidget( l );

    f = new QFrame( box, "horizontal divider" );
    f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
    f->setMinimumHeight( 12 );
    b->addWidget( f );

    l = new QLabel( box, "output label" );
    l->setAlignment( AlignTop | AlignLeft | WordBreak );
    l->setText( "No VW selected yet." );
    b->addWidget( l, 1 );

    b->addStretch( 1 );

    b->activate();
    hb->activate();

    // set up connections
    connect( model, SIGNAL(activated(const char *)),
	     this, SLOT(modelSelected(const char *)) );
    connect( motor, SIGNAL(valueChanged(int)),
	     this, SLOT(motorSelected(int)) );
    connect( year, SIGNAL(valueChanged(int)),
	     this, SLOT(yearSelected(int)) );

    connect( this, SIGNAL(validSelectionMade(const char *)),
	     l, SLOT(setText(const char *)) );
}
Esempio n. 15
0
ThemeManagementDialog::ThemeManagementDialog(QWidget * parent)
: QWidget(parent)
{
	m_pItemDelegate = NULL;
#ifdef COMPILE_WEBKIT_SUPPORT
	m_pWebThemeInterfaceDialog = NULL;
#endif
	setObjectName("theme_options_widget");
	setWindowTitle(__tr2qs_ctx("Manage Themes - KVIrc","theme"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Theme)));

	m_pInstance = this;

	//QGridLayout * g = new QGridLayout(this);
	QVBoxLayout * pVBox = new QVBoxLayout(this);
	KviTalHBox * pHBox = new KviTalHBox(this);
	pHBox->setMargin(1);
	pHBox->setSpacing(1);
	//g->addWidget(pHBox,0,0);
	pVBox->addWidget(pHBox);
	QToolButton * pTool;
	QFrame * pSep;

	pTool = new QToolButton(pHBox);
	pTool->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_SAVE)));
	pTool->setIconSize(QSize(32,32));
	pTool->setToolTip(__tr2qs_ctx("Save Current Theme...","theme"));
	connect(pTool,SIGNAL(clicked()),this,SLOT(saveCurrentTheme()));

	pSep = new QFrame(pHBox);
	pSep->setFrameStyle(QFrame::VLine | QFrame::Sunken);
	pSep->setMinimumWidth(12);

	m_pPackThemeButton = new QToolButton(pHBox);
	m_pPackThemeButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_PACK)));

	m_pPackThemeButton->setIconSize(QSize(32,32));
	m_pPackThemeButton->setToolTip(__tr2qs_ctx("Export Selected Themes to a Distributable Package","theme"));
	connect(m_pPackThemeButton,SIGNAL(clicked()),this,SLOT(packTheme()));

	m_pDeleteThemeButton = new QToolButton(pHBox);
	m_pDeleteThemeButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_REMOVE)));
	m_pDeleteThemeButton->setIconSize(QSize(32,32));
	m_pDeleteThemeButton->setToolTip(__tr2qs_ctx("Delete Selected Themes","theme"));
	connect(m_pDeleteThemeButton,SIGNAL(clicked()),this,SLOT(deleteTheme()));

	pSep = new QFrame(pHBox);
	pSep->setFrameStyle(QFrame::VLine | QFrame::Sunken);
	pSep->setMinimumWidth(12);

	pTool = new QToolButton(pHBox);
	pTool->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN)));
	pTool->setIconSize(QSize(32,32));
	pTool->setToolTip(__tr2qs_ctx("Install Theme Package From Disk","theme"));
	connect(pTool,SIGNAL(clicked()),this,SLOT(installFromFile()));

	pTool = new QToolButton(pHBox);
	pTool->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_WWW)));
	pTool->setIconSize(QSize(32,32));
	pTool->setToolTip(__tr2qs_ctx("Get More Themes...","theme"));
	connect(pTool,SIGNAL(clicked()),this,SLOT(getMoreThemes()));

	QWidget *w= new QWidget(pHBox);
	w->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);

	m_pListWidget = new KviTalListWidget(this);
	m_pListWidget->setContextMenuPolicy(Qt::CustomContextMenu);
	m_pItemDelegate = new KviTalIconAndRichTextItemDelegate(m_pListWidget);
	m_pItemDelegate->setDefaultIcon(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME)));
	m_pListWidget->setItemDelegate(m_pItemDelegate);
	m_pListWidget->setMinimumHeight(400);
	m_pListWidget->setMinimumWidth(420);

	m_pListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
	m_pListWidget->setSortingEnabled(true);
	connect(m_pListWidget,SIGNAL(itemDoubleClicked(QListWidgetItem *)),this,SLOT(applyTheme(QListWidgetItem *)));


	//FIXME tooltip
	//connect(m_pListWidget,SIGNAL(tipRequest(QListWidgetItem *,const QPoint &)),this,SLOT(tipRequest(QListWidgetItem *,const QPoint &)));
	connect(m_pListWidget,SIGNAL(customContextMenuRequested(const QPoint &)),
		this,SLOT(contextMenuRequested(const QPoint &)));
	connect(m_pListWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableDisableButtons()));

	pSep = new QFrame(this);
	pSep->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	pSep->setMinimumWidth(300);
	pSep->setMinimumHeight(8);
	pVBox->addWidget(pSep);

	//g->addWidget(pSep,2,0);

	m_pCurrentInstalledThemeLabel = new QLabel(this);
	m_pCurrentInstalledThemeLabel->setText(__tr2qs_ctx("<b><u>Current Installed Theme:</u> ","theme") + " " + KVI_OPTION_STRING(KviOption_stringIconThemeSubdir) + "</b>");
//	g->addWidget(pLabel,2,0);
	pVBox->addWidget(m_pCurrentInstalledThemeLabel);

	pSep = new QFrame(this);
	pSep->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	pSep->setMinimumWidth(300);

//	g->addWidget(pSep,3,0);
	pVBox->addWidget(pSep);

//	g->addWidget(m_pListWidget,4,0);
	pVBox->addWidget(m_pListWidget);

//	KviDynamicToolTip * tip = new KviDynamicToolTip(m_pListWidget);
//	connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &)));

	QPushButton * b = new QPushButton(__tr2qs("Close"),this);
	b->setMaximumSize(b->sizeHint().width(),b->sizeHint().height());
	connect(b,SIGNAL(clicked()),this,SLOT(closeClicked()));
//	g->addWidget(b,5,0);
	pVBox->addWidget(b);

//	g->setMargin(1);
//	g->setSpacing(1);
	pVBox->setAlignment(b,Qt::AlignRight);
	fillThemeBox();
	m_pContextPopup = new QMenu(this);

	if(g_rectManagementDialogGeometry.y() < 5)
	{
		g_rectManagementDialogGeometry.setY(5);
	}
	resize(g_rectManagementDialogGeometry.width(),
		g_rectManagementDialogGeometry.height());

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

	new QShortcut(Qt::Key_Escape, this, SLOT(closeClicked()));
}
Esempio n. 16
0
TaskSheet::TaskSheet(TasksViewer *owner) : QScrollArea(owner) {
  QFrame *contentWidget = new QFrame(this);
  contentWidget->setMinimumWidth(300);
  contentWidget->setMinimumHeight(400);

  setWidget(contentWidget);
  setWidgetResizable(true);

  m_task   = 0;
  int row  = 0;
  m_viewer = owner;

  QGridLayout *layout = new QGridLayout(contentWidget);
  layout->setMargin(15);
  layout->setSpacing(8);
  layout->setColumnStretch(3, 1);
  layout->setColumnStretch(5, 1);
  layout->setColumnStretch(6, 4);
  layout->setColumnMinimumWidth(2, 70);
  layout->setColumnMinimumWidth(3, 70);
  layout->setColumnMinimumWidth(4, 40);
  layout->setColumnMinimumWidth(5, 100);
  contentWidget->setLayout(layout);
  ::create(m_name, layout, tr("Name:"), row++);
  ::create(m_status, layout, tr("Status:"), row++);
  ::create(m_commandLine, layout, tr("Command Line:"), row++);
  ::create(m_server, layout, tr("Server:"), row++);
  ::create(m_submittedBy, layout, tr("Submitted By:"), row++);
  ::create(m_submittedOn, layout, tr("Submitted On:"), row++);
  ::create(m_submitDate, layout, tr("Submission Date:"), row++);
  ::create(m_startDate, layout, tr("Start Date:"), row++);
  ::create(m_complDate, layout, tr("Completion Date:"), row++);
  ::create(m_duration, layout, tr("Duration:"), row++);
  // m_duration->setMaximumWidth(38);
  ::create(m_stepCount, layout, tr("Step Count:"), row++);
  // m_stepCount->setMaximumWidth(38);
  ::create(m_failedSteps, layout, tr("Failed Steps:"), row++);
  // m_failedSteps->setMaximumWidth(38);
  ::create(m_succSteps, layout, tr("Successful Steps:"), row++);
  // m_succSteps->setMaximumWidth(38);
  ::create(m_priority, layout, tr("Priority:"), row++);
  // m_priority->setMaximumWidth(40);

  layout->setColumnStretch(0, 0);
  layout->setColumnStretch(1, 0);
  layout->setColumnStretch(2, 1);
  layout->setColumnStretch(3, 1);
  layout->setColumnStretch(4, 1);
  layout->setColumnStretch(5, 1);

  int row1 = 0;

  m_boxComposer = new QFrame(contentWidget);
  m_boxComposer->setMinimumHeight(150);
  QGridLayout *layout1 = new QGridLayout(m_boxComposer);
  layout1->setMargin(0);
  layout1->setSpacing(8);
  m_boxComposer->setLayout(layout1);
  ::create(m_outputPath, layout1, tr("Output:"), row1++, 4);

  ::create(m_chunkSize, m_multimedia, layout1, tr("Frames per Chunk:"),
           tr("Multimedia:"), Qt::AlignRight | Qt::AlignTop,
           Qt::AlignLeft | Qt::AlignTop, row1++);
  ::create(m_from, m_to, layout1, tr("From:"), tr("To:"),
           Qt::AlignRight | Qt::AlignTop, Qt::AlignRight | Qt::AlignTop,
           row1++);
  ::create(m_step, m_shrink, layout1, tr("Step:"), tr("Shrink:"),
           Qt::AlignRight | Qt::AlignTop, Qt::AlignRight | Qt::AlignTop,
           row1++);

  layout1->setColumnMinimumWidth(2, 40);
  QStringList multimediaTypes;
  multimediaTypes << tr("None") << tr("Fx Schematic Flows")
                  << tr("Fx Schematic Terminal Nodes");
  m_multimedia->addItems(multimediaTypes);

  ::create(m_threadsCombo, layout1, tr("Dedicated CPUs:"), row1++, 3);
  QStringList threadsTypes;
  threadsTypes << tr("Single") << tr("Half") << tr("All");
  m_threadsCombo->addItems(threadsTypes);

  ::create(m_rasterGranularityCombo, layout1, tr("Render Tile:"), row1++, 3);
  QStringList granularityTypes;
  granularityTypes << tr("None") << tr("Large") << tr("Medium") << tr("Small");
  m_rasterGranularityCombo->addItems(granularityTypes);

  layout1->addWidget(new QWidget(), 0, 5);

  layout1->setColumnStretch(0, 0);
  layout1->setColumnStretch(1, 0);
  layout1->setColumnStretch(2, 0);
  layout1->setColumnStretch(3, 0);
  layout1->setColumnStretch(4, 0);
  layout1->setColumnStretch(5, 1);

  layout->addWidget(m_boxComposer, row++, 0, 1,
                    6 /*, Qt::AlignLeft|Qt::AlignTop*/);

  // tcleanupper Box
  m_boxCleanup         = new QFrame(contentWidget);
  QGridLayout *layout2 = new QGridLayout(m_boxCleanup);
  layout2->setMargin(0);
  layout2->setSpacing(8);
  m_boxCleanup->setLayout(layout2);
  ::create(m_visible, layout2, tr("Visible Only"), 0);
  ::create(m_overwrite, layout2, tr("Overwrite"), 1, 1);

  QStringList overwriteOptions;
  overwriteOptions << tr("All") << tr("NoPaint") << tr("Off");
  m_overwrite->addItems(overwriteOptions);
  m_overwrite->setCurrentIndex(2);  // do not overwrite by default

  layout2->setColumnStretch(0, 0);
  layout2->setColumnStretch(1, 0);
  layout2->setColumnStretch(2, 1);

  layout->addWidget(m_boxCleanup, row++, 2, 1, 1, Qt::AlignLeft | Qt::AlignTop);

  QLabel *label = new QLabel(tr("Dependencies:"), contentWidget);
  label->setObjectName("TaskSheetItemLabel");
  layout->addWidget(label, row, 0, 1, 2, Qt::AlignRight | Qt::AlignTop);

  m_addedBox = new QListWidget(contentWidget);
  m_addedBox->setSelectionMode(QAbstractItemView::ExtendedSelection);
  m_addedBox->setObjectName("tasksRemoveBox");
  m_addedBox->setFrameStyle(QFrame::StyledPanel);
  layout->addWidget(m_addedBox, row, 2, 1, 2, Qt::AlignLeft | Qt::AlignTop);

  m_notAddedBox = new QListWidget(contentWidget);
  m_notAddedBox->setSelectionMode(QAbstractItemView::ExtendedSelection);
  m_notAddedBox->setObjectName("tasksAddBox");
  m_notAddedBox->setFrameStyle(QFrame::StyledPanel);
  layout->addWidget(m_notAddedBox, row++, 4, 1, 2,
                    Qt::AlignLeft | Qt::AlignTop);

  QPushButton *removeBtn = new QPushButton(tr("Remove >>"));
  layout->addWidget(removeBtn, row, 2, 1, 2, Qt::AlignRight | Qt::AlignTop);

  QPushButton *addBtn = new QPushButton(tr("<< Add"));
  layout->addWidget(addBtn, row++, 4, 1, 2, Qt::AlignLeft | Qt::AlignTop);

  bool ret = true;

  ret =
      ret && connect(m_name, SIGNAL(editingFinished()), this, SLOT(setName()));
  ret =
      ret && connect(m_from, SIGNAL(editingFinished()), this, SLOT(setFrom()));
  ret = ret && connect(m_to, SIGNAL(editingFinished()), this, SLOT(setTo()));
  ret =
      ret && connect(m_step, SIGNAL(editingFinished()), this, SLOT(setStep()));
  ret = ret &&
        connect(m_shrink, SIGNAL(editingFinished()), this, SLOT(setShrink()));
  ret = ret && connect(m_outputPath, SIGNAL(editingFinished()), this,
                       SLOT(setOutput()));
  ret = ret && connect(m_chunkSize, SIGNAL(editingFinished()), this,
                       SLOT(setChunkSize()));
  ret = ret && connect(m_priority, SIGNAL(editingFinished()), this,
                       SLOT(setPriority()));

  ret = ret && connect(m_name, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret = ret && connect(m_from, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret = ret && connect(m_to, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret = ret && connect(m_step, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret = ret && connect(m_shrink, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret =
      ret && connect(m_outputPath, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret = ret && connect(m_chunkSize, SIGNAL(focusIn()), this, SLOT(onFocusIn()));
  ret = ret && connect(m_priority, SIGNAL(focusIn()), this, SLOT(onFocusIn()));

  ret = ret && connect(m_multimedia, SIGNAL(currentIndexChanged(int)), this,
                       SLOT(setMultimedia(int)));
  ret = ret && connect(m_visible, SIGNAL(stateChanged(int)), this,
                       SLOT(setVisible(int)));

  ret = ret && connect(m_overwrite, SIGNAL(currentIndexChanged(int)), this,
                       SLOT(setOverwrite(int)));

  ret =
      ret && connect(m_addedBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
                     this, SLOT(onRemovedItemDoubleClicked(QListWidgetItem *)));
  ret = ret &&
        connect(m_notAddedBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
                this, SLOT(onAddedItemDoubleClicked(QListWidgetItem *)));

  ret = ret &&
        connect(removeBtn, SIGNAL(clicked(bool)), this, SLOT(onRemoved(bool)));
  ret =
      ret && connect(addBtn, SIGNAL(clicked(bool)), this, SLOT(onAdded(bool)));

  ret = ret && connect(m_threadsCombo, SIGNAL(currentIndexChanged(int)), this,
                       SLOT(setThreadsCombo(int)));
  ret =
      ret && connect(m_rasterGranularityCombo, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(setGranularityCombo(int)));

  assert(ret);

  // The following instruction is needed in order to prevent contentWidget from
  // shrinking
  // beyond the tolerable size for its grid layout.
  contentWidget->setMinimumSize(layout->minimumSize());

  widget()->hide();
}