- Change the user-dialog to allow the user to change the hostname. It

now automatically detects for any duplicates and warn the user just
  like the cookie config dialog.

- Port user-agent dialog to use new KIOSaveConfig instead of
  KProtocolManager since it is going to become a non-mutable class.

- Add entry for the separate cache config dialog.  More options will be
  added to cache config dialog in the future.  NOTE: the clear cache
  button is not connected to anything yet.  Will be fixed soon.

- New string changes related to all the above modifications and
  additions. (DA)

svn path=/trunk/kdebase/kcontrol/kio/; revision=109338
This commit is contained in:
Dawit Alemayehu 2001-08-06 11:11:42 +00:00
parent 0306378900
commit 834368a59c
7 changed files with 141 additions and 184 deletions

View file

@ -11,6 +11,7 @@
#include "smbrodlg.h"
#include "useragentdlg.h"
#include "kproxydlg.h"
#include "cache.h"
extern "C"
@ -38,7 +39,13 @@ extern "C"
KCModule *create_proxy(QWidget *parent, const char *name)
{
KGlobal::locale()->insertCatalogue("kcmkio");
return new KProxyOptions(parent, name);
return new KProxyDialog(parent, name);
};
KCModule *create_cache(QWidget *parent, const char *name)
{
KGlobal::locale()->insertCatalogue("kcmkio");
return new KCacheConfigDialog( parent, name );
};
KCModule *create_netpref(QWidget *parent, const char *name)

View file

@ -7,7 +7,7 @@
#include <qpushbutton.h>
#include <kio/ioslave_defaults.h>
#include <kprotocolmanager.h>
#include <ksaveioconfig.h>
#include <dcopclient.h>
#include <klocale.h>
#include <kdialog.h>
@ -139,11 +139,12 @@ void KIOPreferences::load()
sb_serverResponse->setValue( KProtocolManager::responseTimeout() );
sb_serverConnect->setValue( KProtocolManager::connectTimeout() );
sb_proxyConnect->setValue( KProtocolManager::proxyConnectTimeout() );
int min_val = KProtocolManager::minimumTimeoutThreshold();
sb_socketRead->setMinValue( min_val );
sb_serverResponse->setMinValue( min_val );
sb_serverConnect->setMinValue( min_val );
sb_proxyConnect->setMinValue( min_val );
sb_socketRead->setMinValue( MIN_TIMEOUT_VALUE );
sb_serverResponse->setMinValue( MIN_TIMEOUT_VALUE );
sb_serverConnect->setMinValue( MIN_TIMEOUT_VALUE );
sb_proxyConnect->setMinValue( MIN_TIMEOUT_VALUE );
sb_socketRead->setMaxValue( MAX_TIMEOUT_VALUE );
sb_serverResponse->setMaxValue( MAX_TIMEOUT_VALUE );
sb_serverConnect->setMaxValue( MAX_TIMEOUT_VALUE );
@ -152,10 +153,10 @@ void KIOPreferences::load()
void KIOPreferences::save()
{
KProtocolManager::setReadTimeout( sb_socketRead->value() );
KProtocolManager::setResponseTimeout( sb_serverResponse->value() );
KProtocolManager::setConnectTimeout( sb_serverConnect->value() );
KProtocolManager::setProxyConnectTimeout( sb_proxyConnect->value() );
KSaveIOConfig::setReadTimeout( sb_socketRead->value() );
KSaveIOConfig::setResponseTimeout( sb_serverResponse->value() );
KSaveIOConfig::setConnectTimeout( sb_serverConnect->value() );
KSaveIOConfig::setProxyConnectTimeout( sb_proxyConnect->value() );
emit changed(true);
// Inform running io-slaves about change...
@ -164,7 +165,8 @@ void KIOPreferences::save()
stream << QString::null;
if ( !kapp->dcopClient()->isAttached() )
kapp->dcopClient()->attach();
kapp->dcopClient()->send( "*", "KIO::Scheduler", "reparseSlaveConfiguration(QString)", data );
kapp->dcopClient()->send( "*", "KIO::Scheduler",
"reparseSlaveConfiguration(QString)", data );
}
void KIOPreferences::defaults()
@ -179,10 +181,10 @@ void KIOPreferences::defaults()
QString KIOPreferences::quickHelp() const
{
return i18n("<h1>Network Preferences</h1>Here you can define"
" the behavior of KDE programs when using Internet"
" and network connections. If you experience timeouts"
" and problems or sit behind a modem, you might want"
" to adjust these values." );
" the behavior of KDE programs when using Internet"
" and network connections. If you experience timeouts"
" and problems or sit behind a modem, you might want"
" to adjust these values." );
}
#include "netpref.moc"

