DBoxFE_ProfileWizard::DBoxFE_ProfileWizard( QDialog *parent, Qt::WFlags flags )
    : QDialog( parent, flags ) {

  // setup grafical user interface (gui)
  setupUi( this );

  page = 0;

  // for download game database file
  m_http = new QHttp( this );
  connect( m_http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( httpRequestFinished( int, bool ) ) );
  connect( m_http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader & ) ), this, SLOT( readResponseHeader( const QHttpResponseHeader & ) ) );

  // connection
  connect( btnBack, SIGNAL( clicked() ), this, SLOT( slotBack() ) );
  connect( btnNext, SIGNAL( clicked() ), this, SLOT( slotNext() ) );
  connect( btnNext, SIGNAL( clicked() ), this, SLOT( slotFinish() ) );

  connect( btnHelp, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
  connect( btnAbort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) );
  connect( btnSelectDir, SIGNAL( clicked() ), this, SLOT( slotSelectDir() ) );
  connect( btnSearch, SIGNAL( clicked() ), this, SLOT( slotSearch() ) );

  // enable button
  btnNext->setEnabled( true );

  // center the wiget on desktop screen
  QDesktopWidget *desktop = qApp->desktop();
  const QRect rect = desktop->availableGeometry( desktop->primaryScreen() );
  int left = ( rect.width() - width() ) / 2;
  int top = ( rect.height() - height() ) / 2;
  setGeometry( left, top, width(), height() );

  downloadFile();
}
Beispiel #2
0
void KHelpMain::createToolbar()
{
	QPixmap pixmap;
	QString pmpath;

	KToolBar *tb = new KToolBar( this );


	pixmap = kapp->getIconLoader()->loadIcon( "back.xpm" );
	tb->insertButton(pixmap, 0, SIGNAL( clicked() ),
		    helpwin, SLOT( slotBack() ),
		    FALSE, klocale->translate("Previous Document"));

	pixmap = kapp->getIconLoader()->loadIcon( "forward.xpm" );
	tb->insertButton(pixmap, 1, SIGNAL( clicked() ),
		    helpwin, SLOT( slotForward() ),
		    FALSE, klocale->translate("Next Document"));

	tb->insertSeparator();

	pixmap = kapp->getIconLoader()->loadIcon( "prev.xpm" );
	tb->insertButton(pixmap, 2, SIGNAL( clicked() ),
		    helpwin, SLOT( slotPrev() ),
		    FALSE, klocale->translate("Previous Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "next.xpm" );
	tb->insertButton(pixmap, 3, SIGNAL( clicked() ),
		    helpwin, SLOT( slotNext() ),
		    FALSE, klocale->translate("Next Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "up.xpm" );
	tb->insertButton(pixmap, 4, SIGNAL( clicked() ),
		    helpwin, SLOT( slotUp() ),
		    FALSE,klocale->translate( "Up one Node"));

	pixmap = kapp->getIconLoader()->loadIcon( "top.xpm" );
	tb->insertButton(pixmap, 5, SIGNAL( clicked() ),
		    helpwin, SLOT( slotTop() ),
		    FALSE, klocale->translate("Top Node"));

	tb->insertSeparator();

	pixmap = kapp->getIconLoader()->loadIcon( "contents.xpm" );
	tb->insertButton(pixmap, 6, SIGNAL( clicked() ),
		    helpwin, SLOT( slotDir() ),
		    FALSE, klocale->translate("Help Contents"));

	pixmap = kapp->getIconLoader()->loadIcon( "reload.xpm" );
	tb->insertButton(pixmap, 7, SIGNAL( clicked() ),
		helpwin, SLOT( slotReload() ),
		TRUE, klocale->translate( "Reload current document" ) );

	pixmap = kapp->getIconLoader()->loadIcon( "stop.xpm" );
	tb->insertButton(pixmap, 8, SIGNAL( clicked() ),
		    helpwin, SLOT( slotStopProcessing() ),
		    FALSE, klocale->translate("Stop"));

	tb->setBarPos( KToolBar::Top );
	toolbar = tb;
}
Beispiel #3
0
dlgTextBrowser::dlgTextBrowser(const char *manual)
{
  char cmd[1024],buf[1024];

  homeIsSet = 0;
  strcpy(buf,"index.html");
  
  form = new Ui_DialogTextBrowser;
  form->setupUi(this);
#ifndef USE_ANDROID
  form->textBrowser->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
#endif

  if(manual == NULL)
  {
    setWindowTitle(tr("pvbrowser Manual"));
  }
  else
  {
    if(strlen(manual) < (int) (sizeof(cmd)-1) ) strcpy(buf,manual);
  }

#ifdef PVWIN32
  ExpandEnvironmentStringsA(buf,cmd,sizeof(cmd)-1);
#else
  strcpy(cmd,buf);
#endif

  QFile fin(cmd);
  if(fin.exists())
  {
    // this is damn slow on windows begin
#ifdef PVDEVELOP
    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#ifdef USE_ANDROID
    form->textBrowser->setSource(QUrl::fromLocalFile(cmd));
#else
    form->textBrowser->load(QUrl::fromLocalFile(cmd));
#endif    
    QApplication::restoreOverrideCursor();
#endif
    // this is damn slow on windows end
    home = cmd;
    homeIsSet = 1;
  }
  else
  {
    form->textBrowser->setHtml("<html><head></head><body>Sorry no application specific help specified.</body></html>");
  }

  QObject::connect(form->pushButtonFind,SIGNAL(clicked()),this,SLOT(slotFind()));
  QObject::connect(form->lineEditPattern,SIGNAL(returnPressed()),this,SLOT(slotFind()));
  QObject::connect(form->pushButtonClose,SIGNAL(clicked()),this,SLOT(hide()));
  QObject::connect(form->pushButtonHome,SIGNAL(clicked()),this,SLOT(slotHome()));
  QObject::connect(form->pushButtonBack,SIGNAL(clicked()),this,SLOT(slotBack()));
  find = 0;
}
Beispiel #4
0
Installer::Installer(QWidget *parent) : QMainWindow(parent)
{
    setupUi(this);
    translator = new QTranslator();

    connect(backButton, SIGNAL(clicked()), this, SLOT(slotBack()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(slotNext()));

    connect(helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
    connect(pushTouchKeyboard, SIGNAL(clicked()), this, SLOT(slotPushVirtKeyboard()));
    connect(pushChangeKeyLayout, SIGNAL(clicked()), this, SLOT(slotPushKeyLayout()));

    connect(lineHostname,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckHost()));

    connect(lineRootPW, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));
    connect(lineRootPW2, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));

    connect(lineName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(lineName,SIGNAL(editingFinished()),this,SLOT(slotSuggestUsername()));
    connect(lineUsername,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW2,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));

    backButton->setText(tr("&Back"));
    nextButton->setText(tr("&Next"));


    // Load the keyboard info
    keyModels = Scripts::Backend::keyModels();
    keyLayouts = Scripts::Backend::keyLayouts();

    // Load the timezones
    comboBoxTimezone->clear();
    QString curZone = Scripts::Backend::guessTimezone();
    comboBoxTimezone->addItems(Scripts::Backend::timezones());
    if ( ! curZone.isEmpty() ) {
      int index = comboBoxTimezone->findText(curZone, Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    } else {
      // Set America/New_York to default
      int index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    }

    // Load the hostname
    lineHostname->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1));

    // Start on the first screen
    installStackWidget->setCurrentIndex(0);
    backButton->setVisible(false);
}
int WebBrowser::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: slotGo(); break;
        case 1: slotFinished((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: slotForward(); break;
        case 3: slotBack(); break;
        case 4: slotReload(); break;
        case 5: clickFindAnswer(); break;
        case 6: clickHyperlink((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
Beispiel #6
0
dlgMyBrowser::dlgMyBrowser(int *sock, int ident, QWidget *parent, const char *manual)
{
  if(opt.arg_debug) printf("dlgMyBrowser:dlgMyBrowser()\n");
  s = sock;
  id = ident;
  mainWindow = (MainWindow *) parent;
  form = new Ui_MyBrowser;
  form->setupUi(this);
#ifdef USE_WEBKIT  
  QObject::connect(form->pushButtonBack,SIGNAL(clicked())              ,this, SLOT(slotBack()));
  QObject::connect(form->pushButtonHome,SIGNAL(clicked())              ,this, SLOT(slotHome()));
  QObject::connect(form->pushButtonForward,SIGNAL(clicked())           ,this, SLOT(slotForward()));
  QObject::connect(form->pushButtonReload,SIGNAL(clicked())            ,this, SLOT(slotReload()));
  QObject::connect(form->pushButtonFind,SIGNAL(clicked())              ,this, SLOT(slotFind()));
  QObject::connect(form->lineEditPattern,SIGNAL(returnPressed())       ,this, SLOT(slotFind()));
  QObject::connect(form->browser,SIGNAL(urlChanged(const QUrl &))      ,this, SLOT(slotUrlChanged(const QUrl &)));
  QObject::connect(form->browser,SIGNAL(linkClicked(const QUrl &))     ,this, SLOT(slotLinkClicked(const QUrl &)));
  QObject::connect(form->browser,SIGNAL(titleChanged(const QString &)) ,this, SLOT(slotTitleChanged(const QString &)));
  QObject::connect(form->browser,SIGNAL(loadFinished(bool))            ,this, SLOT(slotLoadFinished(bool)));
  //QWebPage *page = form->browser->page();
  //QObject::connect(page,SIGNAL(unsupportedContent(QNetworkReply *)),this, SLOT(slotUnsupportedContent(QNetworkReply *)));
  //enabling plugins leads to problems
  //see: https://bugs.webkit.org/show_bug.cgi?id=56552 that we have reported
  if(opt.enable_webkit_plugins)
  {
    if(opt.arg_debug) printf("enable_webkit_plugins\n");
    form->browser->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    form->browser->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
  }
  else
  {
    if(opt.arg_debug) printf("do not enable_webkit_plugins\n");
    form->browser->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
    form->browser->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
  }
#endif
  if(manual == NULL) return;
}
void TutorialStateColorFilter::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateColorFilter::begin ()";

  m_title = createTitle (tr ("Color Filter"));
  m_background = createPixmapItem (":/engauge/img/panel_color_filter.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem (tr ("Each curve has Color Filter settings that\n"
                                "are applied in Segment Fill mode. For\n"
                                "black lines the defaults work well, but for\n"
                                "colored lines the settings can be improved."),
                            QPoint (260, 30));
  m_text1 = createTextItem (tr ("Step 1 - Select the Settings / Color\n"
                                "Filter menu option."),
                            QPoint (285, 115));
  m_text2 = createTextItem (tr ("Step 2 - Select the curve that will\n"
                                "be given the new settings."),
                            QPoint (285, 165));
  m_text3 = createTextItem (tr ("Step 3 - Select the mode. Intensity is\n"
                                "suggested for uncolored lines, and Hue\n"
                                "is suggested for colored lines."),
                            QPoint (285, 210));
  m_text4 = createTextItem (tr ("Step 4 - Adjust the included range by\n"
                                "dragging the green handles, until the\n"
                                "curve is clear in the preview window\n"
                                "below. The graph shows a histogram\n"
                                "distribution of the values underneath.\n"
                                "Click Ok when finished."),
                            QPoint (285, 280));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_back = new TutorialButton (tr ("Back"),
                               context().tutorialDlg().scene());
  m_back->setGeometry (QPoint (backgroundSize.width () / 2 - m_back->size().width () / 2,
                               backgroundSize.height() - buttonMargin() - m_back->size().height()));
  connect (m_back, SIGNAL (signalTriggered ()), this, SLOT (slotBack ()));
}
Beispiel #8
0
Installer::Installer(QWidget *parent) : QMainWindow(parent, Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint)
{
    setupUi(this);
    //Setup the window
    if(!DEBUG){ this->setGeometry( QApplication::primaryScreen()->geometry() ); }//full screen
    else{ this->setWindowFlags(Qt::Window); } //don't keep on bottom/frameless for testing

    translator = new QTranslator();

    connect(backButton, SIGNAL(clicked()), this, SLOT(slotBack()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(slotNext()));

    connect(helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
    connect(pushTouchKeyboard, SIGNAL(clicked()), this, SLOT(slotPushVirtKeyboard()));
    connect(pushChangeKeyLayout, SIGNAL(clicked()), this, SLOT(slotPushKeyLayout()));

    connect(lineHostname,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckHost()));
    connect(lineDomainName, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckDomainName()) );

    connect(lineRootPW, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));
    connect(lineRootPW2, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));

    connect(lineName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(lineName,SIGNAL(editingFinished()),this,SLOT(slotSuggestUsername()));
    connect(lineUsername,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW2,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(line_PCpass, SIGNAL(textChanged(const QString)), this, SLOT(slotCheckUser())) ;
    connect(line_PCpass_repeat, SIGNAL(textChanged(const QString)), this, SLOT(slotCheckUser())) ;
    connect(group_usePC, SIGNAL(toggled(bool)), this, SLOT(slotCheckUser()) );
    connect(push_PC_device, SIGNAL(clicked()), this, SLOT(slotGetPCDevice()) );
    
    connect(tool_testAudio, SIGNAL(clicked()), this, SLOT(slotPlayAudioTest()) );
    connect(slider_volume, SIGNAL(valueChanged(int)), this, SLOT(slotAudioVolumeChanged()) );
    connect(combo_audiodevice, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSetAudioDev()) );
    backButton->setText(tr("&Back"));
    nextButton->setText(tr("&Next"));


    // Load the keyboard info
    keyModels = Scripts::Backend::keyModels();
    keyLayouts = Scripts::Backend::keyLayouts();

    // If we have a saved keyboard layout from installation, use it first
    QString kD;
    if ( QFile::exists("/var/.wizardKeyboard") ) {
      QFile kFile("/var/.wizardKeyboard");
      if ( kFile.open(QIODevice::ReadOnly | QIODevice::Text) ) {
         kD = kFile.readLine().simplified();
         kFile.close();
         
         kbMod = kD.section(" ", 0, 0);
         kbLay = kD.section(" ", 1, 1);
         kbVar = kD.section(" ", 2, 2);
	 Scripts::Backend::changeKbMap(kbMod, kbLay, kbVar);
      } 
    }

    // Load the timezones
    comboBoxTimezone->clear();
    QString curZone = Scripts::Backend::guessTimezone();
    comboBoxTimezone->addItems(Scripts::Backend::timezones());
    if ( ! curZone.isEmpty() ) {
      int index = comboBoxTimezone->findText(curZone, Qt::MatchStartsWith);
      if (index != -1) {
         comboBoxTimezone->setCurrentIndex(index);
      } else {
        // Set America/New_York to default
        index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
        if (index != -1)
           comboBoxTimezone->setCurrentIndex(index);
      }
    } else {
      // Set America/New_York to default
      int index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    }

    // Load the hostname
     lineHostname->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1).section(".",0,0));

    // Load the domain name
    lineDomainName->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=",1).section(".",1,100));

    //Load the available Services into the UI
    LoadServices();
    
    // Start on the first screen
    installStackWidget->setCurrentIndex(0);
    backButton->setVisible(false);

    // Update the status bar
    // This makes the status text more "visible" instead of using the blue background
    //statusBar()->setStyleSheet("background: white");

    
    //Load the audio settings values
    combo_audiodevice->clear();
    QStringList devs = pcbsd::Utils::runShellCommand("pc-sysconfig list-audiodev").join("").split(", ");
    int def = -1; bool found = false;
    for(int i=0; i<devs.length(); i++){
      combo_audiodevice->addItem(devs[i], devs[i].section(":",0,0)); //<full text>, <pcmID>
      if(devs[i].contains(" default")){ found = true; def = i; }
    }
    if(def<0 && !devs.isEmpty()){ def=0; }
    if(def<0){
      //No audio devices found - disable this functionality
      Page_Audio->setEnabled(false); //just do the whole page - nothing will work
    }else{
      combo_audiodevice->setCurrentIndex(def); //make sure this item is initially selected
      if(!found){ slotSetAudioDev(); } //make sure to run the setup command initially
    }
    slider_volume->setValue(100);
    slotAudioVolumeChanged(); //update the volume % label
    
}
Beispiel #9
0
Installer::Installer(QWidget *parent) : QMainWindow(parent)
{
    setupUi(this);
    translator = new QTranslator();

    connect(backButton, SIGNAL(clicked()), this, SLOT(slotBack()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(slotNext()));

    connect(helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
    connect(pushTouchKeyboard, SIGNAL(clicked()), this, SLOT(slotPushVirtKeyboard()));
    connect(pushChangeKeyLayout, SIGNAL(clicked()), this, SLOT(slotPushKeyLayout()));

    connect(lineHostname,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckHost()));

    connect(lineRootPW, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));
    connect(lineRootPW2, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));

    connect(lineName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(lineName,SIGNAL(editingFinished()),this,SLOT(slotSuggestUsername()));
    connect(lineUsername,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW2,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));

    backButton->setText(tr("&Back"));
    nextButton->setText(tr("&Next"));


    // Load the keyboard info
    keyModels = Scripts::Backend::keyModels();
    keyLayouts = Scripts::Backend::keyLayouts();

    // If we have a saved keyboard layout from installation, use it first
    QString kD;
    if ( QFile::exists("/var/.wizardKeyboard") ) {
      QFile kFile("/var/.wizardKeyboard");
      if ( kFile.open(QIODevice::ReadOnly | QIODevice::Text) ) {
         kD = kFile.readLine().simplified();
         kFile.close();
         
         kbMod = kD.section(" ", 0, 0);
         kbLay = kD.section(" ", 1, 1);
         kbVar = kD.section(" ", 2, 2);
	 Scripts::Backend::changeKbMap(kbMod, kbLay, kbVar);
      } 
    }

    // Load the timezones
    comboBoxTimezone->clear();
    QString curZone = Scripts::Backend::guessTimezone();
    comboBoxTimezone->addItems(Scripts::Backend::timezones());
    if ( ! curZone.isEmpty() ) {
      int index = comboBoxTimezone->findText(curZone, Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    } else {
      // Set America/New_York to default
      int index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    }

    // Load the hostname
    lineHostname->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1));

    // Start on the first screen
    installStackWidget->setCurrentIndex(0);
    backButton->setVisible(false);

    // Update the status bar
    // This makes the status text more "visible" instead of using the blue background
    statusBar()->setStyleSheet("background: white");
}
Beispiel #10
0
void KHelpMain::createMenu()
{
    KStdAccel stdAccel;
	fileMenu = new QPopupMenu;
	CHECK_PTR( fileMenu );
	fileMenu->insertItem( klocale->translate("&New Help Window"), this,
                        SLOT( slotCloneWindow() ), stdAccel.openNew() );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Open File..."), helpwin,
                        SLOT(slotOpenFile()), stdAccel.open() );
