Exemple #1
0
void BitcoinGUI::setClientModel(ClientModel *clientModel)
{
    this->clientModel = clientModel;
    if(clientModel)
    {
        // Replace some strings and icons, when using the testnet
        if(clientModel->isTestNet())
        {
            setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]"));
#ifndef Q_OS_MAC
            qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet"));
            setWindowIcon(QIcon(":icons/bitcoin_testnet"));
#else
            MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
#endif
            if(trayIcon)
            {
                trayIcon->setToolTip(tr("MeccaCoin client") + QString(" ") + tr("[testnet]"));
                trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
                toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
            }

            aboutAction->setIcon(QIcon(":/icons/toolbar_testnet"));
        }

        // Keep up to date with client
        setNumConnections(clientModel->getNumConnections());
        connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));

        setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
        connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));

        // Report errors from network/worker thread
        connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));

        rpcConsole->setClientModel(clientModel);
        addressBookPage->setOptionsModel(clientModel->getOptionsModel());
        receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel());
    }
}
/**
\param comp
\param paren
\param flag
\param editmodo
\return
**/
ArticuloList::ArticuloList ( BfCompany *comp, QWidget *parent, Qt::WindowFlags flag, edmode editmodo )
        : BlFormList ( comp, parent, flag, editmodo ), BlImportExport ( comp )
{
    BL_FUNC_DEBUG
    setupUi ( this );
    /// Disparamos los plugins.
    int res = g_plugins->run ( "ArticuloList_ArticuloList", this );
    if ( res != 0 ) {
        return;
    } // end if
    m_tipoarticulo->setMainCompany ( comp );
    m_familia->setMainCompany ( comp );
    mui_list->setMainCompany ( comp );
    setSubForm ( mui_list );
    m_usadoarticulo->setCheckState ( Qt::Unchecked );


    if ( editMode() ) {
        mainCompany() ->insertWindow ( windowTitle(), this );
    } else {
        setWindowTitle ( _ ( "Selector de articulos" ) );
        mui_editar->setHidden ( true );
        mui_borrar->setHidden ( true );
        mui_exportar->setHidden ( true );
        mui_importar->setHidden ( true );
        mui_imprimir->setHidden ( true );
    } // end if
    
    cargaFiltrosXML();
    
    presentar();
    
    
    hideBusqueda();
    /// Hacemos el tratamiento de los permisos que desabilita botones en caso de no haber suficientes permisos.
    trataPermisos ( "articulo" );
    /// Llamamos a los scripts
    blScript(this);
    
}
Exemple #3
0
FinanceMgr::FinanceMgr(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);

	MainButtonList* btnList = new MainButtonList(this);
	
	// set splitter window as the central widget of main window
	mainView = new MainView(this);
	mainView->openWindow(DepartmentManagerView);
	QSplitter* splitter = new QSplitter(this);
	setCentralWidget(splitter);

	splitter->addWidget(btnList);
	splitter->addWidget(mainView);

	// connect the manage menu
	connect(ui.actionDepartment, SIGNAL(triggered()), this, SLOT(handleActionDepartment()));
	connect(ui.actionBankAccount, SIGNAL(triggered()), this, SLOT(handleActionBank()));
	connect(ui.actionBudget, SIGNAL(triggered()), this, SLOT(handleBudget()));
	connect(ui.actionTitle, SIGNAL(triggered()), this, SLOT(handleTitle()));
	connect(ui.actionDetailTitle, SIGNAL(triggered()), this, SLOT(handleDetailTitle()));
	connect(ui.actionIncome, SIGNAL(triggered()), this, SLOT(handleIncome()));
	connect(ui.actionCheck, SIGNAL(triggered()), this, SLOT(handleCRCheck()));
	connect(ui.actionCash, SIGNAL(triggered()), this, SLOT(hanldeCashShow()));

	// here connect the operation of operation menu
	connect(ui.actionInsert, SIGNAL(triggered()), this, SLOT(addItem()));
	connect(ui.actionEdit, SIGNAL(triggered()), this, SLOT(editItem()));
	connect(ui.actionDel, SIGNAL(triggered()), this, SLOT(delItem()));

	// create the toolbar
	createToolbar();

	QString strCurrentYear = QString("%1").arg(QDate::currentDate().year());
	QString strCurrentMonth = QString("%1").arg(QDate::currentDate().month());
	QString strTitle = windowTitle();
	strTitle += QString("-%1%2").arg(strCurrentYear, strCurrentMonth);
	setWindowTitle(strTitle);
}
void UpdateDownloadDialog::installUpdate ()
{
	const bool ifI = updater_->currentProductVersion().productID() == "uu";

	updater_->installUpdate (version_);

	if (updater_->lastError() != Core::AbstractUpdater::NoError) {
		QMessageBox::critical (this,
							   windowTitle (),
							   tr ("Install error"));
		emit rejected ();
	} else {
		//If it uu, then run install and close

		if (ifI) {
			QCoreApplication::quit();
		} else {
			emit accepted ();
		}
	}

}
void MainWindow::setCentralWidget(QWidget* w)
{
    QMainWindow::setCentralWidget(w);

    if (auto c = dynamic_cast<Canvas*>(centralWidget()))
    {
        c->customizeUI(ui);
        window_type = "Graph";
    }
    else if (auto e = dynamic_cast<ScriptPane*>(centralWidget()))
    {
        e->customizeUI(ui);
        window_type = "Script";
    }
    else
    {
        for (auto v : findChildren<Viewport*>())
            v->customizeUI(ui);
        window_type = "View";
    }
    setWindowTitle(windowTitle().arg(window_type));
}
Exemple #6
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tMergeRouteDialog::ExitKeyPressed()
{  
    tMessageBox warningMessageBox( tMessageBox::WARNING, windowTitle(), 
                tr( "Cancelling will automatically accept the network version for all routes. Are you sure?" ), 
                tMessageBox::NO_BUTTON, this );

    tAction* pYesButton = warningMessageBox.AddButton( tMessageBox::YES );
    tAction* pNoButton = warningMessageBox.AddButton( tMessageBox::NO );
    warningMessageBox.SetEscapeButton( pYesButton );

    warningMessageBox.exec();

    tAction* pReplyButton = warningMessageBox.ClickedButton();
    if ( pReplyButton == pNoButton )
    {
        //Go back to the merge dialog (i.e. do nothing)
        return;
    }

    // Else YES or pressed exit again
    KeepAllNetworkVersions();
}
Exemple #7
0
void ImageWindow::saveIsComplete()
{
    // With save(), we do not reload the image but just continue using the data.
    // This means that a saving operation does not lead to quality loss for
    // subsequent editing operations.

    // put image in cache, the LoadingCacheInterface cares for the details
    LoadingCacheInterface::putImage(m_savingContext.destinationURL.toLocalFile(), m_canvas->currentImage());
    ScanController::instance()->scanFileDirectly(m_savingContext.destinationURL.toLocalFile());

    // Pop-up a message to bring user when save is done.
    KNotificationWrapper("editorsavefilecompleted", i18n("save file is completed..."),
                         this, windowTitle());

    QModelIndex next = d->nextIndex();
    if (next.isValid())
    {
        m_canvas->preload(d->imageInfo(next).filePath());
    }

    setViewToURL(d->currentImageInfo.fileUrl());
}
bool QNapiOpenDialog::selectFile()
{
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
	files.clear();
	QString file = getOpenFileName(this, windowTitle(), directory().path(),
#if QT_VERSION >= 0x040400
		nameFilters().join("\n")
#else
		filters().join("\n")
#endif
					);

	if(!file.isEmpty())
		files << file;

	return !file.isEmpty();
#else
	if(!placeWindow()) return false;
	setFileMode(QFileDialog::ExistingFile);
	return exec();
#endif
}
bool NewProjectDialog::checkValidity()
{
   // Hackety hack (but then again so is using "new project dialog" for adding
   // source files)
   if( windowTitle() == "New Source" )
   {
      return !ui->name->text().isEmpty();
   }
   else
   {
      QDir check(ui->path->text());

      if ( !ui->path->text().isEmpty() && !ui->name->text().isEmpty() )
      {
         return true;
      }
      else
      {
         return false;
      }
   }
}
TranscoderOptionsDialog::TranscoderOptionsDialog(Song::FileType type,
                                                 QWidget* parent)
    : QDialog(parent), ui_(new Ui_TranscoderOptionsDialog), options_(nullptr) {
  ui_->setupUi(this);

  switch (type) {
    case Song::Type_Flac:
    case Song::Type_OggFlac:
      options_ = new TranscoderOptionsFlac(this);
      break;
    case Song::Type_Mp4:
      options_ = new TranscoderOptionsAAC(this);
      break;
    case Song::Type_Mpeg:
      options_ = new TranscoderOptionsMP3(this);
      break;
    case Song::Type_OggVorbis:
      options_ = new TranscoderOptionsVorbis(this);
      break;
    case Song::Type_OggOpus:
      options_ = new TranscoderOptionsOpus(this);
      break;
    case Song::Type_OggSpeex:
      options_ = new TranscoderOptionsSpeex(this);
      break;
    case Song::Type_Asf:
      options_ = new TranscoderOptionsWma(this);
      break;
    default:
      break;
  }

  if (options_) {
    setWindowTitle(windowTitle() + " - " + Song::TextForFiletype(type));
    options_->layout()->setContentsMargins(0, 0, 0, 0);
    ui_->verticalLayout->insertWidget(0, options_);
    resize(width(), minimumHeight());
  }
}
void QDesignerFormWindow::changeEvent(QEvent *e)
{
    switch (e->type()) {
        case QEvent::WindowTitleChange:
            m_action->setText(windowTitle().remove(QLatin1String("[*]")));
            break;
        case QEvent::WindowIconChange:
            m_action->setIcon(windowIcon());
            break;
    case QEvent::WindowStateChange: {
        const  QWindowStateChangeEvent *wsce =  static_cast<const QWindowStateChangeEvent *>(e);
        const bool wasMinimized = Qt::WindowMinimized & wsce->oldState();
        const bool isMinimizedNow = isMinimized();
        if (wasMinimized != isMinimizedNow )
            emit minimizationStateChanged(m_editor, isMinimizedNow);
    }
        break;
        default:
            break;
    }
    QWidget::changeEvent(e);
}
void QDesignerFormWindow::updateWindowTitle(const QString &fileName)
{
    QString fn = fileName;

    if (fn.isEmpty()) {
        // Try to preserve its "untitled" number.
        QRegExp rx(QLatin1String("unnamed( (\\d+))?"));

        if (rx.indexIn(windowTitle()) != -1) {
            fn = rx.cap(0);
        } else {
            fn = QLatin1String("untitled");
        }
    }

    if (QWidget *mc = m_editor->mainContainer()) {
        setWindowIcon(mc->windowIcon());
        setWindowTitle(tr("%1 - %2[*]").arg(mc->windowTitle()).arg(fn));
    } else {
        setWindowTitle(fn);
    }
}
Exemple #13
0
void BitcoinGUI::setClientModel(ClientModel *clientModel)
{
    this->clientModel = clientModel;
    if(clientModel)
    {
        if(clientModel->isTestNet())
        {
            setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]"));
#ifndef Q_WS_MAC
            qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet"));
            setWindowIcon(QIcon(":icons/bitcoin_testnet"));
#else
            MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
#endif
            if(trayIcon)
            {
                trayIcon->setToolTip(tr("Nullcoin client") + QString(" ") + tr("[testnet]"));
                trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
                toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
            }
        }

        // Keep up to date with client
        setNumConnections(clientModel->getNumConnections());
        connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));

        setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
        connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));

        setMining(false, 0);
        connect(clientModel, SIGNAL(miningChanged(bool,int)), this, SLOT(setMining(bool,int)));

        // Report errors from network/worker thread
        connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));

        rpcConsole->setClientModel(clientModel);
    }
}
Exemple #14
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tTripDialog::contextMenuEvent( QContextMenuEvent* pEvent )
{
    Q_UNUSED(pEvent);

    tMenu* pMenu = new tMenu( windowTitle(), true, this );

    bool tripEnabled = tInstrumentDataManager::Instance()->GetTripEnabled(m_TripNumber);

    if(tripEnabled == true)
    {
        pMenu->AddAction( m_pStopTripAct );
    }
    else
    {
        pMenu->AddAction( m_pStartTripAct );
    }

    pMenu->AddAction( m_pResetTripAct );

    pMenu->adjustSize();

    pMenu->ShowAndDeleteOnClose( mapToGlobal( pEvent->pos() ) );
}
Exemple #15
0
void SimMainWindow::saveSim()
{
    QString fileName = windowTitle();
    if (!QFile::exists(fileName)){
        fileName = QFileDialog::getSaveFileName(this,tr("Save Simulation"),
                                                "", tr("Estel Simulation (*.estel"));


        QFileInfo info(fileName);
        if (info.suffix()!="estel")
            fileName.append(".estel");
    }



    if(!mEngine->save(fileName)){
        QMessageBox::warning(this,"error","Cannot save file");
        return;
    }
    setWindowTitle(fileName);
    ui->actionSave->setEnabled(false);

}
PostDock::PostDock(QWidget* parent):
    QDockWidget(tr("Post window"), parent)
{
    setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea);
    setFeatures(DockWidgetFloatable | DockWidgetMovable | DockWidgetClosable);

    mPostWindow = new PostWindow(this);
    setWidget(mPostWindow);

    QToolBar *toolBar = new QToolBar();
    toolBar->addAction(mPostWindow->mAutoScrollAction);

    QWidget *titleBar = new QWidget();
    QHBoxLayout *l = new QHBoxLayout();
    l->setContentsMargins(5,2,5,0);
    l->addWidget(new QLabel(windowTitle()), 1);
    l->addWidget(toolBar);
    titleBar->setLayout(l);

    setTitleBarWidget(titleBar);

    connect(this, SIGNAL(topLevelChanged(bool)), this, SLOT(onFloatingChanged(bool)));
}
void DiagnosticsDialog::showDetails()
{
	QProgressDialog box( tr( "Generating diagnostics\n\nPlease wait..." ), QString(), 0, 0, qApp->activeWindow() );
	box.setWindowTitle( windowTitle() );
	box.setWindowFlags( (box.windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowCloseButtonHint );
	if( QProgressBar *bar = box.findChild<QProgressBar*>() )
		bar->setVisible( false );
	box.open();
	
	QApplication::processEvents();

	QString ret;
	QProcess p;
	p.start( "opensc-tool", QStringList() << "-la" );
	p.waitForFinished();
	QString cmd = QString::fromUtf8( p.readAll() );
	if ( !cmd.isEmpty() )
		ret += "<b>" + tr("OpenSC tool:") + "</b><br/> " + cmd.replace( "\n", "<br />" ) + "<br />";
	
	QApplication::processEvents();

	QStringList list;
#if defined(PKCS11_MODULE)
	list << QString("--module=%1").arg( PKCS11_MODULE );
#endif
	list << "-T";
	p.start( "pkcs11-tool", list );
	p.waitForFinished();
	cmd = QString::fromUtf8( p.readAll() );
	if ( !cmd.isEmpty() )
		ret += "<b>" + tr("PKCS11 tool:") + "</b><br/> " + cmd.replace( "\n", "<br />" ) + "<br />";

	if ( !ret.isEmpty() )
		diagnosticsText->append( ret );

	details->setDisabled( true );
}
Exemple #18
0
void ZFramework3D::loadMesh(QString fileName)
{
	ZDataManager *manager = ZDataManager::getDataManager();
	ZMeshSpace::Mesh3D *mesh = new ZMeshSpace::Mesh3D();
	if (mesh->load_obj(fileName.toLocal8Bit()))
	{
		mesh->information(std::cout);
		//manager->clearMeshes();
		manager->clear();
		manager->addMesh(mesh);
		qDebug("mesh loaded!\n");
		// set the mesh handle to the algorithm
		manager->getAlgorithmHandler()->setMesh(mesh);

		// temp to load the eigen file
		QString eigenFile = fileName.mid(0, fileName.length()-4) + "_geometry.eig";
		std::cout << eigenFile.toStdString() << std::endl;
		if (QFileInfo(eigenFile).exists())
		{
			manager->getAlgorithmHandler()->setMesh(mesh);
			if (manager->getAlgorithmHandler()->loadEigenVectors(eigenFile.toLocal8Bit()))
			{
				qDebug("eigen vector loaded!\n");
			}
		}
		return;
	}
	else
	{
		delete mesh;
		QString msg = "Cannot read mesh from file:\n";
		msg += fileName;
		msg += "";
		QMessageBox::critical(NULL, windowTitle(), msg);
	}
	updateViews();
}
/**
\param emp
\param parent
**/
cobropagoview::cobropagoview ( BcCompany *emp, QWidget *parent )
        : BcForm ( emp, parent )
{
    BL_FUNC_DEBUG
    setAttribute ( Qt::WA_DeleteOnClose );
    setupUi ( this );
    m_companyact = emp;
    mui_listado->setMainCompany ( m_companyact );
    /// Inicializamos el listado.
    mui_listado->setDbTableName ( "prevcobro" );
    mui_listado->setDbFieldId ( "idprevcobro" );
    mui_listado->addSubFormHeader ( "idprevcobro", BlDbField::DbInt, BlDbField::DbPrimaryKey, BlSubFormHeader::DbNoWrite , _ ( "idprevcobro" ) );
    mui_listado->addSubFormHeader ( "fprevistaprevcobro", BlDbField::DbInt, BlDbField::DbNotNull, BlSubFormHeader::DbNoWrite , _ ( "fprevistaprevcobro" ) );
    mui_listado->addSubFormHeader ( "fcobroprevcobro", BlDbField::DbInt, BlDbField::DbNoSave, BlSubFormHeader::DbNoWrite , _ ( "fcobroprevcobro" ) );
    mui_listado->addSubFormHeader ( "idctacliente", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNoWrite | BlSubFormHeader::DbHideView, _ ( "idctacliente" ) );
    mui_listado->addSubFormHeader ( "idfpago", BlDbField::DbVarChar, BlDbField::DbNoSave, BlSubFormHeader::DbNoWrite , _ ( "idfpago" ) );
    mui_listado->addSubFormHeader ( "idcuenta", BlDbField::DbInt, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "idcuenta" ) );
    mui_listado->addSubFormHeader ( "idasiento", BlDbField::DbNumeric, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "idasiento" ) );
    mui_listado->addSubFormHeader ( "cantidadprevistaprevcobro", BlDbField::DbNumeric, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "cantidadprevistaprevcobro" ) );
    mui_listado->addSubFormHeader ( "cantidadprevcobro", BlDbField::DbNumeric, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "cantidadprevcobro" ) );
    mui_listado->addSubFormHeader ( "idregistroiva", BlDbField::DbNumeric, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "idregistroiva" ) );
    mui_listado->addSubFormHeader ( "tipoprevcobro", BlDbField::DbNumeric, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "tipoprevcobro" ) );
    mui_listado->addSubFormHeader ( "docprevcobro", BlDbField::DbNumeric, BlDbField::DbNothing, BlSubFormHeader::DbNone , _ ( "docprevcobro" ) );
    mui_listado->setInsert ( false );
    /// Inicializamos el campo cuenta.
    m_cuenta->setMainCompany ( emp );
    m_cuenta->setLabel ( _ ( "Cuenta:" ) );
    m_cuenta->setTableName ( "cuenta" );
    m_cuenta->setFieldId("idcuenta");
    m_cuenta->m_valores["descripcion"] = "";
    m_cuenta->m_valores["codigo"] = "";


    on_mui_actualizar_clicked();
    m_companyact->insertWindow ( windowTitle(), this );
    
}
/**
\param comp
\param paren
\param flag
\param editmodo
\return
**/
BcCuentaListView::BcCuentaListView ( BcCompany *comp, QWidget *parent, Qt::WFlags flag, edmode editmodo )
    : BlFormList ( comp, parent, flag, editmodo )
{
    BL_FUNC_DEBUG
    setupUi ( this );
    /// Disparamos los plugins.
    int res = g_plugins->run ( "BcCuentaListView_BcCuentaListView", this );
    if ( res != 0 ) {

        return;
    } // end if
    mui_list->setMainCompany ( comp );
    setSubForm ( mui_list );

    if ( editMode() ) {
        mainCompany() ->insertWindow ( windowTitle(), this );
    } else {
        setWindowTitle ( _ ( "Selector de cuenta." ) );
        mui_imprimir->setHidden ( TRUE );
    } // end if

    mui_nivel->clear();
    for ( int i = comp->numDigitosEmpresa(); i >= 2; i-- ) {
        /// Inicializamos la tabla de nivel.
        mui_nivel->insertItem ( i, QString::number ( i ) );
    } // end for


    presentar();
    hideBusqueda();
    /// Hacemos el tratamiento de los permisos que desabilita botones en caso de no haber suficientes permisos.
    trataPermisos ( "cuenta" );
    /// Lanzamos los posibles scripts
    blScript(this);

}
AboutDialog::AboutDialog(QWidget *parent, BitScreen* screen) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    const std::string urlMain("http://www.artboomerang.win");
    const std::string urlExplorer("http://www.artboomerang.win");
    ui->setupUi(this);
    this->setWindowTitle("About ArtBoomerang");
    ui->scrollAreaAboutDlg->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
    QScroller::grabGesture(ui->scrollAreaAboutDlg->viewport(), QScroller::TouchGesture);
    QScroller::grabGesture(this->ui->scrollAreaAboutDlg->viewport(), QScroller::LeftMouseButtonGesture);
    ui->scrollAreaAboutDlg->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

