QgsGlobeTileImage::QgsGlobeTileImage( QgsGlobeTileSource* tileSource, const QgsRectangle& tileExtent, int tileSize , int tileLod )
    : osg::Image()
    , mTileSource( tileSource )
    , mTileExtent( tileExtent )
    , mTileSize( tileSize )
    , mLod( tileLod )
{
  mTileSource->addTile( this );
#ifdef GLOBE_SHOW_TILE_STATS
  QgsGlobeTileStatistics::instance()->updateTileCount( + 1 );
#endif
  mTileData = new unsigned char[mTileSize * mTileSize * 4];
  std::memset( mTileData, 0, mTileSize * mTileSize * 4 );
#if 0
  setImage( mTileSize, mTileSize, 1, 4, // width, height, depth, internal_format
            GL_BGRA, GL_UNSIGNED_BYTE,
            mTileData, osg::Image::NO_DELETE );

  mTileSource->mTileUpdateManager.addTile( const_cast<QgsGlobeTileImage*>( this ) );
  mDpi = 72;
#else
  QImage qImage( mTileData, mTileSize, mTileSize, QImage::Format_ARGB32_Premultiplied );
  QPainter painter( &qImage );
  QgsMapRendererCustomPainterJob job( createSettings( qImage.logicalDpiX(), mTileSource->mLayerSet ), &painter );
  job.renderSynchronously();

  setImage( mTileSize, mTileSize, 1, 4, // width, height, depth, internal_format
            GL_BGRA, GL_UNSIGNED_BYTE,
            mTileData, osg::Image::NO_DELETE );
  flipVertical();
  mDpi = qImage.logicalDpiX();
#endif
}
Ejemplo n.º 2
0
void OptionsWidget::onDoneClicked()
{
  createSettings();

  applyProxySettings();

  emit done();
}
Ejemplo n.º 3
0
void PlaylistEdit::settings()
{
#if EDITOR
    SettingsEdit s(0, this);
    s.exec();
    _locale->setLocale();
    createSettings();
#endif
}
Ejemplo n.º 4
0
tab::tab(QWidget *parent, ConfigManager *configM, QAction *cloudAction, MyWebPage *page):  QWidget(parent)
{
    configLoader = configM;
    webPage = page;
    this->cloudAction = cloudAction;

    createUi();
    createSettings();
    createConnects();
}
Ejemplo n.º 5
0
void OptionsWidget::initSettings()
{
  if( m_settings.value("magic").toString() == APP_MAGIC )
  {
    qDebug() << "magic = " << m_settings.value("magic").toString();
    readSettings();
  }
  else
  {
    createSettings();
  }
}
Ejemplo n.º 6
0
Application::Application(int &argc, char **argv) : QApplication(argc, argv)
{
    createSettings();
    m_undoStack = new QUndoStack(this);

    m_mainWindow = new MainWindow();
    m_prefsManager = new PrefsManager(m_mainWindow);
    m_fileManager = new FileManager(m_mainWindow);
    m_selectionTool = new SelectionTool(m_mainWindow->selectionModel(), m_mainWindow->model(), m_mainWindow->treeView());
    m_taskEditTool = new TaskEditorTool(m_mainWindow->treeView(), m_undoStack);

    m_uiManager = new UiManager(m_mainWindow->menuBar(),
                                m_mainWindow->statusBar(), m_mainWindow->toolBar(),
                                m_mainWindow, m_prefsManager, m_fileManager, m_undoStack);
    m_taskControlManager = new TaskControlManager(m_mainWindow->controlsArea(),
                                                  m_prefsManager);
    m_uiManager->setTaskControlManager(m_taskControlManager);
    m_uiManager->addTool(m_uiManager);
    m_uiManager->addTool(m_fileManager);
    m_uiManager->addTool(m_selectionTool);
    m_uiManager->addTool(m_taskEditTool);
    m_uiManager->addTool(m_prefsManager);
    m_uiManager->initManager();
    m_prefsManager->setUiManager(m_uiManager);
    m_mainWindow->setUiManager(m_uiManager);
    m_mainWindow->SetupEventFilter();

    connect(m_mainWindow, SIGNAL(onMainWindowMinimized()), m_uiManager, SLOT(onMainWindowMinimized()));
    connect(m_mainWindow, SIGNAL(onMainWindowRestored()), m_uiManager, SLOT(onMainWindowRestored()));
    connect(m_mainWindow, SIGNAL(onMainWindowClosing()), m_uiManager, SLOT(onMainWindowClosing()));
    connect(m_fileManager, SIGNAL(currentListChanged(ITaskList*)), m_uiManager, SLOT(onCurrentListChanged(ITaskList*)));
    connect(m_fileManager, SIGNAL(currentListChanged(ITaskList*)),
            m_taskControlManager, SLOT(onCurrentListChanged(ITaskList*)));
    connect(m_fileManager, SIGNAL(filenameChanged(QString)), m_uiManager, SLOT(filenameChanged(QString)));
    connect(m_mainWindow, SIGNAL(onModelsChanged(QItemSelectionModel*,QAbstractItemModel*)),
            m_selectionTool, SLOT(onModelsChanged(QItemSelectionModel*,QAbstractItemModel*)));
    connect(m_selectionTool, SIGNAL(selectionChanged(QItemSelectionModel*)),
            m_taskControlManager, SLOT(selectionChanged(QItemSelectionModel*)));
    connect(m_selectionTool, SIGNAL(selectionChanged(QItemSelectionModel*)),
            m_taskEditTool, SLOT(selectionChanged(QItemSelectionModel*)));
    connect(m_prefsManager, SIGNAL(onTopChanged(bool)),
            m_mainWindow, SLOT(onTopChanged(bool)));

    connect(m_selectionTool, SIGNAL(currentChanged(Task::Ptr)),
            m_uiManager, SLOT(currentChanged(Task::Ptr)));

    m_fileManager->startUp();
    m_mainWindow->show();
}
Ejemplo n.º 7
0
DspAmpSpecPlugin::DspAmpSpecPlugin(int _id, QString _name)
    : BasePlugin(_id, _name)
{
    nofLowClip = 0;
    nofHiClip = 0;

    estimateForBaseline = 0;
    outData = new QVector<double>(4096,0.);

    createSettings(settingsLayout);

    addConnector(new PluginConnectorQVUint(this,ScopeCommon::in,"in"));
    addConnector(new PluginConnectorQVDouble(this,ScopeCommon::out,"spectrum"));

    std::cout << "Instantiated DspAmpSpecPlugin" << std::endl;
}
Ejemplo n.º 8
0
PlaylistEdit::PlaylistEdit(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::PlaylistEdit),
      _closeEnabled(false)
{
#if EDITOR
    _locale = new LocaleManager();
#endif

    ui->setupUi(this);
    ui->editWidget->setEnabled(false);
    ui->playlist->editMode();

    _model = new PlaylistModel(this);
    ui->playlist->setModel(_model);

#if EDITOR
    _update = new UpdateDialog();
    _update->checkSilent();
#endif

	createSettings();
	createConnections();

#if WITH_EDITOR_VLCQT
    _instance = new VlcInstance(Tano::vlcQtRecorderArgs(QDir::tempPath() + "/tano-test.ts"), this);
    _media = 0;
    _player = new VlcMediaPlayer(_instance);
    _udpxy = new Udpxy();
    _timer = new QTimer();
    connect(_player, SIGNAL(playing(bool, bool)), this, SLOT(setState(bool)));
    connect(_timer, SIGNAL(timeout()), this, SLOT(checkCurrentIp()));
#else
    ui->updateWidget->hide();
#endif

    _menuExport = new QMenu();
    _menuExport->addAction(ui->actionExportTvheadend);
    _menuExport->addAction(ui->actionExportXmltvId);

#if EDITOR
    ui->toolBar->insertAction(ui->actionClose, ui->actionAbout);
    ui->toolBar->insertAction(ui->actionAbout, ui->actionSettings);
#endif
}
Ejemplo n.º 9
0
void Core::init()
{
    // create settings
    createSettings();
    reloadSettings();

    // language
    refreshLanguage();

    // kamerzysta
    kamerzystaSocket = new QTcpSocket();
    kamerzystaSocket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
    kamerzystaSocket->setSocketOption(QAbstractSocket::KeepAliveOption, 0);

    // network
    QString strServer = "czat-app.onet.pl";
    int iPort = 5015;
    network = new Network(strServer, iPort);
    network->start(QThread::InheritPriority);
}
Ejemplo n.º 10
0
ApplicationSettings::ApplicationSettings() :
  _settings(createSettings("application"))
{
  _transparentDrag = _settings.value("general/transparentdrag", false).toBool();
  _useRaster = _settings.value("general/raster", false).toBool();

  _maxUpdate = _settings.value("general/minimumupdateperiod", QVariant(200)).toInt();

  _showGrid = _settings.value("grid/showgrid", QVariant(false)).toBool();
  _snapToGrid = _settings.value("grid/snaptogrid", QVariant(false)).toBool();
  _gridHorSpacing = _settings.value("grid/horizontalspacing", 20.0).toDouble();
  _gridVerSpacing = _settings.value("grid/verticalspacing", 20.0).toDouble();
  _antialiasPlots = _settings.value("general/antialiasplots", QVariant(true)).toBool();

  Qt::BrushStyle style = (Qt::BrushStyle)_settings.value("fill/style", "0").toInt();
  if (style < Qt::LinearGradientPattern) {
    _backgroundBrush.setColor(QColor(_settings.value("fill/color", "white").toString()));
    _backgroundBrush.setStyle(style);
  }

  QString stopList = _settings.value("fill/gradient", QString()).toString();
  if (!stopList.isEmpty()) {
    QStringList stopInfo = stopList.split(',', QString::SkipEmptyParts);
    QLinearGradient gradient(0.0, 0.0, 0.0, 1.0);
    for (int i = 0; i < stopInfo.size(); i+=2) {
      gradient.setColorAt(stopInfo.at(i).toDouble(), QColor(stopInfo.at(i+1)));
    }
   _gradientStops = gradient.stops();
    _backgroundBrush = QBrush(gradient);
  }

  _refViewWidth = _settings.value("fonts/referenceviewwidth", QVariant(A4Width)).toDouble();
  _refViewHeight = _settings.value("fonts/referenceviewheight", QVariant(A4Height)).toDouble();
  _minFontSize = _settings.value("fonts/minimumfontsize", QVariant(4.0)).toDouble();

  _layoutMargins.setHeight(_settings.value("layout/marginheight", QVariant(3.0)).toDouble());
  _layoutMargins.setWidth(_settings.value("layout/marginwidth", QVariant(3.0)).toDouble());
  _layoutSpacing.setHeight(_settings.value("layout/spacingheight", QVariant(0.0)).toDouble());
  _layoutSpacing.setWidth(_settings.value("layout/spacingwidth", QVariant(0.0)).toDouble());
}
Ejemplo n.º 11
0
MainWindow::MainWindow(Arguments *args)
    : QMainWindow(),
      ui(new Ui::MainWindow),
      _hasPlaylist(false),
      _isLite(false),
      _select(0),
      _locale(new LocaleManager()),
      _model(new PlaylistModel(this)),
      _modelUpdate(new PlaylistUpdate(_model)),
      _channel(0),
      _xmltv(new XmltvManager()),
      _previewTimer(new QTimer(this)),
      _udpxy(new NetworkUdpxy()),
      _osdFloat(0),
      _playlistEditor(0),
      _trayIcon(0)
{
    _arguments = args;

    ui->setupUi(this);

#if defined(Q_OS_LINUX)
    ui->menuAbout->removeAction(ui->actionUpdate);
#else
    ui->actionUpdate->setMenuRole(QAction::ApplicationSpecificRole);
#endif

    createDesktopStartup();
    createBackend();
    createMenus();
    createSettings();
    createGui();
    createShortcuts();
    createConnections();
    _mediaPlayer->createSession(_hasPlaylist && _model->validate());

    qApp->installEventFilter(this);

    tooltip();
}
Ejemplo n.º 12
0
TimersEdit::TimersEdit(PlaylistModel *playlist,
                       QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::TimersEdit),
      _channel(0),
      _closeEnabled(false)
{
    ui->setupUi(this);

    _path = Tano::settingsPath();

    ui->dockWidgetContents->setDisabled(true);
    _playlistModel = playlist;
    ui->playlistWidget->setModel(playlist);
    ui->playlistWidget->refreshModel();

    createSettings();
    createConnections();

    _timersModel = new TimersModel(this);
    ui->timersWidget->setModel(_timersModel);

    read();
}
Ejemplo n.º 13
0
NetworkUdpxy::NetworkUdpxy(bool generate, QObject *parent)
    : QObject(parent),
      _generate(generate)
{
    createSettings();
}
Ejemplo n.º 14
0
QSettings& dialogDefaults()
{
  static QSettings& settingsObject = createSettings("dialog");
  return settingsObject;
}
Ejemplo n.º 15
0
OptionsWidget::OptionsWidget(QString productName,QWidget *parent) :
QScrollArea(parent), m_productName(productName), m_settings(QSettings::SystemScope,"osll",m_productName)
{
  m_widget = new QWidget(this);

  QVBoxLayout * layout = new QVBoxLayout(m_widget);

  layout->addWidget(new QLabel("Login", m_widget));
  layout->addWidget(m_nameEdit = new QLineEdit(m_widget));
  layout->addWidget(new QLabel("Password", m_widget));
  layout->addWidget(m_passwordEdit = new QLineEdit(m_widget));
  layout->addWidget(m_passwordCheckBox = new QCheckBox("Show password", m_widget));
  layout->addWidget(new QLabel("Channel name", m_widget));
  layout->addWidget(m_channelEdit = new QLineEdit(m_widget));
  // NOTE if we use m_widget windget in tracker addition field for username will displayed
  if (m_productName == "tracker")
  {
    layout->addWidget(new QLabel("Name that will be displayed\non Observer map:", m_widget));
    layout->addWidget(m_visibleNameEdit = new QLineEdit());
  }

  m_passwordEdit->setEchoMode(QLineEdit::Password);
  m_passwordCheckBox->setChecked(false);

  layout->addWidget(new QLabel("Server", m_widget));
  layout->addWidget(m_serverUrlEdit = new QLineEdit(m_widget));
  layout->addWidget(new QLabel("Port", m_widget));
  layout->addWidget(m_serverPortEdit = new QSpinBox(m_widget));

  m_serverPortEdit->setMinimum(0);
  m_serverPortEdit->setMaximum(65535);

  layout->addWidget(new QLabel("Proxy type", m_widget));
  layout->addWidget(m_proxyType = new QComboBox(m_widget));
  layout->addWidget(new QLabel("Proxy host", m_widget));
  layout->addWidget(m_proxyHostEdit = new QLineEdit(m_widget));
  layout->addWidget(new QLabel("Proxy port", m_widget));
  layout->addWidget(m_proxyPortEdit = new QSpinBox(m_widget));

  m_proxyType->addItem("DefaultProxy", QNetworkProxy::DefaultProxy);
  m_proxyType->addItem("Socks5Proxy", QNetworkProxy::Socks5Proxy);
  m_proxyType->addItem("NoProxy", QNetworkProxy::NoProxy);
  m_proxyType->addItem("HttpProxy", QNetworkProxy::HttpProxy);
  m_proxyType->addItem("HttpCachingProxy", QNetworkProxy::HttpCachingProxy);
  m_proxyType->addItem("FtpCachingProxy", QNetworkProxy::FtpCachingProxy);
  m_proxyPortEdit->setMinimum(0);
  m_proxyPortEdit->setMaximum(65535);

  layout->addWidget(new QLabel("Cache type", m_widget));
  layout->addWidget(m_cacheType = new QComboBox(m_widget));
  layout->addWidget(new QLabel("Cache path", m_widget));
  layout->addWidget(m_cachePath = new QLineEdit(m_widget));
  layout->addWidget(m_cachePathButton = new QPushButton("Choose dir...", m_widget));
  layout->addWidget(new QLabel("Max cache size", m_widget));
  layout->addWidget(m_cacheMaxSize = new QSpinBox(m_widget));

  m_cacheType->addItem("None", 0);
  m_cacheType->addItem("Network cache", 1);
  m_cacheType->addItem("Disk cache", 2);
  m_cacheType->setCurrentIndex(-1);

  layout->addWidget(m_doneButton = new QPushButton("Done", m_widget));
  layout->addWidget(m_defaultButton = new QPushButton("Default settings", m_widget));
  layout->addWidget(m_cancelButton = new QPushButton("Cancel", m_widget));

  m_widget->setLayout(layout);
  this->setWidget(m_widget);
  this->setWidgetResizable(true);

  connect(m_doneButton, SIGNAL(clicked()), this, SLOT(onDoneClicked()));
  connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(onCancelClicked()));
  connect(m_defaultButton,SIGNAL(clicked()), this, SLOT(setDefaultSettings()));
  connect(m_proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(onProxyTypeChanged(int)));
  connect(m_cacheType, SIGNAL(currentIndexChanged(int)), this, SLOT(onCacheTypeChanged(int)));
  connect(m_cachePathButton, SIGNAL(clicked()), this, SLOT(onCachePathButtonClick()));
  connect(m_passwordCheckBox, SIGNAL(clicked(bool)), this, SLOT(onShowPasswordChecked(bool)));

  onProxyTypeChanged(m_proxyType->currentIndex());

  if( m_settings.value("magic").toString() != APP_MAGIC )
  {
    setDefaultSettings();
    createSettings();
  }

  initSettings();
  applyProxySettings();
}
Ejemplo n.º 16
0
MainApplication::MainApplication(int &argc, char **argv)
  : QtSingleApplication(argc, argv)
  , isPortable_(false)
  , isPortableAppsCom_(false)
  , isClosing_(false)
  , dbFileExists_(false)
  , mainWindow_(0)
  , networkManager_(0)
  , cookieJar_(0)
  , diskCache_(0)
  , downloadManager_(0)
{
  QString message = arguments().value(1);
  if (isRunning()) {
    if (argc == 1) {
      sendMessage("--show");
    } else {
      for (int i = 2; i < argc; ++i)
        message += '\n' + arguments().value(i);
      sendMessage(message);
    }
    isClosing_ = true;
    return;
  } else {
    if (message.contains("--exit", Qt::CaseInsensitive)) {
      isClosing_ = true;
      return;
    }
  }

  setApplicationName("QuiteRss");
  setOrganizationName("QuiteRss");
  setApplicationVersion(STRPRODUCTVER);
  setWindowIcon(QIcon(":/images/quiterss32"));
  setQuitOnLastWindowClosed(false);
  QSettings::setDefaultFormat(QSettings::IniFormat);

  checkPortable();

  checkDir();

  createSettings();

  qWarning() << "Run application!";

  setStyleApplication();

  showSplashScreen();

  connectDatabase();
  setProgressSplashScreen(30);
  qWarning() << "Run application 2";
  mainWindow_ = new MainWindow();
  qWarning() << "Run application 3";
  setProgressSplashScreen(60);

  loadSettings();
  qWarning() << "Run application 4";
  updateFeeds_ = new UpdateFeeds(mainWindow_);
  setProgressSplashScreen(90);
  qWarning() << "Run application 5";
  mainWindow_->restoreFeedsOnStartUp();
  setProgressSplashScreen(100);
  qWarning() << "Run application 6";
  if (!mainWindow_->startingTray_ || !mainWindow_->showTrayIcon_) {
    mainWindow_->show();
  }
  mainWindow_->isMinimizeToTray_ = false;

  closeSplashScreen();

  if (mainWindow_->showTrayIcon_) {
    QTimer::singleShot(0, mainWindow_->traySystem, SLOT(show()));
  }

  if (updateFeedsStartUp_) {
    QTimer::singleShot(0, mainWindow_, SLOT(slotGetAllFeeds()));
  }

  receiveMessage(message);
  connect(this, SIGNAL(messageReceived(QString)), SLOT(receiveMessage(QString)));
}
Ejemplo n.º 17
0
SpecialMatrix::FileParser::FileParser( QString fileName, Data::Graph* matrixGraph, SpecialMatrix::NodeConnections* connections )
{
	createSettings( matrixGraph );
	parseFile( matrixGraph, fileName, connections );
}