Esempio n. 1
0
Notify::Notify (int displayTime, QWidget *parent) : QWidget(parent),
    displayTime(displayTime)
{

    this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowSystemMenuHint|
                         Qt::Tool | Qt::WindowStaysOnTopHint);
    this->setAttribute(Qt::WA_NoSystemBackground, true);
    this->setAttribute(Qt::WA_TranslucentBackground,true);

    backgroundLabel = new QLabel(this);
    backgroundLabel->move(0, 0);
    backgroundLabel->setObjectName("notify-background");


    QHBoxLayout *mainLayout = new QHBoxLayout(backgroundLabel);
    QVBoxLayout *contentLayout = new QVBoxLayout();

    iconLabel = new QLabel(backgroundLabel);
    iconLabel->setFixedWidth(40);
    iconLabel->setAlignment(Qt::AlignCenter);

    titleLabel = new QLabel(backgroundLabel);
    titleLabel->setObjectName("notify-title");

    bodyLabel = new QLabel(backgroundLabel);
    bodyLabel->setObjectName("notify-body");
    QFont font = bodyLabel->font();
    font.setPixelSize(12);
    bodyLabel->setFont(font);

    contentLayout->addWidget(titleLabel);
    contentLayout->addWidget(bodyLabel);

    mainLayout->addWidget(iconLabel);
    mainLayout->addSpacing(5);
    mainLayout->addLayout(contentLayout);


    closeBtn = new QPushButton("×", backgroundLabel);
    closeBtn->setObjectName("notify-close-btn");
    closeBtn->setFixedSize(24, 24);
    connect(closeBtn, &QPushButton::clicked, this, [this]{
        Q_EMIT disappeared();
    });

    this->setStyleSheet("#notify-background {"
                        "border: 1px solid #ccc;"
                        "background:white;"
                        "border-radius: 4px;"
                        "} "
                        "#notify-title{"
                        "font-weight: bold;"
                        "color: #333;"
                        "font-size: 14px;"
                        "}"
                        "#notify-body{"
                        "color: #444;"
                        "}"
                        "#notify-close-btn{ "
                        "border: 0;"
                        "color: #999;"
                        "}"
                        "#notify-close-btn:hover{ "
                        "background: #ccc;"
                        "}");

}
Esempio n. 2
0
KSegSelectionGroupDialog::KSegSelectionGroupDialog(KSegView *view,
						   vector<KSegSelectionGroup *> &inGroups,
						   KSegDocument *inDoc)
  : QDialog(view), justMade(true), doc(inDoc), groups(inGroups)
{
  QHBoxLayout *hbl = new QHBoxLayout(this);

  groupLBox = new QListWidget(this);
  groupLBox->setMinimumSize(140, 300);
  hbl->addWidget(groupLBox);

  hbl->addSpacing(8);
  
  QVBoxLayout *vbl = new QVBoxLayout();

  selectBut = new QPushButton(tr("Select"), this);
  deselectBut = new QPushButton(tr("Deselect"), this);
  newBut = new QPushButton(tr("New Group"), this);
  deleteBut = new QPushButton(tr("Delete Group"),this);
  closeBut = new QPushButton(tr("Close"), this);
  affectInvisible = new QCheckBox(tr("Affect\nInvisible\nItems"), this);

  QToolTip::add(selectBut, tr("Hold SHIFT and click to add to current selection"));
  selectBut->installEventFilter(this);

  QToolTip::add(affectInvisible, tr("Whether the \"All <Type>\" groups also (de)select invisible objects"));

  vbl->addSpacing(8);
  vbl->addWidget(selectBut);
  vbl->addWidget(deselectBut);
  vbl->addWidget(newBut);
  vbl->addWidget(deleteBut);
  vbl->addWidget(closeBut);
  vbl->addSpacing(16);

  vbl->addWidget(affectInvisible);

  vbl->addItem(new QSpacerItem(0, 0));
  hbl->addLayout(vbl);
  hbl->addSpacing(8);  

  //now set up items properties

  connect(groupLBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(doc, SIGNAL(documentChanged()), this, SLOT(updateButtons()));

  connect(selectBut, SIGNAL(clicked()), this, SLOT(select()));
  connect(deselectBut, SIGNAL(clicked()), this, SLOT(deselect()));
  connect(newBut, SIGNAL(clicked()), this, SLOT(newGroup()));
  connect(deleteBut, SIGNAL(clicked()), this, SLOT(deleteGroup()));
  connect(closeBut, SIGNAL(clicked()), this, SLOT(close()));

  groupLBox->setSelectionMode(QAbstractItemView::ExtendedSelection);

  groupLBox->addItem("*" + tr("All Points"));
  groupLBox->addItem("*" + tr("All Segments"));
  groupLBox->addItem("*" + tr("All Rays"));
  groupLBox->addItem("*" + tr("All Lines"));
  groupLBox->addItem("*" + tr("All Circles"));
  groupLBox->addItem("*" + tr("All Arcs"));
  groupLBox->addItem("*" + tr("All Polygons"));
  groupLBox->addItem("*" + tr("All Circle Interiors"));
  groupLBox->addItem("*" + tr("All Arc Sectors"));
  groupLBox->addItem("*" + tr("All Arc Segments"));
  groupLBox->addItem("*" + tr("All Loci"));
  groupLBox->addItem("*" + tr("All Measurements"));
  groupLBox->addItem("*" + tr("All Calculations"));

  numFixedGroups = groupLBox->count();

  int i;
  for(i = 0; i < (int)groups.size(); ++i) {
    groupLBox->addItem(" " + groups[i]->getName());
  }
}
Esempio n. 3
0
TransactionView::TransactionView(QWidget *parent) :
    QWidget(parent), model(0), transactionProxyModel(0),
    transactionView(0)
{
    // Build filter row
    setContentsMargins(0,0,0,0);

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);
#ifdef Q_OS_MAC
    hlayout->setSpacing(5);
    hlayout->addSpacing(26);
#else
    hlayout->setSpacing(0);
    hlayout->addSpacing(23);
#endif

    dateWidget = new QComboBox(this);
#ifdef Q_OS_MAC
    dateWidget->setFixedWidth(121);
#else
    dateWidget->setFixedWidth(120);
#endif
    dateWidget->addItem(tr("All"), All);
    dateWidget->addItem(tr("Today"), Today);
    dateWidget->addItem(tr("This week"), ThisWeek);
    dateWidget->addItem(tr("This month"), ThisMonth);
    dateWidget->addItem(tr("Last month"), LastMonth);
    dateWidget->addItem(tr("This year"), ThisYear);
    dateWidget->addItem(tr("Range..."), Range);
    hlayout->addWidget(dateWidget);

    typeWidget = new QComboBox(this);
#ifdef Q_OS_MAC
    typeWidget->setFixedWidth(121);
#else
    typeWidget->setFixedWidth(120);
#endif

    typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
    typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
                                        TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
    typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
                                  TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
    typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
    typeWidget->addItem(tr("Minted"), TransactionFilterProxy::TYPE(TransactionRecord::StakeMint));
    typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
    typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));

    hlayout->addWidget(typeWidget);

    addressWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    addressWidget->setPlaceholderText(tr("Enter address or label to search"));
#endif
    hlayout->addWidget(addressWidget);

    amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef Q_OS_MAC
    amountWidget->setFixedWidth(97);
#else
    amountWidget->setFixedWidth(100);
