Esempio n. 1
0
void AssetsUpdateLayer::update(float delta)
{
    if (1 || m_curBigVersion >= m_endBigVersion && m_curSmallVersion >= m_endSmallVersion)
    {
        CCLOG("Version check Ok");
        unscheduleUpdate();
        //MD5Check();
        gameEnter();
        return;
    }
    if (!m_isDownloading && checkUpdate())
    {
        createLayerItem();

        char str[128];
        sprintf(str, "%s%s%d.%d.%d.zip", SERVER_ADDRESS, ASSETS_SERVER_PATH, m_curBigVersion, m_curMidVersion, m_curSmallVersion + 1);
        getAssetsManager()->setPackageUrl(str);
        sprintf(str, "%d.%d.%d", m_curBigVersion, m_curMidVersion, m_curSmallVersion + 1);
        getAssetsManager()->setVersionFileUrl(str);
        getAssetsManager()->setStoragePath(m_pathToSave.c_str());

        //sprintf(str, Localization::getInstance()->getValueByKey("Loading_download_restBag_num"), m_endSmallVersion - m_curSmallVersion);
        //m_packegNumberLabel->setString(str);

        m_curPackageLength = 0;
        //getAssetsManager()->getPackageLength((long&)m_packageLength);

        m_isDownloading = true;
        download();
    }
}
Esempio n. 2
0
	TEST_F(UpdateThreadOldFixture, sameVersionSameApp_sameVersionDiffAppPoll)
	{
		setAppVersion(1, 2);
		setLastUpdateVersion(2, 2);

		ASSERT_TRUE(checkUpdate(3, 2));
	}
Esempio n. 3
0
/**
 * Constructor of the sourcesWindow, generating checkboxes and delete buttons
 * @param	selected	Bool list of currently selected websites, in the alphabetical order
 * @param	sites		QStringList of sites names
 * @param	parent		The parent window
 */
sourcesWindow::sourcesWindow(QList<bool> selected, QMap<QString, Site*> *sites, QWidget *parent) : QDialog(parent), ui(new Ui::sourcesWindow), m_selected(selected), m_sites(sites)
{
	ui->setupUi(this);

	bool checkall = true;
	for (int i = 0; i < selected.count(); i++)
	{
		if (!selected.at(i))
		{
			checkall = false;
			break;
		}
	}
	if (checkall)
	{ ui->checkBox->setChecked(true); }

    QSettings settings(savePath("settings.ini"), QSettings::IniFormat);

	addCheckboxes();

	ui->gridLayout->setColumnStretch(0, 1);
	connect(ui->checkBox, SIGNAL(clicked()), this, SLOT(checkClicked()));
	checkUpdate();

	// Check for updates in the model files
	checkForUpdates();

	ui->buttonOk->setFocus();
}
Esempio n. 4
0
	TEST_F(UpdateThreadOldFixture, sameVersionSameApp_newerVersionSameAppPoll)
	{
		setAppVersion(1, 2);
		setLastUpdateVersion(1, 3);

		ASSERT_FALSE(checkUpdate(1, 2));
	}
Esempio n. 5
0
	TEST_F(UpdateThreadOldFixture, newVersionSameApp_olderVersionSameAppPoll)
	{
		setAppVersion(1, 2);
		setLastUpdateVersion(1, 2);

		ASSERT_TRUE(checkUpdate(1, 3));
	}
