Exemple #1
0
SelectiveInstallWidget::SelectiveInstallWidget(QWidget* parent) : QWidget(parent)
{
    ui.setupUi(this);
    ui.rockboxCheckbox->setChecked(RbSettings::value(RbSettings::InstallRockbox).toBool());
    ui.fontsCheckbox->setChecked(RbSettings::value(RbSettings::InstallFonts).toBool());
    ui.themesCheckbox->setChecked(RbSettings::value(RbSettings::InstallThemes).toBool());
    ui.gamefileCheckbox->setChecked(RbSettings::value(RbSettings::InstallGamefiles).toBool());

    // check if Rockbox is installed by looking after rockbox-info.txt.
    // If installed uncheck bootloader installation.
    RockboxInfo info(m_mountpoint);
    ui.bootloaderCheckbox->setChecked(!info.success());

    m_logger = NULL;
    m_zipinstaller = NULL;
    m_themesinstaller = NULL;

    connect(ui.installButton, SIGNAL(clicked()), this, SLOT(startInstall()));
    connect(this, SIGNAL(installSkipped(bool)), this, SLOT(continueInstall(bool)));
    connect(ui.themesCustomize, SIGNAL(clicked()), this, SLOT(customizeThemes()));
    connect(ui.selectedVersion, SIGNAL(currentIndexChanged(int)),
            this, SLOT(selectedVersionChanged(int)));
    // update version information. This also handles setting the previously
    // selected build type and bootloader disabling.
    updateVersion();
}
Exemple #2
0
idupdaterui::idupdaterui( QObject *parent )
:	QWidget()
{
	setupUi( this );
	connect( parent, SIGNAL(status(QString)), m_updateStatus, SLOT(setText(QString)) );
	connect( buttonBox, SIGNAL(accepted()), parent, SLOT(startInstall()) );
	connect( buttonBox, SIGNAL(rejected()), qApp, SLOT(quit()) );
	buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
	buttonBox->button( QDialogButtonBox::Ok )->setText( tr("Start downloading") );
	buttonBox->button( QDialogButtonBox::Close )->setText( tr("Close") );
	show();
}
/**
 * Construct the popup
 * Add extra widgets to the passive popup & connect buttons to mainwindow signals.
 */
