Ejemplo n.º 1
0
PageSettingDlg::PageSettingDlg(QWidget *parent) : QDialog(parent), ui(new Ui::PageSettingDlg) {
    ui->setupUi(this);
    QObject::connect(ui->rLandscape, SIGNAL(clicked()), this, SLOT(changeOrientation()));
    QObject::connect(ui->rPortrait, SIGNAL(clicked()), this, SLOT(changeOrientation()));
    QObject::connect(ui->cbPageSize, SIGNAL(currentIndexChanged(int)), this, SLOT(pageSizeChanged(int)));
    QObject::connect(ui->btnBorderColor, SIGNAL(clicked()), this, SLOT(selectColor()));
    ui->chkDrawBorder->setChecked(false);
    ui->spnBorderWidth->setValue(1);
    ui->lblBorderColor->setStyleSheet("QLabel {background-color: black}");
    
    for (int i=1; i < 7; i++) {
        QIcon icon;
        icon.addPixmap(QPixmap(QString::fromUtf8(":/new/prefix1/images/fs%1.png").arg(i)), QIcon::Normal, QIcon::On);
        ui->cmbBorderStyle->addItem(icon,"", i);
    }
}
Ejemplo n.º 2
0
LapsusApplet::LapsusApplet( const QString& configFile, Type t, QWidget *parent, const char *name )
	: KPanelApplet( configFile, t,
	KPanelApplet::About | KPanelApplet::Preferences | KPanelApplet::ReportBug,
	parent, name ),
	_cfg("lapsusrc"),
	_layout(0), _mainWidget(0), _orientation(orientation()),
	_aboutDlg(0), _bugDlg(0), _confDlg(0),
	_aboutData( "lapsus", I18N_NOOP("Lapsus Panel Applet"),
                         LAPSUS_VERSION,
                         I18N_NOOP("Lapsus provides easy access to additional\nfeatures of ASUS and IBM/Lenovo laptops."),
                         KAboutData::License_GPL,
                         "© 2007 Jakub Schmidtke",
                         0, "http://lapsus.berlios.de", "*****@*****.**" )
{
	LapsusDBus::create();
	
	KGlobal::dirs()->addResourceType( "appicon", KStandardDirs::kde_default("data") + "lapsus/pics" );

	setBackgroundMode(X11ParentRelative);

	_layout = new QHBoxLayout(this);

	changeOrientation(_orientation);
	
	_aboutData.setTranslator(
		I18N_NOOP("_: NAME OF TRANSLATORS\\nYour names"),
		I18N_NOOP("_: EMAIL OF TRANSLATORS\\nYour emails"));
	
	_aboutData.addAuthor("Jakub Schmidtke", 0, "*****@*****.**");
	
	_aboutData.addCredit("Sebastian Herbord",  I18N_NOOP("Light Sensor support"), "*****@*****.**");
}
Ejemplo n.º 3
0
void LapsusApplet::preferences()
{
	if (_confDlg) delete _confDlg;
	
	_confDlg = new LapsusConfDialog(0, &_cfg);
	
	int ret = _confDlg->exec();
	
	delete _confDlg;
	_confDlg = 0;
	
	if (ret == QDialog::Accepted)
		changeOrientation(_orientation);
}
Ejemplo n.º 4
0
int QDeclarativeViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setDesignModeBehavior((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: sceneResized((*reinterpret_cast< QSize(*)>(_a[1]))); break;
        case 2: { bool _r = open((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 3: openFile(); break;
        case 4: openUrl(); break;
        case 5: reload(); break;
        case 6: takeSnapShot(); break;
        case 7: toggleRecording(); break;
        case 8: toggleRecordingWithSelection(); break;
        case 9: ffmpegFinished((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 10: showProxySettings(); break;
        case 11: proxySettingsChanged(); break;
        case 12: rotateOrientation(); break;
        case 13: statusChanged(); break;
        case 14: pauseAnimations(); break;
        case 15: stepAnimations(); break;
        case 16: setAnimationStep(); break;
        case 17: changeAnimationSpeed(); break;
        case 18: launch((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 19: appAboutToQuit(); break;
        case 20: autoStartRecording(); break;
        case 21: autoStopRecording(); break;
        case 22: recordFrame(); break;
        case 23: chooseRecordingOptions(); break;
        case 24: pickRecordingFile(); break;
        case 25: toggleFullScreen(); break;
        case 26: changeOrientation((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
        case 27: orientationChanged(); break;
        case 28: animationSpeedChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 29: showWarnings((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 30: warningsWidgetOpened(); break;
        case 31: warningsWidgetClosed(); break;
        default: ;
        }
        _id -= 32;
    }
    return _id;
}
Ejemplo n.º 5
0
void GlutSensorEmulatorDevice::handleAxesChange(float deltaX, float deltaY) {
	if (useOrientation)
		changeOrientation(deltaX, deltaY);
	else
		changeTranslation(deltaX, deltaY);
} // handleAxesChange
TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model,
                                                 QObject *parent)
    :
    QObject(parent),
    mVisibilityPublisher(TsProperty::KTsPath),
    mDismissRequestSubscriber(QString("%1/%2").arg(TsProperty::KTsPath).arg(TsProperty::KDismissRequestPath))
{
    bool ok(true);
    mLoader.load(KDocmlPath, &ok);
    Q_ASSERT(ok);

    HbDialog *dialog =
        qobject_cast<HbDialog *>(mLoader.findWidget("tsdevicedialog"));
    TsTasksGrid *grid =
        qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
    Q_ASSERT(dialog);
    Q_ASSERT(grid);
    
    bool cssLoaded = HbStyleLoader::registerFilePath(":/resource/hbdialog.css");
    Q_ASSERT(cssLoaded);
    {
        HbLabel *dialogHeading = qobject_cast<HbLabel *>(dialog->headingWidget());
        Q_ASSERT(dialogHeading);
        HbFrameDrawer *headingFrame = new HbFrameDrawer(QLatin1String("qtg_fr_popup_heading"), HbFrameDrawer::ThreePiecesHorizontal);
        dialogHeading->setBackgroundItem(new HbFrameItem(headingFrame));
    }

    grid->setEnabledAnimations(HbAbstractItemView::None);
    grid->setModel(model);

    changeOrientation(dialog->mainWindow()->orientation());
    switchViewOnModelChange();

    // needed because of Qt::QueuedConnection used below
    // @todo: check if we actually need queued connections
    qRegisterMetaType<QModelIndex>("QModelIndex");

    // connect the grid and model
    connect(grid,
            SIGNAL(activated(QModelIndex)),
            model,
            SLOT(openApplication(QModelIndex)));
    connect(grid,
            SIGNAL(activated(QModelIndex)),
            dialog,
            SLOT(close()));
    connect(grid,
            SIGNAL(deleteButtonClicked(QModelIndex)),
            model, SLOT(closeApplication(QModelIndex)),
            Qt::QueuedConnection);

    connect(dialog->mainWindow(),
            SIGNAL(orientationChanged(Qt::Orientation)),
            this,
            SLOT(changeOrientation(Qt::Orientation)));
    connect(dialog,
            SIGNAL(aboutToClose()),
            this,
            SIGNAL(deviceDialogClosed()));

    // switch between grid and "no items" label when model is updated
    connect(model, SIGNAL(modelReset()), this, SLOT(switchViewOnModelChange()));
    connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(switchViewOnModelChange()));
    connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(switchViewOnModelChange()));

    connect(this,
            SIGNAL(deviceDialogClosed()),
            this,
            SLOT(notifyDialogClosed()));
    mVisibilityPublisher.setValue(TsProperty::KVisibilityPath,
                                  static_cast<int>(true));
    mVisibilityPublisher.sync();

    connect(&mDismissRequestSubscriber,
            SIGNAL(contentsChanged()),
            this,
            SLOT(handleDismissRequest()));
}