Example #1
1
LocationEditor::LocationEditor(QWidget *parent) :
    QToolButton(parent)
{
    QPalette pal;
    pal.setColor(backgroundRole(), QPalette::Base);
    setPalette(pal);

    this->setFont(global.getGuiFont(font()));

    inactiveColor = "QToolButton {background-color: transparent; border-radius: 0px; border:none; margin 0px; padding: 4px} ";
    this->setCursor(Qt::PointingHandCursor);
    this->setStyleSheet(inactiveColor);

    defaultText = QString(tr("Click to set location..."));
    this->setText(defaultText);
    actionMenu = new QMenu();
    editAction = actionMenu->addAction(tr("Edit..."));
    clearAction = actionMenu->addAction(tr("Clear"));
    viewAction = actionMenu->addAction(tr("View on map"));
    connect(editAction, SIGNAL(triggered()), this, SLOT(buttonClicked()));
    connect(viewAction, SIGNAL(triggered()), this, SLOT(viewClicked()));
    connect(clearAction, SIGNAL(triggered()), this, SLOT(clearClicked()));
    setAutoRaise(false);
    setMenu(actionMenu);
    this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    this->reloadIcons();
    connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));

    hide();
}
Example #2
1
TItemSelector::TItemSelector(QWidget *parent) : QWidget(parent), k(new Private)
{
    QHBoxLayout *layout = new QHBoxLayout;

    k->available = new QListWidget;

    layout->addWidget(k->available);

    QVBoxLayout *controlBox = new QVBoxLayout;
    controlBox->setSpacing(0);
    controlBox->setMargin(2);
    controlBox->addStretch();

    QToolButton *nextButton = new QToolButton;
    nextButton->setIcon(QPixmap(THEME_DIR + "icons/export_scene.png"));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(addCurrent()));

    controlBox->addWidget(nextButton);
    controlBox->setSpacing(5);

    QToolButton *previousButton = new QToolButton;
    previousButton->setIcon(QPixmap(THEME_DIR + "icons/unexport_scene.png"));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(removeCurrent()));

    controlBox->addWidget(previousButton);
    controlBox->addStretch();

    layout->addLayout(controlBox);

    k->selected = new QListWidget;
    layout->addWidget(k->selected);

    setLayout(layout);
}
Example #3
1
EcXmlEditorWidget::EcXmlEditorWidget(Foundation::Framework *framework, QWidget *parent) :
    QWidget(parent), framework_(framework), xmlEdit_(0)
{
    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setObjectName("mainlayout");
    layout->setContentsMargins(0,0,0,0);
    setLayout(layout);
    setWindowTitle(tr("EC Attribute XML Editor"));
    resize(300, 300);

    xmlEdit_ = new QTextEdit(this);
    layout->addWidget(xmlEdit_);

    QHBoxLayout *hlayout = new QHBoxLayout;
    hlayout->setObjectName("buttonlayout");

    QSpacerItem *spacer = new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Minimum);
    hlayout->addSpacerItem(spacer);

    QPushButton *saveButton = new QPushButton(tr("Save"), this);
    connect(saveButton, SIGNAL(pressed()), this, SLOT(Save()));
    hlayout->addWidget(saveButton);

    QPushButton *revertButton = new QPushButton(tr("Revert"), this);
    connect(revertButton, SIGNAL(pressed()), this, SLOT(Revert()));
    hlayout->addWidget(revertButton);

    layout->addLayout(hlayout);

    setAttribute(Qt::WA_DeleteOnClose);
}
Example #4
1
void PathEnterWidget::setup()
{
    mpLineEdit->setAcceptDrops( false );
    connect( mpLineEdit, SIGNAL(textChanged(QString)),
             this, SIGNAL(textChanged(QString)) );
    connect( mpLineEdit, SIGNAL(textEdited(QString)),
             this, SIGNAL(textEdited(QString)) );
    connect( mpLineEdit, SIGNAL(returnPressed()),
             this, SIGNAL(returnPressed()) );

    QPushButton *button = new QPushButton( "...", this );
    button->setMaximumWidth( button->height() );
    connect( button, SIGNAL(clicked()),
             this, SLOT(browse()) );
    connect( mpLineEdit, SIGNAL(returnPressed()),
             this, SLOT(sendFileName()) );

    QCompleter *completer = new QCompleter( this );
    completer->setModel( mpDirModel );
    mpDirModel->setFilter( QDir::AllDirs | QDir::NoDotAndDotDot );
    mpDirModel->setSorting( QDir::Name );
    mpLineEdit->setCompleter( completer );

    QBoxLayout *layout = new QHBoxLayout( this );
    layout->setContentsMargins( 0, 0, 0, 0 );
    layout->addWidget( mpLineEdit );
    layout->addWidget( button );
    setLayout( layout );

    setAcceptDrops( true );
}
Example #5
1
sql_editor::sql_editor(QWidget* parent): QDialog(parent)
{
    QVBoxLayout *topLayout = new QVBoxLayout( this );
    topLayout->setSpacing(5);
    topLayout->setMargin(5);

    m_edit=new QPlainTextEdit(this);
//  m_edit->setWordWrap(QMultiLineEdit::FixedColumnWidth);
//  m_edit->setWrapColumnOrWidth(40);
    m_edit->setTabChangesFocus(true);

    topLayout->addWidget(m_edit);

    QHBoxLayout* buttons = new QHBoxLayout();
    topLayout->addLayout(buttons);
    QPushButton* w = new QPushButton(tr("OK"), this);
    connect(w, SIGNAL(clicked()), this, SLOT(save_close()));

    QPushButton* w2 = new QPushButton(tr("Help"), this);
    connect(w2, SIGNAL(clicked()), this, SLOT(help()));

    QPushButton* w1 = new QPushButton(tr("Cancel"), this);
    connect(w1, SIGNAL(clicked()), this, SLOT(cancel()));

    QPushButton* btns[]= {w,w2,w1};
    for (int i=0; i<3; i++) {
        buttons->addStretch(10);
        buttons->addWidget(btns[i]);
    }
    buttons->addStretch(10);
    //  topLayout->addLayout (buttons, 10);
    setWindowTitle(tr("SQL subquery"));
    resize(500, 200);
}
Example #6
1
void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel* filterModel )
{
    if ( mFilterModel )
    {
        // Cleanup old model stuff if present
        disconnect( mFilterModel, SIGNAL( filterAboutToBeInvalidated() ), this, SLOT( onFilterAboutToBeInvalidated() ) );
        disconnect( mFilterModel, SIGNAL( filterInvalidated() ), this, SLOT( onFilterInvalidated() ) );
    }

    mFilterModel = filterModel;
    QTableView::setModel( filterModel );

    connect( mFilterModel, SIGNAL( destroyed() ), this, SLOT( modelDeleted() ) );

    delete mFeatureSelectionModel;
    mFeatureSelectionModel = 0;

    if ( filterModel )
    {
        if ( !mFeatureSelectionManager )
        {
            mFeatureSelectionManager = new QgsVectorLayerSelectionManager( mFilterModel->layer(), mFilterModel );
        }

        mFeatureSelectionModel = new QgsFeatureSelectionModel( mFilterModel, mFilterModel, mFeatureSelectionManager, mFilterModel );
        setSelectionModel( mFeatureSelectionModel );
        mTableDelegate->setFeatureSelectionModel( mFeatureSelectionModel );
        connect( mFeatureSelectionModel, SIGNAL( requestRepaint( QModelIndexList ) ), this, SLOT( repaintRequested( QModelIndexList ) ) );
        connect( mFeatureSelectionModel, SIGNAL( requestRepaint() ), this, SLOT( repaintRequested() ) );
    }
}
Example #7
0
string ClsFEDataSampler::addStateVariableDisplay(ClsFEGroup* _clsFEGroup, string strRange) {
#ifdef DEBUG_CLSFEDATASAMPLER
    cout << "ClsFEDataSampler::addStateVariableDisplay(ClsFEGroup* _clsFEGroup, string strRange)" << endl;
    cout << "strRange: " << strRange << endl;
#endif

    /* 2004/11/25:
       prefix the random id by the group name: this should preserve the order in which the data is written to disk */
    string strDisplayID = _clsFEGroup->getGroupID() + ClsIDGenerator::Instance()->Next();//.latin1();
//    string strDisplayID = ClsIDGenerator::Instance()->Next();//.latin1();
//    cout << "@@strDisplayID: " << strDisplayID << endl;



    ClsQNeuronStateVariableDisplay * clsQNeuronStateVariableDisplay = new ClsQNeuronStateVariableDisplay(this, strDisplayID, qframeStateVariableDisplays, _clsFEGroup, strRange, true, true, false, true, true);
    connect(clsQNeuronStateVariableDisplay,SIGNAL(addDisplay(string, list<string>, string )),this, SLOT(addStateVariableDisplay(string, list<string>, string)));
    connect(clsQNeuronStateVariableDisplay,SIGNAL(sigClose(string)),this, SLOT(removeStateVariableDisplay(string)));

    pair<string, ClsQNeuronStateVariableDisplay*> pairTemp(strDisplayID, clsQNeuronStateVariableDisplay);
    mapStateVariableDisplays.insert(pairTemp);
    boxlayoutStateFrames->addWidget(clsQNeuronStateVariableDisplay);


    checkState();

    return strDisplayID;
};
Example #8
0
/*
 *  Constructs a dspSummarizedSalesHistoryByShippingZone as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspSummarizedSalesHistoryByShippingZone::dspSummarizedSalesHistoryByShippingZone(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
    connect(_close, SIGNAL(clicked()), this, SLOT(close()));
    connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
    connect(_selectedShippingZone, SIGNAL(toggled(bool)), _shipZone, SLOT(setEnabled(bool)));

    _productCategory->setType(ProductCategory);

    _shipZone->populate( "SELECT shipzone_id, (shipzone_name || '-' || shipzone_descrip) "
                         "FROM shipzone "
                         "ORDER BY shipzone_name;" );

    _sohist->addColumn(tr("Zone"),        _itemColumn,  Qt::AlignCenter );
    _sohist->addColumn(tr("Customer"),    200,          Qt::AlignLeft   );
    _sohist->addColumn(tr("Item Number"), _itemColumn,  Qt::AlignLeft   );
    _sohist->addColumn(tr("Description"), -1,           Qt::AlignLeft   );
    _sohist->addColumn(tr("Shipped"),     _qtyColumn,   Qt::AlignRight  );
    _sohist->addColumn(tr("Ext. Price"),  _moneyColumn, Qt::AlignRight  );
}
Example #9
0
// === SurfaceViewerDemo =================================================== //
// --- Construction and Destruction ---------------------------------------- //
SurfaceViewerDemo::SurfaceViewerDemo(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::SurfaceViewerDemo)
{
    // setup ui
    ui->setupUi(this);
    ui->colorModeComboBox->setCurrentIndex(4);

    // connect slots
    connect(ui->actionOpen, SIGNAL(triggered()), SLOT(openFile()));
    connect(ui->actionClose, SIGNAL(triggered()), SLOT(closeFile()));
    connect(ui->actionQuit, SIGNAL(triggered()), SLOT(quit()));
    connect(ui->surfaceTypeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(surfaceTypeChanged(int)));
    connect(ui->colorModeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(colorModeChanged(int)));
    connect(ui->opacitySlider, SIGNAL(valueChanged(int)), SLOT(opacitySliderChanged(int)));
    connect(ui->probeRadiusSpinBox, SIGNAL(valueChanged(double)), SLOT(probeRadiusChanged(double)));

    // setup graphics view
    m_moleculeItem = new chemkit::GraphicsMoleculeItem;
    ui->graphicsView->addItem(m_moleculeItem);

    m_molecularSurfaceItem = new chemkit::GraphicsMolecularSurfaceItem;
    m_molecularSurfaceItem->setSurfaceType(chemkit::MolecularSurface::VanDerWaals);
    ui->graphicsView->addItem(m_molecularSurfaceItem);
}
Example #10
0
/*
 *  Constructs a dspItemSitesByParameterList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspItemSitesByParameterList::dspItemSitesByParameterList(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

//  (void)statusBar();

    // signals and slots connections
    connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
    connect(_close, SIGNAL(clicked()), this, SLOT(close()));
    connect(_itemsite, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
    connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));

    _parameter->setType(ParameterGroup::ClassCode);

    _itemsite->addColumn(tr("Site"),          _whsColumn,   Qt::AlignCenter, true,  "warehous_code" );
    _itemsite->addColumn(tr("Item Number"),   _itemColumn,  Qt::AlignLeft,   true,  "item_number"   );
    _itemsite->addColumn(tr("Description"),   -1,           Qt::AlignLeft,   true,  "description"   );
    _itemsite->addColumn(tr("UOM"),           _uomColumn,   Qt::AlignCenter, true,  "uom_name" );
    _itemsite->addColumn(tr("QOH"),           _qtyColumn,   Qt::AlignRight,  true,  "itemsite_qtyonhand"  );
    _itemsite->addColumn(tr("Loc. Cntrl."),   _dateColumn,  Qt::AlignCenter, true,  "loccntrl" );
    _itemsite->addColumn(tr("Cntrl. Meth."),  _dateColumn,  Qt::AlignCenter, true,  "controlmethod" );
    _itemsite->addColumn(tr("Sold Ranking"),  _dateColumn,  Qt::AlignCenter, true,  "soldranking" );
    _itemsite->addColumn(tr("ABC Class"),     _dateColumn,  Qt::AlignCenter, true,  "itemsite_abcclass" );
    _itemsite->addColumn(tr("Cycle Cnt."),    _dateColumn,  Qt::AlignCenter, true,  "itemsite_cyclecountfreq" );
    _itemsite->addColumn(tr("Last Cnt'd"),    _dateColumn,  Qt::AlignCenter, true,  "datelastcount" );
    _itemsite->addColumn(tr("Last Used"),     _dateColumn,  Qt::AlignCenter, true,  "datelastused" );
}
Example #11
0
VideoItem::VideoItem(Video *vid, ShowFunction *func)
    : ShowItem(func)
    , m_video(vid)
    , m_fullscreenAction(NULL)
{
    Q_ASSERT(vid != NULL);

    if (func->color().isValid())
        setColor(func->color());
    else
        setColor(ShowFunction::defaultColor(Function::Video));

    if (func->duration() == 0)
        func->setDuration(m_video->totalDuration());

    calculateWidth();
    connect(m_video, SIGNAL(changed(quint32)),
            this, SLOT(slotVideoChanged(quint32)));
    connect(m_video, SIGNAL(totalTimeChanged(qint64)),
            this, SLOT(slotVideoDurationChanged(qint64)));

    m_fullscreenAction = new QAction(tr("Fullscreen"), this);
    m_fullscreenAction->setCheckable(true);
    if (m_video->fullscreen() == true)
        m_fullscreenAction->setChecked(true);
    connect(m_fullscreenAction, SIGNAL(toggled(bool)),
            this, SLOT(slotFullscreenToggled(bool)));
}
Example #12
0
HTML5PermissionsNotification::HTML5PermissionsNotification(const QString &host, QWebFrame* frame, const QWebPage::Feature &feature)
    : AnimatedWidget(AnimatedWidget::Down, 300, 0)
    , ui(new Ui::HTML5PermissionsNotification)
    , m_host(host)
    , m_frame(frame)
    , m_feature(feature)
{
    setAutoFillBackground(true);
    ui->setupUi(widget());

    ui->close->setIcon(qIconProvider->standardIcon(QStyle::SP_DialogCloseButton));

    QString message;
    QString site = m_host.isEmpty() ? tr("this site") : QString("<b>%1</b>").arg(m_host);

    if (feature == QWebPage::Notifications) {
        ui->iconLabel->setPixmap(QPixmap(":icons/other/notification.png"));
        message = tr("Allow %1 to show desktop notifications?").arg(site);
    }
    else if (feature == QWebPage::Geolocation) {
        ui->iconLabel->setPixmap(QPixmap(":icons/other/geolocation.png"));
        message = tr("Allow %1 to locate your position?").arg(site);
    }

    ui->textLabel->setText(message);

    connect(ui->allow, SIGNAL(clicked()), this, SLOT(grantPermissions()));
    connect(ui->deny, SIGNAL(clicked()), this, SLOT(denyPermissions()));
    connect(ui->close, SIGNAL(clicked()), this, SLOT(denyPermissions()));

    startAnimation();
}
Example #13
0
ProfileWizard::ProfileWizard(TKeyhoteeApplication& mainApp) :
    QWizard(nullptr),
    _mainApp(mainApp)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setOption(HaveHelpButton, true);

    QWizardPage* intro_page = new QWizardPage(this);
    intro_page->setTitle(tr("Welcome to Keyhotee") );
    _profile_intro_ui = new Ui::IntroPage();
    _profile_intro_ui->setupUi(intro_page);

//  _nym_page = new NymPage(this);
    _profile_edit = new ProfileEditPage(this);

    connect(this, &ProfileWizard::helpRequested, this, &ProfileWizard::showHelp);
    connect(this, &ProfileWizard::accepted, this, &ProfileWizard::createProfile);

    setPage(Page_Intro, intro_page);
    setPage(Page_Profile, _profile_edit);
//  setPage(Page_FirstNym, _nym_page);

    setStartId(Page_Intro);

#ifndef Q_WS_MAC
    setWizardStyle(ModernStyle);
#else
    setWizardStyle(MacStyle);
#endif
}
Example #14
0
AVFilterConfigPage::AVFilterConfigPage(QWidget *parent)
    : ConfigPageBase(parent)
{
    setObjectName(QString::fromLatin1("avfilter"));
    QGridLayout *gl = new QGridLayout();
    setLayout(gl);
    gl->setSizeConstraint(QLayout::SetFixedSize);
    int r = 0;
    m_ui[0].type = tr("Video");
    m_ui[1].type = tr("Audio");
    const int mw = 300;
    for (size_t i = 0; i < sizeof(m_ui)/sizeof(m_ui[0]); ++i) {
        m_ui[i].enable = new QCheckBox(tr("Enable") + QString::fromLatin1(" ") + m_ui[i].type);
        gl->addWidget(m_ui[i].enable, r++, 0);
        m_ui[i].name = new QComboBox();
        m_ui[i].name->setToolTip(QString::fromLatin1("%1 %2 %3").arg(tr("Registered")).arg(m_ui[i].type).arg(tr("filters")));
        gl->addWidget(m_ui[i].name, r++, 0);
        m_ui[i].description = new QLabel();
        m_ui[i].description->setMaximumWidth(mw);
        gl->addWidget(m_ui[i].description, r++, 0);
        gl->addWidget(new QLabel(tr("Parameters")), r++, 0);
        m_ui[i].options = new QTextEdit();
        m_ui[i].options->setMaximumWidth(mw);
        m_ui[i].options->setMaximumHeight(mw/6);
        gl->addWidget(m_ui[i].options, r++, 0);
    }
    applyToUi();
    m_ui[0].options->setToolTip(QString::fromLatin1("example: negate"));
    m_ui[1].options->setToolTip(QString::fromLatin1("example: volume=volume=2.0"));
    connect(m_ui[0].name, SIGNAL(currentIndexChanged(QString)), SLOT(videoFilterChanged(QString)));
    m_ui[0].name->addItems(QtAV::LibAVFilter::videoFilters());
    connect(m_ui[1].name, SIGNAL(currentIndexChanged(QString)), SLOT(audioFilterChanged(QString)));
    m_ui[1].name->addItems(QtAV::LibAVFilter::audioFilters());
}
Example #15
0
UpdateDialog::UpdateDialog(QWidget *parent)
    : QDialog(parent),
      ui(new Ui::UpdateDialog),
      _codec(QTextCodec::codecForName("UTF-8")),
      _handler(new UpdateHandler()),
      _request(new NetworkRequest(this)),
      _silent(true)
{
    setWindowModality(Qt::WindowModal);

    ui->setupUi(this);

    ui->labelIconDate->setPixmap(QIcon::fromTheme("x-office-calendar").pixmap(22));
    ui->labelIconDev->setPixmap(QIcon::fromTheme("applications-development").pixmap(22));
    ui->labelIconInfo->setPixmap(QIcon::fromTheme("dialog-information").pixmap(22));
    ui->labelIconLatest->setPixmap(QIcon::fromTheme("dialog-ok").pixmap(22));
    ui->labelIconNew->setPixmap(QIcon::fromTheme("dialog-ok").pixmap(22));
    ui->labelIconOld->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(22));
    ui->labelIconStable->setPixmap(QIcon::fromTheme("dialog-ok").pixmap(22));

    ui->buttonDownload->hide();

    connect(ui->buttonClose, SIGNAL(clicked()), this, SLOT(close()));
    connect(ui->buttonDownload, SIGNAL(clicked()), this, SLOT(download()));
    connect(ui->buttonChangelog, SIGNAL(clicked()), this, SLOT(changelog()));
    connect(ui->buttonBack, SIGNAL(clicked()), this, SLOT(changelogBack()));

    connect(_request, SIGNAL(result(QByteArray, QNetworkReply *)), this, SLOT(readUpdates(QByteArray, QNetworkReply *)));
}
Example #16
0
InputProfileEditor::InputProfileEditor(QWidget* parent, QLCInputProfile* profile)
    : QDialog(parent)
    , m_wizardActive(false)
    , m_latestItem(NULL)
{
    setupUi(this);

    /* Connect the buttons to slots */
    connect(m_addButton, SIGNAL(clicked()),
            this, SLOT(slotAddClicked()));
    connect(m_removeButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveClicked()));
    connect(m_editButton, SIGNAL(clicked()),
            this, SLOT(slotEditClicked()));
    connect(m_wizardButton, SIGNAL(clicked(bool)),
            this, SLOT(slotWizardClicked(bool)));
    connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotEditClicked()));

    /* Listen to input data */
    connect(_app->inputMap(), SIGNAL(inputValueChanged(quint32, quint32, uchar)),
            this, SLOT(slotInputValueChanged(quint32, quint32, uchar)));

    if (profile == NULL)
    {
        m_profile = new QLCInputProfile();
    }
    else
    {
        m_profile = new QLCInputProfile(*profile);
        if ((QFile::permissions(m_profile->path()) &
                QFile::WriteUser) == 0)
        {
            QMessageBox::warning(this, tr("File not writable"),
                                 tr("You do not have permission to write to "
                                    "the file %1. You might not be able to "
                                    "save your modifications to the profile.")
                                 .arg(QDir::toNativeSeparators(
                                          m_profile->path())));
        }
    }

    /* Profile manufacturer & model */
    m_manufacturerEdit->setText(m_profile->manufacturer());
    m_modelEdit->setText(m_profile->model());

    /* Fill up the tree with profile's channels */
    fillTree();

    /* Timer that clears the input data icon after a while */
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));

    QSettings settings;
    QVariant var = settings.value(SETTINGS_GEOMETRY);
    if (var.isValid() == true)
        restoreGeometry(var.toByteArray());
    AppUtil::ensureWidgetIsVisible(this);
}
TimeEntryDialog::TimeEntryDialog( QWidget * parent )
    : QDialog( parent )
{
    setupUi( this );

    mAssetModel = new ElementModel( mAssetTree );
    mAssetModel->setSecondColumnIsLocation( true );
    mAssetTree->setModel( mAssetModel );

//	mCalendarButton->hide();

    connect( mChooseStartDateButton, SIGNAL( clicked() ), SLOT( chooseStartDate() ) );
    connect( mChooseEndDateButton, SIGNAL( clicked() ), SLOT( chooseEndDate() ) );
    connect( mProjectCombo, SIGNAL( activated( const QString & ) ), SLOT( projectSelected( const QString & ) ) );
    connect( mTypeCombo, SIGNAL( currentChanged( const Record & ) ), SLOT( assetTypeChanged( const Record & ) ) );
    connect( mAssetFilterEdit, SIGNAL( textChanged( const QString & ) ), SLOT( slotFilterAssets() ) );

    setDateRange( QDate::currentDate() );
    ProjectList pl = Project::select().filter( "fkeyProjectStatus", 4 ).sorted( "name" );
    mProject = pl[0];
    mProjectCombo->addItems( pl.names() );

    mTypeCombo->setTagFilters( QStringList() << "timesheet" );
    mTypeCombo->setShowFirst( User::currentUser().roles() );
    mAssetType = mTypeCombo->current();
    mUser = User::currentUser();

    mForcedProjectCategories += "Vacation";
    mForcedProjectCategories += "Sick";
    mForcedProjectCategories += "Comp Time";
    mForcedProjectCategories += "Unpaid Leave";
    mForcedProjectCategories += "Holidays";

    mVirtualProject = Project::recordByName( "_virtual_project" );
}
void TextEdit::setupEditActions()
{
    QToolBar *tb = new QToolBar( this );
    QPopupMenu *menu = new QPopupMenu( this );
    menuBar()->insertItem( tr( "&Edit" ), menu );

    QAction *a;
    a = new QAction( tr( "Undo" ), QPixmap( "textdrawing/undo.png" ), tr( "&Undo" ), CTRL + Key_Z, this, "editUndo" );
    connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) );
    a->addTo( tb );
    a->addTo( menu );
    a = new QAction( tr( "Redo" ), QPixmap( "textdrawing/redo.png" ), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" );
    connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
    a->addTo( tb );
    a->addTo( menu );
    menu->insertSeparator();
    a = new QAction( tr( "Cut" ), QPixmap( "textdrawing/editcut.png" ), tr( "&Cut" ), CTRL + Key_X, this, "editCut" );
    connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
    a->addTo( tb );
    a->addTo( menu );
    a = new QAction( tr( "Copy" ), QPixmap( "textdrawing/editcopy.png" ), tr( "C&opy" ), CTRL + Key_C, this, "editCopy" );
    connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
    a->addTo( tb );
    a->addTo( menu );
    a = new QAction( tr( "Paste" ), QPixmap( "textdrawing/editpaste.png" ), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" );
    connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
    a->addTo( tb );
    a->addTo( menu );
}
Example #19
0
ccAlignDlg::ccAlignDlg(ccGenericPointCloud *data, ccGenericPointCloud *model, QWidget* parent)
    : QDialog(parent), Ui::AlignDialog()
{
    setupUi(this);
    setWindowFlags(Qt::Tool);

    samplingMethod->addItem("None");
    samplingMethod->addItem("Random");
    samplingMethod->addItem("Space");
    samplingMethod->addItem("Octree");
    samplingMethod->setCurrentIndex(NONE);

    QColor qRed(255,0,0);
    QColor qYellow(255,255,0);
    ccDisplayOptionsDlg::SetButtonColor(dataColorButton,qRed);
    ccDisplayOptionsDlg::SetButtonColor(modelColorButton,qYellow);

    dataObject = data;
    modelObject = model;
    setColorsAndLabels();

    changeSamplingMethod(samplingMethod->currentIndex());
    toggleNbMaxCandidates(isNbCandLimited->isChecked());

    connect(swapButton, SIGNAL(clicked()), this, SLOT(swapModelAndData()));
    connect(modelSample, SIGNAL(sliderReleased()), this, SLOT(modelSliderReleased()));
    connect(dataSample, SIGNAL(sliderReleased()), this, SLOT(dataSliderReleased()));
    connect(modelSamplingRate, SIGNAL(valueChanged(double)), this, SLOT(modelSamplingRateChanged(double)));
    connect(dataSamplingRate, SIGNAL(valueChanged(double)), this, SLOT(dataSamplingRateChanged(double)));
    connect(deltaEstimation, SIGNAL(clicked()), this, SLOT(estimateDelta()));
    connect(samplingMethod, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSamplingMethod(int)));
    connect(isNbCandLimited, SIGNAL(toggled(bool)), this, SLOT(toggleNbMaxCandidates(bool)));
}
Example #20
0
bool ConsoleBluetoothStarter::startBluetooth(const TrkDevicePtr &trkDevice,
        QObject *listenerParent,
        int attempts,
        QString *errorMessage)
{
    // Set up a console starter to print to stdout.
    ConsoleBluetoothStarter starter(trkDevice, listenerParent);
    starter.setAttempts(attempts);
    switch (starter.start()) {
    case Started:
        break;
    case ConnectionSucceeded:
        return true;
    case StartError:
        *errorMessage = starter.errorString();
        return false;
    }
    // Run the starter with an event loop. @ToDo: Implement
    // some asynchronous keypress read to cancel.
    QEventLoop eventLoop;
    connect(&starter, SIGNAL(connected()), &eventLoop, SLOT(quit()));
    connect(&starter, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
    eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
    if (starter.state() != AbstractBluetoothStarter::Connected) {
        *errorMessage = starter.errorString();
        return false;
    }
    return true;
}
Example #21
0
ShowDesktop::ShowDesktop(const IRazorPanelPluginStartupInfo &startupInfo) :
    QObject(),
    IRazorPanelPlugin(startupInfo)
{
    m_key = GlobalKeyShortcut::Client::instance()->addAction(QString(), QString("/panel/%1/show_desktop/%2/show_hide").arg(QFileInfo(settings()->fileName()).baseName()).arg(settings()->group()), tr("Show desktop"), this);
    if (m_key)
    {
        connect(m_key, SIGNAL(activated()), this, SLOT(showDesktop()));

        if (m_key->shortcut().isEmpty())
        {
            m_key->changeShortcut(DEFAULT_SHORTCUT);
            if (m_key->shortcut().isEmpty())
            {
                RazorNotification::notify(tr("Show Desktop: Global shortcut '%1' cannot be registered").arg(DEFAULT_SHORTCUT));
            }
        }
    }

    QAction * act = new QAction(XdgIcon::fromTheme("user-desktop"), tr("Show Desktop"), this);
    connect(act, SIGNAL(triggered()), this, SLOT(showDesktop()));

    mButton.setDefaultAction(act);
    mButton.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
Example #22
0
QgsDualView::QgsDualView( QWidget* parent )
    : QStackedWidget( parent )
    , mEditorContext()
    , mMasterModel( 0 )
    , mFilterModel( 0 )
    , mFeatureListModel( 0 )
    , mAttributeForm( 0 )
    , mLayerCache( 0 )
    , mProgressDlg( 0 )
    , mFeatureSelectionManager( 0 )
{
    setupUi( this );

    mPreviewActionMapper = new QSignalMapper( this );

    mPreviewColumnsMenu = new QMenu( this );
    mActionPreviewColumnsMenu->setMenu( mPreviewColumnsMenu );

    // Set preview icon
    mActionExpressionPreview->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionPreview.svg" ) );

    // Connect layer list preview signals
    connect( mActionExpressionPreview, SIGNAL( triggered() ), SLOT( previewExpressionBuilder() ) );
    connect( mPreviewActionMapper, SIGNAL( mapped( QObject* ) ), SLOT( previewColumnChanged( QObject* ) ) );
    connect( mFeatureList, SIGNAL( displayExpressionChanged( QString ) ), this, SLOT( previewExpressionChanged( QString ) ) );
}
Example #23
0
dspSummarizedBOM::dspSummarizedBOM(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
    setupUi(this);

    connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
    connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));

    _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cKit);

    _bomitem->setRootIsDecorated(TRUE);
    _bomitem->addColumn(tr("Item Number"),   _itemColumn,  Qt::AlignLeft   );
    _bomitem->addColumn(tr("Description"),   -1,           Qt::AlignLeft   );
    _bomitem->addColumn(tr("UOM"),           _uomColumn,   Qt::AlignCenter );
    _bomitem->addColumn(tr("Ext. Qty. Per"), _qtyColumn,   Qt::AlignRight  );
    _bomitem->setIndentation(10);

    _expiredDaysLit->setEnabled(_showExpired->isChecked());
    _expiredDays->setEnabled(_showExpired->isChecked());
    _effectiveDaysLit->setEnabled(_showFuture->isChecked());
    _effectiveDays->setEnabled(_showFuture->isChecked());

    connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), this, SLOT(sFillList()));
    _revision->setMode(RevisionLineEdit::View);
    _revision->setType("BOM");

    //If not Revision Control, hide control
    _revision->setVisible(_metrics->boolean("RevControl"));
}
PluginCategoriesWindow::PluginCategoriesWindow(StackedWindow *parent) :
    StackedWindow(parent),
    m_model(new PluginCategoryModel(this)),
    m_view(new ListView(this)),
    m_reloadAction(new QAction(tr("Reload"), this)),
    m_label(new QLabel(QString("<p align='center'; style='font-size: 40px; color: %1'>%2</p>")
                       .arg(palette().color(QPalette::Mid).name()).arg(tr("No categories found")), this))
{
    setWindowTitle(tr("Categories"));
    setCentralWidget(new QWidget);

    m_view->setModel(m_model);

    m_reloadAction->setEnabled(false);

    m_label->hide();

    m_layout = new QVBoxLayout(centralWidget());
    m_layout->addWidget(m_view);
    m_layout->addWidget(m_label);
    m_layout->setContentsMargins(0, 0, 0, 0);

    menuBar()->addAction(m_reloadAction);

    connect(m_model, SIGNAL(statusChanged(ResourcesRequest::Status)), this,
            SLOT(onModelStatusChanged(ResourcesRequest::Status)));
    connect(m_view, SIGNAL(activated(QModelIndex)), this, SLOT(showCategory(QModelIndex)));
    connect(m_reloadAction, SIGNAL(triggered()), m_model, SLOT(reload()));
}
Example #25
0
void SendCoinsDialog::setModel(WalletModel *model)
{
    this->model = model;

    for(int i = 0; i < ui->entries->count(); ++i)
    {
        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
        if(entry)
        {
            entry->setModel(model);
        }
    }
    if(model && model->getOptionsModel())
    {
        setBalance(model->getBalance(), model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance());
        connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64)));
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));

        // Coin Control
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels()));
        connect(model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool)));
        connect(model->getOptionsModel(), SIGNAL(transactionFeeChanged(qint64)), this, SLOT(coinControlUpdateLabels()));
        ui->frameCoinControl->setVisible(model->getOptionsModel()->getCoinControlFeatures());
        coinControlUpdateLabels();
    }
