예제 #1
0
DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f)
{
	ui.setupUi(this);
	ui.dateEdit->setDisplayFormat(getDateFormat());
	ui.tableWidget->setTitle(tr("Dive planner points"));
	ui.tableWidget->setModel(DivePlannerPointsModel::instance());
	DivePlannerPointsModel::instance()->setRecalc(true);
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this));
	ui.cylinderTableWidget->setTitle(tr("Available gases"));
	ui.cylinderTableWidget->setModel(CylindersModel::instance());
	QTableView *view = ui.cylinderTableWidget->view();
	view->setColumnHidden(CylindersModel::START, true);
	view->setColumnHidden(CylindersModel::END, true);
	view->setColumnHidden(CylindersModel::DEPTH, false);
	view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
	connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
	connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));

	connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)),
		GasSelectionModel::instance(), SLOT(repopulate()));
	connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)),
		GasSelectionModel::instance(), SLOT(repopulate()));
	connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)),
		GasSelectionModel::instance(), SLOT(repopulate()));
	connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)),
		plannerModel, SIGNAL(cylinderModelEdited()));
	connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)),
		plannerModel, SIGNAL(cylinderModelEdited()));
	connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)),
		plannerModel, SIGNAL(cylinderModelEdited()));

	ui.tableWidget->setBtnToolTip(tr("Add dive data point"));
	connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime)));
	connect(ui.dateEdit, SIGNAL(dateChanged(QDate)), plannerModel, SLOT(setStartDate(QDate)));
	connect(ui.ATMPressure, SIGNAL(valueChanged(int)), this, SLOT(atmPressureChanged(int)));
	connect(ui.atmHeight, SIGNAL(valueChanged(int)), this, SLOT(heightChanged(int)));
	connect(ui.salinity, SIGNAL(valueChanged(double)), this, SLOT(salinityChanged(double)));
	connect(DivePlannerPointsModel::instance(), SIGNAL(startTimeChanged(QDateTime)), this, SLOT(setupStartTime(QDateTime)));

	// Creating (and canceling) the plan
	replanButton = ui.buttonBox->addButton(tr("Save new"), QDialogButtonBox::ActionRole);
	connect(replanButton, SIGNAL(clicked()), plannerModel, SLOT(saveDuplicatePlan()));
	connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(savePlan()));
	connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan()));
	QShortcut *closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), this);
	connect(closeKey, SIGNAL(activated()), plannerModel, SLOT(cancelPlan()));

	// This makes shure the spinbox gets a setMinimum(0) on it so we can't have negative time or depth.
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::DEPTH, new SpinBoxDelegate(0, INT_MAX, 1, this));
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::RUNTIME, new SpinBoxDelegate(0, INT_MAX, 1, this));
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::DURATION, new SpinBoxDelegate(0, INT_MAX, 1, this));
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::CCSETPOINT, new DoubleSpinBoxDelegate(0, 2, 0.1, this));

	/* set defaults. */
	ui.ATMPressure->setValue(1013);
	ui.atmHeight->setValue(0);

	setMinimumWidth(0);
	setMinimumHeight(0);
}
예제 #2
0
fieldManager::fieldManager(QWidget *parent) :
	groupBoxCollapse(parent)
{
	this->itemModel = NULL;

	this->LayoutVertical = new QVBoxLayout(this);
	this->LayoutHorizontal = new QHBoxLayout();
	this->HorizontalSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);
	this->ListView = new QListView(this);
	this->ButtonAdd = new QPushButton(tr("add"),this);
	this->ButtonAdd->setIcon(QIcon(":/toolbar/edit_add.png"));
	this->ButtonRemove = new QPushButton(tr("remove"),this);
	this->ButtonRemove->setIcon(QIcon(":/toolbar/editdelete.png"));
	this->ComboBoxChooser = new QComboBox(this);
	this->ComboBoxChooser->setEditable(true);

	this->LayoutHorizontal->addWidget(this->ComboBoxChooser);
	this->LayoutHorizontal->addSpacerItem(this->HorizontalSpacer);
	this->LayoutHorizontal->addWidget(this->ButtonAdd);
	this->LayoutHorizontal->addWidget(this->ButtonRemove);

	this->LayoutVertical->addWidget(this->ListView);
	this->LayoutVertical->addLayout(LayoutHorizontal);

	connect(this->ButtonAdd,SIGNAL(clicked()),this,SLOT(addButtonClicked()));
	connect(this->ButtonRemove,SIGNAL(clicked()),this,SLOT(removeButtonClicked()));
}
예제 #3
0
OpenSearchDialog::OpenSearchDialog(QWidget *parent)
    : QDialog(parent)
    , m_model(0)
{
    setModal(true);
    setupUi(this);

    m_model = new OpenSearchEngineModel(ToolbarSearch::openSearchManager(), this);
    m_tableView->setModel(m_model);
    m_tableView->horizontalHeader()->resizeSection(0, 200);
    m_tableView->horizontalHeader()->setStretchLastSection(true);
    m_tableView->verticalHeader()->hide();
    m_tableView->verticalHeader()->setDefaultSectionSize(1.2 * fontMetrics().height());
    m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    m_tableView->setShowGrid(false);
    m_tableView->setAlternatingRowColors(true);

    connect(m_closeButton, SIGNAL(clicked()),
            this, SLOT(close()));
    connect(m_addButton, SIGNAL(clicked()),
            this, SLOT(addButtonClicked()));
    connect(m_deleteButton, SIGNAL(clicked()),
            this, SLOT(deleteButtonClicked()));
    connect(m_restoreButton, SIGNAL(clicked()),
            this, SLOT(restoreButtonClicked()));
}
예제 #4
0
파일: contenttab.cpp 프로젝트: KDE/kst-plot
ContentTab::ContentTab(QWidget *parent, ObjectStore *store)
  : DialogTab(parent), _store(store) {

  setupUi(this);

  _up->setIcon(KstGetIcon("kst_uparrow"));
  _down->setIcon(KstGetIcon("kst_downarrow"));
  _add->setIcon(KstGetIcon("kst_rightarrow"));
  _remove->setIcon(KstGetIcon("kst_leftarrow"));
  _up->setToolTip(tr("Raise in plot order: Alt+Up"));
  _down->setToolTip(tr("Lower in plot order: Alt+Down"));
  _add->setToolTip(tr("Select: Alt+s"));
  _remove->setToolTip(tr("Remove: Alt+r"));


  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));

  connect(_add, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_remove, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_up, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_down, SIGNAL(clicked()), this, SIGNAL(modified()));

  connect(_availableRelationList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(availableDoubleClicked(QListWidgetItem*)));
  connect(_displayedRelationList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(displayedDoubleClicked(QListWidgetItem*)));

  connect(_availableRelationList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_displayedRelationList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

  connect(_editSelectedAvailable, SIGNAL(clicked()), this, SLOT(editSelectedAvailable()));
  connect(_editSelectedDisplayed, SIGNAL(clicked()), this, SLOT(editSelectedDisplayed()));

}
ExportVectorsDialog::ExportVectorsDialog(QWidget *parent) :
    QDialog(parent)
{
    setupUi(this);

    MainWindow::setWidgetFlags(this);

     _saveLocationLabel->setBuddy(_saveLocation->_fileEdit);
     _saveLocation->setFile(_dialogDefaults->value("vectorexport/filename",QDir::currentPath()).toString());

    if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
      _store = mw->document()->objectStore();
    } else {
       // FIXME: we need the object store
      qFatal("ERROR: can't construct a ExportVectorsDialog without the object store");
    }

    connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
    connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
    connect(_removeAll, SIGNAL(clicked()), this, SLOT(removeAll()));
    connect(_addAll, SIGNAL(clicked()), this, SLOT(addAll()));

    connect(_changeVectorList, SIGNAL(itemDoubleClicked ( QListWidgetItem * )), this, SLOT(availableDoubleClicked(QListWidgetItem *)));
    connect(_selectedVectorList, SIGNAL(itemDoubleClicked ( QListWidgetItem * )), this, SLOT(selectedDoubleClicked(QListWidgetItem *)));

    connect(_changeVectorList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
    connect(_selectedVectorList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

    connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked()));
    connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));

}
예제 #6
0
QgsSourceSelectDialog::QgsSourceSelectDialog( const QString& serviceName, ServiceType serviceType, QWidget* parent, Qt::WindowFlags fl )
    : QDialog( parent, fl ), mServiceName( serviceName ), mServiceType( serviceType ), mBuildQueryButton( 0 ), mImageEncodingGroup( 0 )
{
  setupUi( this );
  setWindowTitle( QStringLiteral( "Add %1 Layer from a Server" ).arg( mServiceName ) );

  mAddButton = buttonBox->addButton( tr( "&Add" ), QDialogButtonBox::ActionRole );
  mAddButton->setEnabled( false );
  connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addButtonClicked() ) );

  if ( mServiceType == FeatureService )
  {
    mBuildQueryButton = buttonBox->addButton( tr( "&Build query" ), QDialogButtonBox::ActionRole );
    mBuildQueryButton->setDisabled( true );
    connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQueryButtonClicked() ) );
  }

  connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
  connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
  connect( btnEdit, SIGNAL( clicked() ), this, SLOT( modifyEntryOfServerList() ) );
  connect( btnDelete, SIGNAL( clicked() ), this, SLOT( deleteEntryOfServerList() ) );
  connect( btnConnect, SIGNAL( clicked() ), this, SLOT( connectToServer() ) );
  connect( btnChangeSpatialRefSys, SIGNAL( clicked() ), this, SLOT( changeCrs() ) );
  connect( lineFilter, SIGNAL( textChanged( QString ) ), this, SLOT( filterChanged( QString ) ) );
  populateConnectionList();
  mProjectionSelector = new QgsGenericProjectionSelector( this );
  mProjectionSelector->setMessage();

  treeView->setItemDelegate( new QgsSourceSelectItemDelegate( treeView ) );

  QSettings settings;
  restoreGeometry( settings.value( QStringLiteral( "/Windows/SourceSelectDialog/geometry" ) ).toByteArray() );
  cbxUseTitleLayerName->setChecked( settings.value( QStringLiteral( "/Windows/SourceSelectDialog/UseTitleLayerName" ), false ).toBool() );

  mModel = new QStandardItemModel();
  mModel->setHorizontalHeaderItem( 0, new QStandardItem( QStringLiteral( "Title" ) ) );
  mModel->setHorizontalHeaderItem( 1, new QStandardItem( QStringLiteral( "Name" ) ) );
  mModel->setHorizontalHeaderItem( 2, new QStandardItem( QStringLiteral( "Abstract" ) ) );
  if ( serviceType == FeatureService )
  {
    mModel->setHorizontalHeaderItem( 3, new QStandardItem( QStringLiteral( "Cache Feature" ) ) );
    mModel->setHorizontalHeaderItem( 4, new QStandardItem( QStringLiteral( "Filter" ) ) );
    gbImageEncoding->hide();
  }
  else
  {
    cbxFeatureCurrentViewExtent->hide();
    mImageEncodingGroup = new QButtonGroup( this );
  }

  mModelProxy = new QSortFilterProxyModel( this );
  mModelProxy->setSourceModel( mModel );
  mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
  treeView->setModel( mModelProxy );

  connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( treeWidgetItemDoubleClicked( const QModelIndex& ) ) );
  connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( treeWidgetCurrentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
}
FlashSegmentWindowHandler::FlashSegmentWindowHandler(QObject *parent) :
    QObject(parent)
{
    connect(mWindow.ui->classList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*, QListWidgetItem*)));
    connect(mWindow.ui->okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    connect(mWindow.ui->addButton, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
    connect(mWindow.ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteButtonClicked()));
    connect(mWindow.ui->viewButton, SIGNAL(clicked()), this, SLOT(viewButtonClicked()));
}
void AddDialog::check()
{
    if(eDescription->text() == "")
    {
         eDescription->setFocus();
    }
    else if(eTheLow->text() == "")
    {
        eTheLow->setFocus();
    }
    else  addButtonClicked();
}
void ZmdServerDialog::initGUI()
{

  layout = new QVBoxLayout(this);
  nameLabel = new QLabel(i18n("Please enter server name below"), this);
  serverLabel = new QLabel(i18n("Please enter server URL below"), this);
  nameEdit = new KLineEdit(this);
  serverEdit = new KLineEdit(this);
  typeGroup = new QButtonGroup(2, Qt::Vertical, i18n("Server Type"), this);
  QRadioButton *zButton = new QRadioButton("ZYPP", typeGroup);
  QRadioButton *yButton = new QRadioButton("YUM", typeGroup);
  QRadioButton *aButton = new QRadioButton("ZENworks", typeGroup);
  QRadioButton *mButton = new QRadioButton("Mount", typeGroup);
  QRadioButton *nButton = new QRadioButton(i18n("NU Server"), typeGroup);
  QRadioButton *rButton = new QRadioButton(i18n("RCE Server"), typeGroup);
  cancelButton = new KPushButton(KStdGuiItem::cancel(), this);
  addButton = new KPushButton(KStdGuiItem::add(), this);

  layout->addWidget(nameLabel, 0, 0);
  layout->addWidget(nameEdit, 0, 0);
  layout->addWidget(serverLabel, 0, 0);
  layout->addWidget(serverEdit, 0, 0);
  layout->addWidget(typeGroup, 0, 0);
  layout->setMargin(10);
  layout->setSpacing(5);

  typeGroup->setExclusive(true);
  typeGroup->insert(zButton, TYPE_ZYPP);
  typeGroup->insert(yButton, TYPE_YUM);
  typeGroup->insert(aButton, TYPE_ZEN);
  typeGroup->insert(mButton, TYPE_MOUNT);
  typeGroup->insert(nButton, TYPE_NU);
  typeGroup->insert(rButton, TYPE_RCE);
  typeGroup->setButton(TYPE_ZYPP);

  buttonLayout = new QHBoxLayout(layout);
  buttonLayout->addWidget(cancelButton, 0, Qt::AlignLeft);
  buttonLayout->addSpacing(100);
  buttonLayout->addWidget(addButton, 0, Qt::AlignRight);
  addButton->setDefault(true);

  connect(addButton, SIGNAL(clicked()),
          this, SLOT(addButtonClicked()));

  connect(cancelButton, SIGNAL(clicked()),
          this, SLOT(cancelButtonClicked()));

  layout->setMargin(20);
  setCaption(i18n("Add Server"));
  show();
}
EnvironmentVariablesDialog::EnvironmentVariablesDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::EnvironmentVariablesDialog)
{
    ui->setupUi(this);
    
    connect(ui->addButton, SIGNAL(clicked()),
            this, SLOT(addButtonClicked()));
    connect(ui->editButton, SIGNAL(clicked()),
            this, SLOT(editButtonClicked()));
    connect(ui->deleteButton, SIGNAL(clicked()),
            this, SLOT(deleteButtonClicked()));
    connect(ui->valueViewer, SIGNAL(itemSelectionChanged()),
            this, SLOT(viewerSelectionChanged()));
}
예제 #11
0
CalculatorWidget::CalculatorWidget(QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) {
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(layout);

    QSizePolicy policy = sizePolicy();

    displayLabel = new QLabel(this);
    layout->addWidget(displayLabel, 0, 0, 1, 3);
    displayLabel->setAutoFillBackground(true);
    displayLabel->setBackgroundRole(QPalette::Base);
    displayLabel->setAlignment(Qt::AlignRight);
    displayLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
    policy = displayLabel->sizePolicy();
    policy.setVerticalPolicy(QSizePolicy::Fixed);
    displayLabel->setSizePolicy(policy);

    signalMapper = new QSignalMapper(this);
    QPushButton *button = new QPushButton(QString::number(0), this);
    QObject::connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
    signalMapper->setMapping(button, 0);
    layout->addWidget(button, 4, 1);
    digitButtons.push_back(button);
    for (unsigned int i = 1; i < 10; ++i) {
        QPushButton *button = new QPushButton(QString::number(i), this);
        QObject::connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
        signalMapper->setMapping(button, i);
        layout->addWidget(button, 1+(9-i)/3, (i-1)%3);
        digitButtons.push_back(button);
    }
    QObject::connect(signalMapper, SIGNAL(mapped(int)), SLOT(buttonClicked(int)));

    clearButton = new QPushButton("C", this);
    layout->addWidget(clearButton, 1, 4);
    QObject::connect(clearButton, SIGNAL(clicked()), SLOT(clearButtonClicked()));

    additionButton = new QPushButton("+", this);
    layout->addWidget(additionButton, 2, 4);
    QObject::connect(additionButton, SIGNAL(clicked()), SLOT(addButtonClicked()));

    subtractionButton = new QPushButton("-", this);
    layout->addWidget(subtractionButton, 3, 4);
    QObject::connect(subtractionButton, SIGNAL(clicked()), SLOT(subtractButtonClicked()));

    calculateButton = new QPushButton("=", this);
    layout->addWidget(calculateButton, 4, 4);
    QObject::connect(calculateButton, SIGNAL(clicked()), SLOT(calculateButtonClicked()));
}
예제 #12
0
WorkoutEditorBase::WorkoutEditorBase(QStringList &colms, QWidget *parent) :QFrame(parent)
{
    QVBoxLayout *layout = new QVBoxLayout();
    QHBoxLayout *row1Layout = new QHBoxLayout();
    table = new QTableWidget();

    table->setColumnCount(colms.count());
    table->setHorizontalHeaderLabels(colms);
#if QT_VERSION > 0x050000
    table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#else
    table->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#endif
    table->setShowGrid(true);
    table->setAlternatingRowColors(true);
    table->resizeColumnsToContents();
    row1Layout->addWidget(table);

    connect(table,SIGNAL(cellChanged(int,int)),this,SLOT(cellChanged(int,int)));


    QHBoxLayout *row2Layout = new QHBoxLayout();
    QPushButton *delButton = new QPushButton();
    delButton->setText(tr("Delete"));
    delButton->setToolTip(tr("Delete the highlighted row"));
    connect(delButton,SIGNAL(clicked()),this,SLOT(delButtonClicked()));
    row2Layout->addWidget(delButton);
    QPushButton *addButton = new QPushButton();
    addButton->setText(tr("Add"));
    addButton->setToolTip(tr("Add row at end"));
    connect(addButton,SIGNAL(clicked()),this,SLOT(addButtonClicked()));
    row2Layout->addWidget(addButton);
    QPushButton *insertButton = new QPushButton();
    insertButton->setText(tr("Insert"));
    insertButton->setToolTip(tr("Add a Lap below the highlighted row"));
    connect(insertButton,SIGNAL(clicked()),this,SLOT(insertButtonClicked()));
    row2Layout->addWidget(insertButton);
    QPushButton *lapButton = new QPushButton();
    lapButton->setText(tr("Lap"));
    lapButton->setToolTip(tr("Add a Lap below the highlighted row"));
    row2Layout->addWidget(lapButton);
    connect(lapButton,SIGNAL(clicked()),this,SLOT(lapButtonClicked()));
    layout->addLayout(row1Layout);
    layout->addLayout(row2Layout);
    setLayout(layout);
}
예제 #13
0
LegendTab::LegendTab(QWidget *parent)
  : DialogTab(parent) {

  setupUi(this);

  _single = true;

  _up->setIcon(QPixmap(":kst_uparrow.png"));
  _down->setIcon(QPixmap(":kst_downarrow.png"));
  _add->setIcon(QPixmap(":kst_rightarrow.png"));
  _remove->setIcon(QPixmap(":kst_leftarrow.png"));
  _up->setToolTip(i18n("Raise in list order: Alt+Up"));
  _down->setToolTip(i18n("Lower in list order: Alt+Down"));
  _add->setToolTip(i18n("Select: Alt+s"));
  _remove->setToolTip(i18n("Remove: Alt+r"));

  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));

  connect(_add, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_remove, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_up, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_down, SIGNAL(clicked()), this, SIGNAL(modified()));

  connect(_availableRelationList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_displayedRelationList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_availableRelationList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(addButtonClicked()));
  connect(_displayedRelationList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(removeButtonClicked()));

  connect(_autoContents, SIGNAL(stateChanged(int)), this, SLOT(updateActive()));
  connect(_autoContents, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
  connect(_displayVertically, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));

  connect(_title, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_fontSize, SIGNAL(valueChanged(double)), this, SIGNAL(modified()));
  connect(_bold, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
  connect(_underline, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
  connect(_italic, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
  connect(_family, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified()));

  _displayedRelationList->setSortingEnabled(false);
  _availableRelationList->setSortingEnabled(false);
}
예제 #14
0
int appSQL::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: displayButtonClicked(); break;
        case 1: submitChangedButtonClicked(); break;
        case 2: revertChangedButtonClicked(); break;
        case 3: addButtonClicked(); break;
        case 4: deleteButtonClicked(); break;
        case 5: searchButtonClicked(); break;
        case 6: closeButtonClicked(); break;
        }
        _id -= 7;
    }
    return _id;
}
QList<QToolButton *> ConnectionViewWidget::createToolBarWidgets()
{
    QList<QToolButton *> buttons;

    buttons << new QToolButton();
    buttons.last()->setIcon(QIcon(QStringLiteral(":/connectionview/plus.png")));
    buttons.last()->setToolTip(tr("Add binding or connection"));
    connect(buttons.last(), SIGNAL(clicked()), this, SLOT(addButtonClicked()));
    connect(this, SIGNAL(setEnabledAddButtonChanged(bool)), buttons.last(), SLOT(setEnabled(bool)));

    buttons << new QToolButton();
    buttons.last()->setIcon(QIcon(QStringLiteral(":/connectionview/minus.png")));
    buttons.last()->setToolTip(tr("Remove selected binding or connection"));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Delete));
    connect(buttons.last(), SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
    connect(this, SIGNAL(setEnabledRemoveButtonChanged(bool)), buttons.last(), SLOT(setEnabled(bool)));

    return buttons;
}
예제 #16
0
ChangeFileDialog::ChangeFileDialog(QWidget *parent)
  : QDialog(parent), _dataSource(0), _requestID(0) {
   setupUi(this);

  MainWindow::setWidgetFlags(this);

  if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
    _store = mw->document()->objectStore();
  } else {
     // FIXME: we need the object store
    qFatal("ERROR: can't construct a ChangeFileDialog without the object store");
  }

  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_removeAll, SIGNAL(clicked()), this, SLOT(removeAll()));
  connect(_addAll, SIGNAL(clicked()), this, SLOT(addAll()));

  connect(_changeFilePrimitiveList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(availableDoubleClicked(QListWidgetItem*)));
  connect(_selectedFilePrimitiveList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(selectedDoubleClicked(QListWidgetItem*)));

  connect(_allFromFile, SIGNAL(clicked()), this, SLOT(selectAllFromFile()));

  connect(_changeFilePrimitiveList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_selectedFilePrimitiveList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

  connect(_duplicateSelected, SIGNAL(toggled(bool)), _duplicateDependents, SLOT(setEnabled(bool)));
  connect(_dataFile, SIGNAL(changed(QString)), this, SLOT(fileNameChanged(QString)));
  connect(_dataFile, SIGNAL(destroyed()), kstApp->mainWindow(), SLOT(cleanUpDataSourceList()));

  connect(_buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
  connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked()));
  connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));

  connect(_configure, SIGNAL(clicked()), this, SLOT(showConfigWidget()));
  connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(updatePrimitiveList()));

  _dataFile->setFile(dialogDefaults().value("changedatafile/newFileName",QDir::currentPath()).toString());

  updateButtons();
}
예제 #17
0
DifferentiateCurvesDialog::DifferentiateCurvesDialog(QWidget *parent)
  : QDialog(parent) {
   setupUi(this);

  if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
    _store = mw->document()->objectStore();
  } else {
    // FIXME: we need the object store
    qFatal("ERROR: can't construct a DifferentiateCurvesDialog without the object store");
  }

  resetLists();

  connect(_buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
  connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked()));
  connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));

  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));
  connect(_availableListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_selectedListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

// TODO Icons required.
//  _up->setIcon(QPixmap(":kst_uparrow.png"));
  _up->setText("Up");
//  _down->setIcon(QPixmap(":kst_downarrow.png"));
  _down->setText("Down");
//  _add->setIcon(QPixmap(":kst_rightarrow.png"));
  _add->setText("Add");
//  _remove->setIcon(QPixmap(":kst_leftarrow.png"));
  _remove->setText("Remove");

  _maxLineWidth->setMaximum(LINEWIDTH_MAX);
}
DifferentiateCurvesDialog::DifferentiateCurvesDialog(QWidget *parent)
  : QDialog(parent) {
   setupUi(this);

  if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
    _store = mw->document()->objectStore();
  } else {
    // FIXME: we need the object store
    qFatal("ERROR: can't construct a DifferentiateCurvesDialog without the object store");
  }

  resetLists();

  connect(_buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
  connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked()));
  connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));

  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));
  connect(_availableListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_selectedListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

  // Use the standard icons
  _up->setIcon(QPixmap(":kst_uparrow.png"));
  _down->setIcon(QPixmap(":kst_downarrow.png"));
  _add->setIcon(QPixmap(":kst_rightarrow.png"));
  _remove->setIcon(QPixmap(":kst_leftarrow.png"));
  _up->setToolTip(i18n("Move the selected property up the priority list"));
  _down->setToolTip(i18n("Move the selected property down the priority list"));
  _add->setToolTip(i18n("Add the selected property to the list of properties to cycle through"));
  _remove->setToolTip(i18n("Remove the selected property from the list of properties to cycle through"));

  _maxLineWidth->setMaximum(LINEWIDTH_MAX);
}
void SubTableWidget::on_Add_button1_clicked()
{
    emit addButtonClicked();
}
void ossimQtElevationManagerDialog::setupUi(QDialog *ossimQtElevationManagerDialog)
{
   ossimQtElevationManagerDialog->setObjectName(QString::fromUtf8("ossimQtElevationManagerDialog"));
   vboxLayout = new QVBoxLayout(ossimQtElevationManagerDialog);
   vboxLayout->setSpacing(6);
   vboxLayout->setMargin(11);
   vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
   vboxLayout1 = new QVBoxLayout();
   vboxLayout1->setSpacing(6);
   vboxLayout1->setMargin(0);
   vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
   hboxLayout = new QHBoxLayout();
   hboxLayout->setSpacing(6);
   hboxLayout->setMargin(0);
   hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
   theElevationCellGroup = new QGroupBox(ossimQtElevationManagerDialog);
   theElevationCellGroup->setObjectName(QString::fromUtf8("theElevationCellGroup"));
   // theElevationCellGroup->setColumnLayout(0, Qt::Vertical);
//   theElevationCellGroup->layout()->setSpacing(6);
//   theElevationCellGroup->layout()->setMargin(0);
   gridLayout = new QGridLayout(theElevationCellGroup);//->layout());
   gridLayout->setAlignment(Qt::AlignTop);
   gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
   gridLayout->setMargin(0);
   theElevationListBox = new QListWidget(theElevationCellGroup);
   theElevationListBox->setObjectName(QString::fromUtf8("theElevationListBox"));

   gridLayout->addWidget(theElevationListBox, 0, 0, 1, 1);


   hboxLayout->addWidget(theElevationCellGroup);

   vboxLayout2 = new QVBoxLayout();
   vboxLayout2->setSpacing(6);
   vboxLayout2->setMargin(0);
   vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
   theAddButton = new QPushButton(ossimQtElevationManagerDialog);
   theAddButton->setObjectName(QString::fromUtf8("theAddButton"));

   vboxLayout2->addWidget(theAddButton);

   theAddDirectoryButton = new QPushButton(ossimQtElevationManagerDialog);
   theAddDirectoryButton->setObjectName(QString::fromUtf8("theAddDirectoryButton"));

   vboxLayout2->addWidget(theAddDirectoryButton);

   theRemoveButton = new QPushButton(ossimQtElevationManagerDialog);
   theRemoveButton->setObjectName(QString::fromUtf8("theRemoveButton"));

   vboxLayout2->addWidget(theRemoveButton);

   theRemoveAllButton = new QPushButton(ossimQtElevationManagerDialog);
   theRemoveAllButton->setObjectName(QString::fromUtf8("theRemoveAllButton"));

   vboxLayout2->addWidget(theRemoveAllButton);

   theMoveUpButton = new QPushButton(ossimQtElevationManagerDialog);
   theMoveUpButton->setObjectName(QString::fromUtf8("theMoveUpButton"));

   vboxLayout2->addWidget(theMoveUpButton);

   theMoveDownButton = new QPushButton(ossimQtElevationManagerDialog);
   theMoveDownButton->setObjectName(QString::fromUtf8("theMoveDownButton"));

   vboxLayout2->addWidget(theMoveDownButton);

   theMoveToTopButton = new QPushButton(ossimQtElevationManagerDialog);
   theMoveToTopButton->setObjectName(QString::fromUtf8("theMoveToTopButton"));

   vboxLayout2->addWidget(theMoveToTopButton);

   theMoveToBottomButton = new QPushButton(ossimQtElevationManagerDialog);
   theMoveToBottomButton->setObjectName(QString::fromUtf8("theMoveToBottomButton"));

   vboxLayout2->addWidget(theMoveToBottomButton);

   theMosaicButton = new QPushButton(ossimQtElevationManagerDialog);
   theMosaicButton->setObjectName(QString::fromUtf8("theMosaicButton"));

   vboxLayout2->addWidget(theMosaicButton);

   hboxLayout->addLayout(vboxLayout2);

   vboxLayout1->addLayout(hboxLayout);

   hboxLayout1 = new QHBoxLayout();
   hboxLayout1->setSpacing(6);
   hboxLayout1->setMargin(0);
   hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
   theElevationEnabledCheckBox = new QCheckBox(ossimQtElevationManagerDialog);
   theElevationEnabledCheckBox->setObjectName(QString::fromUtf8("theElevationEnabledCheckBox"));

   hboxLayout1->addWidget(theElevationEnabledCheckBox);

   theAutoLoadCheckBox = new QCheckBox(ossimQtElevationManagerDialog);
   theAutoLoadCheckBox->setObjectName(QString::fromUtf8("theAutoLoadCheckBox"));

   hboxLayout1->addWidget(theAutoLoadCheckBox);

   theAutoSortCheckBox = new QCheckBox(ossimQtElevationManagerDialog);
   theAutoSortCheckBox->setObjectName(QString::fromUtf8("theAutoSortCheckBox"));

   hboxLayout1->addWidget(theAutoSortCheckBox);

   vboxLayout1->addLayout(hboxLayout1);

   vboxLayout3 = new QVBoxLayout();
   vboxLayout3->setSpacing(6);
   vboxLayout3->setMargin(0);
   vboxLayout3->addSpacing(10);
   vboxLayout3->setAlignment(Qt::AlignHCenter);
   vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
   hboxLayout3 = new QHBoxLayout();
   hboxLayout3->setSpacing(0);
   hboxLayout3->setMargin(0);
   hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
   theHgtOffsetLabel = new QLabel("                               Height Offset");
   vboxLayout1->addWidget(theHgtOffsetLabel);
   theElevOffsetWidget = new QSlider(Qt::Horizontal, ossimQtElevationManagerDialog);
   theElevOffsetWidget->setObjectName(QString::fromUtf8("theElevOffsetWidget"));
   theElevOffsetWidget->setSingleStep(1);
   theElevOffsetWidget->setSliderPosition(0);
   theElevOffsetWidget->setPageStep(10);
   theElevOffsetWidget->setRange(-400,400);
   theElevOffsetWidget->setFixedWidth(250);
   theElevOffsetWidget->setTracking(false);
   theHgtOffsetValueLabel = new QLabel("0.0");
   theHgtOffsetValueLabel->setFixedWidth(80);
   theHgtOffsetValueLabel->setAlignment(Qt::AlignHCenter);
   hboxLayout3->addWidget(theElevOffsetWidget);
   hboxLayout3->addWidget(theHgtOffsetValueLabel);

   theAutoRefreshCheckBox = new QCheckBox(ossimQtElevationManagerDialog);
   theAutoRefreshCheckBox->setChecked(false);
   theAutoRefreshCheckBox->setObjectName(QString::fromUtf8("theAutoRefreshCheckBox"));
   hboxLayout3->addWidget(theAutoRefreshCheckBox);
   vboxLayout1->addLayout(hboxLayout3);

   //vboxLayout1->addLayout(vboxLayout3);

   vboxLayout->addLayout(vboxLayout1);

   line1 = new QFrame(ossimQtElevationManagerDialog);
   line1->setObjectName(QString::fromUtf8("line1"));
   line1->setFrameShape(QFrame::HLine);
   line1->setFrameShadow(QFrame::Sunken);

   vboxLayout->addWidget(line1);

   hboxLayout2 = new QHBoxLayout();
   hboxLayout2->setSpacing(6);
   hboxLayout2->setMargin(0);
   hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
   spacerItem = new QSpacerItem(215, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);


   hboxLayout2->addItem(spacerItem);

   theCloseButton = new QPushButton(ossimQtElevationManagerDialog);
   theCloseButton->setObjectName(QString::fromUtf8("theCloseButton"));
   QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(0));
   sizePolicy.setHorizontalStretch(0);
   sizePolicy.setVerticalStretch(0);
   sizePolicy.setHeightForWidth(theCloseButton->sizePolicy().hasHeightForWidth());
   theCloseButton->setSizePolicy(sizePolicy);
   theCloseButton->setDefault(true);
   hboxLayout2->addWidget(theCloseButton);

   spacerItem1 = new QSpacerItem(215, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

   hboxLayout2->addItem(spacerItem1);


   vboxLayout->addLayout(hboxLayout2);


    retranslateUi(ossimQtElevationManagerDialog);

    QSize size(320, 393);
    size = size.expandedTo(ossimQtElevationManagerDialog->minimumSizeHint());
    ossimQtElevationManagerDialog->resize(size);

    QObject::connect(theAddButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(addButtonClicked()));
    QObject::connect(theRemoveButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(removeButtonClicked()));
    QObject::connect(theRemoveAllButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(removeAllButtonClicked()));
    QObject::connect(theCloseButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(closeButtonClicked()));
    QObject::connect(theAddDirectoryButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(addDirectoryClicked()));
    QObject::connect(theElevationEnabledCheckBox, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(elevationEnabledCheckBoxClicked()));
    QObject::connect(theAutoLoadCheckBox, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(autoLoadCheckBoxClicked()));
    QObject::connect(theAutoSortCheckBox, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(autoSortingCheckBoxClicked()));
    QObject::connect(theMosaicButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(mosaicButtonClicked()));
    QObject::connect(theMoveUpButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(moveUpButtonClicked()));
    QObject::connect(theMoveDownButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(moveDownButtonClicked()));
    QObject::connect(theMoveToBottomButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(moveToBottomButtonClicked()));
    QObject::connect(theMoveToTopButton, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(moveToTopButtonClicked()));
    QObject::connect(theElevOffsetWidget, SIGNAL(valueChanged(int)), ossimQtElevationManagerDialog, SLOT(elevOffsetChanged(int)));
    QObject::connect(theAutoRefreshCheckBox, SIGNAL(clicked()), ossimQtElevationManagerDialog, SLOT(autoRefreshCheckBoxClicked()));

    QMetaObject::connectSlotsByName(ossimQtElevationManagerDialog);
    } // setupUi