#ifdef USE_FULLSCREEN
        ui->pushButton->setIconSize(screen->iconSize());
        ActionBar *actionBar =new ActionBar(this);
        QAction *closeAction = new QAction(QIcon(":/android_icons/action_close"), tr("&Close"), this);
        connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
        actionBar->addButton(closeAction);
        ui->actionBarLayout->addWidget(actionBar);
        actionBar->setTitle(windowTitle(), false);
        setWindowState(this->windowState() ^ Qt::WindowMaximized);
#endif
    //transparent window with bg-image
    //setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
    //setParent(0); // Create TopLevel-Widget
    //setAttribute(Qt::WA_NoSystemBackground, true);
    //setAttribute(Qt::WA_TranslucentBackground, true);
    //setAttribute(Qt::WA_PaintOnScreen);
    connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(close()));
    //std::replace( s.begin(), s.end(), 'x', 'y');
    QString cpTxt = ui->copyrightLabel->text();
    cpTxt.replace(QString("[urlMain]"), QString::fromStdString(urlMain))
            .replace(QString("[urlExplorer]"), QString::fromStdString(urlExplorer));
    ui->copyrightLabel->setText(cpTxt);
}
Exemple #22
0
/**
 * Creates an XML representation of the view, which can be used for storing the
 * model's data in a file.
 * The representation is rooted at a <QueryView> element, which holds a <Query>
 * element for the query information, a <Columns> element with a list of
 * columns, and a <LocationList> element that describes the list or tree of
 * locations.
 * @param  doc    The XML document object to use
 * @return The root element of the view's representation
 */
