コード例 #1
0
ファイル: gamuzaMain.cpp プロジェクト: carlesgutierrez/GAmuza
//--------------------------------------------------------------
void gamuzaMain::keyReleased(int key){

	bool alt = gamuzaKmap.isAltDown();

	// fullscreen toggle
	if(alt && (key == 'f' || key == 'F')){
		gamuzaFullscreen();
	}

	// LIVE CODING
	if(alt && (key == 'j' || key == 'J')){
		liveCodingMode = !liveCodingMode;
	}

	// show/hide script code
	if(alt && (key == 'w' || key == 'W')){
		viewCode = !viewCode;
	}

	// open file dialog
	if(alt && (key == 'd' || key == 'D')){
		openFileDialog();
	}

	// save frame
	if(alt && (key == 'o' || key == 'O')){
		saveFrame();
	}

	// print frame
	if(alt && (key == 'p' || key == 'P')){
		printFrame();
	}

}
コード例 #2
0
ファイル: pythoneditorwidget.cpp プロジェクト: Ojaswi/inviwo
void PythonEditorWidget::open() {
    if (unsavedChanges_) {
        int ret =
            QMessageBox::information(this, "Python Editor", "Do you want to save unsaved changes?",
                                     "Save", "Discard", "Cancel");

        if (ret == 0) save();

        if (ret == 2)  // Cancel
            return;
    }

    InviwoFileDialog openFileDialog(this, "Open Python Script ...", "script");

    openFileDialog.setFileMode(QFileDialog::AnyFile);

    openFileDialog.addSidebarPath(InviwoApplication::PATH_SCRIPTS);

    openFileDialog.addExtension("py", "Python Script");

    if (openFileDialog.exec()) {
        stopFileObservation(scriptFileName_);
        scriptFileName_ = openFileDialog.selectedFiles().at(0).toLocal8Bit().constData();
        settings_.beginGroup("PythonEditor");
        settings_.setValue("lastScript", scriptFileName_.c_str());
        settings_.endGroup();
        startFileObservation(scriptFileName_);
        readFile();
    }
}
コード例 #3
0
QWidget * ExtcapArgumentFileSelection::createEditor(QWidget * parent)
{
    QWidget * fileWidget = new QWidget(parent);
    QHBoxLayout * editLayout = new QHBoxLayout();
    QMargins margins = editLayout->contentsMargins();
    editLayout->setContentsMargins(0, 0, 0, margins.bottom());
    fileWidget->setContentsMargins(margins.left(), margins.right(), 0, margins.bottom());
    QPushButton * button = new QPushButton(UTF8_HORIZONTAL_ELLIPSIS, fileWidget);

    textBox = new QLineEdit(_default->toString(), parent);
    textBox->setReadOnly(true);

    if ( _argument->default_complex != NULL && _argument->arg_type == EXTCAP_ARG_STRING )
        textBox->setText(QString().fromUtf8(extcap_complex_get_string(_argument->default_complex)));

    if ( _argument->tooltip != NULL )
    {
        textBox->setToolTip(QString().fromUtf8(_argument->tooltip));
        button->setToolTip(QString().fromUtf8(_argument->tooltip));
    }


    connect(button, SIGNAL(clicked()), (QObject *)this, SLOT(openFileDialog()));

    editLayout->addWidget(textBox);
    editLayout->addWidget(button);

    fileWidget->setLayout(editLayout);

    return fileWidget;
}
コード例 #4
0
ファイル: MainFrame.cpp プロジェクト: Thales1330/PSP
void MainFrame::OnOpenClick(wxRibbonButtonBarEvent& event)
{
    wxFileDialog openFileDialog(this, _("Open PSP file"), "", "", "PSP files (*.psp)|*.psp",
                                wxFD_OPEN | wxFD_FILE_MUST_EXIST);
    if(openFileDialog.ShowModal() == wxID_CANCEL) return;

    wxFileName fileName(openFileDialog.GetPath());

    EnableCurrentProjectRibbon();
    Workspace* newWorkspace = new Workspace(this, _("Open project"), this->GetStatusBar(), m_sharedGLContext);
    if(!m_sharedGLContext) m_sharedGLContext = newWorkspace->GetOpenGLContext();

    FileHanding fileHandling(newWorkspace);
    if(fileHandling.OpenProject(fileName)) {
        newWorkspace->SetSavedPath(fileName);

        m_workspaceList.push_back(newWorkspace);

        m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_DISABLESOL, true);
        m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_ENABLESOL, false);

        m_auiNotebook->AddPage(newWorkspace, newWorkspace->GetName(), true);
        m_auiNotebook->Layout();
        newWorkspace->Redraw();
        newWorkspace->SetJustOpened(true);
        newWorkspace->Fit();
        m_projectNumber++;
    } else {
        wxMessageDialog msgDialog(this, _("It was not possible to open the selected file."), _("Error"),
                                  wxOK | wxCENTRE | wxICON_ERROR);
        msgDialog.ShowModal();
        delete newWorkspace;
    }
}
コード例 #5
0
ファイル: uat_delegate.cpp プロジェクト: crondaemon/wireshark
bool UatDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
{
    uat_field_t *field = indexToField(index);

    switch (field->mode) {
    case PT_TXTMOD_DIRECTORYNAME:
    case PT_TXTMOD_FILENAME:
        if (event && (event->type() == QEvent::MouseButtonRelease ||
                    event->type() == QEvent::MouseButtonDblClick)) {
            // Ignore these mouse events, only handle MouseButtonPress.
            return false;
        }
        if (index.isValid()) {
            QString filename_old = model->data(index, Qt::EditRole).toString();
            QString filename = openFileDialog(field, filename_old);
            // TODO should this overwrite only when !filename.isEmpty()?
            model->setData(index, filename, Qt::EditRole);
        }
        // returns false to ensure that QAbstractItemView::edit does not assume
        // the editing state. This causes the view's currentIndex to be changed
        // to the cell where this delegate was "created", as desired.
        return false;

    default:
        return QStyledItemDelegate::editorEvent(event, model, option, index);
    }
}
コード例 #6
0
ファイル: menus.cpp プロジェクト: Kafay/vlc
void QVLCMenu::PopupMenuStaticEntries( QMenu *menu )
{
    QMenu *openmenu = new QMenu( qtr( "Open Media" ), menu );
    addDPStaticEntry( openmenu, qtr( "&Open File..." ),
        ":/type/file-asym", SLOT( openFileDialog() ) );
    addDPStaticEntry( openmenu, qtr( I_OPEN_FOLDER ),
        ":/type/folder-grey", SLOT( PLOpenDir() ) );
    addDPStaticEntry( openmenu, qtr( "Open &Disc..." ),
        ":/type/disc", SLOT( openDiscDialog() ) );
    addDPStaticEntry( openmenu, qtr( "Open &Network..." ),
        ":/type/network", SLOT( openNetDialog() ) );
    addDPStaticEntry( openmenu, qtr( "Open &Capture Device..." ),
        ":/type/capture-card", SLOT( openCaptureDialog() ) );
    menu->addMenu( openmenu );

    menu->addSeparator();
#if 0
    QMenu *helpmenu = HelpMenu( menu );
    helpmenu->setTitle( qtr( "Help" ) );
    menu->addMenu( helpmenu );
#endif

    addDPStaticEntry( menu, qtr( "Quit" ), ":/menu/quit",
                      SLOT( quit() ), "Ctrl+Q" );
}
コード例 #7
0
ファイル: menus.cpp プロジェクト: BloodExecutioner/vlc
/**
 * Media ( File ) Menu
 * Opening, streaming and quit
 **/
QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QWidget *parent, MainInterface *mi )
{
    QMenu *menu = new QMenu( parent );
    QAction *action;

    addDPStaticEntry( menu, qtr( "Open &File..." ),
        ":/type/file-asym", SLOT( simpleOpenDialog() ), "Ctrl+O" );
    addDPStaticEntry( menu, qtr( I_OP_OPDIR ),
        ":/type/folder-grey", SLOT( PLOpenDir() ), "Ctrl+F" );
    addDPStaticEntry( menu, qtr( "Open &Disc..." ),
        ":/type/disc", SLOT( openDiscDialog() ), "Ctrl+D" );
    addDPStaticEntry( menu, qtr( "Open &Network Stream..." ),
        ":/type/network", SLOT( openNetDialog() ), "Ctrl+N" );
    addDPStaticEntry( menu, qtr( "Open &Capture Device..." ),
        ":/type/capture-card", SLOT( openCaptureDialog() ), "Ctrl+C" );

    menu->addSeparator();

    addDPStaticEntry( menu, qtr( "&Open (advanced)..." ),
        ":/type/file-asym", SLOT( openFileDialog() ), "Ctrl+Shift+O" );
    menu->addSeparator();

    addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
                      NULL, SLOT( openUrlDialog() ), "Ctrl+V" );

    if( var_InheritBool( p_intf, "qt-recentplay" ) )
    {
        recentsMenu = new QMenu( qtr( "Open &Recent Media" ), menu );
        updateRecents( p_intf );
        menu->addMenu( recentsMenu );
    }
    menu->addSeparator();

    addDPStaticEntry( menu, qtr( I_PL_SAVE ), "", SLOT( saveAPlaylist() ),
        "Ctrl+Y" );
    menu->addSeparator();