예제 #21
0
void ItemOrderList::onPushButtonAddClicked()
{
    emit addButtonClicked();
}
예제 #22
0
void IdentityWidget::pbAdd_clicked()
{
	emit addButtonClicked();
}
예제 #23
0
	ui.rating->installEventFilter(this);
	ui.visibility->installEventFilter(this);
	ui.airtemp->installEventFilter(this);
	ui.watertemp->installEventFilter(this);
	ui.dateTimeEdit->installEventFilter(this);
	ui.tagWidget->installEventFilter(this);

	QList<QObject *> statisticsTabWidgets = ui.statisticsTab->children();
	Q_FOREACH(QObject* obj, statisticsTabWidgets) {
		QLabel* label = qobject_cast<QLabel *>(obj);
		if (label)
			label->setAlignment(Qt::AlignHCenter);
	}
	ui.cylinders->setTitle(tr("Cylinders"));
	ui.cylinders->setBtnToolTip(tr("Add Cylinder"));
	connect(ui.cylinders, SIGNAL(addButtonClicked()), this, SLOT(addCylinder_clicked()));

	ui.weights->setTitle(tr("Weights"));
	ui.weights->setBtnToolTip(tr("Add Weight System"));
	connect(ui.weights, SIGNAL(addButtonClicked()), this, SLOT(addWeight_clicked()));

	connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
	connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));

	ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
	ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
	// disabled as this column is pointless outside the disabled planner
	// ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
	completers.buddy = new QCompleter(&buddyModel, ui.buddy);
	completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
	completers.location = new QCompleter(&locationModel, ui.location);
