Example #1
0
void ContactDetails::init( const QContact &entry )
{
    // If we redisplay the same entry, don't shift our view around too much
    bool sameEntry = (entry.uid() == ent.uid());

    ent = entry;
    mLink.clear();

    /* Create our members, if we haven't */
    if ( !mModel ) {
        mModel = new QContactModel(this);
        connect(mModel, SIGNAL(modelReset()), this, SLOT(modelChanged()));

        mTabs = new QTabWidget();

        mQuickTab = new ContactOverview(0);
        mDetailsTab = new ContactBrowser(0);
#if defined(QTOPIA_TELEPHONY)
        mCallHistoryTab = new ContactCallHistoryList(0);
#endif
        mMessageHistoryTab = new ContactMessageHistoryList(0);

        mTabs->addTab(mQuickTab, QIcon(":icon/contactdetails"), tr("Overview"));
        mTabs->addTab(mDetailsTab, QIcon(":icon/details"), tr("Details"));
#if defined(QTOPIA_TELEPHONY)
        mTabs->addTab(mCallHistoryTab, QIcon(":icon/phone/calls"), tr("Calls"));
#endif
        mTabs->addTab(mMessageHistoryTab, QIcon(":icon/email"), tr("Messages"));

        connect(mQuickTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mQuickTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));
        connect(mDetailsTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mDetailsTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));
#if defined(QTOPIA_TELEPHONY)
        connect(mCallHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mCallHistoryTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));
#endif
        connect(mMessageHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mMessageHistoryTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));

        connect(mQuickTab, SIGNAL(callContact()), this, SIGNAL(callContact()));
        connect(mQuickTab, SIGNAL(textContact()), this, SIGNAL(textContact()));
        connect(mQuickTab, SIGNAL(emailContact()), this, SIGNAL(emailContact()));
        connect(mQuickTab, SIGNAL(editContact()), this, SIGNAL(editContact()));

        connect(mDetailsTab, SIGNAL(highlighted(QString)), this, SIGNAL(highlighted(QString)));

        QVBoxLayout *v = new QVBoxLayout();
        v->addWidget(mTabs);
        v->setMargin(0);
        setLayout(v);
    }

    modelChanged();

    if (!sameEntry)
        mTabs->setCurrentIndex(0);
    mTabs->currentWidget()->setFocus();
}
Csv_infilter_dialog::Csv_infilter_dialog( QWidget* parent, const char* name )
    : QDialog(parent),
      filter_( 0 ),
      file_stream_( 0 ) {

    setupUi(this);
    SmartPtr<Named_interface> ni =
        Root::instance()->interface( gslibInputFilters_manager );
    Manager* mng = dynamic_cast<Manager*>( ni.raw_ptr() );
    appli_assert( mng );

    Manager::type_iterator begin = mng->begin();
    Manager::type_iterator end = mng->end();
    for( ; begin != end ; ++begin ) {
        ObjectType->addItem( QString( begin->c_str() ) );
    }

    create_specialized_filter( ObjectType->currentText() );
    _back->setEnabled(false);

    ObjectType->setFocus();

    QObject::connect( ObjectType, SIGNAL(activated( const QString& )),
                      this, SLOT( create_specialized_filter( const QString& ) ) );
    QObject::connect( _next, SIGNAL(clicked()), this, SLOT(nextClicked()));
    QObject::connect( _back, SIGNAL(clicked()), this, SLOT(backClicked()));
    QObject::connect( _cancel, SIGNAL(clicked()), this, SLOT(reject()));

}
Example #3
0
void ControlStrip::mousePressEvent(QMouseEvent *event)
{
    int h = height();
    int spacing = qMin(h, (width() - h * 4) / 3);
    int x = event->pos().x();

    if (x < h) {
        emit menuClicked();
        event->accept();
        return;
    }

    if (x > width() - h) {
        emit closeClicked();
        event->accept();
        return;
    }

    if ((x < width() - (h + spacing)) && (x > width() - (h * 2 + spacing))) {
        emit forwardClicked();
        event->accept();
        return;
    }

    if ((x < width() - (h * 2 + spacing * 2)) && (x > width() - (h * 3 + spacing * 2))) {
        emit backClicked();
        event->accept();
        return;
    }
}
Example #4
0
PlayerWindow::PlayerWindow()
{

    QTextCodec::setCodecForTr (QTextCodec::codecForName("UTF-8"));

    layout = new QHBoxLayout();
    setLayout(layout);

    title = new QLabel(tr("Menu Player'a (poki co liczba zdobytych punktow): "));

    label = new QLabel(tr("punktów: "));
    button = new QPushButton(tr("Powrót"));
    spacer = new QSpacerItem(100, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);

    layout->addWidget(title);
    layout->addWidget(label);
    layout->addSpacerItem(spacer);
    layout->addWidget(button);


    connect(button, SIGNAL(clicked()), this, SLOT(backClicked()));



}
Example #5
0
void BrowserView::initialize()
{
    connect(m_zoomStrip, SIGNAL(zoomInClicked()), SLOT(zoomIn()));
    connect(m_zoomStrip, SIGNAL(zoomOutClicked()), SLOT(zoomOut()));

    connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
    connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));
    connect(m_controlStrip, SIGNAL(closeClicked()), qApp, SLOT(quit()));

    QPalette pal = m_webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    m_webView->setPalette(pal);

    FlickCharm *flickCharm = new FlickCharm(this);
    flickCharm->activateOn(m_webView);

    m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
    connect(m_webView, SIGNAL(loadStarted()), SLOT(start()));
    connect(m_webView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
    connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
    connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));

    m_webView->setHtml("about:blank");
    m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    m_webView->setFocus();
}
Example #6
0
void BrowserView::initialize()
{
    connect(m_zoomStrip, SIGNAL(zoomInClicked()), SLOT(zoomIn()));
    connect(m_zoomStrip, SIGNAL(zoomOutClicked()), SLOT(zoomOut()));

    connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
    connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));

    QPalette pal = m_webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    m_webView->setPalette(pal);

    FlickCharm *flickCharm = new FlickCharm(this);
    flickCharm->activateOn(m_webView);

    m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
    connect(m_webView, SIGNAL(loadStarted()), SLOT(start()));
    connect(m_webView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
    connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
    connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));

    m_webView->setHtml("Will try to load page soon!");
    m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    m_webView->setFocus();