#endif
    amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
    hlayout->addWidget(amountWidget);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(createDateRangeWidget());
    vlayout->addWidget(view);
    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_OS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    transactionView = view;

    // Actions
    QAction *copyAddressAction = new QAction(tr("Copy address"), this);
    QAction *copyLabelAction = new QAction(tr("Copy label"), this);
    QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
    QAction *editLabelAction = new QAction(tr("Edit label"), this);
    QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyLabelAction);
    contextMenu->addAction(copyAmountAction);
    contextMenu->addAction(editLabelAction);
    contextMenu->addAction(showDetailsAction);

    // Connect actions
    connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
    connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
    connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString)));
    connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString)));

    connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
    connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
    connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
    connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
}
Esempio n. 4
0
WindowMain::WindowMain(QWidget *parent)
	: QMainWindow(parent)
{
	importer = new OracleImporter(QDesktopServices::storageLocation(QDesktopServices::DataLocation), this);
	nam = new QNetworkAccessManager(this);
	
	checkBoxLayout = new QVBoxLayout;
	
	QWidget *checkboxFrame = new QWidget;
	checkboxFrame->setLayout(checkBoxLayout);
	
	QScrollArea *checkboxArea = new QScrollArea;
	checkboxArea->setWidget(checkboxFrame);
	checkboxArea->setWidgetResizable(true);
	
	checkAllButton = new QPushButton(tr("&Check all"));
	connect(checkAllButton, SIGNAL(clicked()), this, SLOT(actCheckAll()));
	uncheckAllButton = new QPushButton(tr("&Uncheck all"));
	connect(uncheckAllButton, SIGNAL(clicked()), this, SLOT(actUncheckAll()));
	
	QHBoxLayout *checkAllButtonLayout = new QHBoxLayout;
	checkAllButtonLayout->addWidget(checkAllButton);
	checkAllButtonLayout->addWidget(uncheckAllButton);
	
	startButton = new QPushButton(tr("&Start download"));
	connect(startButton, SIGNAL(clicked()), this, SLOT(actStart()));
	
	QVBoxLayout *settingsLayout = new QVBoxLayout;
	settingsLayout->addWidget(checkboxArea);
	settingsLayout->addLayout(checkAllButtonLayout);
	settingsLayout->addWidget(startButton);
	
	totalLabel = new QLabel(tr("Total progress:"));
	totalProgressBar = new QProgressBar;
	nextSetLabel1 = new QLabel(tr("Current file:"));
	nextSetLabel2 = new QLabel;
	fileLabel = new QLabel(tr("Progress:"));
	fileProgressBar = new QProgressBar;
	
	messageLog = new QTextEdit;
	messageLog->setReadOnly(true);
	
	QGridLayout *grid = new QGridLayout;
	grid->addWidget(totalLabel, 0, 0);
	grid->addWidget(totalProgressBar, 0, 1);
	grid->addWidget(nextSetLabel1, 1, 0);
	grid->addWidget(nextSetLabel2, 1, 1);
	grid->addWidget(fileLabel, 2, 0);
	grid->addWidget(fileProgressBar, 2, 1);
	grid->addWidget(messageLog, 3, 0, 1, 2);
	
	QHBoxLayout *mainLayout = new QHBoxLayout;
	mainLayout->addLayout(settingsLayout, 6);
	mainLayout->addSpacing(10);
	mainLayout->addLayout(grid, 10);
	
	QWidget *centralWidget = new QWidget;
	centralWidget->setLayout(mainLayout);
	setCentralWidget(centralWidget);
	
	connect(importer, SIGNAL(setIndexChanged(int, int, const QString &)), this, SLOT(updateTotalProgress(int, int, const QString &)));
	connect(importer, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateFileProgress(int, int)));
	
	aLoadSetsFile = new QAction(tr("Load sets information from &file..."), this);
	connect(aLoadSetsFile, SIGNAL(triggered()), this, SLOT(actLoadSetsFile()));
	aDownloadSetsFile = new QAction(tr("&Download sets information..."), this);
	connect(aDownloadSetsFile, SIGNAL(triggered()), this, SLOT(actDownloadSetsFile()));
	aExit = new QAction(tr("E&xit"), this);
	connect(aExit, SIGNAL(triggered()), this, SLOT(close()));
	
	fileMenu = menuBar()->addMenu(tr("&File"));
	fileMenu->addAction(aLoadSetsFile);
	fileMenu->addAction(aDownloadSetsFile);
	fileMenu->addSeparator();
	fileMenu->addAction(aExit);
	
	setWindowTitle(tr("Oracle importer"));
	setMinimumSize(750, 500);

	QStringList args = qApp->arguments();
	if (args.contains("-dlsets"))
		downloadSetsFile(defaultSetsUrl);
	
	statusLabel = new QLabel;
	statusBar()->addWidget(statusLabel);
	statusLabel->setText(tr("Sets data not loaded."));
}
        BodyMotionGenerationSetupDialog() : QDialog(MainWindow::instance()){

            setWindowTitle(_("Body Motion Generation Setup"));

            vbox = new QVBoxLayout();

            QHBoxLayout* hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Time scale")));
            timeScaleRatioSpin.setDecimals(2);
            timeScaleRatioSpin.setRange(0.01, 9.99);
            timeScaleRatioSpin.setSingleStep(0.01);
            timeScaleRatioSpin.setValue(1.0);
            hbox->addWidget(&timeScaleRatioSpin);
            
            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Pre-initial")));
            preInitialDurationSpin.setDecimals(1);
            preInitialDurationSpin.setRange(0.0, 9.9);
            preInitialDurationSpin.setSingleStep(0.1);
            preInitialDurationSpin.setValue(1.0);
            hbox->addWidget(&preInitialDurationSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            
            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Post-final")));
            postFinalDurationSpin.setDecimals(1);
            postFinalDurationSpin.setRange(0.0, 9.9);
            postFinalDurationSpin.setSingleStep(0.1);
            postFinalDurationSpin.setValue(1.0);
            hbox->addWidget(&postFinalDurationSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();

            hbox = newRow(vbox);
            onlyTimeBarRangeCheck.setText(_("Time bar's range only"));
            onlyTimeBarRangeCheck.setChecked(false);
            hbox->addWidget(&onlyTimeBarRangeCheck);
            
            se3Check.setText(_("Put all link positions"));
            se3Check.setChecked(false);
            hbox->addWidget(&se3Check);
            hbox->addStretch();
            
            hbox = newRow(vbox);
            newBodyItemCheck.setText(_("Make a new body item"));
            newBodyItemCheck.setChecked(true);
            hbox->addWidget(&newBodyItemCheck);
            hbox->addStretch();

            addSeparator(vbox, &stealthyStepCheck);
            stealthyStepCheck.setText(_("Stealthy Step Mode"));
            stealthyStepCheck.setToolTip(_("This mode makes foot lifting / landing smoother to increase the stability"));
            stealthyStepCheck.setChecked(true);

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Height ratio thresh")));
            stealthyHeightRatioThreshSpin.setAlignment(Qt::AlignCenter);
            stealthyHeightRatioThreshSpin.setDecimals(2);
            stealthyHeightRatioThreshSpin.setRange(1.00, 9.99);
            stealthyHeightRatioThreshSpin.setSingleStep(0.01);
            stealthyHeightRatioThreshSpin.setValue(2.0);
            hbox->addWidget(&stealthyHeightRatioThreshSpin);
            hbox->addStretch();

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Flat Lifting Height")));
            flatLiftingHeightSpin.setAlignment(Qt::AlignCenter);
            flatLiftingHeightSpin.setDecimals(3);
            flatLiftingHeightSpin.setRange(0.0, 0.0999);
            flatLiftingHeightSpin.setSingleStep(0.001);
            flatLiftingHeightSpin.setValue(0.005);
            hbox->addWidget(&flatLiftingHeightSpin);
            hbox->addWidget(new QLabel(_("[m]")));

            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Flat Landing Height")));
            flatLandingHeightSpin.setAlignment(Qt::AlignCenter);
            flatLandingHeightSpin.setDecimals(3);
            flatLandingHeightSpin.setRange(0.0, 0.0999);
            flatLandingHeightSpin.setSingleStep(0.001);
            flatLandingHeightSpin.setValue(0.005);
            hbox->addWidget(&flatLandingHeightSpin);
            hbox->addWidget(new QLabel(_("[m]")));
            hbox->addStretch();

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Impact reduction height")));
            impactReductionHeightSpin.setAlignment(Qt::AlignCenter);
            impactReductionHeightSpin.setDecimals(3);
            impactReductionHeightSpin.setRange(0.0, 0.099);
            impactReductionHeightSpin.setSingleStep(0.001);
            impactReductionHeightSpin.setValue(0.005);
            hbox->addWidget(&impactReductionHeightSpin);
            hbox->addWidget(new QLabel(_("[m]")));
            
            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Impact reduction time")));
            impactReductionTimeSpin.setAlignment(Qt::AlignCenter);
            impactReductionTimeSpin.setDecimals(3);
            impactReductionTimeSpin.setRange(0.001, 0.999);
            impactReductionTimeSpin.setSingleStep(0.001);
            impactReductionTimeSpin.setValue(0.04);
            hbox->addWidget(&impactReductionTimeSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();
                             
            addSeparator(vbox, &autoZmpCheck);
            autoZmpCheck.setText(_("Auto ZMP Mode"));
            autoZmpCheck.setToolTip(_("Automatically insert ZMP and foot key poses for stable motion"));
            autoZmpCheck.setChecked(true);

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Min. transtion time")));
            minZmpTransitionTimeSpin.setDecimals(2);
            minZmpTransitionTimeSpin.setRange(0.01, 0.99);
            minZmpTransitionTimeSpin.setSingleStep(0.01);
            minZmpTransitionTimeSpin.setValue(0.1);
            hbox->addWidget(&minZmpTransitionTimeSpin);
            hbox->addWidget(new QLabel(_("[s]")));

            hbox->addSpacing(8);
            hbox->addWidget(new QLabel(_("Centering time thresh")));
            zmpCenteringTimeThreshSpin.setDecimals(3);
            zmpCenteringTimeThreshSpin.setRange(0.001, 0.999);
            zmpCenteringTimeThreshSpin.setSingleStep(0.001);
            zmpCenteringTimeThreshSpin.setValue(0.03);
            hbox->addWidget(&zmpCenteringTimeThreshSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();

            hbox = newRow(vbox);
            hbox->addWidget(new QLabel(_("Time margin before lifting")));
            zmpTimeMarginBeforeLiftingSpin.setDecimals(3);
            zmpTimeMarginBeforeLiftingSpin.setRange(0.0, 0.999);
            zmpTimeMarginBeforeLiftingSpin.setSingleStep(0.001);
            zmpTimeMarginBeforeLiftingSpin.setValue(0.0);
            hbox->addWidget(&zmpTimeMarginBeforeLiftingSpin);
            hbox->addWidget(new QLabel(_("[s]")));
            hbox->addStretch();
            
            addSeparator(vbox);
            hbox = newRow(vbox);

            lipSyncMixCheck.setText(_("Mix lip-sync motion"));
            lipSyncMixCheck.setChecked(false);
            hbox->addWidget(&lipSyncMixCheck);
            hbox->addStretch();

            QVBoxLayout* topVBox = new QVBoxLayout();
            topVBox->addLayout(vbox);

            addSeparator(topVBox);

            QPushButton* okButton = new QPushButton(_("&Ok"));
            okButton->setDefault(true);
            QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
            buttonBox->addButton(okButton, QDialogButtonBox::AcceptRole);
            connect(buttonBox,SIGNAL(accepted()), this, SLOT(accept()));
            topVBox->addWidget(buttonBox);

            setLayout(topVBox);
        }
Esempio n. 6
0
SkipDlg::SkipDlg(QWidget *parent, bool _multi, const QString& _error_text, bool _modal ) :
  KDialog ( parent, "" , _modal )
{
  // TODO : port to KDialogBase
  modal = _modal;

  // Set "StaysOnTop", because this dialog is typically used in kio_uiserver,
  // i.e. in a separate process.
#ifdef Q_WS_X11 //FIXME(E): Implement for QT Embedded, mac & win32
  if (modal)
    KWin::setState( winId(), NET::StaysOnTop );
#endif

  b0 = b1 = b2 = 0L;

  setCaption( i18n( "Information" ) );

  b0 = new KPushButton( KStdGuiItem::cancel(), this );
  connect(b0, SIGNAL(clicked()), this, SLOT(b0Pressed()));

  if ( _multi )
  {
    b1 = new QPushButton( i18n( "Skip" ), this );
    connect(b1, SIGNAL(clicked()), this, SLOT(b1Pressed()));

    b2 = new QPushButton( i18n( "Auto Skip" ), this );
    connect(b2, SIGNAL(clicked()), this, SLOT(b2Pressed()));
  }

  QVBoxLayout *vlayout = new QVBoxLayout( this, 10, 0 );
  // vlayout->addStrut( 360 );	makes dlg at least that wide

  QLabel * lb = new QLabel( _error_text, this );
  lb->setFixedHeight( lb->sizeHint().height() );
  lb->setMinimumWidth( lb->sizeHint().width() );
  vlayout->addWidget( lb );

  vlayout->addSpacing( 10 );

  QHBoxLayout* layout = new QHBoxLayout();
  vlayout->addLayout( layout );
  if ( b0 )
  {
    b0->setDefault( true );
    b0->setFixedSize( b0->sizeHint() );
    layout->addWidget( b0 );
    layout->addSpacing( 5 );
  }
  if ( b1 )
  {
    b1->setFixedSize( b1->sizeHint() );
    layout->addWidget( b1 );
    layout->addSpacing( 5 );
  }
  if ( b2 )
  {
    b2->setFixedSize( b2->sizeHint() );
    layout->addWidget( b2 );
    layout->addSpacing( 5 );
  }

  vlayout->addStretch( 10 );
  vlayout->activate();
  resize( sizeHint() );
}
Esempio n. 7
0
JointSliderViewImpl::JointSliderViewImpl(JointSliderView* self) :
    self(self)
{
    self->setDefaultLayoutArea(View::CENTER);
    self->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);

    QVBoxLayout* vbox = new QVBoxLayout();
    vbox->setSpacing(0);

    QHBoxLayout* hbox = new QHBoxLayout();
    hbox->setSpacing(0);

    showAllToggle.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    showAllToggle.setText(_("All"));
    showAllToggle.setToolTip(_("Show all the joints including unselected ones"));
    showAllToggle.setChecked(true);
    showAllToggle.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&showAllToggle);

    jointIdToggle.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    jointIdToggle.setText(_("ID"));
    jointIdToggle.setToolTip(_("Show joint IDs"));
    jointIdToggle.setChecked(false);
    jointIdToggle.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&jointIdToggle);

    nameToggle.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    nameToggle.setText(_("Name"));
    nameToggle.setToolTip(_("Show joint names"));
    nameToggle.setChecked(true);
    nameToggle.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&nameToggle);
    
    putSpinEntryCheck.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    putSpinEntryCheck.setText(_("Numerical"));
    putSpinEntryCheck.setToolTip(_("Show spin entries for numerical input"));
    putSpinEntryCheck.setChecked(true);
    putSpinEntryCheck.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&putSpinEntryCheck);

    putSliderCheck.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    putSliderCheck.setText(_("Slider"));
    putSliderCheck.setToolTip(_("Show sliders for chaning joint positions"));
    putSliderCheck.setChecked(true);
    putSliderCheck.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&putSliderCheck);
    
    putDialCheck.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    putDialCheck.setText(_("Dial"));
    putDialCheck.setToolTip(_("Show dials for chaning joint positions"));
    putDialCheck.setChecked(true);
    putDialCheck.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&putDialCheck);

    labelOnLeftToggle.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    labelOnLeftToggle.setText(_("IL"));
    labelOnLeftToggle.setToolTip(_("Put all the components for each joint in-line"));
    labelOnLeftToggle.setChecked(true);
    labelOnLeftToggle.sigToggled().connect([&](bool){ updateSliderGrid(); });
    hbox->addWidget(&labelOnLeftToggle);

    hbox->addSpacing(4);
    hbox->addWidget(new VSeparator());
    hbox->addSpacing(4);
    
    numColumnsSpin.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    numColumnsSpin.setToolTip(_("The number of columns"));
    numColumnsSpin.setRange(1, 9);
    numColumnsSpin.setValue(1);
    numColumnsSpin.sigValueChanged().connect([&](int n){ onNumColumnsChanged(n);});
    hbox->addWidget(&numColumnsSpin);

    hbox->addSpacing(4);
    hbox->addWidget(new VSeparator());
    hbox->addSpacing(4);

    unitRadioGroup.addButton(&degreeRadio);
    degreeRadio.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    degreeRadio.setText(_("Deg."));
    degreeRadio.setChecked(true);
    degreeRadio.sigToggled().connect([&](bool){ onUnitChanged(); });
    hbox->addWidget(&degreeRadio);

    unitRadioGroup.addButton(&radianRadio);
    radianRadio.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    radianRadio.setText(_("Rad."));
    radianRadio.sigToggled().connect([&](bool){ onUnitChanged(); });
    hbox->addWidget(&radianRadio);

    hbox->addStretch();
    vbox->addLayout(hbox);

    sliderGrid.setSpacing(0);
    sliderGridBase.setLayout(&sliderGrid);
    scrollArea.setFrameShape(QFrame::NoFrame);
    scrollArea.setWidgetResizable(true);
    scrollArea.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    scrollArea.setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    scrollArea.setWidget(&sliderGridBase);

    vbox->addWidget(&scrollArea, 1);
    self->setLayout(vbox);

    updateSliderGrid();

    updateJointPositionsLater.setFunction([&](){ updateJointPositions(); });
    updateJointPositionsLater.setPriority(LazyCaller::PRIORITY_LOW);

    connectionOfCurrentBodyItemChanged = 
        BodyBar::instance()->sigCurrentBodyItemChanged().connect(
            [&](BodyItem* item){ onCurrentBodyItemChanged(item); });

    self->sigActivated().connect([&](){ enableConnectionToSigKinematicStateChanged(true); });
    self->sigDeactivated().connect([&](){ enableConnectionToSigKinematicStateChanged(false); });
}
Esempio n. 8
0
ConfigDialog::ConfigDialog(MovieRecorderImpl* recorder)
    : recorder(recorder),
      updateViewComboLater(std::bind(&ConfigDialog::updateViewCombo, this))
{
    setWindowTitle(_("Movie Recorder"));
    
    QVBoxLayout* vbox = new QVBoxLayout();
    setLayout(vbox);

    QHBoxLayout* hbox = new QHBoxLayout();
    hbox->addWidget(new QLabel(_("Target view:")));

    targetViewCombo.sigCurrentIndexChanged().connect(
        std::bind(&ConfigDialog::onTargetViewIndexChanged, this, std::placeholders::_1));
    hbox->addWidget(&targetViewCombo);

    viewMarkerCheck.setText(_("Show the marker"));
    viewMarkerCheck.sigToggled().connect(
        std::bind(&MovieRecorderImpl::onViewMarkerToggled, recorder, std::placeholders::_1));
    hbox->addWidget(&viewMarkerCheck);
    
    hbox->addStretch();
    vbox->addLayout(hbox);

    hbox = new QHBoxLayout();
    hbox->addWidget(new QLabel(_("Recording mode: ")));
    ButtonGroup* modeGroup = new ButtonGroup();
    for(int i=0; i < N_RECORDING_MODES; ++i){
        RadioButton* radio = &modeRadioButtons[i];
        radio->setText(recorder->recordingMode.label(i));
        modeGroup->addButton(radio, i);
        hbox->addWidget(radio);
    }
    modeRadioButtons[0].setChecked(true);
    modeGroup->sigButtonClicked().connect(
        std::bind(&ConfigDialog::onRecordingModeRadioClicked, this, std::placeholders::_1));
    hbox->addStretch();
    vbox->addLayout(hbox);

    hbox = new QHBoxLayout();
    hbox->addWidget(new QLabel(_("Directory")));
    hbox->addWidget(&directoryEntry);

    QIcon folderIcon = QIcon::fromTheme("folder");
    if(folderIcon.isNull()){
        directoryButton.setText(_("Select"));
    } else {
        directoryButton.setIcon(folderIcon);
    }
    directoryButton.sigClicked().connect(
        std::bind(&ConfigDialog::showDirectorySelectionDialog, this));
    hbox->addWidget(&directoryButton);
    vbox->addLayout(hbox);

    hbox = new QHBoxLayout();
    hbox->addWidget(new QLabel(_("Basename")));
    basenameEntry.setText("scene");
    hbox->addWidget(&basenameEntry);
    hbox->addStretch();
    vbox->addLayout(hbox);

    hbox = new QHBoxLayout();
    hbox->addWidget(new QLabel(_("Frame rate")));
    fpsSpin.setDecimals(1);
    fpsSpin.setRange(1.0, 9999.9);
    fpsSpin.setValue(30.0);
    fpsSpin.setSingleStep(0.1);
    hbox->addWidget(&fpsSpin);
    hbox->addWidget(new QLabel(_("[fps]")));
    hbox->addStretch();
    vbox->addLayout(hbox);

    hbox = new QHBoxLayout();
    startTimeCheck.setText(_("Start time"));
    hbox->addWidget(&startTimeCheck);
    startTimeSpin.setDecimals(2);
    startTimeSpin.setRange(0.00, 9999.99);
    startTimeSpin.setSingleStep(0.1);
    hbox->addWidget(&startTimeSpin);
    hbox->addWidget(new QLabel(_("[s]")));
    hbox->addSpacing(4);

    finishTimeCheck.setText(_("Finish time"));
    hbox->addWidget(&finishTimeCheck);
    finishTimeSpin.setDecimals(2);
    finishTimeSpin.setRange(0.00, 9999.99);
    finishTimeSpin.setSingleStep(0.1);
    hbox->addWidget(&finishTimeSpin);
    hbox->addWidget(new QLabel(_("[s]")));
    hbox->addStretch();
    vbox->addLayout(hbox);
    
    hbox = new QHBoxLayout();
    imageSizeCheck.setText(_("Image size"));
    hbox->addWidget(&imageSizeCheck);
    
    imageWidthSpin.setRange(1, 9999);
    imageWidthSpin.setValue(640);
    hbox->addWidget(&imageWidthSpin);

    hbox->addWidget(new QLabel("x"));
    imageHeightSpin.setRange(1, 9999);
    imageHeightSpin.setValue(480);
    hbox->addWidget(&imageHeightSpin);
    hbox->addStretch();
    vbox->addLayout(hbox);

    if(ENABLE_MOUSE_CURSOR_CAPTURE){
        hbox = new QHBoxLayout();
        mouseCursorCheck.setText(_("Capture the mouse cursor"));
        hbox->addWidget(&mouseCursorCheck);
        hbox->addStretch();
        vbox->addLayout(hbox);
    }

    vbox->addWidget(new HSeparator());
    QDialogButtonBox* buttonBox = new QDialogButtonBox(this);

    recordingToggle.setText(_("&Record"));
    recordingToggle.setDefault(true);
    recordingToggle.sigToggled().connect(
        std::bind(&MovieRecorderImpl::activateRecording, recorder, std::placeholders::_1, true));
    buttonBox->addButton(&recordingToggle, QDialogButtonBox::ActionRole);

    vbox->addWidget(buttonBox);
}
Esempio n. 9
0
SessionManager::SessionManager(QWidget* parent, const char* name)
  : QWidget(parent, name)
{
  currentlyDisplayedSession = 0;
  QGridLayout* grid = new QGridLayout(this, 4, 2, 2, 2);
  preferredWidth = 200;
  grid->setColStretch(0, 1);
  grid->setColStretch(1, 1);

  scroll = new QScrollView(this);
  frame = new QFrame(scroll->viewport());
  scroll->addChild(frame);

  vBox = new QVBoxLayout(frame, 0, 2);
  vBox->setDirection(QBoxLayout::Up);

  descriptionField = new QTextEdit(this, "description");
  titleField = new QLineEdit(this, "title");
  keywordField = new QLineEdit(this, "keyword");

  selectedGeneNo = new QLineEdit("0  Genes Included", this, "selectedGeneNo");
  //  selectedGeneNo = new QLabel("0  Genes Included", this, "selectedGeneNo");

  commitChanges = new QPushButton("Commit Changes", this, "commitChanges");
  connect(commitChanges, SIGNAL(clicked()), this, SLOT(updateDescriptions()) );
  // commitChanges->setFlat(true);        // enabled if the currently displayed info is owned by the user.. hmm. let's see how we can do
  setDisableColor(commitChanges, true);

  QPushButton* updateSessions = new QPushButton("Update", this, "update");
  connect(updateSessions, SIGNAL(clicked()), this, SIGNAL(updateSessions()) );

  loadGenes = new QPushButton("Load Genes", this, "LoadGenes");
  connect(loadGenes, SIGNAL(clicked()), this, SLOT(selectGenes()) );
  setDisableColor(loadGenes, true);

  copyToSession = new QPushButton("Copy to Current Session", this, "copyToSession");
  connect(copyToSession, SIGNAL(clicked()), this, SLOT(copyIncludedGenesToCurrentSession()) );
  //copyToSession->setFlat(true);         // disabled if nothing selected,, otherwise enabled.. 
  setDisableColor(copyToSession, true);
  appendSession = new QPushButton("Append", this, "appendSession");
  connect(appendSession, SIGNAL(clicked()), this, SLOT(loadAndAppend()) );
  //appendSession->setFlat(true);         // enabled only if one is selected, and readOnly is false.. 
  setDisableColor(appendSession, true);

  grid->addMultiCellWidget(scroll, 0, 1, 1, 1);
  grid->addWidget(selectedGeneNo, 2, 1); 
  //  grid->addWidget(selectedGeneNo, 2, 1, AlignRight); 

  grid->addWidget(titleField, 0, 0);
  grid->addWidget(descriptionField, 1, 0);

  QHBoxLayout* leftBox = new QHBoxLayout();
  grid->addMultiCell(leftBox, 3, 3, 0, 1);
  leftBox->addWidget(commitChanges);
  
  // QHBoxLayout* rightBox = new QHBoxLayout();
  //grid->addLayout(rightBox, 3, 1);

  leftBox->addWidget(loadGenes);
  leftBox->addSpacing(1);
  leftBox->addWidget(copyToSession);
  leftBox->addSpacing(1);
  leftBox->addWidget(appendSession);
  leftBox->addSpacing(10);
  
  leftBox->addWidget(updateSessions);

//    rightBox->addWidget(loadGenes);
//    rightBox->addWidget(copyToSession);
//    rightBox->addWidget(appendSession);
//    rightBox->addSpacing(10);
  
//    rightBox->addWidget(updateSessions);
  
  grid->addWidget(keywordField, 2, 0);
  resize(450, 200);
}
Esempio n. 10
0
void MainBottomWidget::initUi()
{
	m_musicLogo = new QLabel(this);
	QPixmap pix(":/func_btn/music");
	m_musicLogo->setPixmap(pix);
	m_musicLogo->setFixedSize(pix.size());

	m_playButton = new FuncButton(":/func_btn/play_btn", this);
	m_playButton->setObjectName("Play");

	m_playNextButton = new FuncButton(":/func_btn/next_btn", this);
	m_playNextButton->setObjectName("PlayNext");

	m_playFrontButton = new FuncButton(":/func_btn/front_btn", this);
	m_playFrontButton->setObjectName("PlayFront");


	QWidget *buttonWidget = new QWidget;
	QHBoxLayout *button = new QHBoxLayout(buttonWidget);
	button->addWidget(m_playFrontButton, 0, Qt::AlignVCenter);
	button->addSpacing(10);
	button->addWidget(m_playButton, 0, Qt::AlignVCenter);
	button->addSpacing(10);
	button->addWidget(m_playNextButton, 0, Qt::AlignVCenter);
	button->setContentsMargins(10, 10, 5, 5);

	m_voiceWidget = new SliderWidget;
	m_voiceWidget->moveTo(0.25);
	m_voiceWidget->setObjectName("VoiceSlider");
	m_postionWidget = new SliderWidget;
	m_postionWidget->setObjectName("PostionSlider");

	QLabel *maxVoice = new QLabel("100");
	maxVoice->setFixedWidth(40);
	maxVoice->setObjectName("VoiceLabel");
	maxVoice->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

	m_currentVoice = new QLabel("25");
	m_currentVoice->setObjectName("VoiceLabel");
	m_currentVoice->setFixedWidth(40);
	m_currentVoice->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

	m_currentPostion = new QLabel("00:00");
	m_currentPostion->setObjectName("PostionLabel");
	m_currentPostion->setFixedWidth(40);
	m_currentPostion->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

	m_duration = new QLabel("00:00");
	m_duration->setObjectName("PostionLabel");
	m_duration->setFixedWidth(40);
	m_duration->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

	QWidget *voiceWidget = new QWidget;
	QHBoxLayout *voice = new QHBoxLayout(voiceWidget);
	voice->addWidget(m_currentVoice, 0, Qt::AlignLeft | Qt::AlignVCenter);
	voice->addWidget(m_voiceWidget, 0, Qt::AlignVCenter);
	voice->addWidget(maxVoice, 0, Qt::AlignRight | Qt::AlignVCenter);

	QWidget *postionWidget = new QWidget;
	QHBoxLayout *postion = new QHBoxLayout(postionWidget);
	postion->addWidget(m_currentPostion, 0, Qt::AlignLeft | Qt::AlignVCenter);
	postion->addWidget(m_postionWidget, 0, Qt::AlignVCenter);
	postion->addWidget(m_duration, 0, Qt::AlignRight | Qt::AlignVCenter);

	QWidget *slider = new QWidget;
	QVBoxLayout *sliderLayout = new QVBoxLayout(slider);
	sliderLayout->addWidget(voiceWidget, 0, Qt::AlignTop | Qt::AlignHCenter);
	sliderLayout->addSpacing(5);
	sliderLayout->addWidget(postionWidget, 0, Qt::AlignBottom | Qt::AlignHCenter);
	sliderLayout->setContentsMargins(5, 5, 5, 5);

	QHBoxLayout *mainLayout = new QHBoxLayout(this);
	mainLayout->addWidget(m_musicLogo, 0, Qt::AlignLeft | Qt::AlignVCenter);
	mainLayout->addSpacing(15);
	mainLayout->addWidget(buttonWidget, 0, Qt::AlignVCenter);
	mainLayout->addStretch();
	mainLayout->addWidget(slider, 0, Qt::AlignRight | Qt::AlignVCenter);
	mainLayout->setContentsMargins(5, 5, 5, 5);
}
Esempio n. 11
0
PinLabelDialog::PinLabelDialog(const QStringList & labels, bool singleRow, const QString & chipLabel, bool isCore, QWidget *parent)
	: QDialog(parent)
{
	m_isCore = isCore;
	m_labels = labels;
	m_doSaveAs = true;
	this->setWindowTitle(QObject::tr("Pin Label Editor"));

	QVBoxLayout * vLayout = new QVBoxLayout(this);

	QScrollArea * scrollArea = new QScrollArea(this);
	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

	QFrame * frame = new QFrame(this);
	QHBoxLayout * hLayout = new QHBoxLayout(frame);

	QFrame * labelsFrame = initLabels(labels, singleRow, chipLabel);

	QFrame * textFrame = new QFrame();
	QVBoxLayout * textLayout = new QVBoxLayout(frame);

	QLabel * label = new QLabel("<html><body>" +
								tr("<p><h2>Pin Label Editor</h2></p>") +
								tr("<p>Click on a label next to a pin number to rename that pin.") + " " +
								tr("You can use the tab key to move through the labels in order.</p>") +
								"</body></html>");
	label->setMaximumWidth(150);
	label->setWordWrap(true);

	textLayout->addWidget(label);
	textLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));
	textFrame->setLayout(textLayout);

	hLayout->addWidget(labelsFrame);
	hLayout->addSpacing(15);
	hLayout->addWidget(textFrame);
	frame->setLayout(hLayout);

	scrollArea->setWidget(frame);	

	QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
	
	QPushButton * cancelButton = buttonBox->button(QDialogButtonBox::Cancel);
	cancelButton->setText(tr("Cancel"));
	cancelButton->setDefault(false);
	
	m_saveAsButton = buttonBox->button(QDialogButtonBox::Save);
	m_saveAsButton->setText(tr("Save"));
	m_saveAsButton->setEnabled(false);
	m_saveAsButton->setDefault(false);

	m_undoButton = new QPushButton(tr("Undo"));
	m_undoButton->setEnabled(false);
	m_undoButton->setDefault(false);

	m_redoButton = new QPushButton(tr("Redo"));
	m_redoButton->setEnabled(false);
	m_redoButton->setDefault(false);

    buttonBox->addButton(m_undoButton, QDialogButtonBox::ResetRole);
    buttonBox->addButton(m_redoButton, QDialogButtonBox::ResetRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

	vLayout->addWidget(scrollArea);
	vLayout->addWidget(buttonBox);
	this->setLayout(vLayout);

	connect(buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
	connect(&m_undoStack, SIGNAL(canRedoChanged(bool)), this, SLOT(undoChanged(bool)));
	connect(&m_undoStack, SIGNAL(canUndoChanged(bool)), this, SLOT(undoChanged(bool)));
	connect(&m_undoStack, SIGNAL(cleanChanged(bool)), this, SLOT(undoChanged(bool)));

}
AMDirectorySynchronizerDialog::AMDirectorySynchronizerDialog(const QString &side1Directory, const QString &side2Directory, const QString &side1DirectoryName, const QString &side2DirectoryName, QWidget *parent) :
	QDialog(parent)
{
	delaySeconds_ = 0;
	delayCountdown_ = 0;

	side1Directory_ = side1Directory;
	side2Directory_ = side2Directory;

	side1DirectoryName_ = side1DirectoryName;
	side2DirectoryName_ = side2DirectoryName;

	closeOnCompletion_ = false;
	timedWarningOnCompletion_ = false;
	lastCompareResult_ = AMRecursiveDirectoryCompare::NotYetRun;

	QVBoxLayout* mainLayout = new QVBoxLayout();

	singleFileProgressBar_ = new QProgressBar();
	singleFileProgressBar_->setRange(0, 100);
	singleFileLabel_ = new QLabel();

	overallTransferProgressBar_ = new QProgressBar();
	overallTransferProgressBar_->setRange(0, 100);
	overallTransferLabel_ = new QLabel();

	currentCopyFileLabel_ = new QLabel();

	errorTextEdit_ = new QTextEdit();
	errorTextEdit_->setReadOnly(true);
	errorCloseButton_ = new QPushButton("Close");
	errorCloseButton_->setVisible(false);
	successfulSync_ = false;

	progressTextEdit_ = new QTextEdit();
	progressTextEdit_->setReadOnly(true);

	fileListingEdit_ = new QTextEdit();
	fileListingEdit_->setReadOnly(true);

	feedbackStackWidget_ = new AMVerticalStackWidget();
	feedbackStackWidget_->addItem("Files", fileListingEdit_);
	feedbackStackWidget_->addItem("Progress", progressTextEdit_);
	feedbackStackWidget_->addItem("Errors", errorTextEdit_);
	feedbackStackWidget_->collapseItem(0);
	feedbackStackWidget_->collapseItem(1);
	feedbackStackWidget_->collapseItem(2);

	prepareButton_ = new QPushButton("Prepare");
	startButton_ = new QPushButton("Start");
	QHBoxLayout *buttonsHL = new QHBoxLayout();
	buttonsHL->addSpacing(0);
	buttonsHL->addWidget(prepareButton_);
	buttonsHL->addWidget(startButton_);

	QHBoxLayout *singleFileHL = new QHBoxLayout();
	singleFileHL->addWidget(singleFileProgressBar_, Qt::AlignCenter);
	QHBoxLayout *overallTransferHL = new QHBoxLayout();
	overallTransferHL->addWidget(overallTransferProgressBar_, Qt::AlignCenter);

	QGridLayout *gridLayout = new QGridLayout();
	gridLayout->addLayout(singleFileHL, 0, 0, 1, 9, Qt::AlignCenter);
	gridLayout->addWidget(singleFileLabel_, 0, 10, 1, 1, Qt::AlignRight);
	gridLayout->addLayout(overallTransferHL, 1, 0, 1, 9, Qt::AlignCenter);
	gridLayout->addWidget(overallTransferLabel_, 1, 10, 1, 1, Qt::AlignRight);

	mainStatusLabel_ = new QLabel("Synchronize Directories, press Prepare or Start to continue.");
	mainLayout->addWidget(mainStatusLabel_);

	mainLayout->addLayout(gridLayout);
	mainLayout->addWidget(currentCopyFileLabel_);

	mainLayout->addLayout(buttonsHL);
	mainLayout->addWidget(feedbackStackWidget_);
	mainLayout->addWidget(errorCloseButton_, Qt::AlignCenter);


	setLayout(mainLayout);
	synchronizer_ = new AMDirectorySynchronizer(side1Directory_, side2Directory_);
	synchronizer_->setSide1DirectorName(side1DirectoryName_);
	synchronizer_->setSide2DirectorName(side2DirectoryName_);
	synchronizer_->setAllowSide1Creation(true);

	connect(synchronizer_, SIGNAL(copyCompleted()), this, SLOT(onSynchronizerComplete()));
	connect(synchronizer_, SIGNAL(copyFailed()), this, SLOT(onSynchronizerComplete()));
	connect(synchronizer_, SIGNAL(errorMessagesChanged(const QString&)), this, SLOT(onSynchronizerErrorTextChanged(const QString&)));
	connect(synchronizer_, SIGNAL(progressMessagesChanged(QString)), this, SLOT(onSynchronizerProgressTextChanged(QString)));
	connect(synchronizer_, SIGNAL(progressChanged(int,int,int)), this, SLOT(onProgressChanged(int,int,int)));
	connect(synchronizer_, SIGNAL(currentCopyFileChanged(QString)), this, SLOT(onCurrentCopyFileChanged(QString)));

	connect(errorCloseButton_, SIGNAL(clicked()), this, SLOT(onCloseButtonClicked()));

	connect(prepareButton_, SIGNAL(clicked()), this, SLOT(onPrepareButtonClicked()));
	connect(startButton_, SIGNAL(clicked()), this, SLOT(onStartButtonClicked()));

	startButton_->setDefault(false);
	errorCloseButton_->setDefault(false);
	prepareButton_->setDefault(true);

	setModal(true);
}
Esempio n. 13
0
void RTIMULibDemo::layoutWindow()
{
    QVBoxLayout *vLayout = new QVBoxLayout();
    vLayout->setContentsMargins(3, 3, 3, 3);
    vLayout->setSpacing(3);

    vLayout->addWidget(new QLabel("Fusion state (quaternion): "));

    QHBoxLayout *dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    m_fusionQPoseScalar = new QLabel("1");
    m_fusionQPoseScalar->setFrameStyle(QFrame::Panel);
    m_fusionQPoseX = new QLabel("0");
    m_fusionQPoseX->setFrameStyle(QFrame::Panel);
    m_fusionQPoseY = new QLabel("0");
    m_fusionQPoseY->setFrameStyle(QFrame::Panel);
    m_fusionQPoseZ = new QLabel("0");
    m_fusionQPoseZ->setFrameStyle(QFrame::Panel);
    dataLayout->addWidget(m_fusionQPoseScalar);
    dataLayout->addWidget(m_fusionQPoseX);
    dataLayout->addWidget(m_fusionQPoseY);
    dataLayout->addWidget(m_fusionQPoseZ);
    dataLayout->addSpacing(30);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Pose - roll, pitch, yaw (degrees): "));

    m_fusionPoseX = new QLabel("0");
    m_fusionPoseX->setFrameStyle(QFrame::Panel);
    m_fusionPoseY = new QLabel("0");
    m_fusionPoseY->setFrameStyle(QFrame::Panel);
    m_fusionPoseZ = new QLabel("0");
    m_fusionPoseZ->setFrameStyle(QFrame::Panel);
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_fusionPoseX);
    dataLayout->addWidget(m_fusionPoseY);
    dataLayout->addWidget(m_fusionPoseZ);
    dataLayout->addSpacing(137);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Gyros (radians/s): "));

    m_gyroX = new QLabel("0");
    m_gyroX->setFrameStyle(QFrame::Panel);
    m_gyroY = new QLabel("0");
    m_gyroY->setFrameStyle(QFrame::Panel);
    m_gyroZ = new QLabel("0");
    m_gyroZ->setFrameStyle(QFrame::Panel);
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_gyroX);
    dataLayout->addWidget(m_gyroY);
    dataLayout->addWidget(m_gyroZ);
    dataLayout->addSpacing(137);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Accelerometers (g): "));

    m_accelX = new QLabel("0");
    m_accelX->setFrameStyle(QFrame::Panel);
    m_accelY = new QLabel("0");
    m_accelY->setFrameStyle(QFrame::Panel);
    m_accelZ = new QLabel("0");
    m_accelZ->setFrameStyle(QFrame::Panel);
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_accelX);
    dataLayout->addWidget(m_accelY);
    dataLayout->addWidget(m_accelZ);
    dataLayout->addSpacing(137);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Magnetometers (uT): "));

    m_compassX = new QLabel("0");
    m_compassX->setFrameStyle(QFrame::Panel);
    m_compassY = new QLabel("0");
    m_compassY->setFrameStyle(QFrame::Panel);
    m_compassZ = new QLabel("0");
    m_compassZ->setFrameStyle(QFrame::Panel);
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_compassX);
    dataLayout->addWidget(m_compassY);
    dataLayout->addWidget(m_compassZ);
    dataLayout->addSpacing(137);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Fusion controls: "));

    m_enableGyro = new QCheckBox("Enable gyros");
    m_enableGyro->setChecked(true);
    vLayout->addWidget(m_enableGyro);

    m_enableAccel = new QCheckBox("Enable accels");
    m_enableAccel->setChecked(true);
    vLayout->addWidget(m_enableAccel);

    m_enableCompass = new QCheckBox("Enable compass");
    m_enableCompass->setChecked(true);
    vLayout->addWidget(m_enableCompass);

    m_enableDebug = new QCheckBox("Enable debug messages");
    m_enableDebug->setChecked(false);
    vLayout->addWidget(m_enableDebug);

    vLayout->addStretch(1);

    centralWidget()->setLayout(vLayout);
    setFixedSize(500, 450);

}
Esempio n. 14
0
KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
    : QMainWindow( parent, name, 0 )
{
    QWidget *border = new QWidget( this );
    border->setBackgroundColor( black );
    setCentralWidget( border );

    QVBoxLayout *borderLayout = new QVBoxLayout( border );
    borderLayout->addStretch( 1 );

    QWidget *mainWin = new QWidget( border );
    mainWin->setFixedSize(640, 480);
    borderLayout->addWidget( mainWin, 0, AlignHCenter );

    borderLayout->addStretch( 1 );

    view = new KAsteroidsView( mainWin );
    view->setFocusPolicy( StrongFocus );
    connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) );
    connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) );
    connect( view, SIGNAL( rocksRemoved() ), SLOT( slotRocksRemoved() ) );
    connect( view, SIGNAL( updateVitals() ), SLOT( slotUpdateVitals() ) );

    QVBoxLayout *vb = new QVBoxLayout( mainWin );
    QHBoxLayout *hb = new QHBoxLayout;
    QHBoxLayout *hbd = new QHBoxLayout;
    vb->addLayout( hb );

    QFont labelFont( "helvetica", 24 );
    QColorGroup grp( darkGreen, black, QColor( 128, 128, 128 ),
	    QColor( 64, 64, 64 ), black, darkGreen, black );
    QPalette pal( grp, grp, grp );

    mainWin->setPalette( pal );

    hb->addSpacing( 10 );

    QLabel *label;
    label = new QLabel( tr("Score"), mainWin );
    label->setFont( labelFont );
    label->setPalette( pal );
    label->setFixedWidth( label->sizeHint().width() );
    hb->addWidget( label );

    scoreLCD = new QLCDNumber( 6, mainWin );
    scoreLCD->setFrameStyle( QFrame::NoFrame );
    scoreLCD->setSegmentStyle( QLCDNumber::Flat );
    scoreLCD->setFixedWidth( 150 );
    scoreLCD->setPalette( pal );
    hb->addWidget( scoreLCD );
    hb->addStretch( 10 );

    label = new QLabel( tr("Level"), mainWin );
    label->setFont( labelFont );
    label->setPalette( pal );
    label->setFixedWidth( label->sizeHint().width() );
    hb->addWidget( label );

    levelLCD = new QLCDNumber( 2, mainWin );
    levelLCD->setFrameStyle( QFrame::NoFrame );
    levelLCD->setSegmentStyle( QLCDNumber::Flat );
    levelLCD->setFixedWidth( 70 );
    levelLCD->setPalette( pal );
    hb->addWidget( levelLCD );
    hb->addStretch( 10 );

    label = new QLabel( tr("Ships"), mainWin );
    label->setFont( labelFont );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hb->addWidget( label );

    shipsLCD = new QLCDNumber( 1, mainWin );
    shipsLCD->setFrameStyle( QFrame::NoFrame );
    shipsLCD->setSegmentStyle( QLCDNumber::Flat );
    shipsLCD->setFixedWidth( 40 );
    shipsLCD->setPalette( pal );
    hb->addWidget( shipsLCD );

    hb->addStrut( 30 );

    vb->addWidget( view, 10 );