예제 #24
0
	MainPage::MainPage(QWidget* parent)
		: QWidget(parent)
		, search_widget_(new SearchWidget(8, false, this))
		, contact_dialog_(new ContactDialog(this))
        , video_window_(new VideoWindow())
		, video_panel_(new CallPanelMain(this))
		, pages_(new WidgetsNavigator(this))
		, search_contacts_(nullptr)
        , profile_settings_(new ProfileSettingsWidget(this))
        , general_settings_(new GeneralSettingsWidget(this))
        , noContactsYetSuggestions_(nullptr)
        , contact_list_widget_(new ContactList(this, Logic::MembersWidgetRegim::CONTACT_LIST, NULL))
        , add_contact_menu_(0)
    {
        connect(&Utils::InterConnector::instance(), SIGNAL(showNoContactsYetSuggestions()), this, SLOT(showNoContactsYetSuggestions()));
        connect(&Utils::InterConnector::instance(), SIGNAL(hideNoContactsYetSuggestions()), this, SLOT(hideNoContactsYetSuggestions()));

        if (this->objectName().isEmpty())
            this->setObjectName(QStringLiteral("main_page"));
        this->resize(400, 300);
        this->setProperty("Invisible", QVariant(true));
        horizontal_layout_ = new QHBoxLayout(this);
        horizontal_layout_->setSpacing(0);
        horizontal_layout_->setObjectName(QStringLiteral("horizontalLayout"));
        horizontal_layout_->setContentsMargins(0, 0, 0, 0);
        QMetaObject::connectSlotsByName(this);

        QHBoxLayout* originalLayout = qobject_cast<QHBoxLayout*>(layout());
        QVBoxLayout* contactsLayout = new QVBoxLayout();
        contactsLayout->setContentsMargins(0, 0, 0, 0);
        contactsLayout->setSpacing(0);
        assert(video_panel_);
        if (video_panel_) {
            contactsLayout->addWidget(video_panel_);
            video_panel_->hide();
        }

        contactsLayout->addWidget(search_widget_);
        contactsLayout->addWidget(contact_list_widget_);
        QSpacerItem* contactsLayoutSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum);
        contactsLayout->addSpacerItem(contactsLayoutSpacer);

        pages_layout_ = new QVBoxLayout();
        pages_layout_->setContentsMargins(0, 0, 0, 0);
        pages_layout_->setSpacing(0);
        pages_layout_->addWidget(pages_);
        {
            auto pc = pages_->count();
            pages_->addWidget(contact_dialog_);
            pages_->addWidget(profile_settings_);
            pages_->addWidget(general_settings_);
            if (!pc)
                pages_->push(contact_dialog_);
        }
        originalLayout->addLayout(contactsLayout);
        originalLayout->addLayout(pages_layout_);
        QSpacerItem* originalLayoutSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum);
        originalLayout->addSpacerItem(originalLayoutSpacer);
        originalLayout->setAlignment(Qt::AlignLeft);
        setFocus();

        connect(contact_list_widget_, SIGNAL(itemSelected(QString)), contact_dialog_, SLOT(onContactSelected(QString)), Qt::QueuedConnection);
        connect(contact_dialog_, SIGNAL(sendMessage(QString)), contact_list_widget_, SLOT(onSendMessage(QString)), Qt::QueuedConnection);

        connect(contact_list_widget_, SIGNAL(itemSelected(QString)), this, SLOT(onContactSelected(QString)), Qt::QueuedConnection);
        connect(contact_list_widget_, SIGNAL(addContactClicked()), this, SLOT(onAddContactClicked()), Qt::QueuedConnection);

        connect(&Utils::InterConnector::instance(), SIGNAL(profileSettingsShow(QString)), this, SLOT(onProfileSettingsShow(QString)), Qt::QueuedConnection);
        connect(&Utils::InterConnector::instance(), SIGNAL(generalSettingsShow(int)), this, SLOT(onGeneralSettingsShow(int)), Qt::QueuedConnection);
        connect(&Utils::InterConnector::instance(), SIGNAL(profileSettingsBack()), pages_, SLOT(pop()), Qt::QueuedConnection);
        connect(&Utils::InterConnector::instance(), SIGNAL(generalSettingsBack()), pages_, SLOT(pop()), Qt::QueuedConnection);
        connect(&Utils::InterConnector::instance(), SIGNAL(makeSearchWidgetVisible(bool)), search_widget_, SLOT(setVisible(bool)), Qt::QueuedConnection);
        connect(&Utils::InterConnector::instance(), SIGNAL(popPagesToRoot()), pages_, SLOT(poproot()), Qt::QueuedConnection);
        connect(&Utils::InterConnector::instance(), SIGNAL(profileSettingsDoMessage(QString)), contact_list_widget_, SLOT(select(QString)), Qt::QueuedConnection);

        connect(search_widget_, SIGNAL(searchBegin()), this, SLOT(searchBegin()), Qt::QueuedConnection);
        connect(search_widget_, SIGNAL(searchEnd()), this, SLOT(searchEnd()), Qt::QueuedConnection);
        connect(search_widget_, SIGNAL(search(QString)), Logic::GetSearchModel(), SLOT(searchPatternChanged(QString)), Qt::QueuedConnection);
        connect(search_widget_, SIGNAL(enterPressed()), contact_list_widget_, SLOT(searchResult()), Qt::QueuedConnection);
        connect(search_widget_, SIGNAL(upPressed()), contact_list_widget_, SLOT(searchUpPressed()), Qt::QueuedConnection);
        connect(search_widget_, SIGNAL(downPressed()), contact_list_widget_, SLOT(searchDownPressed()), Qt::QueuedConnection);
        connect(search_widget_, SIGNAL(nonActiveButtonPressed()), this, SLOT(addButtonClicked()), Qt::QueuedConnection);
        connect(contact_list_widget_, SIGNAL(searchEnd()), search_widget_, SLOT(searchCompleted()), Qt::QueuedConnection);

        connect(Logic::GetContactListModel(), SIGNAL(selectedContactChanged(QString)), Logic::GetMessagesModel(), SLOT(contactChanged(QString)), Qt::DirectConnection);
        connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipShowVideoWindow(bool)), this, SLOT(onVoipShowVideoWindow(bool)), Qt::DirectConnection);
        connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallIncoming(const std::string&, const std::string&)), this, SLOT(onVoipCallIncoming(const std::string&, const std::string&)), Qt::DirectConnection);
        connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallIncomingAccepted(const voip_manager::ContactEx&)), this, SLOT(onVoipCallIncomingAccepted(const voip_manager::ContactEx&)), Qt::DirectConnection);
        connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallDestroyed(const voip_manager::ContactEx&)), this, SLOT(onVoipCallDestroyed(const voip_manager::ContactEx&)), Qt::DirectConnection);
        connect(&Ui::GetDispatcher()->getVoipController(), SIGNAL(onVoipCallCreated(const voip_manager::ContactEx&)), this, SLOT(onVoipCallCreated(const voip_manager::ContactEx&)), Qt::DirectConnection);

        search_widget_->setVisible(!contact_list_widget_->shouldHideSearch());
	}
