ConfigDialog::ConfigDialog(QWidget* parent)
: KConfigDialog(parent, "Settings", GwenviewConfig::self())
, d(new ConfigDialogPrivate)
{
    setFaceType(KPageDialog::List);
    setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Default);
    showButtonSeparator(true);

    QWidget* widget;
    KPageWidgetItem* pageItem;

    // General
    widget = setupPage(d->mGeneralConfigPage);
    pageItem = addPage(widget, i18n("General"));
    pageItem->setIcon(KIcon("gwenview"));
    connect(d->mGeneralConfigPage.kcfg_ViewBackgroundValue, SIGNAL(valueChanged(int)), SLOT(updateViewBackgroundFrame()));

    // Image View
    widget = setupPage(d->mImageViewConfigPage);

    d->mAlphaBackgroundModeGroup = new InvisibleButtonGroup(widget);
    d->mAlphaBackgroundModeGroup->setObjectName(QLatin1String("kcfg_AlphaBackgroundMode"));
    d->mAlphaBackgroundModeGroup->addButton(d->mImageViewConfigPage.checkBoardRadioButton, int(RasterImageView::AlphaBackgroundCheckBoard));
    d->mAlphaBackgroundModeGroup->addButton(d->mImageViewConfigPage.solidColorRadioButton, int(RasterImageView::AlphaBackgroundSolid));

    d->mWheelBehaviorGroup = new InvisibleButtonGroup(widget);
    d->mWheelBehaviorGroup->setObjectName(QLatin1String("kcfg_MouseWheelBehavior"));
    d->mWheelBehaviorGroup->addButton(d->mImageViewConfigPage.mouseWheelScrollRadioButton, int(MouseWheelBehavior::Scroll));
    d->mWheelBehaviorGroup->addButton(d->mImageViewConfigPage.mouseWheelBrowseRadioButton, int(MouseWheelBehavior::Browse));

    d->mAnimationMethodGroup = new InvisibleButtonGroup(widget);
    d->mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.glAnimationRadioButton, int(DocumentView::GLAnimation));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.softwareAnimationRadioButton, int(DocumentView::SoftwareAnimation));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.noAnimationRadioButton, int(DocumentView::NoAnimation));

    d->mThumbnailBarOrientationGroup = new InvisibleButtonGroup(widget);
    d->mThumbnailBarOrientationGroup->setObjectName(QLatin1String("kcfg_ThumbnailBarOrientation"));
    d->mThumbnailBarOrientationGroup->addButton(d->mImageViewConfigPage.horizontalRadioButton, int(Qt::Horizontal));
    d->mThumbnailBarOrientationGroup->addButton(d->mImageViewConfigPage.verticalRadioButton, int(Qt::Vertical));

    pageItem = addPage(widget, i18n("Image View"));
    pageItem->setIcon(KIcon("view-preview"));

    // Advanced
    widget = setupPage(d->mAdvancedConfigPage);
    pageItem = addPage(widget, i18n("Advanced"));
    pageItem->setIcon(KIcon("preferences-other"));
    d->mAdvancedConfigPage.cacheHelpLabel->setFont(KGlobalSettings::smallestReadableFont());

    updateViewBackgroundFrame();
}
Esempio n. 2
0
void PdfView::zoomOut() {
  if (scalerIndex > 0) {
    scalerIndex--;
    _pageImage = QPixmap();
    setupPage(pageIndex());
    update();
  }
}
Esempio n. 3
0
void PdfView::zoomIn() {
  if (scalerIndex < scalingStrategies.size() - 1) {
    scalerIndex++;
    _pageImage = QPixmap();
    setupPage(pageIndex());
    update();
  }
}
Esempio n. 4
0
KDMSessionsWidget::KDMSessionsWidget(QWidget *parent, const char *name, bool init)
  : KConfigWidget(parent, name)
{
      gui = !init;
      loadSettings();      
      if(gui)
        setupPage(parent);
}
Esempio n. 5
0
void TDPreviewDialog::on_setupToolButton_clicked()
{
        QPageSetupDialog *dialog;
        dialog = new QPageSetupDialog(printer, this);
        if (dialog->exec() == QDialog::Rejected) {
                return;
        }
        setupPage();
        on_pageSpinBox_valueChanged(1);
        setupSpinBox();
}
Esempio n. 6
0
void dumpFigUml(Module *module)
{
    SmiModule    *smiModule;
    int		 x, y;

    smiModule = module->smiModule;

    setupPage();

    x = X_OFFSET, y = Y_OFFSET;
    printClasses(&x, &y, smiModule);
}
Esempio n. 7
0
void dumpFigTree(Module *module)
{
    SmiModule    *smiModule;
    int		 x, y;

    smiModule = module->smiModule;

    setupPage();

    x = X_OFFSET, y = Y_OFFSET;
    printGroups(&x, &y, smiModule);
}
Esempio n. 8
0
/**
 *  Sets up the ClassifierListPage.
 *  @param parent      The parent to the ClassAttPage.
 *  @param classifier  The Concept to display the properties of.
 *  @param doc         The UMLDoc document
 *  @param type        The type of listItem this handles
 */
