HelpBrowser::HelpBrowser( QWidget* parent, const QString& /*caption*/, const QString& guiLanguage, const QString& jumpToSection, const QString& jumpToFile) : QMainWindow( parent ) { firstRun=true; setupUi(this); helpNav = new HelpNavigation(this); #if defined(Q_OS_MAC) && defined(HELP_NAV_AS_DRAWER) // TODO #else QDockWidget * dckw = new QDockWidget(tr("Navigation"),this); dckw->setWidget(helpNav); addDockWidget(Qt::LeftDockWidgetArea, dckw); #endif progressBar = new QProgressBar(this); progressBar->setRange(0,100); statusBar()->addPermanentWidget(progressBar); setupLocalUI(); language = guiLanguage.isEmpty() ? QString("en") : guiLanguage.left(2); finalBaseDir = ScPaths::instance().docDir() + "en/"; //Sane default for help location textBrowser->setSearchPaths(QStringList(finalBaseDir)); menuModel=NULL; loadMenu(); if (menuModel!=NULL) { readBookmarks(); readHistory(); jumpToHelpSection(jumpToSection, jumpToFile ); languageChange(); } else { displayNoHelp(); } }
void HistoryLineEdit::initialize( ) { m_history = new QStringList; readHistory( ); m_pos = m_history->size( ) - 1; connect( this, SIGNAL( returnPressed( ) ), this, SLOT( returnPressed( ) ) ); }
void ModXReader::readHeader() { while (!atEnd()) { readNext(); if (isEndElement()) { break; } if (isStartElement()) { QString lang = attributes().value("lang").toString(); if (name() == "title") { m_data->title.insert(lang, readElementText()); } else if (name() == "description") { m_data->description.insert(lang, readElementText()); } else if (name() == "author-notes") { m_data->authorNotes.insert(lang, readElementText()); } else if (name() == "license") { m_data->license = readElementText(); } else if (name() == "installation") { readInstallation(); } else if (name() == "author-group") { readAuthorGroup(); } else if (name() == "history") { readHistory(); } else if (name() == "mod-version") { m_data->version = readElementText(); } else { readUnknownElement(); } } } }
HelpBrowser::HelpBrowser( QWidget* parent, const QString& /*caption*/, const QString& guiLanguage, const QString& jumpToSection, const QString& jumpToFile) : QMainWindow( parent ) { firstRun=true; setupUi(this); setupLocalUI(); language = guiLanguage.isEmpty() ? QString("en") : guiLanguage.left(2); finalBaseDir = ScPaths::instance().docDir() + "en/"; //Sane default for help location menuModel=NULL; loadMenu(); if (menuModel!=NULL) { readBookmarks(); readHistory(); jumpToHelpSection(jumpToSection, jumpToFile ); languageChange(); } else { displayNoHelp(); } }
MyCalendar::MyCalendar(QWidget *parent) : QMainWindow(parent), ui(new Ui::MyCalendar) { ui->setupUi(this); codec = QTextCodec::codecForName("Big5"); clock = new QTimer; clock->setInterval(10000); file = new QFile("userEvent.txt"); ui->scheduleTable->setRowCount(25); ui->scheduleTable->setColumnCount(8); ui->searchName->setText(codec->toUnicode("請輸入標題")); date = date.currentDateTime(); updateDate(); addTimeInterval(); readHistory(); updateCalendar(); updateTime(); connect(clock, SIGNAL(timeout()),this, SLOT(updateTime())); connect(clock, SIGNAL(timeout()), this, SLOT(checkScheduleTime())); clock->start(); ui->currentTime->setText(currentTime.toString("yyyy/MM/dd hh:mm")); }
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() { readHistory(); readBookmarks(); browser = new QTextBrowser( this ); browser->mimeSourceFactory()->setFilePath( _path ); browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); setCentralWidget( browser ); if ( !home_.isEmpty() ) browser->setSource( home_ ); connect( browser, SIGNAL( highlighted( const QString&) ), statusBar(), SLOT( message( const QString&)) ); resize( 640,700 ); QPopupMenu* file = new QPopupMenu( this ); file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N ); file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O ); file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P ); // The same three icons are used twice each. QIconSet icon_back( QPixmap("textdrawing/previous.png") ); QIconSet icon_forward( QPixmap("textdrawing/next.png") ); QIconSet icon_home( QPixmap("textdrawing/home.png") ); QPopupMenu* go = new QPopupMenu( this ); backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), ALT | Key_Left ); forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), ALT | Key_Right ); go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) ); hist = new QPopupMenu( this ); QStringList::Iterator it = history.begin(); for ( ; it != history.end(); ++it ) mHistory[ hist->insertItem( *it ) ] = *it; connect( hist, SIGNAL( activated( int ) ), this, SLOT( histChosen( int ) ) ); bookm = new QPopupMenu( this ); bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for ( ; it2 != bookmarks.end(); ++it2 ) mBookmarks[ bookm->insertItem( *it2 ) ] = *it2; connect( bookm, SIGNAL( activated( int ) ), this, SLOT( bookmChosen( int ) ) ); menuBar()->insertItem( tr("&File"), file ); menuBar()->insertItem( tr("&Go"), go ); menuBar()->insertItem( tr( "History" ), hist ); menuBar()->insertItem( tr( "Bookmarks" ), bookm ); menuBar()->setItemEnabled( forwardId, FALSE); menuBar()->setItemEnabled( backwardId, FALSE); connect( browser, SIGNAL( backwardAvailable( bool ) ), this, SLOT( setBackwardAvailable( bool ) ) ); connect( browser, SIGNAL( forwardAvailable( bool ) ), this, SLOT( setForwardAvailable( bool ) ) ); QToolBar* toolbar = new QToolBar( this ); addToolBar( toolbar, "Toolbar"); QToolButton* button; button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar ); connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar ); connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar ); toolbar->addSeparator(); pathCombo = new QComboBox( TRUE, toolbar ); connect( pathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( pathSelected( const QString & ) ) ); toolbar->setStretchableWidget( pathCombo ); setRightJustification( TRUE ); setDockEnabled( DockLeft, FALSE ); setDockEnabled( DockRight, FALSE ); pathCombo->insertItem( home_ ); browser->setFocus(); }
FLHelpWindow::FLHelpWindow(const QString &home_, const QString &_path, QWidget *parent, const char *name) : QMainWindow(parent, name, WDestructiveClose), pathCombo(0), selectedURL() { readHistory(); readBookmarks(); browser = new QTextBrowser(this); browser->mimeSourceFactory() ->setFilePath(_path); browser->setFrameStyle(QFrame::Panel | QFrame::Sunken); connect(browser, SIGNAL(textChanged()), this, SLOT(textChanged())); setCentralWidget(browser); if (!home_.isEmpty()) browser->setSource(home_); connect(browser, SIGNAL(highlighted(const QString &)), statusBar(), SLOT(message(const QString &))); resize(640, 700); QPopupMenu *file = new QPopupMenu(this); file->insertItem(tr("&Imprimir"), this, SLOT(print()), CTRL + Key_I); file->insertSeparator(); file->insertItem(tr("&Cerrar"), this, SLOT(close()), Key_Escape); // The same three icons are used twice each. QIconSet icon_back(QPixmap::fromMimeSource("previous.png")); QIconSet icon_forward(QPixmap::fromMimeSource("next.png")); QIconSet icon_home(QPixmap::fromMimeSource("home.png")); QPopupMenu *go = new QPopupMenu(this); backwardId = go->insertItem(icon_back, tr("&Atrás"), browser, SLOT(backward()), CTRL + Key_Left); forwardId = go->insertItem(icon_forward, tr("&Adelante"), browser, SLOT(forward()), CTRL + Key_Right); go->insertItem(icon_home, tr("&Inicio"), browser, SLOT(home())); QPopupMenu *help = new QPopupMenu(this); help->insertItem(tr("&Acerca ..."), this, SLOT(about())); help->insertItem(tr("Acerca de &Qt ..."), this, SLOT(aboutQt())); hist = new QPopupMenu(this); QStringList::Iterator it = history.begin(); for (; it != history.end(); ++it) mHistory[ hist->insertItem(*it)] = *it; connect(hist, SIGNAL(activated(int)), this, SLOT(histChosen(int))); bookm = new QPopupMenu(this); bookm->insertItem(tr("Agregar Favorito"), this, SLOT(addBookmark())); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for (; it2 != bookmarks.end(); ++it2) mBookmarks[ bookm->insertItem(*it2)] = *it2; connect(bookm, SIGNAL(activated(int)), this, SLOT(bookmChosen(int))); menuBar() ->insertItem(tr("&Archivo"), file); menuBar() ->insertItem(tr("&Ir"), go); menuBar() ->insertItem(tr("Historial"), hist); menuBar() ->insertItem(tr("Favoritos"), bookm); menuBar() ->insertSeparator(); menuBar() ->insertItem(tr("&Ayuda"), help); menuBar() ->setItemEnabled(forwardId, FALSE); menuBar() ->setItemEnabled(backwardId, FALSE); connect(browser, SIGNAL(backwardAvailable(bool)), this, SLOT(setBackwardAvailable(bool))); connect(browser, SIGNAL(forwardAvailable(bool)), this, SLOT(setForwardAvailable(bool))); QToolBar *toolbar = new QToolBar(this); addToolBar(toolbar, "Toolbar"); QToolButton *button; button = new QToolButton(icon_back, tr("Atrás"), "", browser, SLOT(backward()), toolbar); connect(browser, SIGNAL(backwardAvailable(bool)), button, SLOT(setEnabled(bool))); button->setEnabled(FALSE); button = new QToolButton(icon_forward, tr("Adelante"), "", browser, SLOT(forward()), toolbar); connect(browser, SIGNAL(forwardAvailable(bool)), button, SLOT(setEnabled(bool))); button->setEnabled(FALSE); button = new QToolButton(icon_home, tr("Inicio"), "", browser, SLOT(home()), toolbar); toolbar->addSeparator(); pathCombo = new QComboBox(TRUE, toolbar); connect(pathCombo, SIGNAL(activated(const QString &)), this, SLOT(pathSelected(const QString &))); toolbar->setStretchableWidget(pathCombo); setRightJustification(TRUE); setDockEnabled(DockLeft, FALSE); setDockEnabled(DockRight, FALSE); pathCombo->insertItem(home_); browser->setFocus(); }
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() { readHistory(); readBookmarks(); browser = new QTextBrowser( this ); QStringList Strlist; Strlist.append( home_); browser->mimeSourceFactory()->setFilePath( Strlist ); browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); setCentralWidget( browser ); if ( !home_.isEmpty() ) //////////////////////////////// browser->setSource( home_ ); //////////////////////////////// connect( browser, SIGNAL( highlighted(const QString&) ), statusBar(), SLOT( message(const QString&)) ); setGeometry( 0,0,236,280); QPopupMenu* file = new QPopupMenu( this ); // file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N ); file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O ); // file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P ); file->insertSeparator(); file->insertItem( tr("&Close"), this, SLOT( close() ), ALT | Key_Q ); // file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), ALT | Key_X ); // The same three icons are used twice each. ////F FIXME QString pixs=(QDir::homeDirPath ()) +"/Applications/gutenbrowser/pix/"; QIconSet icon_back( QPixmap(pixs+"back.png") ); QIconSet icon_forward( QPixmap(pixs+"forward.png") ); QIconSet icon_home( QPixmap(pixs+"home.png") ); QPopupMenu* go = new QPopupMenu( this ); backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), ALT | Key_Left ); forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), ALT | Key_Right ); go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) ); hist = new QPopupMenu( this ); QStringList::Iterator it = history.begin(); for ( ; it != history.end(); ++it ) mHistory[ hist->insertItem( *it ) ] = *it; connect( hist, SIGNAL( activated(int) ), this, SLOT( histChosen(int) ) ); bookm = new QPopupMenu( this ); bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for ( ; it2 != bookmarks.end(); ++it2 ) mBookmarks[ bookm->insertItem( *it2 ) ] = *it2; connect( bookm, SIGNAL( activated(int) ), this, SLOT( bookmChosen(int) ) ); menuBar()->insertItem( tr("&File"), file ); menuBar()->insertItem( tr("&Go"), go ); menuBar()->insertItem( tr( "History" ), hist ); menuBar()->insertItem( tr( "Bookmarks" ), bookm ); // menuBar()->insertSeparator(); // menuBar()->insertItem( tr("&Help"), help ); menuBar()->setItemEnabled( forwardId, FALSE); menuBar()->setItemEnabled( backwardId, FALSE); connect( browser, SIGNAL( backwardAvailable(bool) ), this, SLOT( setBackwardAvailable(bool) ) ); connect( browser, SIGNAL( forwardAvailable(bool) ), this, SLOT( setForwardAvailable(bool) ) ); QToolBar* toolbar = new QToolBar( this ); addToolBar( toolbar, "Toolbar"); QToolButton* button; button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar ); connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar ); connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar ); toolbar->addSeparator(); pathCombo = new QComboBox( TRUE, toolbar ); connect( pathCombo, SIGNAL( activated(const QString&) ), this, SLOT( pathSelected(const QString&) ) ); toolbar->setStretchableWidget( pathCombo ); // pathCombo->setMaximumWidth(190); // setRightJustification( TRUE ); // setDockEnabled( Left, FALSE ); // setDockEnabled( Right, FALSE ); pathCombo->insertItem( home_ ); browser->setFocus(); }
void FitsReader::initialize() { int status = 0; fits_open_file(&_fitsPtr, _filename.c_str(), READONLY, &status); checkStatus(status, _filename); // Move to first HDU int hduType; fits_movabs_hdu(_fitsPtr, 1, &hduType, &status); checkStatus(status, _filename); if(hduType != IMAGE_HDU) throw std::runtime_error("First HDU is not an image"); int naxis = 0; fits_get_img_dim(_fitsPtr, &naxis, &status); checkStatus(status, _filename); if(naxis < 2) throw std::runtime_error("NAxis in image < 2"); std::vector<long> naxes(naxis); fits_get_img_size(_fitsPtr, naxis, &naxes[0], &status); checkStatus(status, _filename); _imgWidth = naxes[0]; _imgHeight = naxes[1]; _nFrequencies = 1; std::string tmp; for(int i=2;i!=naxis;++i) { std::ostringstream name; name << "CTYPE" << (i+1); if(ReadStringKeyIfExists(name.str().c_str(), tmp)) { if(tmp == "FREQ" || tmp == "VRAD") _nFrequencies = naxes[i]; else if(naxes[i] != 1) throw std::runtime_error("Multiple images given in fits file"); } } if(_nFrequencies != 1 && !_allowMultiFreq) throw std::runtime_error("Multiple frequencies given in fits file"); double bScale = 1.0, bZero = 0.0, equinox = 2000.0; ReadDoubleKeyIfExists("BSCALE", bScale); ReadDoubleKeyIfExists("BZERO", bZero); ReadDoubleKeyIfExists("EQUINOX", equinox); if(bScale != 1.0) throw std::runtime_error("Invalid value for BSCALE"); if(bZero != 0.0) throw std::runtime_error("Invalid value for BZERO"); if(equinox != 2000.0) throw std::runtime_error("Invalid value for EQUINOX: "+readStringKey("EQUINOX")); if(ReadStringKeyIfExists("CTYPE1", tmp) && tmp != "RA---SIN" && _checkCType) throw std::runtime_error("Invalid value for CTYPE1"); _phaseCentreRA = 0.0; ReadDoubleKeyIfExists("CRVAL1", _phaseCentreRA); _phaseCentreRA *= M_PI / 180.0; _pixelSizeX = 0.0; ReadDoubleKeyIfExists("CDELT1", _pixelSizeX); _pixelSizeX *= -M_PI / 180.0; if(ReadStringKeyIfExists("CUNIT1", tmp) && tmp != "deg" && _checkCType) throw std::runtime_error("Invalid value for CUNIT1"); double centrePixelX = 0.0; if(ReadDoubleKeyIfExists("CRPIX1", centrePixelX)) _phaseCentreDL = (centrePixelX - ((_imgWidth / 2.0)+1.0)) * _pixelSizeX; else _phaseCentreDL = 0.0; if(ReadStringKeyIfExists("CTYPE2",tmp) && tmp != "DEC--SIN" && _checkCType) throw std::runtime_error("Invalid value for CTYPE2"); _phaseCentreDec = 0.0; ReadDoubleKeyIfExists("CRVAL2", _phaseCentreDec); _phaseCentreDec *= M_PI / 180.0; _pixelSizeY = 0.0; ReadDoubleKeyIfExists("CDELT2", _pixelSizeY); _pixelSizeY *= M_PI / 180.0; if(ReadStringKeyIfExists("CUNIT2", tmp) && tmp != "deg" && _checkCType) throw std::runtime_error("Invalid value for CUNIT2"); double centrePixelY = 0.0; if(ReadDoubleKeyIfExists("CRPIX2", centrePixelY)) _phaseCentreDM = ((_imgHeight / 2.0)+1.0 - centrePixelY) * _pixelSizeY; else _phaseCentreDM = 0.0; _dateObs = 0.0; readDateKeyIfExists("DATE-OBS", _dateObs); if(naxis >= 3 && readStringKey("CTYPE3") == "FREQ") { _frequency = readDoubleKey("CRVAL3"); _bandwidth = readDoubleKey("CDELT3"); } else { _frequency = 0.0; _bandwidth = 0.0; } if(naxis >= 4 && readStringKey("CTYPE4") == "STOKES") { double val = readDoubleKey("CRVAL4"); switch(int(val)) { default: throw std::runtime_error("Unknown polarization specified in fits file"); case 1: _polarization = Polarization::StokesI; break; case 2: _polarization = Polarization::StokesQ; break; case 3: _polarization = Polarization::StokesU; break; case 4: _polarization = Polarization::StokesV; break; case -1: _polarization = Polarization::RR; break; case -2: _polarization = Polarization::LL; break; case -3: _polarization = Polarization::RL; break; case -4: _polarization = Polarization::LR; break; case -5: _polarization = Polarization::XX; break; case -6: _polarization = Polarization::YY; break; case -7: _polarization = Polarization::XY; break; case -8: _polarization = Polarization::YX; break; } } else { _polarization = Polarization::StokesI; } double bMaj=0.0, bMin=0.0, bPa=0.0; if(ReadDoubleKeyIfExists("BMAJ", bMaj) && ReadDoubleKeyIfExists("BMIN", bMin) && ReadDoubleKeyIfExists("BPA", bPa)) { _hasBeam = true; _beamMajorAxisRad = bMaj * (M_PI / 180.0); _beamMinorAxisRad = bMin * (M_PI / 180.0); _beamPositionAngle = bPa * (M_PI / 180.0); } else { _hasBeam = false; _beamMajorAxisRad = 0.0; _beamMinorAxisRad = 0.0; _beamPositionAngle = 0.0; } _telescopeName = std::string(); ReadStringKeyIfExists("TELESCOP", _telescopeName); _observer = std::string(); ReadStringKeyIfExists("OBSERVER", _observer); _objectName = std::string(); ReadStringKeyIfExists("OBJECT", _objectName); _origin = std::string(); _originComment = std::string(); ReadStringKeyIfExists("ORIGIN", _origin, _originComment); _history.clear(); readHistory(); }
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name) : Q3MainWindow( parent, name, Qt::WDestructiveClose ), pathCombo( 0 ), selectedURL() { DigitDebug::ctor(QString("helpwindow " + QString::number((ulong) this, 16))); readHistory(); readBookmarks(); browser = new Q3TextBrowser( this ); CHECK_PTR_ENGAUGE(browser); browser->mimeSourceFactory()->setFilePath( _path ); browser->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); setCentralWidget( browser ); if ( !home_.isEmpty() ) browser->setSource( home_ ); connect( browser, SIGNAL( highlighted( const QString&) ), statusBar(), SLOT( message( const QString&)) ); // display help window in previous position with same size DefaultSettings& rSettings = DefaultSettings::instance(); move(rSettings.getWindowHelpPosition()); resize(rSettings.getWindowHelpSize()); QMenu* file = new QMenu( this ); CHECK_PTR_ENGAUGE(file); file->insertItem( tr("&Open File"), this, SLOT( openFile() ), Qt::CTRL+Qt::Key_O ); file->insertItem( tr("&Print"), this, SLOT( print() ), Qt::CTRL+Qt::Key_P ); file->insertSeparator(); file->insertItem( tr("&Close"), this, SLOT( close() ), Qt::CTRL+Qt::Key_Q ); //file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), Qt::CTRL+Qt::Key_X ); // The same three icons are used twice each. QPixmap helpback (helpback_xpm); QPixmap helpforward (helpforward_xpm); QPixmap helphome (helphome_xpm); QIcon icon_back (helpback); QIcon icon_forward (helpforward); QIcon icon_home (helphome); QMenu* go = new QMenu( this ); CHECK_PTR_ENGAUGE(go); backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), Qt::CTRL+Qt::Key_Left ); forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), Qt::CTRL+Qt::Key_Right ); go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) ); hist = new QMenu( this ); CHECK_PTR_ENGAUGE(hist); QStringList::Iterator it = history.begin(); for ( ; it != history.end(); ++it ) mHistory[ hist->insertItem( *it ) ] = *it; connect( hist, SIGNAL( activated( int ) ), this, SLOT( histChosen( int ) ) ); bookm = new QMenu( this ); CHECK_PTR_ENGAUGE(bookm); bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); bookm->insertSeparator(); QStringList::Iterator it2 = bookmarks.begin(); for ( ; it2 != bookmarks.end(); ++it2 ) mBookmarks[ bookm->insertItem( *it2 ) ] = *it2; connect( bookm, SIGNAL( activated( int ) ), this, SLOT( bookmChosen( int ) ) ); menuBar()->insertItem( tr("&File"), file ); menuBar()->insertItem( tr("&Go"), go ); menuBar()->insertItem( tr( "History" ), hist ); menuBar()->insertItem( tr( "Bookmarks" ), bookm ); menuBar()->setItemEnabled( forwardId, FALSE); menuBar()->setItemEnabled( backwardId, FALSE); connect( browser, SIGNAL( backwardAvailable( bool ) ), this, SLOT( setBackwardAvailable( bool ) ) ); connect( browser, SIGNAL( forwardAvailable( bool ) ), this, SLOT( setForwardAvailable( bool ) ) ); Q3ToolBar* toolbar = new Q3ToolBar( this ); CHECK_PTR_ENGAUGE(toolbar); addToolBar( toolbar, "Toolbar"); QToolButton* button; button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar ); CHECK_PTR_ENGAUGE(button); connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar ); CHECK_PTR_ENGAUGE(button); connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); button->setEnabled( FALSE ); button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar ); CHECK_PTR_ENGAUGE(button); toolbar->addSeparator(); pathCombo = new QComboBox( TRUE, toolbar ); CHECK_PTR_ENGAUGE(pathCombo); connect( pathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( pathSelected( const QString & ) ) ); toolbar->setStretchableWidget( pathCombo ); setRightJustification( TRUE ); setDockEnabled( Qt::DockLeft, FALSE ); setDockEnabled( Qt::DockRight, FALSE ); pathCombo->insertItem( home_ ); browser->setFocus(); }