Exemple #1
0
int lh_hydrainfo(lua_State *L) {
  checkArg(L, 2, "hydramap");
  int x = luaInt(1);
  int y = luaInt(2);
  helpAbout(x, y);
  return 0;
  }
int Buddies::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: countOnlineUsers(); break;
        case 1: setUserStatus(); break;
        case 2: loginUser(); break;
        case 3: loginCurrentStatus(); break;
        case 4: validateUser(); break;
        case 5: stopifNotConnected(); break;
        case 6: myexit(); break;
        case 7: focusTabEdit(); break;
        case 8: structUser(); break;
        case 9: startChat(); break;
        case 10: helpAbout(); break;
        case 11: getSysInfo(); break;
        case 12: onlineNotify(); break;
        case 13: WriteOnWall(); break;
        case 14: Information(); break;
        case 15: dbstatus(); break;
        case 16: openNotes(); break;
        case 17: setIcon((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 18: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 19: messageClicked(); break;
        case 20: showMessage(); break;
        }
        _id -= 21;
    }
    return _id;
}
Exemple #3
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;
}
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;
}
Exemple #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();
}
Exemple #6
0
void MainWindow::createActions() {
    _fileNewAct = new QAction(tr("&New..."), this);
    _fileNewAct->setShortcut(QKeySequence::New);
    _fileNewAct->setStatusTip(tr("Create new simulation"));
    _fileNewAct->setIcon(QIcon::fromTheme("document-new", QIcon(":/icons/new.png")));
    connect(_fileNewAct, SIGNAL(triggered()), this, SLOT(fileNew()));


    _fileOpenAct = new QAction(tr("&Open..."), this);
    _fileOpenAct->setShortcut(QKeySequence::Open);
    _fileOpenAct->setStatusTip(tr("Load existing simulation data"));
    _fileOpenAct->setIcon(QIcon::fromTheme("document-open", QIcon(":/icons/open.png")));
    connect(_fileOpenAct, SIGNAL(triggered()), this, SLOT(fileOpen()));

    _fileCloseAct = new QAction(tr("&Close..."), this);
    _fileCloseAct->setShortcut(QKeySequence::Close);
    _fileCloseAct->setStatusTip(tr("Exit current simulation"));
    connect(_fileCloseAct, SIGNAL(triggered()), this, SLOT(fileClose()));

    _fileSaveAct = new QAction(tr("&Save"), this);
    _fileSaveAct->setShortcut(QKeySequence::Save);
    _fileSaveAct->setStatusTip(tr("Save simulation data to file"));
    _fileSaveAct->setIcon(QIcon::fromTheme("document-save", QIcon(":/icons/save.png")));
    connect(_fileSaveAct, SIGNAL(triggered()), this, SLOT(fileSave()));

    _fileSaveAsAct = new QAction(tr("Save &as..."), this);
    _fileSaveAsAct->setShortcut(QKeySequence::SaveAs);
    _fileSaveAsAct->setStatusTip(tr("Save simulation data to file"));
    _fileSaveAsAct->setIcon(QIcon::fromTheme("document-save-as", QIcon(":/icons/save.png")));
    connect(_fileSaveAsAct, SIGNAL(triggered()), this, SLOT(fileSaveAs()));

    _fileExitAct = new QAction(tr("E&xit..."), this);
    _fileExitAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X));
    _fileExitAct->setStatusTip(tr("Exit program"));
    _fileExitAct->setIcon(QIcon::fromTheme("application-exit"));
    connect(_fileExitAct, SIGNAL(triggered()), this, SLOT(close()));


    _helpAboutAct = new QAction(tr("&About"), this);
    _helpAboutAct->setStatusTip(tr("About HPC program"));
    _helpAboutAct->setIcon(QIcon::fromTheme("help-about"));
    connect(_helpAboutAct, SIGNAL(triggered()), this, SLOT(helpAbout()));

    _helpAboutQtAct = new QAction(tr("&About Qt"), this);
    _helpAboutQtAct->setStatusTip(tr("About Qt framework"));
    _helpAboutQtAct->setIcon(QIcon::fromTheme("help-about"));
    connect(_helpAboutQtAct, SIGNAL(triggered()), this, SLOT(helpAboutQt()));

    _fileSaveAct->setEnabled(false);
    _fileSaveAsAct->setEnabled(false);
    _fileCloseAct->setEnabled(false);
}
Exemple #7
0
WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags)
	: QMainWindow(parent)
{
	setupUi(this);

	(void) statusBar();

	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(close()));
	connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnect()));
	connect(scanButton, SIGNAL(clicked()), this, SLOT(scan()));
	connect(connectButton, SIGNAL(clicked()), this, SLOT(connectB()));
	connect(fileEventHistoryAction, SIGNAL(activated()), this,
		SLOT(eventHistory()));
	connect(networkSelect, SIGNAL(activated(const QString&)), this,
		SLOT(selectNetwork(const QString&)));
	connect(fileEdit_networkAction, SIGNAL(activated()), this,
		SLOT(editNetwork()));
	connect(fileAdd_NetworkAction, SIGNAL(activated()), this,
		SLOT(addNetwork()));
	connect(adapterSelect, SIGNAL(activated(const QString&)), this,
		SLOT(selectAdapter(const QString&)));

	eh = NULL;
	scanres = NULL;
	udr = NULL;
	ctrl_iface = NULL;
	ctrl_conn = NULL;
	monitor_conn = NULL;
	msgNotifier = NULL;
	ctrl_iface_dir = strdup("/var/run/wpa_supplicant");

	parse_argv();

	textStatus->setText("connecting to wpa_supplicant");
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), SLOT(ping()));
	timer->start(1000, FALSE);

	if (openCtrlConnection(ctrl_iface) < 0) {
		printf("Failed to open control connection to "
		       "wpa_supplicant.\n");
	}

	updateStatus();
	networkMayHaveChanged = true;
	updateNetworks();
}
MainWindow::MainWindow()
  :QMainWindow()
{
  // actions
  fileNewAction = new QAction( this );
  helpAboutAction = new QAction( this);
  ExitApplicationAction = new QAction( this);
  openAction = new QAction(this);
  saveAction = new QAction(this);
  
  //MenuBars
  MenuBar = new QMenuBar(this);
  setMenuBar(MenuBar);

  fileMenu = new QMenu( this );
  fileMenu->addAction(fileNewAction);;
  fileMenu->addAction(openAction);
  fileMenu->addAction(saveAction);
  fileMenu->addAction(ExitApplicationAction);
  fileMenu->insertSeparator(ExitApplicationAction);
  menuBar()->addMenu( fileMenu);
  helpMenu = new QMenu( this );
  helpMenu->addAction(helpAboutAction);
  menuBar()->addMenu(helpMenu);

  //Add Text
  fileNewAction->setText(tr("&New MarSystem") );
  helpAboutAction->setText(tr( "&About") );
  ExitApplicationAction->setText( tr("&Quit") );
  openAction->setText( tr("&Open") );
  saveAction->setText( tr("&Save") );
  fileMenu->setTitle( tr("&File") );
  helpMenu->setTitle( tr("&Help") );

  // signals and slots connections
  connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) );
  connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
  connect( ExitApplicationAction, SIGNAL( activated() ), this, SLOT( exitApp() ) );
  connect( openAction, SIGNAL( activated() ), this, SLOT( openFile() ) );
  connect( saveAction, SIGNAL( activated() ), this, SLOT( saveFile())) ;

  init();
  
  
}
Exemple #9
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()));
}
Exemple #10
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);
}
Exemple #11
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);
}
Exemple #12
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
}
Exemple #13
0
MainFrame::MainFrame(QWidget *parent)
: QMainWindow(parent)
{
    QMenu *filePopup = menuBar()->addMenu("&File");
    filePopup->addAction("&Exit", this, SLOT(close()));

    QMenu *editPopup = menuBar()->addMenu("&Edit");
    editPopup->addAction("&Undo", 0, 0, Qt::CTRL + Qt::Key_Z);
    editPopup->addSeparator();
    editPopup->addAction("Cu&t", 0, 0, Qt::CTRL + Qt::Key_X);
    editPopup->addAction("&Copy", 0, 0, Qt::CTRL + Qt::Key_C);
    editPopup->addAction("&Paste", 0, 0, Qt::CTRL + Qt::Key_V);
    editPopup->addSeparator();
    editPopup->addAction("&Options...", this, SLOT(editOptions()));

    QMenu *helpPopup = menuBar()->addMenu("&Help");
    helpPopup->addAction("&About QtMfc...", this, SLOT(helpAbout()), Qt::CTRL + Qt::Key_F1);

    view = new ChildView(this);
    setCentralWidget(view);

    statusBar();
}
Exemple #14
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);
}
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);
}
Exemple #16
0
void qavimator::on_helpAboutAction_triggered()
{
    helpAbout();
}
Exemple #17
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();
}
/*
 *  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) ) );
}
/*
 *  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() ) );
}
Exemple #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;
}
Exemple #21
0
MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags)
    , Ui::MainWindow()
{
    setupUi(this);

    // instantiate singleton
    new RobotManager(this);

    QWidget* toolsWidget = new QWidget();
    m_toolsUi = new Ui::ToolWidget();
    m_toolsUi->setupUi(toolsWidget);
    m_toolsUi->cmbTool->addItem("Place Vehicle");        // 0
    m_toolsUi->cmbTool->insertSeparator(1);              // 1
    m_toolsUi->cmbTool->addItem("Modify Obstacles");     // 2
    m_toolsUi->cmbTool->addItem("Modify Explored Area"); // 3
    m_toolsUi->cmbTool->insertSeparator(4);              // 4
    m_toolsUi->cmbTool->addItem("DisCoverage (Orientation-based)"); // 5
    m_toolsUi->cmbTool->addItem("MinDist");              // 6
    m_toolsUi->cmbTool->addItem("DisCoverage (Frontier Weights)"); // 7
	m_toolsUi->cmbTool->addItem("Random"); // 8
	m_toolsUi->cmbTool->addItem("MaxArea"); // 9
	m_toolsUi->cmbTool->addItem("Ruffins"); // 10
    toolBar->insertWidget(actionDummy, toolsWidget);
    toolBar->removeAction(actionDummy);

    m_stats = new Statistics(this);
    dwStatistics->setWidget(m_stats);
    dwStatistics->setVisible(false);

    m_statusProgress = new QLabel("Explored: 0.00%", statusBar());
    statusBar()->addPermanentWidget(m_statusProgress);

    m_statusResolution = new QLabel(statusBar());
    statusBar()->addPermanentWidget(m_statusResolution);
    setStatusResolution(0.2);

    m_statusPosition = new QLabel(statusBar());
    statusBar()->addPermanentWidget(m_statusPosition);
    setStatusPosition(QPoint(0, 0));

    m_scene = new Scene(this, this);
    scrollArea->setWidget(m_scene);
    scrollArea->installEventFilter(this);

    m_robotListView = new RobotListView(this);
    dwRobotManager->setWidget(m_robotListView);


    connect(actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(actionZoomIn, SIGNAL(triggered()), m_scene, SLOT(zoomIn()));
    connect(actionZoomOut, SIGNAL(triggered()), m_scene, SLOT(zoomOut()));
    connect(actionNew, SIGNAL(triggered()), this, SLOT(newScene()));
    connect(actionOpen, SIGNAL(triggered()), this, SLOT(openScene()));
    connect(actionSave, SIGNAL(triggered()), this, SLOT(saveScene()));
    connect(actionSaveAs, SIGNAL(triggered()), this, SLOT(saveSceneAs()));
    connect(actionPartition, SIGNAL(triggered(bool)), Config::self(), SLOT(setShowPartition(bool)));
    connect(actionDensity, SIGNAL(triggered(bool)), Config::self(), SLOT(setShowDensity(bool)));
    connect(actionVectorField, SIGNAL(triggered(bool)), Config::self(), SLOT(setShowVectorField(bool)));
    connect(actionPreview, SIGNAL(triggered(bool)), Config::self(), SLOT(setShowPreviewTrajectory(bool)));
    connect(actionStatistics, SIGNAL(triggered(bool)), dwStatistics, SLOT(setVisible(bool)));
    connect(actionExport, SIGNAL(triggered()), this, SLOT(exportToTikz()));
    connect(actionReload, SIGNAL(triggered()), this, SLOT(reloadScene()));
	connect(actionStep, SIGNAL(triggered()), this, SLOT(tick()));
    connect(m_toolsUi->cmbTool, SIGNAL(currentIndexChanged(int)), m_scene, SLOT(selectTool(int)));
    connect(m_toolsUi->sbRadius, SIGNAL(valueChanged(double)), m_scene, SLOT(setOperationRadius(double)));

    connect(actionAbout, SIGNAL(triggered()), this, SLOT(helpAbout()));
    connect(actionAboutQt, SIGNAL(triggered()), this, SLOT(helpAboutQt()));
}
bool MainWindowImpl::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: insertDriver((QString)static_QUType_QString.get(_o+1)); break;
    case 1: tlToRoute((TLList)(*((TLList*)static_QUType_ptr.get(_o+1)))); break;
    case 2: routeToTl((RouteList)(*((RouteList*)static_QUType_ptr.get(_o+1)))); break;
    case 3: fileNew_(); break;
    case 4: fileOpen_(); break;
    case 5: static_QUType_bool.set(_o,fileSave_()); break;
    case 6: fileSaveAs_(); break;
    case 7: fileClose_(); break;
    case 8: chooseNet_(); break;
    case 9: seeNet_(); break;
    case 10: configRoute_(); break;
    case 11: editDrivers_(); break;
    case 12: helpContents(); break;
    case 13: helpAbout(); break;
    case 14: removeDriver_(); break;
    case 15: removeSensor_(); break;
    case 16: insertDriver_(); break;
    case 17: insertSensor_(); break;
    case 18: driverSelected_((const QString&)static_QUType_QString.get(_o+1)); break;
    case 19: sensorSelected_((const QString&)static_QUType_QString.get(_o+1)); break;
    case 20: showItems_(); break;
    case 21: clearFields_(); break;
    case 22: clearFields_((bool)static_QUType_bool.get(_o+1)); break;
    case 23: listTemplates_(); break;
    case 24: showTemplateStructure_((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 25: driverChanged_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 26: sensorChanged_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 27: agentChanged_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 28: gammaChanged_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 29: tauChanged_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 30: templateChanged_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 31: tableDriverClicked_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 32: tableSensorClicked_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 33: tableTemplateClicked_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+4))); break;
    case 34: removeOption_(); break;
    case 35: addOption_(); break;
    case 36: saveTemplate_(); break;
    case 37: descriptionChanged_(); break;
    case 38: setDriverRoutes_((RouteList)(*((RouteList*)static_QUType_ptr.get(_o+1)))); break;
    case 39: newTemplate_(); break;
    case 40: removeTemplate_(); break;
    case 41: runSimulation_(); break;
    case 42: viewSimulation_(); break;
    case 43: view3D_((QString)static_QUType_QString.get(_o+1)); break;
    case 44: chooseAgentsFile_(); break;
    case 45: createNewNet_(); break;
    case 46: runAgents_(); break;
    case 47: showAgents_((XmlAgentList)(*((XmlAgentList*)static_QUType_ptr.get(_o+1)))); break;
    case 48: addAgent_(); break;
    case 49: listAgentsSelectionChanged_((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 50: removeAgent_(); break;
    case 51: saveAgents_(); break;
    case 52: saveAsAgents_(); break;
    case 53: tableAgentsClicked_((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+4))); break;
    case 54: setNewAgent_((RouteList)(*((RouteList*)static_QUType_ptr.get(_o+1)))); break;
    default:
	return MainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}
Exemple #23
0
QMenus::QMenus(QWidget *parent) 
    : QMainWindow(parent, 0) // QMainWindow's default flag is WType_TopLevel
{
    QAction *action;

    QMenu *file = new QMenu(this);

    action = new QAction(QPixmap((const char**)fileopen), "&Open", this);
    action->setShortcut(tr("CTRL+O"));
    connect(action, SIGNAL(triggered()), this, SLOT(fileOpen()));
    file->addAction(action);

    action = new QAction(QPixmap((const char**)filesave),"&Save", this);
    action->setShortcut(tr("CTRL+S"));
    connect(action, SIGNAL(triggered()), this, SLOT(fileSave()));
    file->addAction(action);

    QMenu *edit = new QMenu(this);

    action = new QAction("&Normal", this);
    action->setShortcut(tr("CTRL+N"));
    action->setToolTip("Normal");
    action->setStatusTip("Toggles Normal");
    action->setCheckable(true);
    connect(action, SIGNAL(triggered()), this, SLOT(editNormal()));
    edit->addAction(action);

    action = new QAction("&Bold", this);
    action->setShortcut(tr("CTRL+B"));
    action->setCheckable(true);
    connect(action, SIGNAL(triggered()), this, SLOT(editBold()));
    edit->addAction(action);

    action = new QAction("&Underline", this);
    action->setShortcut(tr("CTRL+U"));
    action->setCheckable(true);
    connect(action, SIGNAL(triggered()), this, SLOT(editUnderline()));
    edit->addAction(action);

    QMenu *advanced = new QMenu(this);
    action = new QAction("&Font...", this);
    connect(action, SIGNAL(triggered()), this, SLOT(editAdvancedFont()));
    advanced->addAction(action);

    action = new QAction("&Style...", this);
    connect(action, SIGNAL(triggered()), this, SLOT(editAdvancedStyle()));
    advanced->addAction(action);

    edit->addMenu(advanced)->setText("&Advanced");

    edit->addSeparator();

    action = new QAction("Una&vailable", this);
    action->setShortcut(tr("CTRL+V"));
    action->setCheckable(true);
    action->setEnabled(false);
    connect(action, SIGNAL(triggered()), this, SLOT(editUnderline()));
    edit->addAction(action);

    QMenu *help = new QMenu(this);

    action = new QAction("&About...", this);
    action->setShortcut(tr("F1"));
    connect(action, SIGNAL(triggered()), this, SLOT(helpAbout()));
    help->addAction(action);

    action = new QAction("&About Qt...", this);
    connect(action, SIGNAL(triggered()), this, SLOT(helpAboutQt()));
    help->addAction(action);

    if (!QAxFactory::isServer())
        menuBar()->addMenu(file)->setText("&File");
    menuBar()->addMenu(edit)->setText("&Edit");
    menuBar()->addMenu(help)->setText("&Help");

    editor = new QTextEdit(this);
    setCentralWidget(editor);

    statusBar();
}
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;
}
Exemple #25
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());
}
Exemple #26
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();
}
bool MainWindow::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        showProperties((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 1:
        updateProperties((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 2:
        showDialogHelp();
        break;
    case 3:
        showDebugStep((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2));
        break;
    case 4:
        showStackFrame((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2));
        break;
    case 5:
        showErrorMessage((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3));
        break;
    case 6:
        finishedRun();
        break;
    case 7:
        breakPointsChanged();
        break;
    case 8:
        fileNew();
        break;
    case 9:
        fileNewDialog();
        break;
    case 10:
        fileNewFile();
        break;
    case 11:
        fileClose();
        break;
    case 12:
        fileQuit();
        break;
    case 13:
        fileCloseProject();
        break;
    case 14:
        fileOpen();
        break;
    case 15:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2));
        break;
    case 16:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2),(const QString&)static_QUType_QString.get(_o+3));
        break;
    case 17:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(bool)static_QUType_bool.get(_o+4));
        break;
    case 18:
        static_QUType_bool.set(_o,fileSave());
        break;
    case 19:
        static_QUType_bool.set(_o,fileSaveForm());
        break;
    case 20:
        static_QUType_bool.set(_o,fileSaveProject());
        break;
    case 21:
        static_QUType_bool.set(_o,fileSaveAs());
        break;
    case 22:
        fileSaveAll();
        break;
    case 23:
        fileCreateTemplate();
        break;
    case 24:
        editUndo();
        break;
    case 25:
        editRedo();
        break;
    case 26:
        editCut();
        break;
    case 27:
        editCopy();
        break;
    case 28:
        editPaste();
        break;
    case 29:
        editDelete();
        break;
    case 30:
        editSelectAll();
        break;
    case 31:
        editLower();
        break;
    case 32:
        editRaise();
        break;
    case 33:
        editAdjustSize();
        break;
    case 34:
        editLayoutHorizontal();
        break;
    case 35:
        editLayoutVertical();
        break;
    case 36:
        editLayoutHorizontalSplit();
        break;
    case 37:
        editLayoutVerticalSplit();
        break;
    case 38:
        editLayoutGrid();
        break;
    case 39:
        editLayoutContainerHorizontal();
        break;
    case 40:
        editLayoutContainerVertical();
        break;
    case 41:
        editLayoutContainerGrid();
        break;
    case 42:
        editBreakLayout();
        break;
    case 43:
        editAccels();
        break;
    case 44:
        editFunctions();
        break;
    case 45:
        editConnections();
        break;
    case 46:
        static_QUType_ptr.set(_o,editSource());
        break;
    case 47:
        static_QUType_ptr.set(_o,editSource((SourceFile*)static_QUType_ptr.get(_o+1)));
        break;
    case 48:
        static_QUType_ptr.set(_o,openSourceEditor());
        break;
    case 49:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2)));
        break;
    case 50:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)));
        break;
    case 51:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4)));
        break;
    case 52:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4),(bool)static_QUType_bool.get(_o+5)));
        break;
    case 53:
        editFormSettings();
        break;
    case 54:
        editProjectSettings();
        break;
    case 55:
        editPixmapCollection();
        break;
    case 56:
        editDatabaseConnections();
        break;
    case 57:
        editPreferences();
        break;
    case 58:
        projectInsertFile();
        break;
    case 59:
        searchFind();
        break;
    case 60:
        searchIncremetalFindMenu();
        break;
    case 61:
        searchIncremetalFind();
        break;
    case 62:
        searchIncremetalFindNext();
        break;
    case 63:
        searchReplace();
        break;
    case 64:
        searchGotoLine();
        break;
    case 65:
        previewForm();
        break;
    case 66:
        previewForm((const QString&)static_QUType_QString.get(_o+1));
        break;
    case 67:
        toolsCustomWidget();
        break;
    case 68:
        toolsConfigure();
        break;
    case 69:
        helpContents();
        break;
    case 70:
        helpManual();
        break;
    case 71:
        helpAbout();
        break;
    case 72:
        helpAboutQt();
        break;
    case 73:
        helpRegister();
        break;
    case 74:
        activeWindowChanged((QWidget*)static_QUType_ptr.get(_o+1));
        break;
    case 75:
        updateUndoRedo((bool)static_QUType_bool.get(_o+1),(bool)static_QUType_bool.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4));
        break;
    case 76:
        updateEditorUndoRedo();
        break;
    case 77:
        toolSelected((QAction*)static_QUType_ptr.get(_o+1));
        break;
    case 78:
        clipboardChanged();
        break;
    case 79:
        selectionChanged();
        break;
    case 80:
        windowsMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 81:
        setupWindowActions();
        break;
    case 82:
        createNewTemplate();
        break;
    case 83:
        projectSelected((QAction*)static_QUType_ptr.get(_o+1));
        break;
    case 84:
        setupRecentlyFilesMenu();
        break;
    case 85:
        setupRecentlyProjectsMenu();
        break;
    case 86:
        recentlyFilesMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 87:
        recentlyProjectsMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 88:
        emitProjectSignals();
        break;
    case 89:
        showStartDialog();
        break;
    case 90:
        doFunctionsChanged();
        break;
    case 91:
        static_QUType_bool.set(_o,openProjectSettings((Project*)static_QUType_ptr.get(_o+1)));
        break;
    default:
        return QMainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}
Exemple #28
0
RMainWnd::RMainWnd(reditor::REditor* edit) : QMainWindow(), medit(edit)
{
    setWindowTitle(tr("Room Editor"));
    setWindowIcon(QIcon(":/resources/favicon.ico"));
    
    // central widget
    meditWnd = new REditWnd(medit->objects(), medit->camera(), this);
    setCentralWidget(meditWnd);
    
    // set corners for docks
    setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
    setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
    
    // docks
    mloggerDock = new QDockWidget(this);
    mloggerDock->setWindowTitle(tr("Editor Log"));
    mlogger = new RLogger(mloggerDock);
    mloggerDock->setWidget(mlogger);
    addDockWidget(Qt::BottomDockWidgetArea, mloggerDock);
    // TODO attach dock window with objects on the scene
    
    // File menu
    QMenu* fileMenu = menuBar()->addMenu(tr("&File"));
    QAction* newAction = fileMenu->addAction(tr("&New Project"), this, SIGNAL(newProject()), QKeySequence::New);
    newAction->setIcon(QIcon(":/resources/new.png"));
    QAction* openAction = fileMenu->addAction(tr("&Open Project.."), this, SIGNAL(openProject()), QKeySequence::Open);
    openAction->setIcon(QIcon(":/resources/open.png"));
    fileMenu->addSeparator();
    msaveAction = fileMenu->addAction(tr("&Save Project"), this, SIGNAL(saveProject()), QKeySequence::Save);
    msaveAction->setIcon(QIcon(":/resources/save.png"));
    msaveAsAction = fileMenu->addAction(tr("S&ave Project As..."), this, SIGNAL(saveProjectAs()), Qt::SHIFT + Qt::CTRL + Qt::Key_S);
    msaveAsAction->setIcon(QIcon(":/resources/saveAs.png"));
    enableSave(false); // activate after user makes some changes, no sense to save empty project
    fileMenu->addSeparator();
    fileMenu->addAction(tr("&Exit.."), this, SLOT(close()), QKeySequence::Quit);
    
    // Help menu
    QMenu* helpMenu = menuBar()->addMenu(tr("&Help"));
    helpMenu->addAction(tr("&About RoomEdit"), this, SIGNAL(helpAbout()));
    
    // File toolbar
    QToolBar* fileToolBar = addToolBar(tr("File"));
    fileToolBar->addAction(newAction);
    fileToolBar->addAction(openAction);
    fileToolBar->addSeparator();
    fileToolBar->addAction(msaveAction);
    fileToolBar->addAction(msaveAsAction);
    
    // Camera view toolbar
    QToolBar* cameraToolBar = addToolBar(tr("Camera"));
    mcameraGroup = new QButtonGroup(cameraToolBar);
    QPushButton * cam1 = new QPushButton(QString("1"), this);
    QPushButton * cam2 = new QPushButton(QString("2"), this);
    QPushButton * cam3 = new QPushButton(QString("3"), this);
    cam1->setCheckable(true);
    cam2->setCheckable(true);
    cam3->setCheckable(true);
    cam1->setChecked(true);
    mcameraGroup->addButton(cam1, 1);
    mcameraGroup->addButton(cam2, 2);
    mcameraGroup->addButton(cam3, 3);
    mcameraGroup->setExclusive(true);
    connect(mcameraGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(switchCamera(int)));
    cameraToolBar->addWidget(cam1);
    cameraToolBar->addWidget(cam2);
    cameraToolBar->addWidget(cam3);
}
Exemple #29
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);
}
Exemple #30
0
WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags) : QMainWindow(parent) {
	setupUi(this);

#ifdef CONFIG_NATIVE_WINDOWS
	fileStopServiceAction = new QAction(this);
	fileStopServiceAction->setObjectName("Stop Service");
	fileStopServiceAction->setIconText(tr("Stop Service"));
	fileMenu->insertAction(actionWPS, fileStopServiceAction);

	fileStartServiceAction = new QAction(this);
	fileStartServiceAction->setObjectName("Start Service");
	fileStartServiceAction->setIconText(tr("Start Service"));
	fileMenu->insertAction(fileStopServiceAction, fileStartServiceAction);

	connect(fileStartServiceAction, SIGNAL(triggered()), this,
		SLOT(startService()));
	connect(fileStopServiceAction, SIGNAL(triggered()), this,
		SLOT(stopService()));

	addInterfaceAction = new QAction(this);
	addInterfaceAction->setIconText(tr("Add Interface"));
	fileMenu->insertAction(fileStartServiceAction, addInterfaceAction);

	connect(addInterfaceAction, SIGNAL(triggered()), this,
		SLOT(addInterface()));
#endif /* CONFIG_NATIVE_WINDOWS */