// -- bottom layout:
    vb->addLayout( hbd );

    QFont smallFont( "helvetica", 14 );
    hbd->addSpacing( 10 );

    QString sprites_prefix = "qasteroids/sprites/";
/*
    label = new QLabel( tr( "T" ), mainWin );
    label->setFont( smallFont );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    teleportsLCD = new QLCDNumber( 1, mainWin );
    teleportsLCD->setFrameStyle( QFrame::NoFrame );
    teleportsLCD->setSegmentStyle( QLCDNumber::Flat );
    teleportsLCD->setPalette( pal );
    teleportsLCD->setFixedHeight( 20 );
    hbd->addWidget( teleportsLCD );

    hbd->addSpacing( 10 );
*/
    QPixmap pm( sprites_prefix + "powerups/brake.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    brakesLCD = new QLCDNumber( 1, mainWin );
    brakesLCD->setFrameStyle( QFrame::NoFrame );
    brakesLCD->setSegmentStyle( QLCDNumber::Flat );
    brakesLCD->setPalette( pal );
    brakesLCD->setFixedHeight( 20 );
    hbd->addWidget( brakesLCD );

    hbd->addSpacing( 10 );

    pm.load( sprites_prefix + "powerups/shield.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    shieldLCD = new QLCDNumber( 1, mainWin );
    shieldLCD->setFrameStyle( QFrame::NoFrame );
    shieldLCD->setSegmentStyle( QLCDNumber::Flat );
    shieldLCD->setPalette( pal );
    shieldLCD->setFixedHeight( 20 );
    hbd->addWidget( shieldLCD );

    hbd->addSpacing( 10 );

    pm.load( sprites_prefix + "powerups/shoot.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    shootLCD = new QLCDNumber( 1, mainWin );
    shootLCD->setFrameStyle( QFrame::NoFrame );
    shootLCD->setSegmentStyle( QLCDNumber::Flat );
    shootLCD->setPalette( pal );
    shootLCD->setFixedHeight( 20 );
    hbd->addWidget( shootLCD );

    hbd->addStretch( 1 );

    label = new QLabel( tr( "Fuel" ), mainWin );
    label->setFont( smallFont );
    label->setFixedWidth( label->sizeHint().width() + 10 );
    label->setPalette( pal );
    hbd->addWidget( label );

    powerMeter = new KALedMeter( mainWin );
    powerMeter->setFrameStyle( QFrame::Box | QFrame::Plain );
    powerMeter->setRange( MAX_POWER_LEVEL );
    powerMeter->addColorRange( 10, darkRed );
    powerMeter->addColorRange( 20, QColor(160, 96, 0) );
    powerMeter->addColorRange( 70, darkGreen );
    powerMeter->setCount( 40 );
    powerMeter->setPalette( pal );
    powerMeter->setFixedSize( 200, 12 );
    hbd->addWidget( powerMeter );

    shipsRemain = 3;
    showHiscores = FALSE;

    actions.insert( Qt::Key_Up, Thrust );
    actions.insert( Qt::Key_Left, RotateLeft );
    actions.insert( Qt::Key_Right, RotateRight );
    actions.insert( Qt::Key_Space, Shoot );
    actions.insert( Qt::Key_Z, Teleport );
    actions.insert( Qt::Key_X, Brake );
    actions.insert( Qt::Key_S, Shield );
    actions.insert( Qt::Key_P, Pause );
    actions.insert( Qt::Key_L, Launch );
    actions.insert( Qt::Key_N, NewGame );

    view->showText( tr( "Press N to start playing" ), yellow );
}
/**
 * Constructor.
 */
CQSBMLSaveOptionsDialog::CQSBMLSaveOptionsDialog(QWidget * pParent , const char * name): QDialog(pParent, name, true)
    , mCompressionType(CQSBMLSaveOptionsDialog::NONE)
    , mSaveCOPASIMIRIAM(true)
    , mpLayout(new QVBoxLayout(this))
    , mpVersionBox(new QComboBox(false, this))
    , mpMIRIAMCheckbox(new QCheckBox("Save COPASI MIRIAM annotation", this))
    , mpCompressionGroup(new QButtonGroup(2, Qt::Horizontal, "Compression", this))
    , mpOKButton(new QPushButton("Export", this))
    , mpCancelButton(new QPushButton("Cancel", this))
{
  // add the widgets to the layout
  std::vector<std::pair<unsigned C_INT32, unsigned C_INT32> > levelsAndVersions;
  levelsAndVersions.push_back(std::pair<unsigned C_INT32, unsigned C_INT32>(1, 2));
  levelsAndVersions.push_back(std::pair<unsigned C_INT32, unsigned C_INT32>(2, 1));
  levelsAndVersions.push_back(std::pair<unsigned C_INT32, unsigned C_INT32>(2, 2));
  levelsAndVersions.push_back(std::pair<unsigned C_INT32, unsigned C_INT32>(2, 3));
  levelsAndVersions.push_back(std::pair<unsigned C_INT32, unsigned C_INT32>(2, 4));
  this->setLevelsAndVersions(levelsAndVersions);
  this->setLevelAndVersion(std::pair<unsigned C_INT32, unsigned C_INT32>(2, 3));
  // that the widget has a fixed size determined by it's elements
  this->mpLayout->setResizeMode(QLayout::Fixed);
  this->mpLayout->addSpacing(5);
  QHBoxLayout* pLayout = new QHBoxLayout();
  this->mpLayout->addLayout(pLayout);
  pLayout->addSpacing(5);
  pLayout->addWidget(new QLabel("SBML Version:", this));
  pLayout->addSpacing(5);
  pLayout->addWidget(this->mpVersionBox);
  pLayout->addSpacing(5);
  // the compression feature is disabled for now since the libsbml we use
  // does not have the dependencies
  //this->mpLayout->addSpacing(8);
  //this->mpLayout->addWidget(this->mpCompressionGroup);
  // add the buttons to the compression group
  this->mpCompressionGroup->setRadioButtonExclusive(true);
  new QRadioButton("none", this->mpCompressionGroup);
  new QRadioButton("zip", this->mpCompressionGroup);
  new QRadioButton("gzip", this->mpCompressionGroup);
  new QRadioButton("bzip2", this->mpCompressionGroup);
  this->mpCompressionGroup->setButton(this->mCompressionType);
  this->mpCompressionGroup->hide();
  this->mpLayout->addSpacing(8);
  pLayout = new QHBoxLayout();
  this->mpLayout->addLayout(pLayout);
  QToolTip::add(this->mpMIRIAMCheckbox, "Export additional MIRIAM annotation in the COPASI namespace.");
  this->mpMIRIAMCheckbox->setChecked(this->mSaveCOPASIMIRIAM);
  pLayout->addStretch();
  pLayout->addWidget(this->mpMIRIAMCheckbox);
  pLayout->addStretch();
  this->mpLayout->addSpacing(8);
  pLayout = new QHBoxLayout();
  this->mpLayout->addLayout(pLayout);
  // make OK button the default
  // add some space between the buttons and before and after them
  pLayout->addStretch();
  pLayout->addWidget(this->mpOKButton);
  pLayout->addStretch();
  pLayout->addWidget(this->mpCancelButton);
  pLayout->addStretch();
  this->mpOKButton->setDefault(true);
  this->mpLayout->addSpacing(5);
  // set the tab order
  this->setTabOrder(this->mpVersionBox, this->mpCompressionGroup);
  this->setTabOrder(this->mpCompressionGroup, this->mpMIRIAMCheckbox);
  this->setTabOrder(this->mpMIRIAMCheckbox, this->mpOKButton);
  this->setTabOrder(this->mpOKButton, this->mpCancelButton);

  // connect the signals and slots
  connect(this->mpMIRIAMCheckbox, SIGNAL(toggled(bool)), this, SLOT(miriam_toggled(bool)));
  connect(this->mpCompressionGroup, SIGNAL(clicked(int)), this, SLOT(compression_clicked(int)));
  connect(this->mpOKButton, SIGNAL(clicked()), this, SLOT(ok_clicked()));
  connect(this->mpCancelButton, SIGNAL(clicked()), this, SLOT(cancel_clicked()));
}
Esempio n. 16
0
void NewGrpModal::setIconLst()
{
    SimpleIcon *icon;

    formBasic = new QVBoxLayout();
    formWidget = new QWidget();
    formBasic->setContentsMargins(rectPoint.x()+10*scaleFactor,rectPoint.y(),rectPoint.x()+10*scaleFactor,rectPoint.y()-12*scaleFactor);

    formBasic->addWidget(formWidget);
    setLayout(formBasic);

    formLayout = new QVBoxLayout();
    formLayout->setSpacing(0);
    formWidget->setLayout(formLayout);

    nameLbl = new QLabel(lbl1);
    nameLbl->setFont(QFont("Calibri",lblTxtSize));
    nameLbl->setStyleSheet("QLabel { color : "+lblTxtColor+"; }");
    formLayout->addWidget(nameLbl);

    QWidget *editName = new QWidget();
    QHBoxLayout *editNameLayout = new QHBoxLayout();
    editName->setLayout(editNameLayout);
    editNameLayout->addSpacing(20*scaleFactor);
    grpName = new QLineEdit();
    grpName->setFont(QFont("Calibri",lblTxtSize));

    grpName->setStyleSheet(" color : "+lblTxtColor+/*"; border: 0px solid gray; background: "+backGroundColor+*/";");
    grpName->setAlignment(Qt::AlignCenter);
    grpName->setMaxLength(10);
    editNameLayout->addWidget(grpName);
    editNameLayout->addSpacing(20*scaleFactor);
    formLayout->addWidget(editName);

    choiceLbl = new QLabel(lbl2);
    choiceLbl->setFont(QFont("Calibri",lblTxtSize));
    choiceLbl->setStyleSheet("QLabel { color : "+lblTxtColor+"; }");
    formLayout->addWidget(choiceLbl);

    QWidget *lineWidget = new QWidget();
    QHBoxLayout *lineGridLayout = new QHBoxLayout();
    lineWidget->setLayout(lineGridLayout);

    gridWidget = new QWidget();
    gridLayout = new QGridLayout();
    gridLayout->setSpacing(gridSpace);
    lineGridLayout->addStretch(1);
    lineGridLayout->addWidget(gridWidget);
    lineGridLayout->addStretch(1);

    gridWidget->setLayout(gridLayout);
    formLayout->addWidget(lineWidget);

    for(int i=0; i<columnsNum*rowsNum; i++)
    {
        if(i < imgSrcLst.length())
        {
            icon = new SimpleIcon(i,grpViewFolder+imgSrcLst[i],"",iconSize,true);
            if(i==0)
            {
                icon->selectIcon();
                selectedIcon = i;

            }
            iconsGrid.append(icon);
            icon->setAlignment(Qt::AlignVCenter);
            connect(icon,SIGNAL(click(int)),this,SLOT(onClickGrpIcon(int)));
            gridLayout->addWidget(icon, qFloor(i/columnsNum),i%columnsNum);
        }
        else
Esempio n. 17
0
void EFFEditorTransformPanel::Create()
{

	QDoubleValidator * doubleValidator = new QDoubleValidator();

	QToolBar * pToolbar = new QToolBar();
	
	QVBoxLayout * pMainLayout = new QVBoxLayout();
	pMainLayout->addWidget(pToolbar);
	pMainLayout->setContentsMargins(1, 1, 1, 1);
	pMainLayout->setSpacing(2);

	//position
	QLabel * pPosLabel = new QLabel();
	pPosLabel->setText(tr("Position"));
	pMainLayout->addWidget(pPosLabel);

	QHBoxLayout * pPosLayout = new QHBoxLayout();
	pPosLayout->setSpacing(0);
	pPosLayout->addSpacing(10);

	QLabel * pPosXLabel = new QLabel(NULL);
	pPosXLabel->setText(tr("X"));
	pPosLayout->addWidget(pPosXLabel);
	m_pPosXLineEdit = new QLineEdit();
	m_pPosXLineEdit->setValidator(doubleValidator);
	pPosLayout->addWidget(m_pPosXLineEdit, 1);

	QLabel * pPosYLabel = new QLabel(NULL);
	pPosYLabel->setText(tr("Y"));
	pPosLayout->addWidget(pPosYLabel);
	m_pPosYLineEdit = new QLineEdit();
	m_pPosYLineEdit->setValidator(doubleValidator);
	pPosLayout->addWidget(m_pPosYLineEdit, 1);

	QLabel * pPosZLabel = new QLabel();
	pPosZLabel->setText(tr("Z"));
	pPosLayout->addWidget(pPosZLabel);
	m_pPosZLineEdit = new QLineEdit();
	m_pPosZLineEdit->setValidator(doubleValidator);
	pPosLayout->addWidget(m_pPosZLineEdit, 1);

	pMainLayout->addLayout(pPosLayout);



	//rotation
	QLabel * pRotLabel = new QLabel();
	pRotLabel->setText(tr("Rotation"));
	pMainLayout->addWidget(pRotLabel);

	QHBoxLayout * pRotLayout = new QHBoxLayout();
	pRotLayout->setSpacing(0);
	pRotLayout->addSpacing(10);

	QLabel * pRotXLabel = new QLabel();
	pRotXLabel->setText(tr("X"));
	pRotLayout->addWidget(pRotXLabel);
	m_pRotXLineEdit = new QLineEdit();
	m_pRotXLineEdit->setValidator(doubleValidator);
	pRotLayout->addWidget(m_pRotXLineEdit, 1);

	QLabel * pRotYLabel = new QLabel();
	pRotYLabel->setText(tr("Y"));
	pRotLayout->addWidget(pRotYLabel);
	m_pRotYLineEdit = new QLineEdit();
	m_pRotYLineEdit->setValidator(doubleValidator);
	pRotLayout->addWidget(m_pRotYLineEdit, 1);

	QLabel * pRotZLabel = new QLabel();
	pRotZLabel->setText(tr("Z"));
	pRotLayout->addWidget(pRotZLabel);
	m_pRotZLineEdit = new QLineEdit();
	m_pRotZLineEdit->setValidator(doubleValidator);
	pRotLayout->addWidget(m_pRotZLineEdit, 1);

	pMainLayout->addLayout(pRotLayout);


	//scale
	QLabel * pScaleLabel = new QLabel();
	pScaleLabel->setText(tr("Scale"));
	pMainLayout->addWidget(pScaleLabel);

	QHBoxLayout * pScaleLayout = new QHBoxLayout();
	pScaleLayout->setSpacing(0);
	pScaleLayout->addSpacing(10);

	QLabel * pScaleXLabel = new QLabel();
	pScaleXLabel->setText(tr("X"));
	pScaleLayout->addWidget(pScaleXLabel);
	m_pScaleXLineEdit = new QLineEdit();
	m_pScaleXLineEdit->setValidator(doubleValidator);
	pScaleLayout->addWidget(m_pScaleXLineEdit, 1);

	QLabel * pScaleYLabel = new QLabel();
	pScaleYLabel->setText(tr("Y"));
	pScaleLayout->addWidget(pScaleYLabel);
	m_pScaleYLineEdit = new QLineEdit();
	m_pScaleYLineEdit->setValidator(doubleValidator);
	pScaleLayout->addWidget(m_pScaleYLineEdit, 1);

	QLabel * pScaleZLabel = new QLabel();
	pScaleZLabel->setText(tr("Z"));
	pScaleLayout->addWidget(pScaleZLabel);
	m_pScaleZLineEdit = new QLineEdit();
	m_pScaleZLineEdit->setValidator(doubleValidator);
	pScaleLayout->addWidget(m_pScaleZLineEdit, 1);

	pMainLayout->addLayout(pScaleLayout);


	setLayout(pMainLayout);
	setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
}
Esempio n. 18
0
TransactionView::TransactionView(QWidget *parent) :
    QWidget(parent), model(0), transactionProxyModel(0),
    transactionView(0)
{
    QSettings settings;
    // Build filter row
    setContentsMargins(0,0,0,0);

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);
#ifdef Q_OS_MAC
    hlayout->setSpacing(5);
    hlayout->addSpacing(26);
#else
    hlayout->setSpacing(0);
    hlayout->addSpacing(23);
#endif

    watchOnlyWidget = new QComboBox(this);
    watchOnlyWidget->setFixedWidth(24);
    watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All);
    watchOnlyWidget->addItem(QIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
    watchOnlyWidget->addItem(QIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
    hlayout->addWidget(watchOnlyWidget);

    dateWidget = new QComboBox(this);
#ifdef Q_OS_MAC
    dateWidget->setFixedWidth(121);
#else
    dateWidget->setFixedWidth(120);
#endif
    dateWidget->addItem(tr("All"), All);
    dateWidget->addItem(tr("Today"), Today);
    dateWidget->addItem(tr("This week"), ThisWeek);
    dateWidget->addItem(tr("This month"), ThisMonth);
    dateWidget->addItem(tr("Last month"), LastMonth);
    dateWidget->addItem(tr("This year"), ThisYear);
    dateWidget->addItem(tr("Range..."), Range);
    dateWidget->setCurrentIndex(settings.value("transactionDate").toInt());
    hlayout->addWidget(dateWidget);

    typeWidget = new QComboBox(this);
#ifdef Q_OS_MAC
    typeWidget->setFixedWidth(TYPE_COLUMN_WIDTH+1);
#else
    typeWidget->setFixedWidth(TYPE_COLUMN_WIDTH);
#endif

    typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
    typeWidget->addItem(tr("Most Common"), TransactionFilterProxy::COMMON_TYPES);
    typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
                                        TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
    typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
                                  TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
    typeWidget->addItem(tr("Darksent"), TransactionFilterProxy::TYPE(TransactionRecord::Darksent));
    typeWidget->addItem(tr("Obfuscation Make Collateral Inputs"), TransactionFilterProxy::TYPE(TransactionRecord::ObfuscationMakeCollaterals));
    typeWidget->addItem(tr("Obfuscation Create Denominations"), TransactionFilterProxy::TYPE(TransactionRecord::ObfuscationCreateDenominations));
    typeWidget->addItem(tr("Obfuscation Denominate"), TransactionFilterProxy::TYPE(TransactionRecord::ObfuscationDenominate));
    typeWidget->addItem(tr("Obfuscation Collateral Payment"), TransactionFilterProxy::TYPE(TransactionRecord::ObfuscationCollateralPayment));
    typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
    typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
    typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
    typeWidget->setCurrentIndex(settings.value("transactionType").toInt());

    hlayout->addWidget(typeWidget);

    addressWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    addressWidget->setPlaceholderText(tr("Enter address or label to search"));
#endif
    hlayout->addWidget(addressWidget);

    amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef Q_OS_MAC
    amountWidget->setFixedWidth(97);
#else
    amountWidget->setFixedWidth(100);
#endif
    amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
    hlayout->addWidget(amountWidget);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(createDateRangeWidget());
    vlayout->addWidget(view);
    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_OS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    view->installEventFilter(this);

    transactionView = view;

    // Actions
    QAction *copyAddressAction = new QAction(tr("Copy address"), this);
    QAction *copyLabelAction = new QAction(tr("Copy label"), this);
    QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
    QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
    QAction *editLabelAction = new QAction(tr("Edit label"), this);
    QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyLabelAction);
    contextMenu->addAction(copyAmountAction);
    contextMenu->addAction(copyTxIDAction);
    contextMenu->addAction(editLabelAction);
    contextMenu->addAction(showDetailsAction);

    mapperThirdPartyTxUrls = new QSignalMapper(this);

    // Connect actions
    connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString)));

    connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
    connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
    connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int)));
    connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString)));
    connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString)));

    connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
    connect(view, SIGNAL(clicked(QModelIndex)), this, SLOT(computeSum()));
    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
    connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
    connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
    connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
    connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
}
// //! [CustomViewerWorkbenchWindowAdvisorPreWindowOpen]
// //! [WorkbenchWindowAdvisorCreateWindowContentsHead]
void CustomViewerWorkbenchWindowAdvisor::CreateWindowContents(berry::Shell::Pointer shell)
{
  // the all containing main window
  QMainWindow *mainWindow = static_cast<QMainWindow *>(shell->GetControl());
  // //! [WorkbenchWindowAdvisorCreateWindowContentsHead]
  mainWindow->setVisible(true);

  // the widgets
  QWidget *CentralWidget = new QWidget(mainWindow);
  CentralWidget->setObjectName("CentralWidget");
  CentralWidget->setVisible(true);

  QtPerspectiveSwitcherTabBar *PerspectivesTabBar =
    new QtPerspectiveSwitcherTabBar(this->GetWindowConfigurer()->GetWindow());
  PerspectivesTabBar->setObjectName("PerspectivesTabBar");
  PerspectivesTabBar->addTab("Image Viewer");
  PerspectivesTabBar->addTab("DICOM-Manager");
  PerspectivesTabBar->setVisible(true);
  PerspectivesTabBar->setDrawBase(false);

  QPushButton *StyleUpdateButton = new QPushButton("Update Style", mainWindow);
  StyleUpdateButton->setMaximumWidth(100);
  StyleUpdateButton->setObjectName("StyleUpdateButton");
  QObject::connect(StyleUpdateButton, SIGNAL(clicked()), this, SLOT(UpdateStyle()));

  QToolButton *OpenFileButton = new QToolButton(mainWindow);
  OpenFileButton->setMaximumWidth(100);
  OpenFileButton->setObjectName("FileOpenButton");
  OpenFileButton->setText("Open File");
  QObject::connect(OpenFileButton, SIGNAL(clicked()), this, SLOT(OpenFile()));

  QWidget *PageComposite = new QWidget(CentralWidget);
  PageComposite->setObjectName("PageComposite");
  PageComposite->setVisible(true);

  // the layouts
  QVBoxLayout *CentralWidgetLayout = new QVBoxLayout(CentralWidget);
  CentralWidgetLayout->contentsMargins();
  CentralWidgetLayout->setContentsMargins(9, 9, 9, 9);
  CentralWidgetLayout->setSpacing(0);
  CentralWidgetLayout->setObjectName("CentralWidgetLayout");

  QHBoxLayout *PerspectivesLayer = new QHBoxLayout(mainWindow);
  PerspectivesLayer->setObjectName("PerspectivesLayer");

  QHBoxLayout *PageCompositeLayout = new QHBoxLayout(PageComposite);
  PageCompositeLayout->setContentsMargins(0, 0, 0, 0);
  PageCompositeLayout->setSpacing(0);
  PageComposite->setLayout(PageCompositeLayout);
  // //! [WorkbenchWindowAdvisorCreateWindowContents]
  // all glued together
  mainWindow->setCentralWidget(CentralWidget);
  CentralWidgetLayout->addLayout(PerspectivesLayer);
  CentralWidgetLayout->addWidget(PageComposite);
  CentralWidget->setLayout(CentralWidgetLayout);
  PerspectivesLayer->addWidget(PerspectivesTabBar);
  PerspectivesLayer->addSpacing(300);
  PerspectivesLayer->addWidget(OpenFileButton);

  // for style customization convenience
  /*PerspectivesLayer->addSpacing(10);
  PerspectivesLayer->addWidget(StyleUpdateButton);*/

  // for correct initial layout, see also bug#1654
  CentralWidgetLayout->activate();
  CentralWidgetLayout->update();

  this->GetWindowConfigurer()->CreatePageComposite(PageComposite);
  // //! [WorkbenchWindowAdvisorCreateWindowContents]
}
ConfigBackendsPage::ConfigBackendsPage( Config *_config, QWidget *parent )
    : ConfigPageBase( parent ),
    config( _config )
{
    QVBoxLayout *box = new QVBoxLayout( this );

    QFont groupFont;
    groupFont.setBold( true );

    QLabel *lCdRipper = new QLabel( i18n("CD ripper"), this );
    lCdRipper->setFont( groupFont );
    box->addWidget( lCdRipper );

    box->addSpacing( ConfigDialogSpacingSmall );

    QHBoxLayout *ripperBox = new QHBoxLayout();
    ripperBox->addSpacing( ConfigDialogOffset );
    box->addLayout( ripperBox );
    QLabel *lSelectorRipper = new QLabel( i18n("Use plugin:"), this );
    ripperBox->addWidget( lSelectorRipper );
    ripperBox->setStretchFactor( lSelectorRipper, 2 );
    cSelectorRipper = new KComboBox( this );
    cSelectorRipper->addItems( config->data.backends.rippers );
    ripperBox->addWidget( cSelectorRipper );
    ripperBox->setStretchFactor( cSelectorRipper, 1 );
    connect( cSelectorRipper, SIGNAL(activated(int)), this, SLOT(somethingChanged()) );
    connect( cSelectorRipper, SIGNAL(activated(const QString&)), this, SLOT(ripperChanged(const QString&)) );
    pConfigureRipper = new KPushButton( KIcon("configure"), "", this );
    pConfigureRipper->setFixedSize( cSelectorRipper->sizeHint().height(), cSelectorRipper->sizeHint().height() );
    pConfigureRipper->setFlat( true );
    ripperBox->addWidget( pConfigureRipper );
    ripperBox->setStretchFactor( pConfigureRipper, 1 );
    connect( pConfigureRipper, SIGNAL(clicked()), this, SLOT(configureRipper()) );

    box->addSpacing( ConfigDialogSpacingBig );

    QLabel *lFilters = new QLabel( i18n("Filters"), this );
    lFilters->setFont( groupFont );
    box->addWidget( lFilters );

    box->addSpacing( ConfigDialogSpacingSmall );

    QHBoxLayout *filterBox = new QHBoxLayout();
    filterBox->addSpacing( ConfigDialogOffset );
    box->addLayout( filterBox );
    QGridLayout *filterGrid = new QGridLayout();

    int row = 0;
    foreach( const QString filterPluginName, config->data.backends.filters )
    {
        if( row == 0 )
        {
            QLabel *lSelectorFilter = new QLabel( i18n("Enable plugins:"), this );
            filterGrid->addWidget( lSelectorFilter, row, 0 );
        }

        QCheckBox *newCheckBox = new QCheckBox( filterPluginName, this );
        newCheckBox->setChecked( config->data.backends.enabledFilters.contains(filterPluginName) );
        filterGrid->addWidget( newCheckBox, row, 1 );
        filterCheckBoxes.append( newCheckBox );
        connect( newCheckBox, SIGNAL(stateChanged(int)), this, SLOT(somethingChanged()) );

        KPushButton *newConfigButton = new KPushButton( KIcon("configure"), "", this );
        newConfigButton->setFixedSize( cSelectorRipper->sizeHint().height(), cSelectorRipper->sizeHint().height() );
        newConfigButton->setFlat( true );
        filterGrid->addWidget( newConfigButton, row, 2 );
        connect( newConfigButton, SIGNAL(clicked()), this, SLOT(configureFilter()) );
        filterConfigButtons.append( newConfigButton );

        FilterPlugin *plugin = qobject_cast<FilterPlugin*>(config->pluginLoader()->backendPluginByName(filterPluginName));
        if( plugin )
        {
            newConfigButton->setEnabled( plugin->isConfigSupported(BackendPlugin::General,"") );
        }
        else
        {
            newConfigButton->setEnabled( false );
        }

        if( newConfigButton->isEnabled() )
            newConfigButton->setToolTip( i18n("Configure %1 ...",filterPluginName) );

        row++;
    }

    filterGrid->setColumnStretch( 0, 2 );
    filterGrid->setColumnStretch( 1, 1 );
    filterBox->addLayout( filterGrid );

    box->addSpacing( ConfigDialogSpacingBig );

    QLabel *lPriorities = new QLabel( i18n("Priorities"), this );
    lPriorities->setFont( groupFont );
    box->addWidget( lPriorities );

    box->addSpacing( ConfigDialogSpacingSmall );

    QVBoxLayout *formatBox = new QVBoxLayout();
    box->addLayout( formatBox, 1 );

    QHBoxLayout *formatSelectorBox = new QHBoxLayout();
    formatSelectorBox->addSpacing( ConfigDialogOffset );
    formatBox->addLayout( formatSelectorBox );
    QLabel *lSelectorFormat = new QLabel( i18n("Configure plugin priorities for format:"), this );
    formatSelectorBox->addWidget( lSelectorFormat );
    cSelectorFormat = new KComboBox( this );
    cSelectorFormat->addItems( config->pluginLoader()->formatList(PluginLoader::Possibilities(PluginLoader::Encode|PluginLoader::Decode|PluginLoader::ReplayGain),PluginLoader::CompressionType(PluginLoader::InferiorQuality|PluginLoader::Lossy|PluginLoader::Lossless|PluginLoader::Hybrid)) );
    cSelectorFormat->removeItem( cSelectorFormat->findText("wav") );
    cSelectorFormat->removeItem( cSelectorFormat->findText("audio cd") );
    formatSelectorBox->addWidget( cSelectorFormat );
    connect( cSelectorFormat, SIGNAL(activated(const QString&)), this, SLOT(formatChanged(const QString&)) );
    formatSelectorBox->addStretch();

    QHBoxLayout *formatBackendsBox = new QHBoxLayout();
    formatBackendsBox->addSpacing( ConfigDialogOffset );
    formatBox->addLayout( formatBackendsBox );
    decoderList = new BackendsListWidget( i18n("Decoder"), config, this );
    formatBackendsBox->addWidget( decoderList );
    connect( decoderList, SIGNAL(orderChanged()), this, SLOT(somethingChanged()) );
    encoderList = new BackendsListWidget( i18n("Encoder"), config, this );
    formatBackendsBox->addWidget( encoderList );
    connect( encoderList, SIGNAL(orderChanged()), this, SLOT(somethingChanged()) );
    replaygainList = new BackendsListWidget( i18n("Replay Gain"), config, this );
    formatBackendsBox->addWidget( replaygainList );
    connect( replaygainList, SIGNAL(orderChanged()), this, SLOT(somethingChanged()) );

    QHBoxLayout *optimizationsBox = new QHBoxLayout();
    optimizationsBox->addSpacing( ConfigDialogOffset );
    formatBox->addLayout( optimizationsBox );
    optimizationsBox->addStretch();
    pShowOptimizations = new KPushButton( KIcon("games-solve"), i18n("Show possible optimizations"), this );
    optimizationsBox->addWidget( pShowOptimizations );
    connect( pShowOptimizations, SIGNAL(clicked()), this, SLOT(showOptimizations()) );
    optimizationsBox->addStretch();

    box->addStretch( 2 );

    ripperChanged( cSelectorRipper->currentText() );
    formatChanged( cSelectorFormat->currentText() );
}
CollectionChooser::CollectionChooser(QWidget *parent, const char *name)
 : QWidget(parent, name)
{
	QLabel *lblAvailable = new QLabel( this );
	lblAvailable->setText( i18n( "Available:" ) );

	m_available = new CollectionListView( 0, this );
	m_available->setDragEnabled( true );
	connect( m_available, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), SLOT(addClicked()) );
	connect( m_available, SIGNAL(dropped(QDropEvent*)), SLOT(droppedAvailable(QDropEvent*)) );

	m_add = new KPushButton( this );
	m_add->setText( i18n( "&Add" ) );
	//m_add->setGuiItem( KStdGuiItem::add() );
	connect( m_add, SIGNAL(clicked()), SLOT(addClicked()) );

	m_addAll = new KPushButton( this );
	//m_addAll->setIconSet( KStdGuiItem::add().iconSet() );
	m_addAll->setText( i18n( "Add A&ll" ) );
	connect( m_addAll, SIGNAL(clicked()), SLOT(addAllClicked()) );

	m_remove = new KPushButton( this );
	m_remove->setText( i18n( "&Remove" ) );
	//m_remove->setGuiItem( KStdGuiItem::remove() );
	connect( m_remove, SIGNAL(clicked()), SLOT(removeClicked()) );

	m_removeAll = new KPushButton( this );
	//m_removeAll->setIconSet( KStdGuiItem::remove().iconSet() );
	m_removeAll->setText( i18n( "R&emove All" ) );
	connect( m_removeAll, SIGNAL(clicked()), SLOT(removeAllClicked()) );

	QLabel *lblChoosen = new QLabel( this );
	lblChoosen->setText( i18n( "Selected:" ) );

	m_choosen = new CollectionListView( 0, this );
	m_choosen->setDragEnabled( true );
	connect( m_choosen, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), SLOT(removeClicked()) );
	connect( m_choosen, SIGNAL(dropped(QDropEvent*)), SLOT(droppedChoosen(QDropEvent*)) );

	QVBoxLayout *layAvailable = new QVBoxLayout();
	layAvailable->addSpacing( 10 );
	layAvailable->add( lblAvailable );
	layAvailable->addSpacing( 10 );
	layAvailable->add( m_available );

	QVBoxLayout *layButtons = new QVBoxLayout();
	layButtons->addSpacing( 10 );
	layButtons->add( m_add );
	layButtons->addSpacing( 10 );
	layButtons->add( m_addAll );
	layButtons->addSpacing( 30 );
	layButtons->add( m_remove );
	layButtons->addSpacing( 10 );
	layButtons->add( m_removeAll );
	layButtons->addStretch();

	QVBoxLayout *layChoosen = new QVBoxLayout();
	layChoosen->addSpacing( 10 );
	layChoosen->add( lblChoosen );
	layChoosen->addSpacing( 10 );
	layChoosen->add( m_choosen );

	QHBoxLayout *layout = new QHBoxLayout( this );
	layout->addLayout( layAvailable );
	layout->addSpacing( 10 );
	layout->addLayout( layButtons );
	layout->addSpacing( 10 );
	layout->addLayout( layChoosen );
}
Esempio n. 22
0
FeedbackDialog::FeedbackDialog(QWidget * parent) : QDialog(parent)
{
    setModal(true);
    setWindowFlags(Qt::Sheet);
    setWindowModality(Qt::WindowModal);
    setMinimumSize(700, 460);
    resize(700, 460);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    netManager = NULL;
    GenerateSpecs();

    /* Top layout */

    QVBoxLayout * pageLayout = new QVBoxLayout();
    QHBoxLayout * summaryLayout = new QHBoxLayout();
    QHBoxLayout * emailLayout = new QHBoxLayout();
    QHBoxLayout * descriptionLayout = new QHBoxLayout();
    QHBoxLayout * combinedTopLayout = new QHBoxLayout();
    QHBoxLayout * systemLayout = new QHBoxLayout();

    info = new QLabel();
    info->setText(QString(
        "<style type=\"text/css\">"
        "a { color: #fc0; }"
        "b { color: #0df; }"
        "</style>"
        "<div align=\"center\"><h1>%1</h1>"
        "<h3>%2<h3>"
        "<h4>%3 <a href=\"http://code.google.com/p/hedgewars/wiki/KnownBugs\">known bugs</a><h4>"
        "<h4>%4<h4>"
        "</div>")
        .arg(tr("Send us feedback!"))
        .arg(tr("We are always happy about suggestions, ideas, or bug reports."))
        .arg(tr("If you found a bug, you can see if it's already been reported here: "))
        .arg(tr("Your email address is optional, but necessary if you want us to get back at you."))
    );
    info->setOpenExternalLinks(true);
    pageLayout->addWidget(info);

    QVBoxLayout * summaryEmailLayout = new QVBoxLayout();

    const int labelWidth = 90;

    label_email = new QLabel();
    label_email->setText(QLabel::tr("Your Email"));
    label_email->setFixedWidth(labelWidth);
    emailLayout->addWidget(label_email);
    email = new QLineEdit();
    emailLayout->addWidget(email);
    summaryEmailLayout->addLayout(emailLayout);

    label_summary = new QLabel();
    label_summary->setText(QLabel::tr("Summary"));
    label_summary->setFixedWidth(labelWidth);
    summaryLayout->addWidget(label_summary);
    summary = new QLineEdit();
    summaryLayout->addWidget(summary);
    summaryEmailLayout->addLayout(summaryLayout);

    combinedTopLayout->addLayout(summaryEmailLayout);

    CheckSendSpecs = new QCheckBox();
    CheckSendSpecs->setText(QLabel::tr("Send system information"));
    CheckSendSpecs->setChecked(true);
    systemLayout->addWidget(CheckSendSpecs);
    BtnViewInfo = new QPushButton(tr("View"));
    systemLayout->addWidget(BtnViewInfo, 1);
    BtnViewInfo->setFixedSize(60, 30);
    connect(BtnViewInfo, SIGNAL(clicked()), this, SLOT(ShowSpecs()));
    combinedTopLayout->addLayout(systemLayout);

    combinedTopLayout->setStretch(0, 1);
    combinedTopLayout->insertSpacing(1, 20);

    pageLayout->addLayout(combinedTopLayout);

    label_description = new QLabel();
    label_description->setText(QLabel::tr("Description"));
    label_description->setFixedWidth(labelWidth);
    descriptionLayout->addWidget(label_description, 0, Qt::AlignTop);
    description = new QTextBrowser();
    description->setReadOnly(false);
    descriptionLayout->addWidget(description);
    pageLayout->addLayout(descriptionLayout);

    /* Bottom layout */

    QHBoxLayout * bottomLayout = new QHBoxLayout();
    QHBoxLayout * captchaLayout = new QHBoxLayout();
    QVBoxLayout * captchaInputLayout = new QVBoxLayout();

    QPushButton * BtnCancel = new QPushButton(tr("Cancel"));
    bottomLayout->addWidget(BtnCancel, 0);
    BtnCancel->setFixedSize(100, 40);
    connect(BtnCancel, SIGNAL(clicked()), this, SLOT(reject()));

    bottomLayout->insertStretch(1);

    label_captcha = new QLabel();
    label_captcha->setStyleSheet("border: 3px solid #ffcc00; border-radius: 4px");
    label_captcha->setText("loading<br>captcha");
    label_captcha->setFixedSize(200, 50);
    captchaLayout->addWidget(label_captcha);

    label_captcha_input = new QLabel();
    label_captcha_input->setText(QLabel::tr("Type the security code:"));
    captchaInputLayout->addWidget(label_captcha_input);
    captchaInputLayout->setAlignment(label_captcha, Qt::AlignBottom);
    captcha_code = new QLineEdit();
    captcha_code->setFixedSize(165, 30);
    captchaInputLayout->addWidget(captcha_code);
    captchaInputLayout->setAlignment(captcha_code, Qt::AlignTop);
    captchaLayout->addLayout(captchaInputLayout);
    captchaLayout->setAlignment(captchaInputLayout, Qt::AlignLeft);

    bottomLayout->addLayout(captchaLayout);
    bottomLayout->addSpacing(40);

    // TODO: Set green arrow icon for send button (:/res/Start.png)
    BtnSend = new QPushButton(tr("Send Feedback"));
    bottomLayout->addWidget(BtnSend, 0);
    BtnSend->setFixedSize(120, 40);
    connect(BtnSend, SIGNAL(clicked()), this, SLOT(SendFeedback()));

    bottomLayout->setStretchFactor(captchaLayout, 0);
    bottomLayout->setStretchFactor(BtnSend, 1);

    QVBoxLayout * dialogLayout = new QVBoxLayout(this);
    dialogLayout->addLayout(pageLayout, 1);
    dialogLayout->addLayout(bottomLayout);

    LoadCaptchaImage();
}
Esempio n. 23
0
PreFlightWeatherPage::PreFlightWeatherPage( QWidget *parent ) :
  QWidget(parent),
  m_downloadManger(0),
  m_updateIsRunning(false),
  NoMetar(tr("No METAR available")),
  NoTaf(tr("No TAF available"))
{
  setObjectName("PreFlightWeatherPage");
  setWindowTitle(tr("METAR and TAF"));
  setWindowFlags( Qt::Tool );
  setWindowModality( Qt::WindowModal );
  setAttribute(Qt::WA_DeleteOnClose);

  if( MainWindow::mainWindow() )
    {
      // Resize the window to the same size as the main window has. That will
      // completely hide the parent window.
      resize( MainWindow::mainWindow()->size() );

#ifdef ANDROID
      // On Galaxy S3 there are size problems observed
      setMinimumSize( MainWindow::mainWindow()->size() );
      setMaximumSize( MainWindow::mainWindow()->size() );
#endif
    }

  QVBoxLayout *mainLayout  = new QVBoxLayout( this );
  m_listWidget             = new QWidget( this );
  m_displayWidget          = new QWidget( this );
  m_editorWidget           = new QWidget( this );

  mainLayout->addWidget( m_listWidget );
  mainLayout->addWidget( m_displayWidget );
  mainLayout->addWidget( m_editorWidget );

  m_displayWidget->hide();
  m_editorWidget->hide();

  //----------------------------------------------------------------------------
  // List widget
  //----------------------------------------------------------------------------
  QVBoxLayout *listLayout = new QVBoxLayout( m_listWidget );

  m_list = new QTreeWidget;
  m_list->setRootIsDecorated( false );
  m_list->setItemsExpandable( false );
  m_list->setSortingEnabled( true );
  m_list->setSelectionMode( QAbstractItemView::SingleSelection );
  m_list->setSelectionBehavior( QAbstractItemView::SelectRows );
  m_list->setAlternatingRowColors(true);
  m_list->setColumnCount( 1 );
  m_list->setFocusPolicy( Qt::StrongFocus );
  m_list->setUniformRowHeights(true);
  m_list->setHeaderLabel( tr( "METAR and TAF" ) );

  m_list->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  m_list->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );

#ifdef ANDROID
  QScrollBar* lvsb = m_list->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture(m_list->viewport(), QScroller::LeftMouseButtonGesture);
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture(m_list->viewport(), QtScroller::LeftMouseButtonGesture);
#endif

  listLayout->addWidget( m_list );

  QHBoxLayout* hbbox1 = new QHBoxLayout;
  listLayout->addLayout( hbbox1 );

  QPushButton* cmd = new QPushButton(tr("Add"), this);
  hbbox1->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotShowAirportEditor()));

  hbbox1->addSpacing( 10 );

  m_listUpdateButton = new QPushButton(tr("Update"), this);
  hbbox1->addWidget(m_listUpdateButton);
  connect (m_listUpdateButton, SIGNAL(clicked()), SLOT(slotRequestWeatherData()));

  hbbox1->addSpacing( 10 );

  cmd = new QPushButton(tr("Details"), this);
  hbbox1->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotDetails()));

  QHBoxLayout* hbbox2 = new QHBoxLayout;
  listLayout->addLayout( hbbox2 );

  cmd = new QPushButton(tr("Delete"), this);
  hbbox2->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotDeleteAirport()));

  hbbox2->addSpacing( 10 );

  cmd = new QPushButton(tr("Close"), this);
  hbbox2->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotClose()));

  //----------------------------------------------------------------------------
  // Display widget for report details
  //----------------------------------------------------------------------------
  QVBoxLayout *displayLayout = new QVBoxLayout( m_displayWidget );
  m_display = new QTextEdit;
  m_display->setReadOnly( true );