#ifdef ENABLE_SOUT
    addDPStaticEntry( menu, qtr( "Conve&rt / Save..." ), "",
        SLOT( openAndTranscodingDialogs() ), "Ctrl+R" );
    addDPStaticEntry( menu, qtr( "&Stream..." ),
        ":/menu/stream", SLOT( openAndStreamingDialogs() ), "Ctrl+S" );
    menu->addSeparator();
#endif

    action = addMIMStaticEntry( p_intf, menu, qtr( "Quit at the end of playlist" ), "",
                               SLOT( activatePlayQuit( bool ) ) );
    action->setCheckable( true );
    action->setChecked( THEMIM->getPlayExitState() );

    if( mi->getSysTray() )
    {
        action = menu->addAction( qtr( "Close to systray"), mi,
                                 SLOT( toggleUpdateSystrayMenu() ) );
    }

    addDPStaticEntry( menu, qtr( "&Quit" ) ,
        ":/menu/quit", SLOT( quit() ), "Ctrl+Q" );
    return menu;
}
コード例 #8
0
ファイル: ZomFrame.cpp プロジェクト: elifnaz/ZombieSim
void ZomFrame::OnLoadSurvivor(wxCommandEvent& event)
{
    
    try
    {
        wxFileDialog openFileDialog(this, _("Open a ZOM file"), "", "./zom",
                                    "ZOM Files|*.zom", wxFD_OPEN|wxFD_FILE_MUST_EXIST);
        if (openFileDialog.ShowModal() == wxID_CANCEL)
        {
            return;
        }
        std::string fileName = openFileDialog.GetPath().ToStdString();
        humanMachine.LoadMachine(fileName);
        mPanel->mHumanProgram = fileName.substr(fileName.find_last_of('/') + 1);
        World::get().setDrawPanel(mPanel);
        
        if (mZombieLoaded)
        {
            mSimMenu->Enable(ID_SImSTART, true);
            mSimMenu->Enable(ID_RESET, true);
            mSimMenu->Enable(ID_RANDOMIZE, true);
            
        }
        mHumanLoaded = true;
        mPanel->PaintNow();
        
        
    }
    catch (FileLoadExcept exception)
    {
        wxMessageBox("ZOM file is invalid", "Error", wxOK | wxICON_ERROR);
    }
    
}
コード例 #9
0
void MainWindow::on_actionExport_to_PGN_triggered()
{
    QFileDialog openFileDialog(this);
    openFileDialog.exec();
    openFileDialog.setFilter("*.pgn");

    if(openFileDialog.result() == QDialog::Accepted)
    {
        if(openFileDialog.selectedFiles().size() == 0)
        {
            return;
        }

        vector<int> ids;

        for(int i = 0; i < _gamesModel->rowCount(); ++i)
        {
            QModelIndex selectedElement = _gamesModel->index(i, 0);
            QString text = _gamesModel->data(
                        _gamesModel->index(selectedElement.row(), 0)).toString();
            ids.push_back(text.toInt());
        }

        PGNExporter exporter;

        QProgressDialog progressDialog(QString("Import"), "", 0, 100);

        connect(&exporter, SIGNAL(onProgress(int)), &progressDialog, SLOT(setValue(int)));
        exporter.exportToFile(ids, openFileDialog.selectedFiles()[0]);

//        ui->pbClear->click();
    }
}
コード例 #10
0
ファイル: main.cpp プロジェクト: sagaxu/xcalc
void MyFrame::OnLoad(wxCommandEvent& event)
{
	wxFileDialog openFileDialog(this, L"打开发票文件", "", "",
				L"文本文件(*.txt)|*.txt",
				wxFD_OPEN | wxFD_FILE_MUST_EXIST);

	if (openFileDialog.ShowModal() == wxID_CANCEL)
		return;

	std::ifstream input_stream(openFileDialog.GetPath().ToStdString(), std::ifstream::binary);
	if (!input_stream)
		return;

	input_stream.seekg(0, input_stream.end);
	int length = input_stream.tellg();
	input_stream.seekg(0, input_stream.beg);

	char * buffer = new char [length];
	input_stream.read (buffer,length);

	if (!input_stream)
		std::cout << L"错误: 只读取了" << input_stream.gcount() << L" 字节";

	this->invoice_list->SetValue(buffer);
	input_stream.close();
	delete[] buffer;
}
コード例 #11
0
void PL_EDITOR_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
    if( GetScreen()->IsModify() )
    {
        wxString msg;
        wxString filename = GetCurrFileName();

        if( filename.IsEmpty() )
            msg = _("Save changes in a new file before closing?");
        else
            msg.Printf( _("Save the changes in\n<%s>\nbefore closing?"),
                        GetChars( filename ) );

        int ii = DisplayExitDialog( this, msg );

        switch( ii )
        {
        case wxID_CANCEL:
            Event.Veto();
            return;

        case wxID_NO:
            break;

        case wxID_OK:
        case wxID_YES:
        {
            if( filename.IsEmpty() )
            {
                wxFileDialog openFileDialog(this, _("Create file"), wxEmptyString,
                        wxEmptyString, PageLayoutDescrFileWildcard, wxFD_SAVE);

                if (openFileDialog.ShowModal() == wxID_CANCEL)
                    return;

                filename = openFileDialog.GetPath();
            }

            if( !SavePageLayoutDescrFile( filename ) )
            {
                msg.Printf( _("Unable to create <%s>"), GetChars( filename ) );
                wxMessageBox( msg );
            }
        }
            break;
        }
    }

    // do not show the window because we do not want any paint event
    Show( false );

    // was: Pgm().SaveCurrentSetupValues( m_configSettings );
    wxConfigSaveSetups( Kiface().KifaceSettings(), m_configSettings );

    // On Linux, m_propertiesPagelayout must be destroyed
    // before deleting the main frame to avoid a crash when closing
    m_propertiesPagelayout->Destroy();
    Destroy();
}
コード例 #12
0
ファイル: videocontrol.cpp プロジェクト: YeClimEric/Qt
VideoControl::VideoControl(QWidget *parent)
    : QWidget(parent)
{
    setStyleSheet("background:black;");

    m_timeSlider = new QSlider(Qt::Horizontal, this);
    m_menuButton = new QToolButton(this);
    m_playButton = new QPushButton(this);

    m_volumnButton = new QToolButton(this);
    m_volumnSlider = new QSlider(Qt::Vertical, this);
    m_volumnSlider->setRange(0, 100);
    m_volumnSlider->setValue(100);

    m_playButton->setIcon(QIcon(":/video/play"));
    m_volumnButton->setIcon(QIcon(":/video/volumn"));
    m_menuButton->setIcon(QIcon(":/video/menu"));

    m_playButton->setCursor(QCursor(Qt::PointingHandCursor));
    m_volumnButton->setCursor(QCursor(Qt::PointingHandCursor));
    m_menuButton->setCursor(QCursor(Qt::PointingHandCursor));
    m_timeSlider->setCursor(QCursor(Qt::PointingHandCursor));
    m_volumnSlider->setCursor(QCursor(Qt::PointingHandCursor));

    m_popupVolumn.setStyleSheet(BarrageCore::MMenuStyle01);
    m_timeSlider->setStyleSheet(BarrageCore::MSliderStyle02);
    m_volumnSlider->setStyleSheet(BarrageCore::MSliderStyle01);
    m_playButton->setStyleSheet(BarrageCore::MPushButtonStyle02);
    m_volumnButton->setStyleSheet(BarrageCore::MToolButtonStyle02);
    m_menuButton->setStyleSheet(BarrageCore::MToolButtonStyle02);

    QVBoxLayout *controlVLayout = new QVBoxLayout(this);
    controlVLayout->setSpacing(0);
    controlVLayout->setContentsMargins(0, 0, 0, 0);
    QWidget *controlBWidget = new QWidget(this);
    QHBoxLayout *controlBLayout = new QHBoxLayout(controlBWidget);
    controlBLayout->setContentsMargins(9, 0, 9, 0);
    controlBLayout->addWidget(m_menuButton);
    controlBLayout->addWidget(m_playButton);
    controlBLayout->addWidget(m_volumnButton);
    controlBLayout->addStretch(1);
    controlBLayout->addWidget(createBarrageWidget(), 15);
    controlBLayout->addStretch(1);
    controlBWidget->setLayout(controlBLayout);
    controlVLayout->addWidget(m_timeSlider);
    controlVLayout->addWidget(controlBWidget);
    setLayout(controlVLayout);

    QWidgetAction *widgetAction = new QWidgetAction(this);
    widgetAction->setDefaultWidget(m_volumnSlider);
    m_popupVolumn.addAction(widgetAction);
    m_volumnButton->setMenu(&m_popupVolumn);
    m_volumnButton->setPopupMode(QToolButton::InstantPopup);

    connect(m_menuButton, SIGNAL(clicked()), SLOT(openFileDialog()));
    connect(m_timeSlider, SIGNAL(sliderReleased()), SLOT(sliderReleased()));
    connect(m_volumnSlider, SIGNAL(valueChanged(int)), parent, SLOT(volumnChanged(int)));
    connect(m_playButton, SIGNAL(clicked()), parent, SLOT(play()));
}
コード例 #13
0
ファイル: studioFrame.cpp プロジェクト: oamldev/oamlStudio
void StudioFrame::OnLoad(wxCommandEvent& WXUNUSED(event)) {
	wxFileDialog openFileDialog(this, _("Open oaml.defs"), wxEmptyString, "oaml.defs", "*.defs", wxFD_OPEN|wxFD_FILE_MUST_EXIST);
	if (openFileDialog.ShowModal() == wxID_CANCEL)
		return;

	wxString path = openFileDialog.GetPath();
	Load(path.ToStdString());
}
コード例 #14
0
ファイル: EnvMap.cpp プロジェクト: Junios/Falcor
void EnvMap::loadTexture()
{
    std::string filename;
    if(openFileDialog("DDS files\0*.dds\0\0", filename))
    {
        mpSkybox = SkyBox::createFromTexture(filename, true, mpTriLinearSampler);
    }
}
コード例 #15
0
ファイル: newsalary.cpp プロジェクト: YamenAjjour/Raqeeb
void NewSalary::showEvent(QShowEvent*event)
{
    userModel= new UserHandler(this);
    QString error;
    if(!userModel->init(error))
        QMessageBox::warning(this,error,error,QMessageBox::Ok);
    openFileDialog();
}
コード例 #16
0
ファイル: MainWindow.cpp プロジェクト: krre/gagarin
void MainWindow::on_actionOpen_triggered() {
    if (maybeSave()) {
        QString fileName = openFileDialog(QFileDialog::AcceptOpen);
        if (!fileName.isEmpty()) {
            loadFile(fileName);
        }
    }
}
コード例 #17
0
ファイル: tlpeditors.cpp プロジェクト: serghei/kde3-kdewebdev
URIEditor::URIEditor(QWidget *parent, const char* name) : TLPEditor(parent,name){
  QString whatsthis =i18n("With this line edit you can insert the URI of the resource you want to reach");  
  setWhatsThis(whatsthis);
  setLabelText(" Uri  :");
  setButtonIcon("fileopen");
  setToolTip(i18n("Open the URI selector"));
    
  connect(m_pb, SIGNAL(clicked()), this, SLOT(openFileDialog()));
}
コード例 #18
0
void FastQSPWindow::reloadQSP()
{
  if(qspFilePath == "")
  {
    openFileDialog();
    return;
  }
  openFile(qspFilePath);
}
コード例 #19
0
ファイル: GLShaderDev.cpp プロジェクト: Ryp/GLShaderDev
void GLShaderDev::initializeActions()
{
    QSettings settings;

    QMenu* recent;
    QMenu* fileMenu = menuBar()->addMenu(tr("&File"));
    fileMenu->addAction(QIcon(":/document-new.png"), tr("&New..."), _newFileDialog, SLOT(exec()), QKeySequence::New);
    connect(_newFileDialog, SIGNAL(accepted()), this, SLOT(newFile()));
    fileMenu->addAction(QIcon(":/document-open.png"), tr("&Open..."), this, SLOT(openFileDialog()), QKeySequence::Open);
    recent = fileMenu->addMenu(QIcon(":/document-open-recent.png"), tr("Open &Recent"));

    for (int i = 0; i < MaxRecentFiles; ++i)
        (_recentFileActions[i] = recent->addAction(tr("<Empty>"), this, SLOT(openRecentFile())))->setVisible(true);
    (_recentFileActions[MaxRecentFiles] = recent->addSeparator())->setVisible(true);
    (_recentFileActions[MaxRecentFiles + 1] = recent->addAction(tr("&Clear List"), this, SLOT(clearFileRecent())))->setEnabled(false);
    updateRecentFiles();

    fileMenu->addSeparator();
    fileMenu->addAction(QIcon(":/document-save-all.png"), tr("Save Al&l"), _editor, SLOT(saveAll()));
    fileMenu->addAction(QIcon(":/document-save.png"), tr("&Save"), _editor, SLOT(save()), QKeySequence::Save);
    fileMenu->addAction(QIcon(":/document-save-as.png"), tr("Save &As..."), this, SLOT(saveFileAs()), QKeySequence::SaveAs);
    fileMenu->addSeparator();
    fileMenu->addAction(QIcon(":/dialog-close.png"), tr("&Close"), _editor, SLOT(closeCurrentTab()), tr("Ctrl+W"));
    fileMenu->addAction(QIcon(":/dialog-close.png"), tr("Cl&ose All"), _editor, SLOT(closeAllTabs()), tr("Ctrl+Shift+W"));
    fileMenu->addSeparator();
    fileMenu->addAction(QIcon(":/application-exit.png"), tr("&Quit"), this, SLOT(close()), QKeySequence::Quit);

    QMenu* projectMenu = menuBar()->addMenu(tr("&Project"));
    projectMenu->addAction(QIcon(":/project-development-new-template.png"), tr("&New Project"), this, SLOT(newProject()));
    projectMenu->addAction(QIcon(":/project-open.png"), tr("&Open Project..."), this, SLOT(openProjectDialog()));
    recent = projectMenu->addMenu(QIcon(":/document-open-recent.png"), tr("Open &Recent"));

    for (int i = 0; i < MaxRecentProjects; ++i)
        (_recentProjectActions[i] = recent->addAction(tr("<Empty>"), this, SLOT(openRecentProject())))->setVisible(true);
    (_recentProjectActions[MaxRecentProjects] = recent->addSeparator())->setVisible(true);
    (_recentProjectActions[MaxRecentProjects + 1] = recent->addAction(tr("&Clear List"), this, SLOT(clearProjectRecent())))->setEnabled(false);
    updateRecentProjects();

    projectMenu->addSeparator();
    projectMenu->addAction(QIcon(":/configure.png"), tr("Open &Configuration..."), this, SLOT(openProjectConfiguration()));
    projectMenu->addAction(QIcon(":/run-build.png"), tr("&Build Current"), this, SLOT(buildCurrentProject()), tr("F8"));
    projectMenu->addSeparator();
    projectMenu->addAction(QIcon(":/project-development-close.png"), tr("&Close Project"), this, SLOT(closeProject()));

    menuBar()->addMenu("|")->setEnabled(false);

    QMenu* toolsMenu = menuBar()->addMenu(tr("&Tools"));
    toolsMenu->addAction(QIcon(":/preferences-other.png"), tr("&OpenGL Info..."), this, SLOT(showGLInfo()));

    QMenu* settingsMenu = menuBar()->addMenu(tr("&Settings"));
    settingsMenu->addAction(QIcon(":/preferences-other.png"), tr("&Preferences..."), this, SLOT(showPreferences()));

    QMenu* helpMenu = menuBar()->addMenu(tr("&Help"));
    helpMenu->addAction(QIcon(":/glsd-icon.png"), tr("&About GLShaderDev"), this, SLOT(about()));
    helpMenu->addAction(QIcon(":/qt-icon.png"), tr("About &Qt"), qApp, SLOT(aboutQt()));
}
コード例 #20
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    timer(new QTimer(this))
{
    ui->setupUi(this);

    this->setWindowIcon(QIcon(":/icon.png"));

    Qt::WindowFlags flags = this->windowFlags();

    this->setWindowFlags(flags | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); //
    this->setAttribute(Qt::WA_TranslucentBackground, true);

    timer->setTimerType(Qt::PreciseTimer); // fixes subtitle delay
    connect(timer, SIGNAL(timeout()), this, SLOT(update()));

    connect(ui->backwardButton, SIGNAL(clicked()), this, SLOT(fastBackward()));
    connect(ui->forwardButton, SIGNAL(clicked()), this, SLOT(fastForward()));

    connect(ui->toggleButton, SIGNAL(clicked()), this, SLOT(togglePlay()));
    connect(ui->loadButton, SIGNAL(clicked()), this, SLOT(openFileDialog()));
    connect(ui->prefButton, SIGNAL(clicked()), this, SLOT(openSettingsWindow()));
    connect(ui->quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(ui->horizontalSlider, SIGNAL(sliderMoved(int)), this, SLOT(sliderMoved(int)));


    if (QSystemTrayIcon::isSystemTrayAvailable()) {
        trayIcon = new QSystemTrayIcon();
        trayIcon->setIcon(QIcon(":/icon.png"));

        connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

        menu = new QMenu();

        QAction *settings = new QAction("Preferences", 0);
        connect(settings, SIGNAL(triggered()), this, SLOT(openSettingsWindow()));
        menu->addAction(settings);

        QAction *quit = new QAction("Quit", 0);
        connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
        menu->addAction(quit);

        trayIcon->setContextMenu(menu);

        trayIcon->show();
    }

    this->setAttribute(Qt::WA_Hover, true);

    ui->bottomWidgets->setAttribute(Qt::WA_NoMousePropagation); // fix window disappear problem

    this->loadPref();
    setAcceptDrops(true);
}
コード例 #21
0
ファイル: Si5351C_wxgui.cpp プロジェクト: junaid124/lms7suite
void Si5351C_wxgui::OnbtnLoadFileClick(wxCommandEvent& event)
{
    wxFileDialog openFileDialog(this, _("Open project file"), "", "", "Register Files (*.h)|*.h|Text files (*.txt)|*.TXT", wxFD_OPEN|wxFD_FILE_MUST_EXIST);
    if (openFileDialog.ShowModal() == wxID_CANCEL)
        return;

    m_pModule->LoadRegValuesFromFile( openFileDialog.GetPath().ToStdString().c_str() );
    if(m_pModule->UploadConfiguration() != 0)
        wxMessageBox(wxString::Format(_("Configuration failed"), _("Error")));
}
コード例 #22
0
ファイル: MainFrame.cpp プロジェクト: feisan/ipainfo
void MainFrame::OnOpenButtonClicked(wxCommandEvent& WXUNUSED(event))
{
    wxFileDialog openFileDialog(this, _("Open IPA file"), "", "",
                       "IPA files (*.ipa)|*.ipa", wxFD_OPEN|wxFD_FILE_MUST_EXIST);

    if (openFileDialog.ShowModal() == wxID_CANCEL)
        return; 

    this->ProcessIPA(openFileDialog.GetPath());
}
コード例 #23
0
 void MapPropertiesDialog::OnAddWadClicked(wxCommandEvent& event) {
     wxFileDialog openFileDialog(NULL, wxT("Choose texture wad"), wxT(""), wxT(""), wxT("*.wad"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
     if (openFileDialog.ShowModal() == wxID_OK) {
         PathDialog pathDialog(this, openFileDialog.GetPath().ToStdString(), m_document->GetFilename().ToStdString());
         if (pathDialog.ShowModal() == wxID_OK) {
             m_wadList->addWad(pathDialog.path());
             updateWadProperty();
         }
     }
 }
コード例 #24
0
ファイル: mainwindow.cpp プロジェクト: refaim/3d-parser
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    viewer(this)
{
    ui.setupUi(this);
    setCentralWidget(&viewer);
    viewer.setFocus();
    connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(openFileDialog()));
    connect(ui.actionSetDefPos, SIGNAL(triggered()), &viewer, SLOT(setDefPos()));
    ui.menuCamera->setEnabled(false);
}
コード例 #25
0
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{
	wxFileDialog openFileDialog(this, _T("Open XML file"), _T(""), _T(""),
		_T("XML files (*.xml)|*.xml"), wxFD_OPEN|wxFD_FILE_MUST_EXIST);
	if (openFileDialog.ShowModal() == wxID_CANCEL)
		return;

	string filepath = openFileDialog.GetPath().ToStdString();

	//wxFileInputStream input_stream(openFileDialog.GetPath());
	//if (!input_stream.IsOk())
 //   {
 //       wxLogError(_T("Cannot open file '%s'."), openFileDialog.GetPath());
 //       return;
 //   }

	//wxTextInputStream text(input_stream, wxT("\x09"), wxConvUTF8 );
	//wxString docXML;
	//while (input_stream.IsOk() && !input_stream.Eof())
	//{
	//	wxString line = text.ReadLine();
	//	docXML+=line;
	//}

	//reload
	if (filepath.length() > 0)
	{
		if (m_engine)
		{
			delete m_engine;
			m_engine = nullptr;
		}
		if (m_rootNode)
		{
			delete m_rootNode;
			m_rootNode = nullptr;
		}

		ROMNode* newNode = ROMNode::LoadXML(filepath, nullptr);

		if (newNode != nullptr)
		{
			m_rootNode = newNode;
			m_rootNode->SetKnowledgeBase(m_rules);
			m_engine = new LinearEngine(m_rootNode, "HydraulicCylinderDictionary");
			m_engine->EvaluateAll();

			UpdateControls();
		}
	}
}
コード例 #26
0
	void ModuleManagerDialog::OnModuleAdd(wxCommandEvent& event) {
		wxFileDialog openFileDialog(this);

		if (openFileDialog.ShowModal() == wxID_OK){
			wxString filename = openFileDialog.GetFilename();
			auto module = System::LoadPunkModule(filename.wc_str());
		}

		m_loaded_modules_list->Clear();
		for (std::uint32_t i = 0, max_i = System::GetLoadedPunkModulesCount(); i < max_i; ++i) {
			auto module = System::GetLoadedPunkModule(i);
			m_loaded_modules_list->Insert(wxString((const wchar_t*)module->GetName().Data()), 0, (void**)module);
		}
	}
コード例 #27
0
ファイル: MainWindow.cpp プロジェクト: lemlang/loglan82
void MainWindow::OnExecute(wxCommandEvent& WXUNUSED(event)) {
    wxFileDialog
    openFileDialog(this, _("Open Loglan file"), "", "",
            "log files (*.log)|*.log", wxFD_OPEN | wxFD_FILE_MUST_EXIST);
    if (openFileDialog.ShowModal() == wxID_CANCEL)
        return; // the user changed idea...
    wxFileName executablesDir = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() );
    wxString wxString1 = wxString::Format("%s%s",
            executablesDir.GetFullPath(),
            wxFileName::GetPathSeparators());
    wxString execCommand = wxString::Format("%sloglanint %s", wxString1, openFileDialog.GetPath());
    wxExecute(execCommand, wxEXEC_ASYNC);
    wxLogMessage(execCommand);
}
コード例 #28
0
ファイル: studioFrame.cpp プロジェクト: oamldev/oamlStudio
bool StudioFrame::SaveAs() {
	wxFileDialog openFileDialog(this, _("Save oaml.defs"), wxEmptyString, "oaml.defs", "*.defs", wxFD_SAVE);
	if (openFileDialog.ShowModal() == wxID_CANCEL)
		return false;

	defsPath = openFileDialog.GetPath();
	wxFileName fname(defsPath);
	projectPath = fname.GetPathWithSep();
	InitCallbacks(projectPath);

	fileHistory->AddFileToHistory(defsPath);

	Save();
	return true;
}
コード例 #29
0
ファイル: menus.cpp プロジェクト: Kafay/vlc
/**
 * Media ( File ) Menu
 * Opening, streaming and quit
 **/
QMenu *QVLCMenu::FileMenu( intf_thread_t *p_intf, QWidget *parent )
{
    QMenu *menu = new QMenu( parent );

    addDPStaticEntry( menu, qtr( "&Open File..." ),
        ":/type/file-asym", SLOT( simpleOpenDialog() ), "Ctrl+O" );
    addDPStaticEntry( menu, qtr( "Advanced Open File..." ),
        ":/type/file-asym", SLOT( openFileDialog() ), "Ctrl+Shift+O" );
    addDPStaticEntry( menu, qtr( I_OPEN_FOLDER ),
        ":/type/folder-grey", SLOT( PLOpenDir() ), "Ctrl+F" );
    addDPStaticEntry( menu, qtr( "Open &Disc..." ),
        ":/type/disc", SLOT( openDiscDialog() ), "Ctrl+D" );
    addDPStaticEntry( menu, qtr( "Open &Network Stream..." ),
        ":/type/network", SLOT( openNetDialog() ), "Ctrl+N" );
    addDPStaticEntry( menu, qtr( "Open &Capture Device..." ),
        ":/type/capture-card", SLOT( openCaptureDialog() ),
        "Ctrl+C" );

    menu->addSeparator();
    addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
                      NULL, SLOT( openUrlDialog() ), "Ctrl+V" );

    if( config_GetInt( p_intf, "qt-recentplay" ) )
    {
        recentsMenu = new QMenu( qtr( "&Recent Media" ), menu );
        updateRecents( p_intf );
        menu->addMenu( recentsMenu );
    }
    menu->addMenu( SDMenu( p_intf, menu ) );
    menu->addSeparator();

    addDPStaticEntry( menu, qtr( I_PL_SAVE ), "", SLOT( saveAPlaylist() ),
        "Ctrl+Y" );
    menu->addSeparator();

#ifdef ENABLE_SOUT
    addDPStaticEntry( menu, qtr( "Conve&rt / Save..." ), "",
        SLOT( openAndTranscodingDialogs() ), "Ctrl+R" );
    addDPStaticEntry( menu, qtr( "&Streaming..." ),
        ":/menu/stream", SLOT( openAndStreamingDialogs() ),
        "Ctrl+S" );
    menu->addSeparator();
#endif

    addDPStaticEntry( menu, qtr( "&Quit" ) ,
        ":/menu/quit", SLOT( quit() ), "Ctrl+Q" );
    return menu;
}
コード例 #30
0
ファイル: wx_player.cpp プロジェクト: 371816210/vlc_vlc
void MainWindow::OnOpen(wxCommandEvent& event) {
    wxFileDialog openFileDialog(this, wxT("Choose File"));

    if (openFileDialog.ShowModal() == wxID_CANCEL) {
        return;
    }
    else {
        libvlc_media_t *media;
        wxFileName filename = wxFileName::FileName(openFileDialog.GetPath());
        filename.MakeRelativeTo();
        media = libvlc_media_new_path(vlc_inst, filename.GetFullPath().mb_str());
        libvlc_media_player_set_media(media_player, media);
        play();
        libvlc_media_release(media);
    }
}