Пример #1
0
WBBrowserWindow::WBBrowserWindow(QWidget *parent, Ui::MainWindow* uniboardMainWindow, bool isViewerWebInstance)
        : QWidget(parent)
        , mWebToolBar(0)
        , mSearchToolBar(0)
        , mTabWidget(new WBTabWidget(this))
        , mSearchAction(0)
        , mUniboardMainWindow(uniboardMainWindow)
{
    QWebSettings *defaultSettings = QWebSettings::globalSettings();
    defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
    defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true);

    setupMenu();
    if(!isViewerWebInstance)
        setupToolBar();
    else{
        setupToolBarForTutorial();
    }

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setSpacing(0);
    layout->setMargin(0);

    layout->addWidget(mTabWidget);

    this->setLayout(layout);

    connect(mTabWidget, SIGNAL(loadPage(const QString &)), this, SLOT(loadPage(const QString &)));


    connect(mTabWidget, SIGNAL(setCurrentTitle(const QString &)), this, SLOT(slotUpdateWindowTitle(const QString &)));

    if (!isViewerWebInstance) {
        connect(mTabWidget, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int)));
    }
Пример #2
0
void iAFiAKErModuleInterface::startFiAKEr()
{
	setupToolBar();
	QString path = QFileDialog::getExistingDirectory(m_mainWnd, "Choose Folder containing Result csv", m_mainWnd->getPath());
	if (path.isEmpty())
		return;
	
	auto explorer = new iAFiAKErController(m_mainWnd);
	QStringList parameterNames = QStringList() << "+CSV Format" << "#Step Coordinate Shift";
	QStringList formatEntries = iACsvConfig::getListFromRegistry();
	if (!formatEntries.contains(iAFiberResultsCollection::SimpleFormat))
		formatEntries.append(iAFiberResultsCollection::SimpleFormat);
	if (!formatEntries.contains(iAFiberResultsCollection::LegacyFormat))
		formatEntries.append(iAFiberResultsCollection::LegacyFormat);
	if (!formatEntries.contains(iACsvConfig::LegacyFiberFormat))
		formatEntries.append(iACsvConfig::LegacyFiberFormat);
	if (!formatEntries.contains(iACsvConfig::LegacyVoidFormat))
		formatEntries.append(iACsvConfig::LegacyVoidFormat);
	QList<QVariant> values;
	values << formatEntries << 0;
	dlg_commoninput dlg(m_mainWnd, "Choose CSV Format", parameterNames, values);
	if (dlg.exec() != QDialog::Accepted)
		return;
	QString configName = dlg.getComboBoxValue(0);
	double stepShift = dlg.getDblValue(1);
	//cmbbox_Format->addItems(formatEntries);
	m_mainWnd->addSubWindow(explorer);
	explorer->start(path, configName, stepShift);
}
Пример #3
0
MainWindow::MainWindow(ScriptEnvironment *env, QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	d = new MainWindowPrivate;
	d->pagesActionGroup = new QActionGroup( this );
	d->message = new Message();
	connect(qApp, SIGNAL(showMessage(QString,QString,QString)), d->message, SLOT(showMessage(QString,QString,QString)));
	d->env = env;

	//setAttribute(Qt::WA_DeleteOnClose, true);

	// Restore size and position
	QSettings settings;
	resize(settings.value("Size", size()).toSize());
	move(settings.value("Pos", pos()).toPoint());

	statusBar()->setSizeGripEnabled(true);
	setupMenu();

	QWidget *centralWidget = new QWidget(this);
	QVBoxLayout *layout = new QVBoxLayout;
	centralWidget->setLayout(layout);

	layout->addWidget(d->message);

	d->stackedLayout = new QStackedLayout;
	layout->addLayout(d->stackedLayout);

	setCentralWidget(centralWidget);

	setupToolBar();

	setWindowTitle( tr("TelldusCenter") );
}
Пример #4
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)