Esempio n. 6
0
/** Constructor */
IdDialog::IdDialog(QWidget *parent)
: MainPage(parent)
{
	ui.setupUi(this);

	mEditDialog = NULL;
	//mPulseSelected = NULL;

	ui.radioButton_ListAll->setChecked(true);
	connect( ui.pushButton_NewId, SIGNAL(clicked()), this, SLOT(OpenOrShowAddDialog()));
	connect( ui.pushButton_EditId, SIGNAL(clicked()), this, SLOT(OpenOrShowEditDialog()));
	connect( ui.treeWidget_IdList, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection()));

	connect( ui.radioButton_ListYourself, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
	connect( ui.radioButton_ListFriends, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
	connect( ui.radioButton_ListOthers, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
	connect( ui.radioButton_ListPseudo, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );
	connect( ui.radioButton_ListAll, SIGNAL(toggled( bool ) ), this, SLOT(ListTypeToggled( bool ) ) );

	QTimer *timer = new QTimer(this);
	timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
	timer->start(1000);

	rsIdentity->generateDummyData();

	mIdQueue = new TokenQueue(rsIdentity, this);

}
Esempio n. 7
0
//每隔半小时会重新向文件服务器获取配置xml以更新软件数据
void CSMonitorClient::timerEvent(QTimerEvent *event)
{
	if(m_reqXMLTimerId == event->timerId())
	{
		downloadUpdateXmlFromServer();
		downloadHelpInfoXmlFromServer();
		checkUpdate();
	}
}
KDvoid AssetsManager::update ( KDvoid )
{
    // 1. Urls of package and version should be valid;
    // 2. Package should be a zip file.
    if ( m_sVersionFileUrl.size ( ) == 0 ||
         m_sPackageUrl.size ( ) == 0 ||
         std::string::npos == m_sPackageUrl.find ( ".zip" ) )
    {
        CCLOG ( "no version file url, or no package url, or the package is not a zip file" );
        return;
    }
    
    // Check if there is a new version.
    if ( !checkUpdate ( ) )
	{
		return;
	}
    
    // Is package already downloaded?
	std::string  sDownloadedVersion = CCUserDefault::sharedUserDefault ( )->getStringForKey ( KEY_OF_DOWNLOADED_VERSION );
    if ( sDownloadedVersion != m_sVersion )
    {
        if ( !downLoad ( ) )
		{
			return;
		}
        
        // Record downloaded version.
        CCUserDefault::sharedUserDefault ( )->setStringForKey ( KEY_OF_DOWNLOADED_VERSION, m_sVersion.c_str ( ) );
        CCUserDefault::sharedUserDefault ( )->flush ( );
    }
    
    // Uncompress zip file.
    if ( !uncompress_ ( ) )
	{
		return;
	}
    
    // Record new version code.
    CCUserDefault::sharedUserDefault ( )->setStringForKey ( KEY_OF_VERSION, m_sVersion.c_str ( ) );
    
    // Unrecord downloaded version code.
    CCUserDefault::sharedUserDefault ( )->setStringForKey ( KEY_OF_DOWNLOADED_VERSION, "" );
    
    CCUserDefault::sharedUserDefault ( )->flush ( );
    
    // Set resource search path.
    setSearchPath ( );
    
    // Delete unloaded zip file.
	std::string  sZipfileName = m_sStoragePath + TEMP_PACKAGE_FILE_NAME;
    if ( kdRemove ( sZipfileName.c_str ( ) ) != 0 )
    {
        CCLOG ( "can not remove downloaded zip file" );
    }
}
Esempio n. 9
0
void Updater::start()
{
    if(a_netManager->networkAccessible() != QNetworkAccessManager::NotAccessible)
    {
        qDebug() << "starting";
        checkUpdate();
    }
    else
        noNetworkError();
}
Esempio n. 10
0
int main (int argc, const char * argv[])
{    
    checkUpdate();
    
    for(;;)
    {
        checkFinder();
        
        sleep(5);
    }
    return 0;
}
int main() {
  bool verbose = false;
  checkUpdate(2,1,5,verbose);
  checkUpdate(2,1,9,verbose);
  checkUpdate(2,1,17,verbose);
  checkUpdate(2,2,21,verbose);
  checkUpdate(2,3,21,verbose);
  checkUpdate(2,2,13,verbose);
  cout << "updates b = 2 ok " << endl;
  checkUpdate(4,1,5);
  checkUpdate(4,1,9);
  checkUpdate(4,2,13);
  cout << "updates b = 4 ok" << endl;
  rangeSums(2,1,5,verbose);
  rangeSums(2,1,9,verbose);
  rangeSums(2,2,13,verbose);
  rangeSums(2,3,21,verbose);
  cout << "range sums b = 2 ok " << endl;
  rangeFirstMoments(2,1,5);
  rangeFirstMoments(2,1,9);
  rangeFirstMoments(2,2,13);
  rangeFirstMoments(2,3,21);
  cout << "range first moment b = 2 ok" << endl;
  checkConstantInterpolation(4,1,9);
  checkConstantInterpolation(4,2,13);
  checkConstantInterpolation(4,3,21);
  cout << "constant ok" << endl;
  checkLinearInterpolation(4,1,9);
  checkLinearInterpolation(4,2,13);
  checkLinearInterpolation(4,3,21);
  cout << "linear ok" << endl;
  rangeFirstMoments(4,1,5);
  rangeFirstMoments(4,1,9);
  rangeFirstMoments(4,2,13);
  cout << "range first moment b = 4 ok" << endl;
  rangeSums(4,1,5);
  rangeSums(4,1,9);
  rangeSums(4,2,13);
  rangeSums(4,3,21);
  cout << "range sums b = 4 ok " << endl;
  transformDeltas(4,1,9);
  transformDeltas(4,2,13);
  cout << "deltas ok " << endl;
  cout << "If you made it that far, the code should be mostly bug free." << endl;
}
Esempio n. 12
0
ThreadNet::ThreadNet(QObject *parent) : QThread(parent)
{
	tcp_server = new QTcpServer();
	connect(tcp_server, SIGNAL(newConnection()), this, SLOT(tcpSendData()));
	tcpInitServer();

	udp_socket = new QUdpSocket();
	udp_socket->bind(udp_port, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
	connect(udp_socket, SIGNAL(readyRead()), this, SLOT(udpProcessPendingDatagrams()));

	checkUpdate();
	setTimer();



}
Esempio n. 13
0
/** Constructor */
WikiDialog::WikiDialog(QWidget *parent)
: MainPage(parent)
{
	/* Invoke the Qt Designer generated object setup routine */
	ui.setupUi(this);

	mAddPageDialog = NULL;
	mAddGroupDialog = NULL;
	mEditDialog = NULL;

	connect( ui.toolButton_NewGroup, SIGNAL(clicked()), this, SLOT(OpenOrShowAddGroupDialog()));
	connect( ui.toolButton_NewPage, SIGNAL(clicked()), this, SLOT(OpenOrShowAddPageDialog()));
	connect( ui.toolButton_Edit, SIGNAL(clicked()), this, SLOT(OpenOrShowEditDialog()));
	connect( ui.toolButton_Republish, SIGNAL(clicked()), this, SLOT(OpenOrShowRepublishDialog()));

	// Usurped until Refresh works normally
	connect( ui.toolButton_Delete, SIGNAL(clicked()), this, SLOT(insertWikiGroups()));
	connect( ui.pushButton, SIGNAL(clicked()), this, SLOT(todo()));

	connect( ui.treeWidget_Pages, SIGNAL(itemSelectionChanged()), this, SLOT(groupTreeChanged()));


	// GroupTreeWidget.
	connect(ui.groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupListCustomPopupMenu(QPoint)));
	connect(ui.groupTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(wikiGroupChanged(QString)));


	QTimer *timer = new QTimer(this);
	timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
	timer->start(1000);

	/* setup TokenQueue */
	mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);


	/* Setup Group Tree */
	mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(IMAGE_FOLDER), true);
	mSubscribedGroups = ui.groupTreeWidget->addCategoryItem(tr("Subscribed Groups"), QIcon(IMAGE_FOLDERRED), true);
	mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(IMAGE_FOLDERGREEN), false);
	mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(IMAGE_FOLDERYELLOW), false);

  //Auto refresh seems not to work, temporary solution at start
  insertWikiGroups();

}
Esempio n. 14
0
bool Towerlayer::init()
{
	if(!Layer::init())
	{
		return false;
	}

	//¼àÌý´¥Ãþµ½ËþÉÏ¿ÉÒÔÉý¼¶
	auto listener = EventListenerTouchOneByOne::create();
	listener->onTouchBegan=[=](Touch *t,Event *e){
		checkPoint = this->convertTouchToNodeSpace(t);
		 
			 checkUpdate(checkPoint);
		  
		return true;
	};
	Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener,this);
	 return true;
}
void dlgCheckMaterialUpdates::downloadFinished(QNetworkReply *reply)
{
    QUrl url = reply->url();
    if (reply->error())
    {
        QMessageBox::warning(this,
                             tr("Material Update"),
                             tr("Cannot perform action.\n%1.").arg(reply->errorString()),
                             QMessageBox::Ok);
        return;
    }

    ui->lblLoading->setVisible(false);
    ui->lblStatus->clear();

    if (url.toString() == URLupdate)
        checkUpdate();
    else if(url.toString() == URLmaterialsFile)
        processDownload();
}
Esempio n. 16
0
void RbUtilQt::downloadBleedingDone(bool error)
{
    if(error) {
        qDebug() << "[RbUtil] network error:" << bleeding->error();
    }
    else {
        bleedingInfo.open();
        QSettings info(bleedingInfo.fileName(), QSettings::IniFormat, this);
        bleedingInfo.close();
        versmap.insert("bleed_rev", info.value("bleeding/rev").toString());
        versmap.insert("bleed_date", info.value("bleeding/timestamp").toString());
        qDebug() << "[RbUtil] version map:" << versmap;
        ui.statusbar->showMessage(tr("Download build information finished."), 5000);

        m_gotInfo = true;
        
        //start check for updates
        checkUpdate();
    }
}
Esempio n. 17
0
/** Constructor */
PhotoDialog::PhotoDialog(QWidget *parent)
: MainPage(parent)
{
  /* Invoke the Qt Designer generated object setup routine */
  ui.setupUi(this);

  connect( ui.peerTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( peerTreeWidgetCustomPopupMenu( QPoint ) ) );
  connect( ui.photoTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( photoTreeWidgetCustomPopupMenu( QPoint ) ) );

  connect( ui.peerTreeWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem * , QTreeWidgetItem * ) ), this, SLOT( updatePhotoList( ) ) );

  connect( ui.photoTreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem * , int ) ), this, SLOT( showPhoto( QTreeWidgetItem *, int ) ) );
  connect( ui.addButton, SIGNAL( clicked( ) ), this, SLOT( addPhotos( ) ) );
  connect( ui.expandButton, SIGNAL(clicked()), this, SLOT(togglefileview()));

  /* hide the Tree +/- */
  ui.photoTreeWidget -> setRootIsDecorated( false );

  QSize iconSize(PHOTO_ICON_SIZE,PHOTO_ICON_SIZE);
  ui.photoTreeWidget->setIconSize(iconSize);
  
  /* Set header resize modes and initial section sizes */
  QHeaderView * ptw_header = ui.peerTreeWidget->header () ;
  ptw_header->setResizeMode (0, QHeaderView::Interactive);

  ptw_header->resizeSection ( 0, 175 );



	/* Set a GUI update timer - much cleaner than
	 * doing everything through the notify agent 
	 */

  QTimer *timer = new QTimer(this);
  timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
  timer->start(1000);
}
Esempio n. 18
0
void RbUtilQt::downloadBleedingDone(bool error)
{
    if(error) {
        qDebug() << "[RbUtil] network error:" << bleeding->error();
        ui.statusbar->showMessage(tr("Can't get version information!"));
        QMessageBox::critical(this, tr("Network error"),
                tr("Can't get version information.\n"
                   "Network error: %1. Please check your network and proxy settings.")
                    .arg(bleeding->errorString()));
        return;
    }
    else {
        bleedingInfo.open();
        ServerInfo::readBleedingInfo(bleedingInfo.fileName());
        bleedingInfo.close();

        ui.statusbar->showMessage(tr("Download build information finished."), 5000);
        updateSettings();
        m_gotInfo = true;

        //start check for updates
        checkUpdate();
    }
}
Esempio n. 19
0
// Check for update
void TaskBarIcon::OnMenuUpdate(wxCommandEvent&)
{
	checkUpdate();
}
Esempio n. 20
0
/** Constructor */
LinksDialog::LinksDialog(RsPeers *peers, RsFiles *files, QWidget *parent)
: MainPage(parent), mPeers(peers), mFiles(files)
{
  /* Invoke the Qt Designer generated object setup routine */
  ui.setupUi(this);

  connect( ui.linkTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( linkTreeWidgetCostumPopupMenu( QPoint ) ) );


  /* link combos */
  connect( ui.rankComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( changedSortRank( int ) ) );
  connect( ui.periodComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( changedSortPeriod( int ) ) );
  connect( ui.fromComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( changedSortFrom( int ) ) );
  connect( ui.topComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( changedSortTop( int ) ) );

  /* add button */
  connect( ui.addButton, SIGNAL( clicked( void ) ), this, SLOT( addLinkComment( void ) ) );
  connect( ui.expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggleWindows( void ) ) );
  
  connect( ui.addToolButton, SIGNAL( clicked( ) ), this, SLOT( addNewLink( ) ) );

  connect( ui.linkTreeWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem * ) ),
  		this, SLOT( changedItem ( QTreeWidgetItem *, QTreeWidgetItem * ) ) );

  connect( ui.linkTreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int ) ),
  		this, SLOT( openLink ( QTreeWidgetItem *, int ) ) );

  connect( ui.anonBox, SIGNAL( stateChanged ( int ) ), this, SLOT( checkAnon ( void  ) ) );

  mStart = 0;


    /* Set header resize modes and initial section sizes */
	QHeaderView * _header = ui.linkTreeWidget->header () ;
  _header->setResizeMode (0, QHeaderView::Interactive);
	_header->setResizeMode (1, QHeaderView::Interactive);
	_header->setResizeMode (2, QHeaderView::Interactive);

	_header->resizeSection ( 0, 400 );
	_header->resizeSection ( 1, 60 );
	_header->resizeSection ( 2, 150 );

	ui.linkTreeWidget->setSortingEnabled(true);
	
	ui.linklabel->setMinimumWidth(20);


	/* Set a GUI update timer - much cleaner than
	 * doing everything through the notify agent
	 */

  QTimer *timer = new QTimer(this);
  timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
  timer->start(1000);

  /* Hide platform specific features */