예제 #25
0
ChordEdit::ChordEdit(Score* s, QWidget* parent)
   : QDialog(parent)
      {
      _harmony = 0;
      score    = s;

      setupUi(this);
      // note that rootGroup button identifiers map conveniently
      // onto all possible tpc2step return values: don't change
      rootGroup = new QButtonGroup(this);
      rootGroup->addButton(rootC,   0);
      rootGroup->addButton(rootD,   1);
      rootGroup->addButton(rootE,   2);
      rootGroup->addButton(rootF,   3);
      rootGroup->addButton(rootG,   4);
      rootGroup->addButton(rootA,   5);
      rootGroup->addButton(rootB,   6);

      // note that accidentalsGroup button identifiers map conveniently
      // onto all possible tpc2alter return values: don't change
      accidentalsGroup = new QButtonGroup(this);
      accidentalsGroup->addButton(accDFlat,  -2 + 3);
      accidentalsGroup->addButton(accFlat,   -1 + 3);
      accidentalsGroup->addButton(accNone,    0 + 3);
      accidentalsGroup->addButton(accSharp,   1 + 3);
      accidentalsGroup->addButton(accDSharp,  2 + 3);

      extensionGroup = new QButtonGroup(this);
      extensionGroup->addButton(extMaj,    2);
      extensionGroup->addButton(ext2,     15);
      extensionGroup->addButton(extMaj7,   6);
      extensionGroup->addButton(extMaj9,   7);
      extensionGroup->addButton(ext6,      5);
      extensionGroup->addButton(ext69,    14);

      extensionGroup->addButton(extm,     16);
      extensionGroup->addButton(extm7,    19);
      extensionGroup->addButton(extm6,    23);
      extensionGroup->addButton(extm9,    20);
      extensionGroup->addButton(extmMaj7, 18);
      extensionGroup->addButton(extm7b5,  32);
      extensionGroup->addButton(extdim,   33);
      extensionGroup->addButton(ext7,     64);
      extensionGroup->addButton(ext9,     70);
      extensionGroup->addButton(ext13,    65);
      extensionGroup->addButton(ext7b9,   76);
      extensionGroup->addButton(extsus,  184);
      extensionGroup->addButton(ext7Sus, 128);
      extensionGroup->addButton(extOther,  0);

      extOtherCombo->clear();
      ChordList* cl = score->style()->chordList();
      foreach (const ChordDescription* cd, *cl) {
            QString p;
            if (cd->names.isEmpty())
                  p = "?";
            else
                  p = cd->names.front();
            extOtherCombo->addItem(p, cd->id);
            }
      connect(rootGroup, SIGNAL(buttonClicked(int)), SLOT(chordChanged()));
      connect(extensionGroup, SIGNAL(buttonClicked(int)), SLOT(chordChanged()));
      connect(extOtherCombo, SIGNAL(currentIndexChanged(int)), SLOT(chordChanged()));
      connect(accidentalsGroup, SIGNAL(buttonClicked(int)), SLOT(chordChanged()));
      connect(bassNote, SIGNAL(currentIndexChanged(int)), SLOT(chordChanged()));
      connect(extOther, SIGNAL(toggled(bool)), SLOT(otherToggled(bool)));
      connect(addButton, SIGNAL(clicked()), SLOT(addButtonClicked()));
      connect(deleteButton, SIGNAL(clicked()), SLOT(deleteButtonClicked()));

      extOtherCombo->setEnabled(false);

      model = new QStandardItemModel(0, 3);
      model->setHeaderData(0, Qt::Horizontal, tr("Type"));
      model->setHeaderData(1, Qt::Horizontal, tr("Value"));
      model->setHeaderData(2, Qt::Horizontal, tr("Alter"));

      connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                     SLOT(modelDataChanged(QModelIndex,QModelIndex)));

      degreeTable->setModel(model);
      delegate = new DegreeTabDelegate;
      degreeTable->setItemDelegate(delegate);
      degreeTable->setColumnWidth(0, 80);
      degreeTable->setColumnWidth(1, 71);
      degreeTable->setColumnWidth(2, 71);
      }
