summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp8
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp2
4 files changed, 13 insertions, 13 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index a09bc30..7f1c0b8 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -83,214 +83,214 @@ void MainWindow::makeMenu()
{
QToolBar *toolBar = new QToolBar( this );
QMenuBar *menuBar = new QMenuBar( toolBar );
QPopupMenu *srvMenu = new QPopupMenu( menuBar );
QPopupMenu *viewMenu = new QPopupMenu( menuBar );
QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
QPopupMenu *helpMenu = new QPopupMenu( menuBar );
setToolBarsMovable( false );
toolBar->setHorizontalStretchable( true );
menuBar->insertItem( tr( "Package" ), srvMenu );
menuBar->insertItem( tr( "View" ), viewMenu );
menuBar->insertItem( tr( "Settings" ), cfgMenu );
menuBar->insertItem( tr( "Help" ), helpMenu );
// QLabel *spacer;
// spacer = new QLabel( "", toolBar );
// spacer->setBackgroundColor( toolBar->backgroundColor() );
// toolBar->setStretchableWidget( spacer );
runAction = new QAction( tr( "Apply" ),
Resource::loadPixmap( "oipkg/install" ),
QString::null, 0, this, 0 );
connect( runAction, SIGNAL( activated() ),
this, SLOT( runIpkg() ) );
runAction->addTo( toolBar );
runAction->addTo( srvMenu );
srvMenu->insertSeparator();
updateAction = new QAction( tr( "Update" ),
Resource::loadIconSet( "oipkg/update" ),
QString::null, 0, this, 0 );
connect( updateAction, SIGNAL( activated() ),
this , SLOT( updateList() ) );
updateAction->addTo( toolBar );
updateAction->addTo( srvMenu );
QAction *cfgact;
cfgact = new QAction( tr( "Setups" ),
QString::null, 0, this, 0 );
connect( cfgact, SIGNAL( activated() ),
SLOT( showSettingsSetup() ) );
cfgact->addTo( cfgMenu );
cfgact = new QAction( tr( "Servers" ),
QString::null, 0, this, 0 );
connect( cfgact, SIGNAL( activated() ),
SLOT( showSettingsSrv() ) );
cfgact->addTo( cfgMenu );
cfgact = new QAction( tr( "Destinations" ),
QString::null, 0, this, 0 );
connect( cfgact, SIGNAL( activated() ),
SLOT( showSettingsDst() ) );
cfgact->addTo( cfgMenu );
QAction *a;
// SECTIONS
sectionBar = new QToolBar( this );
addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE );
sectionBar->setHorizontalStretchable( true );
QLabel *label = new QLabel( sectionBar, "section" );
// label->setBackgroundMode( NoBackground );
label->font().setPointSize( 8 );
label->setText( tr( "Section:" ) );
sectionBar->setStretchableWidget( label );
section = new QComboBox( false, sectionBar );
section->font().setPointSize( 8 );
label = new QLabel( " / ", sectionBar );
label->font().setPointSize( 8 );
// label->setBackgroundMode( PaletteForeground );
subsection = new QComboBox( false, sectionBar );
subsection->font().setPointSize( 8 );
a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) );
a->addTo( sectionBar );
setSections();
setSubSections();
sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) );
sectionAction->setToggleAction( true );
sectionAction->addTo( viewMenu );
// sectionBar->setStretchableWidget( section );
//FIND
findBar = new QToolBar(this);
addToolBar( findBar, "Filter", QMainWindow::Top, TRUE );
label = new QLabel( tr("Filter: "), findBar );
// label->setBackgroundMode( PaletteForeground );
findBar->setHorizontalStretchable( TRUE );
findEdit = new QLineEdit( findBar, "findEdit" );
findBar->setStretchableWidget( findEdit );
- connect( findEdit, SIGNAL( textChanged( const QString & ) ),
+ connect( findEdit, SIGNAL( textChanged(const QString&) ),
this, SLOT( displayList() ) );
a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
a->addTo( findBar );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( findBar );
findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 );
connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
findAction->setToggleAction( true );
findAction->addTo( viewMenu );
//SEARCH
searchBar = new QToolBar(this);
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
label = new QLabel( tr("Search: "), searchBar );
// label->setBackgroundMode( PaletteForeground );
searchBar->setHorizontalStretchable( TRUE );
searchEdit = new QLineEdit( searchBar, "seachEdit" );
searchBar->setStretchableWidget( searchEdit );
-// connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
+// connect( searchEdit, SIGNAL( textChanged(const QString&) ),
// this, SLOT( displayList() ) );
a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
a->addTo( searchBar );
searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) );
searchCommit->addTo( searchBar );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) );
a->addTo( searchBar );
searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 );
connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
searchAction->setToggleAction( true );
searchAction->addTo( viewMenu );
//DEST
destBar = new QToolBar(this);
addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
label = new QLabel( tr("Destination: "), destBar );
// label->setBackgroundMode( PaletteForeground );
destBar->setHorizontalStretchable( TRUE );
destination = new QComboBox( false, destBar );
destination->insertStringList( settings->getDestinationNames() );
setComboName(destination,settings->getDestinationName());
connect( destination, SIGNAL(activated(int)),
settings, SLOT(activeDestinationChange(int)) );
// space->setBackgroundMode( PaletteForeground );
CheckBoxLink = new QCheckBox( tr("Link"), destBar);
// CheckBoxLink->setBackgroundMode( PaletteForeground );
CheckBoxLink->setChecked( settings->createLinks() );
connect( CheckBoxLink, SIGNAL(toggled(bool)),
settings, SLOT(linkEnabled(bool)) );
destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
a->addTo( destBar );
destBar->setStretchableWidget( CheckBoxLink );
destAction->setToggleAction( true );
destAction->addTo( viewMenu );
// helpMenu
helpMenu->insertSeparator();
a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
helpMenu->insertSeparator();
a = new QAction( tr( "Install" ),
Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
a = new QAction( tr( "Remove" ),
Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
helpMenu->insertSeparator();
a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
helpMenu->insertSeparator();
a = new QAction( tr( "New version, installed" ),
Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
a = new QAction( tr( "New version, not installed" ),
Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
a = new QAction( tr( "Old version, installed" ),
Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
a = new QAction( tr( "Old version, not installed" ),
Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
a = new QAction( tr( "Old version, new version installed" ),
Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
a = new QAction( tr( "New version, old version installed" ),
Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 );
a->addTo( helpMenu );
// a = new QAction( tr( "" ),
// Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 );
// a->addTo( helpMenu );
// configure the menus
Config cfg( "oipkg", Config::User );
cfg.setGroup( "gui" );
findShow( cfg.readBoolEntry( "findBar", true ) );
searchShow( cfg.readBoolEntry( "searchBar", true ) );
sectionShow( cfg.readBoolEntry( "sectionBar", true ) );
destShow( cfg.readBoolEntry( "destBar", false ) );
setComboName(section,cfg.readEntry("default_section"));
sectionChanged();
}
MainWindow::~MainWindow()
{
Config cfg( "oipkg", Config::User );
cfg.setGroup( "gui" );
cfg.writeEntry( "findBar", !findBar->isHidden() );
cfg.writeEntry( "searchBar", !searchBar->isHidden() );
@@ -375,141 +375,141 @@ void MainWindow::setSections()
{
section->clear();
section->insertStringList( packageListServers.getSections() );
}
void MainWindow::setSubSections()
{
subsection->clear();
subsection->insertStringList( packageListServers.getSubSections() );
}
void MainWindow::showSettings(int i)
{
if ( settings->showDialog( i ) )
{
updateList();
}
setComboName(destination,settings->getDestinationName());
CheckBoxLink->setChecked( settings->createLinks() );
}
void MainWindow::showSettingsSetup()
{
showSettings(0);
}
void MainWindow::showSettingsSrv()
{
showSettings(1);
}
void MainWindow::showSettingsDst()
{
showSettings(2);
}
void MainWindow::sectionShow(bool b)
{
if (b) sectionBar->show();
else sectionBar->hide();
sectionAction->setOn( b );
}
void MainWindow::sectionClose()
{
sectionAction->setOn( false );
}
void MainWindow::findShow(bool b)
{
if (b) findBar->show();
else findBar->hide();
findAction->setOn( b );
}
void MainWindow::findClose()
{
findAction->setOn( false );
}
void MainWindow::searchShow(bool b)
{
if (b) searchBar->show();
else searchBar->hide();
searchAction->setOn( b );
}
void MainWindow::searchClose()
{
searchAction->setOn( false );
}
void MainWindow::destShow(bool b)
{
if (b) destBar->show();
else destBar->hide();
destAction->setOn( b );
}
void MainWindow::destClose()
{
destAction->setOn( false );
}
void MainWindow::setDocument(const QString &fileName)
{
if ( !QFile::exists( fileName ) ) return;
ipkg->installFile( fileName );
QCopEnvelope e("QPE/System", "linkChanged(QString)");
QString lf = QString::null;
e << lf;
}
void MainWindow::makeChannel()
{
channel = new QCopChannel( "QPE/Application/oipkg", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receive(const QCString&, const QByteArray&)) );
+ connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receive(const QCString&,const QByteArray&)) );
}
void MainWindow::receive(const QCString &msg, const QByteArray &arg)
{
pvDebug(3, "QCop "+msg+" "+QCString(arg));
if ( msg == "installFile(QString)" )
{
ipkg->installFile( QString(arg) );
}else if( msg == "removeFile(QString)" )
{
ipkg->removeFile( QString(arg) );
}else if( msg == "createLinks(QString)" )
{
ipkg->createLinks( QString(arg) );
}else if( msg == "removeLinks(QString)" )
{
ipkg->removeLinks( QString(arg) );
}else{
pvDebug(2,"Huh what do ya want")
}
}
void MainWindow::createLinks()
{
pvDebug(2,"creating links...");
ipkg->createLinks( settings->destinationurl->text() );
}
void MainWindow::removeLinks()
{
pvDebug(2,"removing links...");
ipkg->removeLinks( settings->destinationurl->text() );
}
void MainWindow::remotePackageQuery()
{
packageListSearch.query( searchEdit->text() );
packageListSearch.update();
displayList();
}
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 1610a37..1b4812d 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -118,123 +118,123 @@ void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg,
void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg,
const QRect & r )
{
// Skip QCheckListItem
// (makes you wonder what we're getting from QCheckListItem)
QListViewItem::paintFocus(p,cg,r);
}
QPixmap PackageListItem::statePixmap() const
{
bool installed = package->installed();
bool old = package->isOld();
bool verinstalled = package->otherInstalled();
if ( !package->toProcess() ) {
if ( !installed )
if (old)
{
if (verinstalled) return *pm_uninstalled_old_installed_new;
else return *pm_uninstalled_old;
}
else
{
if (verinstalled) return *pm_uninstalled_installed_old;
else return *pm_uninstalled;
}
else
if (old) return *pm_installed_old;
else return *pm_installed;
} else { //toProcess() == true
if ( !installed )
return *pm_install;
else
return *pm_uninstall;
}
}
QString PackageListItem::key( int column, bool ascending ) const
{
if ( column == 2 ) {
QString t = text(2);
double bytes=t.toDouble();
if ( t.contains('M') ) bytes*=1024*1024;
else if ( t.contains('K') || t.contains('k') ) bytes*=1024;
if ( !ascending ) bytes=999999999-bytes;
return QString().sprintf("%09d",(int)bytes);
} else {
return QListViewItem::key(column,ascending);
}
}
void PackageListItem::setOn( bool b )
{
QCheckListItem::setOn( b );
package->toggleProcess();
package->setLink( settings->createLinks() );
displayDetails();
}
void PackageListItem::displayDetails()
{
QString sod;
sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits());
//sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest());
sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest());
sod = sod.isEmpty()?QString(""):QString(" ("+sod+")");
setText(0, package->name()+sod );
nameItem->setText( 0, QObject::tr("Name: ")+package->name());
linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No")));
destItem->setText( 0, QObject::tr("Destination: ")+package->dest() );
statusItem->setText( 0, QObject::tr("Status: ")+package->status() );
repaint();
}
QPopupMenu* PackageListItem::getPopupMenu()
{
popupMenu->clear();
destsMenu->clear();
QAction *popupAction;
qDebug("PackageListItem::showPopup ");
if (!package->installed()){
popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
QStringList dests = settings->getDestinationNames();
QString ad = settings->getDestinationName();
for (uint i = 0; i < dests.count(); i++ )
{
popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 );
popupAction->addTo( destsMenu );
if ( dests[i] == ad && getPackage()->toInstall() )
{
popupAction->setToggleAction( true );
popupAction->setOn(true);
}
}
- connect( destsMenu, SIGNAL( activated( int ) ),
- this, SLOT( menuAction( int ) ) );
+ connect( destsMenu, SIGNAL( activated(int) ),
+ this, SLOT( menuAction(int) ) );
popupMenu->popup( QCursor::pos() );
}else{
popupMenu->insertItem( QObject::tr("Remove"));
- connect( popupMenu, SIGNAL( activated( int ) ),
- this, SLOT( menuAction( int ) ) );
+ connect( popupMenu, SIGNAL( activated(int) ),
+ this, SLOT( menuAction(int) ) );
popupMenu->popup( QCursor::pos() );
}
return popupMenu;
}
void PackageListItem::menuAction( int i )
{
if (!package->installed()){
package->setDest( destsMenu->text(i) );
package->setLink( settings->createLinks() );
}
package->setOn();
displayDetails();
}
//void PackageListItem::toggleProcess()
//{
// package->toggleProcess() ;
// displayDetails();
//}
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 3c7435d..98ebf88 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -1,118 +1,118 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#include "packagelistview.h"
#include <qpopupmenu.h>
#include <qaction.h>
#include "listviewitemoipkg.h"
#include "packagelistitem.h"
#include "pksettings.h"
PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s)
: QListView(p,n)
{
settings = s;
popupTimer = new QTimer( this );
setSelectionMode(QListView::NoSelection);
addColumn( tr("Package") );
setRootIsDecorated( true );
connect( popupTimer, SIGNAL(timeout()),
this, SLOT(showPopup()) );
- connect( this, SIGNAL( pressed( QListViewItem* ) ),
- this, SLOT( setCurrent( QListViewItem* ) ) );
- connect( this, SIGNAL( clicked( QListViewItem* ) ),
- this, SLOT( stopTimer( QListViewItem* ) ) );
+ connect( this, SIGNAL( pressed(QListViewItem*) ),
+ this, SLOT( setCurrent(QListViewItem*) ) );
+ connect( this, SIGNAL( clicked(QListViewItem*) ),
+ this, SLOT( stopTimer(QListViewItem*) ) );
}
//PackageListView::~PackageListView()
//{
//}
void PackageListView::setCurrent( QListViewItem* p )
{
qDebug("PackageListView::setCurrent ");
activeItem = (ListViewItemOipkg*)p;
if ( activeItem != 0 ) popupTimer->start( 750, true );
// if ( activeItem->getType() != ListViewItemOipkg::Package ){
// qDebug("PackageListView::setCurrent !p ");
// activePackage = 0;
// activePackageListItem = 0;
// qDebug("PackageListView::setCurrent returning ");
// return;
// };
// activePackageListItem = (PackageListItem*)p;
// activePackage = activePackageListItem->getPackage();
// if (activePackage == 0 )
// {
// qDebug("PackageListView::setCurrent if (!activePackage)");
// return;
// }
qDebug("PackageListView::setCurrent popupTimer->start");
}
void PackageListView::showPopup()
{
qDebug("PackageListView::showPopup");
QPopupMenu *popup = activeItem->getPopupMenu();
if (popup == 0) return;
popup->popup( QCursor::pos() );
qDebug("PackageListView::showPopup");
}
void PackageListView::stopTimer( QListViewItem* )
{
popupTimer->stop();
}
void PackageListView::display()
{
QDictIterator<PackageList> list( PackageLists );
PackageList *packlist;
OipkgPackage *pack;
PackageListItem *item;
ListViewItemOipkg *rootItem;
QListViewItem* it;
QListViewItem* itdel;
while ( list.current() ) {
packlist = list.current();
rootItem = rootItems.find( list.currentKey() );
//rootItem->clear();
it=rootItem->firstChild();
while ( it )
{
itdel = it;
it = it->nextSibling();
delete itdel;
}
pack = packlist->first();
while( pack )
{
item = new PackageListItem( rootItem, pack, settings );
pack = packlist->next();
}
++list;
}
}
void PackageListView::addList( QString n, PackageList* pl)
{
PackageLists.insert(n, pl);
ListViewItemOipkg *item = new ListViewItemOipkg(this,n,ListViewItemOipkg::Feed);
rootItems.insert(n, item);
}
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 063b018..aac011e 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -1,145 +1,145 @@
#include "pksettings.h"
#include <qpe/process.h>
#include <qpe/resource.h>
#include <qpe/stringutil.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qprogressbar.h>
#include <qcombobox.h>
#include <qdict.h>
#include <qfile.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlistview.h>
#include <qlistbox.h>
#include <qcheckbox.h>
#include <qmessagebox.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qregexp.h>
#include <qstring.h>
#include <qobject.h>
#include <qtextstream.h>
#include <qtextview.h>
#include <qtoolbutton.h>
#include <qtabwidget.h>
#include <stdlib.h>
#include <unistd.h>
#include "debug.h"
//#include "utils.h"
PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl )
: PackageManagerSettingsBase( parent, name, fl )
{
connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) );
connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) );
connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) );
connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) );
connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
// connect( CheckBoxLink, SIGNAL(toggled(bool)),
// activeLinkDestination, SLOT(setEnabled(bool)) );
// connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) );
-// connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) );
+// connect( settingName, SIGNAL(textChanged(const QString&)), this, SLOT(installationSettingSetName(const QString&)) );
// connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) );
// connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) );
// connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) );
servername->setEnabled(FALSE);
serverurl->setEnabled(FALSE);
serverurlDic.setAutoDelete(TRUE);
destinationname->setEnabled(FALSE);
destinationurl->setEnabled(FALSE);
destinationurlDic.setAutoDelete(TRUE);
readSettings();
activeLinkDestination->hide();
serverChanged = false;
// get rid of setups
// Settings->hide();
// settingName->hide();
// newsetting->hide();
// renamesetting->hide();
// removesetting->hide();
}
PackageManagerSettings::~PackageManagerSettings()
{
}
void PackageManagerSettings::newServer()
{
int i = servers->count();
if ( servername->isEnabled() || serverurl->text().isEmpty() ) {
serverurlDic.insert(i,new QString("http://"));
servers->insertItem(tr("New"));
activeServers->insertItem(tr("New"));
} else {
// allows one-level undo
serverurlDic.insert(i,new QString(serverurl->text()));
servers->insertItem(servername->text());
activeServers->insertItem(servername->text());
}
changed = true;
servers->setSelected(i,TRUE);
editServer(i);
changed = true;
}
void PackageManagerSettings::newDestination()
{
int i = destinations->count();
if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) {
destinationurlDic.insert(i,new QString("/"));
destinations->insertItem(tr("New"));
activeDestination->insertItem(tr("New"));
activeLinkDestination->insertItem(tr("New"));
} else {
// allows one-level undo
destinationurlDic.insert(i,new QString(destinationurl->text()));
destinations->insertItem(destinationname->text());
activeDestination->insertItem(destinationname->text());
activeLinkDestination->insertItem(destinationname->text());
}
destinations->setSelected(i,TRUE);
editDestination(i);
changed = true;
}
void PackageManagerSettings::editServer(int i)
{
if ( servername->isEnabled() ) {
disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
} else {
servername->setEnabled(TRUE);
serverurl->setEnabled(TRUE);
}
servername->setText( servers->text(i) );
serverurl->setText( *serverurlDic[i] );
editedserver = i;
serverChanged = true;
connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
changed = true;
}
void PackageManagerSettings::editDestination(int i)
{
if ( destinationname->isEnabled() ) {
disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
} else {
destinationname->setEnabled(TRUE);
destinationurl->setEnabled(TRUE);
//since it does not work anyway