Example #1
0
bool QuickOpenManager::initWithApp(IApplication *app)
{
    if (!IQuickOpenManager::initWithApp(app)) {
        return false;
    }

    m_liteApp->extension()->addObject("LiteApi.IQuickOpenManager",this);

    m_widget = new QuickOpenWidget(m_liteApp,m_liteApp->mainWindow());

    connect(m_widget->editor(),SIGNAL(textChanged(QString)),this,SLOT(filterChanged(QString)));
    connect(m_widget->editor(),SIGNAL(returnPressed()),this,SLOT(selected()));
    connect(m_widget->view(),SIGNAL(clicked(QModelIndex)),this,SLOT(selected()));
    connect(m_widget->view(),SIGNAL(activated(QModelIndex)),this,SLOT(selected()));
    connect(m_widget,SIGNAL(hideWidget()),this,SLOT(hideWidget()));
    connect(m_widget,SIGNAL(indexChanage(QModelIndex)),this,SLOT(indexChanage(QModelIndex)));

    m_quickOpenFiles = new QuickOpenFiles(app,this);
    m_quickOpenFolder = new QuickOpenFolder(app,this);

    this->addFilter("",m_quickOpenFiles);
    this->addFilter("",m_quickOpenFolder);
    this->addFilter("~",new QuickOpenEditor(m_liteApp,this));
    this->addFilter(">",new QuickOpenAction(m_liteApp,this));
    this->addFilter("?",new QuickOpenHelp(m_liteApp,this));

    this->registerQuickOpenMimeType("@");

    m_quickOpenAct = new QAction(tr("Quick Open File"),this);
    m_quickOpenEditAct = new QAction(tr("Quick Open Editor"),this);
    m_quickOpenSymbolAct = new QAction(tr("Quick Open Symbol"),this);
    m_quickOpenActionAct = new QAction(tr("Quick Open Command"),this);
    m_quickOpenHelpAct = new QAction(tr("Show All Quick Open Actions"),this);

    m_liteApp->actionManager()->setViewMenuSeparator("sep/quickopen",true);

    LiteApi::IActionContext *context = m_liteApp->actionManager()->getActionContext(m_liteApp,"App");
    context->regAction(m_quickOpenAct,"QuickOpen","CTRL+P");
    context->regAction(m_quickOpenEditAct,"QuickOpenEditor","CTRL+ALT+P");
    context->regAction(m_quickOpenActionAct,"QuickOpenCommand","CTRL+SHIFT+P");
    context->regAction(m_quickOpenSymbolAct,"QuickOpenSymbol","CTRL+SHIFT+O");
    context->regAction(m_quickOpenHelpAct,"QuickOpenHelp","");

    m_liteApp->actionManager()->insertMenuActions(ID_MENU_TOOLS,"sep/quickopen",true, QList<QAction*>()
                                                  << m_quickOpenAct
                                                  << m_quickOpenActionAct
                                                  << m_quickOpenEditAct
                                                  << m_quickOpenSymbolAct
                                                  << m_quickOpenHelpAct );

    connect(m_quickOpenAct,SIGNAL(triggered(bool)),this,SLOT(quickOpen()));
    connect(m_quickOpenEditAct,SIGNAL(triggered(bool)),this,SLOT(quickOpenEditor()));
    connect(m_quickOpenSymbolAct,SIGNAL(triggered(bool)),this,SLOT(quickOpenSymbol()));
    connect(m_quickOpenActionAct,SIGNAL(triggered(bool)),this,SLOT(quickOpenCommand()));
    connect(m_quickOpenHelpAct,SIGNAL(triggered(bool)),this,SLOT(quickOpenHelp()));

    connect(m_liteApp,SIGNAL(aboutToQuit()),this,SLOT(appAboutToQuit()));

    return true;
}
Example #2
0
void WidgetStackControlListener::slotValueChanged(double v) {
    if (v > 0.0) {
        emit(switchToWidget());
    } else {
        emit(hideWidget());
    }
}
Example #3
0
void SWidgetManager::switchWidgetVisiblity( QWidget *widget )
{
    if( widgetIsVisible(widget) )
        hideWidget(widget);
    else
        showWidget(widget);
}
void WizScreenShotWidget::keyPressEvent(QKeyEvent *event)
{
    if (event->key() == Qt::Key_Escape)
    {
        initCWizScreenShotWidget();
        hideWidget();
    }
}
void WizScreenShotWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
    if (currentShotState == finishShot || currentShotState == finishMoveShot || currentShotState == finishControl)
    {
        QRect rcSelect = getMoveControlSelectedRect();
        hideWidget();
        if (rcSelect.contains(event->pos()))
            emit finishPixmap(shotPixmap);
    }
}
Example #6
0
void
AnimatedSplitter::addWidget( AnimatedWidget* widget )
{
    qDebug() << Q_FUNC_INFO << widget;
    QSplitter::addWidget( widget );
    m_sizes << widget->hiddenSize();

    connect( widget, SIGNAL( showWidget() ), SLOT( onShowRequest() ) );
    connect( widget, SIGNAL( hideWidget() ), SLOT( onHideRequest() ) );
    connect( widget, SIGNAL( hiddenSizeChanged() ), SLOT( onHiddenSizeChanged() ) );
    connect( this, SIGNAL( shown( QWidget* ) ), widget, SLOT( onShown( QWidget* ) ) );
    connect( this, SIGNAL( hidden( QWidget* ) ), widget, SLOT( onHidden( QWidget* ) ) );
}
Example #7
0
void
AnimatedSplitter::addWidget( AnimatedWidget* widget )
{
    QSplitter::addWidget( widget );

    connect( widget, SIGNAL( showWidget() ), SLOT( onShowRequest() ) );
    connect( widget, SIGNAL( hideWidget() ), SLOT( onHideRequest() ) );
    connect( widget, SIGNAL( sizeHintChanged( QSize ) ), SLOT( onShowRequest() ) );
    connect( widget, SIGNAL( sizeChanged( QSize ) ), SLOT( onSizeChanged( QSize ) ) );

    connect( this, SIGNAL( shown( QWidget*, bool ) ), widget, SLOT( onShown( QWidget*, bool ) ) );
    connect( this, SIGNAL( hidden( QWidget*, bool ) ), widget, SLOT( onHidden( QWidget*, bool ) ) );
}
void UserWidget::loginInUser(QString nam) {

     hideWidget();

     QList<ImageButton*> m_children =
             this->findChildren<ImageButton *>();
     for(int i = 0; i < m_children.length(); i++) {
         if (m_children[i]->objectName()!=nam) {
             m_children[i]->hide();
         } else {
             m_children[i]->show();
             m_children[i]->setIconSize(ImageButton::AvatarBigSize);
         }
     }

}
int HideToolWindow::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: hideWidget((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: setVisible((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: updateTranslation(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
Example #10
0
void VirtualJoystickPlugin::menuAction(int action, bool checked) {
  (void) checked;

  switch (action) {
  case 1:
    if (!joystick) {
      joystick = new JoystickWidget();
      gui->addDockWidget((void*)joystick);
      joystick->setMaxSpeed(12.0);

      connect(joystick, SIGNAL(newSpeed(double, double)), this, SLOT(newSpeed(double, double)));

      connect(joystick, SIGNAL(hideSignal()), this, SLOT(hideWidget()));
      connect(joystick, SIGNAL(closeSignal()), this, SLOT(closeWidget()));
    }
    else {
Example #11
0
  void Sidebar::tabClicked(int i)
  {
    ToolView *w = m_idToWidget[i];

    if (!w)
      return;

    if (isTabRaised(i))
    {
      showWidget (w);
      w->setFocus ();
    }
    else
    {
      hideWidget (w);
      m_mainWin->centralWidget()->setFocus ();
    }
  }
Example #12
0
void WWidgetStack::addWidgetWithControl(QWidget* pWidget, ControlObject* pControl) {
    int index = addWidget(pWidget);
    if (pControl) {
        WidgetStackControlListener* pListener = new WidgetStackControlListener(
            this, pControl, index);
        m_showMapper.setMapping(pListener, index);
        m_hideMapper.setMapping(pListener, index);
        if (pControl->get() > 0) {
            setCurrentIndex(count()-1);
        }
        pListener->onCurrentWidgetChanged(currentIndex());
        connect(pListener, SIGNAL(switchToWidget()),
                &m_showMapper, SLOT(map()));
        connect(pListener, SIGNAL(hideWidget()),
                &m_hideMapper, SLOT(map()));
        connect(this, SIGNAL(currentChanged(int)),
                pListener, SLOT(onCurrentWidgetChanged(int)));
    }
}
Example #13
0
void
TransferView::streamFinished( StreamConnection* sc )
{
    if ( !m_index.contains( sc ) )
        return;

    QPersistentModelIndex i = m_index.take( sc );
    delete m_tree->invisibleRootItem()->takeChild( i.row() );

    if ( m_tree->invisibleRootItem()->childCount() > 0 )
        emit showWidget();
    else
        emit hideWidget();

/*    if ( m_index.contains( sc ) )
    {
        int i = m_index.value( sc );
        m_tree->invisibleRootItem()->child( i )->setText( 1, tr( "Finished" ) );
    }*/
}
Example #14
0
void VehicleList::handleRequest(Operations::Type type, AbstractMessage *msg)
{
    const QString &userName = msg->getUserName();
    if (!ui->obuList->hasUser(userName)) {
        if (userName == "[Me]")
            ui->obuList->addItem(new QListWidgetItem(QIcon("./icon/local.png"), userName, ui->obuList));
        else
            ui->obuList->addItem(new QListWidgetItem(userName, ui->obuList));
        ui->obuInfoStack->addWidget(userName);

        Timer *timer = new Timer(this);
        timer->setUserName(userName);
        userTimer.insert(userName, timer);
        connect(timer, SIGNAL(userTimeOut(QString)), ui->obuInfoStack, SLOT(hideWidget(QString)));
        connect(timer, SIGNAL(userTimeOut(QString)), ui->obuList, SLOT(removeItem(QString)));
        timer->start(GraphicsArgument::argument().getDeadTime());
    }

    // 每次更新定时器。
    QMap<QString, QTimer *>::iterator itr = userTimer.find(userName);
    if (itr != userTimer.end()) {
        qreal deadTime =  GraphicsArgument::argument().getDeadTime();
        ((QTimer *)itr.value())->start(deadTime);
    }

    if (type == Operations::UPDATE_LIST) {
        LocationMessage *m1 = (LocationMessage *) msg;
        QString s("Vehicle Name :  " + userName
                + "\nLocation :\n" + m1->getLatitude() + ", " + m1->getLontitude()
                + "\nSpeed :\t" + m1->getSpeed()
                + "\nDirection :\t" + m1->getDirect()
                + "\nLicense :\t" + m1->getLicense());
        ui->obuInfoStack->updateVehicleInfo(userName, s);
        ui->obuList->setItemColor(userName, m1->getMessageType());
    } else if (type == Operations::UPDATE_HOP) {
        HopMessage *m = (HopMessage *) msg;
        ui->obuList->setIconHop(userName, m->getHopMark());
    }
}
void WizScreenShotWidget::savePixmap()
{
    hideWidget();
    emit finishPixmap(shotPixmap);
}
void WizScreenShotWidget::quit()
{
    hideWidget();
    emit shotScreenQuit();
}