#ifdef Q_WS_WIN

#endif

}
Esempio n. 21
0
	TEST_F(UpdateThreadOldFixture, sameVersionDiffApp)
	{
		setAppVersion(1, 2);
		ASSERT_TRUE(checkUpdate(2, 2));
	}
Esempio n. 22
0
BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
    QMainWindow(parent),
    clientModel(0),
    walletFrame(0),
    unitDisplayControl(0),
    labelEncryptionIcon(0),
    labelConnectionsIcon(0),
    labelBlocksIcon(0),
    progressBarLabel(0),
    progressBar(0),
    progressDialog(0),
    appMenuBar(0),
    toolbar(0),
    tabGroup(0),
    overviewAction(0),
    historyAction(0),
    masternodeAction(0),
    systemnodeAction(0),
    quitAction(0),
    sendCoinsAction(0),
    usedSendingAddressesAction(0),
    usedReceivingAddressesAction(0),
    signMessageAction(0),
    verifyMessageAction(0),
    aboutAction(0),
    updateAction(0),
    receiveCoinsAction(0),
    optionsAction(0),
    toggleHideAction(0),
    encryptWalletAction(0),
    backupWalletAction(0),
    changePassphraseAction(0),
    aboutQtAction(0),
    openRPCConsoleAction(0),
    openAction(0),
    showHelpMessageAction(0),
    trayIcon(0),
    trayIconMenu(0),
    notificator(0),
    rpcConsole(0),
    prevBlocks(0),
    spinnerFrame(0),
    updateChecked(false)
{
    /* Open CSS when configured */
    this->setStyleSheet(GUIUtil::loadStyleSheet());

    GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this);

    QString windowTitle = tr("Crown Core") + " - ";