Example #26
0
customerGroups::customerGroups(QWidget* parent, const char* name, Qt::WindowFlags fl)
    : XWidget(parent, name, fl)
{
    setupUi(this);

    connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
    connect(_view, SIGNAL(clicked()), this, SLOT(sView()));

    _custgrp->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "custgrp_name");
    _custgrp->addColumn(tr("Description"),   -1, Qt::AlignLeft, true, "custgrp_descrip");

    if (_privileges->check("MaintainCustomerGroups"))
    {
        connect(_custgrp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
        connect(_custgrp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
        connect(_custgrp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
    }
    else
    {
        _new->setEnabled(false);
        connect(_custgrp, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
    }

    sFillList();
}
KoDockWidgetTitleBar::KoDockWidgetTitleBar(QDockWidget* dockWidget)
    : QWidget(dockWidget), d(new Private(this))
{
    QDockWidget *q = dockWidget;

    d->floatButton = new KoDockWidgetTitleBarButton(this);
    d->floatButton->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarNormalButton, 0, q));
    connect(d->floatButton, SIGNAL(clicked()), SLOT(toggleFloating()));
    d->floatButton->setVisible(true);
    d->floatButton->setToolTip(i18nc("@info:tooltip", "Float Docker"));

    d->closeButton = new KoDockWidgetTitleBarButton(this);
    d->closeButton->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarCloseButton, 0, q));
    connect(d->closeButton, SIGNAL(clicked()), q, SLOT(close()));
    d->closeButton->setVisible(true);
    d->closeButton->setToolTip(i18nc("@info:tooltip", "Close Docker"));

    d->collapseButton = new KoDockWidgetTitleBarButton(this);
    d->collapseButton->setIcon(d->openIcon);
    connect(d->collapseButton, SIGNAL(clicked()), SLOT(toggleCollapsed()));
    d->collapseButton->setVisible(false);
    d->collapseButton->setToolTip(i18nc("@info:tooltip", "Collapse Docker"));

    d->lockIcon = koIcon("object-unlocked");
    d->lockButton = new KoDockWidgetTitleBarButton(this);
    d->lockButton->setIcon(d->lockIcon);
    connect(d->lockButton, SIGNAL(clicked()), SLOT(toggleLocked()));
    d->lockButton->setVisible(true);
    d->lockButton->setToolTip(i18nc("@info:tooltip", "Lock Docker"));

    connect(dockWidget, SIGNAL(featuresChanged(QDockWidget::DockWidgetFeatures)), SLOT(featuresChanged(QDockWidget::DockWidgetFeatures)));
    connect(dockWidget, SIGNAL(topLevelChanged(bool)), SLOT(topLevelChanged(bool)));
    d->featuresChanged(0);
}
CWizConsoleDialog::CWizConsoleDialog(CWizExplorerApp& app, QWidget* parent)
    : QDialog(parent)
    , m_app(app)
    , m_ui(new Ui::CWizConsoleDialog)
    , m_bAutoScroll(true)
    , m_nPos(0)
{
    m_ui->setupUi(this);
    //setWindowFlags(Qt::Tool);

    m_ui->editConsole->setReadOnly(true);
    m_ui->btnCopyToClipboard->setEnabled(false);

    connect(Utils::Logger::logger(), SIGNAL(readyRead()), SLOT(onLogBufferReadyRead()));
    connect(m_ui->btnSaveAs, SIGNAL(clicked()), SLOT(onBtnSaveAsClicked()));
    connect(m_ui->editConsole, SIGNAL(copyAvailable(bool)), SLOT(onConsoleCopyAvailable(bool)));
    connect(m_ui->btnCopyToClipboard, SIGNAL(clicked()), SLOT(onBtnCopyToClipboardClicked()));
    connect(m_ui->buttonClear, SIGNAL(clicked()), SLOT(onBtnClearClicked()));

    connect(m_ui->editConsole, SIGNAL(textChanged()), SLOT(onConsoleTextChanged()));
    connect(m_ui->editConsole->verticalScrollBar(), SIGNAL(valueChanged(int)), SLOT(onConsoleSliderMoved(int)));

    //
    load();
}
ExtensibleFileDialog::ExtensibleFileDialog(QWidget *parent, bool extended, Qt::WFlags flags)
    : QFileDialog(parent, flags)
{
    d_extension = 0;

    d_extension_toggle = new QPushButton(tr("<< &Advanced"));
    d_extension_toggle->setCheckable(true);
    if (extended)
        d_extension_toggle->toggle();
    d_extension_toggle->hide(); // show only for d_extension != 0

    QGridLayout *main_layout = qobject_cast<QGridLayout*>(layout());
    if (main_layout) {
        d_extension_row = main_layout->rowCount();
        main_layout->addWidget(d_extension_toggle, d_extension_row, main_layout->columnCount()-1);
        main_layout->setRowStretch(d_extension_row, 0);
        main_layout->setRowStretch(d_extension_row+1, 0);
    } else {
        // fallback in case QFileDialog uses a different layout in the future (=> main_layout==0)
        // would probably look a mess, but at least all functions would be accessible
        layout()->addWidget(d_extension_toggle);
    }

    connect(this, SIGNAL(accepted()), this, SLOT(close()));
    connect(this, SIGNAL(rejected()), this, SLOT(close()));
}
Example #30
0
Pane::Pane(QWidget *parent) : QWidget(parent), ui(new Ui::Pane) {
    directory = 0;
    pending_directory = 0;
    ui->setupUi(this);
    ui->list->setModel(&file_list_model);
    ui->list->installEventFilter(this);
    ui->list->viewport()->installEventFilter(this);
    ui->list->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);

    QFontMetrics font_metrics(ui->list->font());
    ui->list->verticalHeader()->setFixedWidth(10 + font_metrics.width(">"));

    ui->address->installEventFilter(this);
    ready = true;
    main_window = 0;
    connect(ui->address, SIGNAL(returnPressed()), this, SLOT(on_go_clicked()));

    ui->loading_indicator->hide();
    QMovie* loading_movie = new QMovie(":/loading.gif", QByteArray(), ui->loading_indicator);
    ui->loading_indicator->setMovie(loading_movie);
    loading_movie->start();

    connect(ui->list->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(current_index_changed(QModelIndex,QModelIndex)));
    connect(ui->list->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SIGNAL(selection_changed()));
    connect(ui->list->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SIGNAL(selection_changed()));
}