#ifdef Q_OS_SYMBIAN
    QTimer::singleShot(0, this, SLOT(setDefaultIap()));
#endif
}
Example #7
0
HacServer::HacServer(QObject *parent)
: QObject(parent)
{
	qDebug() << "HacServer::HacServer";
	// init qws server
	server = QWSServer::instance();
	QScreen *screen = QScreen::instance();
	server->setMaxWindowRect(QRect(WINDOW_X, WINDOW_Y, WINDOW_W, WINDOW_H));

	// init status bar 
	statusBar = new StatusBar;
	connect(statusBar, SIGNAL(homeClicked()), this, SLOT(OnHomeClicked()));
	connect(statusBar, SIGNAL(backClicked()), this, SLOT(OnBackClicked()));
	connect(statusBar, SIGNAL(clockClicked()), this, SLOT(OnClockClicked()));
	statusBar->setGeometry(STATUSBAR_X, STATUSBAR_Y, STATUSBAR_W, STATUSBAR_H);
	statusBar->show();

	// init auto start applications


    QProcess *myApp = new QProcess;
    myApp->setProcessChannelMode(QProcess::ForwardedChannels);
	myApp->start(APP_HAC01_BIN);
	myApp->waitForStarted();
}
Example #8
0
NeoControl::NeoControl(QWidget *parent, Qt::WFlags f)
    : QWidget(parent)
{
#ifdef QTOPIA
    this->setWindowState(Qt::WindowMaximized);
#else
    Q_UNUSED(f);
#endif
    bQvga = new QPushButton(tr("Switch to QVGA"), this);
    connect(bQvga, SIGNAL(clicked()), this, SLOT(qvgaClicked()));

    bBack = new QPushButton(this);
    connect(bBack, SIGNAL(clicked()), this, SLOT(backClicked()));

    bNext = new QPushButton(tr("Next"), this);
    connect(bNext, SIGNAL(clicked()), this, SLOT(nextClicked()));

    bSave = new QPushButton(tr("Save"), this);
    connect(bSave, SIGNAL(clicked()), this, SLOT(saveClicked()));

    chkDeepSleep = new QCheckBox(tr("Deep sleep"), this);
    connect(chkDeepSleep, SIGNAL(stateChanged(int)), this, SLOT(deepSleepStateChanged(int)));

    chkMux = new QCheckBox(tr("Multiplexing"), this);
    connect(chkMux, SIGNAL(stateChanged(int)), this, SLOT(muxStateChanged(int)));

    chkFso = new QCheckBox(tr("Use FSO (freesmartphone.org)"), this);
    connect(chkFso, SIGNAL(stateChanged(int)), this, SLOT(fsoStateChanged(int)));

    label = new QLabel(this);
    lineEdit = new QLineEdit(this);

    label4 = new QLabel(this);
    label5 = new QLabel(this);

    slider4 = new MixerSlider(this);
    slider5 = new MixerSlider(this);

    buttonLayout = new QHBoxLayout();
    buttonLayout->setAlignment(Qt::AlignBottom);
    buttonLayout->addWidget(bBack);
    buttonLayout->addWidget(bNext);

    layout = new QVBoxLayout(this);
    layout->addWidget(bQvga);
    layout->addWidget(label);
    layout->addWidget(label4);
    layout->addWidget(slider4);
    layout->addWidget(label5);
    layout->addWidget(slider5);
    layout->addWidget(bSave);
    layout->addWidget(lineEdit);
    layout->addWidget(chkDeepSleep);
    layout->addWidget(chkMux);
    layout->addWidget(chkFso);
    layout->addLayout(buttonLayout);

    showScreen(NeoControl::ScreenInit);
}
Example #9
0
QMplayer::QMplayer(QWidget *parent, Qt::WFlags f)
    : QWidget(parent)
{
#ifdef QTOPIA
    this->setWindowState(Qt::WindowMaximized);
#else
    Q_UNUSED(f);
#endif
    lw = new QListWidget(this);
    int h = lw->fontMetrics().height();
    lw->setIconSize(QSize(h, h));

    scanItem = new QListWidgetItem(tr("Scan"), lw);
    scanItem->setSelected(true);

    settingsItem = new QListWidgetItem(tr("Sharing"), lw);

    bOk = new QPushButton(this);
    connect(bOk, SIGNAL(clicked()), this, SLOT(okClicked()));

    bBack = new QPushButton(this);
    connect(bBack, SIGNAL(clicked()), this, SLOT(backClicked()));

    bUp = new QPushButton(this);
    connect(bUp, SIGNAL(clicked()), this, SLOT(upClicked()));

    bDown = new QPushButton(this);
    connect(bDown, SIGNAL(clicked()), this, SLOT(downClicked()));

    label = new QLabel(this);
    lineEdit = new QLineEdit(this);
    progress = new QProgressBar(this);    

    buttonLayout = new QHBoxLayout();
    buttonLayout->setAlignment(Qt::AlignBottom);
    buttonLayout->addWidget(bOk);
    buttonLayout->addWidget(bBack);
    buttonLayout->addWidget(bUp);
    buttonLayout->addWidget(bDown);

    layout = new QVBoxLayout(this);
    layout->addWidget(lw);
    layout->addWidget(label);
    layout->addWidget(lineEdit);
    layout->addWidget(progress);
    layout->addLayout(buttonLayout);

    maxScanLevel = 0;
    fbset = false;
    delTmpFiles = -1;
    process = NULL;
    tcpServer = NULL;

    showScreen(QMplayer::ScreenInit);
}
EditCalendarsPage::EditCalendarsPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    m_calendarList = new QListWidget(this);
    connect(m_calendarList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(itemDoubleClicked(QListWidgetItem *)));