QDomElement QueryView::toXML(QDomDocument& doc) const
{
	// Create an element for storing the view.
	QDomElement viewElem = doc.createElement("QueryView");
	viewElem.setAttribute("name", windowTitle());
	viewElem.setAttribute("type", QString::number(type_));

	// Store query information.
	QDomElement queryElem = doc.createElement("Query");
	queryElem.setAttribute("type", QString::number(query_.type_));
	queryElem.setAttribute("flags", QString::number(query_.flags_));
	queryElem.appendChild(doc.createCDATASection(query_.pattern_));
	viewElem.appendChild(queryElem);

	// Create a "Columns" element.
	QDomElement colsElem = doc.createElement("Columns");
	viewElem.appendChild(colsElem);

	// Add an element for each column.
	foreach (Location::Fields field, model()->columns()) {
		QDomElement colElem = doc.createElement("Column");
		colElem.setAttribute("field", QString::number(field));
		colsElem.appendChild(colElem);
	}
Exemple #23
0
void MainWindow::on_actionMinimize_to_system_tray_triggered()
{
	if(systray == NULL){
		QIcon icon("image/system/magatamas/5.png");
		systray = new QSystemTrayIcon(icon, this);

		QAction *appear = new QAction(tr("Show main window"), this);
		connect(appear, SIGNAL(triggered()), this, SLOT(show()));

		QMenu *menu = new QMenu;
		menu->addAction(appear);
		menu->addMenu(ui->menuGame);
		menu->addMenu(ui->menuView);
		menu->addMenu(ui->menuOptions);
		menu->addMenu(ui->menuHelp);

		systray->setContextMenu(menu);

		systray->show();
		systray->showMessage(windowTitle(), tr("Game is minimized"));

		hide();
	}
}
Exemple #24
0
PresetEditor::PresetEditor(const QVariantMap &data, QWidget *parent) :
    QDialog(parent), m_ui(new Ui::PresetEditor)
{
    m_ui->setupUi(this);
    m_ui->nameLineEdit->setText(data.value("name").toString());
    m_ui->extensionLineEdit->setText(data.value("ext").toString());
    m_ui->commandLineEdit->setText(data.value("command").toString());
    m_ui->us16bitCheckBox->setChecked(data.value("use_16bit").toBool());
    m_ui->tagsCheckBox->setChecked(data.value("tags").toBool());

    if(data["read_only"].toBool())
    {
        setWindowTitle(tr("%1 (Read Only)").arg(windowTitle()));
        m_ui->buttonBox->setStandardButtons(QDialogButtonBox::Close);
        m_ui->nameLineEdit->setReadOnly(true);
        m_ui->extensionLineEdit->setReadOnly(true);
        m_ui->commandLineEdit->setReadOnly(true);
        m_ui->us16bitCheckBox->setDisabled(true);
        m_ui->tagsCheckBox->setDisabled(true);
        m_ui->commandToolButton->setDisabled(true);
    }
    else
        createMenus();
}
MinecraftProcess *LegacyInstance::prepareForLaunch(AuthSessionPtr account)
{
	MinecraftProcess *proc = new MinecraftProcess(this);

	QIcon icon = MMC->icons()->getIcon(iconKey());
	auto pixmap = icon.pixmap(128, 128);
	pixmap.save(PathCombine(minecraftRoot(), "icon.png"), "PNG");

	// create the launch script
	QString launchScript;
	{
		// window size
		QString windowParams;
		if (settings().get("LaunchMaximized").toBool())
			windowParams = "max";
		else
			windowParams = QString("%1x%2")
							   .arg(settings().get("MinecraftWinWidth").toInt())
							   .arg(settings().get("MinecraftWinHeight").toInt());

		QString lwjgl = QDir(MMC->settings()->get("LWJGLDir").toString() + "/" + lwjglVersion())
							.absolutePath();
		launchScript += "userName " + account->player_name + "\n";
		launchScript += "sessionId " + account->session + "\n";
		launchScript += "windowTitle " + windowTitle() + "\n";
		launchScript += "windowParams " + windowParams + "\n";
		launchScript += "lwjgl " + lwjgl + "\n";
		launchScript += "launcher legacy\n";
	}
	proc->setLaunchScript(launchScript);

	// set the process work path
	proc->setWorkdir(minecraftRoot());

	return proc;
}
//
// Get active window title
// see: Quartz Window Services
//
QString AutoTypePlatformMac::activeWindowTitle()
{
    QString title;

    CFArrayRef windowList = ::CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID);
    if (windowList != nullptr) {
        CFIndex count = ::CFArrayGetCount(windowList);

        for (CFIndex i = 0; i < count; i++) {
            CFDictionaryRef window = static_cast<CFDictionaryRef>(::CFArrayGetValueAtIndex(windowList, i));
            if (windowLayer(window) == 0) {
                // First toplevel window in list (front to back order)
                title = windowTitle(window);
                if (!title.isEmpty()) {
                    break;
                }
            }
        }

        ::CFRelease(windowList);
    }

    return title;
}
Exemple #27
0
CSysSettingDialog::CSysSettingDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CSysSettingDialog)
{
    ui->setupUi(this);

    CCommonFunction::ConnectCloseButton( ui->lblClose );
    pSettings = CCommonFunction::GetSettings( CommonDataType::CfgSysSet );
    ReadFile( );

    CCommonFunction::ControlSysMenu( *this );
    setWindowFlags( Qt::FramelessWindowHint );

    CCommonFunction::GetPath( strPath, CommonDataType::PathUIImage );
    QString strPlateSet = strPath + "NewIcon/SysSet.JPG";
    setStatusTip( strPlateSet );

    strPlateSet = strPath + "NewIcon/SysMiddleSet.JPG";
    QString strStyle = QString( "background-image:url(%1);" ).arg( strPlateSet );
    ui->tabWidget->setStyleSheet( strStyle );

    ui->lblTilte->setText( windowTitle( ) );
    move( 123, 177 );
}
Exemple #28
0
void HardwareHiqsdr :: processAnswer (QStringList list)
{
    if (list[0] == "*getserial?") {
       // try to set the serial
       qDebug() << Q_FUNC_INFO<<list[2];
       // change the title bar
       QString x;
       x.clear(); 
       QTextStream(&x) << windowTitle() << " - SN: " << list[2];

       setWindowTitle(x) ;
    }

    if (list[0] == "*getpreselector?") {
       // try to set the serial
       qDebug() << Q_FUNC_INFO << list [1] << list[2] << list[3] ;
       // change the preselector buttons
       int x = list[1].toInt() ;
       
       if (x >= 0 && x < 16) {
           psel[x]->setText(list[3]);
       }
    }
    
    if (list[0] == "getpreampstatus?") {
       // try to set the serial
       qDebug() << Q_FUNC_INFO << list [1] << list[2] << list[3] ;
       // change the preamp button
       int x = list[1].toInt() ;
       
       if (x >= 0 && x <= 1) {
           preampVal = x;
           preamp->setChecked((preampVal == 1) ? true : false);   
       }
    }
}
Exemple #29
0
/*! Constructs the main application window.

  Initialize all components and connect them.
  */