ClassifierListPage::ClassifierListPage(QWidget* parent, UMLClassifier* classifier,
                                       UMLDoc* doc, UMLObject::ObjectType type)
  : DialogPageBase(parent)
{
    m_itemType = type;
    m_bSigWaiting = false;
    m_doc = doc;
    m_pClassifier = classifier;
    m_pMenu = 0;

    setupPage();
}
Esempio n. 9
0
bool PdfView::setDocument(const QString &path) {
  Poppler::Document *oldDoc = doc;

  doc = Poppler::Document::load(path);
  delete oldDoc;

  if (doc) {
    doc->setRenderHint(Poppler::Document::Antialiasing);
    doc->setRenderHint(Poppler::Document::TextAntialiasing);
    contentsChanged(QUrl::fromLocalFile(path));
    _pageImage = QPixmap();
    setupPage(pageIndex());
  }

  return doc;
}
Esempio n. 10
0
bool Weather::keyPressEvent(QKeyEvent *event)
{
    if (GetFocusWidget() && GetFocusWidget()->keyPressEvent(event))
        return true;

    bool handled = false;
    QStringList actions;
    handled = GetMythMainWindow()->TranslateKeyPress("Weather", event, actions);

    for (int i = 0; i < actions.size() && !handled; i++)
    {
        QString action = actions[i];
        handled = true;

        if (action == "LEFT")
            cursorLeft();
        else if (action == "RIGHT")
            cursorRight();
        else if (action == "PAUSE")
            holdPage();
        else if (action == "MENU")
            setupPage();
        else if (action == "UPDATE")
        {
            m_srcMan->doUpdate();
        }
        else if (action == "ESCAPE")
        {
            m_nextpage_Timer->stop();
            hideScreen();
            Close();
        }
        else
            handled = false;
    }

    if (!handled && MythScreenType::keyPressEvent(event))
        handled = true;

    return handled;
}
void WebApplicationWindow::onLoadingChanged(QWebLoadRequest *request)
{
    qDebug() << Q_FUNC_INFO << "id" << mApplication->id() << "status" << request->status();

    switch (request->status()) {
    case QQuickWebView::LoadStartedStatus:
        setupPage();
        return;
    case QQuickWebView::LoadStoppedStatus:
    case QQuickWebView::LoadFailedStatus:
        return;
    case QQuickWebView::LoadSucceededStatus:
        break;
    }

    Q_FOREACH(BaseExtension *extension, mExtensions.values())
        extension->initialize();

    // If we're a headless app we don't show the window and in case of an
    // application with an remote entry point it's already visible at
    // this point
    if (mHeadless || mApplication->hasRemoteEntryPoint())
        return;

    // if the framework  called us with an explicit stagePreparing call we
    // will wait for the call to stageReady to come in
    if (mStagePreparing && !mStageReady) {
        if (!mWindow->isVisible() && !mStageReadyTimer.isActive()) {
            qDebug() << Q_FUNC_INFO << "id" << mApplication->id() << "kicking stage ready timer";
            mStageReadyTimer.start(3000);
        }
        else {
            qDebug() << Q_FUNC_INFO << "id" << mApplication->id() << "omitting stage ready timer as alreay active or window visible";
        }
        return;
    }

    if (!mWindow->isVisible())
        mWindow->show();
}
Esempio n. 12
0
TablePrintDialog::TablePrintDialog(QTableView *p_tableView, QPrinter * p_printer, QWidget *parent)
  : QDialog(parent)
  , tableView(p_tableView)
  , printer(p_printer)
  , gridMode(NoGrid)
  , lines(0)
  , pages(0)
  , leftMargin(80)
  , rightMargin(80)
  , topMargin(40)
  , bottomMargin(40)
  , spacing(4)
  , headerSize(60)
  , footerSize(60)
  , sceneZoomFactor(100)
  , columnZoomFactor(0.65)
  , rowHeight(0)
  , columnMultiplier(0)
  , model(tableView->model())
  , titleFmt(NULL)
  , headerFmt(NULL)
  , fmt(NULL)
{
  //setup printer
  printer->setFullPage(true);
  switch (QLocale::system().country())
  {
  case QLocale::AnyCountry:
  case QLocale::Canada:
  case QLocale::UnitedStates:
  case QLocale::UnitedStatesMinorOutlyingIslands:
    printer->setPageSize(QPrinter::Letter);
    break;
  default:
    printer->setPageSize(QPrinter::A4);
    break;
  }


  setHeaderText("Document");
  footerText=trUtf8("Page: ");


  //get column widths
  for (int i=0; i<model->columnCount(); i++)
  {
    int colWidth=tableView->columnWidth(i);
    colSizes.append(QTextLength(QTextLength::FixedLength,colWidth));
  }

  //title font
  titleFont=tableView->font();
  titleFont.setPointSize(24);
  titleFont.setBold(false);
  titleFont.setUnderline(false);
  titleFmt =new QFontMetrics(titleFont);


  //header font
  headerFont=tableView->font();
  headerFont.setBold(true);
  headerFont.setUnderline(true);
  headerFont.setPointSize(9);
  headerFmt =new QFontMetrics(headerFont);

  //normal font
  font=tableView->font();
  headerFont.setPointSize(9);
  fmt = new QFontMetrics(font);


  QString date=QDate::currentDate().toString(QLocale().dateFormat());
  QString time=QTime::currentTime().toString(QLocale().timeFormat(QLocale::ShortFormat));
  headerStdText = date+"  "+time;

  setupPage();
  columnMultiplier=pageScene.width()/tableView->width()*columnZoomFactor;
}
Esempio n. 13
0
void TablePrintDialog::print()
{
  //printDialog
  printer->setFromTo(1,pages);
  printer->setOutputFormat(QPrinter::NativeFormat);
  printer->setOutputFileName("");
  QPrintDialog dialog(printer, this);
  dialog.setWindowTitle("Print Document");
  if (dialog.exec() == QDialog::Rejected)
  {
    return;
  }
  setupPage();


  // get num copies
  int doccopies;
  int pagecopies;
  if (printer->collateCopies())
  {
    doccopies = 1;
    pagecopies = printer->numCopies();
  }
  else
  {
    doccopies = printer->numCopies();
    pagecopies = 1;
  }

  // get page range
  int firstpage = printer->fromPage();
  int lastpage = printer->toPage();
  if (firstpage == 0 && lastpage == 0)  // all pages
  {
    firstpage = 1;
    lastpage =pages;
  }

  // print order
  bool ascending = true;
  if (printer->pageOrder() == QPrinter::LastPageFirst)
  {
    int tmp = firstpage;
    firstpage = lastpage;
    lastpage = tmp;
    ascending = false;
  }

  // loop through and print pages
  QPainter painter(printer);
  for (int dc=0; dc<doccopies; dc++)
  {
    int pagenum = firstpage;
    while (true)
    {
      for (int pc=0; pc<pagecopies; pc++)
      {
        if (printer->printerState() == QPrinter::Aborted ||
            printer->printerState() == QPrinter::Error)
        {
          break;
        }
        // print page
        paintPage(pagenum);
        pageScene.render(&painter);
        if (pc < pagecopies-1) printer->newPage();
      }

      if (pagenum == lastpage) break;
      if (ascending)
      {
        pagenum++;
      }
      else
      {
        pagenum--;
      }
      printer->newPage();
    }

    if (dc < doccopies-1)
      printer->newPage();
  }

}
Esempio n. 14
0
void PdfView::resizeEvent(QResizeEvent *event) {
  RDocView::resizeEvent(event);
  _pageImage = QPixmap();
  setupPage(pageIndex());
}
Esempio n. 15
0
TDPreviewDialog::TDPreviewDialog(QTableView *p_tableView, QPrinter * p_printer, const QString &titulo, QWidget *parent) : QDialog(parent)
{
        //variables
        titulol=titulo+" : Vista previa de Impresion";
        titulopdf=titulo;
        tableView=p_tableView;
        leftMargin=80;
        rightMargin=80;
        topMargin=40;
        bottomMargin=40;
        spacing=4;
        headerSize=60;
        footerSize=60;
        sceneZoomFactor=100;
        columnZoomFactor=0.65;
        gridMode=NoGrid;

        model= tableView->model();

        //setup printer
        printer=p_printer;
        printer->setFullPage(true);
        switch (QLocale::system().country()) {
        case QLocale::AnyCountry:
        case QLocale::UnitedStates:
        case QLocale::UnitedStatesMinorOutlyingIslands:
                printer->setPageSize(QPrinter::A4);
                break;
        default:
                printer->setPageSize(QPrinter::Letter);
                break;
        }

        setHeaderText(titulo);
        footerText=trUtf8("Pagina: ");

        //get column widths
        for (int i=0; i<model->columnCount(); i++) {
                int colWidth=tableView->columnWidth(i);
                colSizes.append(QTextLength(QTextLength::FixedLength,colWidth));
        }

        //title font
        titleFont=tableView->font();
        titleFont.setPointSize(24);
        titleFont.setBold(false);
        titleFont.setUnderline(false);
        titleFmt =new QFontMetrics(titleFont);



        //header font
        headerFont=tableView->font();
        headerFont.setBold(true);
        headerFont.setUnderline(true);
        headerFont.setPointSize(9);
        headerFmt =new QFontMetrics(headerFont);

        //normal font
        font=tableView->font();
        headerFont.setPointSize(9);
        fmt =new  QFontMetrics(font);


        QString date=QDate::currentDate().toString(QLocale().dateFormat());
        QString time=QTime::currentTime().toString(QLocale().timeFormat(QLocale::ShortFormat));
        headerStdText = date+"  "+time;

        setupPage();
        columnMultiplier=pageScene.width()/tableView->width()*columnZoomFactor;
}
Esempio n. 16
0
/**
 * Constructor.
 */
ActivityPage::ActivityPage(QWidget * pParent, StateWidget * pWidget)
  : DialogPageBase(pParent)
{
    m_pStateWidget = pWidget;
    setupPage();
}