View file

@ -8,121 +8,6 @@ X-KDE-ModuleType=Library
X-KDE-Library=kio
X-KDE-FactoryName=proxy
Name=Proxies & Cache
Name[af]=INSTANDBEDIENER & KAS
Name[az]=Vəkil vericilər & Ön Yaddaş
Name[bg]=Прокси & кеш
Name[cs]=Proxy a vyrovnávací paměť
Name[da]=Proxier & Cache
Name[de]=Proxies & Zwischenspeicher
Name[eo]=Prokuriloj kaj tenejo
Name[es]=Proxies y caché
Name[et]=Proxy ja vahemälu
Name[fi]=Välityspalvelimet ja välimuisti
Name[fr]=Proxy et cache
Name[he]=ןומטמו םיכוותמ
Name[hu]=Proxy- és gyorstár-beállítások
Name[is]=Sel og biðminni
Name[it]=Proxy e cache
Name[ja]= &
Name[ko]=
Name[lt]=Tarpinės stotys (proxies) ir krepšys
Name[lv]=Proksī & Kešs
Name[no_NY]=Proxy-ar og mellomlager
Name[pl]=Pośrednicy i bufor
Name[pt_BR]=Proxies e Cache
Name[pt]=Proxies e Cache
Name[ro]=Proxy şi cache
Name[ru]=Прокси и кэш
Name[sk]=Proxy a vyrovnávacia pamäť
Name[sl]=Nadomestniki in predpomnilink
Name[sv]=Proxy & Cache
Name[ta]=À¢É¡Á¢¸û & Å¢¨ÃŸõ
Name[tr]=Vekiller ve Ön bellek
Name[uk]=Проксі та кеш
Name[zh_CN.GB2312]=
Comment=Configure any proxy servers you must use (usually needed if you are behind a firewall)
Comment[af]=KONFIGUREER ENIGE VOLMAG BEDIENERS JY MOET GEBRUIK (GEWOONLIK BENODIG AS JY WORD AGTER 'N VUURMUUR)
Comment[az]=İşlətməniz lazım gələn vəkil vericiləri buradan quraşdırın
Comment[bg]=Настройки за работа с прокси сървър (обикновенно е необходимо ако сте зад firewall)
Comment[br]=Kefluniañ kement servijer proksi e rankit implij (ret ma 'z oc'h a-dreñv ur maltouter peurliesañ)
Comment[bs]=Podešavanje proxy poslužitelja (obično potrebno ako se nalazite iza vatrozida)
Comment[ca]=Configureu els servidors de procuració que heu d'usar (és necessàri habitualment si esteu darrera d'un tallafoc)
Comment[cs]=Nastavte všechny proxy servery, které musíte používat (obvykle nutné, jestliže jste za firewallem)
Comment[da]=Indstil proxy servere som du skal bruge (sædvanligvis nødvendigt bag en brandmur)
Comment[de]=Richten Sie hier die Proxyserver ein, die Sie brauchen (z.B. wenn Sie sich hinter einem Firewall befinden)
Comment[el]=Ρύθμιση των proxy servers που χρησιμοποιείτε (συνήθως χρειάζεται αν είστε πίσω από ένα firewall)
Comment[eo]=Agordo de la prokuriloj, de vi uzendaj (normale necesa, se vi troviĝas malantaŭ fajromuro)
Comment[es]=Configura cualquier servidor proxy que deba usar (normalmente es necesario si está detrás de un cortafuegos)
Comment[et]=Proxy serverite seadistamine
Comment[fi]=Aseta välityspalvelimet joita sinun tulee käyttää (palomuurin takia esimerkiksi)
Comment[fr]=Configuration des serveurs proxy (souvent nécessaire si vous êtes derrière un pare-feu)
Comment[gl]=Configuración dos servidores proxy que necesite (normalmente se está está tras un firewall)
Comment[he]=(Firewall ירוחאמ אצמנ התא םא ץוחנ ללכ ךרדב) שמתשהל ךילע םהב םיכוותמה םיתרשה לכ תורדגה יוניש
Comment[hr]=Podešavanje proxy poslužitelja (obično potrebno ako se nalazite iza vatrozida)
Comment[hu]=A proxy kiszolgálók beállítása (általában akkor van rá szükség, ha tűzfalat használ)
Comment[is]=Stilla hvaða vefsel þú notar (oft nauðsyn ef þú ert bakvið eldvegg)
Comment[it]=Configura i proxy server che devi usare (di solito è necessario se ti trovi dietro un firewall)
Comment[ja]=使()
Comment[ko]=( )
Comment[lt]=Sukonfigūruokite proxy serverius, kuriuos jums reikia naudoti (to paprastai reikia, jei jūs esate už firewall)
Comment[lv]=Konfigurēt jebkuru vajadzīgo Proxy serveri (parasti nepieciešams, ja atrodaties aiz ugunsmūra)
Comment[mk]=Конфигурирање на proxy-сервисите што морате да ги користите (обично, ако сте позади firewall)
Comment[mt]=Ikkonfigura proxy servers li trid tuża (ġeneralment meħtieġ biss jekk qiegħed wara firewall)Configure any proxy servers you must use (usually needed if you are behind a firewall)
Comment[nl]=Geef hier aan welke eventuele proxy-servers u wilt gebruiken. (Dit is meestal nodig als u achter een firewall zit).
Comment[no]=Konfigurerer de proxy-tjenerene du må bruke (vanligvis brukt hvis du er bak en brannmur)
Comment[no_NY]=Set opp dei proxy-tenarane du må bruka (vanlegvis påkravd dersom maskina er bak ein brannmur)
Comment[oc]=Configuretz los servors de procuracion que eu d'usar (ens necessari abitualment si essetz darrera d'un tallafoc)
Comment[pl]=Konfiguracja serwerów pośredniczących (proxy) (zwykle są potrzebne gdy pracuje się za zaporą ogniową - firewall)
Comment[pt_BR]=Configure os servidores de proxy que você precisa usar (geralmente necessários se você acessa a Internet via firewall)
Comment[pt]=Configuração de servidores proxy (normalmente necessários se estiveres atrás de uma 'firewall')
Comment[ro]=Configurează orice server-e proxy pe care trebuie să le utilizaţi (în mod normal dacă sînteţi în spatele unui firewall)
Comment[ru]=Настройки для работы с прокси
Comment[sk]=Konfigurácia proxy servera. Ak je potrebný musíte ho nastaviť.
Comment[sl]=Nastavite vse nadomestne strežnike, ki jih morate uporabljati (navadno potrebno, če ste za požarnim zidom).
Comment[sr]=Konfigurišite proxy server koji morate da koristite (obično je potrebno ako ste iza firewalla)
Comment[sv]=Ställer in alla proxyservrar som du måste använda (oftast nödvändigt om du befinner dig bakom en brandvägg)
Comment[ta]=­í§¸ ¯í¸û À¢É¡Á¢ô ÀâÁ¡È¢ «¨ÁôÒ¸¨Ç ÅÊŨÁì¸Ä¡õ
Comment[tr]=Kullanmanız gereken vekil sunucuları buradan yapılandırınız
Comment[uk]=Налаштуйте проксі-сервери, що потрібні Вам для роботи (потрібні здебільшого, якщо Ви знаходитесь за фаєрволом)
Comment[vi]=Cu hình Proxy mà bn bt buc phi dùng(luôn luôn cn nếu bn nm sau tưng la)
Comment[zh_CN.GB2312]=使 ()
Comment[zh_TW.Big5]=使()
Keywords=Proxy,Proxy server,WWW,Internet,Browsing,HTTP,FTP,Network,Firewall,Cache,Ports,Size
Keywords[af]=VOLMAG,VOLMAG BEDIENER,WWW,INTERNET,BLAAIïNG,HTTP,FTP,NETWERK,VUURMUUR,KAS,POORTE,GROOTTE
Keywords[az]=Proxy,Vəkil verici,WWW,İnternet,Darama,HTTP,FTP,Şəbəkə,Firewall,Önyaddaş,Port
Keywords[ca]=Procuració,servidor de procuració,WWW,Internet,Navegació,HTTP,FTP,Xarxa,Tallafocs,Cau,Ports,Mida
Keywords[cs]=Proxy,Proxy server,WWW,Internet,Prohlížení,HTTP,FTP,Síť,Firewall,Cache,Keš,Porty,Velikost
Keywords[da]=Proxy,Proxy server,www,Internet,Netsøgning,Http,Ftp,Netværk,Brandmur,Cache,Porte,Størrelse
Keywords[de]=Proxy,Proxy-Server,WWW,Internet,Durchsuchen,Browsen,HTTP,FTP,Netz,Netzwerk,Firewall,Zwischenspeicher,Cache,Ports
Keywords[el]=Proxy,Διακομιστής Proxy,WWW,Internet,Φυλλομέτρηση,HTTP,FTP,Δίκτυο,Firewall,Cache,Πόρτες,Μέγεθος
Keywords[eo]=prokurilo,proxy,TTT,WWW,Interreto,HTTP,FTP,reto,retŝirmilo,fajroŝirmilo,bufro,pordo,grandeco
Keywords[es]=Proxy,Servidor proxy,WWW,Internet,Navegación,HTTP,FTP,Red,Cortafuegos,Caché,Puertos,Tamaño
Keywords[et]=proxy,proxy server,WWW,Internet,brausimine,HTTP,FTP,võrk,tulemüür,vahemälu,pordid,suurus
Keywords[fi]=Proxy,Proxy-palvelin,Välitys,Välityspalvelin,WWW,Internet,Selailu,HTTP,FTP,Verkko,Palomuuri,Portit,Koko
Keywords[fr]=proxy,serveur proxy,WWW,Web,internet,navigation,HTTP,FTP,réseau,firewall,pare-feu,cache,port,taille
Keywords[he]=לדוג,תואיצי,ןומטמ,Firewall,תשר,FTP,HTTP,השילג,טנרטניא,WWW,ךוותמ תרש
Keywords[hu]=proxy,proxy kiszolgáló,WWW,internet,böngészés,HTTP,FTP,hálózat,tűzfal,gyorstár,portok,méret
Keywords[is]=Sel,Vefsel,Vefurinn,Netið,Flakk,Vafra,Vafri,Eldveggur,Net,Port,Stærð
Keywords[it]=Proxy,Proxy server,WWW,Internet,Navigazione,HTTP,FTP,Rete,Firewall,Cache,Porte,Dimensione
Keywords[ja]=,,WWW,, ,HTTP,FTP,,,,,
Keywords[ko]=Proxy,Proxy server,WWW,Internet,Browsing,HTTP,FTP,Network,Firewall,Cache,Ports,Size,,, , ,,,,,,,,
Keywords[lt]=Proxy,Proxy server, proxy serveris,WWW,Internet,internetas,Browsing,naršymas,HTTP,FTP,Network,tinklas,Firewall,Cache,krepšys,Ports,portai,Size,dydis
Keywords[lv]=Starpnieks,Starpniek serveris,WWW,Internets,Pārlūkošana,HTTP,FTP,Tīkls,Ugunsmūris,Kešs,Porti,Izmērs
Keywords[nl]=proxy,proxy server,www,Internet,Browsing,HTTP,FTP,Netwerk,proxy-server,firewall,cache,poorten,afmeting
Keywords[no]=Proxy,Proksi,Proxy-tjener,Proksi-tjener,WWW,vVv,Internet,Internett,Weblesing,HTTP,FTP,Nettverk,Brannmur
Keywords[no_NY]=proxy,proxy-tenar,WWW,verdsveven,internett,surfing,HTTP,FTP,nettverk,brannmur,mellomlager,portar,storleik
Keywords[pl]=Proxy,serwer proxy,serwer pośredniczący,pośrednicy,przeglądanie,Internet,WWW,sieć,HTTP,FTP,firewall,zapora ogniowa,ściana ogniowa,porty,rozmiar,bufor,cache
Keywords[pt_BR]=Proxy,Servidor de proxy,WWW,Internet,Navegação,HTTP,FTP,Rede,Firewall,Cache,Portas,Tamanho
Keywords[pt]=proxy,servidor proxy,WWW,internet,navegação,HTTP,FTP,rede,firewall,cache,portos,tamanho
Keywords[ro]=proxy,server proxy,WWW,Internet,navigare,HTTP,FTP,reţea,firewall,cache,port,mărime
Keywords[sk]=Proxy,Proxy server,WWW,Internet,prehliadanie,browsing,HTTP,FTP,Network,Firewall,Sieť,Cache,porty,veľkosť
Keywords[sl]=nadomestnik,proxy,nadomestni strežnik,WWW,splet,internet,brskanje,HTTP,FTP,omrežje,požarni zid,vrata,velikost,predpomnilnik
Keywords[sv]=Proxy,Proxy server, WWW,Internet,Surfning,HTTP,FTP,Nätverk,Brandvägg,Cache,Portar,Storlek
Keywords[tr]=Proxy,Vekil sunucu,WWW,İnternet,Tarama,HTTP,FTP,Ağ,Firewall,Önbellek,Port
Keywords[uk]=проксі,проксі-сервер,Інтернет,www,переглядати,мережа,фаєрвол,кеш,порти,http,ftp,розмір
Keywords[vi]=,Duyt,Tưng la,Mng,Cng,C, Proxy,Proxy server,WWW,Internet,Browsing,HTTP,FTP,Network,Firewall,Cache,Ports,Size
Keywords[zh_CN.GB2312]=Proxy,Proxy server,WWW,Internet,Browsing,HTTP,FTP,Network,Firewall,Cache,Ports,Size,server,WWW,Internet,Browsing,HTTP,FTP,Network,Firewall,Cache,Ports,Size,,,,,,,,
Name=Proxy
Comment=Configure proxy servers (usually needed if you are behind a firewall or use a caching server like Squid)
Keywords=Proxy,Proxy server,Firewall,Squid,proxy