#ifdef ANDROID
  lvsb = m_display->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture(m_display->viewport(), QScroller::LeftMouseButtonGesture);
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture(m_display->viewport(), QtScroller::LeftMouseButtonGesture);
#endif

  displayLayout->addWidget( m_display );

  QHBoxLayout* hbbox = new QHBoxLayout;
  displayLayout->addLayout( hbbox );

  m_detailsUpdateButton = new QPushButton(tr("Update"));
  hbbox->addWidget(m_detailsUpdateButton);
  connect (m_detailsUpdateButton, SIGNAL(clicked()), SLOT(slotRequestWeatherData()));

  hbbox->addSpacing( 10 );

  cmd = new QPushButton(tr("Close"));
  hbbox->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotShowListWidget()));

  //----------------------------------------------------------------------------
  // Editor widget for station adding.
  //----------------------------------------------------------------------------
  QVBoxLayout *editorLayout = new QVBoxLayout( m_editorWidget );

  editorLayout->addWidget( new QLabel(tr("Airport ICAO Code")), 0, Qt::AlignLeft );

  QHBoxLayout *inputLayout = new QHBoxLayout;
  editorLayout->addLayout( inputLayout );

  QRegExpValidator* eValidator = new QRegExpValidator( QRegExp( "[a-zA-Z0-9]{4}|^$" ), this );

  Qt::InputMethodHints imh;
  m_airportEditor = new QLineEdit;
  m_airportEditor->setInputMethodHints(Qt::ImhUppercaseOnly | Qt::ImhDigitsOnly | Qt::ImhNoPredictiveText);
  m_airportEditor->setValidator( eValidator );

  connect( m_airportEditor, SIGNAL(returnPressed()),
           MainWindow::mainWindow(), SLOT(slotCloseSip()) );

  inputLayout->addWidget( m_airportEditor, 5 );
  inputLayout->addSpacing( 10 );

  cmd = new QPushButton(tr("Cancel"), this);
  inputLayout->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotShowListWidget()));

  inputLayout->addSpacing( 10 );

  cmd = new QPushButton(tr("Ok"), this);
  inputLayout->addWidget(cmd);
  connect (cmd, SIGNAL(clicked()), SLOT(slotAddAirport()));

  editorLayout->addStretch( 10 );

  //----------------------------------------------------------------------------
  loadAirportData( true );
  show();
}
Esempio n. 24
0
BirthdayDlg::BirthdayDlg(QWidget* parent)
	: KDialog(parent),
	  mSpecialActionsButton(0)
{
	setObjectName("BirthdayDlg");    // used by LikeBack
	setCaption(i18nc("@title:window", "Import Birthdays From KAddressBook"));
	setButtons(Ok | Cancel);
	setDefaultButton(Ok);
	connect(this, SIGNAL(okClicked()), SLOT(slotOk()));

	QWidget* topWidget = new QWidget(this);
	setMainWidget(topWidget);
	QVBoxLayout* topLayout = new QVBoxLayout(topWidget);
	topLayout->setMargin(0);
	topLayout->setSpacing(spacingHint());

	// Prefix and suffix to the name in the alarm text
	// Get default prefix and suffix texts from config file
	KConfigGroup config(KGlobal::config(), "General");
	mPrefixText = config.readEntry("BirthdayPrefix", i18nc("@info/plain", "Birthday: "));
	mSuffixText = config.readEntry("BirthdaySuffix");

	QGroupBox* textGroup = new QGroupBox(i18nc("@title:group", "Alarm Text"), topWidget);
	topLayout->addWidget(textGroup);
	QGridLayout* grid = new QGridLayout(textGroup);
	grid->setMargin(marginHint());
	grid->setSpacing(spacingHint());
	QLabel* label = new QLabel(i18nc("@label:textbox", "Prefix:"), textGroup);
	label->setFixedSize(label->sizeHint());
	grid->addWidget(label, 0, 0);
	mPrefix = new BLineEdit(mPrefixText, textGroup);
	mPrefix->setMinimumSize(mPrefix->sizeHint());
	label->setBuddy(mPrefix);
	connect(mPrefix, SIGNAL(focusLost()), SLOT(slotTextLostFocus()));
	mPrefix->setWhatsThis(i18nc("@info:whatsthis",
	      "Enter text to appear before the person's name in the alarm message, "
	      "including any necessary trailing spaces."));
	grid->addWidget(mPrefix, 0, 1);

	label = new QLabel(i18nc("@label:textbox", "Suffix:"), textGroup);
	label->setFixedSize(label->sizeHint());
	grid->addWidget(label, 1, 0);
	mSuffix = new BLineEdit(mSuffixText, textGroup);
	mSuffix->setMinimumSize(mSuffix->sizeHint());
	label->setBuddy(mSuffix);
	connect(mSuffix, SIGNAL(focusLost()), SLOT(slotTextLostFocus()));
	mSuffix->setWhatsThis(i18nc("@info:whatsthis",
	      "Enter text to appear after the person's name in the alarm message, "
	      "including any necessary leading spaces."));
	grid->addWidget(mSuffix, 1, 1);

	QGroupBox* group = new QGroupBox(i18nc("@title:group", "Select Birthdays"), topWidget);
	topLayout->addWidget(group);
	QVBoxLayout* layout = new QVBoxLayout(group);
	layout->setMargin(0);
	BirthdayModel* model = BirthdayModel::instance(this);
	connect(model, SIGNAL(addrBookError()), SLOT(addrBookError()));
	connect(model, SIGNAL(dataChanged(const QModelIndex&,const QModelIndex&)), SLOT(resizeViewColumns()));
	model->setPrefixSuffix(mPrefixText, mSuffixText);
	BirthdaySortModel* sortModel = new BirthdaySortModel(model, this);
	sortModel->setSortCaseSensitivity(Qt::CaseInsensitive);
	mListView = new QTreeView(group);
	mListView->setModel(sortModel);
	mListView->setRootIsDecorated(false);    // don't show expander icons
	mListView->setSortingEnabled(true);
	mListView->sortByColumn(BirthdayModel::NameColumn);
	mListView->setAllColumnsShowFocus(true);
	mListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
	mListView->setSelectionBehavior(QAbstractItemView::SelectRows);
	mListView->setTextElideMode(Qt::ElideRight);
	mListView->header()->setResizeMode(BirthdayModel::NameColumn, QHeaderView::Stretch);
	mListView->header()->setResizeMode(BirthdayModel::DateColumn, QHeaderView::ResizeToContents);
	connect(mListView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), SLOT(slotSelectionChanged()));
	mListView->setWhatsThis(i18nc("@info:whatsthis",
	      "<para>Select birthdays to set alarms for.<nl/>"
	      "This list shows all birthdays in <application>KAddressBook</application> except those for which alarms already exist.</para>"
	      "<para>You can select multiple birthdays at one time by dragging the mouse over the list, "
	      "or by clicking the mouse while pressing Ctrl or Shift.</para>"));
	layout->addWidget(mListView);

	group = new QGroupBox(i18nc("@title:group", "Alarm Configuration"), topWidget);
	topLayout->addWidget(group);
	QVBoxLayout* groupLayout = new QVBoxLayout(group);
	groupLayout->setMargin(marginHint());
	groupLayout->setSpacing(spacingHint());

	// Sound checkbox and file selector
	QHBoxLayout* hlayout = new QHBoxLayout();
	hlayout->setMargin(0);
	groupLayout->addLayout(hlayout);
	mSoundPicker = new SoundPicker(group);
	mSoundPicker->setFixedSize(mSoundPicker->sizeHint());
	hlayout->addWidget(mSoundPicker);
	hlayout->addSpacing(2*spacingHint());
	hlayout->addStretch();

	// Font and colour choice button and sample text
	mFontColourButton = new FontColourButton(group);
	mFontColourButton->setMaximumHeight(mFontColourButton->sizeHint().height() * 3/2);
	hlayout->addWidget(mFontColourButton);
	connect(mFontColourButton, SIGNAL(selected(const QColor&, const QColor&)), SLOT(setColours(const QColor&, const QColor&)));

	// How much advance warning to give
	mReminder = new Reminder(i18nc("@info:whatsthis", "Check to display a reminder in advance of the birthday."),
	                         i18nc("@info:whatsthis", "Enter the number of days before each birthday to display a reminder. "
	                              "This is in addition to the alarm which is displayed on the birthday."),
	                         false, false, group);
	mReminder->setFixedSize(mReminder->sizeHint());
	mReminder->setMaximum(0, 364);
	mReminder->setMinutes(0, true);
	groupLayout->addWidget(mReminder, 0, Qt::AlignLeft);

	// Acknowledgement confirmation required - default = no confirmation
	hlayout = new QHBoxLayout();
	hlayout->setMargin(0);
	hlayout->setSpacing(2*spacingHint());
	groupLayout->addLayout(hlayout);
	mConfirmAck = EditDisplayAlarmDlg::createConfirmAckCheckbox(group);
	mConfirmAck->setFixedSize(mConfirmAck->sizeHint());
	hlayout->addWidget(mConfirmAck);
	hlayout->addSpacing(2*spacingHint());
	hlayout->addStretch();

	if (ShellProcess::authorised())    // don't display if shell commands not allowed (e.g. kiosk mode)
	{
		// Special actions button
		mSpecialActionsButton = new SpecialActionsButton(false, group);
		mSpecialActionsButton->setFixedSize(mSpecialActionsButton->sizeHint());
		hlayout->addWidget(mSpecialActionsButton);
	}

	// Late display checkbox - default = allow late display
	hlayout = new QHBoxLayout();
	hlayout->setMargin(0);
	hlayout->setSpacing(2*spacingHint());
	groupLayout->addLayout(hlayout);
	mLateCancel = new LateCancelSelector(false, group);
	mLateCancel->setFixedSize(mLateCancel->sizeHint());
	hlayout->addWidget(mLateCancel);
	hlayout->addStretch();

	// Sub-repetition button
	mSubRepetition = new RepetitionButton(i18nc("@action:button", "Sub-Repetition"), false, group);
	mSubRepetition->setFixedSize(mSubRepetition->sizeHint());
	mSubRepetition->set(Repetition(), true, 364*24*60);
	mSubRepetition->setWhatsThis(i18nc("@info:whatsthis", "Set up an additional alarm repetition"));
	hlayout->addWidget(mSubRepetition);

	// Set the values to their defaults
	setColours(Preferences::defaultFgColour(), Preferences::defaultBgColour());
	mFontColourButton->setDefaultFont();
	mFontColourButton->setBgColour(Preferences::defaultBgColour());
	mFontColourButton->setFgColour(Preferences::defaultFgColour());
	mLateCancel->setMinutes(Preferences::defaultLateCancel(), true, TimePeriod::Days);
	mConfirmAck->setChecked(Preferences::defaultConfirmAck());
	mSoundPicker->set(Preferences::defaultSoundType(), Preferences::defaultSoundFile(),
	                  Preferences::defaultSoundVolume(), -1, 0, Preferences::defaultSoundRepeat());
	if (mSpecialActionsButton)
		mSpecialActionsButton->setActions(Preferences::defaultPreAction(), Preferences::defaultPostAction(), Preferences::defaultCancelOnPreActionError());

	KActionCollection* actions = new KActionCollection(this);
	KStandardAction::selectAll(mListView, SLOT(selectAll()), actions);
	KStandardAction::deselect(mListView, SLOT(clearSelection()), actions);
	actions->addAssociatedWidget(mListView);
	foreach (QAction* action, actions->actions())
		action->setShortcutContext(Qt::WidgetWithChildrenShortcut);

	enableButtonOk(false);     // only enable OK button when something is selected
}
Esempio n. 25
0
void KSegSelectionGroupDialog::newGroup()
{
  if(doc->getSelected().size() == 0) return; //shouldn't be here anyway

  //set up the name query dialog
  QDialog nameDlg(0, 0, true);
  QPushButton *ok, *cancel;
  QLabel *query;
  QLineEdit *edit;
  
  QVBoxLayout vlayout(&nameDlg);

  vlayout.addSpacing(8);

  QHBoxLayout hlayout0;
  vlayout.addLayout(&hlayout0);

  hlayout0.addSpacing(8);
  
  query = new QLabel(tr("Enter new group name:"), &nameDlg);
  hlayout0.addWidget(query);

  hlayout0.addSpacing(8);

  edit = new QLineEdit(&nameDlg);
  hlayout0.addWidget(edit);
  
  hlayout0.addSpacing(8);
  vlayout.addSpacing(8);

  QHBoxLayout hlayout;
  vlayout.addLayout(&hlayout);

  hlayout.addSpacing(8);
  ok = new QPushButton(qApp->translate("KSegDocument", "OK", ""), &nameDlg );
  hlayout.addWidget(ok);
  QObject::connect( ok, SIGNAL(clicked()), &nameDlg, SLOT(accept()) );
  ok->setDefault(true);
  hlayout.addSpacing(8);
  cancel = new QPushButton(qApp->translate("KSegDocument", "Cancel", ""), &nameDlg );
  hlayout.addWidget(cancel);
  QObject::connect( cancel, SIGNAL(clicked()), &nameDlg, SLOT(reject()) );
  hlayout.addSpacing(8);

  vlayout.addSpacing(8);

  //run the dialog
  nameDlg.exec();
  if(nameDlg.result() == QDialog::Rejected) return;

  //create the group
  groups.push_back(new KSegSelectionGroup(doc));
  groups.back()->setName(edit->text());
  
  for(int i = 0; i < (int)doc->getSelected().size(); ++i)
    groups.back()->addRef(doc->getSelected()[i]);

  groupLBox->addItem(" " + edit->text());

  doc->emitDocumentModified();
}
Esempio n. 26
0
//-------------------------------------------------------------------------
KJSDebugWin::KJSDebugWin(QWidget *parent, const char *name) : KMainWindow(parent, name, WType_TopLevel), KInstance("kjs_debugger")
{
    m_breakpoints = 0;
    m_breakpointCount = 0;

    m_curSourceFile = 0;
    m_mode = Continue;
    m_nextSourceUrl = "";
    m_nextSourceBaseLine = 1;
    m_execs = 0;
    m_execsCount = 0;
    m_execsAlloc = 0;
    m_steppingDepth = 0;

    m_stopIcon = KGlobal::iconLoader()->loadIcon("stop", KIcon::Small);
    m_emptyIcon = QPixmap(m_stopIcon.width(), m_stopIcon.height());
    QBitmap emptyMask(m_stopIcon.width(), m_stopIcon.height(), true);
    m_emptyIcon.setMask(emptyMask);

    setCaption(i18n("JavaScript Debugger"));

    QWidget *mainWidget = new QWidget(this);
    setCentralWidget(mainWidget);

    QVBoxLayout *vl = new QVBoxLayout(mainWidget, 5);

    // frame list & code
    QSplitter *hsplitter = new QSplitter(Qt::Vertical, mainWidget);
    QSplitter *vsplitter = new QSplitter(hsplitter);
    QFont font(KGlobalSettings::fixedFont());

    QWidget *contextContainer = new QWidget(vsplitter);

    QLabel *contextLabel = new QLabel(i18n("Call stack"), contextContainer);
    QWidget *contextListContainer = new QWidget(contextContainer);
    m_contextList = new QListBox(contextListContainer);
    m_contextList->setMinimumSize(100, 200);
    connect(m_contextList, SIGNAL(highlighted(int)), this, SLOT(slotShowFrame(int)));

    QHBoxLayout *clistLayout = new QHBoxLayout(contextListContainer);
    clistLayout->addWidget(m_contextList);
    clistLayout->addSpacing(KDialog::spacingHint());

    QVBoxLayout *contextLayout = new QVBoxLayout(contextContainer);
    contextLayout->addWidget(contextLabel);
    contextLayout->addSpacing(KDialog::spacingHint());
    contextLayout->addWidget(contextListContainer);

    // source selection & display
    QWidget *sourceSelDisplay = new QWidget(vsplitter);
    QVBoxLayout *ssdvl = new QVBoxLayout(sourceSelDisplay);

    m_sourceSel = new QComboBox(toolBar());
    connect(m_sourceSel, SIGNAL(activated(int)), this, SLOT(slotSourceSelected(int)));

    m_sourceDisplay = new SourceDisplay(this, sourceSelDisplay);
    ssdvl->addWidget(m_sourceDisplay);
    connect(m_sourceDisplay, SIGNAL(lineDoubleClicked(int)), SLOT(slotToggleBreakpoint(int)));

    QValueList< int > vsplitSizes;
    vsplitSizes.insert(vsplitSizes.end(), 120);
    vsplitSizes.insert(vsplitSizes.end(), 480);
    vsplitter->setSizes(vsplitSizes);

    // evaluate

    QWidget *evalContainer = new QWidget(hsplitter);

    QLabel *evalLabel = new QLabel(i18n("JavaScript console"), evalContainer);
    m_evalEdit = new EvalMultiLineEdit(evalContainer);
    m_evalEdit->setWordWrap(QMultiLineEdit::NoWrap);
    m_evalEdit->setFont(font);
    connect(m_evalEdit, SIGNAL(returnPressed()), SLOT(slotEval()));
    m_evalDepth = 0;

    QVBoxLayout *evalLayout = new QVBoxLayout(evalContainer);
    evalLayout->addSpacing(KDialog::spacingHint());
    evalLayout->addWidget(evalLabel);
    evalLayout->addSpacing(KDialog::spacingHint());
    evalLayout->addWidget(m_evalEdit);

    QValueList< int > hsplitSizes;
    hsplitSizes.insert(hsplitSizes.end(), 400);
    hsplitSizes.insert(hsplitSizes.end(), 200);
    hsplitter->setSizes(hsplitSizes);

    vl->addWidget(hsplitter);

    // actions
    KPopupMenu *debugMenu = new KPopupMenu(this);
    menuBar()->insertItem("&Debug", debugMenu);

    m_actionCollection = new KActionCollection(this);
    m_actionCollection->setInstance(this);

    // Venkman use F12, KDevelop F10
    KShortcut scNext = KShortcut(KKeySequence(KKey(Qt::Key_F12)));
    scNext.append(KKeySequence(KKey(Qt::Key_F10)));
    m_nextAction = new KAction(i18n("Next breakpoint", "&Next"), "dbgnext", scNext, this, SLOT(slotNext()), m_actionCollection, "next");
    m_stepAction = new KAction(i18n("&Step"), "dbgstep", KShortcut(Qt::Key_F11), this, SLOT(slotStep()), m_actionCollection, "step");
    // Venkman use F5, Kdevelop F9
    KShortcut scCont = KShortcut(KKeySequence(KKey(Qt::Key_F5)));
    scCont.append(KKeySequence(KKey(Qt::Key_F9)));
    m_continueAction = new KAction(i18n("&Continue"), "dbgrun", scCont, this, SLOT(slotContinue()), m_actionCollection, "cont");
    m_stopAction = new KAction(i18n("St&op"), "stop", KShortcut(Qt::Key_F4), this, SLOT(slotStop()), m_actionCollection, "stop");
    m_breakAction = new KAction(i18n("&Break at Next Statement"), "dbgrunto", KShortcut(Qt::Key_F8), this, SLOT(slotBreakNext()), m_actionCollection,
                                "breaknext");


    m_nextAction->setToolTip(i18n("Next breakpoint", "Next"));
    m_stepAction->setToolTip(i18n("Step"));
    m_continueAction->setToolTip(i18n("Continue"));
    m_stopAction->setToolTip(i18n("Stop"));
    m_breakAction->setToolTip("Break at next Statement");

    m_nextAction->setEnabled(false);
    m_stepAction->setEnabled(false);
    m_continueAction->setEnabled(false);
    m_stopAction->setEnabled(false);
    m_breakAction->setEnabled(true);

    m_nextAction->plug(debugMenu);
    m_stepAction->plug(debugMenu);
    m_continueAction->plug(debugMenu);
    //   m_stopAction->plug(debugMenu); ### disabled until DebuggerImp::stop() works reliably
    m_breakAction->plug(debugMenu);

    m_nextAction->plug(toolBar());
    m_stepAction->plug(toolBar());
    m_continueAction->plug(toolBar());
    //   m_stopAction->plug(toolBar()); ###
    m_breakAction->plug(toolBar());

    toolBar()->insertWidget(1, 300, m_sourceSel);
    toolBar()->setItemAutoSized(1);

    updateContextList();
    setMinimumSize(300, 200);
    resize(600, 450);
}
Esempio n. 27
0
Exif::SearchDialog::SearchDialog( QWidget* parent )
    : KPageDialog( parent )
{
    setWindowTitle( i18n("EXIF Search") );
    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help);
    QWidget *mainWidget = new QWidget(this);
    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);
    mainLayout->addWidget(mainWidget);
    QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    //PORTING SCRIPT: WARNING mainLayout->addWidget(buttonBox) must be last item in layout. Please move it.
    mainLayout->addWidget(buttonBox);
    setFaceType( Tabbed );

    QWidget* settings = new QWidget;
    KPageWidgetItem* page = new KPageWidgetItem( settings, i18n("Settings" ) );

    addPage(  page );
    QVBoxLayout* vlay = new QVBoxLayout( settings );

    // Iso, Exposure, Aperture, FNumber
    QHBoxLayout* hlay = new QHBoxLayout;
    vlay->addLayout( hlay );
    QGridLayout* gridLayout = new QGridLayout;
    gridLayout->setSpacing( 6 );
    hlay->addLayout( gridLayout );
    hlay->addStretch( 1 );

    makeISO( gridLayout );
    makeExposureTime( gridLayout );
    hlay->addSpacing(30);

    gridLayout = new QGridLayout;
    gridLayout->setSpacing( 6 );
    hlay->addLayout( gridLayout );
    hlay->addStretch( 1 );
    m_apertureValue = makeApertureOrFNumber( i18n( "Aperture Value" ), QString::fromLatin1( "Exif_Photo_ApertureValue" ), gridLayout, 0 );
    m_fNumber = makeApertureOrFNumber( i18n( "F Number" ), QString::fromLatin1( "Exif_Photo_FNumber" ), gridLayout, 1 );

    hlay->addSpacing(30);

    // Focal length
    QHBoxLayout* focalLayout = new QHBoxLayout;
    focalLayout->setSpacing( 6 );
    hlay->addLayout( focalLayout );
    hlay->addStretch( 1 );

    QLabel* label = new QLabel( i18n( "Focal Length" ) );
    focalLayout->addWidget(label);

    m_fromFocalLength = new QSpinBox;
    focalLayout->addWidget(m_fromFocalLength);
    m_fromFocalLength->setRange( 0, 10000 );
    m_fromFocalLength->setSingleStep( 10 );

    label = new QLabel( i18nc("As in 'A range from x to y'","to"));
    focalLayout->addWidget(label);

    m_toFocalLength = new QSpinBox;
    focalLayout->addWidget(m_toFocalLength);
    m_toFocalLength->setRange( 0, 10000 );
    m_toFocalLength->setSingleStep( 10 );

    m_toFocalLength->setValue( 10000 );
    QString suffix = i18nc( "This is millimeter for focal length, like 35mm", "mm" );
    m_fromFocalLength->setSuffix( suffix );
    m_toFocalLength->setSuffix( suffix );

    connect( m_fromFocalLength, SIGNAL(valueChanged(int)), this, SLOT(fromFocalLengthChanged(int)) );
    connect( m_toFocalLength, SIGNAL(valueChanged(int)), this, SLOT(toFocalLengthChanged(int)) );

    // exposure program and Metring mode
    hlay = new QHBoxLayout;
    vlay->addLayout( hlay );
    hlay->addWidget( makeExposureProgram( settings ) );
    hlay->addWidget( makeMeteringMode( settings ) );

    vlay->addStretch( 1 );

    // ------------------------------------------------------------ Camera
    page = new KPageWidgetItem( makeCamera(), i18n("Camera") );
    addPage( page );

    // ------------------------------------------------------------ Lens
    page = new KPageWidgetItem( makeLens(), i18n("Lens") );
    addPage( page );

    // ------------------------------------------------------------ Misc
    QWidget* misc = new QWidget;
    addPage( new KPageWidgetItem( misc, i18n("Miscellaneous") ) );
    vlay = new QVBoxLayout( misc );
    vlay->addWidget( makeOrientation( misc ), 1 );

    hlay = new QHBoxLayout;
    vlay->addLayout( hlay );
    hlay->addWidget( makeContrast( misc ) );
    hlay->addWidget( makeSharpness( misc ) );
    hlay->addWidget( makeSaturation( misc ) );
    vlay->addStretch( 1 );
}
Esempio n. 28
0
EditorToolBar::EditorToolBar(QWidget *parent)
    : QWidget(parent)
{
    QString skin = "default";

    m_comboFontFamily = new CWizToolComboBoxFont(this);
    connect(m_comboFontFamily, SIGNAL(activated(const QString&)),
            SLOT(on_comboFontFamily_indexChanged(const QString&)));

    QStringList listSize;
    listSize << "9px" << "10px" << "11px" << "12px" << "13px"<< "14px"
             << "18px" << "24px" << "36px" << "48px" << "64px" << "72px";
    m_comboFontSize = new CWizToolComboBox(this);
    m_comboFontSize->addItems(listSize);
    connect(m_comboFontSize, SIGNAL(activated(const QString&)),
            SLOT(on_comboFontSize_indexChanged(const QString&)));

    m_btnFormatMatch = new CWizToolButton(this);
    m_btnFormatMatch->setIcon(::WizLoadSkinIcon(skin, "actionFormatMatch"));
    connect(m_btnFormatMatch, SIGNAL(clicked()), SLOT(on_btnFormatMatch_clicked()));

    m_btnForeColor = new CWizToolButtonColor(this);
    m_btnForeColor->setIcon(::WizLoadSkinIcon(skin, "actionFormatForeColor"));
    connect(m_btnForeColor, SIGNAL(clicked()), SLOT(on_BtnForeColor_clicked()));

    m_btnBackColor = new CWizToolButtonColor(this);
    m_btnBackColor->setIcon(::WizLoadSkinIcon(skin, "actionFormatBackColor"));
    connect(m_btnBackColor, SIGNAL(clicked()), SLOT(on_BtnBackColor_clicked()));

    m_btnBold = new CWizToolButton(this);
    m_btnBold->setIcon(::WizLoadSkinIcon(skin, "actionFormatBold"));
    connect(m_btnBold, SIGNAL(clicked()), SLOT(on_btnBold_clicked()));

    m_btnItalic = new CWizToolButton(this);
    m_btnItalic->setIcon(::WizLoadSkinIcon(skin, "actionFormatItalic"));
    connect(m_btnItalic, SIGNAL(clicked()), SLOT(on_btnItalic_clicked()));

    m_btnUnderLine = new CWizToolButton(this);
    m_btnUnderLine->setIcon(::WizLoadSkinIcon(skin, "actionFormatUnderLine"));
    connect(m_btnUnderLine, SIGNAL(clicked()), SLOT(on_btnUnderLine_clicked()));

    m_btnJustifyLeft = new CWizToolButton(this);
    m_btnJustifyLeft->setIcon(::WizLoadSkinIcon(skin, "actionFormatJustifyLeft"));
    connect(m_btnJustifyLeft, SIGNAL(clicked()), SLOT(on_btnJustifyLeft_clicked()));

    m_btnJustifyCenter = new CWizToolButton(this);
    m_btnJustifyCenter->setIcon(::WizLoadSkinIcon(skin, "actionFormatJustifyCenter"));
    connect(m_btnJustifyCenter, SIGNAL(clicked()), SLOT(on_btnJustifyCenter_clicked()));

    m_btnJustifyRight = new CWizToolButton(this);
    m_btnJustifyRight->setIcon(::WizLoadSkinIcon(skin, "actionFormatJustifyRight"));
    connect(m_btnJustifyRight, SIGNAL(clicked()), SLOT(on_btnJustifyRight_clicked()));

    m_btnUnorderedList = new CWizToolButton(this);
    m_btnUnorderedList->setIcon(::WizLoadSkinIcon(skin, "actionFormatInsertUnorderedList"));
    connect(m_btnUnorderedList, SIGNAL(clicked()), SLOT(on_btnUnorderedList_clicked()));

    m_btnOrderedList = new CWizToolButton(this);
    m_btnOrderedList->setIcon(::WizLoadSkinIcon(skin, "actionFormatInsertOrderedList"));
    connect(m_btnOrderedList, SIGNAL(clicked()), SLOT(on_btnOrderedList_clicked()));

    m_btnTable = new CWizToolButton(this);
    m_btnTable->setCheckable(false);
    m_btnTable->setIcon(::WizLoadSkinIcon(skin, "actionFormatInsertTable"));
    connect(m_btnTable, SIGNAL(clicked()), SLOT(on_btnTable_clicked()));

    m_btnHorizontal = new CWizToolButton(this);
    m_btnHorizontal->setCheckable(false);
    m_btnHorizontal->setIcon(::WizLoadSkinIcon(skin, "actionFormatInsertHorizontal"));
    connect(m_btnHorizontal, SIGNAL(clicked()), SLOT(on_btnHorizontal_clicked()));

    QHBoxLayout* layout = new QHBoxLayout();
    layout->setContentsMargins(3, 0, 3, 0);
    layout->setAlignment(Qt::AlignBottom);
    layout->setSpacing(2);
    setLayout(layout);

    layout->addWidget(m_comboFontFamily);
    layout->addSpacing(6);
    layout->addWidget(m_comboFontSize);
    layout->addSpacing(12);
    layout->addWidget(m_btnFormatMatch);
    layout->addWidget(m_btnForeColor);
    layout->addWidget(m_btnBackColor);
    layout->addWidget(m_btnBold);
    layout->addWidget(m_btnItalic);
    layout->addWidget(m_btnUnderLine);
    layout->addSpacing(12);
    layout->addWidget(m_btnJustifyLeft);
    layout->addWidget(m_btnJustifyCenter);
    layout->addWidget(m_btnJustifyRight);
    layout->addSpacing(12);
    layout->addWidget(m_btnUnorderedList);
    layout->addWidget(m_btnOrderedList);
    layout->addSpacing(12);
    layout->addWidget(m_btnTable);
    layout->addWidget(m_btnHorizontal);
    layout->addStretch();
}
Esempio n. 29
0
cal2::cal2(QWidget *parent)
    : QWidget(parent)
{

    initBasicData();
//--------------------------顶层--------------------------------------------------------------
    QFont font1;
    font1.setPixelSize(15);

    QPalette palette1;
    palette1.setColor(QPalette::WindowText,QColor(155,155,155,255));

    today = new ClickedLabel;
    today->setFont(font1);
    today->setPalette(palette1);
    today->setText(tr("Today"));
    connect(today,SIGNAL(clicked(ClickedLabel*)),this,SLOT(todayOnClicked()));

    pre = new ClickedLabel;
    pre->setFont(font1);
    pre->setPalette(palette1);
    pre->setText(tr("PRE"));
    connect(pre,SIGNAL(clicked(ClickedLabel*)),this,SLOT(preOnClicked()));

    next = new ClickedLabel;
    next->setFont(font1);
    next->setPalette(palette1);
    next->setText(tr("NEXT"));
    connect(next,SIGNAL(clicked(ClickedLabel*)),this,SLOT(nextOnClicked()));

    month = new ClickedLabel;
    month->setFont(font1);
    month->setPalette(palette1);

    year = new ClickedLabel;
    year->setFont(font1);
    year->setPalette(palette1);

    QHBoxLayout *toplayout = new QHBoxLayout;
    toplayout->addWidget(today);
    toplayout->addStretch();
    toplayout->addWidget(pre);
    toplayout->addSpacing(20);
    toplayout->addWidget(month);
    toplayout->addSpacing(5);
    toplayout->addWidget(year);
    toplayout->addSpacing(20);
    toplayout->addWidget(next);
    toplayout->addStretch();

//--------------------------顶层结束----------------------------------------------------------



//---------------------------星期---------------------------------------------------------------
    QString weekstr[7]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
    QHBoxLayout* weeklayout = new QHBoxLayout;
    weeklayout->setSpacing(0);

    QFont font2;
    font2.setPixelSize(15);
    QPalette palette2;
    palette2.setColor(QPalette::WindowText,QColor(155,155,155,255));

    for(int i=0;i<7;i++)
    {
        QLabel* label = new QLabel(tr("%1").arg(weekstr[i]));
        label->setFont(font2);
        label->setPalette(palette2);
        label->setAlignment(Qt::AlignBottom|Qt::AlignHCenter);
        label->setFixedHeight(20);
        weeklayout->addWidget(label);
    }


    QVBoxLayout *toplayout2 = new QVBoxLayout;
    toplayout2->addLayout(toplayout);
    toplayout2->addLayout(weeklayout);
    QWidget *topwidget = new QWidget;
    topwidget->setLayout(toplayout2);
    topwidget->setFixedHeight(70);
    topwidget->setAutoFillBackground(true);
    QPalette pet;
    pet.setColor(QPalette::Background,QColor(50,58,69));
    topwidget->setPalette(pet);
    topwidget->setFixedHeight(100);
    //topwidget->setStyleSheet("background-color: rgb(50,58,69)");

//---------------------------星期结束---------------------------------------------------------------



//----------------------------月历----------------------------------------------------------------
    QGridLayout* grid = new QGridLayout;
    grid->setSpacing(1);

    int row,col,num;
    for(row=0;row<6;row++)
        for(col=1;col<=7;col++)
        {
            num =row*7+col;
            labels[num] = new cal_label;

            QPalette lpa;
            lpa.setColor(QPalette::WindowText,QColor(200,200,200));
            labels[num]->lunarday->setPalette(lpa);
            connect(labels[num],SIGNAL(clicked(cal_label*)),this,SLOT(changeday(cal_label*)));
            grid->addWidget(labels[num],row,col-1);
        }

    QVBoxLayout* mainlayout = new QVBoxLayout();
    //mainlayout->setSpacing(0);
    mainlayout->addWidget(topwidget);
    mainlayout->addLayout(grid);


    QFont rtfont1;
    rtfont1.setPixelSize(30);
    righttop = new QLabel;
    righttop->setFont(rtfont1);
    righttop->setStyleSheet("color:white;background-color:rgb(20,185,214)");
    righttop->setFixedSize(360,100);
    //righttop->setAlignment(Qt::AlignCenter);
    righttop->setIndent(20);

    righttop2 = new QLabel;
    rtfont1.setPixelSize(20);
    righttop2->setFont(rtfont1);
    righttop2->setFixedHeight(100);
    righttop2->setStyleSheet("color:white;background-color:grey");
    righttop2->setAlignment(Qt::AlignCenter);
    //righttop2->setIndent(30);

    QVBoxLayout *rtlayout = new QVBoxLayout;
    rtlayout->addWidget(righttop);
    rtlayout->addWidget(righttop2);
    rtlayout->setSpacing(0);

//    QLabel *rtwidget = new QLabel;
//    rtwidget->setLayout(rtlayout);
//    rtwidget->setFixedHeight(200);
//    rtwidget->setStyleSheet("background-color:rgb(107,203,202)");
//    //rtwidget->setPalette(pet);

    todaylist = new QListWidget;
    QFont f1;
    f1.setPixelSize(20);
    todaylist->setFont(f1);
    //todaylist->setStyleSheet("background-color:rgb(24,34,144)");

    QVBoxLayout *right1 = new QVBoxLayout;
    right1->addLayout(rtlayout);
    right1->addWidget(todaylist);

    QHBoxLayout *lastlayout = new QHBoxLayout(this);
    lastlayout->setSpacing(1);
    lastlayout->addLayout(mainlayout);
    lastlayout->addLayout(right1);
    lastlayout->setMargin(0);

    newCal();

}
Esempio n. 30
0
Ui::CallPanelMain::CallPanelMain(QWidget* parent)
    : QWidget(parent)
    , _menu(NULL)
    , actual_vol_(0)
    , menu_show_(NULL)
    , name_and_status_container_(NULL)
    , avatar_container_(NULL) {

        setProperty("CallPanelMain", true);

        QVBoxLayout* root_layout = new QVBoxLayout();
        root_layout->setContentsMargins(0, 0, 0, 0);
        root_layout->setSpacing(0);
        root_layout->setAlignment(Qt::AlignVCenter);
        setLayout(root_layout);

        QWidget* rootWidget = new QWidget(this);
        rootWidget->setContentsMargins(0, 0, 0, 0);
        rootWidget->setProperty("CallPanelMain", true);
        layout()->addWidget(rootWidget);

        QHBoxLayout* layout = new QHBoxLayout();
        layout->setContentsMargins(0, 0, 0, 0);
        layout->setSpacing(0);
        layout->setAlignment(Qt::AlignVCenter);
        rootWidget->setLayout(layout);

        avatar_container_ = new AvatarContainerWidget(rootWidget, Utils::scale_value(50), Utils::scale_value(16), Utils::scale_value(12), Utils::scale_value(5));
        avatar_container_->setOverlap(0.6f);
        layout->addWidget(avatar_container_);

        name_and_status_container_ = new NameAndStatusWidget(rootWidget, Utils::scale_value(17), Utils::scale_value(12));
        name_and_status_container_->setNameProperty("CallPanelMainText_Name", true);
        name_and_status_container_->setStatusProperty("CallPanelMainText_Status", true);
        name_and_status_container_->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred));
        layout->addWidget(name_and_status_container_);

        layout->addSpacing(Utils::scale_value(6));

        menu_show_ = new QPushButton(rootWidget);
        menu_show_->setProperty("MenuShow", true);
		menu_show_->setCursor(QCursor(Qt::PointingHandCursor));
        connect(menu_show_, SIGNAL(clicked()), this, SLOT(onMenuButtonClicked()), Qt::QueuedConnection);
        layout->addWidget(menu_show_);

        layout->addSpacing(Utils::scale_value(24));

        QPushButton* callStop = new QPushButton(rootWidget);
        callStop->setProperty("StopCallMainButton", true);
		callStop->setCursor(QCursor(Qt::PointingHandCursor));
        connect(callStop, SIGNAL(clicked()), this, SLOT(onHangUpButtonClicked()), Qt::QueuedConnection);
        layout->addWidget(callStop);

        layout->addSpacing(Utils::scale_value(16));
        connect(&_menu, SIGNAL(onMenuOpenChanged(bool)), this, SLOT(onMenuOpenChanged(bool)), Qt::QueuedConnection);
        _menu.hide();

        QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallNameChanged(const std::vector<voip_manager::Contact>&)), this, SLOT(onVoipCallNameChanged(const std::vector<voip_manager::Contact>&)), Qt::DirectConnection);
        QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallDestroyed(const voip_manager::ContactEx&)), this, SLOT(onVoipCallDestroyed(const voip_manager::ContactEx&)), Qt::DirectConnection);
        QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipVolumeChanged(const std::string&,int)), this, SLOT(onVoipVolumeChanged(const std::string&,int)), Qt::DirectConnection);
        QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipMuteChanged(const std::string&,bool)), this, SLOT(onVoipMuteChanged(const std::string&,bool)), Qt::DirectConnection);
        QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipMediaLocalAudio(bool)), this, SLOT(onVoipMediaLocalAudio(bool)), Qt::DirectConnection);
        QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipMediaLocalVideo(bool)), this, SLOT(onVoipMediaLocalVideo(bool)), Qt::DirectConnection);
		QObject::connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallTimeChanged(unsigned,bool)), this, SLOT(onVoipCallTimeChanged(unsigned,bool)), Qt::DirectConnection);

        {
            SliderEx* slider = new SliderEx(&_menu);
            slider->setProperty("CallMenuItemCommon", true);
            slider->set_property_for_slider("VideoPanelVolumeSlider", true);
            slider->set_property_for_icon("CallMenuItemButton", true);

            _menu.add_widget(kmenu_item_volume, slider);
            connect(slider, SIGNAL(onSliderValueChanged(int)), this, SLOT(onVolumeChanged(int)), Qt::QueuedConnection);
            connect(slider, SIGNAL(onSliderReleased()), this, SLOT(onVolumeReleased()), Qt::QueuedConnection);
            connect(slider, SIGNAL(onIconClick()), this, SLOT(onVolumeOnOff()), Qt::QueuedConnection);
        }
        
        {
            QPushButton* btn = new QPushButton(&_menu);
            btn->setProperty("CallMenuItemCommon", true);
            btn->setProperty("CallMenuItemButton", true);
			btn->setCursor(QCursor(Qt::PointingHandCursor));
            _menu.add_widget(kmenu_item_mic, btn);
            connect(btn, SIGNAL(clicked()), this, SLOT(onMuteMicOnOffClicked()), Qt::QueuedConnection);
        }
        
        {
            QPushButton* btn = new QPushButton(&_menu);
            btn->setProperty("CallMenuItemCommon", true);
            btn->setProperty("CallMenuItemButton", true);
			btn->setCursor(QCursor(Qt::PointingHandCursor));
            _menu.add_widget(kmenu_item_cam, btn);
            connect(btn, SIGNAL(clicked()), this, SLOT(onVideoOnOffClicked()), Qt::QueuedConnection);
        }
}