summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp24
-rw-r--r--noncore/unsupported/oipkg/mainwindow.h3
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp26
-rw-r--r--noncore/unsupported/oipkg/pksettings.h3
-rw-r--r--noncore/unsupported/oipkg/pksettingsbase.ui4
5 files changed, 36 insertions, 24 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index d1be8d0..11fc91b 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -104,49 +104,49 @@ void MainWindow::makeMenu()
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( showSettings() ) );
+ 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 QPEToolBar( 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 );
@@ -203,63 +203,63 @@ void MainWindow::makeMenu()
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 QPEToolBar(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)) );
- spacer = new QLabel( " ", destBar );
+// spacer = new QLabel( " ", destBar );
// spacer->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 );
+ 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 );
@@ -364,62 +364,68 @@ void MainWindow::subSectionChanged()
this, SLOT( sectionChanged() ) );
disconnect( subsection, SIGNAL(activated(int) ),
this, SLOT( subSectionChanged() ) );
packageListServers.setSubSection( subsection->currentText() );
connect( section, SIGNAL( activated(int) ),
this, SLOT( sectionChanged() ) );
connect( subsection, SIGNAL(activated(int) ),
this, SLOT( subSectionChanged() ) );
displayList();
}
void MainWindow::setSections()
{
section->clear();
section->insertStringList( packageListServers.getSections() );
}
void MainWindow::setSubSections()
{
subsection->clear();
subsection->insertStringList( packageListServers.getSubSections() );
}
-void MainWindow::showSettings()
+void MainWindow::showSettings(int i)
{
- if ( settings->showDialog( 0 ) )
+ if ( settings->showDialog( i ) )
+ {
updateList();
+ }
+ setComboName(destination,settings->getDestinationName());
+ CheckBoxLink->setChecked( settings->createLinks() );
+}
+void MainWindow::showSettingsSetup()
+{
+ showSettings(0);
}
void MainWindow::showSettingsSrv()
{
- if ( settings->showDialog( 1 ) )
- updateList();
+ showSettings(1);
}
void MainWindow::showSettingsDst()
{
- if ( settings->showDialog( 2 ) )
- updateList();
+ 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 );
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h
index 090ddd3..354c585 100644
--- a/noncore/unsupported/oipkg/mainwindow.h
+++ b/noncore/unsupported/oipkg/mainwindow.h
@@ -31,49 +31,50 @@ class QPEToolBar;
class QLineEdit;
class PackageListItem;
class QCopChannel;
class QMessageBox;
class QCheckBox;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
~MainWindow();
void makeChannel();
QCopChannel *channel;
protected slots:
void runIpkg();
void updateList();
void displayList();
void subSectionChanged();
void sectionChanged();
- void showSettings();
+ void showSettings(int);
+ void showSettingsSetup();
void showSettingsSrv();
void showSettingsDst();
public slots:
void sectionClose();
void sectionShow(bool);
void findClose();
void findShow(bool);
void searchClose();
void searchShow(bool);
void destClose();
void destShow(bool);
void filterList();
void createLinks();
void removeLinks();
void receive (const QCString &, const QByteArray &);
void setDocument (const QString &);
void remotePackageQuery();
private:
void makeMenu();
void setSections();
void setSubSections();
bool updateIcon;
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 59d5a3e..14c1944 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -38,48 +38,55 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na
{
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( 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;
@@ -511,60 +518,59 @@ QStringList PackageManagerSettings::getDestinationUrls()
return sl;
}
/** returns the destination listed in ipkg.conf */
QString PackageManagerSettings::getDestinationUrlByName(QString n)
{
QStringList sl;
for (int i=0; i<(int)destinations->count(); i++)
{
if ( n == destinations->text(i)) return*destinationurlDic[i];
}
return "";
}
/** returns the destination listed in ipkg.conf */
QStringList PackageManagerSettings::getDestinationNames()
{
QStringList sl;
for (int i=0; i<(int)destinations->count(); i++)
{
sl += destinations->text(i);
}
return sl;
}
-
+
void PackageManagerSettings::linkEnabled( bool b )
{
pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no"));
activeLinkDestination->setEnabled( b );
+ CheckBoxLink->setChecked( b );
}
void PackageManagerSettings::activeServerChanged()
{
changed = true;
}
-QComboBox* PackageManagerSettings::getDestCombo()
-{
- return new QComboBox(activeDestination);
-}
-
void PackageManagerSettings::createLinksToDest()
{
pvDebug(2,"creating links...");
// emit doCreateLinks( destinationurl->text() );
// ipkg->createLinks( destinationurl );
}
void PackageManagerSettings::removeLinksToDest()
{
pvDebug(2,"removing links...");
// emit doRemoveLinks( destinationurl->text() );
// ipkg->removeLinks( destinationurl );
}
-//void PackageManagerSettings::setIpkg( PmIpkg* i )
-//{
-// ipkg = i;
-//}
+void PackageManagerSettings::activeDestinationChange(int i)
+{
+ pvDebug(5,"activeDestinationChange "+QString::number(i));
+ if (i > activeDestination->count()) return;
+ activeDestination->setCurrentItem(i);
+ pvDebug(5,"dest name "+ activeDestination->currentText());
+}
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h
index 8f9fe62..d66c4e8 100644
--- a/noncore/unsupported/oipkg/pksettings.h
+++ b/noncore/unsupported/oipkg/pksettings.h
@@ -3,73 +3,72 @@
#include "pksettingsbase.h"
//#include "pmipkg.h"
#include <qintdict.h>
#include <qobject.h>
class PackageManagerSettings : public PackageManagerSettingsBase
{
Q_OBJECT
public:
PackageManagerSettings( QWidget* , const char* , WFlags );
~PackageManagerSettings();
bool showDialog( int ) ;
QString getDestinationUrl();
QString getDestinationName();
QString getLinkDestinationName();
bool createLinks();
QStringList getServers();
QStringList getActiveServers();
QStringList getDestinationUrls();
QStringList getDestinationNames();
QString getDestinationUrlByName(QString);
- QComboBox* getDestCombo();
-// void setIpkg( PmIpkg* );
public slots:
void writeInstallationSettings();
void readInstallationSettings();
void writeCurrentInstallationSetting();
void readInstallationSetting(int);
void installationSettingSetName(const QString &);
void removeLinksToDest();
void createLinksToDest();
void newServer();
void editServer(int);
void removeDestination();
void newDestination();
void editDestination(int);
void linkEnabled(bool);
void removeServer();
void serverNameChanged(const QString&);
void serverUrlChanged(const QString&);
void destNameChanged(const QString&);
void destUrlChanged(const QString&);
void installationSettingChange(int);
void newInstallationSetting();
void removeInstallationSetting();
void renameInstallationSetting();
void activeServerChanged();
+ void activeDestinationChange(int);
signals:
// void doCreateLinks( QString dest );
// void doRemoveLinks( QString dest );
private:
QIntDict<QString> serverurlDic;
QIntDict<QString> destinationurlDic;
int ipkg_old;
int editedserver;
int editeddestination;
int currentSetting;
int installationSettingsCount;
bool changed;
bool serverChanged;
bool readIpkgConfig(const QString&);
void writeIpkgConfig(const QString&);
void writeSettings();
void readSettings();
};
#endif
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui
index 5b83248..e95ed83 100644
--- a/noncore/unsupported/oipkg/pksettingsbase.ui
+++ b/noncore/unsupported/oipkg/pksettingsbase.ui
@@ -1,38 +1,38 @@
<!DOCTYPE UI><UI>
<class>PackageManagerSettingsBase</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>Form4</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>337</width>
+ <width>333</width>
<height>454</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Package Servers</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>3</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>3</number>
</property>
<widget row="0" column="0" >
<class>QTabWidget</class>
@@ -194,49 +194,49 @@
</widget>
<widget row="3" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout13</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Used servers:</string>
+ <string>Used servers: (Highlighted feeds are active)</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer4</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>