Esempio n. 1
0
void ResTable::setRclMain(RclMain *m, bool ismain) 
{
    m_rclmain = m;
    m_ismainres = ismain;

    // We allow single selection only in the main table because this
    // may have a mix of file-level docs and subdocs and multisave
    // only works for subdocs
    if (m_ismainres)
	tableView->setSelectionMode(QAbstractItemView::SingleSelection);
    else
	tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);

    if (!m_ismainres) {
	connect(new QShortcut(closeKeySeq, this), SIGNAL (activated()), 
		this, SLOT (close()));
	connect(new QShortcut(quitKeySeq, this), SIGNAL (activated()), 
		m_rclmain, SLOT (fileExit()));
	connect(this, SIGNAL(previewRequested(Rcl::Doc)), 
		m_rclmain, SLOT(startPreview(Rcl::Doc)));
	connect(this, SIGNAL(docSaveToFileClicked(Rcl::Doc)), 
		m_rclmain, SLOT(saveDocToFile(Rcl::Doc)));
	connect(this, SIGNAL(editRequested(Rcl::Doc)), 
		m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
    }
}
Esempio n. 2
0
void dnd::contextMenuEvent ( QContextMenuEvent * )
{

	QString path = INSTALLDIR"images/";

    QString snewtask = path + "add.png";
    QString soptions = path + "preferences.png";  
    QString sabout = path + "about.png";
    QString sexit = path + "exit.png";

    QPixmap pix_newtask(snewtask);
    QPixmap pix_options(soptions);
    QPixmap pix_about(sabout);
    QPixmap pix_exit(sexit);

	QPopupMenu* contextMenu = new QPopupMenu( this );
    Q_CHECK_PTR( contextMenu );
	QLabel *caption = new QLabel(tr("<font color=darkblue><u><b>wdget</b></u></font>"), this );
	caption->setAlignment( Qt::AlignCenter );
	contextMenu->insertSeparator();
	contextMenu->insertItem( caption );
	contextMenu->insertSeparator();
	contextMenu->insertItem(pix_newtask, tr("New task"), dmw, SLOT(fileNewUrl()) );
	contextMenu->insertItem(pix_options, tr("Setting..."), dmw, SLOT(filePref()) );
	contextMenu->insertItem(pix_about,  tr("About..."), dmw, SLOT(helpAbout()) );
	contextMenu->insertItem(pix_exit,  tr("Quit"), dmw, SLOT(fileExit()) );
	contextMenu->exec( QCursor::pos() );
	delete contextMenu;
}
Esempio n. 3
0
bool TextEdit::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: fileNew(); break;
    case 1: fileOpen(); break;
    case 2: fileSave(); break;
    case 3: fileSaveAs(); break;
    case 4: filePrint(); break;
    case 5: fileClose(); break;
    case 6: fileExit(); break;
    case 7: editUndo(); break;
    case 8: editRedo(); break;
    case 9: editCut(); break;
    case 10: editCopy(); break;
    case 11: editPaste(); break;
    case 12: textBold(); break;
    case 13: textUnderline(); break;
    case 14: textItalic(); break;
    case 15: textFamily((const QString&)static_QUType_QString.get(_o+1)); break;
    case 16: textSize((const QString&)static_QUType_QString.get(_o+1)); break;
    case 17: textColor(); break;
    case 18: textAlign((QAction*)static_QUType_ptr.get(_o+1)); break;
    case 19: fontChanged((const QFont&)*((const QFont*)static_QUType_ptr.get(_o+1))); break;
    case 20: colorChanged((const QColor&)*((const QColor*)static_QUType_ptr.get(_o+1))); break;
    case 21: alignmentChanged((int)static_QUType_int.get(_o+1)); break;
    case 22: editorChanged((QWidget*)static_QUType_ptr.get(_o+1)); break;
    default:
	return QMainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}
Esempio n. 4
0
bool MainWindow::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: buildPalette(); break;
    case 1: buildFont(); break;
    case 2: tunePalette(); break;
    case 3: paletteSelected((int)static_QUType_int.get(_o+1)); break;
    case 4: styleSelected((const QString&)static_QUType_QString.get(_o+1)); break;
    case 5: familySelected((const QString&)static_QUType_QString.get(_o+1)); break;
    case 6: substituteSelected((const QString&)static_QUType_QString.get(_o+1)); break;
    case 7: removeSubstitute(); break;
    case 8: addSubstitute(); break;
    case 9: downSubstitute(); break;
    case 10: upSubstitute(); break;
    case 11: removeLibpath(); break;
    case 12: addLibpath(); break;
    case 13: downLibpath(); break;
    case 14: upLibpath(); break;
    case 15: browseLibpath(); break;
    case 16: removeFontpath(); break;
    case 17: addFontpath(); break;
    case 18: downFontpath(); break;
    case 19: upFontpath(); break;
    case 20: browseFontpath(); break;
    case 21: fileSave(); break;
    case 22: fileExit(); break;
    case 23: somethingModified(); break;
    case 24: helpAbout(); break;
    case 25: helpAboutQt(); break;
    case 26: pageChanged((QWidget*)static_QUType_ptr.get(_o+1)); break;
    default:
	return MainWindowBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
Esempio n. 5
0
QT_BEGIN_NAMESPACE