View file

@ -33,7 +33,6 @@
#include <kurllabel.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kprotocolmanager.h>
#include "fakeuaprovider.h"
#include "uagentproviderdlg.h"
@ -181,11 +180,6 @@ void UAProviderDlg::updateInfo()
setIdentity(citem);
}
void UAProviderDlg::setEnableHostEdit( bool state )
{
m_leSite->setEnabled( state );
}
void UAProviderDlg::setSiteName( const QString& text )
{
m_leSite->setText( text );

View file

@ -53,7 +53,6 @@ public:
void setSiteName( const QString& );
void setIdentity( const QString& );
void setEnableHostEdit( bool );
QString siteName();
QString identity();

View file

@ -1,12 +1,25 @@
/*
UserAgent Options
(c) Kalle Dalheimer 1997
Original Authors:
Copyright (c) Kalle Dalheimer 1997
Copyright (c) David Faure <faure@kde.org> 1998
Copyright (c) Dirk Mueller <mueller@kde.org> 2000
Port to KControl
(c) David Faure <faure@kde.org> 1998
Completely re-written by:
Copyright (C) 2000- Dawit Alemayehu <adawit@kde.org>
(c) Dirk Mueller <mueller@kde.org> 2000
(c) Dawit Alemayehu <adawit@kde.org> 2000-2001
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qvbox.h>
@ -22,9 +35,9 @@
#include <kdialog.h>
#include <klistview.h>
#include <dcopclient.h>
#include <kprotocolmanager.h>
#include <kmessagebox.h>
#include <ksimpleconfig.h>
#include <ksaveioconfig.h>
#include <kio/http_slave_defaults.h>
#include "useragentdlg.h"
@ -37,7 +50,6 @@ UserAgentOptions::UserAgentOptions( QWidget * parent, const char * name )
QVBoxLayout *lay = new QVBoxLayout( this, KDialog::marginHint(),
KDialog::spacingHint() );
lay->setAutoAdd( true );
//lay->setMargin( KDialog::marginHint() );
// Send User-agent info ?
cb_sendUAString = new QCheckBox( i18n("Se&nd browser identification"), this );
@ -162,6 +174,10 @@ UserAgentOptions::UserAgentOptions( QWidget * parent, const char * name )
QWhatsThis::add( pb_delete, i18n("Delete the selected entry") );
connect( pb_delete, SIGNAL( clicked() ), this, SLOT( deletePressed() ) );
pb_deleteAll = new QPushButton( i18n("D&elete All"), vbox );
QWhatsThis::add( pb_deleteAll, i18n("Delete all enteries") );
connect( pb_deleteAll, SIGNAL( clicked() ), this, SLOT( deleteAllPressed() ) );
pb_import = new QPushButton( i18n("Import..."), vbox );
pb_import->hide();
QWhatsThis::add( pb_import, i18n("Import pre-packaged site/domain specific identifiers") );
@ -233,12 +249,14 @@ void UserAgentOptions::load()
changeSendUAString();
}
void UserAgentOptions::updateButtons()
{
bool hasItems = lv_siteUABindings->childCount() > 0;
bool itemSelected = ( hasItems && lv_siteUABindings->selectedItem()!=0 );
pb_delete->setEnabled( itemSelected );
pb_change->setEnabled( itemSelected );
pb_deleteAll->setEnabled( hasItems );
}
void UserAgentOptions::defaults()
@ -326,50 +344,77 @@ void UserAgentOptions::save()
kapp->dcopClient()->send( "*", "KIO::Scheduler", "reparseSlaveConfiguration(QString)", data );
}
bool UserAgentOptions::handleDuplicate( const QString& site,
const QString& identity,
const QString& alias )
{
QListViewItem* item = lv_siteUABindings->firstChild();
while ( item != 0 )
{
if ( item->text(0).findRev( site ) != -1 &&
item != lv_siteUABindings->currentItem() )
{
QString msg = i18n("<qt><center>Found an existing identification for"
"<br/><b>%1</b><br/>"
"Do you want to replace it ?</center>"
"</qt>").arg(site);
int res = KMessageBox::warningYesNo(this, msg,
i18n("Duplicate Identification"),
QString::null);
if ( res == KMessageBox::Yes )
{
item->setText(0, site);
item->setText(1, identity);
item->setText(2, alias);
emit KCModule::changed(true);
}
return true;
}
item = item->nextSibling();
}
return false;
}
void UserAgentOptions::addPressed()
{
UAProviderDlg* dlg = new UAProviderDlg( i18n("Add Identification"), this, 0L, m_provider );
UAProviderDlg* dlg = new UAProviderDlg( i18n("Add Identification"),
this, 0L, m_provider );
if ( dlg->exec() == QDialog::Accepted )
{
bool found = false;
QListViewItem* it = lv_siteUABindings->firstChild();
while( it )
if ( !handleDuplicate( dlg->siteName(), dlg->identity(), dlg->alias() ) )
{
if( it->text(0) == dlg->siteName() )
{
it->setText( 1, dlg->identity() );
it->setText( 2, dlg->alias() );
found = true;
break;
}
it = it->nextSibling();
QListViewItem* index = new QListViewItem( lv_siteUABindings,
dlg->siteName(),
dlg->identity(),
dlg->alias() );
lv_siteUABindings->sort();
lv_siteUABindings->setCurrentItem( index );
emit KCModule::changed(true);
}
if( !found )
(void) new QListViewItem( lv_siteUABindings, dlg->siteName(), dlg->identity(), dlg->alias() );
lv_siteUABindings->sort();
emit KCModule::changed(true);
}
delete dlg;
}
void UserAgentOptions::changePressed()
{
if(!lv_siteUABindings->currentItem())
return;
UAProviderDlg* dlg = new UAProviderDlg( i18n("Modify Identification"), this, 0L, m_provider );
dlg->setEnableHostEdit( false );
dlg->setSiteName( lv_siteUABindings->currentItem()->text(0) );
dlg->setIdentity( lv_siteUABindings->currentItem()->text(1) );
UAProviderDlg* dlg = new UAProviderDlg( i18n("Modify Identification"),
this, 0L, m_provider );
QListViewItem *index = lv_siteUABindings->currentItem();
QString old_site = index->text(0);
dlg->setSiteName( old_site );
dlg->setIdentity( index->text(1) );
if ( dlg->exec() == QDialog::Accepted )
{
QListViewItem* it = lv_siteUABindings->currentItem();
if( it->text(0) == dlg->siteName() )
QString new_site = dlg->siteName();
if ( new_site == old_site ||
!handleDuplicate( dlg->siteName(), dlg->identity(), dlg->alias() ) )
{
it->setText( 1, dlg->identity() );
it->setText( 2, dlg->alias() );
index->setText( 0, new_site );
index->setText( 1, dlg->identity() );
index->setText( 2, dlg->alias() );
emit KCModule::changed(true);
}
emit KCModule::changed(true);
}
delete dlg;
}
@ -386,6 +431,14 @@ void UserAgentOptions::deletePressed()
emit KCModule::changed(true);
}
void UserAgentOptions::deleteAllPressed()
{
lv_siteUABindings->clear();
updateButtons();
emit KCModule::changed(true);
}
void UserAgentOptions::importPressed()
{
}

View file

@ -1,12 +1,25 @@
/*
UserAgent Options
(c) Kalle Dalheimer 1997
Original Authors:
Copyright (c) Kalle Dalheimer 1997
Copyright (c) David Faure <faure@kde.org> 1998
Copyright (c) Dirk Mueller <mueller@kde.org> 2000
Port to KControl
(c) David Faure <faure@kde.org> 1998
Completely re-written by:
Copyright (C) 2000- Dawit Alemayehu <adawit@kde.org>
(c) Dirk Mueller <mueller@kde.org> 2000
(c) Dawit Alemayehu <adawit@kde.org> 2000-2001
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef _USERAGENTDLG_H
@ -41,6 +54,7 @@ public:
private slots:
void addPressed();
void deletePressed();
void deleteAllPressed();
void changePressed();
void importPressed();
void exportPressed();
@ -49,6 +63,8 @@ private slots:
void changeDefaultUAModifiers( int );
private:
bool handleDuplicate( const QString&, const QString&, const QString& );
enum {
SHOW_OS = 0,
SHOW_OS_VERSION,
@ -72,6 +88,7 @@ private:
// Site specific settings
KListView* lv_siteUABindings;
QGroupBox* gb_siteSpecific;
QPushButton* pb_deleteAll;
QPushButton* pb_delete;
QPushButton* pb_change;
QPushButton* pb_import;