#ifndef Q_OS_SYMBIAN
    // Add push buttons for non-Symbian platforms as they do not support soft keys
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *addButton = new QPushButton("Add new", this);
    connect(addButton,SIGNAL(clicked()), this, SIGNAL(addClicked()));
    hbLayout->addWidget(addButton);
    QPushButton *editButton = new QPushButton("Edit", this);
    connect(editButton,SIGNAL(clicked()),this,SLOT(editClicked()));
    hbLayout->addWidget(editButton);
    QPushButton *deleteButton = new QPushButton("Delete", this);
    connect(deleteButton,SIGNAL(clicked()),this,SLOT(deleteClicked()));
    hbLayout->addWidget(deleteButton);
    QPushButton *backButton = new QPushButton("Back", this);
    connect(backButton,SIGNAL(clicked()),this,SLOT(backClicked()));
    hbLayout->addWidget(backButton);
#endif

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addWidget(m_calendarList);

#ifndef Q_OS_SYMBIAN
    scrollAreaLayout->addLayout(hbLayout);
#endif

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);

    // Add softkeys
    QAction* cancelSoftKey = new QAction("Back", this);
    cancelSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(cancelSoftKey);
    connect(cancelSoftKey, SIGNAL(triggered(bool)), this, SLOT(backClicked()));

    QAction* editSoftKey = new QAction("Edit",this);
    editSoftKey->setSoftKeyRole(QAction::PositiveSoftKey); // Perhaps SelectSoftKey
    addAction(editSoftKey);
    connect(editSoftKey, SIGNAL(triggered(bool)), this, SLOT(editClicked()));
}
Example #11
0
void HeaderWidget::emitSignal(int id)
{
    switch (id) {
    case 1:
        emit backClicked();
        break;
    case 2:
        emit homeClicked();
        break;
    case 3:
        emit logoutClicked();
        break;
    }
}
void
ScrobblesWidget::onTrackClicked( TrackWidget& trackWidget )
{
    MetadataWidget* w;
    ui->layout->addWidget( w = new MetadataWidget( trackWidget.track() ));
    w->fetchTrackInfo();
    w->setBackButtonVisible( true );

    trackWidget.startSpinner();
    connect( ui->layout, SIGNAL( moveFinished(QLayoutItem*)), &trackWidget, SLOT(clearSpinner()) );

    connect( w, SIGNAL(finished()), SLOT(onMetadataWidgetFinished()));
    connect( w, SIGNAL(backClicked()), SLOT(onBackClicked()));
}
Toolbar::Toolbar(QWidget *parent) :
    QToolBar(parent)
{
    layout()->setSpacing(0);

    QWidget *m_w = new QWidget(this);
    m_l = new QHBoxLayout(this);
    m_l->setContentsMargins(0,0,0,0);
    m_l->setSpacing(0);
    m_w->setLayout(m_l);

    // create basic actions
    m_btn_back = new QToolButton(this);
    m_btn_next = new QToolButton(this);
    QToolButton *btn_top = new QToolButton(this);
    m_btn_back->setIcon(QIcon::fromTheme("go-previous")); m_btn_back->setText(tr("Previous folder"));
    btn_top->setIcon(QIcon::fromTheme("go-up")); btn_top->setText(tr("Parent folder"));
    m_btn_next->setIcon(QIcon::fromTheme("go-next")); m_btn_next->setText(tr("Next folder"));
    connect(m_btn_back, SIGNAL(clicked()), this, SIGNAL(backClicked()));
    connect(m_btn_next, SIGNAL(clicked()), this, SIGNAL(nextClicked()));
    connect(btn_top, SIGNAL(clicked()), this, SIGNAL(topClicked()));
    m_l->addWidget(m_btn_back);
    m_l->addWidget(btn_top);
    m_l->addWidget(m_btn_next);

    m_breadcrumb = new Breadcrumb(this);
    m_l->addWidget(m_breadcrumb, 1, Qt::AlignLeft);
    connect(m_breadcrumb, SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl)));

    m_line_edit = new QLineEdit(this);
    m_line_edit->hide();
    connect(m_line_edit, SIGNAL(returnPressed()), this, SLOT(m_edit_bar_returned()));

    m_btn_switch = new QToolButton(this);
    m_btn_switch->setIcon(QIcon::fromTheme("gtk-edit")); m_btn_switch->setText(tr("Edit"));
    connect(m_btn_switch, SIGNAL(clicked()), this, SLOT(m_show_edit_bar()));
    m_l->addWidget(m_btn_switch);

    QToolButton *btn_icon = new QToolButton(this);
    QToolButton *btn_list = new QToolButton(this);
    btn_icon->setIcon(QIcon::fromTheme("view-icons")); btn_icon->setText(tr("Icon view"));
    btn_list->setIcon(QIcon::fromTheme("view-list")); btn_list->setText(tr("List view"));
    connect(btn_icon, SIGNAL(clicked()), this, SLOT(m_change_view_icons()));
    connect(btn_list, SIGNAL(clicked()), this, SLOT(m_change_view_list()));
    m_l->addWidget(btn_icon);
    m_l->addWidget(btn_list);

    addWidget(m_w);
}
Example #14
0
void NavigationBarWidget::initialize()
	{
	// Connecting necessary Signals to Slots
	connect(iSlidingTimer, SIGNAL(timeout()), this, SLOT(slideTick()));
	connect(ui.SlidePushButton, SIGNAL(clicked()), this, SLOT(propagateSlideClicked()));
	connect(ui.SlidePushButton, SIGNAL(clicked()), this, SLOT(slide()));
	// Attaching Signals and Slots for Zooming
	connect(ui.ZoomInPushButton, SIGNAL(clicked()), this, SLOT(zoomIn()));
	connect(ui.ZoomOutPushButton, SIGNAL(clicked()), this, SLOT(zoomOut()));
	// Connecting internal Signals with external ones, for encapsulation
	connect(ui.BackPushButton, SIGNAL(clicked()), this, SIGNAL(backClicked()));
	connect(ui.ForwardPushButton, SIGNAL(clicked()), this, SIGNAL(forwardClicked()));
	connect(ui.HomePushButton, SIGNAL(clicked()), this, SIGNAL(homeClicked()));
	connect(ui.ZoomSlider, SIGNAL(valueChanged(int)), this, SIGNAL(zoomLevelChanged(int)));
	}
