Esempio n. 1
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent)
{
    m_preRenderer = 0;
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_scrollArea);
    layout()->addWidget(m_pageSelector);

    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));


    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("pgzkexirpt_print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Open in KWord"), this));
    a->setObjectName("pgzkexirpt_open_kword");
    a->setToolTip(i18n("Open the report in KWord"));
    a->setWhatsThis(i18n("Opens the current report in KWord."));
    a->setEnabled(false);
//! @todo connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKWord()));

#ifdef HAVE_KSPREAD
    viewActions << (a = new KAction(KIcon("kspread"), i18n("Open in KSpread"), this));
    a->setObjectName("pgzkexirpt_open_kspread");
    a->setToolTip(i18n("Open the report in KSpread"));
    a->setWhatsThis(i18n("Opens the current report in KSpread."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));
#endif

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export to HTML"), this));
    a->setObjectName("pgzkexirpt_export_html");
    a->setToolTip(i18n("Export the report to HTML"));
    a->setWhatsThis(i18n("Exports the report to a HTML file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);


    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));

}
Esempio n. 2
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0), m_kexi(0), m_functions(0)
{   
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    layout()->addWidget(m_scrollArea);
    
#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_pageSelector);
    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));
#endif
    
    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Save to KWord"), this));
    a->setObjectName("save_to_kword");
    a->setToolTip(i18n("Save the report to a KWord document"));
    a->setWhatsThis(i18n("Save the report to a KWord document"));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderODT()));

    viewActions << (a = new KAction(KIcon("kspread"), i18n("Save to KSpread"), this));
    a->setObjectName("save_to_kspread");
    a->setToolTip(i18n("Save the report to a KSpread document"));
    a->setWhatsThis(i18n("Saves the current report to a KSpread document."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export as Web Page"), this));
    a->setObjectName("export_as_web_page");
    a->setToolTip(i18n("Export the report as web page"));
    a->setWhatsThis(i18n("Exports the report to a web page file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
Esempio n. 3
0
MainWindow::MainWindow(QWidget *parent) :
	QDialog(parent)
{
	nextButton = new QPushButton(tr("next"));
	nextButton->setDisabled(true);
	connect(nextButton, SIGNAL(clicked()), this, SLOT(nextButtonClicked()));

	prevButton = new QPushButton(tr("prev"));
	connect(prevButton, SIGNAL(clicked()), this, SLOT(prevButtonClicked()));
	prevButton->setDisabled(true);

	plusButton = new QPushButton(tr("+"));
	connect(plusButton, SIGNAL(clicked()), this, SLOT(plusButtonClicked()));
	plusButton->setDisabled(true);

	minusButton = new QPushButton(tr("-"));
	connect(minusButton, SIGNAL(clicked()), this, SLOT(minusButtonClicked()));
	minusButton->setDisabled(true);

	tooOldButton = new QPushButton(tr("[:|||:]"));
	connect(tooOldButton, SIGNAL(clicked()), this, SLOT(toOldButtonClicked()));
	tooOldButton->setDisabled(true);

	gotoButton = new QPushButton(tr("Go to this quote"));
	connect(gotoButton, SIGNAL(clicked()), this, SLOT(gotoButtonClicked()));
	gotoButton->setDisabled(true);

	loadButton = new QPushButton(tr("load"));
	connect(loadButton, SIGNAL(clicked()), this, SLOT(loadButtonClicked()));

	NumberOfCurrentQuote = new QLineEdit;
	//NumberOfCurrentQuote->setDisabled(true);

	currentRating = new QLineEdit;
	currentRating->setDisabled(true);

	currentQuote = new QTextEdit;
	currentQuote->setDisabled(true);

	label1 = new QLabel;
	label2 = new QLabel;

	label1->setText("rating");
	label2->setText("number of quote");

	setWindowTitle(tr("Bash.im"));

	QHBoxLayout *buttonLayout1 = new QHBoxLayout;
	buttonLayout1->addWidget(minusButton);
	buttonLayout1->addWidget(tooOldButton);
	buttonLayout1->addWidget(plusButton);
	buttonLayout1->addWidget(label1);
	buttonLayout1->addWidget(currentRating);

	QHBoxLayout *buttonLayout2 = new QHBoxLayout;
	buttonLayout2->addWidget(loadButton);
	buttonLayout2->addWidget(prevButton);
	buttonLayout2->addWidget(nextButton);

	QHBoxLayout *buttonLayout3 = new QHBoxLayout;
	buttonLayout3->addWidget(label2);
	buttonLayout3->addWidget(NumberOfCurrentQuote);
	buttonLayout3->addWidget(gotoButton);

	QVBoxLayout *mainLayout = new QVBoxLayout;
	mainLayout->addLayout(buttonLayout1);
	mainLayout->addLayout(buttonLayout2);
	mainLayout->addWidget(currentQuote);
	mainLayout->addLayout(buttonLayout3);

	setLayout(mainLayout);
}
void KexiRecordNavigator::slotPrevButtonClicked()
{
    emit prevButtonClicked();
    if (d->handler)
        d->handler->moveToPreviousRecordRequested();
}
Esempio n. 5
0
KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0) //! @todo KEXI3, m_kexi(0), m_functions(0)
{
    setObjectName("KexiReportDesigner_DataView");

    m_reportView = new KReportView(this);
    layout()->addWidget(m_reportView);

#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(*m_reportView->scrollArea(), m_reportView);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setInsertingEnabled(false);
    m_pageSelector->setLabelText(xi18nc("Page selector label", "Page:"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonFirst, xi18n("Go to first page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonFirst, xi18n("Goes to first page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonPrevious, xi18n("Go to previous page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonPrevious, xi18n("Goes to previous page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonNext, xi18n("Go to next page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonNext, xi18n("Goes to next page"));
    m_pageSelector->setButtonToolTipText(KexiRecordNavigator::ButtonLast, xi18n("Go to last page"));
    m_pageSelector->setButtonWhatsThisText(KexiRecordNavigator::ButtonLast, xi18n("Goes to last page"));
    m_pageSelector->setNumberFieldToolTips(xi18n("Current page number"), xi18n("Number of pages"));
    m_pageSelector->setRecordHandler(this);
#endif

    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;

#ifndef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("document-print"), xi18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(xi18n("Print report"));
    a->setWhatsThis(xi18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    KActionMenu *exportMenu = new KActionMenu(koIcon("document-export"), xi18nc("@title:menu","E&xport As"), this);
    exportMenu->setObjectName("report_export_as");
    exportMenu->setDelayed(false);
#endif

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(xi18n("Export:"), this));
    a->setEnabled(false); //!TODO this is a bit of a dirty way to add what looks like a label to the toolbar!
    // " ", not "", is said to be needed in maemo, the icon didn't display properly without it
    viewActions << (a = new QAction(koIcon("application-vnd.oasis.opendocument.text"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-vnd.oasis.opendocument.text"),
                                          xi18nc("open dialog to export as text document", "Text Document..."), this));
#endif
    a->setObjectName("export_as_text_document");
    a->setToolTip(xi18n("Export the report as a text document (in OpenDocument Text format)"));
    a->setWhatsThis(xi18n("Exports the report as a text document (in OpenDocument Text format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsTextDocument()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("application-pdf"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-pdf"),
                                          xi18nc("Portable Document Format...", "PDF..."), this));
#endif
    a->setObjectName("export_as_pdf");
    a->setToolTip(xi18n("Export as PDF"));
    a->setWhatsThis(xi18n("Exports the current report as PDF."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsPdf()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("application-vnd.oasis.opendocument.spreadsheet"),
                                          xi18nc("open dialog to export as spreadsheet", "Spreadsheet..."), this));
#endif
    a->setObjectName("export_as_spreadsheet");
    a->setToolTip(xi18n("Export the report as a spreadsheet (in OpenDocument Spreadsheet format)"));
    a->setWhatsThis(xi18n("Exports the report as a spreadsheet (in OpenDocument Spreadsheet format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsSpreadsheet()));

#ifdef KEXI_MOBILE
    viewActions << (a = new QAction(koIcon("text-html"), QLatin1String(" "), this));
#else
    exportMenu->addAction(a = new QAction(koIcon("text-html"),
                                          xi18nc("open dialog to export as web page", "Web Page..."), this));
#endif
    a->setObjectName("export_as_web_page");
    a->setToolTip(xi18n("Export the report as a web page (in HTML format)"));
    a->setWhatsThis(xi18n("Exports the report as a web page (in HTML format)."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportAsWebPage()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    // setup main menu actions
    QList<QAction*> mainMenuActions;

    mainMenuActions << exportMenu;

    setMainMenuActions(mainMenuActions);

    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
Esempio n. 6
0
QmlView::QmlView(QUrl source, QWidget *parent, MafwRegistryAdapter *mafwRegistry ) :
    QMainWindow(parent),
    ui(new Ui::QmlView),
    mafwRegistry(mafwRegistry),
    mafwRenderer(mafwRegistry->renderer())
{
    ui->setupUi(this);
    ui->declarativeView->setSource(source);
    ui->declarativeView->setResizeMode(QDeclarativeView::SizeRootObjectToView);

    setAttribute(Qt::WA_DeleteOnClose);
    setAttribute(Qt::WA_Maemo5StackedWindow);
    setAttribute(Qt::WA_Maemo5NonComposited);

    QGLWidget *glWidget = new QGLWidget(this);
    ui->declarativeView->setViewport(glWidget);

    positionTimer = new QTimer(this);
    positionTimer->setInterval(1000);

    fmtx = new FMTXInterface(this);

    Rotator *rotator = Rotator::acquire();
    savedPolicy = rotator->policy();
    rotator->setPolicy(Rotator::Landscape);

    rootObject = dynamic_cast<QObject*>(ui->declarativeView->rootObject());
    rootObject->setParent(this);

    connect(rootObject, SIGNAL(quitButtonClicked()), this, SLOT(close()));
    connect(rootObject, SIGNAL(prevButtonClicked()), mafwRenderer, SLOT(previous()));
    connect(rootObject, SIGNAL(playButtonClicked()), this, SLOT(onPlayClicked()));
    connect(rootObject, SIGNAL(nextButtonClicked()), mafwRenderer, SLOT(next()));
    connect(rootObject, SIGNAL(fmtxButtonClicked()), this, SLOT(onFmtxClicked()));
    connect(rootObject, SIGNAL(sliderValueChanged(int)), this, SLOT(onSliderValueChanged(int)));
    connect(rootObject, SIGNAL(playlistItemSelected(int)), this, SLOT(onPlaylistItemChanged(int)));

    connect(this, SIGNAL(titleChanged(QVariant)), rootObject, SLOT(setSongTitle(QVariant)));
    connect(this, SIGNAL(albumChanged(QVariant)), rootObject, SLOT(setSongAlbum(QVariant)));
    connect(this, SIGNAL(artistChanged(QVariant)), rootObject, SLOT(setSongArtist(QVariant)));
    connect(this, SIGNAL(albumArtChanged(QVariant)), rootObject, SLOT(setAlbumArt(QVariant)));
    connect(this, SIGNAL(durationTextChanged(QVariant)), rootObject, SLOT(setPosition(QVariant)));
    connect(this, SIGNAL(positionChanged(QVariant)), rootObject, SLOT(setSliderValue(QVariant)));
    connect(this, SIGNAL(durationChanged(QVariant)), rootObject, SLOT(setSliderMaximum(QVariant)));
    connect(this, SIGNAL(stateIconChanged(QVariant)), rootObject, SLOT(setPlayButtonIcon(QVariant)));
    connect(this, SIGNAL(rowChanged(QVariant)), rootObject, SLOT(onRowChanged(QVariant)));
    connect(this, SIGNAL(fmtxStateChanged(QVariant)), rootObject, SLOT(onFmtxStateChanged(QVariant)));

    connect(this, SIGNAL(playlistItemAppended(QVariant,QVariant,QVariant)),
            rootObject, SLOT(appendPlaylistItem(QVariant,QVariant,QVariant)));
    connect(this, SIGNAL(playlistItemInserted(QVariant,QVariant,QVariant,QVariant)),
            rootObject, SLOT(insertPlaylistItem(QVariant,QVariant,QVariant,QVariant)));
    connect(this, SIGNAL(playlistItemSet(QVariant,QVariant,QVariant,QVariant)),
            rootObject, SLOT(setPlaylistItem(QVariant,QVariant,QVariant,QVariant)));
    connect(this, SIGNAL(playlistItemRemoved(QVariant)),
            rootObject, SLOT(removePlaylistItem(QVariant)));
    connect(this, SIGNAL(playlistCleared()),
            rootObject, SLOT(clearPlaylist()));

    connect(mafwRenderer, SIGNAL(stateChanged(MafwPlayState)), this, SLOT(onStateChanged(MafwPlayState)));
    connect(mafwRenderer, SIGNAL(positionReceived(int,QString)), this, SLOT(onPositionChanged(int)));
    connect(mafwRenderer, SIGNAL(statusReceived(MafwPlaylist*,uint,MafwPlayState,QString,QString)),
            this, SLOT(onStatusReceived(MafwPlaylist*,uint,MafwPlayState)));
    connect(positionTimer, SIGNAL(timeout()), mafwRenderer, SLOT(getPosition()));

    connect(fmtx, SIGNAL(propertyChanged()), this, SLOT(onFmtxChanged()));
    onFmtxChanged();

    positionTimer->start();

    quint32 disable = {0};
    Atom winPortraitModeSupportAtom = XInternAtom(QX11Info::display(), "_HILDON_PORTRAIT_MODE_SUPPORT", false);
    XChangeProperty(QX11Info::display(), winId(), winPortraitModeSupportAtom, XA_CARDINAL, 32, PropModeReplace, (uchar*) &disable, 1);

    this->setDNDAtom(true);

    mafwRenderer->getStatus();
    mafwRenderer->getPosition();
}