//	fileMenu->insertItem( klocale->translate("Open UR&L..."), helpwin,
//                        SLOT(slotOpenURL()) );
	fileMenu->insertItem( klocale->translate("&Reload"), helpwin,
                        SLOT(slotReload()) );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Search"), helpwin,
                        SLOT(slotSearch()) );
	fileMenu->insertSeparator();
	fileMenu->insertItem( klocale->translate("&Print..."), helpwin,
                        SLOT(slotPrint()), stdAccel.print() );
	fileMenu->insertSeparator();
	idClose = fileMenu->insertItem(klocale->translate("&Close"),this,
                        SLOT(slotClose()), stdAccel.close()); // CC :!!!!!
	fileMenu->insertItem( klocale->translate("&Quit"), this,
                        SLOT(slotQuit()), stdAccel.quit() );

	editMenu = new QPopupMenu;
	CHECK_PTR( editMenu );
	idCopy = editMenu->insertItem(klocale->translate("&Copy"), helpwin,
                        SLOT(slotCopy()), stdAccel.copy() );
	editMenu->insertItem(klocale->translate("&Find..."), helpwin,
                        SLOT(slotFind()), stdAccel.find() );
	editMenu->insertItem(klocale->translate("Find &next"), helpwin,
                        SLOT(slotFindNext()), Key_F3 );

	gotoMenu = new QPopupMenu;
	CHECK_PTR( gotoMenu );
	idBack = gotoMenu->insertItem( klocale->translate("&Back"), helpwin,
                        SLOT(slotBack()) );
	idForward = gotoMenu->insertItem( klocale->translate("&Forward"), helpwin,
                        SLOT(slotForward()) );
	gotoMenu->insertSeparator();
	idDir = gotoMenu->insertItem( klocale->translate("&Contents"), helpwin,
                        SLOT(slotDir()) );
	idTop = gotoMenu->insertItem( klocale->translate("&Top"), helpwin,
                        SLOT(slotTop()) );
	idUp = gotoMenu->insertItem( klocale->translate("&Up"), helpwin,
                        SLOT(slotUp()) );
	idPrev = gotoMenu->insertItem( klocale->translate("&Previous"), helpwin,
                        SLOT(slotPrev()) );
	idNext = gotoMenu->insertItem( klocale->translate("&Next"), helpwin,
                        SLOT(slotNext()) );

	bookmarkMenu = new QPopupMenu;
	CHECK_PTR( bookmarkMenu );
	connect( bookmarkMenu, SIGNAL( activated( int ) ),
			helpwin, SLOT( slotBookmarkSelected( int ) ) );
	connect( bookmarkMenu, SIGNAL( highlighted( int ) ),
			helpwin, SLOT( slotBookmarkHighlighted( int ) ) );

	optionsMenu = new QPopupMenu;
	CHECK_PTR( optionsMenu );
	optionsMenu->setCheckable( true );
	optionsMenu->insertItem( klocale->translate("&General Preferences..."), this,
			SLOT(slotOptionsGeneral()) );
	optionsMenu->insertSeparator();
	optionsMenu->insertItem(klocale->translate( "Show &Toolbar"), this,
                        SLOT(slotOptionsToolbar()));

	optionsMenu->insertItem( klocale->translate("Show &Location"), this,
                        SLOT(slotOptionsLocation()) );
	optionsMenu->insertItem( klocale->translate("Show Status&bar"), this,
		SLOT(slotOptionsStatusbar()) );
	optionsMenu->insertSeparator();
	optionsMenu->insertItem( klocale->translate("&Save Options"), this,
                        SLOT(slotOptionsSave()) );

	QString at = klocale->translate("KDE Help System\n");
	at+= klocale->translate("Version ");
	at+= KDEHELP_VERSION;
	at+=klocale->translate("\n\nCopyright (c) 1997 Martin Jones <*****@*****.**>"\
	"\n\nThis program is licensed under the GNU General Public License (GPL)."\
	"\nKDEHelp comes with ABSOLUTELY NO WARRANY to the extent permitted by applicable law.");

	QPopupMenu *helpMenu = kapp->getHelpMenu( true, at );