Example #15
0
int Help::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: emitBack(); break;
        case 1: backClicked(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
int NetcardsPanel::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:
            currentNetcardChanged((*reinterpret_cast< int(*)>(_a[1])));
            break;
        case 1:
            refreshClicked();
            break;
        case 2:
            requestGoPLCPage((*reinterpret_cast< bool(*)>(_a[1])));
            break;
        case 3:
            backClicked();
            break;
        case 4:
            onNetcardsChanged((*reinterpret_cast< const SVT_NotifyType(*)>(_a[1])));
            break;
        case 5:
            slot_RefreshCurrentSetting();
            break;
        case 6:
            setPLCBtnUsible((*reinterpret_cast< bool(*)>(_a[1])));
            break;
        case 7:
            setBackBtnUsible((*reinterpret_cast< bool(*)>(_a[1])));
            break;
        case 8:
            setBackBtnText((*reinterpret_cast< const QString(*)>(_a[1])));
            break;
        case 9:
            buttonClicked((*reinterpret_cast< int(*)>(_a[1])));
            break;
        default:
            ;
        }
        _id -= 10;
    }
    return _id;
}
Example #17
0
OsdWidget::OsdWidget(QWidget *parent)
    : StyledBar(parent),
      ui(new Ui::OsdWidget),
      _current(""),
      _file(new NetworkDownload())
{
    ui->setupUi(this);

    setLightColored(true);
    setSingleRow(false);

    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);

    _info = new InfoBarWidget(this);
    ui->controls->addWidget(_info);

    ui->logo->hide();
    ui->teletext->hide();

    ui->buttonBack->setProperty("extraframe", true);
    ui->buttonMute->setProperty("extraframe", true);
    ui->buttonNext->setProperty("extraframe", true);
    ui->buttonPlay->setProperty("extraframe", true);
    ui->buttonRecordNow->setProperty("extraframe", true);
    ui->buttonSnapshot->setProperty("extraframe", true);
    ui->buttonStop->setProperty("extraframe", true);
    ui->buttonTeletext->setProperty("extraframe", true);

    connect(_info, SIGNAL(open(QString)), this, SIGNAL(openLink(QString)));
    connect(ui->teletext, SIGNAL(valueChanged(int)), this, SIGNAL(teletextPage(int)));

    connect(ui->buttonBack, SIGNAL(clicked()), this, SIGNAL(backClicked()));
    connect(ui->buttonMute, SIGNAL(clicked()), this, SIGNAL(muteClicked()));
    connect(ui->buttonNext, SIGNAL(clicked()), this, SIGNAL(nextClicked()));
    connect(ui->buttonPlay, SIGNAL(clicked()), this, SIGNAL(playClicked()));
    connect(ui->buttonRecordNow, SIGNAL(clicked()), this, SIGNAL(recordNowClicked()));
    connect(ui->buttonSnapshot, SIGNAL(clicked()), this, SIGNAL(snapshotClicked()));
    connect(ui->buttonStop, SIGNAL(clicked()), this, SIGNAL(stopClicked()));
    connect(ui->buttonTeletext, SIGNAL(clicked()), this, SIGNAL(teletextClicked()));

    connect(_file, SIGNAL(file(QFile *)), this, SLOT(setLogo(QFile *)));
}
void TutorialPage::createLayout()
{
	m_tutorialWebView = new QWebView(this);
	m_tutorialWebView->setObjectName("TutorialPageQWebView");

	m_tutorialWebView->page()->history()->setMaximumItemCount(0); // we don't want back/forwoard functionality
	m_tutorialWebView->setContextMenuPolicy(Qt::NoContextMenu);
	m_tutorialWebView->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

	QHBoxLayout* hLayout = new QHBoxLayout();
	hLayout->addStretch();
	hLayout->addWidget(m_tutorialWebView);
	hLayout->addStretch();

	QVBoxLayout* mainLayout = new QVBoxLayout(this);
	mainLayout->setContentsMargins(0, 0, 0, 0);
	mainLayout->addStretch();
	mainLayout->addLayout(hLayout);

	QPushButton* backButton = new QPushButton(tr("&Back"));
	backButton->setMaximumWidth(BUTTON_MAX_WIDTH);
	CENT::connect(backButton, SIGNAL(clicked()), this, SIGNAL(backClicked()));

	QPushButton* nextButton = new QPushButton(tr("&Play"));
	nextButton->setMaximumWidth(BUTTON_MAX_WIDTH);
	CENT::connect(nextButton, SIGNAL(clicked()), this, SIGNAL(nextClicked()));

	// Buttons
	QWidget* buttonWidget = new QWidget();

	QList<QWidget*> buttons;
	buttons << backButton << nextButton;

	bool b = UiHelpers::createButtonFooter(*buttonWidget, buttons, UiHelpers::AllRight);
	Q_ASSERT(b); Q_UNUSED(b);

	mainLayout->addStretch();
	mainLayout->addWidget(buttonWidget);

	setLayout(mainLayout);
}
Example #19
0
QuestWindow::QuestWindow()
{
   QTextCodec::setCodecForTr (QTextCodec::codecForName("UTF-8"));

   layout = new QHBoxLayout();
   setLayout(layout);

   label = new QLabel(tr("TreϾ zadania"));
   //label2 = new QLabel(tr("Typ zadania"));
   button = new QPushButton(tr("Powrót"));
   button2 = new QPushButton(tr("Rozwi¹¿"));
   spacer = new QSpacerItem(100, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);

   layout->addWidget(label);
   layout->addSpacerItem(spacer);
   //layout->addWidget(label2);
   layout->addWidget(button);
   layout->addWidget(button2);

   connect(button, SIGNAL(clicked()), this, SLOT(backClicked()));
   connect(button2, SIGNAL(clicked()), this, SLOT(runClicked()));

}
Example #20
0
void PhMediaPanel::onBack()
{
	if(_clock)
		_clock->setTime(_timeIn);
	emit backClicked();
}
Example #21
0
void MythUIVirtualKeyboard::updateKeys(bool connectSignals)
{
    QList<MythUIType *> *children = GetAllChildren();
    for (int i = 0; i < children->size(); ++i)
    {
        MythUIButton *button = dynamic_cast<MythUIButton *>(children->at(i));
        if (button)
        {
            if (m_keyMap.contains(button->objectName()))
            {
                KeyDefinition key = m_keyMap.value(button->objectName());
                button->SetText(getKeyText(key));

                if (connectSignals)
                {
                    if (key.type == "shift")
                    {
                        if (!m_shiftLButton)
                            m_shiftLButton = button;
                        else if (!m_shiftRButton)
                            m_shiftRButton = button;

                        button->SetLockable(true);
                        connect(button, SIGNAL(Clicked()), SLOT(shiftClicked()));
                    }
                    else if (key.type == "char")
                        connect(button, SIGNAL(Clicked()), SLOT(charClicked()));
                    else if (key.type == "done")
                        connect(button, SIGNAL(Clicked()), SLOT(returnClicked()));
                    else if (key.type == "del")
                        connect(button, SIGNAL(Clicked()), SLOT(delClicked()));
                    else if (key.type == "lock")
                    {
                        m_lockButton = button;
                        m_lockButton->SetLockable(true);
                        connect(m_lockButton, SIGNAL(Clicked()), SLOT(lockClicked()));
                    }
                    else if (key.type == "alt")
                    {
                        m_altButton = button;
                        m_altButton->SetLockable(true);
                        connect(m_altButton, SIGNAL(Clicked()), SLOT(altClicked()));
                    }
                    else if (key.type == "comp")
                    {
                        m_compButton = button;
                        m_compButton->SetLockable(true);
                        connect(m_compButton, SIGNAL(Clicked()), SLOT(compClicked()));
                    }
                    else if (key.type == "moveleft")
                        connect(button, SIGNAL(Clicked()), SLOT(moveleftClicked()));
                    else if (key.type == "moveright")
                        connect(button, SIGNAL(Clicked()), SLOT(moverightClicked()));
                    else if (key.type == "back")
                        connect(button, SIGNAL(Clicked()), SLOT(backClicked()));
                }
            }
            else
                LOG(VB_GENERAL, LOG_WARNING,
                    QString("WARNING - Key '%1' not found in map")
                        .arg(button->objectName()));
        }
    }
}
Example #22
0
DiffDialog::DiffDialog(KConfig& cfg, QWidget *parent, bool modal)
    : QDialog(parent)
    , partConfig(cfg)
{
    markeditem = -1;
    setModal(modal);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
    connect(buttonBox, &QDialogButtonBox::helpRequested, this, &DiffDialog::slotHelp);

    QPushButton *user1Button = new QPushButton;
    buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    KGuiItem::assign(user1Button, KStandardGuiItem::saveAs());

    QGridLayout *pairlayout = new QGridLayout();
    mainLayout->addLayout(pairlayout);
    pairlayout->setRowStretch(0, 0);
    pairlayout->setRowStretch(1, 1);
    pairlayout->setColumnStretch(1, 0);
    pairlayout->addItem(new QSpacerItem(16, 0), 0, 1);
    pairlayout->setColumnStretch(0, 10);
    pairlayout->setColumnStretch(2, 10);

    revlabel1 = new QLabel;
    pairlayout->addWidget(revlabel1, 0, 0);

    revlabel2 = new QLabel;
    pairlayout->addWidget(revlabel2, 0, 2);

    diff1 = new DiffView(cfg, true, false, this);
    diff2 = new DiffView(cfg, true, true, this);
    DiffZoomWidget *zoom = new DiffZoomWidget(this);
    zoom->setDiffView(diff2);

    pairlayout->addWidget(diff1, 1, 0);
    pairlayout->addWidget(zoom,  1, 1);
    pairlayout->addWidget(diff2, 1, 2);

    diff1->setPartner(diff2);
    diff2->setPartner(diff1);

    syncbox = new QCheckBox(i18n("Synchronize scroll bars"));
    syncbox->setChecked(true);
    connect(syncbox, SIGNAL(toggled(bool)), this, SLOT(toggleSynchronize(bool)));

    itemscombo = new KComboBox;
    itemscombo->addItem(QString());
    connect(itemscombo, SIGNAL(activated(int)), this, SLOT(comboActivated(int)));

    nofnlabel = new QLabel;
    // avoids auto resize when the text is changed
    nofnlabel->setMinimumWidth(fontMetrics().width(i18np("%1 difference", "%1 differences", 10000)));

    backbutton = new QPushButton(QLatin1String("&<<"));
    connect(backbutton, SIGNAL(clicked()), SLOT(backClicked()));

    forwbutton = new QPushButton(QLatin1String("&>>"));
    connect(forwbutton, SIGNAL(clicked()), SLOT(forwClicked()));

    connect(user1Button, SIGNAL(clicked()), SLOT(saveAsClicked()));

    QBoxLayout *buttonlayout = new QHBoxLayout();
    mainLayout->addLayout(buttonlayout);
    buttonlayout->addWidget(syncbox, 0);
    buttonlayout->addStretch(4);
    buttonlayout->addWidget(itemscombo);
    buttonlayout->addStretch(1);
    buttonlayout->addWidget(nofnlabel);
    buttonlayout->addStretch(1);
    buttonlayout->addWidget(backbutton);
    buttonlayout->addWidget(forwbutton);

    mainLayout->addWidget(buttonBox);
    buttonBox->button(QDialogButtonBox::Close)->setDefault(true);

    setAttribute(Qt::WA_DeleteOnClose, true);

    KConfigGroup cg(&partConfig, "DiffDialog");
    syncbox->setChecked(cg.readEntry("Sync",false));
    restoreGeometry(cg.readEntry<QByteArray>("geometry", QByteArray()));
}
Example #23
0
QMplayer::QMplayer(QWidget *parent, Qt::WFlags f)
    : QWidget(parent)
{
#ifdef QTOPIA
    this->setWindowState(Qt::WindowMaximized);
    softm = QSoftMenuBar::menuFor(this);
    rmMpAction = softm->addAction(tr("Remove mplayer"), this, SLOT(removeMplayer()));
    rmDlAction = softm->addAction(tr("Remove youtube-dl"), this, SLOT(removeYoutubeDl()));
    rmFlvAction = softm->addAction(tr("Remove FLV videos"), this, SLOT(removeFlv()));
#else
    Q_UNUSED(f);
#endif
    lw = new QListWidget(this);
    int h = lw->fontMetrics().height();
    lw->setIconSize(QSize(h, h));

    scanItem = new QListWidgetItem(tr("Scan"), lw);
    scanItem->setSelected(true);

    sharingItem = new QListWidgetItem(tr("Sharing"), lw);

    encodingItem = new QListWidgetItem(lw);

    bOk = new QPushButton(this);
    connect(bOk, SIGNAL(clicked()), this, SLOT(okClicked()));

    bBack = new QPushButton(this);
    connect(bBack, SIGNAL(clicked()), this, SLOT(backClicked()));

    bUp = new QPushButton(this);
    connect(bUp, SIGNAL(clicked()), this, SLOT(upClicked()));

    bDown = new QPushButton(this);
    connect(bDown, SIGNAL(clicked()), this, SLOT(downClicked()));

    label = new QLabel(this);
    lineEdit = new QLineEdit(this);
    progress = new QProgressBar(this);    

    buttonLayout = new QHBoxLayout();
    buttonLayout->setAlignment(Qt::AlignBottom);
    buttonLayout->addWidget(bOk);
    buttonLayout->addWidget(bBack);
    buttonLayout->addWidget(bUp);
    buttonLayout->addWidget(bDown);

    layout = new QVBoxLayout(this);
    layout->addWidget(lw);
    layout->addWidget(label);
    layout->addWidget(lineEdit);
    layout->addWidget(progress);
    layout->addLayout(buttonLayout);

    maxScanLevel = 0;
    delTmpFiles = -1;
    useBluetooth = -1;
    process = NULL;
    tcpServer = NULL;

    ubasedir = QDir::homePath();
    QString basedir1 = QDir::homePath()+"/Documents";
    QString basedir2 = "/media/card/Documents";
    QDir dirch;
    if (dirch.exists(basedir1))
        ubasedir = basedir1;
    if (dirch.exists(basedir2))
        ubasedir = basedir2;

    tube = false;
    QStringList cl_args = QCoreApplication::arguments();
    int ac = cl_args.count();
    if (ac>1)
    {
        int tki=1;
        while(true)
        {
            QString a = cl_args[tki];
            if (a=="--mpargs")
            {
                if (ac>tki+1)
                {
                    mpargs << QString(cl_args[tki+1]).split(" ");
                }
                else
                {
                    console("Not enough parameters for '--mpargs' argument");
                }
                tki+=2;
            }
            else if (a=="--basedir")
            {
                if (ac>tki+1)
                {
                    ubasedir = cl_args[tki+1];
                }
                else
                {
                    console("Not enough parameters for '--basedir' argument");
                }
                tki+=2;
            }
            else if (a=="--youtube-dl")
            {
                tube=true;
                tki+=1;
            }
            else
            {
                mplist << a;
                tki+=1;
            }

            if (tki>=ac) break;
        }
    }

    mpgui = (mplist.count()==0);
    if (mpgui)
        showScreen(QMplayer::ScreenInit);
    else
    {
        if (tube)
        {
            while (mplist.count() > 1)
                mplist.removeLast();
            QTimer::singleShot(0, this, SLOT(sTimerEvent()));
        }
        else
        {
            this->screen = QMplayer::ScreenInit;
            okClicked();
        }
    }
}
Example #24
0
    connect(ui->actionFullscreen, SIGNAL(triggered(bool)), this, SLOT(toggleFullscreen(bool)));

    connect(ui->actionMute, SIGNAL(toggled(bool)), _mediaPlayer->osd(), SLOT(mute(bool)));
    connect(ui->actionVolumeDown, SIGNAL(triggered()), _mediaPlayer->osd(), SLOT(volumeDown()));
    connect(ui->actionVolumeUp, SIGNAL(triggered()), _mediaPlayer->osd(), SLOT(volumeUp()));