#ifdef ENABLE_WALLET
    /* if compiled with wallet support, -disablewallet can still disable the wallet */
    enableWallet = !GetBoolArg("-disablewallet", false);
#else
    enableWallet = false;
#endif // ENABLE_WALLET
    if(enableWallet)
    {
        windowTitle += tr("Wallet");
    } else {
        windowTitle += tr("Node");
    }
    QString userWindowTitle = QString::fromStdString(GetArg("-windowtitle", ""));
    if(!userWindowTitle.isEmpty()) windowTitle += " - " + userWindowTitle;
    windowTitle += " " + networkStyle->getTitleAddText();
#ifndef Q_OS_MAC
    QApplication::setWindowIcon(networkStyle->getAppIcon());
    setWindowIcon(networkStyle->getAppIcon());
#else
    MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon());
#endif
    setWindowTitle(windowTitle);

#if defined(Q_OS_MAC) && QT_VERSION < 0x050000
    // This property is not implemented in Qt 5. Setting it has no effect.
    // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras.
    setUnifiedTitleAndToolBarOnMac(true);
#endif

    rpcConsole = new RPCConsole(enableWallet ? this : 0);
#ifdef ENABLE_WALLET
    if(enableWallet)
    {
        /** Create wallet frame and make it the centralish widget */
        walletFrame = new WalletFrame(this);
        walletFrame->setMinimumWidth(650);
        walletFrame->setMinimumHeight(500);
    } else