/*
	QPopupMenu *helpMenu = new QPopupMenu;
	CHECK_PTR( helpMenu );
	helpMenu->insertItem( klocale->translate("&Using KDE Help"), this,
                        SLOT(slotUsingHelp()) ); 
	helpMenu->insertSeparator();
	helpMenu->insertItem( klocale->translate("&About"), this, SLOT(slotAbout()) );
*/
	menu = new KMenuBar( this );
	CHECK_PTR( menu );
	menu->insertItem( klocale->translate("&File"), fileMenu );
	menu->insertItem( klocale->translate("&Edit"), editMenu );
	menu->insertItem( klocale->translate("&Goto"), gotoMenu );
	menu->insertItem( klocale->translate("&Bookmarks"), bookmarkMenu );
	menu->insertItem( klocale->translate("&Options"), optionsMenu );
	menu->insertSeparator();
	menu->insertItem( klocale->translate("&Help"), helpMenu );
}
Beispiel #11
0
Thesaurus::Thesaurus()
{
    m_standAlone = false;
    m_thesProc = new KProcess;
    m_wnProc = new KProcess;

    m_dialog = new KDialog(0);
    m_dialog->setButtons(KDialog::Help | KDialog::Ok | KDialog::Cancel);
    m_dialog->setDefaultButton(KDialog::Ok);
    m_dialog->setHelp(QString(), "thesaurus");
    m_dialog->resize(600, 400);

    KConfigGroup cfg = KGlobal::config()->group("");
    m_dataFile = cfg.readEntry("datafile");
    if (m_dataFile.isEmpty())
        m_dataFile = KGlobal::dirs()->findResource("data", "koffice/thesaurus/thesaurus.txt");
    setCaption();

    m_noMatch = i18n("(No match)");

    m_historyPos = 1;
    QWidget *page = new QWidget();
    m_dialog->setMainWidget(page);
    QVBoxLayout *topLayout = new QVBoxLayout(page);
    topLayout->setMargin(KDialog::marginHint());
    topLayout->setSpacing(KDialog::spacingHint());

    QHBoxLayout *row1 = new QHBoxLayout;
    topLayout->addLayout(row1);
    m_edit = new KHistoryComboBox(page);
    QLabel editLabel(i18n("&Search for:"), page);
    editLabel.setBuddy(m_edit);

    m_search = new KPushButton(i18n("S&earch"), page);
    connect(m_search, SIGNAL(clicked()), this, SLOT(slotFindTerm()));
    row1->addWidget(&editLabel, 0);
    row1->addWidget(m_edit, 1);
    row1->addWidget(m_search, 0);
    m_back = new QToolButton(page);
    m_back->setIcon(KIcon(QString::fromLatin1("go-previous")));
    m_back->setToolTip(i18nc("@action:button Go back to the previous word in history", "Back"));
    row1->addWidget(m_back, 0);
    m_forward = new QToolButton(page);
    m_forward->setIcon(KIcon(QString::fromLatin1("go-next")));
    m_forward->setToolTip(i18nc("@action:button Go forward to the next word in history", "Forward"));
    row1->addWidget(m_forward, 0);

    KPushButton *lang = new KPushButton(i18n("Change Language..."), page);
    connect(lang, SIGNAL(clicked()), this, SLOT(slotChangeLanguage()));
    row1->addWidget(lang, 0);

    connect(m_back, SIGNAL(clicked()), this, SLOT(slotBack()));
    connect(m_forward, SIGNAL(clicked()), this, SLOT(slotForward()));

    m_tabWidget = new KTabWidget(page);
    topLayout->addWidget(m_tabWidget);

    //
    // Thesaurus Tab
    //
    QWidget *thesWidget = new QWidget(m_tabWidget);
    m_tabWidget->addTab(thesWidget, i18n("&Thesaurus"));
    QHBoxLayout *thesLayout = new QHBoxLayout;
    thesLayout->setSpacing(KDialog::spacingHint());
    thesWidget->setLayout(thesLayout);

    QGroupBox *synGroupBox = new QGroupBox(i18n("Synonyms"), thesWidget);
    QHBoxLayout *synLayout = new QHBoxLayout();
    synGroupBox->setLayout(synLayout);
    m_synListWidget = new QListWidget(synGroupBox);
    synLayout->addWidget(m_synListWidget);
    thesLayout->addWidget(synGroupBox);

    QGroupBox *hyperGroupBox = new QGroupBox(i18n("More General Words"), thesWidget);
    QHBoxLayout *hyperLayout = new QHBoxLayout();
    hyperGroupBox->setLayout(hyperLayout);
    m_hyperListWidget = new QListWidget(hyperGroupBox);
    hyperLayout->addWidget(m_hyperListWidget);
    thesLayout->addWidget(hyperGroupBox);

    QGroupBox *hypoGroupBox = new QGroupBox(i18n("More Specific Words"), thesWidget);
    QHBoxLayout *hypoLayout = new QHBoxLayout();
    hypoGroupBox->setLayout(hypoLayout);
    m_hypoListWidget = new QListWidget(hypoGroupBox);
    hypoLayout->addWidget(m_hypoListWidget);
    thesLayout->addWidget(hypoGroupBox);

    // single click -- keep display unambiguous by removing other selections:

    connect(m_synListWidget, SIGNAL(itemClicked(QListWidgetItem *)),
            this, SLOT(slotSetReplaceTermSyn(QListWidgetItem *)));
    connect(m_hyperListWidget, SIGNAL(itemClicked(QListWidgetItem *)),
            this, SLOT(slotSetReplaceTermHyper(QListWidgetItem *)));
    connect(m_hypoListWidget, SIGNAL(itemClicked(QListWidgetItem *)),
            this, SLOT(slotSetReplaceTermHypo(QListWidgetItem *)));

    // double click -- set the double clicked item as the new search term

    connect(m_synListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
            this, SLOT(slotFindTermFromList(QListWidgetItem *)));
    connect(m_hyperListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
            this, SLOT(slotFindTermFromList(QListWidgetItem *)));
    connect(m_hypoListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
            this, SLOT(slotFindTermFromList(QListWidgetItem *)));

    //
    // WordNet Tab
    //

    QWidget *wnWidget = new QWidget(m_tabWidget);
    m_tabWidget->addTab(wnWidget, i18n("&Wordnet"));
    QVBoxLayout *wnLayout = new QVBoxLayout;
    wnLayout->setSpacing(KDialog::spacingHint());
    wnLayout->setMargin(KDialog::marginHint());
    wnWidget->setLayout(wnLayout);

    m_wnComboBox = new KComboBox(wnWidget);
    m_wnComboBox->setEditable(false);
    wnLayout->addWidget(m_wnComboBox);
    connect(m_wnComboBox, SIGNAL(activated(int)), this, SLOT(slotFindTerm()));

    m_resultTextBrowser = new KTextBrowser(wnWidget);
    m_resultTextBrowser->setReadOnly(true);
    connect(m_resultTextBrowser, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(slotFindTermFromUrl(const QUrl &)));
    wnLayout->addWidget(m_resultTextBrowser);

    // Connect for the history box
    m_edit->setTrapReturnKey(true);        // Do not use Return as default key...
    connect(m_edit, SIGNAL(returnPressed()), this, SLOT(slotFindTerm()));
    connect(m_edit, SIGNAL(activated(int)), this, SLOT(slotGotoHistory(int)));

    QHBoxLayout *row2 = new QHBoxLayout( /*m_top_layout*/ );
    topLayout->addLayout(row2);
    m_replaceLineEdit = new KLineEdit(page);
    m_replaceLabel = new QLabel(i18n("&Replace with:"), page);
    m_replaceLabel->setBuddy(m_replaceLineEdit);
    row2->addWidget(m_replaceLabel, 0);
    row2->addWidget(m_replaceLineEdit, 1);

    // Set focus
    m_edit->setFocus();
    updateNavButtons();

    connect(m_dialog, SIGNAL(accepted()), this, SLOT(process()));
    connect(m_dialog, SIGNAL(rejected()), this, SLOT(dialogClosed()));
}
Beispiel #12
0
KfmView::KfmView( KfmGui *_gui, QWidget *parent, const char *name, KfmView *_parent_view )
    : KHTMLView( parent, name, 0, _parent_view )
{
    rectStart = false;
    dPainter = 0L;
    
    htmlCache = new HTMLCache();
    if(!_parent_view)
    {
	backStack = new QStack<SavedPage>;
	forwardStack = new QStack<SavedPage>;
	backStack->setAutoDelete( false );
	forwardStack->setAutoDelete( false );
    }
    else
    {
	backStack = _parent_view->getBackStack();
	forwardStack = _parent_view->getForwardStack();
    }

    connect( htmlCache, SIGNAL( urlLoaded( const char*, const char *) ),
	     this, SLOT( slotImageLoaded( const char*, const char* ) ) );
    connect( this, SIGNAL( imageRequest( const char * ) ), htmlCache, SLOT( slotURLRequest( const char * ) ) );
    connect( this, SIGNAL( cancelImageRequest( const char * ) ),
	     htmlCache, SLOT( slotCancelURLRequest( const char * ) ) );
    connect( this, SIGNAL( popupMenu( KHTMLView *, const char *, const QPoint & ) ),
	     this, SLOT( slotPopupMenu2( KHTMLView *, const char *, const QPoint & ) ) );
    connect( getKHTMLWidget(), SIGNAL( scrollVert( int ) ),
	SLOT( slotUpdateSelect(int) ) );

    connect( this, SIGNAL( goUp() ), this, SLOT( slotUp() ) );
    connect( this, SIGNAL( goRight() ), this, SLOT( slotForward() ) );
    connect( this, SIGNAL( goLeft() ), this, SLOT( slotBack() ) );
    connect ( getKHTMLWidget(), SIGNAL( redirect( int , const char *) ),
	      this, SLOT( slotRedirect( int, const char * )) );
    connect( &redirectTimer, SIGNAL(timeout()), 
	     this, SLOT(slotDelayedRedirect2()));


    gui = _gui;
 
    dropZone = 0L;
    popupMenu = 0L;
    
    popupMenuEvent = false;
    stackLock = false;

    // ignoreMouseRelease = false; // Stephan: Just guessed. It was undefined

    childViewList.setAutoDelete( false );

    manager = new KFMManager( this );

    dropZone = new KDNDDropZone( view , DndURL );
    connect( dropZone, SIGNAL( dropAction( KDNDDropZone *) ),
	     this, SLOT( slotDropEvent( KDNDDropZone *) ) );
    connect( dropZone, SIGNAL( dropEnter( KDNDDropZone *) ),
	     this, SLOT( slotDropEnterEvent( KDNDDropZone *) ) );
    connect( dropZone, SIGNAL( dropLeave( KDNDDropZone *) ),
	     this, SLOT( slotDropLeaveEvent( KDNDDropZone *) ) );

    connect( KIOServer::getKIOServer(), SIGNAL( notify( const char * ) ), this,
    	     SLOT( slotFilesChanged( const char * ) ) );
    connect( KIOServer::getKIOServer(), SIGNAL( mountNotify() ), this, SLOT( slotMountNotify() ) );

    getKHTMLWidget()->setFocusPolicy( QWidget::StrongFocus );
    setHTMLWidgetOptions();
}