//	(void) statusBar();

	/*
	 * Disable WPS tab by default; it will be enabled if wpa_supplicant is
	 * built with WPS support.
	 */
	wpsTab->setEnabled(false);
	wpaguiTab->setTabEnabled(wpaguiTab->indexOf(wpsTab), false);

	connect(fileEventHistoryAction, SIGNAL(triggered()), this,
		SLOT(eventHistory()));
	connect(fileSaveConfigAction, SIGNAL(triggered()), this,
		SLOT(saveConfig()));
	connect(actionWPS, SIGNAL(triggered()), this, SLOT(wpsDialog()));
	connect(actionPeers, SIGNAL(triggered()), this, SLOT(peersDialog()));
	connect(fileExitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
	connect(networkAddAction, SIGNAL(triggered()), this,
		SLOT(addNetwork()));
	connect(networkEditAction, SIGNAL(triggered()), this,
		SLOT(editSelectedNetwork()));
	connect(networkRemoveAction, SIGNAL(triggered()), this,
		SLOT(removeSelectedNetwork()));
	connect(networkEnableAllAction, SIGNAL(triggered()), this,
		SLOT(enableAllNetworks()));
	connect(networkDisableAllAction, SIGNAL(triggered()), this,
		SLOT(disableAllNetworks()));
	connect(networkRemoveAllAction, SIGNAL(triggered()), this,
		SLOT(removeAllNetworks()));
	connect(helpIndexAction, SIGNAL(triggered()), this, SLOT(helpIndex()));
	connect(helpContentsAction, SIGNAL(triggered()), this,
		SLOT(helpContents()));
	connect(helpAboutAction, SIGNAL(triggered()), this, SLOT(helpAbout()));
	connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnect()));
	connect(scanButton, SIGNAL(clicked()), this, SLOT(scan()));
	connect(connectButton, SIGNAL(clicked()), this, SLOT(connectB()));
	connect(adapterSelect, SIGNAL(activated(const QString&)), this,
		SLOT(selectAdapter(const QString&)));
	connect(networkSelect, SIGNAL(activated(const QString&)), this,
		SLOT(selectNetwork(const QString&)));
	connect(addNetworkButton, SIGNAL(clicked()), this, SLOT(addNetwork()));
	connect(editNetworkButton, SIGNAL(clicked()), this,
		SLOT(editListedNetwork()));
	connect(removeNetworkButton, SIGNAL(clicked()), this,
		SLOT(removeListedNetwork()));
	connect(networkList, SIGNAL(itemSelectionChanged()), this,
		SLOT(updateNetworkDisabledStatus()));
	connect(enableRadioButton, SIGNAL(toggled(bool)), this,
		SLOT(enableListedNetwork(bool)));
	connect(disableRadioButton, SIGNAL(toggled(bool)), this,
		SLOT(disableListedNetwork(bool)));
	connect(scanNetworkButton, SIGNAL(clicked()), this, SLOT(scan()));
	connect(networkList, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
		this, SLOT(editListedNetwork()));
	connect(wpaguiTab, SIGNAL(currentChanged(int)), this,
		SLOT(tabChanged(int)));
	connect(wpsPbcButton, SIGNAL(clicked()), this, SLOT(wpsPbc()));
	connect(wpsPinButton, SIGNAL(clicked()), this, SLOT(wpsGeneratePin()));
	connect(wpsApPinEdit, SIGNAL(textChanged(const QString &)), this,
		SLOT(wpsApPinChanged(const QString &)));
	connect(wpsApPinButton, SIGNAL(clicked()), this, SLOT(wpsApPin()));

	eh = NULL;
	scanres = NULL;
	peers = NULL;
	add_iface = NULL;
	udr = NULL;
	tray_icon = NULL;
	startInTray = false;
	ctrl_iface = NULL;
	ctrl_conn = NULL;
	monitor_conn = NULL;
	msgNotifier = NULL;
	ctrl_iface_dir = strdup("/var/run/wpa_supplicant");

//	parse_argv();

#ifndef QT_NO_SESSIONMANAGER
//	if (app->isSessionRestored()) {
//		QSettings settings("wpa_supplicant", "wpa_gui");
//		settings.beginGroup("state");
//		if (app->sessionId().compare(settings.value("session_id").
//					     toString()) == 0)
//			startInTray = settings.value("in_tray").toBool();
//		settings.endGroup();
//	}
#endif

	if (QSystemTrayIcon::isSystemTrayAvailable())
		createTrayIcon(startInTray);
	else
		show();

	connectedToService = false;
	textStatus->setText(tr("connecting to wpa_supplicant"));
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), SLOT(ping()));
	timer->setSingleShot(FALSE);
	timer->start(1000);

	if (openCtrlConnection(ctrl_iface) < 0) {
		printf("Failed to open control connection to "
		       "wpa_supplicant.\n");
	}

	updateStatus();
	networkMayHaveChanged = true;
	updateNetworks();
}