#endif // ENABLE_WALLET
    {
        /* When compiled without wallet or -disablewallet is provided,
         * the central widget is the rpc console.
         */
        setCentralWidget(rpcConsole);
    }

    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
    // Needs walletFrame to be initialized
    createActions(networkStyle);

    // Create application menu bar
    createMenuBar();

    // Create the toolbars
    createToolBars();

    // Create system tray icon and notification
    createTrayIcon(networkStyle);

    // Create status bar
    statusBar();

    // Status bar notification icons
    QFrame *frameBlocks = new QFrame();
    frameBlocks->setContentsMargins(0,0,0,0);
    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
    frameBlocksLayout->setContentsMargins(3,0,3,0);
    frameBlocksLayout->setSpacing(3);
    unitDisplayControl = new UnitDisplayStatusBarControl();
    labelEncryptionIcon = new QLabel();
    labelConnectionsIcon = new QPushButton();
    labelConnectionsIcon->setFlat(true); // Make the button look like a label, but clickable
    labelConnectionsIcon->setStyleSheet(".QPushButton { background-color: rgba(255, 255, 255, 0); border: none;}");
    labelConnectionsIcon->setMaximumSize(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
    labelBlocksIcon = new QLabel();
    if(enableWallet)
    {
        frameBlocksLayout->addStretch();
        frameBlocksLayout->addWidget(unitDisplayControl);
        frameBlocksLayout->addStretch();
        frameBlocksLayout->addWidget(labelEncryptionIcon);
    }
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelConnectionsIcon);
    frameBlocksLayout->addStretch();
    frameBlocksLayout->addWidget(labelBlocksIcon);
    frameBlocksLayout->addStretch();

    // Progress bar and label for blocks download
    progressBarLabel = new QLabel();
    progressBarLabel->setVisible(true);
    progressBar = new GUIUtil::ProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->setVisible(true);

    // Override style sheet for progress bar for styles that have a segmented progress bar,
    // as they make the text unreadable (workaround for issue #1071)
    // See https://qt-project.org/doc/qt-4.8/gallery.html
    QString curStyle = QApplication::style()->metaObject()->className();
    if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
    {
        progressBar->setStyleSheet("QProgressBar { background-color: #F8F8F8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #00CCFF, stop: 1 #33CCFF); border-radius: 7px; margin: 0px; }");
    }

    statusBar()->addWidget(progressBarLabel);
    statusBar()->addWidget(progressBar);
    statusBar()->addPermanentWidget(frameBlocks);

    // Jump directly to tabs in RPC-console
    connect(openInfoAction, SIGNAL(triggered()), rpcConsole, SLOT(showInfo()));
    connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(showConsole()));
    connect(openNetworkAction, SIGNAL(triggered()), rpcConsole, SLOT(showNetwork()));
    connect(openPeersAction, SIGNAL(triggered()), rpcConsole, SLOT(showPeers()));
    connect(openRepairAction, SIGNAL(triggered()), rpcConsole, SLOT(showRepair()));
    connect(openConfEditorAction, SIGNAL(triggered()), rpcConsole, SLOT(showConfEditor()));
    connect(showBackupsAction, SIGNAL(triggered()), rpcConsole, SLOT(showBackups()));
    connect(labelConnectionsIcon, SIGNAL(clicked()), rpcConsole, SLOT(showPeers()));

    // Get restart command-line parameters and handle restart
    connect(rpcConsole, SIGNAL(handleRestart(QStringList)), this, SLOT(handleRestart(QStringList)));
    
    // prevents an open debug window from becoming stuck/unusable on client shutdown
    connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));

    // Install event filter to be able to catch status tip events (QEvent::StatusTip)
    this->installEventFilter(this);

    // Initially wallet actions should be disabled
    setWalletActionsEnabled(false);

    // Subscribe to notifications from core
    subscribeToCoreSignals();

    if (GetBoolArg("-updateautocheck", true))
    {
        // Check update after 10 seconds
        QTimer::singleShot(10000, this, SLOT(checkUpdate()));
    }
}
Esempio n. 23
0
// Нажата кнопка принудительного обновления
void launcherSettings::on_launchCheckUpdate_clicked() {
    qInfo() << "launcherSettings::on_launchCheckUpdate_clicked: Check update clicked";

    emit checkUpdate();
}
Esempio n. 24
0
/** Constructor */
BlogsDialog::BlogsDialog(QWidget *parent)
: MainPage (parent)
{
  	/* Invoke the Qt Designer generated object setup routine */
  	setupUi(this);

  	connect(actionCreate_Blog, SIGNAL(triggered()), this, SLOT(createBlog()));
  	connect(postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
  	connect(subscribeButton, SIGNAL( clicked( void ) ), this, SLOT( subscribeBlog ( void ) ) );
  	connect(unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeBlog ( void ) ) );
  	
    connect(treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(selectBlog(const QModelIndex &)));
    connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(toggleSelection(const QModelIndex &)));
    connect(treeView, SIGNAL(customContextMenuRequested( QPoint ) ), this, SLOT( blogListCustomPopupMenu( QPoint ) ) );

  	mBlogId = "";
  	mPeerId = rsPeers->getOwnId(); // add your id

    model = new QStandardItemModel(0, 2, this);
    model->setHeaderData(0, Qt::Horizontal, tr("Name"), Qt::DisplayRole);
    model->setHeaderData(1, Qt::Horizontal, tr("ID"), Qt::DisplayRole);

    treeView->setModel(model);
    treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);

    treeView->setItemDelegate(new ChanGroupDelegate());

    // hide header and id column
    treeView->setHeaderHidden(true);
    treeView->hideColumn(1);
    
    itemFont = QFont("ARIAL", 10);
    itemFont.setBold(true);
	
    QStandardItem *OwnBlogs = new QStandardItem(tr("My Blogs"));
    OwnBlogs->setForeground(QBrush(QColor(79, 79, 79)));
    OwnBlogs->setFont(itemFont);
    
    QStandardItem *SubscribedBlogs = new QStandardItem(tr("Subscribed Blogs"));
    SubscribedBlogs->setForeground(QBrush(QColor(79, 79, 79)));
    SubscribedBlogs->setFont(itemFont);

    QStandardItem *PopularBlogs = new QStandardItem(tr("Popular Blogs"));
    PopularBlogs->setForeground(QBrush(QColor(79, 79, 79)));
    PopularBlogs->setFont(itemFont);

    QStandardItem *OtherBlogs = new QStandardItem(tr("Other Blogs"));
    OtherBlogs->setForeground(QBrush(QColor(79, 79, 79)));        
    OtherBlogs->setFont(itemFont);

    model->appendRow(OwnBlogs);
    model->appendRow(SubscribedBlogs);
    model->appendRow(PopularBlogs);
    model->appendRow(OtherBlogs);

    //added from ahead
    updateBlogList();

    mBlogFont = QFont("MS SANS SERIF", 22);
    nameLabel->setFont(mBlogFont);    
    nameLabel->setMinimumWidth(20);
		   
    QMenu *blogmenu = new QMenu();
    blogmenu->addAction(actionCreate_Blog); 
    blogmenu->addSeparator();
    blogpushButton->setMenu(blogmenu);
	
    QTimer *timer = new QTimer(this);
    timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
    timer->start(1000);
}
Esempio n. 25
0
	TEST_F(UpdateThreadOldFixture, sameVersionSameApp)
	{
		setAppVersion(1, 2);
		ASSERT_FALSE(checkUpdate(1, 2));
	}