{
    /* Window Title */
    setWindowTitle(tr(APPLICATION_NAME));

    /* Set sticky places for dockwidgets */
    setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
    setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
    setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);

    /*
     * Create Mastercontroller (zone -1)
     * Controls all zones on all bridges.
     */
    master = new SingleController("Master", -1, this);
    masterDockWidget = new QDockWidget(tr("Master Controller"), this);
    masterDockWidget->setWidget(master);
    masterDockWidget->setMaximumWidth(200);
    addDockWidget(Qt::TopDockWidgetArea, masterDockWidget);

    /* Audio Controller */
    audio = new audioController(this);
    addDockWidget(Qt::TopDockWidgetArea, audio);

    /* Connect Audio to Master .*/
    connect(audio, SIGNAL(setRandomSame()), master, SLOT(setRandomExt()));
    connect(audio, SIGNAL(flash()), master, SLOT(flash()));
    connect(audio, SIGNAL(flashRandom()), master, SLOT(flashRandom()));
    connect(audio, SIGNAL(fade10()), master, SLOT(fade10Ext()));
    connect(audio, SIGNAL(fade20()), master, SLOT(fade20Ext()));

    presetController = new PresetController(this);
    presetController->setMinimumWidth(230);
    addDockWidget(Qt::TopDockWidgetArea, presetController);
    connect(presetController, SIGNAL(createPreset()), this, SLOT(getPreset()));
    connect(this, SIGNAL(presetAvailable(Preset*)), presetController, SLOT(addPreset(Preset*)));
    connect(presetController, SIGNAL(setPreset(Preset*)), this, SLOT(setPreset(Preset*)));

    /* Center the window. */
    QWidget *w = window();
    w->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, w->size(), qApp->desktop()->availableGeometry()));

    /* Create Bridge Discovery Dialog. */
    MiLightDiscover *d = new MiLightDiscover(this);
    connect(d, SIGNAL(selectedDevices(QStringList, bool)), this, SLOT(setupControllers(QStringList, bool)));
    d->exec();

    setupActions();
    setupToolBar();
    setupMenuBar();
    setupStatusBar();

    loadSettings();

    delete d;

}
Пример #5
0
////////////////////////////////////////////////////////////////////////////////
/// IGNATView::getToolBar
///
/// @description         This function returns a pointer to the view specific
///                      toolbar.
/// @pre                 None
/// @post                None
///
/// @return QToolBar *:  This is a pointer to the toolbar specific to the view.
///
/// @limitations         None
///
////////////////////////////////////////////////////////////////////////////////
QToolBar * IGNATView::getToolBar()
{
    //Set up the toolbar if one has not yet been initialized.
    if( m_toolBar == NULL )
        setupToolBar();

    return m_toolBar;
}
Пример #6
0
qavimator::qavimator(yarp::os::ResourceFinder &config, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::qavimator)
{
    ui->setupUi(this);
    setupToolBar();
    ui->animationView->init(config);
    nFPS=10;

    width=850;
    height=600;


    readSettings();
    // default size

    if (config.check("name")) {
        GUI_NAME=std::string(config.find("name").asString().c_str());
    }
    if (GUI_NAME[0]!='/') {
        GUI_NAME=std::string("/")+GUI_NAME;
    }
    if (config.check("width")) {
        width=config.find("width").asInt();
    }
    if (config.check("height")) {
        height=config.find("height").asInt();
    }

    //sanity check
    if(width<100) {
        width=100;
    }
    if(height<100) {
        height=100;
    }

    this->resize(width, height);

    int xpos=32,ypos=32;
    if (config.check("xpos")) {
        xpos=config.find("xpos").asInt();
    }
    if (config.check("ypos")) {
        ypos=config.find("ypos").asInt();
    }
    this->move(xpos,ypos);

    setWindowTitle(GUI_NAME.c_str());

    connect(ui->animationView,SIGNAL(backgroundClicked()),this,SLOT(backgroundClicked()));
    connect(this,SIGNAL(resetCamera()),ui->animationView,SLOT(resetCamera()));

    ui->animationView->startTimer(1000/nFPS);


}
Пример #7
0
TDDSuiteLayer::TDDSuiteLayer()
: mEditFilter(NULL)
{
	LayerColor *bgLayer = LayerColor::create(Color4B::WHITE, 800, 400);
	addChild(bgLayer);
	
	setupTestMenu();
	setupToolBar();
	
	
}
Пример #8
0
AleatoriedadWidget::AleatoriedadWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AleatoriedadWidget)
{
    ui->setupUi(this);
    esconder(2);

    setupAction();

    createMenus();

    setupToolBar();
}
Пример #9
0
DownloadTab::DownloadTab()
{
    m_layout = new QVBoxLayout(this);
    m_layout->setMargin(0);
    m_layout->setSpacing(0);

    setupToolBar();

    m_view = new DownloadView(this);
    m_layout->addWidget(m_view, 1);

    connect(m_searchEdit, SIGNAL(textChanged(const QString &)),
            m_view->model(), SLOT(setFilterFixedString(const QString &)));
}
Пример #10
0
void QlixMainWindow::DeviceSelected(QMtpDevice* in_device)
{
  setupStatusBar();
  _deviceChooser->hide();
  //TODO this is not such a great idea..
  // _watchDog->quit();
  _currentDevice = in_device;

  _deviceExplorer = new DeviceExplorer(in_device, this);
  _deviceExplorer->SetProgressBar(_progressBar);
  setupToolBar();
  setupActions();
  setupConnections();
  setCentralWidget(_deviceExplorer);
  _deviceExplorer->setContentsMargins(0,-10,0,0);
  _albumlistAction->trigger();
}
Пример #11
0
MainWindow::MainWindow(const QMap<QString, QSize> &customSizeHints,
                        QWidget *parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags)
{
    setObjectName("MainWindow");
    setWindowTitle("Qt Main Window Demo");

    center = new QTextEdit(this);
    center->setReadOnly(true);
    center->setMinimumSize(400, 205);
    setCentralWidget(center);

    setupToolBar();
    setupMenuBar();
    setupDockWidgets(customSizeHints);

    statusBar()->showMessage(tr("Status Bar"));
}
Пример #12
0
PreferencesDialog::PreferencesDialog(QWidget* parent)
: QDialog(parent) {

    pagesWidget_ = new QStackedWidget;
    pagesWidget_->addWidget(getGeneralPage());
    pagesWidget_->addWidget(getCfgPage("microscope"));
    pagesWidget_->addWidget(getCfgPage("system"));
    pagesWidget_->addWidget(getCfgPage("software"));
    pagesWidget_->addWidget(getCfgPage("status"));
    pagesWidget_->addWidget(getCfgPage("viewer"));
    pagesWidget_->addWidget(getFontsPage());
    pagesWidget_->setCurrentIndex(0);

    QPushButton *closeButton = new QPushButton(tr("Close"));
    connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close);
    
    QHBoxLayout *buttonsLayout = new QHBoxLayout;
    buttonsLayout->setMargin(10);
    buttonsLayout->addStretch(1);
    buttonsLayout->addWidget(closeButton);
    
    QFrame* hLine = new QFrame(this);
    hLine->setFrameStyle(QFrame::HLine | QFrame::Sunken);
    
    QVBoxLayout *verticalLayout = new QVBoxLayout;
    verticalLayout->setMargin(0);
    verticalLayout->setSpacing(0);
    verticalLayout->addStretch(0);
    verticalLayout->addWidget(setupToolBar(), 0);
    verticalLayout->addWidget(hLine, 0);
    verticalLayout->addWidget(pagesWidget_, 1);
    verticalLayout->addSpacing(12);
    verticalLayout->addLayout(buttonsLayout, 0);
    
    setLayout(verticalLayout);

    setWindowTitle(tr("Preferences"));
    setModal(true);
    resize(650, 600);
}
Пример #13
0
frmDebugger::frmDebugger(frmMain *parent, const wxString &title)
	: pgFrame(NULL, title),
	  m_standaloneDebugger(NULL),
	  m_standaloneDirectDbg(NULL),
	  m_parent(parent)
{
	dlgName = wxT("frmDebugger");
	RestorePosition(100, 100, 600, 500, 450, 300);

	wxWindowBase::SetFont(settings->GetSystemFont());

	manager.SetManagedWindow(this);
	manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_TRANSPARENT_DRAG);

	// Define the icon for this window
	SetIcon(*debugger_png_ico);

	// Create (and configure) the menu bar, toolbar, and status bar
	m_menuBar   = setupMenuBar();
	m_toolBar   = setupToolBar();
	m_statusBar = setupStatusBar();

	manager.AddPane(m_toolBar, wxAuiPaneInfo().Name(wxT("toolBar")).Caption(wxT("Toolbar")).ToolbarPane().Top().Row(1).Position(1).LeftDockable(false).RightDockable(false));

	// Now load the layout
	wxString perspective;
	settings->Read(wxT("Debugger/frmDebugger/Perspective-") + wxString(FRMDEBUGGER_PERSPECTIVE_VER), &perspective, FRMDEBUGGER_DEFAULT_PERSPECTIVE);
	manager.LoadPerspective(perspective, true);

	// and reset the captions for the current language
	manager.GetPane(wxT("toolBar")).Caption(_("Toolbar"));

	// Sync the View menu options
	m_viewMenu->Check(MENU_ID_VIEW_TOOLBAR, manager.GetPane(wxT("toolBar")).IsShown());

	manager.Update();

}
Пример #14
0
TDDSuiteLayer::TDDSuiteLayer()
    : mEditFilter(NULL)
    , mStatusLeftLabel(NULL)
    , mFilterCount(0)
    , mMode(TDDMenuModeAll)
    , mClearMenu(NULL)
{
    Size screenSize = TDDHelper::getScreenSize();
    log("DEBUG: screenSize: %f, %f", screenSize.width, screenSize.height );
    LayerColor *bgLayer = LayerColor::create(Color4B(TDD_COLOR_WHITE2),
                          screenSize.width, screenSize.height );
    addChild(bgLayer);

    // Top bar with: back, filter and all/history
    setupToolBar();

    // Status
    setupStatusBar();

    // Menu
    setupTestMenu();

    //this->setVisible(true);
}
Пример #15
0
MazeWindow::MazeWindow() {
  init();
  createActions();
  setupToolBar();
  resize(1000,800);
}
Пример #16
0
void iAFiAKErModuleInterface::loadFiAKErProject()
{
	setupToolBar();
	iAFiAKErController::loadAnalysis(m_mainWnd, m_mainWnd->getPath());
}
Пример #17
0
TupMainWindow::TupMainWindow(TupSplash *splash, int parameters) : 
              TabbedMainWindow(), m_projectManager(0), drawingTab(0), animationTab(0), 
              m_viewChat(0), m_exposureSheet(0), m_scenes(0), isSaveDialogOpen(false), internetOn(false)
{
    #ifdef K_DEBUG
           TINIT;
    #endif

    // Loading audio player plugin
    // TAudioPlayer::instance()->loadEngine("gstreamer"); // FIXME: Move this to the settings 
    setObjectName("TupMainWindow_");

    // Defining the status bar
    m_statusBar = new TupStatusBar(this);
    setStatusBar(m_statusBar);

    // Naming the main frame...
    setWindowTitle(tr("Tupi: Open 2D Magic"));
    setWindowIcon(QIcon(THEME_DIR + "icons/about.png"));

    // Defining the render type for the drawings
    m_renderType = Tupi::RenderType(TCONFIG->value("RenderType").toInt());

    // Calling out the project manager
    m_projectManager = new TupProjectManager(this);

    splash->setMessage(tr("Setting up the project manager"));
    SleeperThread::msleep(500);

    // Calling out the events/actions manager
    splash->setMessage(tr("Loading action manager..."));
    m_actionManager = new TActionManager(this);

    // Defining the menu bar
    splash->setMessage(tr("Creating menu bar..."));
    SleeperThread::msleep(500);

    setupActions();
	
    splash->setMessage(tr("Creating GUI..."));
    SleeperThread::msleep(500);
	
    // Setting up all the GUI...
    createGUI(); // This method is called from the tupmainwindow_gui class
    setupMenu();
    setupToolBar();

    // Check if user wants to see a Tupi tip for every time he launches the program
    TCONFIG->beginGroup("TipOfDay");
    //bool showTips = qvariant_cast<bool>(TCONFIG->value("ShowOnStart", true));
    bool showTips = TCONFIG->value("ShowOnStart", true).toBool();

    // If option is enabled, then, show a little dialog with a nice tip
    if (showTips)
        QTimer::singleShot(0, this, SLOT(showTipDialog()));

    // Time to load plugins... 
    TupPluginManager::instance()->loadPlugins();

    // Defining the Animation view, as the first interface to show up	
    setCurrentPerspective(Animation);

    TCONFIG->beginGroup("General");
    // check if into the config file, user always wants to start opening his last project 
    // created
    bool openLast = TCONFIG->value("OpenLastProject").toBool();

    if (openLast && parameters == 1)
        openProject(TCONFIG->value("LastProject").toString());

    if (TCONFIG->firstTime()) {
        TCONFIG->setValue("OpenLastProject", openLast);
        TCONFIG->setValue("AutoSave", 2);
    }

    TupMainWindow::requestType = None;
    lastSave = false;
}