예제 #26
0
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
	weightModel(new WeightModel(this)),
	cylindersModel(new CylindersModel(this)),
	editMode(NONE),
	copyPaste(false),
	currentTrip(0)
{
	ui.setupUi(this);

	extraWidgets << new TabDiveInformation();
	ui.tabWidget->addTab(extraWidgets.last(), tr("Information"));
	extraWidgets << new TabDiveStatistics();
	ui.tabWidget->addTab(extraWidgets.last(), tr("Statistics"));
	extraWidgets << new TabDivePhotos();
	ui.tabWidget->addTab(extraWidgets.last(), tr("Photos"));
	extraWidgets << new TabDiveExtraInfo();
	ui.tabWidget->addTab(extraWidgets.last(), tr("Extra Info"));

	ui.dateEdit->setDisplayFormat(prefs.date_format);

	memset(&displayed_dive, 0, sizeof(displayed_dive));
	memset(&displayedTrip, 0, sizeof(displayedTrip));

	// This makes sure we only delete the models
	// after the destructor of the tables,
	// this is needed to save the column sizes.
	cylindersModel->setParent(ui.cylinders);
	weightModel->setParent(ui.weights);

	ui.cylinders->setModel(cylindersModel);
	ui.weights->setModel(weightModel);
	closeMessage();

	connect(ui.editDiveSiteButton, SIGNAL(clicked()), MainWindow::instance(), SIGNAL(startDiveSiteEdit()));
	connect(ui.location, &DiveLocationLineEdit::entered, MapWidget::instance(), &MapWidget::centerOnIndex);
	connect(ui.location, &DiveLocationLineEdit::currentChanged, MapWidget::instance(), &MapWidget::centerOnIndex);

	QAction *action = new QAction(tr("Apply changes"), this);
	connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
	addMessageAction(action);

	action = new QAction(tr("Discard changes"), this);
	connect(action, SIGNAL(triggered(bool)), this, SLOT(rejectChanges()));
	addMessageAction(action);

	QShortcut *closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), this);
	connect(closeKey, SIGNAL(activated()), this, SLOT(escDetected()));

	if (qApp->style()->objectName() == "oxygen")
		setDocumentMode(true);
	else
		setDocumentMode(false);

	// we start out with the fields read-only; once things are
	// filled from a dive, they are made writeable
	setEnabled(false);

	ui.cylinders->setTitle(tr("Cylinders"));
	ui.cylinders->setBtnToolTip(tr("Add cylinder"));
	connect(ui.cylinders, SIGNAL(addButtonClicked()), this, SLOT(addCylinder_clicked()));

	ui.weights->setTitle(tr("Weights"));
	ui.weights->setBtnToolTip(tr("Add weight system"));
	connect(ui.weights, SIGNAL(addButtonClicked()), this, SLOT(addWeight_clicked()));

	// This needs to be the same order as enum dive_comp_type in dive.h!
	ui.DiveType->insertItems(0, QStringList() << tr("OC") << tr("CCR") << tr("pSCR") << tr("Freedive"));
	connect(ui.DiveType, SIGNAL(currentIndexChanged(int)), this, SLOT(divetype_Changed(int)));

	connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
	connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));

	ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
	ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::USE, new TankUseDelegate(this));
	ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
	ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
	completers.buddy = new QCompleter(&buddyModel, ui.buddy);
	completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
	completers.suit = new QCompleter(&suitModel, ui.suit);
	completers.tags = new QCompleter(&tagModel, ui.tagWidget);
	completers.buddy->setCaseSensitivity(Qt::CaseInsensitive);
	completers.divemaster->setCaseSensitivity(Qt::CaseInsensitive);
	completers.suit->setCaseSensitivity(Qt::CaseInsensitive);
	completers.tags->setCaseSensitivity(Qt::CaseInsensitive);
	ui.buddy->setCompleter(completers.buddy);
	ui.divemaster->setCompleter(completers.divemaster);
	ui.suit->setCompleter(completers.suit);
	ui.tagWidget->setCompleter(completers.tags);
	ui.diveNotesMessage->hide();
	ui.depth->hide();
	ui.depthLabel->hide();
	ui.duration->hide();
	ui.durationLabel->hide();
	setMinimumHeight(0);
	setMinimumWidth(0);

	// Current display of things on Gnome3 looks like shit, so
	// let`s fix that.
	if (isGnome3Session()) {
		QPalette p;
		p.setColor(QPalette::Window, QColor(Qt::white));
		ui.scrollArea->viewport()->setPalette(p);
		ui.scrollArea_2->viewport()->setPalette(p);

		// GroupBoxes in Gnome3 looks like I'v drawn them...
		static const QString gnomeCss(
			"QGroupBox {"
			"    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
			"    stop: 0 #E0E0E0, stop: 1 #FFFFFF);"
			"    border: 2px solid gray;"
			"    border-radius: 5px;"
			"    margin-top: 1ex;"
			"}"
			"QGroupBox::title {"
			"    subcontrol-origin: margin;"
			"    subcontrol-position: top center;"
			"    padding: 0 3px;"
			"    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
			"    stop: 0 #E0E0E0, stop: 1 #FFFFFF);"
			"}");
		Q_FOREACH (QGroupBox *box, findChildren<QGroupBox *>()) {
			box->setStyleSheet(gnomeCss);
		}
	}