Esempio n. 26
0
// Called when changes to an entry will affect the Store.
void
Bootcache::flagForUpdate ()
{
    m_needsUpdate = true;
    checkUpdate ();
}
Esempio n. 27
0
CSMonitorClient::CSMonitorClient(QWidget *parent)
	: QFrame(parent)
	, m_bPressed(false)
{
	ClientLogger->AddLog(QString::fromLocal8Bit("客户端版本号【%1】 电话号码【%2】").arg(MessageDataMediator->m_strClientVersion).arg(MessageDataMediator->m_strNewId));

	//setWindowIcon(QIcon(":/Resources/normal.png"));
	setMinimumSize(QSize(900, 600));

 	m_pMessageEventMediator = NetClass->m_pMessageEventMediator;
 	m_pNetClient = NetClass->m_pNetClt;
	//connect(m_pMessageEventMediator, &CMessageEventMediator::sigServerHasGetSoftInstall, SoftInstallResultSendManager, &CSoftInstallResultSendThread::serverHasGetSoftInstall);
	//SoftInstallResultSendManager->Start(QApplication::applicationDirPath() + "/updateTask.xml");

	setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
	setObjectName("mainFrame");
	//setWidgetStyleSheet(":/Resources/blue.css");

	m_titleWidget = new CTitleWidget(this);
	m_titleWidget->setParent(this);
	//m_titleWidget->setCloseButtonHint(false);
	m_titleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	m_titleWidget->setTitle(QString::fromLocal8Bit("SMonitor软件安装/升级管理系统(正式版)"));

	m_trayIcon = new CSystemTrayIcon(this);
	m_trayIcon->setHidden(true);
	m_trayIcon->show();
	
	m_stackedWidget = new QStackedWidget(this);
	m_sideBarWidget = new CSideBarWidget(this);
	initTabWidget();

	m_sideBarWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	//m_sideBarWidget->setMinimumHeight(300);
	connect(m_sideBarWidget, &CSideBarWidget::currentIndexChanged, 
		m_stackedWidget, &QStackedWidget::setCurrentIndex);

	QHBoxLayout* hBoxLayout = new QHBoxLayout;
	hBoxLayout->setMargin(0);
	hBoxLayout->setSpacing(0);
	hBoxLayout->addWidget(m_sideBarWidget);
	hBoxLayout->addWidget(m_stackedWidget);

	QVBoxLayout* mainLayout = new QVBoxLayout(this);
	mainLayout->setMargin(0);
	mainLayout->setSpacing(0);
	mainLayout->addWidget(m_titleWidget);
	mainLayout->addLayout(hBoxLayout);

	connect(m_trayIcon, &CSystemTrayIcon::activated, this, &CSMonitorClient::activedByTrayIcon);
	connect(m_trayIcon, &CSystemTrayIcon::hideOrShowWidget, this, &CSMonitorClient::hideOrShow);
	connect(m_trayIcon, &CSystemTrayIcon::quitApplication, this, &CSMonitorClient::close);
	//connect(m_trayIcon, &CSystemTrayIcon::aboutApplication, this, &CSMonitorClient::about);
	connect(m_trayIcon, &CSystemTrayIcon::messageClicked, this, &CSMonitorClient::updateArrived);
	connect(m_titleWidget, &CTitleWidget::minimumzed, this, &CSMonitorClient::setMinimumed);
	connect(m_titleWidget, &CTitleWidget::closed, this, &CSMonitorClient::setMinimumed);
	connect(SoftManager, &CSoftManager::quitApplication, this, &CSMonitorClient::close);

	//首先需要加载本地保存的数据
	CategoryFactory->LoadLocalData();

	//加载缓存
	CategoryFactory->CheckUpgradeData();

	connect(CategoryFactory, &CCategoryFactory::upgradeNotify, m_trayIcon, &CSystemTrayIcon::setState);
	//如果服务器断开,则加载上一次下载的服务器数据
	//if(!NetClass->m_pNetClt->m_bIsOnLine){
	//	CategoryFactory->CheckUpgradeData();
	//	ClientLogger->AddLog(QString::fromLocal8Bit("客户端连接服务器异常,加载前一次下载至本地的配置数据"));
	//}
	connect(SoftManager, &CSoftManager::InstallFinished, CategoryFactory, &CCategoryFactory::InstallFinished);
	
	//CXmlParse::Instance()->LoadLocalData();
	//connect(CXmlParse::Instance(), &CXmlParse::upgradeNotify, m_trayIcon, &CSystemTrayIcon::setState);
	//connect(CXmlParse::Instance(), &CXmlParse::upgradeFinished, m_trayIcon, &CSystemTrayIcon::setState);

	//CHTTPDownloader* gHTTPDownload = new CHTTPDownloader(this);
	//gHTTPDownload->downloadFileSync(QString::fromLocal8Bit("http://127.0.0.1:8000/83001 - 副本.zip"), "D:\\test\\3.jpg", 0, true);

	//ClientLogger->AddLog(QString::fromLocal8Bit("客户端启动"));
	connect(m_pMessageEventMediator, &CMessageEventMediator::sigGetXml, this, &CSMonitorClient::setServerXmlUrl);

	//半小时申请一次
	m_reqXMLTimerId = startTimer(60000 * 30);

	SoftManager->Start();

	downloadUpdateXmlFromServer();
	downloadHelpInfoXmlFromServer();
	checkUpdate();
}
Esempio n. 28
0
void
Bootcache::periodicActivity ()
{
    checkUpdate();
}
Esempio n. 29
0
void UpdateChecker::run() {
    checkUpdate();
}
Esempio n. 30
0
	TEST_F(UpdateThreadOldFixture, newVersionSameApp)
	{
		setAppVersion(1, 2);
		ASSERT_TRUE(checkUpdate(1, 3));
	}