Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

mainwindow.cpp

Go to the documentation of this file.
00001 #include <klocale.h>
00002 /****************************************************************************
00003 ** Form implementation generated from reading ui file './mainwindow.ui'
00004 **
00005 ** Created: Sa Mär 27 17:53:05 2004
00006 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.3   edited May 19 14:22 $)
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "mainwindow.h"
00012 
00013 #include <qvariant.h>
00014 #include <qlayout.h>
00015 #include <qtooltip.h>
00016 #include <qwhatsthis.h>
00017 #include <qaction.h>
00018 #include <qmenubar.h>
00019 #include <qpopupmenu.h>
00020 #include <qtoolbar.h>
00021 #include <qimage.h>
00022 #include <qpixmap.h>
00023 
00024 #include "urlevent.h"
00025 #include "createhtml.h"
00026 #include "importwizarddialog.h"
00027 #include "reindex.h"
00028 #include "./mainwindow.ui.h"
00029 /*
00030  *  Constructs a MainWindow as a child of 'parent', with the
00031  *  name 'name' and widget flags set to 'f'.
00032  *
00033  */
00034 MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl )
00035     : QMainWindow( parent, name, fl )
00036 {
00037     (void)statusBar();
00038     if ( !name )
00039         setName( "MainWindow" );
00040 
00041     // actions
00042     fileExitAction = new QAction( this, "fileExitAction" );
00043     editUndoAction = new QAction( this, "editUndoAction" );
00044     editUndoAction->setIconSet( QIconSet( SmallIcon( "undo" ) ) );
00045     editRedoAction = new QAction( this, "editRedoAction" );
00046     editRedoAction->setIconSet( QIconSet( SmallIcon( "redo" ) ) );
00047     editCutAction = new QAction( this, "editCutAction" );
00048     editCutAction->setIconSet( QIconSet( SmallIcon(  "editcut" ) ) );
00049     editCopyAction = new QAction( this, "editCopyAction" );
00050     editCopyAction->setIconSet( QIconSet( SmallIcon(  "editcopy" ) ) );
00051     editPasteAction = new QAction( this, "editPasteAction" );
00052     editPasteAction->setIconSet( QIconSet( SmallIcon(  "editpaste" ) ) );
00053     editFindAction = new QAction( this, "editFindAction" );
00054     editFindAction->setIconSet( QIconSet( SmallIcon(  "find" ) ) );
00055     helpContentsAction = new QAction( this, "helpContentsAction" );
00056     helpIndexAction = new QAction( this, "helpIndexAction" );
00057     helpAboutAction = new QAction( this, "helpAboutAction" );
00058     createAuthorAction = new QAction( this, "createAuthorAction" );
00059     createAuthorAction->setIconSet( QIconSet( SmallIcon( "newauthor" ) ) );
00060     createNoteAction = new QAction( this, "createNoteAction" );
00061     createNoteAction->setIconSet( QIconSet( SmallIcon( "newnote" ) ) );
00062     createPartAction = new QAction( this, "createPartAction" );
00063     createPartAction->setIconSet( QIconSet( SmallIcon( "newpart" ) ) );
00064     createPublAction = new QAction( this, "createPublAction" );
00065     createPublAction->setIconSet( QIconSet( SmallIcon( "newpubl" ) ) );
00066     createJournalAction = new QAction( this, "createJournalAction" );
00067     createJournalAction->setIconSet( QIconSet( SmallIcon( "newjournal" ) ) );
00068     createPublisherAction = new QAction( this, "createPublisherAction" );
00069     createPublisherAction->setIconSet( QIconSet( SmallIcon( "newpublisher" ) ) );
00070     authorOverviewAction = new QAction( this, "authorOverviewAction" );
00071     authorOverviewAction->setIconSet( QIconSet( SmallIcon( "showauthor" ) ) );
00072     noteOverviewAction = new QAction( this, "noteOverviewAction" );
00073     noteOverviewAction->setIconSet( QIconSet( SmallIcon( "shownote" ) ) );
00074     publOverviewAction = new QAction( this, "publOverviewAction" );
00075     publOverviewAction->setIconSet( QIconSet( SmallIcon( "showpubl" ) ) );
00076     journalOverviewAction = new QAction( this, "journalOverviewAction" );
00077     journalOverviewAction->setIconSet( QIconSet( SmallIcon( "showjournal" ) ) );
00078     publisherOverviewAction = new QAction( this, "publisherOverviewAction" );
00079     publisherOverviewAction->setIconSet( QIconSet( SmallIcon( "showpublisher" ) ) );
00080     forwardAction = new QAction( this, "forwardAction" );
00081     forwardAction->setIconSet( QIconSet( SmallIcon(  "forward" ) ) );
00082     backAction = new QAction( this, "backAction" );
00083     backAction->setIconSet( QIconSet( SmallIcon(  "back" ) ) );
00084     closeAction = new QAction( this, "closeAction" );
00085     exportHtmlAction = new QAction( this, "exportHtmlAction" );
00086     stateAction = new QAction( this, "stateAction" );
00087     stateAction->setIconSet( QIconSet( SmallIcon( "state" ) ) );
00088     searchAction = new QAction( this, "searchAction" );
00089     searchAction->setIconSet( QIconSet( SmallIcon( "find" ) ) );
00090     importJStorAction = new QAction( this, "importJStorAction" );
00091     projectOverviewAction = new QAction( this, "projectOverviewAction" );
00092     projectOverviewAction->setIconSet( QIconSet( SmallIcon( "project_open" ) ) );
00093     createProjectAction = new QAction( this, "createProjectAction" );
00094     createProjectAction->setIconSet( QIconSet( SmallIcon( "project_open" ) ) );
00095     ReindexAction = new QAction( this, "ReindexAction" );
00096 
00097 
00098     // toolbars
00099     toolBar = new QToolBar( QString(""), this, DockTop ); 
00100 
00101     editCutAction->addTo( toolBar );
00102     editCopyAction->addTo( toolBar );
00103     editPasteAction->addTo( toolBar );
00104     editFindAction->addTo( toolBar );
00105     toolBar->addSeparator();
00106     fileExitAction->addTo( toolBar );
00107     navtoolbar = new QToolBar( QString(""), this, DockTop ); 
00108 
00109     backAction->addTo( navtoolbar );
00110     forwardAction->addTo( navtoolbar );
00111     overviewtoolbar = new QToolBar( QString(""), this, DockTop ); 
00112 
00113     authorOverviewAction->addTo( overviewtoolbar );
00114     noteOverviewAction->addTo( overviewtoolbar );
00115     publOverviewAction->addTo( overviewtoolbar );
00116     journalOverviewAction->addTo( overviewtoolbar );
00117     publisherOverviewAction->addTo( overviewtoolbar );
00118     projectOverviewAction->addTo( overviewtoolbar );
00119     searchAction->addTo( overviewtoolbar );
00120     stateAction->addTo( overviewtoolbar );
00121     createToolbar = new QToolBar( QString(""), this, DockTop ); 
00122 
00123     createAuthorAction->addTo( createToolbar );
00124     createNoteAction->addTo( createToolbar );
00125     createPublAction->addTo( createToolbar );
00126     createJournalAction->addTo( createToolbar );
00127     createPublisherAction->addTo( createToolbar );
00128     createProjectAction->addTo( createToolbar );
00129 
00130 
00131     // menubar
00132     menubar = new QMenuBar( this, "menubar" );
00133 
00134     menubar->setGeometry( QRect( 0, 0, 525, 23 ) );
00135 
00136     fileMenu = new QPopupMenu( this );
00137     exportHtmlAction->addTo( fileMenu );
00138     importJStorAction->addTo( fileMenu );
00139     fileMenu->insertSeparator();
00140     fileMenu->insertSeparator();
00141     closeAction->addTo( fileMenu );
00142     fileExitAction->addTo( fileMenu );
00143     menubar->insertItem( QString(""), fileMenu, 2 );
00144 
00145     editMenu = new QPopupMenu( this );
00146     editUndoAction->addTo( editMenu );
00147     editRedoAction->addTo( editMenu );
00148     editMenu->insertSeparator();
00149     editCutAction->addTo( editMenu );
00150     editCopyAction->addTo( editMenu );
00151     editPasteAction->addTo( editMenu );
00152     editMenu->insertSeparator();
00153     editFindAction->addTo( editMenu );
00154     menubar->insertItem( QString(""), editMenu, 3 );
00155 
00156     OverviewMenu = new QPopupMenu( this );
00157     authorOverviewAction->addTo( OverviewMenu );
00158     noteOverviewAction->addTo( OverviewMenu );
00159     publOverviewAction->addTo( OverviewMenu );
00160     journalOverviewAction->addTo( OverviewMenu );
00161     publisherOverviewAction->addTo( OverviewMenu );
00162     projectOverviewAction->addTo( OverviewMenu );
00163     searchAction->addTo( OverviewMenu );
00164     stateAction->addTo( OverviewMenu );
00165     menubar->insertItem( QString(""), OverviewMenu, 4 );
00166 
00167     CreateMenu = new QPopupMenu( this );
00168     createAuthorAction->addTo( CreateMenu );
00169     createNoteAction->addTo( CreateMenu );
00170     createPartAction->addTo( CreateMenu );
00171     createPublAction->addTo( CreateMenu );
00172     createJournalAction->addTo( CreateMenu );
00173     createPublisherAction->addTo( CreateMenu );
00174     createProjectAction->addTo( CreateMenu );
00175     menubar->insertItem( QString(""), CreateMenu, 5 );
00176 
00177     OptionsMenu = new QPopupMenu( this );
00178     ReindexAction->addTo( OptionsMenu );
00179     menubar->insertItem( QString(""), OptionsMenu, 6 );
00180 
00181     helpMenu = new QPopupMenu( this );
00182     helpContentsAction->addTo( helpMenu );
00183     helpIndexAction->addTo( helpMenu );
00184     helpMenu->insertSeparator();
00185     helpAboutAction->addTo( helpMenu );
00186     menubar->insertItem( QString(""), helpMenu, 7 );
00187 
00188     languageChange();
00189     resize( QSize(525, 656).expandedTo(minimumSizeHint()) );
00190     clearWState( WState_Polished );
00191 
00192     // signals and slots connections
00193     connect( editCutAction, SIGNAL( activated() ), this, SLOT( editCut() ) );
00194     connect( editCopyAction, SIGNAL( activated() ), this, SLOT( editCopy() ) );
00195     connect( editPasteAction, SIGNAL( activated() ), this, SLOT( editPaste() ) );
00196     connect( editFindAction, SIGNAL( activated() ), this, SLOT( editFind() ) );
00197     connect( helpIndexAction, SIGNAL( activated() ), this, SLOT( helpIndex() ) );
00198     connect( helpContentsAction, SIGNAL( activated() ), this, SLOT( helpContents() ) );
00199     connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
00200     connect( createAuthorAction, SIGNAL( activated() ), this, SLOT( createAuthor() ) );
00201     connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) );
00202     connect( closeAction, SIGNAL( activated() ), this, SLOT( close() ) );
00203     connect( forwardAction, SIGNAL( activated() ), this, SLOT( forward() ) );
00204     connect( backAction, SIGNAL( activated() ), this, SLOT( back() ) );
00205     connect( noteOverviewAction, SIGNAL( activated() ), this, SLOT( noteOverview() ) );
00206     connect( publOverviewAction, SIGNAL( activated() ), this, SLOT( publOverview() ) );
00207     connect( journalOverviewAction, SIGNAL( activated() ), this, SLOT( journalOverview() ) );
00208     connect( publisherOverviewAction, SIGNAL( activated() ), this, SLOT( publisherOverview() ) );
00209     connect( authorOverviewAction, SIGNAL( activated() ), this, SLOT( authorOverview() ) );
00210     connect( exportHtmlAction, SIGNAL( activated() ), this, SLOT( exportHtml() ) );
00211     connect( stateAction, SIGNAL( activated() ), this, SLOT( state() ) );
00212     connect( searchAction, SIGNAL( activated() ), this, SLOT( search() ) );
00213     connect( importJStorAction, SIGNAL( activated() ), this, SLOT( importJStor() ) );
00214     connect( createJournalAction, SIGNAL( activated() ), this, SLOT( createJournal() ) );
00215     connect( createNoteAction, SIGNAL( activated() ), this, SLOT( createNote() ) );
00216     connect( createPublAction, SIGNAL( activated() ), this, SLOT( createPublication() ) );
00217     connect( createPublisherAction, SIGNAL( activated() ), this, SLOT( createPublisher() ) );
00218     connect( createProjectAction, SIGNAL( activated() ), this, SLOT( createProject() ) );
00219     connect( projectOverviewAction, SIGNAL( activated() ), this, SLOT( projectOverview() ) );
00220     connect( ReindexAction, SIGNAL( activated() ), this, SLOT( reindex() ) );
00221     init();
00222 }
00223 
00224 /*
00225  *  Destroys the object and frees any allocated resources
00226  */
00227 MainWindow::~MainWindow()
00228 {
00229     // no need to delete child widgets, Qt does it all for us
00230 }
00231 
00232 /*
00233  *  Sets the strings of the subwidgets using the current
00234  *  language.
00235  */
00236 void MainWindow::languageChange()
00237 {
00238     setCaption( tr2i18n( "Literature" ) );
00239     fileExitAction->setText( tr2i18n( "Exit" ) );
00240     fileExitAction->setMenuText( tr2i18n( "E&xit" ) );
00241     fileExitAction->setAccel( QString::null );
00242     editUndoAction->setText( tr2i18n( "Undo" ) );
00243     editUndoAction->setMenuText( tr2i18n( "&Undo" ) );
00244     editUndoAction->setAccel( tr2i18n( "Ctrl+Z" ) );
00245     editRedoAction->setText( tr2i18n( "Redo" ) );
00246     editRedoAction->setMenuText( tr2i18n( "&Redo" ) );
00247     editRedoAction->setAccel( tr2i18n( "Ctrl+Y" ) );
00248     editCutAction->setText( tr2i18n( "Cut" ) );
00249     editCutAction->setMenuText( tr2i18n( "&Cut" ) );
00250     editCutAction->setAccel( tr2i18n( "Ctrl+X" ) );
00251     editCopyAction->setText( tr2i18n( "Copy" ) );
00252     editCopyAction->setMenuText( tr2i18n( "C&opy" ) );
00253     editCopyAction->setAccel( tr2i18n( "Ctrl+C" ) );
00254     editPasteAction->setText( tr2i18n( "Paste" ) );
00255     editPasteAction->setMenuText( tr2i18n( "&Paste" ) );
00256     editPasteAction->setAccel( tr2i18n( "Ctrl+V" ) );
00257     editFindAction->setText( tr2i18n( "Find" ) );
00258     editFindAction->setMenuText( tr2i18n( "&Find..." ) );
00259     editFindAction->setAccel( tr2i18n( "Ctrl+F" ) );
00260     helpContentsAction->setText( tr2i18n( "Contents" ) );
00261     helpContentsAction->setMenuText( tr2i18n( "&Contents..." ) );
00262     helpContentsAction->setAccel( QString::null );
00263     helpIndexAction->setText( tr2i18n( "Index" ) );
00264     helpIndexAction->setMenuText( tr2i18n( "&Index..." ) );
00265     helpIndexAction->setAccel( QString::null );
00266     helpAboutAction->setText( tr2i18n( "About" ) );
00267     helpAboutAction->setMenuText( tr2i18n( "&About..." ) );
00268     helpAboutAction->setAccel( QString::null );
00269     createAuthorAction->setText( tr2i18n( "Create Author" ) );
00270     createNoteAction->setText( tr2i18n( "Create Note" ) );
00271     createPartAction->setText( tr2i18n( "Create Part" ) );
00272     createPublAction->setText( tr2i18n( "Create Publication" ) );
00273     createJournalAction->setText( tr2i18n( "Create Journal" ) );
00274     createPublisherAction->setText( tr2i18n( "Create Publisher" ) );
00275     authorOverviewAction->setText( tr2i18n( "Author Overview" ) );
00276     noteOverviewAction->setText( tr2i18n( "Note Overview" ) );
00277     publOverviewAction->setText( tr2i18n( "Publication Overview" ) );
00278     journalOverviewAction->setText( tr2i18n( "Journal Overview" ) );
00279     publisherOverviewAction->setText( tr2i18n( "Publisher Overview" ) );
00280     forwardAction->setText( tr2i18n( "forward" ) );
00281     backAction->setText( tr2i18n( "back" ) );
00282     closeAction->setText( tr2i18n( "Close" ) );
00283     exportHtmlAction->setText( tr2i18n( "Export HTML" ) );
00284     stateAction->setText( tr2i18n( "State" ) );
00285     stateAction->setMenuText( tr2i18n( "State" ) );
00286     stateAction->setToolTip( tr2i18n( "State" ) );
00287     stateAction->setStatusTip( tr2i18n( "State" ) );
00288     searchAction->setText( tr2i18n( "Search" ) );
00289     importJStorAction->setText( tr2i18n( "Import" ) );
00290     projectOverviewAction->setText( tr2i18n( "Project Overview" ) );
00291     createProjectAction->setText( tr2i18n( "Create Project" ) );
00292     ReindexAction->setText( tr2i18n( "Re-index" ) );
00293     toolBar->setLabel( tr2i18n( "Tools" ) );
00294     navtoolbar->setLabel( tr2i18n( "Navigation Toolbar" ) );
00295     overviewtoolbar->setLabel( tr2i18n( "Toolbar" ) );
00296     createToolbar->setLabel( tr2i18n( "Toolbar_2" ) );
00297     menubar->findItem( 2 )->setText( tr2i18n( "&File" ) );
00298     menubar->findItem( 3 )->setText( tr2i18n( "&Edit" ) );
00299     menubar->findItem( 4 )->setText( tr2i18n( "Overview" ) );
00300     menubar->findItem( 5 )->setText( tr2i18n( "Create" ) );
00301     menubar->findItem( 6 )->setText( tr2i18n( "Options" ) );
00302     menubar->findItem( 7 )->setText( tr2i18n( "&Help" ) );
00303 }
00304 
00305 #include "mainwindow.moc"

Generated on Sat Mar 27 19:20:40 2004 for Literature by doxygen 1.3.6-20040222