OSUpdaterPopup::OSUpdaterPopup(QWidget * parent,MainWindow * mainWindow) : KPassivePopup(parent)
{
	setTimeout(30000);

	_popupLayout = new QVBoxLayout(this, 11, 20, "popupLayout");

	_titleLayout = new QHBoxLayout(_popupLayout,KDialog::spacingHint(),"titleLayout");

	_title = new QLabel("<b>openSUSE updater.</b>",this);
	_title->setTextFormat(Qt::RichText);
	_title->setAlignment(Qt::SingleLine);

	_closeButton = new QPushButton("x",this,"closebutton");
	_closeButton->setMinimumSize(QSize(20,20));
	_closeButton->setMaximumSize(QSize(20,20));
	connect(_closeButton, SIGNAL(clicked()),this, SLOT(hide()));

	_titleLayout->addWidget(_title);
	_titleLayout->addStretch();
	_titleLayout->addWidget(_closeButton);
	
	_description = new QLabel(this);

	KIconLoader *loader = KGlobal::iconLoader();
	QPixmap icon = loader->loadIcon("msg_warning",KIcon::Panel);
	_iconLabel = new QLabel(this);
	_iconLabel->setPixmap(icon);
	_descriptionLayout = new QHBoxLayout(_popupLayout,KDialog::spacingHint(),"descriptionlayout");

	_descriptionLayout->addWidget(_iconLabel);
	_descriptionLayout->addWidget(_description);
	
	_buttonLayout = new QHBoxLayout(_popupLayout,KDialog::spacingHint(),"buttonLayout");

	_installButton = new QPushButton(i18n("Install"),this,"installbutton");
	_cancelButton = new QPushButton(i18n("Ignore"),this,"ignorebutton");
	connect(_cancelButton, SIGNAL(clicked()),this, SLOT(hide()));
	connect(_installButton, SIGNAL(clicked()),mainWindow, SIGNAL(startInstall()));
	connect(_installButton, SIGNAL(clicked()),this, SLOT(hide()));

	_buttonLayout->addStretch();
	_buttonLayout->addWidget(_installButton);
	_buttonLayout->addWidget(_cancelButton);
	_buttonLayout->addStretch();
}
ToolTransactionId ToolManager::installTools(Misc::ToolTransaction* transaction)
{
	if (!areAllToolsValid(transaction->toolsList))
	{
		safe_delete(transaction);
		return -1;
	}

	if (areAllToolsInstalled(transaction->toolsList))
	{
		safe_delete(transaction);
		return -2;	
	}

	Misc::ToolTransInfo* info = new Misc::ToolTransInfo(false, transaction, this);

	m_MapLock.lock();

	ToolTransactionId ttid = m_uiLastTransId;
	m_uiLastTransId++;
	m_mTransactions[ttid] = info;

	m_MapLock.unlock();


	std::vector<DesuraId> idList;
	info->getIds(idList);

	for (size_t x=0; x<idList.size(); x++)
	{
		DesuraId id = idList[x];
		ToolInfo* tool = findItem(id.toInt64());

		//This should not happen as there is a check before a install starts to make sure all tool ids are valid
		if (!tool)
			continue;

		if (tool->isInstalled())
			info->removeItem(id);
	}

	startInstall(ttid);
	return ttid;
}
UpdaterApplication::UpdaterApplication() : KUniqueApplication(true,true,false)
{

  int backend = UpdaterSettings::self()->backend();
  
 	if ( backend == UpdaterSettings::EnumBackend::zmd )
  {
      kdDebug() << "Using ZMD backend..." << endl;
 			updater = new ZmdUpdater();
  }
 	else if ( backend == UpdaterSettings::EnumBackend::zypp )
  {
      kdDebug() << "Using ZYPP backend..." << endl;
      updater = new ZYppUpdater();
  }
  else
  {
      kdDebug() << "No backend selected. Using ZYPP backend..." << endl;
 			updater = new ZYppUpdater();
      kdDebug() << "backend initialized" << endl;
 	}

	main = new MainWindow(updater->capabilities());
	setMainWidget(main);

	//Connects the signals 

	//Signal that controls applet state
	connect(updater, SIGNAL(updateApplet(int, int)), main, SLOT(slotAppletState(int, int)));

  connect(updater, SIGNAL(updateAppletError(const QString &)), main, SLOT(slotAppletError(const QString &)));
  
	//Signal which allows updater "plugins" to force an update refresh
	connect(updater, SIGNAL(refreshList()), main, SLOT(checkUpdates()));

	//Signal to hide selection buttons if updater doesn't pack QCheckListItems
	connect(updater, SIGNAL(disableSelectButtons()), main, SLOT(disableSelectButtons()));

	//Starts installation
	connect(main, SIGNAL(startInstall()), updater, SLOT(startInstall()));

	//Starts updater backend configuration
	connect(main, SIGNAL(configureUpdater()), updater, SLOT(configureUpdater()));

	//Start update list populate, makes backend check for updates
	connect(main, SIGNAL(populateUpdateList(QListView*)), updater, SLOT(populateUpdateList(QListView*)));

	//Signal to inform the mainwindow of new updates in the list
	connect(updater, SIGNAL(populateDone()), main, SLOT(populateDone()));

	//Signals to get backend to put together a description for selected update and to return that description
	connect(main, SIGNAL(updateSelected(QListViewItem*)), updater, SLOT(updateSelected(QListViewItem*)));
	connect(updater, SIGNAL(returnDescription(QString)), main, SLOT(gotDescription(QString)));

	//Signal to tell the backend to show a menu at the specified position
	connect(main, SIGNAL(updateMenu(QListViewItem*, const QPoint&)), updater, SLOT(updateMenu(QListViewItem*, const QPoint&)));

  // signal to tell the gui that install are allowed or not
  connect( updater, SIGNAL(installAllowed(bool)), main, SLOT(slotInstallAllowed(bool)));
  
	main->checkUpdates();

}
Exemple #6
0
/**
  Post construction initialization, done after event loop
  displays the gui
*/
void PackageView::init()
{
    //setup context menu for installed packages
    QWidget * installedPage = tabWidget->widget( 0 );
    QMenu *installedContext = QSoftMenuBar::menuFor( installedPage );
    detailsAction = new QAction( tr("Details"), this);
    detailsAction->setVisible( false );
    connect( detailsAction, SIGNAL(triggered()), this, SLOT(displayDetails()) );

    uninstallAction = new QAction( tr("Uninstall"), installedPage );
    uninstallAction->setVisible( false );
    connect( uninstallAction, SIGNAL(triggered()), this, SLOT(startUninstall()) );

    reenableAction = new QAction( tr("Re-enable"), installedPage );
    reenableAction->setVisible( false );
    connect( reenableAction, SIGNAL(triggered()), this, SLOT(confirmReenable()) );

    installedContext->addAction( detailsAction );
    installedContext->addAction( uninstallAction );
    installedContext->addAction( reenableAction );
    connect( installedContext, SIGNAL(aboutToShow()),
                this,   SLOT(contextMenuShow()) );

    //setup context menu for downloadable packages
    QWidget * downloadPage = tabWidget->widget( 1 );
    QMenu *downloadContext = QSoftMenuBar::menuFor( tabWidget->widget(1) );
    installAction = new QAction( tr("Install"), downloadPage );
    installAction->setVisible( false );
    connect( installAction, SIGNAL(triggered()), this, SLOT(startInstall()) );

    menuServers = new QMenu( tr( "Connect" ), this );

    QAction* editServersAction = new QAction( tr( "Edit servers" ), this );
    connect( editServersAction, SIGNAL(triggered()), this, SLOT(editServers()) );

    downloadContext->addMenu( menuServers );
    downloadContext->addAction( detailsAction );
    downloadContext->addAction( installAction );
    downloadContext->addAction( editServersAction );

    connect( downloadContext, SIGNAL(aboutToShow()),
                this,   SLOT(contextMenuShow()) );

    model->populateServers();
    QStringList servers = model->getServers();
    qSort( servers );
    QAction *sa;
    serversActionGroup = new QActionGroup( this );
    serversActionGroup->setExclusive( true );
    connect( serversActionGroup, SIGNAL(triggered(QAction*)),
             this, SLOT(serverChoice(QAction*)) );
    for ( int i = 0; i < servers.count(); i++ )
    {
        sa = new QAction( servers[i], serversActionGroup );
        serversActionGroup->addAction( sa );
    }
    menuServers->addActions( serversActionGroup->actions() );

    targetActionGroup = new QActionGroup( this );
    targetActionGroup->setExclusive( true );
    connect( targetActionGroup, SIGNAL(triggered(QAction*)),
            this, SLOT(targetChoice(QAction*)) );

     waitWidget = new QWaitWidget( this );
}