Beispiel #1
0
MyFracWindow::MyFracWindow() : KDockMainWindow(NULL, "mainwnd", WType_TopLevel),
	_posValid(false),
	_juliaMode(false),
	_maxIter(0.5),
	_threshold(0.5),
	_gradientData(NULL),
	_scrollTimer(NULL),
	_scrollDir(0),
	_generator(this, false),
	_progressDialog(NULL)
{
	KImageIO::registerFormats();

	generatorThread.start(QThread::LowPriority);

	createWidgets();
	createActions();
	createGUI();

	_presets.loadPresets(kapp->config());
	readParameters();

	onDefaultView();
	updateMode();

	_scrollTimer = new QTimer(this);
	connect(_scrollTimer, SIGNAL(timeout()), SLOT(scrollTimer()));

	resize(700, 520);

	setAutoSaveSettings();
	readDockConfig();
}
Beispiel #2
0
void MainWindow::setToolViewStyle(int flag)
{
  d->m_styleIDEAlMode = flag; // see KMultiTabBar for the first 3 bits

  DockContainer *tmpL=(DockContainer*) (m_leftContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpL) tmpL->setStyle(flag);

  DockContainer *tmpR=(DockContainer*) (m_rightContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpR) tmpR->setStyle(flag);

  DockContainer *tmpT=(DockContainer*) (m_topContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpT) tmpT->setStyle(flag);

  DockContainer *tmpB=(DockContainer*) (m_bottomContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpB) tmpB->setStyle(flag);

  d->m_toolviewStyle = flag;
  bool toolviewExists = false;
  QMap<QWidget*,KMDI::ToolViewAccessor*>::Iterator it;
  for (it = m_toolViews->begin(); it != m_toolViews->end(); ++it) {
    KDockWidget *dockWidget = dynamic_cast<KDockWidget*>(it.data()->wrapperWidget());
    if (dockWidget) {
      if (flag == KMDI::IconOnly)
      {
        dockWidget->setTabPageLabel(" ");
        dockWidget->setPixmap(*(it.data()->wrappedWidget()->icon()));
      } else
      if (flag == KMDI::TextOnly)
      {
        dockWidget->setPixmap(); //FIXME: Does not hide the icon in the IDEAl mode.
        dockWidget->setTabPageLabel(it.data()->wrappedWidget()->caption());
      } else
      if (flag == KMDI::TextAndIcon)
      {
        dockWidget->setPixmap(*(it.data()->wrappedWidget()->icon()));
        dockWidget->setTabPageLabel(it.data()->wrappedWidget()->caption());
      }
      toolviewExists = true;
    }
  }
  if (toolviewExists)
  {
    //workaround for the above FIXME to make switching to TextOnly mode work in IDEAl as well. Be sure that this version of switch* is called.
    if (flag == KMDI::TextOnly)
    {
   /*   MainWindow::switchToTabPageMode();
      MainWindow::switchToIDEAlMode();*/ //TODO
    } else
    {
      writeDockConfig();
      readDockConfig();
    }
  }
}
Beispiel #3
0
Kooka::Kooka( const QCString& deviceToUse)
   : KParts::DockMainWindow( 0, "Kooka" ),
      m_printer(0),
      m_prefDialogIndex(0)
{
    /* Start to create the main view framework */
    m_view = new KookaView( this, deviceToUse);

    /* Call createGUI on the ocr-result view */
    setXMLFile( "kookaui.rc", true );

    setAcceptDrops(false); // Waba: Not (yet?) supported
    KConfig *konf = KGlobal::config ();
    readDockConfig ( konf, DOCK_SIZES );

    // then, setup our actions
    setupActions();

    createGUI(0L); // m_view->ocrResultPart());
    // and a status bar
    statusBar()->insertItem( QString(), KookaView::StatusTemp );
    statusBar()->show();

    // allow the view to change the statusbar and caption
    connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
            this,   SLOT(changeStatusbar(const QString&)));
    connect(m_view, SIGNAL(signalCleanStatusbar(void)),
            this, SLOT(cleanStatusbar()));
    connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
            this,   SLOT(changeCaption(const QString&)));

    changeCaption( i18n( "KDE Scanning" ));

    setAutoSaveSettings(  QString::fromLatin1("General Options"),
                          true );
}