MPWindow::MPWindow(QWidget *parent) :
    QMainWindow(parent),
    m_view(0),
    m_document(0),
    m_streetlayer(0),
    m_infosdock(0),
    m_coordsLabel(0),
    m_paintTimeLabel(0),
    m_meterPerPixelLabel(0),
    m_imagesProgress(0),
    m_dataProgress(0),
    m_wsProgress(0),
    ui(new Ui::MPWindow)
{
    ui->setupUi(this);
    setWindowTitle(windowTitle() + QString(" - %1").arg(VERSION));

    m_streetlayer = new ImageMapLayer("");
    m_streetlayer->setMapAdapter(TMS_ADAPTER_UUID, "OSM Mapnik");
    m_streetlayer->setVisible(true);

    initUIComponents();

    // Allow slots connecting between threads with type CoordBox
    qRegisterMetaType<CoordBox>();

    // Restore settings
    loadSettings();

    // Abstract document
    loadDocument(new MPDocument());

    // Default interaction
    m_view->launch(m_view->defaultInteraction());

}
Exemple #30
0
void Search::findPrev()
{
	bool found = false;
	if(fieldArchive==NULL)	return;

	buttonPrev->setEnabled(false);
	buttonPrev->setDefault(true);

	if(currentIndex() == Text)
	{
		found = findPrevText();
	}
	else if(currentIndex() == Script)
	{
		found = findPrevScript();
	}

	if(!found)
	{
		QMessageBox::information(this, windowTitle(), tr("Premier fichier,\npoursuite de la recherche dans le dernier fichier."));
	}

	buttonPrev->setEnabled(true);
}