bool AMDatamanAppControllerForActions2::startupCreateUserInterface()
{
	AMErrorMon::information(this, AMDATAMANAPPCONTROLLER_STARTUP_MESSAGES, "Acquaman Startup: Populating User Interface");
	qApp->processEvents();
	settingsMasterView_ = 0;
	issueSubmissionView_ = 0;
	bottomBar_ = new AMBottomBar();
	// These buttons are never used.  Hiding them.
	bottomBar_->fullScreenButton->hide();
	bottomBar_->adjustScanFinishButton->hide();
	bottomBar_->restartScanButton->hide();
	mw_->addBottomWidget(bottomBar_);
	connect(bottomBar_, SIGNAL(addButtonClicked()), this, SLOT(onAddButtonClicked()));
	connect(bottomBar_, SIGNAL(pauseScanIssued()), this, SIGNAL(pauseScanIssued()));
	connect(bottomBar_, SIGNAL(resumeScanIssued()), this, SIGNAL(resumeScanIssued()));
	connect(bottomBar_, SIGNAL(stopScanIssued()), this, SIGNAL(stopScanIssued()));

	// Create panes in the main window:
	////////////////////////////////////

	// A heading for the scan editors
	scanEditorsParentItem_ = mw_->windowPaneModel()->headingItem("Open Scans");


	// Make a dataview widget and add it under two links/headings: "Runs" and "Experiments". See AMMainWindowModel for more information.
	////////////////////////////////////
	dataView_ = new AMDataViewWithActionButtons();
	dataView_->setWindowTitle("Data");

	QStandardItem* dataViewItem = new QStandardItem();
	dataViewItem->setData(qVariantFromValue((QWidget*)dataView_), AM::WidgetRole);
	dataViewItem->setFlags(Qt::ItemIsEnabled);	// enabled, but should not be selectable
	QFont font = QFont("Lucida Grande", 10, QFont::Bold);
	font.setCapitalization(QFont::AllUppercase);
	dataViewItem->setFont(font);
	dataViewItem->setData(QBrush(QColor::fromRgb(100, 109, 125)), Qt::ForegroundRole);
	dataViewItem->setData(true, AMWindowPaneModel::DockStateRole);

	mw_->windowPaneModel()->appendRow(dataViewItem);

	runsParentItem_ = new QStandardItem(QIcon(":/22x22/view_calendar_upcoming_days.png"), "Runs");
	mw_->windowPaneModel()->initAliasItem(runsParentItem_, dataViewItem, "Runs", -1);
	dataViewItem->appendRow(runsParentItem_);
	experimentsParentItem_ = new QStandardItem(QIcon(":/applications-science.png"), "Experiments");
	mw_->windowPaneModel()->initAliasItem(experimentsParentItem_, dataViewItem, "Experiments", -1);
	dataViewItem->appendRow(experimentsParentItem_);

	// Hook into the sidebar and add Run and Experiment links below these headings.
	runExperimentInsert_ = new AMRunExperimentInsert(AMDatabase::database("user"), runsParentItem_, experimentsParentItem_, this);
	connect(runExperimentInsert_, SIGNAL(newExperimentAdded(QModelIndex)), this, SLOT(onNewExperimentAdded(QModelIndex)));

	// connect the activated signal from the dataview to our own slot
	connect(dataView_, SIGNAL(selectionActivated(QList<QUrl>)), this, SLOT(onDataViewItemsActivated(QList<QUrl>)));
	connect(dataView_, SIGNAL(selectionActivatedSeparateWindows(QList<QUrl>)), this, SLOT(onDataViewItemsActivatedSeparateWindows(QList<QUrl>)));
	connect(dataView_, SIGNAL(selectionExported(QList<QUrl>)), this, SLOT(onDataViewItemsExported(QList<QUrl>)));
	connect(dataView_, SIGNAL(launchScanConfigurationsFromDb(QList<QUrl>)), this, SLOT(onLaunchScanConfigurationsFromDb(QList<QUrl>)));
	connect(dataView_, SIGNAL(fixCDF(QUrl)), this, SLOT(fixCDF(QUrl)));

	// When 'alias' links are clicked in the main window sidebar, we might need to notify some widgets of the details
	connect(mw_, SIGNAL(aliasItemActivated(QWidget*,QString,QVariant)), this, SLOT(onMainWindowAliasItemActivated(QWidget*,QString,QVariant)));
	/////////////////////////

	// Make connections:
	//////////////////////////////

	connect(mw_, SIGNAL(currentPaneChanged(QWidget*)), this, SLOT(onCurrentPaneChanged(QWidget*)));

	// show main window
	mw_->show();

	return true;
}