#if defined(Q_OS_LINUX)
    if (_mediaPlayer->teletextEnabled()) {
        connect(ui->actionTeletext, SIGNAL(triggered(bool)), _mediaPlayer->osd(), SLOT(teletext(bool)));
        connect(ui->actionTeletext, SIGNAL(triggered(bool)), _mediaPlayer, SLOT(teletext(bool)));
        connect(_mediaPlayer->osd(), SIGNAL(teletextClicked()), ui->actionTeletext, SLOT(trigger()));
    }
#endif

    connect(_mediaPlayer->osd(), SIGNAL(backClicked()), ui->actionBack, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(muteClicked()), ui->actionMute, SLOT(toggle()));
    connect(_mediaPlayer->osd(), SIGNAL(nextClicked()), ui->actionNext, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(playClicked()), ui->actionPlay, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(recordNowClicked()), ui->actionRecordNow, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(snapshotClicked()), ui->actionSnapshot, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(stopClicked()), ui->actionStop, SLOT(trigger()));

    connect(_xmltv, SIGNAL(current(QStringList)), _mediaPlayer->osd(), SLOT(setEpg(QStringList)));
    connect(_xmltv, SIGNAL(schedule(QString, XmltvProgrammeModel *)), _scheduleTab, SLOT(setEpg(QString, XmltvProgrammeModel *)));
    connect(_scheduleTab, SIGNAL(requestEpg(QString)), _xmltv, SLOT(request(QString)));
    connect(_scheduleTab, SIGNAL(itemSelected(QString)), _xmltv, SLOT(requestProgramme(QString)));
    connect(_xmltv, SIGNAL(programme(XmltvProgramme *)), _showInfoTab, SLOT(display(XmltvProgramme *)));
    connect(_mediaPlayer->osd(), SIGNAL(openLink(QString)), _xmltv, SLOT(requestProgramme(QString)));
    connect(_showInfoTab, SIGNAL(requestNext(QString, QString)), _xmltv, SLOT(requestProgrammeNext(QString, QString)));
    connect(_showInfoTab, SIGNAL(requestPrevious(QString, QString)), _xmltv, SLOT(requestProgrammePrevious(QString, QString)));