/*
 *  Constructs a MainWindowBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
MainWindowBase::MainWindowBase(QWidget* parent, const char* name, Qt::WindowFlags fl)
    : Q3MainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(fontpathlineedit, SIGNAL(returnPressed()), this, SLOT(addFontpath()));
    connect(PushButton15, SIGNAL(clicked()), this, SLOT(addFontpath()));
    connect(PushButton1, SIGNAL(clicked()), this, SLOT(addSubstitute()));
    connect(PushButton14, SIGNAL(clicked()), this, SLOT(browseFontpath()));
    connect(stylecombo, SIGNAL(activated(int)), this, SLOT(buildFont()));
    connect(psizecombo, SIGNAL(activated(int)), this, SLOT(buildFont()));
    connect(PushButton12, SIGNAL(clicked()), this, SLOT(downFontpath()));
    connect(PushButton3, SIGNAL(clicked()), this, SLOT(downSubstitute()));
    connect(familycombo, SIGNAL(activated(QString)), this, SLOT(familySelected(QString)));
    connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
    connect(fileSaveAction, SIGNAL(activated()), this, SLOT(fileSave()));
    connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
    connect(helpAboutQtAction, SIGNAL(activated()), this, SLOT(helpAboutQt()));
    connect(TabWidget3, SIGNAL(currentChanged(QWidget*)), this, SLOT(pageChanged(QWidget*)));
    connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int)));
    connect(PushButton13, SIGNAL(clicked()), this, SLOT(removeFontpath()));
    connect(PushButton4, SIGNAL(clicked()), this, SLOT(removeSubstitute()));
    connect(effectcheckbox, SIGNAL(toggled(bool)), effectbase, SLOT(setEnabled(bool)));
    connect(fontembeddingcheckbox, SIGNAL(toggled(bool)), GroupBox10, SLOT(setEnabled(bool)));
    connect(toolboxeffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(dcispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
    connect(cfispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
    connect(wslspin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
    connect(menueffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(comboeffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(audiosinkCombo, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(videomodeCombo, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(tooltipeffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(strutwidth, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
    connect(strutheight, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
    connect(effectcheckbox, SIGNAL(toggled(bool)), this, SLOT(somethingModified()));
    connect(resolvelinks, SIGNAL(toggled(bool)), this, SLOT(somethingModified()));
    connect(fontembeddingcheckbox, SIGNAL(clicked()), this, SLOT(somethingModified()));
    connect(rtlExtensions, SIGNAL(toggled(bool)), this, SLOT(somethingModified()));
    connect(inputStyle, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(inputMethod, SIGNAL(activated(int)), this, SLOT(somethingModified()));
    connect(gstylecombo, SIGNAL(activated(QString)), this, SLOT(styleSelected(QString)));
    connect(familysubcombo, SIGNAL(activated(QString)), this, SLOT(substituteSelected(QString)));
    connect(btnAdvanced, SIGNAL(clicked()), this, SLOT(tunePalette()));
    connect(PushButton11, SIGNAL(clicked()), this, SLOT(upFontpath()));
    connect(PushButton2, SIGNAL(clicked()), this, SLOT(upSubstitute()));
    init();
}
Esempio n. 6
0
qavimator::~qavimator()
{
    //if (animationView) delete animationView;
    //animationView=0;
    fileExit();

    delete ui;


}
Esempio n. 7
0
// ------------------------------------------
//  csImgGoogle MainWindow
// ------------------------------------------
csImgGoogle::csImgGoogle( QWidget *parent)
 : QMainWindow( parent)
{
    // ---------------------------
    // Setup the MainGUI
    // ---------------------------
    setupUi(this);

    // page attributes
    page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

    myWebView = new csWebView(centralwidget);
    myWebView->setObjectName(QString::fromUtf8("myWebView"));
    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(myWebView->sizePolicy().hasHeightForWidth());
    myWebView->setSizePolicy(sizePolicy);
    myWebView->setMinimumSize(QSize(500, 0));
    myWebView->setUrl(QUrl("http://www.google.com/imghp"));
    gridLayout->addWidget(myWebView, 1, 0, 1, 1);

    // ---------------------------
    // create the cglx server
    // ---------------------------
    connected   = false;

    sm	= new myserver(CS_HCI_CUST_SERV,contact_port, CS_SERV_ACTIVE);

    // ---------------------------
    // connect slots and signals
    // ---------------------------
    connect(actionExit, SIGNAL(triggered()), this, SLOT(fileExit()));
    connect(actionConnect, SIGNAL(triggered()), this, SLOT(cs_connect()));
    connect(actionDisconnect, SIGNAL(triggered()), this, SLOT(cs_disconnect()));
    connect(actionLoad_Image, SIGNAL(triggered()), this, SLOT(cs_loadImages()));


    connect(myWebView, SIGNAL(send_image(int,int,const QUrl &)), this, SLOT(sendImgURIToClient(int,int,const QUrl &)));

    sm->setGoogler(this);

    // web inspector
    inspector   = new QWebInspector();
    inspector->setPage(myWebView->page());
}
Esempio n. 8
0
/*
 *  Constructs a RenderWindow as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
RenderWindow::RenderWindow(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen()));
    connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint()));
    connect(filePrintToPDFAction, SIGNAL(activated()), this, SLOT(filePrintToPDF()));
    connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
    connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
    connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
    connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
    connect(_table, SIGNAL(selectionChanged()), this, SLOT(sSelectionChanged()));
    connect(_list, SIGNAL(clicked()), this, SLOT(sList()));
}
Esempio n. 9
0
MQLEdit::MQLEdit(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(fileNewAction, SIGNAL(activated()), this, SLOT(fileNew()));
    connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen()));
    connect(fileSaveAction, SIGNAL(activated()), this, SLOT(fileSave()));
    connect(fileSaveAsAction, SIGNAL(activated()), this, SLOT(fileSaveAs()));
    connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint()));
    connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
    connect(editFindAction, SIGNAL(activated()), this, SLOT(editFind()));
    connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex()));
    connect(helpContentsAction, SIGNAL(activated()), this, SLOT(helpContents()));
    connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
    connect(fileDatabaseConnectAction, SIGNAL(activated()), this, SLOT(fileDatabaseConnect()));
    connect(fileDatabaseDisconnectAction, SIGNAL(activated()), this, SLOT(fileDatabaseDisconnect()));
    connect(viewParameter_ListAction, SIGNAL(activated()), this, SLOT(showParamList()));
    connect(toolsParse_QueryAction, SIGNAL(activated()), this, SLOT(parseQuery()));
    connect(toolsExecute_QueryAction, SIGNAL(activated()), this, SLOT(execQuery()));
    connect(viewLog_OutputAction, SIGNAL(activated()), this, SLOT(showLog()));
    connect(viewResultsAction, SIGNAL(activated()), this, SLOT(showResults()));
    connect(viewExecuted_SQLAction, SIGNAL(activated()), this, SLOT(showExecutedSQL()));

    QSqlDatabase db = QSqlDatabase();
    if(_loggedIn && db.isValid() && db.isOpen()) {
	_loggedIn = true;
    } else {
	_loggedIn = false;
    }
    
    fileDatabaseConnectAction->setEnabled(!_loggedIn);
    fileDatabaseDisconnectAction->setEnabled(_loggedIn);
    
    _pEdit = new ParameterEdit(this);
    _log = new LogOutput(this);
    _sql = new LogOutput(this);
    _results = new ResultsOutput(this);
}
Esempio n. 10
0
ImportWindow::ImportWindow(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex()));
  connect(helpContentsAction, SIGNAL(activated()), this, SLOT(helpContents()));
  connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
  connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
  connect(fileOpenAction, SIGNAL(activated()), this, SLOT(sAdd()));
  connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
  connect(_import, SIGNAL(clicked()), this, SLOT(sImport()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove()));
  connect(_reports, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(reportsDoubleClicked(QListWidgetItem*)));

  _reports->clear();
  _dbTimerId = startTimer(60000);
}
Esempio n. 11
0
RenderWindow::RenderWindow(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen()));
  connect(fileLoadFromDB, SIGNAL(activated()), this, SLOT(fileLoad()));
  connect(filePrintPreviewAction, SIGNAL(activated()), this, SLOT(filePreview()));
  connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint()));
  connect(filePrintToPDFAction, SIGNAL(activated()), this, SLOT(filePrintToPDF()));
  connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
  connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
  connect(_table, SIGNAL(itemSelectionChanged()), this, SLOT(sSelectionChanged()));
  connect(_list, SIGNAL(clicked()), this, SLOT(sList()));
  _autoPrint = false;                    //AUTOPRINT
}
Esempio n. 12
0
void TextEdit::setupFileActions()
{
    QToolBar *tb = new QToolBar( this );
    tb->setLabel( "File Actions" );
    QPopupMenu *menu = new QPopupMenu( this );
    menuBar()->insertItem( tr( "&File" ), menu );

    QAction *a;
    a = new QAction( QPixmap::fromMimeSource( "filenew.xpm" ), tr( "&New..." ), CTRL + Key_N, this, "fileNew" );
    connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
    a->addTo( tb );
    a->addTo( menu );
    a = new QAction( QPixmap::fromMimeSource( "fileopen.xpm" ), tr( "&Open..." ), CTRL + Key_O, this, "fileOpen" );
    connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
    a->addTo( tb );
    a->addTo( menu );
    menu->insertSeparator();
    a = new QAction( QPixmap::fromMimeSource( "filesave.xpm" ), tr( "&Save..." ), CTRL + Key_S, this, "fileSave" );
    connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) );
    a->addTo( tb );
    a->addTo( menu );
    a = new QAction( tr( "Save &As..." ), 0, this, "fileSaveAs" );
    connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
    a->addTo( menu );
    menu->insertSeparator();
    a = new QAction( QPixmap::fromMimeSource( "fileprint.xpm" ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" );
    connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) );
    a->addTo( tb );
    a->addTo( menu );
    a = new QAction( tr( "&Close" ), 0, this, "fileClose" );
    connect( a, SIGNAL( activated() ), this, SLOT( fileClose() ) );
    a->addTo( menu );
    a = new QAction( tr( "E&xit" ), 0, this, "fileExit" );
    connect( a, SIGNAL( activated() ), this, SLOT( fileExit() ) );
    a->addTo( menu );
}
Esempio n. 13
0
ImportWindow::ImportWindow(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex()));
    connect(helpContentsAction, SIGNAL(activated()), this, SLOT(helpContents()));
    connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
    connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
    connect(fileOpenAction, SIGNAL(activated()), this, SLOT(sAdd()));
    connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
    connect(_import, SIGNAL(clicked()), this, SLOT(sImport()));
    connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove()));

    _reports->clear();

    QSqlQuery qpop;
    QSqlError err;
    if(!qpop.exec(getSqlFromTag("fmt19", QSqlDatabase::database().driverName())))
    {
        err = qpop.lastError();
        _log->append(tr("<font color=red>The following error was encountered "
                        "retrieving available schemas:\n"
                        "\t%1\n\t%2\n</font>")
                     .arg(err.driverText())
                     .arg(err.databaseText()));
        return;
    } else
        while (qpop.next())
            _schema->addItem(qpop.value(0).toString(), qpop.value(0));

    _dbTimerId = startTimer(60000);
}
Esempio n. 14
0
MainGui::MainGui(QWidget *p) : QMainWindow(p), currenthdr(NULL) {
	setupUi(this);
	setAcceptDrops(true);

	//main toolbar setup
	QActionGroup *toolBarOptsGroup = new QActionGroup(this);
	toolBarOptsGroup->addAction(actionText_Under_Icons);
	toolBarOptsGroup->addAction(actionIcons_Only);
	toolBarOptsGroup->addAction(actionText_Alongside_Icons);
	toolBarOptsGroup->addAction(actionText_Only);
	menuToolbars->addAction(toolBar->toggleViewAction());

	mdiArea = new QMdiArea(this);
	mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
	mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
	mdiArea->setBackground(QBrush(QColor::fromRgb(192, 192, 192)) );
	setCentralWidget(mdiArea);

	qtpfsgui_options=QtpfsguiOptions::getInstance();
	load_options();

	setWindowTitle("Qtpfsgui "QTPFSGUIVERSION);

	connect(mdiArea,SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(updateActions(QMdiSubWindow*)));
	connect(fileNewAction, SIGNAL(triggered()), this, SLOT(fileNewViaWizard()));
	connect(fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen()));
	connect(fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
	connect(TonemapAction, SIGNAL(triggered()), this, SLOT(tonemap_requested()));
	connect(rotateccw, SIGNAL(triggered()), this, SLOT(rotateccw_requested()));
	connect(rotatecw, SIGNAL(triggered()), this, SLOT(rotatecw_requested()));
	connect(actionResizeHDR, SIGNAL(triggered()), this, SLOT(resize_requested()));
	connect(action_Projective_Transformation, SIGNAL(triggered()), this, SLOT(projectiveTransf_requested()));
	connect(actionBatch_Tone_Mapping, SIGNAL(triggered()), this, SLOT(batch_requested()));
	connect(Low_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_ldr_exp()));
	connect(Fit_to_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_fit_exp()));
	connect(Shrink_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_shrink_exp()));
	connect(Extend_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_extend_exp()));
	connect(Decrease_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_decrease_exp()));
	connect(Increase_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_increase_exp()));
	connect(zoomInAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomin()));
	connect(zoomOutAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomout()));
	connect(fitToWindowAct,SIGNAL(toggled(bool)),this,SLOT(current_mdi_fit_to_win(bool)));
	connect(normalSizeAct,SIGNAL(triggered()),this,SLOT(current_mdi_original_size()));
	connect(documentationAction,SIGNAL(triggered()),this,SLOT(openDocumentation()));
	connect(actionWhat_s_This,SIGNAL(triggered()),this,SLOT(enterWhatsThis()));
	connect(actionAbout_Qt,SIGNAL(triggered()),qApp,SLOT(aboutQt()));
	connect(actionAbout_Qtpfsgui,SIGNAL(triggered()),this,SLOT(aboutQtpfsgui()));
	connect(OptionsAction,SIGNAL(triggered()),this,SLOT(preferences_called()));
	connect(Transplant_Exif_Data_action,SIGNAL(triggered()),this,SLOT(transplant_called()));
	connect(actionTile,SIGNAL(triggered()),mdiArea,SLOT(tileSubWindows()));
	connect(actionCascade,SIGNAL(triggered()),mdiArea,SLOT(cascadeSubWindows()));
	connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit()));
	connect(menuWindows, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu()));
	connect(actionSave_Hdr_Preview, SIGNAL(triggered()), this, SLOT(saveHdrPreview()));

	//QSignalMapper?
	connect(actionText_Under_Icons,SIGNAL(triggered()),this,SLOT(Text_Under_Icons()));
	connect(actionIcons_Only,SIGNAL(triggered()),this,SLOT(Icons_Only()));
	connect(actionText_Alongside_Icons,SIGNAL(triggered()),this,SLOT(Text_Alongside_Icons()));
	connect(actionText_Only,SIGNAL(triggered()),this,SLOT(Text_Only()));

	windowMapper = new QSignalMapper(this);
	connect(windowMapper,SIGNAL(mapped(QWidget*)),this,SLOT(setActiveSubWindow(QWidget*)));

	//recent files
	for (int i = 0; i < MaxRecentFiles; ++i) {
		recentFileActs[i] = new QAction(this);
		recentFileActs[i]->setVisible(false);
		connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile()));
	}
	separatorRecentFiles = menuFile->addSeparator();
	for (int i = 0; i < MaxRecentFiles; ++i)
		menuFile->addAction(recentFileActs[i]);
	updateRecentFileActions();

	//this->showMaximized();

	testTempDir(qtpfsgui_options->tempfilespath);
	statusBar()->showMessage(tr("Ready.... Now open an Hdr or create one!"),17000);
}
Esempio n. 15
0
MQLEdit::MQLEdit(QWidget* parent, Qt::WindowFlags fl)
    : QWidget(parent, fl)
{
  setupUi(this);

  if (OpenRPT::name.isEmpty())
    OpenRPT::name = tr("MetaSQL Editor");

  _mqlSelector = 0;
  _document = _text->document();
  _document->setDefaultFont(QFont("Courier"));

  connect(_document,     SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool)));
  connect(editFindAction,              SIGNAL(triggered()), this, SLOT(editFind()));
  connect(fileDatabaseConnectAction,   SIGNAL(triggered()), this, SLOT(fileDatabaseConnect()));
  connect(fileDatabaseDisconnectAction,SIGNAL(triggered()), this, SLOT(fileDatabaseDisconnect()));
  connect(fileDatabaseOpenAction,      SIGNAL(triggered()), this, SLOT(fileDatabaseOpen()));
  connect(fileDatabaseSaveAsAction,    SIGNAL(triggered()), this, SLOT(fileDatabaseSaveAs()));
  connect(fileExitAction,              SIGNAL(triggered()), this, SLOT(fileExit()));
  connect(fileNewAction,               SIGNAL(triggered()), this, SLOT(fileNew()));
  connect(fileOpenAction,              SIGNAL(triggered()), this, SLOT(fileOpen()));
  connect(filePrintAction,             SIGNAL(triggered()), this, SLOT(filePrint()));
  connect(fileSaveAction,              SIGNAL(triggered()), this, SLOT(fileSave()));
  connect(fileSaveAsAction,            SIGNAL(triggered()), this, SLOT(fileSaveAs()));
  connect(helpAboutAction,             SIGNAL(triggered()), this, SLOT(helpAbout()));
  connect(helpContentsAction,          SIGNAL(triggered()), this, SLOT(helpContents()));
  connect(helpIndexAction,             SIGNAL(triggered()), this, SLOT(helpIndex()));
  connect(searchForParametersAction,   SIGNAL(triggered()), this, SLOT(populateParameterEdit()));
  connect(toolsExecute_QueryAction,    SIGNAL(triggered()), this, SLOT(execQuery()));
  connect(toolsParse_QueryAction,      SIGNAL(triggered()), this, SLOT(parseQuery()));
  connect(viewExecuted_SQLAction,      SIGNAL(triggered()), this, SLOT(showExecutedSQL()));
  connect(viewLog_OutputAction,        SIGNAL(triggered()), this, SLOT(showLog()));
  connect(viewParameter_ListAction,    SIGNAL(triggered()), this, SLOT(showParamList()));
  connect(viewResultsAction,           SIGNAL(triggered()), this, SLOT(showResults()));

  QSqlDatabase db = QSqlDatabase().database();
  if(db.isValid() && db.isOpen())
    OpenRPT::loggedIn = true;
  else
  {
    OpenRPT::loggedIn = false;
    db = QSqlDatabase();
  }

  if (parent) // then must be embedded
  {
    if (DEBUG)
      qDebug("MQLEdit::MQLEdit(%p) OpenRPT::loggedIn = %d",
             parent, OpenRPT::loggedIn);
    fileDatabaseConnectAction->setVisible(! OpenRPT::loggedIn);
    fileDatabaseDisconnectAction->setVisible(! OpenRPT::loggedIn);

    fileExitAction->setText(tr("Close"));

    QToolBar *menuproxy = new QToolBar(this);
    menuproxy->setObjectName("menuproxy");
    menuproxy->setOrientation(Qt::Horizontal);
    verticalLayout->insertWidget(0, menuproxy);

    menuproxy->addAction(fileMenu->menuAction());
    menuproxy->addAction(editMenu->menuAction());
    menuproxy->addAction(ViewMenu->menuAction());
    menuproxy->addAction(ToolsMenu->menuAction());
    menuproxy->addAction(helpMenu->menuAction());
  }
  
  fileDatabaseConnectAction->setEnabled(!OpenRPT::loggedIn);
  fileDatabaseDisconnectAction->setEnabled(OpenRPT::loggedIn);
  fileDatabaseOpenAction->setEnabled(OpenRPT::loggedIn);
  fileDatabaseSaveAsAction->setEnabled(OpenRPT::loggedIn);
  
  _pEdit   = new ParameterEdit(this, Qt::Window);
  _log     = new LogOutput(this);
  _sql     = new LogOutput(this);
  _results = new ResultsOutput(this);

  _highlighter = new MetaSQLHighlighter(_document);

  clear();

  setDestType(MQLUnknown);
}
Esempio n. 16
0
void kdvi::makeMenuBar()
{
    if (menuBar) delete menuBar;
    menuBar = new KMenuBar( this );
    CHECK_PTR( menuBar );

    QPopupMenu *p = new QPopupMenu;
    CHECK_PTR( p );

    m_fn = p->insertItem( i18n("&New"),	this, SLOT(fileNew()) );
    m_fo = p->insertItem( i18n("&Open ..."),	this, SLOT(fileOpen()) );

    recentmenu = new QPopupMenu;
    CHECK_PTR( recentmenu );

    connect( recentmenu, SIGNAL(activated(int)), SLOT(openRecent(int)) );

    m_fr = p->insertItem( i18n("Open &recent"),	recentmenu );

    m_fp = p->insertItem( i18n("&Print ..."),	this, SLOT(filePrint()));
    m_fx = p->insertItem( i18n("E&xit"), this, SLOT(fileExit()));

    m_f = p;
    menuBar->insertItem( i18n("&File"), p, -2 );

    p = new QPopupMenu;
    CHECK_PTR( p );
    m_vi = p->insertItem( i18n("Zoom &in"),	dviwin, SLOT(prevShrink()) );
    m_vo = p->insertItem( i18n("Zoom &out"),	dviwin, SLOT(nextShrink()) );
    m_vf = p->insertItem( i18n("&Fit to page"),	this, SLOT(viewFitPage()) );
    m_vw = p->insertItem( i18n("Fit to page &width"),	this, SLOT(viewFitPageWidth()));
    p->insertSeparator();
    m_vr = p->insertItem( i18n("&Redraw page"),	dviwin, SLOT(drawPage()) );

    m_v = p;
    menuBar->insertItem( i18n("&View"), p, -2 );

    p = new QPopupMenu;
    CHECK_PTR( p );
    m_pp = p->insertItem( i18n("&Previous"),	dviwin, SLOT(prevPage()) );
    m_pn = p->insertItem( i18n("&Next"),		dviwin, SLOT(nextPage()) );
    m_pf = p->insertItem( i18n("&First"),	dviwin, SLOT(firstPage()) );
    m_pl = p->insertItem( i18n("&Last"),		dviwin, SLOT(lastPage()) );
    m_pg = p->insertItem( i18n("&Go to ..."),	this,   SLOT(pageGoto()) );

    m_p = p;
    menuBar->insertItem( i18n("&Page"), p, -2 );

    p = new QPopupMenu;
    CHECK_PTR( p );
    p->setCheckable( TRUE );
    m_op = p->insertItem( i18n("&Preferences ..."), this, SLOT(optionsPreferences()));
    m_ok = p->insertItem( i18n("&Keys ..."), this, SLOT(configKeys()));
    p->insertSeparator();
    m_of = p->insertItem( i18n("Make PK-&fonts"), this, SLOT(toggleMakePK()) );
    p->setItemChecked( m_of, makepk );
    m_o0 = p->insertItem( i18n("Show PS"), this, SLOT(toggleShowPS()));
    p->setItemChecked( m_o0, showPS );
    m_om = p->insertItem( i18n("Show &Menubar"), this, SLOT(toggleShowMenubar()) );
    p->setItemChecked( m_om, !hideMenubar );
    m_ob = p->insertItem( i18n("Show &Buttons"), this, SLOT(toggleShowButtons()) );
    p->setItemChecked( m_ob, !hideButtons );
    m_ot = p->insertItem( i18n("Show Page Lis&t"), this, SLOT(toggleVertToolbar()) );
    p->setItemChecked( m_ol, vertToolbar );
    m_os = p->insertItem( i18n("Show &Statusbar"), this, SLOT(toggleShowStatusbar()) );
    p->setItemChecked( m_os, !hideStatusbar );
    m_ol = p->insertItem( i18n("Show Scro&llbars"), this, SLOT(toggleShowScrollbars()) );
    p->setItemChecked( m_ol, !hideScrollbars );

    m_o = p;
    menuBar->insertItem( i18n("&Options"), p, -2 );
    optionsmenu = p;

    menuBar->insertSeparator();

    QPopupMenu *help = kapp->getHelpMenu(true, QString(i18n("DVI Viewer"))
                                         + " " + KDVI_VERSION
                                         + i18n("\n\nby Markku Hihnala")
                                         + " ([email protected])");

    m_h = p;
    menuBar->insertItem( i18n("&Help"), help );
    if ( hideMenubar )	menuBar->hide();
    setMenu( menuBar );
}
Esempio n. 17
0
void qavimator::on_fileExitAction_triggered()
{
    //qDebug("qavimator::fileExit() not implemented");
    fileExit();
}
TTMpeg2MainWnd::TTMpeg2MainWnd( QWidget* parent, const char* name, Qt::WFlags fl )
  : Q3MainWindow( parent, name, fl )
			      //      image0( (const char **) image0_data )
{
  if ( !name )
    setName( "TTMpeg2MainWnd" );

  // images
  // ---------------------------------------------------------------------------
  TTCut::imgDownArrow  = new QPixmap( (const char**)downarrow_18_xpm );
  TTCut::imgUpArrow    = new QPixmap( (const char**)uparrow_18_xpm );
  TTCut::imgDelete     = new QPixmap( (const char**)cancel_18_xpm );
  TTCut::imgFileOpen24 = new QPixmap( (const char**)fileopen_24_xpm );
  TTCut::imgFileNew    = new QPixmap( (const char**)filenew_16_xpm );
  TTCut::imgFileOpen   = new QPixmap( (const char**)fileopen_16_xpm );
  TTCut::imgFileSave   = new QPixmap( (const char**)filesave_16_xpm );;
  TTCut::imgFileSaveAs = new QPixmap( (const char**)filesaveas_16_xpm );
  TTCut::imgSaveImage  = new QPixmap( (const char**)saveimage_16_xpm );
  TTCut::imgSettings   = new QPixmap( (const char**)settings_16_xpm );
  TTCut::imgSettings18 = new QPixmap( (const char**)settings_18_xpm );
  TTCut::imgExit       = new QPixmap( (const char**)exit_16_xpm );
  TTCut::imgPlay       = new QPixmap( (const char**)play_18_xpm );
  TTCut::imgStop       = new QPixmap( (const char**)stop_18_xpm );
  TTCut::imgSearch     = new QPixmap( (const char**)search_18_xpm );
  TTCut::imgChapter    = new QPixmap( (const char**)chapter_18_xpm );
  TTCut::imgPreview    = new QPixmap( (const char**)preview_18_xpm );
  TTCut::imgCutAV      = new QPixmap( (const char**)cutav_18_xpm );
  TTCut::imgCutAudio   = new QPixmap( (const char**)cutaudio_18_xpm );
  TTCut::imgGoTo       = new QPixmap( (const char**)goto_18_xpm );
  TTCut::imgMarker     = new QPixmap( (const char**)note_18_xpm );
  TTCut::imgClock      = new QPixmap( (const char**)clock_16_xpm );
  TTCut::imgApply      = new QPixmap( (const char**)apply_18_xpm );
  TTCut::imgAddToList  = new QPixmap( (const char**)addtolist_18_xpm );
  TTCut::imgFileClose  = new QPixmap( (const char**)fileclose_18_xpm );

  slider_update = true;

  // min widgets size
  // --------------------------------------------------------------------------
  setMinimumSize( QSize( 860, 480 ) );
  setMaximumSize( QSize( 1600, 1280 ) );

  // central widget
  // --------------------------------------------------------------------------
  setCentralWidget( new QWidget( this, "qt_central_widget" ) );


  // --------------------------------------------------------------------------
  // menu-bar
  // --------------------------------------------------------------------------

  // menu actions
  // --------------------------------------------------------------------------

  // file-menu
  fileOpenAction       = new QAction( this, "fileOpenAction" );
  fileOpenAction->setIconSet( QIcon( *(TTCut::imgFileOpen) ) );
  fileSettingsAction   = new QAction( this, "fileSettingsAction" );
  fileSettingsAction->setIconSet( QIcon( *(TTCut::imgSettings) ) );
  fileAnalyzeAction    = new QAction( this, "fileAnalyzeAction" );
  fileAnalyzeAction->setIconSet( QIcon( *(TTCut::imgPreview) ) );
  fileExitAction       = new QAction( this, "fileExitAction" );
  fileExitAction->setIconSet( QIcon( *(TTCut::imgExit) ) );

  // menubar
  MenuBar = new QMenuBar( this, "MenuBar" );
  
  //file-menu
  fileMenu = new Q3PopupMenu( this );
  fileOpenAction->addTo( fileMenu );
  fileAnalyzeAction->addTo( fileMenu );
  fileMenu->insertSeparator();
  fileSettingsAction->addTo( fileMenu );
  fileMenu->insertSeparator();
  fileExitAction->addTo( fileMenu );
  MenuBar->insertItem( QString("File"), fileMenu,   1 );
  

  // ---------------------------------------------------------------------------
  // tool-bar
  // ---------------------------------------------------------------------------
  toolBar = new Q3ToolBar( this, "ToolBar" );

  tbStartAnalyzing = new QToolButton( toolBar, "StartAnalyze" );
  tbStartAnalyzing->setIconSet( QIcon( *(TTCut::imgPreview) ) );

  // ---------------------------------------------------------------------------
  // status-bar
  // ---------------------------------------------------------------------------
  (void)statusBar();


  // central layout manager (grid 4x2)
  // ---------------------------------------------------------------------------
  TTMpeg2MainWndLayout = new QGridLayout( centralWidget(), 
					  4, 1, 11, 6, 
					  "TTMpeg2MainWndLayout"); 

  // open stream section
  // ---------------------------------------------------------------------------
  gbStreamName = new Q3GroupBox( centralWidget(), "gbStreamName" );
  gbStreamName->setColumnLayout(0, Qt::Vertical );
  gbStreamName->layout()->setSpacing( 6 );
  gbStreamName->layout()->setMargin( 11 );
  gbStreamNameLayout = new QGridLayout( gbStreamName->layout() );
  gbStreamNameLayout->setAlignment( Qt::AlignTop );
  
  leStreamName = new QLineEdit( gbStreamName, "leStreamName" );
  
  gbStreamNameLayout->addWidget( leStreamName, 0, 1 );
  
  pbOpenStream = new QPushButton( gbStreamName, "pbOpenStream" );
  pbOpenStream->setMinimumSize( QSize( 24, 24 ) );
  pbOpenStream->setMaximumSize( QSize( 24, 24 ) );
  pbOpenStream->setPixmap( (QPixmap)*(TTCut::imgFileOpen) );
  
  gbStreamNameLayout->addWidget( pbOpenStream, 0, 0 );
  TTMpeg2MainWndLayout->addMultiCellWidget( gbStreamName, 0, 0, 0, 1 );


  // stream info section
  // ---------------------------------------------------------------------------
  layout10 = new QHBoxLayout( 0, 0, 6, "layout10"); 
  layout9 = new QVBoxLayout( 0, 0, 6, "layout9"); 

  // buffer statistics
  gbBufferStatistics = new Q3GroupBox( centralWidget(), "gbBufferStatistics" );
  gbBufferStatistics->setColumnLayout(0, Qt::Vertical );
  gbBufferStatistics->layout()->setSpacing( 6 );
  gbBufferStatistics->layout()->setMargin( 11 );
  gbBufferStatisticsLayout = new QGridLayout( gbBufferStatistics->layout() );
  gbBufferStatisticsLayout->setAlignment( Qt::AlignTop );
  
  layout1 = new QVBoxLayout( 0, 0, 6, "layout1"); 

  slFileLength = new QLabel( gbBufferStatistics, "slFileLength" );
  layout1->addWidget( slFileLength );
  
  slReadOps = new QLabel( gbBufferStatistics, "slReadOps" );
  layout1->addWidget( slReadOps );
  
  slFillOps = new QLabel( gbBufferStatistics, "slFillOps" );
  layout1->addWidget( slFillOps );
  
  slReadTime = new QLabel( gbBufferStatistics, "slReadTime" );
  layout1->addWidget( slReadTime );
  
  gbBufferStatisticsLayout->addLayout( layout1, 0, 0 );
  
  layout2 = new QVBoxLayout( 0, 0, 6, "layout2"); 
  
  laFileLength = new QLabel( gbBufferStatistics, "laFileLength" );
  layout2->addWidget( laFileLength );
  
  laReadOps = new QLabel( gbBufferStatistics, "laReadOps" );
  layout2->addWidget( laReadOps );
  
  laFillOps = new QLabel( gbBufferStatistics, "laFillOps" );
  layout2->addWidget( laFillOps );
  
  laReadTime = new QLabel( gbBufferStatistics, "laReadTime" );
  layout2->addWidget( laReadTime );
  
  gbBufferStatisticsLayout->addLayout( layout2, 0, 1 );
  layout9->addWidget( gbBufferStatistics );

  // stream statistics
  gbStreamStatistics = new Q3GroupBox( centralWidget(), "gbStreamStatistics" );
  gbStreamStatistics->setColumnLayout(0, Qt::Vertical );
  gbStreamStatistics->layout()->setSpacing( 6 );
  gbStreamStatistics->layout()->setMargin( 11 );
  gbStreamStatisticsLayout = new QGridLayout( gbStreamStatistics->layout() );
  gbStreamStatisticsLayout->setAlignment( Qt::AlignTop );

  line1 = new Q3Frame( gbStreamStatistics, "line1" );
  line1->setFrameShape( Q3Frame::HLine );
  line1->setFrameShadow( Q3Frame::Sunken );
  line1->setFrameShape( Q3Frame::HLine );
  
  gbStreamStatisticsLayout->addMultiCellWidget( line1, 1, 1, 0, 1 );
  
  layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 
  
  slTotalFrames = new QLabel( gbStreamStatistics, "slTotalFrames" );
  layout5->addWidget( slTotalFrames );
  
  slIFrames = new QLabel( gbStreamStatistics, "slIFrames" );
  layout5->addWidget( slIFrames );
  
  slPFrames = new QLabel( gbStreamStatistics, "slPFrames" );
  layout5->addWidget( slPFrames );
  
  slBFrames = new QLabel( gbStreamStatistics, "slBFrames" );
  layout5->addWidget( slBFrames );
  
  gbStreamStatisticsLayout->addLayout( layout5, 0, 0 );
  
  layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); 
  
  slSeqHeader = new QLabel( gbStreamStatistics, "slSeqHeader" );
  layout4->addWidget( slSeqHeader );
  
  slGOPHeader = new QLabel( gbStreamStatistics, "slGOPHeader" );
  layout4->addWidget( slGOPHeader );
  
  slPicHeader = new QLabel( gbStreamStatistics, "slPicHeader" );
  layout4->addWidget( slPicHeader );
  
  slSeqEndHeader = new QLabel( gbStreamStatistics, "slSeqEndHeader" );
  layout4->addWidget( slSeqEndHeader );
  
  gbStreamStatisticsLayout->addLayout( layout4, 2, 0 );
  
  layout6 = new QVBoxLayout( 0, 0, 6, "layout6"); 
  
  laSequence = new QLabel( gbStreamStatistics, "laSequence" );
  layout6->addWidget( laSequence );
  
  laGOP = new QLabel( gbStreamStatistics, "laGOP" );
  layout6->addWidget( laGOP );
  
  laPicture = new QLabel( gbStreamStatistics, "laPicture" );
  layout6->addWidget( laPicture );
  
  laSequenceEnd = new QLabel( gbStreamStatistics, "laSequenceEnd" );
  layout6->addWidget( laSequenceEnd );
  
  gbStreamStatisticsLayout->addLayout( layout6, 2, 1 );

  layout7 = new QVBoxLayout( 0, 0, 6, "layout7"); 

  laFramesTotal = new QLabel( gbStreamStatistics, "laFramesTotal" );
  layout7->addWidget( laFramesTotal );
  
  laIFrames = new QLabel( gbStreamStatistics, "laIFrames" );
  layout7->addWidget( laIFrames );
  
  laPFrames = new QLabel( gbStreamStatistics, "laPFrames" );
  layout7->addWidget( laPFrames );
  
  laBFrames = new QLabel( gbStreamStatistics, "laBFrames" );
  layout7->addWidget( laBFrames );
  
  gbStreamStatisticsLayout->addLayout( layout7, 0, 1 );
  layout9->addWidget( gbStreamStatistics );
  layout10->addLayout( layout9 );

  // list view stream info
  gbStreamInfo = new Q3GroupBox( centralWidget(), "gbStreamInfo" );
  gbStreamInfo->setColumnLayout(0, Qt::Vertical );
  gbStreamInfo->layout()->setSpacing( 6 );
  gbStreamInfo->layout()->setMargin( 11 );
  gbStreamInfoLayout = new QGridLayout( gbStreamInfo->layout() );
  gbStreamInfoLayout->setAlignment( Qt::AlignTop );
  
  lvStreamInfo = new Q3ListView( gbStreamInfo, "lvStreamInfo" );
  lvStreamInfo->addColumn( tr( "Header" ) );
  lvStreamInfo->addColumn( tr( "Offset" ) );
  lvStreamInfo->addColumn( tr( "Type" ) );
  lvStreamInfo->addColumn( tr( "Temp Ref." ) );
  lvStreamInfo->addColumn( tr( "S-Order" ) );
  lvStreamInfo->addColumn( tr( "D-Order" ) );
  lvStreamInfo->addColumn( tr( "Time-code" ) );

  lvStreamInfo->setSorting( 5, TRUE );

  gbStreamInfoLayout->addWidget( lvStreamInfo, 0, 0 );
  layout10->addWidget( gbStreamInfo );
  
  TTMpeg2MainWndLayout->addLayout( layout10, 1, 0 );
  
  // sequence info
  gbSequenceInfo = new Q3GroupBox( centralWidget(), "gbSequenceInfo" );
  gbSequenceInfo->setColumnLayout(0, Qt::Vertical );
  gbSequenceInfo->layout()->setSpacing( 6 );
  gbSequenceInfo->layout()->setMargin( 11 );
  gbSequenceInfoLayout = new QGridLayout( gbSequenceInfo->layout() );
  gbSequenceInfoLayout->setAlignment( Qt::AlignTop );
  
  layout19 = new QVBoxLayout( 0, 0, 6, "layout19"); 
  
  slBitrate = new QLabel( gbSequenceInfo, "slBitrate" );
  layout19->addWidget( slBitrate );
  
  slFramerate = new QLabel( gbSequenceInfo, "slFramerate" );
  layout19->addWidget( slFramerate );
  
  slWidth = new QLabel( gbSequenceInfo, "slWidth" );
  layout19->addWidget( slWidth );
  
  slHeight = new QLabel( gbSequenceInfo, "slHeight" );
  layout19->addWidget( slHeight );
  
  gbSequenceInfoLayout->addLayout( layout19, 0, 0 );
  
  layout20 = new QVBoxLayout( 0, 0, 6, "layout20"); 
   
  laSeqBitrate = new QLineEdit( gbSequenceInfo, "laSeqBitrate" );
  laSeqBitrate->setEnabled( FALSE );
  laSeqBitrate->setReadOnly( TRUE );
  layout20->addWidget( laSeqBitrate );
  
  laSeqFramerate = new QLineEdit( gbSequenceInfo, "laSeqFramerate" );
  laSeqFramerate->setEnabled( FALSE );
  laSeqFramerate->setReadOnly( TRUE );
  layout20->addWidget( laSeqFramerate );
  
  laSeqPicWidth = new QLineEdit( gbSequenceInfo, "laSeqPicWidth" );
  laSeqPicWidth->setEnabled( FALSE );
  laSeqPicWidth->setReadOnly( TRUE );
  layout20->addWidget( laSeqPicWidth );
  
  laSeqPicHeight = new QLineEdit( gbSequenceInfo, "laSeqPicHeight" );
  laSeqPicHeight->setEnabled( FALSE );
  laSeqPicHeight->setReadOnly( TRUE );
  layout20->addWidget( laSeqPicHeight );
  
  gbSequenceInfoLayout->addLayout( layout20, 0, 1 );
  
  TTMpeg2MainWndLayout->addWidget( gbSequenceInfo, 1, 1 );
  
  // scroll-bar
  // ---------------------------------------------------------------------------
  sbFrames = new QScrollBar( centralWidget(), "sbFrames" );
  sbFrames->setOrientation( Qt::Horizontal );
  
  TTMpeg2MainWndLayout->addMultiCellWidget( sbFrames, 2, 2, 0, 1 );
  
  // current frame info and navigation
  // ---------------------------------------------------------------------------
  frameInfo = new TTCurrentFrameInfo( centralWidget() , "FrameInfo" );

  TTMpeg2MainWndLayout->addMultiCellWidget( frameInfo, 3, 3, 0 ,1 );

  // ready
  languageChange();
  resize( QSize(963, 725).expandedTo(minimumSizeHint()) );
  //Qt4.0: clearWState( WState_Polished );

  // initialize some attributes
  // ---------------------------------------------------------------------------
  step_frame     = 0;
  step_order     = 0;
  is_stream_open = false;

  // show the video window
  // ---------------------------------------------------------------------------
  mpeg2_window = new TTMPEG2Window( 0 );
  mpeg2_window->show();
  mpeg2_window->resize( 720, 576 );

  // show the chart window
  // ---------------------------------------------------------------------------
  //chart_window = new TTFrameChart( 0, "CHARTWND", 420, 120 );
  //chart_window->show();

  // mpeg2 info window
  // ---------------------------------------------------------------------------
  //info_window = new TTMpeg2InfoView( 0, "INFOWND" );
  //info_window->show();

  // signals and slots connections
  // ---------------------------------------------------------------------------
  // file-menu
  connect(fileOpenAction,     SIGNAL( activated() ),   this, SLOT(fileOpen()));
  connect(fileAnalyzeAction,  SIGNAL( activated() ),   this, SLOT(fileAnalyze()));
  connect(fileSettingsAction, SIGNAL( activated() ),   this, SLOT(fileSettings()));
  connect(fileExitAction,     SIGNAL( activated() ),   this, SLOT(fileExit()));

  // tool-bar
  connect(tbStartAnalyzing, SIGNAL(clicked()), this, SLOT(fileAnalyze()));

  // open file button
  connect(pbOpenStream,       SIGNAL( clicked() ),     this,   SLOT( fileOpen()));

  // video position slider
  connect( sbFrames,  SIGNAL( valueChanged(int) ), this, SLOT( videoSliderChanged(int) ) );
  
  // current frame info / navigation
  connect(frameInfo,          SIGNAL(nextFrame()),     this, SLOT(nextFrameAction()));
  connect(frameInfo,          SIGNAL(prevFrame()),     this, SLOT(prevFrameAction()));
  connect(frameInfo,          SIGNAL(orderAnyFrame()), this, SLOT(orderAnyFrame()));
  connect(frameInfo,          SIGNAL(orderIFrame()),   this, SLOT(orderIFrame()));
  connect(frameInfo,          SIGNAL(orderPFrame()),   this, SLOT(orderPFrame()));
  connect(frameInfo,          SIGNAL(orderBFrame()),   this, SLOT(orderBFrame()));
  connect(frameInfo,          SIGNAL(orderDisplay()),  this, SLOT(orderDisplay()));
  connect(frameInfo,          SIGNAL(orderStream()),   this, SLOT(orderStream()));

}
Esempio n. 19
0
/*
 *  Constructs a MainWindow as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl )
    : QMainWindow( parent, name, fl )
{
    (void)statusBar();
    QImage img;
    img.loadFromData( image0_data, sizeof( image0_data ), "PNG" );
    image0 = img;
    img.loadFromData( image1_data, sizeof( image1_data ), "PNG" );
    image1 = img;
    img.loadFromData( image2_data, sizeof( image2_data ), "PNG" );
    image2 = img;
    img.loadFromData( image3_data, sizeof( image3_data ), "PNG" );
    image3 = img;
    img.loadFromData( image4_data, sizeof( image4_data ), "PNG" );
    image4 = img;
    img.loadFromData( image5_data, sizeof( image5_data ), "PNG" );
    image5 = img;
    img.loadFromData( image6_data, sizeof( image6_data ), "PNG" );
    image6 = img;
    img.loadFromData( image7_data, sizeof( image7_data ), "PNG" );
    image7 = img;
    img.loadFromData( image8_data, sizeof( image8_data ), "PNG" );
    image8 = img;
    img.loadFromData( image9_data, sizeof( image9_data ), "PNG" );
    image9 = img;
    if ( !name )
	setName( "MainWindow" );
    setCentralWidget( new QWidget( this, "qt_central_widget" ) );

    QWidget* privateLayoutWidget = new QWidget( centralWidget(), "layout8" );
    privateLayoutWidget->setGeometry( QRect( 1, 11, 340, 300 ) );
    layout8 = new QVBoxLayout( privateLayoutWidget, 11, 6, "layout8"); 

    BotonesLector = new QButtonGroup( privateLayoutWidget, "BotonesLector" );
    BotonesLector->setColumnLayout(0, Qt::Vertical );
    BotonesLector->layout()->setSpacing( 6 );
    BotonesLector->layout()->setMargin( 11 );
    BotonesLectorLayout = new QHBoxLayout( BotonesLector->layout() );
    BotonesLectorLayout->setAlignment( Qt::AlignTop );

    layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 

    pushButton1 = new QPushButton( BotonesLector, "pushButton1" );
    layout9->addWidget( pushButton1 );

    pushButton2 = new QPushButton( BotonesLector, "pushButton2" );
    layout9->addWidget( pushButton2 );
    BotonesLectorLayout->addLayout( layout9 );
    layout8->addWidget( BotonesLector );

    layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); 

    layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 

    txtSldrTitleTemp = new QLabel( privateLayoutWidget, "txtSldrTitleTemp" );
    txtSldrTitleTemp->setFrameShape( QLabel::Box );
    txtSldrTitleTemp->setScaledContents( FALSE );
    layout5->addWidget( txtSldrTitleTemp );

    sldrTemp = new QSlider( privateLayoutWidget, "sldrTemp" );
    sldrTemp->setMaxValue( 4 );
    sldrTemp->setOrientation( QSlider::Vertical );
    layout5->addWidget( sldrTemp );

    txtTemp = new QLabel( privateLayoutWidget, "txtTemp" );
    QFont txtTemp_font(  txtTemp->font() );
    txtTemp_font.setPointSize( 8 );
    txtTemp->setFont( txtTemp_font ); 
    layout5->addWidget( txtTemp );
    layout6->addLayout( layout5 );

    Grupo1 = new QGroupBox( privateLayoutWidget, "Grupo1" );
    layout6->addWidget( Grupo1 );

    layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); 

    txtSldrTitleVelocidad = new QLabel( privateLayoutWidget, "txtSldrTitleVelocidad" );
    txtSldrTitleVelocidad->setFrameShape( QLabel::Box );
    txtSldrTitleVelocidad->setScaledContents( FALSE );
    layout4->addWidget( txtSldrTitleVelocidad );

    sldrVelocidad = new QSlider( privateLayoutWidget, "sldrVelocidad" );
    sldrVelocidad->setOrientation( QSlider::Vertical );
    layout4->addWidget( sldrVelocidad );

    txtVelocidad = new QLabel( privateLayoutWidget, "txtVelocidad" );
    QFont txtVelocidad_font(  txtVelocidad->font() );
    txtVelocidad_font.setPointSize( 8 );
    txtVelocidad->setFont( txtVelocidad_font ); 
    layout4->addWidget( txtVelocidad );
    layout6->addLayout( layout4 );
    layout8->addLayout( layout6 );

    BotonActivar = new QButtonGroup( privateLayoutWidget, "BotonActivar" );
    BotonActivar->setColumnLayout(0, Qt::Vertical );
    BotonActivar->layout()->setSpacing( 6 );
    BotonActivar->layout()->setMargin( 11 );
    BotonActivarLayout = new QHBoxLayout( BotonActivar->layout() );
    BotonActivarLayout->setAlignment( Qt::AlignTop );

    btnIniciar = new QPushButton( BotonActivar, "btnIniciar" );
    btnIniciar->setToggleButton( TRUE );
    BotonActivarLayout->addWidget( btnIniciar );
    layout8->addWidget( BotonActivar );

    // actions
    fileNewAction = new QAction( this, "fileNewAction" );
    fileNewAction->setIconSet( QIconSet( image0 ) );
    fileOpenAction = new QAction( this, "fileOpenAction" );
    fileOpenAction->setIconSet( QIconSet( image1 ) );
    fileSaveAction = new QAction( this, "fileSaveAction" );
    fileSaveAction->setIconSet( QIconSet( image2 ) );
    fileSaveAsAction = new QAction( this, "fileSaveAsAction" );
    filePrintAction = new QAction( this, "filePrintAction" );
    filePrintAction->setIconSet( QIconSet( image3 ) );
    fileExitAction = new QAction( this, "fileExitAction" );
    editUndoAction = new QAction( this, "editUndoAction" );
    editUndoAction->setIconSet( QIconSet( image4 ) );
    editRedoAction = new QAction( this, "editRedoAction" );
    editRedoAction->setIconSet( QIconSet( image5 ) );
    editCutAction = new QAction( this, "editCutAction" );
    editCutAction->setIconSet( QIconSet( image6 ) );
    editCopyAction = new QAction( this, "editCopyAction" );
    editCopyAction->setIconSet( QIconSet( image7 ) );
    editPasteAction = new QAction( this, "editPasteAction" );
    editPasteAction->setIconSet( QIconSet( image8 ) );
    editFindAction = new QAction( this, "editFindAction" );
    editFindAction->setIconSet( QIconSet( image9 ) );
    helpContentsAction = new QAction( this, "helpContentsAction" );
    helpIndexAction = new QAction( this, "helpIndexAction" );
    helpAboutAction = new QAction( this, "helpAboutAction" );


    // toolbars


    // menubar
    menubar = new QMenuBar( this, "menubar" );


    fileMenu = new QPopupMenu( this );
    fileOpenAction->addTo( fileMenu );
    fileSaveAction->addTo( fileMenu );
    fileMenu->insertSeparator();
    fileMenu->insertSeparator();
    fileExitAction->addTo( fileMenu );
    menubar->insertItem( QString(""), fileMenu, 1 );

    helpMenu = new QPopupMenu( this );
    helpMenu->insertSeparator();
    helpAboutAction->addTo( helpMenu );
    menubar->insertItem( QString(""), helpMenu, 2 );

    languageChange();
    resize( QSize(351, 352).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) );
    connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
    connect( fileSaveAction, SIGNAL( activated() ), this, SLOT( fileSave() ) );
    connect( fileSaveAsAction, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
    connect( filePrintAction, SIGNAL( activated() ), this, SLOT( filePrint() ) );
    connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) );
    connect( editUndoAction, SIGNAL( activated() ), this, SLOT( editUndo() ) );
    connect( editRedoAction, SIGNAL( activated() ), this, SLOT( editRedo() ) );
    connect( editCutAction, SIGNAL( activated() ), this, SLOT( editCut() ) );
    connect( editCopyAction, SIGNAL( activated() ), this, SLOT( editCopy() ) );
    connect( editPasteAction, SIGNAL( activated() ), this, SLOT( editPaste() ) );
    connect( editFindAction, SIGNAL( activated() ), this, SLOT( editFind() ) );
    connect( helpIndexAction, SIGNAL( activated() ), this, SLOT( helpIndex() ) );
    connect( helpContentsAction, SIGNAL( activated() ), this, SLOT( helpContents() ) );
    connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
    connect( sldrTemp, SIGNAL( valueChanged(int) ), txtTemp, SLOT( setNum(int) ) );
    connect( sldrVelocidad, SIGNAL( valueChanged(int) ), txtVelocidad, SLOT( setNum(int) ) );
    connect( BotonActivar, SIGNAL( toggled(bool) ), this, SLOT( Activar(bool) ) );
}
Esempio n. 20
0
int mainForm::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Q3MainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: fileOpen((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 1: fileOpen(); break;
        case 2: fileNew(); break;
        case 3: populateStructure(); break;
        case 4: populateTable((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 5: resetBrowser(); break;
        case 6: fileClose(); break;
        case 7: fileExit(); break;
        case 8: closeEvent((*reinterpret_cast< QCloseEvent*(*)>(_a[1]))); break;
        case 9: addRecord(); break;
        case 10: deleteRecord(); break;
        case 11: updateTableView((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 12: selectTableLine((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 13: navigatePrevious(); break;
        case 14: navigateNext(); break;
        case 15: navigateGoto(); break;
        case 16: setRecordsetLabel(); break;
        case 17: browseFind((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 18: browseFindAway(); break;
        case 19: lookfor((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< const QString(*)>(_a[3]))); break;
        case 20: showrecord((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 21: createTable(); break;
        case 22: createIndex(); break;
        case 23: compact(); break;
        case 24: deleteTable(); break;
        case 25: editTable(); break;
        case 26: deleteIndex(); break;
        case 27: copy(); break;
        case 28: paste(); break;
        case 29: helpWhatsThis(); break;
        case 30: helpAbout(); break;
        case 31: updateRecordText((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3]))); break;
        case 32: logWinAway(); break;
        case 33: editWinAway(); break;
        case 34: editText((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 35: doubleClickTable((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< const QPoint(*)>(_a[4]))); break;
        case 36: executeQuery(); break;
        case 37: mainTabSelected((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 38: toggleLogWindow((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 39: importTableFromCSV(); break;
        case 40: exportTableToCSV(); break;
        case 41: dbState((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 42: fileSave(); break;
        case 43: fileRevert(); break;
        case 44: exportDatabaseToSQL(); break;
        case 45: importDatabaseFromSQL(); break;
        case 46: openPreferences(); break;
        case 47: updatePreferences(); break;
        case 48: languageChange(); break;
        default: ;
        }
        _id -= 49;
    }
    return _id;
}
Esempio n. 21
0
MainWindow::MainWindow()
    : ui(new Ui::MainWindow),
      editPalette(palette()),
      previewPalette(palette()),
      previewstyle(0)
{
    ui->setupUi(this);
    statusBar();

    // signals and slots connections
    connect(ui->fontPathLineEdit, SIGNAL(returnPressed()), SLOT(addFontpath()));
    connect(ui->addFontPathButton, SIGNAL(clicked()), SLOT(addFontpath()));
    connect(ui->addSubstitutionButton, SIGNAL(clicked()), SLOT(addSubstitute()));
    connect(ui->browseFontPathButton, SIGNAL(clicked()), SLOT(browseFontpath()));
    connect(ui->fontStyleCombo, SIGNAL(activated(int)), SLOT(buildFont()));
    connect(ui->pointSizeCombo, SIGNAL(activated(int)), SLOT(buildFont()));
    connect(ui->downFontpathButton, SIGNAL(clicked()), SLOT(downFontpath()));
    connect(ui->downSubstitutionButton, SIGNAL(clicked()), SLOT(downSubstitute()));
    connect(ui->fontFamilyCombo, SIGNAL(activated(QString)), SLOT(familySelected(QString)));
    connect(ui->fileExitAction, SIGNAL(triggered()), SLOT(fileExit()));
    connect(ui->fileSaveAction, SIGNAL(triggered()), SLOT(fileSave()));
    connect(ui->helpAboutAction, SIGNAL(triggered()), SLOT(helpAbout()));
    connect(ui->helpAboutQtAction, SIGNAL(triggered()), SLOT(helpAboutQt()));
    connect(ui->mainTabWidget, SIGNAL(currentChanged(int)), SLOT(pageChanged(int)));
    connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int)));
    connect(ui->removeFontpathButton, SIGNAL(clicked()), SLOT(removeFontpath()));
    connect(ui->removeSubstitutionButton, SIGNAL(clicked()), SLOT(removeSubstitute()));
    connect(ui->toolBoxEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    connect(ui->doubleClickIntervalSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
    connect(ui->cursorFlashTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
    connect(ui->wheelScrollLinesSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
    connect(ui->menuEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    connect(ui->comboEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    connect(ui->toolTipEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    connect(ui->strutWidthSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
    connect(ui->strutHeightSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
    connect(ui->effectsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
    connect(ui->resolveLinksCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
    connect(ui->fontEmbeddingCheckBox, SIGNAL(clicked()), SLOT(somethingModified()));
    connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
    connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString)));
    connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString)));
    connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette()));
    connect(ui->upFontpathButton, SIGNAL(clicked()), SLOT(upFontpath()));
    connect(ui->upSubstitutionButton, SIGNAL(clicked()), SLOT(upSubstitute()));

    modified = true;
    desktopThemeName = tr("Desktop Settings (Default)");
    setWindowIcon(QPixmap(":/qt-project.org/qtconfig/images/appicon.png"));
    QStringList gstyles = QStyleFactory::keys();
    gstyles.sort();
    ui->guiStyleCombo->addItem(desktopThemeName);
    ui->guiStyleCombo->setItemData(ui->guiStyleCombo->findText(desktopThemeName),
                                   tr("Choose style and palette based on your desktop settings."),
                                   Qt::ToolTipRole);
    ui->guiStyleCombo->addItems(gstyles);

    QSettings settings(QLatin1String("QtProject"));
    settings.beginGroup(QLatin1String("Qt"));

    QString currentstyle = settings.value(QLatin1String("style")).toString();
    if (currentstyle.isEmpty()) {
        ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->findText(desktopThemeName));
        currentstyle = QApplication::style()->objectName();
    } else {
        int index = ui->guiStyleCombo->findText(currentstyle, Qt::MatchFixedString);
        if (index != -1) {
            ui->guiStyleCombo->setCurrentIndex(index);
        } else { // we give up
            ui->guiStyleCombo->addItem(tr("Unknown"));
            ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->count() - 1);
        }
    }
    ui->buttonMainColor->setColor(palette().color(QPalette::Active, QPalette::Button));
    ui->buttonWindowColor->setColor(palette().color(QPalette::Active, QPalette::Window));
    connect(ui->buttonMainColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette()));
    connect(ui->buttonWindowColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette()));

#ifdef Q_WS_X11
    if (X11->desktopEnvironment == DE_KDE)
        ui->colorConfig->hide();
    else
        ui->kdeNoteLabel->hide();
#else
    ui->colorConfig->hide();
    ui->kdeNoteLabel->hide();
#endif

    QFontDatabase db;
    QStringList families = db.families();
    ui->fontFamilyCombo->addItems(families);

    QStringList fs = families;
    QStringList fs2 = QFont::substitutions();
    QStringList::Iterator fsit = fs2.begin();
    while (fsit != fs2.end()) {
        if (!fs.contains(*fsit))
            fs += *fsit;
        fsit++;
    }
    fs.sort();
    ui->familySubstitutionCombo->addItems(fs);

    ui->chooseSubstitutionCombo->addItems(families);
    QList<int> sizes = db.standardSizes();
    foreach(int i, sizes)
        ui->pointSizeCombo->addItem(QString::number(i));

    ui->doubleClickIntervalSpinBox->setValue(QApplication::doubleClickInterval());
    ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime());
    ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines());
    // #############
    // resolveLinksCheckBox->setChecked(qt_resolve_symlinks);

    ui->effectsCheckBox->setChecked(QApplication::isEffectEnabled(Qt::UI_General));
    ui->effectsFrame->setEnabled(ui->effectsCheckBox->isChecked());

    if (QApplication::isEffectEnabled(Qt::UI_FadeMenu))
        ui->menuEffectCombo->setCurrentIndex(2);
    else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu))
        ui->menuEffectCombo->setCurrentIndex(1);

    if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo))
        ui->comboEffectCombo->setCurrentIndex(1);

    if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))
        ui->toolTipEffectCombo->setCurrentIndex(2);
    else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
        ui->toolTipEffectCombo->setCurrentIndex(1);

    if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox))
        ui->toolBoxEffectCombo->setCurrentIndex(1);

    QSize globalStrut = QApplication::globalStrut();
    ui->strutWidthSpinBox->setValue(globalStrut.width());
    ui->strutHeightSpinBox->setValue(globalStrut.height());

    // find the default family
    QStringList::Iterator sit = families.begin();
    int i = 0, possible = -1;
    while (sit != families.end()) {
        if (*sit == QApplication::font().family())
            break;
        if ((*sit).contains(QApplication::font().family()))
            possible = i;

        i++;
        sit++;
    }
    if (sit == families.end())
        i = possible;
    if (i == -1) // no clue about the current font
        i = 0;

    ui->fontFamilyCombo->setCurrentIndex(i);

    QStringList styles = db.styles(ui->fontFamilyCombo->currentText());
    ui->fontStyleCombo->addItems(styles);

    QString stylestring = db.styleString(QApplication::font());
    sit = styles.begin();
    i = 0;
    possible = -1;
    while (sit != styles.end()) {
        if (*sit == stylestring)
            break;
        if ((*sit).contains(stylestring))
            possible = i;

        i++;
        sit++;
    }
    if (sit == styles.end())
        i = possible;
    if (i == -1) // no clue about the current font
        i = 0;
    ui->fontStyleCombo->setCurrentIndex(i);

    i = 0;
    for (int psize = QApplication::font().pointSize(); i < ui->pointSizeCombo->count(); ++i) {
        const int sz = ui->pointSizeCombo->itemText(i).toInt();
        if (sz == psize) {
            ui->pointSizeCombo->setCurrentIndex(i);
            break;
        } else if(sz > psize) {
            ui->pointSizeCombo->insertItem(i, QString::number(psize));
            ui->pointSizeCombo->setCurrentIndex(i);
            break;
        }
    }

    QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText());
    ui->substitutionsListBox->clear();
    ui->substitutionsListBox->insertItems(0, subs);

    ui->rtlExtensionsCheckBox->setChecked(settings.value(QLatin1String("useRtlExtensions"), false)
                                          .toBool());

#ifdef Q_WS_X11
    QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString();
    if (!settingsInputStyle.isEmpty())
      ui->inputStyleCombo->setCurrentIndex(ui->inputStyleCombo->findText(settingsInputStyle));
#else
    ui->inputStyleCombo->hide();
    ui->inputStyleLabel->hide();
#endif

#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
    QStringList inputMethodCombo = QInputContextFactory::keys();
    int inputMethodComboIndex = -1;
    QString defaultInputMethod = settings.value(QLatin1String("DefaultInputMethod"), QLatin1String("xim")).toString();
    for (int i = inputMethodCombo.size()-1; i >= 0; --i) {
        const QString &im = inputMethodCombo.at(i);
        if (im.contains(QLatin1String("imsw"))) {
            inputMethodCombo.removeAt(i);
            if (inputMethodComboIndex > i)
                --inputMethodComboIndex;
        } else if (im == defaultInputMethod) {
            inputMethodComboIndex = i;
        }
    }
    if (inputMethodComboIndex == -1 && !inputMethodCombo.isEmpty())
        inputMethodComboIndex = 0;
    ui->inputMethodCombo->addItems(inputMethodCombo);
    ui->inputMethodCombo->setCurrentIndex(inputMethodComboIndex);
#else
    ui->inputMethodCombo->hide();
    ui->inputMethodLabel->hide();
#endif

    ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true)
                                          .toBool());
    fontpaths = settings.value(QLatin1String("fontPath")).toStringList();
    ui->fontpathListBox->insertItems(0, fontpaths);

    settings.endGroup(); // Qt

    ui->helpView->setText(tr(appearance_text));

    setModified(false);
    updateStyleLayout();
}
Esempio n. 22
0
/*
 *  Constructs a TestWindow as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
TestWindow::TestWindow( QWidget* parent, const char* name, WFlags fl )
    : QMainWindow( parent, name, fl )
{
    (void)statusBar();
    QImage img;
    img.loadFromData( image0_data, sizeof( image0_data ), "PNG" );
    image0 = img;
    img.loadFromData( image1_data, sizeof( image1_data ), "PNG" );
    image1 = img;
    img.loadFromData( image2_data, sizeof( image2_data ), "PNG" );
    image2 = img;
    img.loadFromData( image3_data, sizeof( image3_data ), "PNG" );
    image3 = img;
    img.loadFromData( image4_data, sizeof( image4_data ), "PNG" );
    image4 = img;
    img.loadFromData( image5_data, sizeof( image5_data ), "PNG" );
    image5 = img;
    img.loadFromData( image6_data, sizeof( image6_data ), "PNG" );
    image6 = img;
    img.loadFromData( image7_data, sizeof( image7_data ), "PNG" );
    image7 = img;
    img.loadFromData( image8_data, sizeof( image8_data ), "PNG" );
    image8 = img;
    img.loadFromData( image9_data, sizeof( image9_data ), "PNG" );
    image9 = img;
    if ( !name )
	setName( "TestWindow" );
    setCentralWidget( new QWidget( this, "qt_central_widget" ) );
    TestWindowLayout = new QVBoxLayout( centralWidget(), 11, 6, "TestWindowLayout"); 

    mainPanel = new QGroupBox( centralWidget(), "mainPanel" );
    mainPanel->setPaletteForegroundColor( QColor( 255, 255, 255 ) );
    mainPanel->setPaletteBackgroundColor( QColor( 0, 0, 0 ) );
    mainPanel->setFrameShadow( QGroupBox::Sunken );
    mainPanel->setFlat( FALSE );

    grpbuffer = new QGroupBox( mainPanel, "grpbuffer" );
    grpbuffer->setGeometry( QRect( 10, 20, 320, 60 ) );
    grpbuffer->setPaletteForegroundColor( QColor( 255, 255, 255 ) );
    grpbuffer->setFlat( FALSE );
    TestWindowLayout->addWidget( mainPanel );

    layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 

    btnStart = new QPushButton( centralWidget(), "btnStart" );
    layout1->addWidget( btnStart );

    btnStop = new QPushButton( centralWidget(), "btnStop" );
    layout1->addWidget( btnStop );
    TestWindowLayout->addLayout( layout1 );

    // actions
    fileNewAction = new QAction( this, "fileNewAction" );
    fileNewAction->setIconSet( QIconSet( image0 ) );
    fileOpenAction = new QAction( this, "fileOpenAction" );
    fileOpenAction->setIconSet( QIconSet( image1 ) );
    fileSaveAction = new QAction( this, "fileSaveAction" );
    fileSaveAction->setIconSet( QIconSet( image2 ) );
    fileSaveAsAction = new QAction( this, "fileSaveAsAction" );
    filePrintAction = new QAction( this, "filePrintAction" );
    filePrintAction->setIconSet( QIconSet( image3 ) );
    fileExitAction = new QAction( this, "fileExitAction" );
    editUndoAction = new QAction( this, "editUndoAction" );
    editUndoAction->setIconSet( QIconSet( image4 ) );
    editRedoAction = new QAction( this, "editRedoAction" );
    editRedoAction->setIconSet( QIconSet( image5 ) );
    editCutAction = new QAction( this, "editCutAction" );
    editCutAction->setIconSet( QIconSet( image6 ) );
    editCopyAction = new QAction( this, "editCopyAction" );
    editCopyAction->setIconSet( QIconSet( image7 ) );
    editPasteAction = new QAction( this, "editPasteAction" );
    editPasteAction->setIconSet( QIconSet( image8 ) );
    editFindAction = new QAction( this, "editFindAction" );
    editFindAction->setIconSet( QIconSet( image9 ) );
    helpContentsAction = new QAction( this, "helpContentsAction" );
    helpIndexAction = new QAction( this, "helpIndexAction" );
    helpAboutAction = new QAction( this, "helpAboutAction" );


    // toolbars


    // menubar
    menubar = new QMenuBar( this, "menubar" );

    menubar->setEnabled( FALSE );
    menubar->setPaletteBackgroundColor( QColor( 239, 239, 239 ) );

    fileMenu = new QPopupMenu( this );
    fileNewAction->addTo( fileMenu );
    fileOpenAction->addTo( fileMenu );
    fileSaveAction->addTo( fileMenu );
    fileSaveAsAction->addTo( fileMenu );
    fileMenu->insertSeparator();
    filePrintAction->addTo( fileMenu );
    fileMenu->insertSeparator();
    fileExitAction->addTo( fileMenu );
    menubar->insertItem( QString(""), fileMenu, 3 );

    editMenu = new QPopupMenu( this );
    editUndoAction->addTo( editMenu );
    editRedoAction->addTo( editMenu );
    editMenu->insertSeparator();
    editCutAction->addTo( editMenu );
    editCopyAction->addTo( editMenu );
    editPasteAction->addTo( editMenu );
    editMenu->insertSeparator();
    editFindAction->addTo( editMenu );
    menubar->insertItem( QString(""), editMenu, 4 );

    Help = new QPopupMenu( this );
    helpContentsAction->addTo( Help );
    helpIndexAction->addTo( Help );
    Help->insertSeparator();
    helpAboutAction->addTo( Help );
    menubar->insertItem( QString(""), Help, 5 );

    languageChange();
    resize( QSize(373, 363).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) );
    connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
    connect( fileSaveAction, SIGNAL( activated() ), this, SLOT( fileSave() ) );
    connect( fileSaveAsAction, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
    connect( filePrintAction, SIGNAL( activated() ), this, SLOT( filePrint() ) );
    connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) );
    connect( editUndoAction, SIGNAL( activated() ), this, SLOT( editUndo() ) );
    connect( editRedoAction, SIGNAL( activated() ), this, SLOT( editRedo() ) );
    connect( editCutAction, SIGNAL( activated() ), this, SLOT( editCut() ) );
    connect( editCopyAction, SIGNAL( activated() ), this, SLOT( editFind() ) );
    connect( editPasteAction, SIGNAL( activated() ), this, SLOT( editPaste() ) );
    connect( editFindAction, SIGNAL( activated() ), this, SLOT( editFind() ) );
    connect( helpIndexAction, SIGNAL( activated() ), this, SLOT( helpIndex() ) );
    connect( helpContentsAction, SIGNAL( activated() ), this, SLOT( helpContents() ) );
    connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
    connect( btnStart, SIGNAL( released() ), this, SLOT( add() ) );
    connect( btnStop, SIGNAL( released() ), this, SLOT( remove() ) );
}
Esempio n. 23
0
/*
 *  Constructs a mainForm as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
mainForm::mainForm( QWidget* parent, const char* name, WFlags fl )
    : QMainWindow( parent, name, fl )
{
    (void)statusBar();
    if ( !name )
	setName( "mainForm" );
    setCentralWidget( new QWidget( this, "qt_central_widget" ) );
    mainFormLayout = new QVBoxLayout( centralWidget(), 11, 6, "mainFormLayout"); 

    mainTab = new QTabWidget( centralWidget(), "mainTab" );

    structure = new QWidget( mainTab, "structure" );
    structureLayout = new QVBoxLayout( structure, 11, 6, "structureLayout"); 

    dblistView = new QListView( structure, "dblistView" );
    dblistView->addColumn( tr( "Name" ) );
    dblistView->header()->setClickEnabled( FALSE, dblistView->header()->count() - 1 );
    dblistView->addColumn( tr( "Object" ) );
    dblistView->header()->setClickEnabled( FALSE, dblistView->header()->count() - 1 );
    dblistView->addColumn( tr( "Type" ) );
    dblistView->header()->setClickEnabled( FALSE, dblistView->header()->count() - 1 );
    dblistView->addColumn( tr( "Schema" ) );
    dblistView->header()->setClickEnabled( FALSE, dblistView->header()->count() - 1 );
    dblistView->setResizePolicy( QScrollView::Manual );
    dblistView->setSelectionMode( QListView::NoSelection );
    dblistView->setRootIsDecorated( TRUE );
    dblistView->setResizeMode( QListView::LastColumn );
    structureLayout->addWidget( dblistView );
    mainTab->insertTab( structure, QString("") );

    browser = new QWidget( mainTab, "browser" );
    browserLayout = new QVBoxLayout( browser, 11, 6, "browserLayout"); 

    layout2 = new QHBoxLayout( 0, 0, 6, "layout2"); 

    textLabel1 = new QLabel( browser, "textLabel1" );
    layout2->addWidget( textLabel1 );

    comboBrowseTable = new QComboBox( FALSE, browser, "comboBrowseTable" );
    comboBrowseTable->setMinimumSize( QSize( 115, 0 ) );
    layout2->addWidget( comboBrowseTable );

    buttonFind = new QPushButton( browser, "buttonFind" );
    buttonFind->setPixmap( QPixmap::fromMimeSource( "searchfind.png" ) );
    buttonFind->setToggleButton( TRUE );
    layout2->addWidget( buttonFind );
    QSpacerItem* spacer = new QSpacerItem( 51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout2->addItem( spacer );

    buttonNewRecord = new QPushButton( browser, "buttonNewRecord" );
    layout2->addWidget( buttonNewRecord );

    buttonDeleteRecord = new QPushButton( browser, "buttonDeleteRecord" );
    layout2->addWidget( buttonDeleteRecord );
    browserLayout->addLayout( layout2 );

    dataTable = new QTable( browser, "dataTable" );
    dataTable->setAcceptDrops( TRUE );
    dataTable->setResizePolicy( QTable::Default );
    dataTable->setVScrollBarMode( QTable::Auto );
    dataTable->setNumRows( 0 );
    dataTable->setNumCols( 0 );
    dataTable->setReadOnly( TRUE );
    dataTable->setSelectionMode( QTable::Single );
    dataTable->setFocusStyle( QTable::FollowStyle );
    browserLayout->addWidget( dataTable );

    layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 

    buttonPrevious = new QPushButton( browser, "buttonPrevious" );
    buttonPrevious->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, buttonPrevious->sizePolicy().hasHeightForWidth() ) );
    layout9->addWidget( buttonPrevious );

    labelRecordset = new QLabel( browser, "labelRecordset" );
    layout9->addWidget( labelRecordset );

    buttonNext = new QPushButton( browser, "buttonNext" );
    buttonNext->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, buttonNext->sizePolicy().hasHeightForWidth() ) );
    layout9->addWidget( buttonNext );
    QSpacerItem* spacer_2 = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout9->addItem( spacer_2 );

    buttonGoto = new QPushButton( browser, "buttonGoto" );
    layout9->addWidget( buttonGoto );

    editGoto = new QLineEdit( browser, "editGoto" );
    editGoto->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, editGoto->sizePolicy().hasHeightForWidth() ) );
    editGoto->setFrameShape( QLineEdit::LineEditPanel );
    editGoto->setFrameShadow( QLineEdit::Sunken );
    layout9->addWidget( editGoto );
    browserLayout->addLayout( layout9 );
    mainTab->insertTab( browser, QString("") );

    query = new QWidget( mainTab, "query" );
    queryLayout = new QVBoxLayout( query, 11, 6, "queryLayout"); 

    textLabel1_2 = new QLabel( query, "textLabel1_2" );
    queryLayout->addWidget( textLabel1_2 );

    sqlTextEdit = new QTextEdit( query, "sqlTextEdit" );
    sqlTextEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, sqlTextEdit->sizePolicy().hasHeightForWidth() ) );
    queryLayout->addWidget( sqlTextEdit );

    layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); 

    executeQueryButton = new QPushButton( query, "executeQueryButton" );
    layout5->addWidget( executeQueryButton );
    QSpacerItem* spacer_3 = new QSpacerItem( 325, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout5->addItem( spacer_3 );
    queryLayout->addLayout( layout5 );

    textLabel2 = new QLabel( query, "textLabel2" );
    queryLayout->addWidget( textLabel2 );

    queryErrorLineEdit = new QLineEdit( query, "queryErrorLineEdit" );
    queryErrorLineEdit->setReadOnly( TRUE );
    queryLayout->addWidget( queryErrorLineEdit );

    textLabel3 = new QLabel( query, "textLabel3" );
    queryLayout->addWidget( textLabel3 );

    queryResultListView = new QListView( query, "queryResultListView" );
    queryResultListView->setResizePolicy( QListView::Default );
    queryResultListView->setSelectionMode( QListView::NoSelection );
    queryResultListView->setResizeMode( QListView::AllColumns );
    queryLayout->addWidget( queryResultListView );
    mainTab->insertTab( query, QString("") );
    mainFormLayout->addWidget( mainTab );

    // actions
    fileNewAction = new QAction( this, "fileNewAction" );
    fileNewAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "new.png" ) ) );
    fileOpenAction = new QAction( this, "fileOpenAction" );
    fileOpenAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "open.png" ) ) );
    fileExitAction = new QAction( this, "fileExitAction" );
    editCopyAction = new QAction( this, "editCopyAction" );
    editPasteAction = new QAction( this, "editPasteAction" );
    editFindAction = new QAction( this, "editFindAction" );
    editFindAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "searchfind.png" ) ) );
    helpContentsAction = new QAction( this, "helpContentsAction" );
    helpIndexAction = new QAction( this, "helpIndexAction" );
    helpAboutAction = new QAction( this, "helpAboutAction" );
    fileCloseAction = new QAction( this, "fileCloseAction" );
    fileCloseAction->setEnabled( FALSE );
    newRecordAction = new QAction( this, "newRecordAction" );
    fileCompactAction = new QAction( this, "fileCompactAction" );
    fileCompactAction->setEnabled( FALSE );
    helpWhatsThisAction = new QAction( this, "helpWhatsThisAction" );
    helpWhatsThisAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "whatis.png" ) ) );
    sqlLogAction = new QAction( this, "sqlLogAction" );
    sqlLogAction->setToggleAction( TRUE );
    sqlLogAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "log.png" ) ) );
    fileImportCSVAction = new QAction( this, "fileImportCSVAction" );
    fileExportCSVAction = new QAction( this, "fileExportCSVAction" );
    fileSaveAction = new QAction( this, "fileSaveAction" );
    fileSaveAction->setEnabled( FALSE );
    fileSaveAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "save.png" ) ) );
    fileRevertAction = new QAction( this, "fileRevertAction" );
    fileRevertAction->setEnabled( FALSE );
    fileRevertAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "revert.png" ) ) );
    fileImportAction = new QAction( this, "fileImportAction" );
    fileExportAction = new QAction( this, "fileExportAction" );
    editCreateTableAction = new QAction( this, "editCreateTableAction" );
    editCreateTableAction->setEnabled( FALSE );
    editCreateTableAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "create_table.png" ) ) );
    editDeleteTableAction = new QAction( this, "editDeleteTableAction" );
    editDeleteTableAction->setEnabled( FALSE );
    editDeleteTableAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "delete_table.png" ) ) );
    editModifyTableAction = new QAction( this, "editModifyTableAction" );
    editModifyTableAction->setEnabled( FALSE );
    editModifyTableAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "modify_table.png" ) ) );
    editCreateIndexAction = new QAction( this, "editCreateIndexAction" );
    editCreateIndexAction->setEnabled( FALSE );
    editCreateIndexAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "create_index.png" ) ) );
    editDeleteIndexAction = new QAction( this, "editDeleteIndexAction" );
    editDeleteIndexAction->setEnabled( FALSE );
    editDeleteIndexAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "delete_index.png" ) ) );
    fileImportSQLAction = new QAction( this, "fileImportSQLAction" );
    fileExportSQLAction = new QAction( this, "fileExportSQLAction" );


    // toolbars
    Toolbar = new QToolBar( QString(""), this, DockTop ); 

    fileNewAction->addTo( Toolbar );
    fileOpenAction->addTo( Toolbar );
    fileSaveAction->addTo( Toolbar );
    fileRevertAction->addTo( Toolbar );
    Toolbar->addSeparator();
    editCreateTableAction->addTo( Toolbar );
    editDeleteTableAction->addTo( Toolbar );
    editModifyTableAction->addTo( Toolbar );
    editCreateIndexAction->addTo( Toolbar );
    editDeleteIndexAction->addTo( Toolbar );
    Toolbar->addSeparator();
    sqlLogAction->addTo( Toolbar );
    Toolbar->addSeparator();
    helpWhatsThisAction->addTo( Toolbar );


    // menubar
    menubar = new QMenuBar( this, "menubar" );


    fileMenu = new QPopupMenu( this );
    fileNewAction->addTo( fileMenu );
    fileOpenAction->addTo( fileMenu );
    fileCloseAction->addTo( fileMenu );
    fileMenu->insertSeparator();
    fileSaveAction->addTo( fileMenu );
    fileRevertAction->addTo( fileMenu );
    fileCompactAction->addTo( fileMenu );
    fileMenu->insertSeparator();
    QPopupMenu *PopupMenuEditor_9 = new QPopupMenu( this );
    fileMenu->setAccel( tr( "" ), 
        fileMenu->insertItem( fileImportAction->iconSet(),tr( "Import" ), PopupMenuEditor_9 ) );
    fileImportSQLAction->addTo( PopupMenuEditor_9 );
    fileImportCSVAction->addTo( PopupMenuEditor_9 );
    QPopupMenu *PopupMenuEditor_12 = new QPopupMenu( this );
    fileMenu->setAccel( tr( "" ), 
        fileMenu->insertItem( fileExportAction->iconSet(),tr( "Export" ), PopupMenuEditor_12 ) );
    fileExportSQLAction->addTo( PopupMenuEditor_12 );
    fileExportCSVAction->addTo( PopupMenuEditor_12 );
    fileMenu->insertSeparator();
    fileExitAction->addTo( fileMenu );
    menubar->insertItem( QString(""), fileMenu, 1 );

    EditMenu = new QPopupMenu( this );
    editCreateTableAction->addTo( EditMenu );
    editDeleteTableAction->addTo( EditMenu );
    editModifyTableAction->addTo( EditMenu );
    EditMenu->insertSeparator();
    editCreateIndexAction->addTo( EditMenu );
    editDeleteIndexAction->addTo( EditMenu );
    menubar->insertItem( QString(""), EditMenu, 2 );

    ViewMenu = new QPopupMenu( this );
    sqlLogAction->addTo( ViewMenu );
    menubar->insertItem( QString(""), ViewMenu, 3 );

    PopupMenu = new QPopupMenu( this );
    helpWhatsThisAction->addTo( PopupMenu );
    helpAboutAction->addTo( PopupMenu );
    menubar->insertItem( QString(""), PopupMenu, 4 );

    languageChange();
    resize( QSize(702, 552).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) );
    connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
    connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) );
    connect( fileCloseAction, SIGNAL( activated() ), this, SLOT( fileClose() ) );
    connect( comboBrowseTable, SIGNAL( activated(const QString&) ), this, SLOT( populateTable(const QString&) ) );
    connect( buttonNewRecord, SIGNAL( clicked() ), this, SLOT( addRecord() ) );
    connect( buttonDeleteRecord, SIGNAL( clicked() ), this, SLOT( deleteRecord() ) );
    connect( buttonPrevious, SIGNAL( clicked() ), this, SLOT( navigatePrevious() ) );
    connect( buttonNext, SIGNAL( clicked() ), this, SLOT( navigateNext() ) );
    connect( editGoto, SIGNAL( returnPressed() ), this, SLOT( navigateGoto() ) );
    connect( buttonGoto, SIGNAL( clicked() ), this, SLOT( navigateGoto() ) );
    connect( buttonFind, SIGNAL( toggled(bool) ), this, SLOT( browseFind(bool) ) );
    connect( fileCompactAction, SIGNAL( activated() ), this, SLOT( compact() ) );
    connect( editCopyAction, SIGNAL( activated() ), this, SLOT( copy() ) );
    connect( editPasteAction, SIGNAL( activated() ), this, SLOT( paste() ) );
    connect( helpWhatsThisAction, SIGNAL( activated() ), this, SLOT( helpWhatsThis() ) );
    connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
    connect( dataTable, SIGNAL( doubleClicked(int,int,int,const QPoint&) ), this, SLOT( doubleClickTable(int,int,int,const QPoint&) ) );
    connect( mainTab, SIGNAL( selected(const QString&) ), this, SLOT( mainTabSelected(const QString&) ) );
    connect( sqlLogAction, SIGNAL( toggled(bool) ), this, SLOT( toggleLogWindow(bool) ) );
    connect( executeQueryButton, SIGNAL( clicked() ), this, SLOT( executeQuery() ) );
    connect( fileImportCSVAction, SIGNAL( activated() ), this, SLOT( importTableFromCSV() ) );
    connect( fileExportCSVAction, SIGNAL( activated() ), this, SLOT( exportTableToCSV() ) );
    connect( fileRevertAction, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
    connect( fileSaveAction, SIGNAL( activated() ), this, SLOT( fileSave() ) );
    connect( editDeleteIndexAction, SIGNAL( activated() ), this, SLOT( deleteIndex() ) );
    connect( editCreateIndexAction, SIGNAL( activated() ), this, SLOT( createIndex() ) );
    connect( editCreateTableAction, SIGNAL( activated() ), this, SLOT( createTable() ) );
    connect( editDeleteTableAction, SIGNAL( activated() ), this, SLOT( deleteTable() ) );
    connect( editModifyTableAction, SIGNAL( activated() ), this, SLOT( editTable() ) );
    connect( fileExportSQLAction, SIGNAL( activated() ), this, SLOT( exportDatabaseToSQL() ) );
    connect( fileImportSQLAction, SIGNAL( activated() ), this, SLOT( importDatabaseFromSQL() ) );
    init();
}
Esempio n. 24
0
QAPEWindow::QAPEWindow()
{
  resize(QSize(800, 500).expandedTo(minimumSizeHint()));
  
  actFileNew=new QAction(QIcon(":/images/filenew.png"), tr("&New"), this);
  actFileNew->setStatusTip(tr("Create new file"));
  actFileOpen=new QAction(QIcon(":/images/fileopen.png"), tr("&Open..."), this);
  actFileOpen->setShortcut(tr("Ctrl+O"));
  actFileOpen->setStatusTip(tr("Open an existing file"));
  actFileSave=new QAction(QIcon(":/images/filesave.png"), tr("&Save"), this);
  actFileSave->setShortcut(tr("Ctrl+S"));
  actFileSave->setStatusTip(tr("Save file"));
  actFileSaveAs=new QAction(QIcon(":/images/filesaveas.png"), tr("Save &as..."), this);
  actFileSaveAs->setStatusTip(tr("Save file with another name"));
  actFileGenerate=new QAction(QIcon(":/images/filegenerate.png"), tr("&Generate ~/.asoundrc directly"), this);
  actFileGenerate->setStatusTip(tr("Generate config file for ALSA from current file  to ~/.asoundrc directly"));
  actFileGeneratePart=new QAction(QIcon(":/images/filegeneratepart.png"), tr("&Generate config..."), this);
  actFileGeneratePart->setStatusTip(tr("Generate config file for ALSA from current file"));
  actFileExit=new QAction(QIcon(":/images/fileexit.png"), tr("E&xit"), this);
  actFileExit->setStatusTip(tr("Close program"));
  
  actEditHW=new QAction(QIcon(":/images/hw.png"), tr("&HW output"), this);
  actEditHW->setStatusTip(tr("Add HW output block"));
  actEditInp=new QAction(QIcon(":/images/inp.png"), tr("DSP &input"), this);
  actEditInp->setStatusTip(tr("Add DSP input block"));
  actEditNull=new QAction(QIcon(":/images/null.png"), tr("Dummy &null output"), this);
  actEditNull->setStatusTip(tr("Add dummy null output block"));
  actEditFile=new QAction(QIcon(":/images/file.png"), tr("Write to &file"), this);
  actEditFile->setStatusTip(tr("Add block, that writes stream to file"));
  
  actEditRoute=new QAction(QIcon(":/images/route.png"), tr("&Route plugin"), this);
  actEditRoute->setStatusTip(tr("Add route block for routing and duplicating channels"));
  actEditRate=new QAction(QIcon(":/images/rate.png"), tr("R&ate plugin"), this);
  actEditRate->setStatusTip(tr("Add samplerate conversion block"));
  actEditDmix=new QAction(QIcon(":/images/dmix.png"), tr("D&mix pugin"), this);
  actEditDmix->setStatusTip(tr("Add dmix mixing and samplerate conversion block"));
  actEditLADSPA=new QAction(QIcon(":/images/ladspa.png"), tr("&LADSPA plugin thunk"), this);
  actEditLADSPA->setStatusTip(tr("Add some LADSPA effect block"));
  actEditMeter=new QAction(QIcon(":/images/meter.png"), tr("Me&ter plugin"), this);
  actEditMeter->setStatusTip(tr("Add volume meter plugin"));
  
  actEditLinear=new QAction(QIcon(":/images/linear.png"), tr("Li&near<->linear"), this);
  actEditLinear->setStatusTip(tr("Add linear<->linear format conversion block"));
  actEditFloat=new QAction(QIcon(":/images/float.png"), tr("Fl&oat<->linear"), this);
  actEditFloat->setStatusTip(tr("Add float<->linear format conversion block"));
  actEditIEC958=new QAction(QIcon(":/images/iec.png"), tr("IE&C-958<->linear"), this);
  actEditIEC958->setStatusTip(tr("Add IEC-958<->linear frames format conversion block"));
  actEditMuLaw=new QAction(QIcon(":/images/mulaw.png"), tr("M&u-Law<->linear"), this);
  actEditMuLaw->setStatusTip(tr("Add mu-Law<->linear format conversion block"));
  actEditALaw=new QAction(QIcon(":/images/alaw.png"), tr("A-La&w<->linear"), this);
  actEditALaw->setStatusTip(tr("Add A-Law<->linear format conversion block"));
  actEditImaADPCM=new QAction(QIcon(":/images/ima.png"), tr("IMA ADP&CM<->linear"), this);
  actEditImaADPCM->setStatusTip(tr("Add IMA ADPCM<->linear format conversion block"));
  
  actToolAllocate=new QAction(tr("&Scroll-in lost components"), this);
  actToolAllocate->setStatusTip(tr("Move lost components (accidentally moved beyond workspace) in your sight"));
  
  actHelpAbout=new QAction(tr("&About..."), this);
  actHelpAbout->setStatusTip(tr("About ALSA Plugin editor"));
  
  QToolBar *tbMain = new QToolBar(this);
  addToolBar(Qt::TopToolBarArea, tbMain);
  
  QToolBar *tbTools = new QToolBar(this);
  addToolBar(Qt::LeftToolBarArea, tbTools);

  QMenu *mFile,*mEdit,*mTools,*mHelp;
  
  mFile=menuBar()->addMenu(tr("&File"));
  mFile->addAction(actFileNew);
  mFile->addAction(actFileOpen);
  mFile->addAction(actFileSave);
  mFile->addAction(actFileSaveAs);
  mFile->addSeparator();
  mFile->addAction(actFileExit);
  
  mEdit=menuBar()->addMenu(tr("&Edit"));
  mEdit->addAction(actEditHW);
  mEdit->addAction(actEditInp);
  mEdit->addAction(actEditNull);
  mEdit->addAction(actEditFile);
  mEdit->addSeparator()->setText(tr("Routing, mixing, effects"));
  mEdit->addAction(actEditRoute);
  mEdit->addAction(actEditRate);
  mEdit->addAction(actEditDmix);
  mEdit->addAction(actEditLADSPA);
  mEdit->addAction(actEditMeter);
  mEdit->addSeparator()->setText(tr("Format conversion"));
  mEdit->addAction(actEditLinear);
  mEdit->addAction(actEditFloat);
  mEdit->addAction(actEditIEC958);
  mEdit->addAction(actEditMuLaw);
  mEdit->addAction(actEditALaw);
  mEdit->addAction(actEditImaADPCM);
  
  mTools=menuBar()->addMenu(tr("&Tools"));
  mTools->addAction(actFileGenerate);
  mTools->addAction(actFileGeneratePart);
  mTools->addSeparator();
  mTools->addAction(actToolAllocate);
  
  mHelp=menuBar()->addMenu(tr("&Help"));
  mHelp->addAction(actHelpAbout);
  
  tbMain->addAction(actFileNew);
  tbMain->addAction(actFileOpen);
  tbMain->addAction(actFileSave);
  tbMain->addSeparator();
  tbMain->addAction(actFileGenerate);
  tbMain->addAction(actFileGeneratePart);
  tbMain->addSeparator();
  tbMain->addAction(actFileExit);
  
  tbTools->addAction(actEditHW);
  tbTools->addAction(actEditInp);
  tbTools->addAction(actEditNull);
  tbTools->addAction(actEditFile);
  tbTools->addSeparator();
  tbTools->addAction(actEditRoute);
  tbTools->addAction(actEditRate);
  tbTools->addAction(actEditDmix);
  tbTools->addAction(actEditLADSPA);
  tbTools->addAction(actEditMeter);
  tbTools->addSeparator();
  tbTools->addAction(actEditLinear);
  tbTools->addAction(actEditFloat);
  tbTools->addAction(actEditIEC958);
  tbTools->addAction(actEditMuLaw);
  tbTools->addAction(actEditALaw);
  tbTools->addAction(actEditImaADPCM);

  QStatusBar* statusbar = new QStatusBar(this);
  statusbar->setObjectName("statusbar");
  setStatusBar(statusbar);
  statusLabel=new QLabel(statusbar);
  statusbar->addWidget(statusLabel,100);

  scrollArea = new QScrollArea(this);
  scrollArea->setWidgetResizable(true);

  setCentralWidget(scrollArea);

  renderArea = new QRenderArea(scrollArea,scrollArea);
  scrollArea->setWidget(renderArea);

  programTitle=tr("ALSA Plugin Editor");
  workFile="";
  
  repaintTimer=0;
  deletedTimer=0;
  
  connect(actFileNew,SIGNAL(triggered()),this,SLOT(fileNew()));
  connect(actFileOpen,SIGNAL(triggered()),this,SLOT(fileOpen()));
  connect(actFileSave,SIGNAL(triggered()),this,SLOT(fileSave()));
  connect(actFileSaveAs,SIGNAL(triggered()),this,SLOT(fileSaveAs()));
  connect(actFileGenerate,SIGNAL(triggered()),this,SLOT(fileGenerate()));
  connect(actFileGeneratePart,SIGNAL(triggered()),this,SLOT(fileGeneratePart()));
  connect(actFileExit,SIGNAL(triggered()),this,SLOT(fileExit()));
  
  connect(actEditHW,SIGNAL(triggered()),this,SLOT(editHW()));
  connect(actEditInp,SIGNAL(triggered()),this,SLOT(editInp()));
  connect(actEditNull,SIGNAL(triggered()),this,SLOT(editNull()));
  connect(actEditFile,SIGNAL(triggered()),this,SLOT(editFile()));
  connect(actEditDmix,SIGNAL(triggered()),this,SLOT(editDmix()));
  connect(actEditRoute,SIGNAL(triggered()),this,SLOT(editRoute()));
  connect(actEditRate,SIGNAL(triggered()),this,SLOT(editRate()));
  connect(actEditLADSPA,SIGNAL(triggered()),this,SLOT(editLADSPA()));
  connect(actEditMeter,SIGNAL(triggered()),this,SLOT(editMeter()));
  connect(actEditLinear,SIGNAL(triggered()),this,SLOT(editLinear()));
  connect(actEditFloat,SIGNAL(triggered()),this,SLOT(editFloat()));
  connect(actEditIEC958,SIGNAL(triggered()),this,SLOT(editIEC958()));
  connect(actEditALaw,SIGNAL(triggered()),this,SLOT(editALaw()));
  connect(actEditMuLaw,SIGNAL(triggered()),this,SLOT(editMuLaw()));
  connect(actEditImaADPCM,SIGNAL(triggered()),this,SLOT(editImaADPCM()));
  
  connect(actToolAllocate,SIGNAL(triggered()),this,SLOT(toolAllocate()));
  connect(actHelpAbout,SIGNAL(triggered()),this,SLOT(helpAbout()));
  
  modified=false;
  updateStatus();
  
  srand(clock());
}
Esempio n. 25
0
LDViewMainWindow::LDViewMainWindow(QApplication *a)
	:QMainWindow(),Ui::LDView(),
	fileSeparatorIndex(-1),
	toolbarMaxStep(new QLabel),
	toolbarCurrentStep(new QLabel),
	toolbarStepLabel(new QLabel("Step :")),
	toolbarViewAngle(NULL),
	toolbarWireframeMenu(new QMenu(this)),
	edgeMenu(new QMenu(this)),
	bfcMenu(new QMenu(this)),
	primitiveMenu(new QMenu(this))
{
    setupUi(this);
	toolbar->insertWidget(toolbarFirstStep,toolbarStepLabel);
	toolbar->insertWidget(toolbarFirstStep,toolbarCurrentStep);
	toolbar->insertWidget(toolbarFirstStep,toolbarMaxStep);
    if (modelViewer) modelViewer->setMainWindow(this);
    connect( fileOpenAction, SIGNAL( triggered() ), this, SLOT( fileOpen() ) );
    connect( fileSaveSettingsAction, SIGNAL( triggered() ), this, SLOT( fileSaveSettings() ) );
    connect( fileExportAction, SIGNAL( triggered() ), this, SLOT( fileExport() ) );
    connect( fileExportOptionAction, SIGNAL( triggered() ), this, SLOT( fileExportOption() ) );
	connect( file3DSExportOptionAction, SIGNAL( triggered() ), this, SLOT( file3DSExportOption() ) );
    connect( fileJPEGOptionsAction, SIGNAL( triggered() ), this, SLOT( fileJPEGOptions() ) );
    connect( fileSaveAction, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
    connect( filePrintAction, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
    connect( fileExitAction, SIGNAL( triggered() ), this, SLOT( fileExit() ) );
    connect( helpContentsAction, SIGNAL( triggered() ), this, SLOT( helpContents() ) );
    connect( helpAboutAction, SIGNAL( triggered() ), this, SLOT( helpAbout() ) );
    connect( helpAboutQtAction, SIGNAL( triggered() ), this, SLOT( helpAboutQt() ) );
    connect( editPreferencesAction, SIGNAL( triggered() ), this, SLOT( editPreferences() ) );
    connect( viewToolBarAction, SIGNAL( toggled(bool) ), this, SLOT( viewToolBar(bool) ) );
    connect( toolbarWireframeAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarWireframe(bool) ) );
    connect( toolbarEdgeAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarEdge(bool) ) );
    connect( toolbarPrimitiveSubstitutionAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarPrimitiveSubstitution(bool) ) );
    connect( toolbarLightingAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarLighting(bool) ) );
    connect( toolbarBFCAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarBFC(bool) ) );
    connect( toolbarAxesAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarAxes(bool) ) );
    connect( toolbarSeamsAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarSeams(bool) ) );
    connect( viewStatusBarAction, SIGNAL( toggled(bool) ), this, SLOT( viewStatusBar(bool) ) );
    connect( viewLatitudeRotationAction, SIGNAL( toggled(bool) ), this, SLOT( latitudeRotation(bool) ) );
    connect( viewKeepRightSideUpAction, SIGNAL( toggled(bool) ), this, SLOT( keepRightSideUp(bool) ) );
    connect( viewFullScreenAction, SIGNAL( triggered() ), this, SLOT( viewFullScreen() ) );
    connect( viewResetViewAction, SIGNAL( triggered() ), this, SLOT( viewResetView() ) );
    connect( helpOpenGLDriverInfoAction, SIGNAL( triggered() ), this, SLOT( helpOpenGLDriverInfo() ) );
    connect( fileLDrawDirAction, SIGNAL( triggered() ), this, SLOT( fileLDrawDir() ) );
    connect( fileExtraDirAction, SIGNAL( triggered() ), this, SLOT( fileExtraDir() ) );
    connect( fileCheckForUpdatesAction, SIGNAL( triggered() ), this, SLOT( fileCheckForUpdates() ) );
    connect( fileReloadAction, SIGNAL( triggered() ), this, SLOT( fileReload() ) );
    connect( viewShowErrorsAction, SIGNAL( triggered() ), this, SLOT( viewShowErrors() ) );
    connect( pollActionGroup, SIGNAL( triggered(QAction*) ), this, SLOT( pollChanged(QAction*) ) );
    connect( viewZoomToFitAction, SIGNAL( triggered() ), this, SLOT( viewZoomToFit() ) );
	connect( viewRightSideUpAction, SIGNAL( triggered() ), this, SLOT( viewRightSideUp() ) );
    connect( viewModeActionGroup, SIGNAL( triggered(QAction*) ), this, SLOT( viewModeChanged(QAction*) ) );
    connect( frontViewAngleAction, SIGNAL( triggered() ), this, SLOT( frontViewAngle() ) );
    connect( backViewAngleAction, SIGNAL( triggered() ), this, SLOT( backViewAngle() ) );
    connect( leftViewAngleAction, SIGNAL( triggered() ), this, SLOT( leftViewAngle() ) );
    connect( rightViewAngleAction, SIGNAL( triggered() ), this, SLOT( rightViewAngle() ) );
    connect( topViewAngleAction, SIGNAL( triggered() ), this, SLOT( topViewAngle() ) );
    connect( bottomViewAngleAction, SIGNAL( triggered() ), this, SLOT( bottomViewAngle() ) );
    connect( latLongViewAngleAction, SIGNAL( triggered() ), this, SLOT( latLongViewAngle() ) );
    connect( isoViewAngleAction, SIGNAL( triggered() ), this, SLOT( isoViewAngle() ) );
    connect( saveDefaultViewAngleAction, SIGNAL( triggered() ), this, SLOT( saveDefaultViewAngle() ) );
    connect( fileCancelLoadAction, SIGNAL( triggered() ), this, SLOT( fileCancelLoad() ) );
    connect( showViewInfoAction, SIGNAL( triggered() ), this, SLOT( showViewInfo() ) );
    connect( showPovCameraAction, SIGNAL( triggered() ), this, SLOT( showPovCamera() ) );
    connect( showPovAspectRatioAction, SIGNAL( toggled(bool) ), this, SLOT( showPovAspectRatio(bool) ) );
    connect( toolsPartListAction, SIGNAL( triggered() ), this, SLOT( toolsPartList() ) );
    connect( toolbarPrevStep, SIGNAL( triggered() ), this, SLOT( prevStep() ) );
    connect( toolbarNextStep, SIGNAL( triggered() ), this, SLOT( nextStep() ) );
    connect( toolbarFirstStep, SIGNAL( triggered() ), this, SLOT( firstStep() ) );
    connect( toolbarLastStep, SIGNAL( triggered() ), this, SLOT( lastStep() ) );
    connect( stepGoto, SIGNAL( triggered() ), this, SLOT( gotoStep() ) );
    connect( toolsModelTreeAction, SIGNAL( triggered() ), this, SLOT( toolsModelTree() ) );
    connect( toolsBoundingBoxAction, SIGNAL( triggered() ), this, SLOT( toolsBoundingBox() ) );
    connect( toolsMpdModelSelectionAction, SIGNAL( triggered() ), this, SLOT( toolsMpdModelSelection() ) );

    connect(fileMenu, SIGNAL(aboutToShow()), this, SLOT(doFileMenuAboutToShow()));
    connect(editMenu, SIGNAL(aboutToShow()), this, SLOT(doEditMenuAboutToShow()));
    connect(viewMenu, SIGNAL(aboutToShow()), this, SLOT(doViewMenuAboutToShow()));
    connect(toolsMenu,SIGNAL(aboutToShow()), this, SLOT(doToolsMenuAboutToShow()));
    connect(helpMenu, SIGNAL(aboutToShow()), this, SLOT(doHelpMenuAboutToShow()));

	int cnt,i;
	QAction *item;
    for ( cnt = i = 0; ; i++)
    {
        item = fileMenu->actions()[i];
        if (item->isSeparator())
        {
            if (++cnt == 2)
                break;
        }
    }
    fileSeparatorIndex = i;
#ifdef __APPLE__
    fileMenu->removeItemAt(fileSeparatorIndex);
    fileSeparatorIndex = -1;
    openRecentMenu = new QMenu(this, "openRecentMenu");
    fileMenu->insertItem("Open Recent", openRecentMenu, -1, 1);
#endif // __APPLE__
    if (!recentFiles)
    {
        recentFiles = new TCStringArray(10);
        populateRecentFiles();
    }
    populateRecentFileMenuItems();
	setupStandardSizes();
#ifdef __APPLE__
        // Since Preferences is the only item in the edit menu, we need to
        // delete the edit menu on the Mac, since the item is going to get
        // magically moved to the LDView menu.  The problem is, if we delete
        // the edit menu, the magic stops working, since it's apparently all
        // done on the fly.  So, we're going to create a new fully-functional
        // Preferences menu item at the top of the File menu, and THEN delete
        // the edit menu.  This newly created menu item won't be visible to the
        // user, but it will make the other one continue to function after the
        // deletion of the edit menu.
        fileMenu->insertItem("Preferences", this, SLOT(doPreferences()),
            0, -1, 0);
        // Remove the (empty without Preferences) edit menu.
        menuBar->removeItem(menuBar->idAt(1));
#endif //__APPLE__
	toolbarViewAngle = new QToolButton(toolbar);
	toolbarViewAngle->setMenu(viewingAnglePopupMenu);
	toolbarViewAngle->setPopupMode(QToolButton::InstantPopup);
	toolbarViewAngle->setIcon(QPixmap( ":/images/images/toolbar_view.png"));
	toolbarViewAngle->setEnabled(false);
	toolbar->insertWidget(editPreferencesAction,toolbarViewAngle);
	connect( wireframeFogAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarWireframeFog(bool) ) );
	connect( wireframeRemoveHiddenLinesAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarWireframeRemoveHiddenLines(bool) ) );
	toolbarWireframeMenu->addAction(wireframeFogAction);
	toolbarWireframeMenu->addAction(wireframeRemoveHiddenLinesAction);
	QToolButton *toolbarWireframe =
		(QToolButton *)toolbar->widgetForAction(toolbarWireframeAction);	
	if (toolbarWireframe != NULL)
	{
		toolbarWireframe->setMenu(toolbarWireframeMenu);
		toolbarWireframe->setPopupMode(QToolButton::MenuButtonPopup);
	}
	connect( textureStudAction, SIGNAL( toggled(bool) ), this, SLOT( textureStud(bool) ) );
	primitiveMenu->addAction(textureStudAction);
	QToolButton *toolbarPrimitives =
		(QToolButton *)toolbar->widgetForAction(toolbarPrimitiveSubstitutionAction);
	if (toolbarPrimitives)
	{
		toolbarPrimitives->setMenu(primitiveMenu);
		toolbarPrimitives->setPopupMode(QToolButton::MenuButtonPopup);
	}
	connect( edgeShowEdgeOnlyAction, SIGNAL( toggled(bool) ), this, SLOT( edgeShowEdgeOnly(bool) ) );
	connect( edgeConditionalLineAction, SIGNAL( toggled(bool) ), this, SLOT( edgeConditionalLine(bool) ) );
	connect( edgeHighQualityAction, SIGNAL( toggled(bool) ), this, SLOT( edgeHighQuality(bool) ) );
	connect( edgeAlwaysBlackAction, SIGNAL( toggled(bool) ), this, SLOT( edgeAlwaysBlack(bool) ) );
	edgeMenu->addAction(edgeShowEdgeOnlyAction);
	edgeMenu->addAction(edgeConditionalLineAction);
	edgeMenu->addAction(edgeHighQualityAction);
	edgeMenu->addAction(edgeAlwaysBlackAction);
	QToolButton *toolbarEdge =
		(QToolButton *)toolbar->widgetForAction(toolbarEdgeAction);
	if (toolbarEdge)
	{
		toolbarEdge->setMenu(edgeMenu);
		toolbarEdge->setPopupMode(QToolButton::MenuButtonPopup);
	}
	connect( bfcRedBackFacesAction, SIGNAL( toggled(bool) ), this, SLOT( bfcRedBackFaces(bool) ) );
	connect( bfcGreenFrontFacesAction, SIGNAL( toggled(bool) ), this, SLOT( bfcGreenFrontFaces(bool) ) );
	connect( bfcBlueNeutralFacesAction, SIGNAL( toggled(bool) ), this, SLOT( bfcBlueNeutralFaces(bool) ) );
	bfcMenu->addAction(bfcRedBackFacesAction);
	bfcMenu->addAction(bfcGreenFrontFacesAction);
	bfcMenu->addAction(bfcBlueNeutralFacesAction);
	QToolButton *toolbarBfc =
		(QToolButton *)toolbar->widgetForAction(toolbarBFCAction);
	if (toolbarBfc)
	{
		toolbarBfc->setMenu(bfcMenu);
		toolbarBfc->setPopupMode(QToolButton::MenuButtonPopup);
	}
    modelViewer->setApplication(a);
}
bool TestWindow::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        fileNew();
        break;
    case 1:
        fileOpen();
        break;
    case 2:
        fileSave();
        break;
    case 3:
        fileSaveAs();
        break;
    case 4:
        filePrint();
        break;
    case 5:
        fileExit();
        break;
    case 6:
        editUndo();
        break;
    case 7:
        editRedo();
        break;
    case 8:
        editCut();
        break;
    case 9:
        add();
        break;
    case 10:
        editPaste();
        break;
    case 11:
        editFind();
        break;
    case 12:
        helpIndex();
        break;
    case 13:
        helpContents();
        break;
    case 14:
        helpAbout();
        break;
    case 15:
        static_QUType_ptr.set(_o,remove());
        break;
    case 16:
        begin();
        break;
    case 17:
        end();
        break;
    case 18:
        languageChange();
        break;
    default:
        return QMainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}