From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/konsole/AUTHORS | 2 + kcontrol/konsole/Makefile.am | 18 + kcontrol/konsole/kcmkonsole.cpp | 191 ++++++++++ kcontrol/konsole/kcmkonsole.desktop | 185 +++++++++ kcontrol/konsole/kcmkonsole.h | 46 +++ kcontrol/konsole/kcmkonsoledialog.ui | 390 +++++++++++++++++++ kcontrol/konsole/schemadialog.ui | 631 +++++++++++++++++++++++++++++++ kcontrol/konsole/schemaeditor.cpp | 708 +++++++++++++++++++++++++++++++++++ kcontrol/konsole/schemaeditor.h | 84 +++++ kcontrol/konsole/sessiondialog.ui | 446 ++++++++++++++++++++++ kcontrol/konsole/sessioneditor.cpp | 383 +++++++++++++++++++ kcontrol/konsole/sessioneditor.h | 68 ++++ 12 files changed, 3152 insertions(+) create mode 100644 kcontrol/konsole/AUTHORS create mode 100644 kcontrol/konsole/Makefile.am create mode 100644 kcontrol/konsole/kcmkonsole.cpp create mode 100644 kcontrol/konsole/kcmkonsole.desktop create mode 100644 kcontrol/konsole/kcmkonsole.h create mode 100644 kcontrol/konsole/kcmkonsoledialog.ui create mode 100644 kcontrol/konsole/schemadialog.ui create mode 100644 kcontrol/konsole/schemaeditor.cpp create mode 100644 kcontrol/konsole/schemaeditor.h create mode 100644 kcontrol/konsole/sessiondialog.ui create mode 100644 kcontrol/konsole/sessioneditor.cpp create mode 100644 kcontrol/konsole/sessioneditor.h (limited to 'kcontrol/konsole') diff --git a/kcontrol/konsole/AUTHORS b/kcontrol/konsole/AUTHORS new file mode 100644 index 000000000..a515139f9 --- /dev/null +++ b/kcontrol/konsole/AUTHORS @@ -0,0 +1,2 @@ +Andrea Rizzi April 2001 +Stephan Binner October 2001 diff --git a/kcontrol/konsole/Makefile.am b/kcontrol/konsole/Makefile.am new file mode 100644 index 000000000..622e7fa71 --- /dev/null +++ b/kcontrol/konsole/Makefile.am @@ -0,0 +1,18 @@ +kde_module_LTLIBRARIES = kcm_konsole.la + +kcm_konsole_la_SOURCES = schemaeditor.cpp sessioneditor.cpp kcmkonsole.cpp \ + schemadialog.ui sessiondialog.ui kcmkonsoledialog.ui + +kcm_konsole_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kcm_konsole_la_LIBADD = -lkdeui $(LIB_KIO) +AM_CPPFLAGS = $(all_includes) + +METASOURCES = AUTO + +noinst_HEADERS = kcmkonsole.h schemaeditor.h sessioneditor.h schemadialog.h sessiondialog.h kcmkonsoledialog.h + +kcmkonsole_data_DATA = kcmkonsole.desktop +kcmkonsole_datadir = $(kde_appsdir)/.hidden + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmkonsole.pot diff --git a/kcontrol/konsole/kcmkonsole.cpp b/kcontrol/konsole/kcmkonsole.cpp new file mode 100644 index 000000000..19b547366 --- /dev/null +++ b/kcontrol/konsole/kcmkonsole.cpp @@ -0,0 +1,191 @@ +/*************************************************************************** + kcmkonsole.cpp - control module for konsole + ------------------- + begin : mar apr 17 16:44:59 CEST 2001 + copyright : (C) 2001 by Andrea Rizzi + email : rizzi@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "schemaeditor.h" +#include "sessioneditor.h" +#include "kcmkonsole.h" + +typedef KGenericFactory ModuleFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_konsole, ModuleFactory("kcmkonsole") ) + +KCMKonsole::KCMKonsole(QWidget * parent, const char *name, const QStringList&) +:KCModule(ModuleFactory::instance(), parent, name) +{ + + setQuickHelp( i18n("

Konsole

With this module you can configure Konsole, the KDE terminal" + " application. You can configure the generic Konsole options (which can also be " + "configured using the RMB) and you can edit the schemas and sessions " + "available to Konsole.")); + + QVBoxLayout *topLayout = new QVBoxLayout(this); + dialog = new KCMKonsoleDialog(this); + dialog->line_spacingSB->setRange(0, 8, 1, false); + dialog->line_spacingSB->setSpecialValueText(i18n("normal line spacing", "Normal")); + dialog->show(); + topLayout->add(dialog); + load(); + + KAboutData *ab=new KAboutData( "kcmkonsole", I18N_NOOP("KCM Konsole"), + "0.2",I18N_NOOP("KControl module for Konsole configuration"), KAboutData::License_GPL, + "(c) 2001, Andrea Rizzi", 0, 0, "rizzi@kde.org"); + + ab->addAuthor("Andrea Rizzi",0, "rizzi@kde.org"); + setAboutData( ab ); + + connect(dialog->terminalSizeHintCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->warnCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->ctrldragCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->cutToBeginningOfLineCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->allowResizeCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->bidiCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->xonXoffCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->blinkingCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->frameCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->line_spacingSB,SIGNAL(valueChanged(int)), SLOT( changed() )); + connect(dialog->matchTabWinTitleCB,SIGNAL(toggled(bool)), SLOT( changed() )); + connect(dialog->silence_secondsSB,SIGNAL(valueChanged(int)), SLOT( changed() )); + connect(dialog->word_connectorLE,SIGNAL(textChanged(const QString &)), SLOT( changed() )); + connect(dialog->SchemaEditor1, SIGNAL(changed()), SLOT( changed() )); + connect(dialog->SessionEditor1, SIGNAL(changed()), SLOT( changed() )); + connect(dialog->SchemaEditor1, SIGNAL(schemaListChanged(const QStringList &,const QStringList &)), + dialog->SessionEditor1, SLOT(schemaListChanged(const QStringList &,const QStringList &))); + connect(dialog->SessionEditor1, SIGNAL(getList()), dialog->SchemaEditor1, SLOT(getList())); +} + +void KCMKonsole::load() +{ + load(false); +} + +void KCMKonsole::load(bool useDefaults) +{ + KConfig config("konsolerc", true); + config.setDesktopGroup(); + config.setReadDefaults(useDefaults); + + dialog->terminalSizeHintCB->setChecked(config.readBoolEntry("TerminalSizeHint",false)); + bidiOrig = config.readBoolEntry("EnableBidi",false); + dialog->bidiCB->setChecked(bidiOrig); + dialog->matchTabWinTitleCB->setChecked(config.readBoolEntry("MatchTabWinTitle",false)); + dialog->warnCB->setChecked(config.readBoolEntry("WarnQuit",true)); + dialog->ctrldragCB->setChecked(config.readBoolEntry("CtrlDrag",true)); + dialog->cutToBeginningOfLineCB->setChecked(config.readBoolEntry("CutToBeginningOfLine",false)); + dialog->allowResizeCB->setChecked(config.readBoolEntry("AllowResize",false)); + xonXoffOrig = config.readBoolEntry("XonXoff",false); + dialog->xonXoffCB->setChecked(xonXoffOrig); + dialog->blinkingCB->setChecked(config.readBoolEntry("BlinkingCursor",false)); + dialog->frameCB->setChecked(config.readBoolEntry("has frame",true)); + dialog->line_spacingSB->setValue(config.readUnsignedNumEntry( "LineSpacing", 0 )); + dialog->silence_secondsSB->setValue(config.readUnsignedNumEntry( "SilenceSeconds", 10 )); + dialog->word_connectorLE->setText(config.readEntry("wordseps",":@-./_~")); + + dialog->SchemaEditor1->setSchema(config.readEntry("schema")); + + emit changed(useDefaults); +} + +void KCMKonsole::save() +{ + if (dialog->SchemaEditor1->isModified()) + { + dialog->TabWidget2->showPage(dialog->tab_2); + dialog->SchemaEditor1->querySave(); + } + + if (dialog->SessionEditor1->isModified()) + { + dialog->TabWidget2->showPage(dialog->tab_3); + dialog->SessionEditor1->querySave(); + } + + KConfig config("konsolerc"); + config.setDesktopGroup(); + + config.writeEntry("TerminalSizeHint", dialog->terminalSizeHintCB->isChecked()); + bool bidiNew = dialog->bidiCB->isChecked(); + config.writeEntry("EnableBidi", bidiNew); + config.writeEntry("MatchTabWinTitle", dialog->matchTabWinTitleCB->isChecked()); + config.writeEntry("WarnQuit", dialog->warnCB->isChecked()); + config.writeEntry("CtrlDrag", dialog->ctrldragCB->isChecked()); + config.writeEntry("CutToBeginningOfLine", dialog->cutToBeginningOfLineCB->isChecked()); + config.writeEntry("AllowResize", dialog->allowResizeCB->isChecked()); + bool xonXoffNew = dialog->xonXoffCB->isChecked(); + config.writeEntry("XonXoff", xonXoffNew); + config.writeEntry("BlinkingCursor", dialog->blinkingCB->isChecked()); + config.writeEntry("has frame", dialog->frameCB->isChecked()); + config.writeEntry("LineSpacing" , dialog->line_spacingSB->value()); + config.writeEntry("SilenceSeconds" , dialog->silence_secondsSB->value()); + config.writeEntry("wordseps", dialog->word_connectorLE->text()); + + config.writeEntry("schema", dialog->SchemaEditor1->schema()); + + config.sync(); + + emit changed(false); + + DCOPClient *dcc = kapp->dcopClient(); + dcc->send("konsole-*", "konsole", "reparseConfiguration()", QByteArray()); + dcc->send("kdesktop", "default", "configure()", QByteArray()); + dcc->send("klauncher", "klauncher", "reparseConfiguration()", QByteArray()); + + if (xonXoffOrig != xonXoffNew) + { + xonXoffOrig = xonXoffNew; + KMessageBox::information(this, i18n("The Ctrl+S/Ctrl+Q flow control setting will only affect " + "newly started Konsole sessions.\n" + "The 'stty' command can be used to change the flow control " + "settings of existing Konsole sessions.")); + } + + if (bidiNew && !bidiOrig) + { + KMessageBox::information(this, i18n("You have chosen to enable " + "bidirectional text rendering by " + "default.\n" + "Note that bidirectional text may " + "not always be shown correctly, " + "especially when selecting parts of " + "text written right-to-left. This " + "is a known issue which cannot be " + "resolved at the moment due to the " + "nature of text handling in " + "console-based applications.")); + } + bidiOrig = bidiNew; + +} + +void KCMKonsole::defaults() +{ + load(true); +} + +#include "kcmkonsole.moc" diff --git a/kcontrol/konsole/kcmkonsole.desktop b/kcontrol/konsole/kcmkonsole.desktop new file mode 100644 index 000000000..8aa6aecf1 --- /dev/null +++ b/kcontrol/konsole/kcmkonsole.desktop @@ -0,0 +1,185 @@ +[Desktop Entry] +Icon=konsole +Type=Application +Exec=kcmshell kcmkonsole +DocPath=kcontrol/kcmkonsole/index.html + +X-KDE-Library=konsole +X-KDE-ParentApp=kcontrol +Name=Konsole +Name[ar]=طرفية التحكم +Name[az]=Konsol +Name[be]=Кансоль +Name[bg]=Конзола +Name[bn]=কনসোল +Name[bs]=Konzola +Name[ca]=Consola +Name[csb]=Kònsola +Name[el]=Κονσόλα +Name[eo]=Konzolo +Name[et]=Konsool +Name[eu]=Kontsola +Name[he]=מסוף +Name[hi]=कंसोल +Name[hr]=Konzola +Name[is]=Skjáhermir +Name[ka]=კონსოლი +Name[lo]=ຄອນໂຊລ - K +Name[mk]=Конзола +Name[mn]=Консол +Name[nb]=Konsoll +Name[ne]=कन्सोल +Name[nn]=Konsoll +Name[pa]=ਕੰਨਸੋਲ +Name[pl]=Konsola +Name[ro]=Consolă +Name[se]=Konsolla +Name[sk]=Konzola +Name[sl]=Konzola +Name[ta]=கான்சோல் +Name[te]=కాన్సోల్ +Name[tg]=Консол +Name[th]=คอนโซล K +Name[zu]=Ikhonsoli +Comment=Konsole configuration module +Comment[af]=Konsole opstelling module +Comment[ar]=وحدة إعداد طرفية التحكم +Comment[az]=Konsol quraşdırma modulu +Comment[be]=Модуль настаўлення кансолі +Comment[bg]=Настройване на конзолата +Comment[bn]=কনসোল কনফিগারেশন মডিউল +Comment[br]=Mollad kefluniadur Konsole +Comment[bs]=Modul sa podešavanje konzole +Comment[ca]=Mòdul de configuració de la consola +Comment[cs]=Konfigurační modul terminálu konsole +Comment[csb]=Mòduł kònfigùracëji kònsolë +Comment[cy]=Modiwl ffurfweddu Konsole +Comment[da]=Konsole-indstillingsmodul +Comment[de]=Modul zur Einrichtung von Konsole +Comment[el]=Άρθρωμα ρύθμισης Κονσόλας +Comment[eo]=Agordo de Konzolo +Comment[es]=Módulo de configuración de Konsole +Comment[et]=Terminaliemulaatori seadistamine +Comment[eu]=Kontsola konfiguratzeko modulua +Comment[fa]=پیمانۀ پیکربندی Konsole +Comment[fi]=Konsolen asetukset +Comment[fr]=Configuration de Konsole +Comment[fy]=Konsole-ynstellingsmodule +Comment[ga]=Modúl Cumraíochta Konsole +Comment[gl]=Módulo de configuración de Konsole +Comment[he]=שינוי הגדרות המסוף +Comment[hi]=कंसोल कॉन्फ़िगरेशन मोड +Comment[hr]=Modul za konfiguriranje konzole +Comment[hu]=A Konsole parancsértelmező beállításai +Comment[is]=Skjáhermisstillingar +Comment[it]=Modulo di configurazione di Konsole +Comment[ja]=Konsole の設定モジュール +Comment[ka]=კონსოლის კონფიგურაციის მოდული +Comment[kk]=Konsole модулін баптау +Comment[km]=ម៉ូឌុល​កំណត់​រចនាសម្ព័ន្ធ Konsole +Comment[lo]=ໂມດູນປັບແຕ່ງຄອນໂຊນ - K +Comment[lt]=Konsole konfigūravimo įrankis +Comment[lv]=Konsoles konfigurācijas modulis +Comment[mk]=Модул за конфигурација на конзолата +Comment[mn]=Консол тохируулгын модул +Comment[ms]=Konsol modul konfigurasi +Comment[mt]=Konfigurazzjoni ta' Konsole +Comment[nb]=Verktøy for å tilpasse Konsole +Comment[nds]=Moduul för't Instellen vun Konsole +Comment[ne]=कन्सोल कन्फिगरेसन मोड्युल +Comment[nl]=Konsole-configuratiemodule +Comment[nn]=Oppsettmodul for Konsole +Comment[nso]=Seripa sa peakanyo ya konsole +Comment[pa]=ਕੰਨਸੋਲ ਸੰਰਚਨਾ ਮੈਡੀਊਲ +Comment[pl]=Moduł konfiguracji konsoli +Comment[pt]=Módulo de configuração do Konsole +Comment[pt_BR]=Módulo de configuração do Konsole +Comment[ro]=Modul de configurare Konsole +Comment[ru]=Модуль настройки Konsole +Comment[rw]=Igice cy'iboneza rya Konsole +Comment[se]=Konsole:a heivehanmoduvla +Comment[sk]=Konfiguračný modul konzole +Comment[sl]=Modul za nastavitve konzole +Comment[sr]=Модул за подешавање Konsole +Comment[sr@Latn]=Modul za podešavanje Konsole +Comment[sv]=Anpassa Konsole +Comment[ta]=கான்சோல் வடிவமைப்பு பகுதி +Comment[tg]=Модули танзимоти Konsole +Comment[th]=โมดูลปรับแต่งคอนโซล K +Comment[tr]=Konsole Yapılandırma modülü +Comment[tt]=Konsol caylaw modulı +Comment[uk]=Засіб конфігурації модуля Konsole +Comment[uz]=Terminalni moslash moduli +Comment[uz@cyrillic]=Терминални мослаш модули +Comment[ven]=Modulu wa nzudzanyo wa Konsole +Comment[vi]=Cấu hình Konsole +Comment[wa]=Module d' apontiaedje do terminå di KDE Konsole +Comment[xh]=Umnqongo woqwalaselo we Konsole +Comment[zh_CN]=Konsole 配置模块 +Comment[zh_TW]=Konsole 組態模組 +Comment[zu]=Ingxenye yokuhlanganisela ikhonsoli +Keywords=konsole,schema,konsole background,colors,background,terminal application,terminal +Keywords[az]=konsol,sxem,konsol arxa planı,rənglər,arxa plan,terminal proqramı,terminal +Keywords[be]=Кансоль,Схема,Фон кансолі,Колеры,Фон,Тэрмінальная праграма,Тэрмінал,Эмулятар тэрміналу,konsole,schema,konsole background,colors,background,terminal application,terminal +Keywords[bg]=конзола, терминал, konsole, schema, konsole background, colors, background, terminal application, terminal +Keywords[ca]=consola,esquema,fons de la consola,colors,fons,aplicació de terminal,terminal +Keywords[cs]=konsole,schéma,pozadí konsole,barvy,pozadí,terminálová aplikace,terminál +Keywords[csb]=kònsola,schemat,spòdlé kònsolë,farwë,spòdlé,programa terminala,terminal +Keywords[cy]=konsole,sgema,cefndir konsole,lliwiau,cefndir,cymhwysiadau terfynell,terfynell +Keywords[da]=konsole,sammensætning,konsole-baggrund,farver,baggrund,terminalprogram,terminal +Keywords[de]=Konsole,Farbschema,Hintergrund,Farben,Terminal +Keywords[el]=κονσόλα,σχήμα,φόντο κονσόλας,χρώματα,φόντο,εφαρμογή τερματικού,τερματικό +Keywords[en_GB]=konsole,schema,konsole background,colours,background,terminal application,terminal +Keywords[eo]=Konzolo,koloraro,fono,koloro,konzolofono,terminaaplikaĵo,terminalo +Keywords[es]=konsole,esquema,fondo de konsole,colores,fondo,aplicación de terminal,terminal +Keywords[et]=konsool,skeem,konsooli taust,värvid,taust,terminal,terminaliemulaator +Keywords[eu]=konsole,eskema,kontsolaren atzeko planoa,koloreak,atzeko planoa,terminal aplikazioa,terminala +Keywords[fa]=konsole، طرحواره، زمینه konsole، رنگها، زمینه، کاربرد پایانه، پایانه +Keywords[fi]=konsole,teema,konsolen tausta,värit,tausta,pääteohjelma,pääte,komento,komentikkuna +Keywords[fr]=konsole,modèle,fond,couleurs,terminal +Keywords[fy]=konsole,skema,konsole eftergrûn,colors,kleuren,background,eftergrûn,terminal applikaasje,terminal +Keywords[ga]=konsole,scéimre,cúlra konsole,dathanna,cúlra,clár teirminéil,teirminéal +Keywords[gl]=konsole,esquema,fondo de konsole,cores,fondo,aplicación de terminal,terminal +Keywords[he]=מסוף,יישום מסוף,רקע,צבעים,רקע המסוף,תבנית, konsole,schema,konsole background,colors,background,terminal application,terminal +Keywords[hi]=कंसोल,योजना,कंसोल पृष्ठभूमि,रंग,पृष्ठ भूमि,टर्मिनल अनुप्रयोग,टर्मिनल +Keywords[hr]=konsole,schema,konsole background,colors,background,terminal application,terminal,konzola,shema,pozadina konzole,boje,pozadina,terminalska aplikacija +Keywords[hu]=Konsole,kinézet,terminál-háttér,színek,háttér,terminálalkalmazás,terminál +Keywords[is]=konsole,skjáhermir,skjáhermissbakgrunnur,litir,bakgrunnur,terminal application,terminal +Keywords[it]=konsole,schema,sfondo di konsole,colori,sfondo,terminale,shell +Keywords[ja]=konsole,schema,konsole 背景,色,背景,ターミナルアプリケーション,ターミナル +Keywords[km]=កុងសូល,គ្រោងការណ៍,ផ្ទៃ​ខាង​ក្រោយ​កុងសូល,ពណ៌,ផ្ទៃ​ខាង​ក្រោយ,កម្មវិធី​ស្ថានីយ,ស្ថានីយ +Keywords[lt]=konsole,schema,konsole background,colors,background,terminal application,terminal, konsolė, schema, konsolės fono spalva, spalvos, fono spalva, terminalinė programa, terminalas +Keywords[lv]=konsole,shēma,konsoles fons,krāsas,fons,termināla aplikācija,termināls +Keywords[mk]=konsole,schema,konsole background,colors,background,terminal application,terminal,конзола,шема,подлога на конзола,позадина на конзола,бои,подлога,позадина,терминалска апликација,терминал +Keywords[mn]=Консол,Өнгөний схем,Дэвсгэр,Өнгө,Терминал +Keywords[mt]=konsole,schema,konsole background,colors,background,terminal application,terminal,skema,sfond,kuluri,emulatur +Keywords[nb]=konsole,oppsett,konsoll,konsollbakgrunn,farger,bakgrunn,terminal +Keywords[nds]=Konsole,Muster,Klören,Achtergrund,Terminalprogramm,Terminal +Keywords[ne]=कन्सोल, स्कीमा, कन्सोल पृष्ठभूमि, रङहरू, पृष्ठभूमि, टर्मिनल अनुप्रयोग, टर्मिनल +Keywords[nn]=konsoll,oppsett,konsollbakgrunn,fargar,bakgrunn,terminal +Keywords[nso]=konsole,schema,bokamorago bja konsole,mebala,bokamorago,tshomiso ya terminal,terminal +Keywords[pa]=konsole,schema,konsole background,colors,background,terminal application,terminal,ਕੰਨਸੋਲ,ਸਕੀਮ,ਰੰਗ,ਟਰਮੀਨਲ +Keywords[pl]=konsola,schemat,tło konsoli,kolory,tło,program terminala,terminal +Keywords[pt]=konsole,esquema,fundo do konsole,cores,fundo,aplicação de terminal,terminal +Keywords[pt_BR]=konsole,esquema,fundo do konsole,cores,segundo plano,aplicativo de terminal, terminal +Keywords[ro]=consolă,konsole,schemă,fundal,terminal,aplicație terminal +Keywords[rw]=Konsole,igishushanyombonera ,mbuganyuma ya konsole,amabara , mbuganyuma ,Porogaramu Igihera, Igihera +Keywords[se]=konsolla,heivehus,konsolladuogás,ivnnit,duogáš,terminála +Keywords[sk]=konsole,schéma,pozadie konzole,konzola,farby,pozadie,terminálová aplikácia,terminál +Keywords[sl]=konsola,shema,ozadje konzole,barve,ozadje,terminalski program,terminal +Keywords[sr]=konsole,schema,konsole background,colors,background,terminal application,terminal,терминал,боје,позадина,шема +Keywords[sr@Latn]=konsole,schema,konsole background,colors,background,terminal application,terminal,terminal,boje,pozadina,šema +Keywords[sv]=konsole,konsoll,schema,konsol bakgrund,färger,bakgrund,terminalprogram,terminal +Keywords[ta]=கான்சோல்,அமைப்பு,கான்சோல் பின்ன்ணி,வண்ணங்கள்,பின்ன்ணி,கடைசி பயன்பாடு,கடைசி +Keywords[th]=คอนโซล K,ชุดรูปแบบ,พื้นหลังคอนโซล,สี,พื้นหลัง,แอพพลิเคชันเทอร์มินัล,เทอร์มินัล +Keywords[tr]=konsol,şema,konsol arkaplanı,renkler,arkaplan,terminal,konsole +Keywords[uk]=konsole,схема,тло konsole,кольори,тло,програма терміналу,термінал +Keywords[uz]=terminalning orqa foni,ranglar,orqa fon,terminal dasturi,terminal +Keywords[uz@cyrillic]=терминалнинг орқа фони,ранглар,орқа фон,терминал дастури,терминал +Keywords[ven]=konsole,tshikimu,vhuvha ha konsole,mivhala ya konsole,theminala,apulifikhesheni ya theminala,theminala +Keywords[vi]=konsole,schema,ảnh nền của konsole,màu,nền,trình đầu cuối,thiết bị cuối +Keywords[wa]=konsole,arindjmint,fond del konsole,coleurs,fond,prgrame terminå,terminå +Keywords[xh]=konsole,schema,imvelaphi ye konsole,imibala,imvelaphi,isicelo sesiphelo sendlela,isiphelo sendlela +Keywords[zh_CN]=konsole,schema,konsole background,colors,background,terminal application,terminal,颜色,背景色,终端程序,终端 +Keywords[zh_TW]=konsole,schema,konsole background,colors,background,terminal application,terminal,配色,konsole 背景,顏色,背景,終端機應用程式,終端機 +Keywords[zu]=konsole,iplani,inkundla yekhonsoli,imibala,inkundla, umyaleli wangaphandle,ithuluzi langaphandle diff --git a/kcontrol/konsole/kcmkonsole.h b/kcontrol/konsole/kcmkonsole.h new file mode 100644 index 000000000..ae6ee069b --- /dev/null +++ b/kcontrol/konsole/kcmkonsole.h @@ -0,0 +1,46 @@ +/*************************************************************************** + kcmkonsole.h + ------------------- + begin : mar apr 17 16:44:59 CEST 2001 + copyright : (C) 2001 by Andrea Rizzi + email : rizzi@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef KCMKONSOLE_H +#define KCMKONSOLE_H + +#include + +#include "kcmkonsoledialog.h" + +class QFont; +class QStringList; + +class KCMKonsole + : public KCModule +{ + Q_OBJECT + +public: + KCMKonsole (QWidget *parent = 0, const char *name = 0, const QStringList& = 0); + + void load(); + void load(bool useDefaults); + void save(); + void defaults(); +private: + KCMKonsoleDialog *dialog; + bool xonXoffOrig; + bool bidiOrig; +}; + +#endif diff --git a/kcontrol/konsole/kcmkonsoledialog.ui b/kcontrol/konsole/kcmkonsoledialog.ui new file mode 100644 index 000000000..bb805ed4b --- /dev/null +++ b/kcontrol/konsole/kcmkonsoledialog.ui @@ -0,0 +1,390 @@ + +KCMKonsoleDialog + + + KCMKonsoleDialog + + + + 0 + 0 + 507 + 490 + + + + + + + + + unnamed + + + 0 + + + + TabWidget2 + + + 0 + + + + + + + + tab + + + &General + + + + unnamed + + + + Spacer3 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + GroupBox3 + + + Double Click + + + + unnamed + + + + TextLabel1_3 + + + Consider the following characters &part of a word when double clicking: + + + word_connectorLE + + + + + word_connectorLE + + + + 1 + 5 + 0 + 0 + + + + + + + + GroupBox2 + + + Misc + + + + unnamed + + + + terminalSizeHintCB + + + Show terminal si&ze after resizing + + + + + frameCB + + + Show &frame + + + + + warnCB + + + &Confirm quit when closing more than one session + + + + + blinkingCB + + + &Blinking cursor + + + + + ctrldragCB + + + &Require Ctrl key for drag and drop + + + + + cutToBeginningOfLineCB + + + Triple click selects &only from the current word forward + + + + + allowResizeCB + + + Allow progr&ams to resize terminal window + + + + + xonXoffCB + + + Use Ctrl+S/Ctrl+Q flow control + + + + + Spacer3 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + bidiCB + + + Enable bidirectional text rendering + + + + + SilenceLabel + + + + 1 + 5 + 0 + 0 + + + + Seconds to detect s&ilence: + + + silence_secondsSB + + + + + silence_secondsSB + + + + 1 + 0 + 0 + 0 + + + + 1 + + + + + line_spacingSB + + + + 1 + 0 + 0 + 0 + + + + 0 + + + 8 + + + + + TextLabel1_4 + + + + 1 + 5 + 0 + 0 + + + + &Line spacing: + + + line_spacingSB + + + + + Spacer2 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + matchTabWinTitleCB + + + Set tab title to match window title + + + + + + + + + tab + + + &Schema + + + + unnamed + + + + SchemaEditor1 + + + + + + + tab + + + S&ession + + + + unnamed + + + + SessionEditor1 + + + + + + + + + + SchemaEditor +
schemaeditor.h
+ + -1 + -1 + + 0 + + 7 + 7 + 0 + 0 + +
+ + SessionEditor +
sessioneditor.h
+ + -1 + -1 + + 0 + + 7 + 7 + 0 + 0 + +
+
+ + kcolorbutton.h + knuminput.h + kdialog.h + + + + + knuminput.h + knuminput.h + knuminput.h + knuminput.h + schemaeditor.h + sessioneditor.h + +
diff --git a/kcontrol/konsole/schemadialog.ui b/kcontrol/konsole/schemadialog.ui new file mode 100644 index 000000000..64fda6a49 --- /dev/null +++ b/kcontrol/konsole/schemadialog.ui @@ -0,0 +1,631 @@ + +SchemaDialog + + + SchemaDialog + + + + 0 + 0 + 420 + 423 + + + + Konsole Schema Editor + + + + + + + + unnamed + + + 0 + + + + Layout2 + + + + unnamed + + + + TextLabel1 + + + &Title: + + + titleLine + + + + + titleLine + + + + 7 + 5 + 0 + 0 + + + + + + + + GroupBox1 + + + + 5 + 3 + 0 + 0 + + + + Colors + + + + unnamed + + + + TextLabel8 + + + Shell co&lor: + + + colorCombo + + + + + boldCheck + + + &Bold + + + + + Spacer5 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + colorButton + + + + + + + + + Custom + + + + + System Background + + + + + System Foreground + + + + + Random Hue + + + + typeCombo + + + + + Spacer2 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + transparentCheck + + + Trans&parent + + + + + TextLabel1_2 + + + &Konsole color: + + + typeCombo + + + + + + 0 - Foreground Color + + + + + 1 - Background Color + + + + + 2 - Color 0 (black) + + + + + 3 - Color 1 (red) + + + + + 4 - Color 2 (green) + + + + + 5 - Color 3 (yellow) + + + + + 6 - Color 4 (blue) + + + + + 7 - Color 5 (magenta) + + + + + 8 - Color 6 (cyan) + + + + + 9 - Color 7 (white) + + + + + 10 - Foreground Intensive Color + + + + + 11 - Background Intensive Color + + + + + 12 - Color 0 Intensive (gray) + + + + + 13 - Color 1 Intensive (light red) + + + + + 14 - Color 2 Intensive (light green) + + + + + 15 - Color 3 Intensive (light yellow) + + + + + 16 - Color 4 Intensive (light blue) + + + + + 17 - Color 5 Intensive (light magenta) + + + + + 18 - Color 6 Intensive (light cyan) + + + + + 19 - Color 7 Intensive (white) + + + + colorCombo + + + + 5 + 5 + 0 + 0 + + + + + + + + GroupBox2 + + + Schema + + + + unnamed + + + + schemaList + + + + + defaultSchemaCB + + + S&et as default schema + + + + + Layout3 + + + + unnamed + + + + saveButton + + + Sa&ve Schema... + + + + + removeButton + + + &Remove Schema + + + + + Spacer7 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + + + + + GroupBox13 + + + Background + + + + unnamed + + + + Spacer1 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + backgndLine + + + + + imageBrowse + + + ... + + + + + + Tiled + + + + + Centered + + + + + Full + + + + modeCombo + + + + + TextLabel11 + + + &Image: + + + modeCombo + + + + + TextLabel6 + + + Min + + + + + shadeSlide + + + 50 + + + Horizontal + + + + + TextLabel5 + + + Max + + + + + TextLabel3 + + + Shade t&o: + + + shadeColor + + + + + shadeColor + + + + + + + + previewPixmap + + + + 0 + 0 + 0 + 0 + + + + + 180 + 120 + + + + + 180 + 120 + + + + Panel + + + Sunken + + + true + + + + + transparencyCheck + + + Tr&ansparent + + + + + + + Spacer4 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + + transparencyCheck + toggled(bool) + shadeSlide + setEnabled(bool) + + + transparencyCheck + toggled(bool) + shadeColor + setEnabled(bool) + + + transparencyCheck + toggled(bool) + TextLabel3 + setEnabled(bool) + + + transparencyCheck + toggled(bool) + TextLabel6 + setEnabled(bool) + + + transparencyCheck + toggled(bool) + TextLabel5 + setDisabled(bool) + + + transparencyCheck + toggled(bool) + TextLabel5 + setEnabled(bool) + + + defaultSchemaCB + toggled(bool) + defaultSchemaCB + setDisabled(bool) + + + transparencyCheck + toggled(bool) + backgndLine + setDisabled(bool) + + + transparencyCheck + toggled(bool) + imageBrowse + setDisabled(bool) + + + + titleLine + colorCombo + typeCombo + boldCheck + transparentCheck + colorButton + schemaList + defaultSchemaCB + saveButton + removeButton + modeCombo + backgndLine + transparencyCheck + shadeColor + shadeSlide + + + kcolorbutton.h + kdialog.h + + + + diff --git a/kcontrol/konsole/schemaeditor.cpp b/kcontrol/konsole/schemaeditor.cpp new file mode 100644 index 000000000..f7591bee8 --- /dev/null +++ b/kcontrol/konsole/schemaeditor.cpp @@ -0,0 +1,708 @@ +/*************************************************************************** + schemaeditor.cpp - description + ------------------- + begin : mar apr 17 16:44:59 CEST 2001 + copyright : (C) 2001 by Andrea Rizzi + email : rizzi@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#define TABLE_COLORS 20 + + +#include "schemaeditor.h" +#include "schemaeditor.moc" + +#include + +#include +#include +#include +#include +#include +#include +#include + +//#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// SchemaListBoxText is a list box text item with schema filename +class SchemaListBoxText : public QListBoxText +{ + public: + SchemaListBoxText(const QString &title, const QString &filename): QListBoxText(title) + { + m_filename = filename; + }; + + const QString filename() { return m_filename; }; + + private: + QString m_filename; +}; + + +SchemaEditor::SchemaEditor(QWidget * parent, const char *name) +:SchemaDialog(parent, name) +{ + schMod= false; + loaded = false; + schemaLoaded = false; + change = false; + oldSlot = 0; + oldSchema = -1; + color.resize(20); + type.resize(20); + bold.resize(20); + transparent.resize(20); + defaultSchema = ""; + spix = new KSharedPixmap; + + connect(spix, SIGNAL(done(bool)), SLOT(previewLoaded(bool))); + + DCOPClient *client = kapp->dcopClient(); + if (!client->isAttached()) + client->attach(); + QByteArray data; + + QDataStream args(data, IO_WriteOnly); + args << 1; + client->send("kdesktop", "KBackgroundIface", "setExport(int)", data); + + + + + transparencyCheck->setChecked(true); + transparencyCheck->setChecked(false); + + + KGlobal::locale()->insertCatalogue("konsole"); // For schema translations + connect(imageBrowse, SIGNAL(clicked()), this, SLOT(imageSelect())); + connect(saveButton, SIGNAL(clicked()), this, SLOT(saveCurrent())); + connect(removeButton, SIGNAL(clicked()), this, SLOT(removeCurrent())); + connect(colorCombo, SIGNAL(activated(int)), this, SLOT(slotColorChanged(int))); + connect(typeCombo, SIGNAL(activated(int)), this, SLOT(slotTypeChanged(int))); + connect(schemaList, SIGNAL(highlighted(int)), this, SLOT(readSchema(int))); + connect(shadeColor, SIGNAL(changed(const QColor&)), this, SLOT(updatePreview())); + connect(shadeSlide, SIGNAL(valueChanged(int)), this, SLOT(updatePreview())); + connect(transparencyCheck, SIGNAL(toggled(bool)), this, SLOT(updatePreview())); + connect(backgndLine, SIGNAL(returnPressed()), this, SLOT(updatePreview())); + + connect(titleLine, SIGNAL(textChanged(const QString&)), this, SLOT(schemaModified())); + connect(shadeColor, SIGNAL(changed(const QColor&)), this, SLOT(schemaModified())); + connect(shadeSlide, SIGNAL(valueChanged(int)), this, SLOT(schemaModified())); + connect(transparencyCheck, SIGNAL(toggled(bool)), this, SLOT(schemaModified())); + connect(modeCombo, SIGNAL(activated(int)), this, SLOT(schemaModified())); + connect(backgndLine, SIGNAL(returnPressed()), this, SLOT(schemaModified())); + connect(transparentCheck, SIGNAL(toggled(bool)), this, SLOT(schemaModified())); + connect(boldCheck, SIGNAL(toggled(bool)), this, SLOT(schemaModified())); + connect(colorButton, SIGNAL(changed(const QColor&)), this, SLOT(schemaModified())); + connect(backgndLine, SIGNAL(textChanged(const QString&)), this, SLOT(schemaModified())); + + connect(defaultSchemaCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + removeButton->setEnabled( schemaList->currentItem() ); +} + + +QString SchemaEditor::schema() +{ + QString filename = defaultSchema; + + int i = schemaList->currentItem(); + if (defaultSchemaCB->isChecked() && i>=0) + filename = ((SchemaListBoxText *) schemaList->item(i))->filename(); + + return filename.section('/',-1); +} + + +void SchemaEditor::setSchema(QString sch) +{ + defaultSchema = sch; + sch = locate("data", "konsole/"+sch); + + int sc = -1; + for (int i = 0; i < (int) schemaList->count(); i++) + if (sch == ((SchemaListBoxText *) schemaList->item(i))->filename()) + sc = i; + + oldSchema = sc; + if (sc == -1) + sc = 0; + schemaList->setCurrentItem(sc); +// readSchema(sc); +} + +SchemaEditor::~SchemaEditor() +{ + delete spix; +} + + + +void SchemaEditor::updatePreview() +{ + + if (transparencyCheck->isChecked()) { + if (loaded) { + float rx = (100.0 - shadeSlide->value()) / 100; + QImage ima(pix.convertToImage()); + ima = KImageEffect::fade(ima, rx, shadeColor->color()); + QPixmap pm; + pm.convertFromImage(ima); + previewPixmap->setPixmap(pm); + previewPixmap->setScaledContents(true); + } + else //try to reload + { + if(!spix->loadFromShared(QString("DESKTOP1"))) + kdDebug(0) << "cannot load" << endl; + + } + } else { + QPixmap pm; + pm.load(backgndLine->text()); + if ( pm.isNull() ) { + previewPixmap->clear(); + } else { + previewPixmap->setPixmap(pm); + previewPixmap->setScaledContents(true); + } + } + +} + +void SchemaEditor::previewLoaded(bool l) +{ + if (l) { + QWMatrix mat; + pix = + spix->xForm(mat. + scale(180.0 / spix->QPixmap::width(), + 100.0 / spix->QPixmap::height())); + kdDebug(0) << "Loaded" << endl; + loaded = true; + if (transparencyCheck->isChecked()) { + updatePreview(); + } + + } else + kdDebug(0) << "error loading" << endl; + +} + + +void SchemaEditor::getList() +{ + if (! schemaLoaded) { + loadAllSchema(); + setSchema(defaultSchema); + schemaLoaded = true; + change = true; + } +} + +void SchemaEditor::show() +{ + getList(); + SchemaDialog::show(); +} + + +void SchemaEditor::loadAllSchema(QString currentFile) +{ + QStringList list = KGlobal::dirs()->findAllResources("data", "konsole/*.schema"); + QStringList::ConstIterator it; + disconnect(schemaList, SIGNAL(highlighted(int)), this, SLOT(readSchema(int))); + schemaList->clear(); + + QListBoxItem* currentItem = 0; + for (it = list.begin(); it != list.end(); ++it) { + + QString name = (*it); + + QString title = readSchemaTitle(name); + + // Only insert new items so that local items override global + if (schemaList->findItem(title, ExactMatch) == 0) { + if (title.isNull() || title.isEmpty()) + title=i18n("untitled"); + + schemaList->insertItem(new SchemaListBoxText(title, name)); + if (currentFile==name.section('/',-1)) + currentItem = schemaList->item( schemaList->count()-1 ); + } + } + schemaList->sort(); + schemaList->setCurrentItem(0); // select the first added item correctly too + schemaList->setCurrentItem(currentItem); + connect(schemaList, SIGNAL(highlighted(int)), this, SLOT(readSchema(int))); + schemaListChanged(); +} + +void SchemaEditor::imageSelect() +{ + QString start; + start = backgndLine->text(); + if (start.isEmpty()) + { + QStringList list=KGlobal::dirs()->resourceDirs("wallpaper"); + if(list.count()>0) + start= list.last(); + } + + KURL url = KFileDialog::getImageOpenURL(start, 0, i18n("Select Background Image")); +// KURL url=KFileDialog::getOpenURL(start,"",0,i18n("Select Background Image")); + if(!url.path().isEmpty()) + { + backgndLine->setText(url.path()); + updatePreview(); + } +} + +void SchemaEditor::slotTypeChanged(int slot) +{ + schemaModified(); + + bool active = slot == 0 || slot == 3; + colorButton->setEnabled(active); + boldCheck->setEnabled(active); + transparentCheck->setEnabled(active); +} + + +void SchemaEditor::slotColorChanged(int slot) +{ + kdDebug(0) << slot << endl; + color[oldSlot] = colorButton->color(); + type[oldSlot] = typeCombo->currentItem(); + bold[oldSlot] = boldCheck->isChecked(); + transparent[oldSlot] = transparentCheck->isChecked(); + + change = false; // Don't mark as modified + transparentCheck->setChecked(transparent[slot]); + boldCheck->setChecked(bold[slot]); + typeCombo->setCurrentItem(type[slot]); + colorButton->setColor(color[slot]); + oldSlot = slot; + change = true; +} + +void SchemaEditor::removeCurrent() +{ + int i = schemaList->currentItem(); + if(i==-1) + return; + QString base = ((SchemaListBoxText *) schemaList->item(i))->filename(); + + // Query if system schemas should be removed + if (locateLocal("data", "konsole/" + base.section('/', -1)) != base) { + int code = KMessageBox::warningContinueCancel(this, + i18n("You are trying to remove a system schema. Are you sure?"), + i18n("Removing System Schema"), + KGuiItem(i18n("&Delete"), "editdelete")); + if (code != KMessageBox::Continue) + return; + } + + QString base_filename = base.section('/',-1); + + if(base_filename==schema()) + setSchema(""); + + if (!QFile::remove(base)) + KMessageBox::error(this, + i18n("Cannot remove the schema.\nMaybe it is a system schema.\n"), + i18n("Error Removing Schema")); + + loadAllSchema(); + + setSchema(defaultSchema); + +} + +void SchemaEditor::saveCurrent() +{ + + //This is to update the color table + colorCombo->setCurrentItem(0); + slotColorChanged(0); + + QString fullpath; + if (schemaList->currentText() == titleLine->text()) { + int i = schemaList->currentItem(); + fullpath = ((SchemaListBoxText *) schemaList->item(i))->filename().section('/',-1); + } + else { + // Only ask for a name for changed titleLine, considered a "save as" + fullpath = titleLine->text().stripWhiteSpace().simplifyWhiteSpace()+".schema"; + + bool ok; + fullpath = KInputDialog::getText( i18n( "Save Schema" ), + i18n( "File name:" ), fullpath, &ok, this ); + if (!ok) return; + } + + if (fullpath[0] != '/') + fullpath = KGlobal::dirs()->saveLocation("data", "konsole/") + fullpath; + + QFile f(fullpath); + if (f.open(IO_WriteOnly)) { + QTextStream t(&f); + t.setEncoding( QTextStream::UnicodeUTF8 ); + + t << "# schema for konsole autogenerated with the schema editor" << endl; + t << endl; + t << "title " << titleLine->text() << endl; // Use title line as schema title + t << endl; + if (transparencyCheck->isChecked()) { + QColor c = shadeColor->color(); + QString tra; + tra.sprintf("transparency %1.2f %3d %3d %3d", + 1.0 * (100 - shadeSlide->value()) / 100, c.red(), c.green(), c.blue()); + t << tra << endl; + } + + if (!backgndLine->text().isEmpty()) { + QString smode; + int mode; + mode = modeCombo->currentItem(); + if (mode == 0) + smode = "tile"; + if (mode == 1) + smode = "center"; + if (mode == 2) + smode = "full"; + + QString image; + image.sprintf("image %s %s", + (const char *) smode.latin1(), + (const char *) backgndLine->text().utf8()); + t << image << endl; + } + t << endl; + t << "# foreground colors" << endl; + t << endl; + t << "# note that the default background color is flagged" << endl; + t << "# to become transparent when an image is present." << endl; + t << endl; + t << "# slot transparent bold" << endl; + t << "# | red grn blu | |" << endl; + t << "# V V--color--V V V" << endl; + + for (int i = 0; i < 20; i++) { + QString scol; + if (type[i] == 0) + scol.sprintf("color %2d %3d %3d %3d %2d %1d # %s", i, + color[i].red(), color[i].green(), color[i].blue(), + transparent[i], bold[i], + (const char *) colorCombo->text(i).utf8()); + else if (type[i] == 1) + scol.sprintf("sysfg %2d %2d %1d # %s", i, + transparent[i], bold[i], + (const char *) colorCombo->text(i).utf8()); + else if (type[i] == 2) + scol.sprintf("sysbg %2d %2d %1d # %s", i, + transparent[i], bold[i], + (const char *) colorCombo->text(i).utf8()); + else { + int ch, cs, cv; + color[i].hsv(&ch, &cs, &cv); + scol.sprintf("rcolor %1d %3d %3d %2d %1d # %s", i, + cs, cv, transparent[i], bold[i], + (const char *) colorCombo->text(i).utf8()); + } + t << scol << endl; + } + + + f.close(); + } else + KMessageBox::error(this, i18n("Cannot save the schema.\nMaybe permission denied.\n"), + i18n("Error Saving Schema")); + + schMod=false; + loadAllSchema(fullpath.section('/',-1)); +} + +void SchemaEditor::schemaModified() +{ + if (change) { + saveButton->setEnabled(titleLine->text().length() != 0); + schMod=true; + emit changed(); + } +} + +QString SchemaEditor::readSchemaTitle(const QString & file) +{ + /* + Code taken from konsole/konsole/schema.cpp + + */ + + + QString fPath = locate("data", "konsole/" + file); + + if (fPath.isNull()) + fPath = locate("data", file); + + if (fPath.isNull()) + return 0; + + FILE *sysin = fopen(QFile::encodeName(fPath), "r"); + if (!sysin) + return 0; + + + char line[100]; + while (fscanf(sysin, "%80[^\n]\n", line) > 0) + if (strlen(line) > 5) + if (!strncmp(line, "title", 5)) { + fclose(sysin); + return i18n(line + 6); + } + + return 0; +} + +void SchemaEditor::schemaListChanged() +{ + QStringList titles, filenames; + SchemaListBoxText *item; + + for (int index = 0; index < (int) schemaList->count(); index++) { + item = (SchemaListBoxText *) schemaList->item(index); + titles.append(item->text()); + filenames.append(item->filename().section('/', -1)); + } + + emit schemaListChanged(titles, filenames); +} + +void SchemaEditor::querySave() +{ + int result = KMessageBox::questionYesNo(this, + i18n("The schema has been modified.\n" + "Do you want to save the changes?"), + i18n("Schema Modified"), + KStdGuiItem::save(), + KStdGuiItem::discard()); + if (result == KMessageBox::Yes) + { + saveCurrent(); + } +} + +void SchemaEditor::readSchema(int num) +{ + /* + Code taken from konsole/konsole/schema.cpp + + */ + + if (oldSchema != -1) { + + + if (defaultSchemaCB->isChecked()) { + + defaultSchema = ((SchemaListBoxText *) schemaList->item(oldSchema))->filename(); + + } + + if(schMod) { + disconnect(schemaList, SIGNAL(highlighted(int)), this, SLOT(readSchema(int))); + schemaList->setCurrentItem(oldSchema); + querySave(); + schemaList->setCurrentItem(num); + connect(schemaList, SIGNAL(highlighted(int)), this, SLOT(readSchema(int))); + schMod=false; + } + + } + + QString fPath = locate("data", "konsole/" + + ((SchemaListBoxText *) schemaList->item(num))->filename()); + + if (fPath.isNull()) + fPath = locate("data", + ((SchemaListBoxText *) schemaList->item(num))->filename()); + + if (fPath.isNull()) { + KMessageBox::error(this, i18n("Cannot find the schema."), + i18n("Error Loading Schema")); + + + return; + } + removeButton->setEnabled( QFileInfo (fPath).isWritable () ); + defaultSchemaCB->setChecked(fPath.section('/',-1) == defaultSchema.section('/',-1)); + + FILE *sysin = fopen(QFile::encodeName(fPath), "r"); + if (!sysin) { + KMessageBox::error(this, i18n("Cannot load the schema."), + i18n("Error Loading Schema")); + loadAllSchema(); + return; + } + + char line[100]; + + + titleLine->setText(i18n("untitled")); + transparencyCheck->setChecked(false); + backgndLine->setText(""); + + while (fscanf(sysin, "%80[^\n]\n", line) > 0) { + if (strlen(line) > 5) { + + if (!strncmp(line, "title", 5)) { + titleLine->setText(i18n(line + 6)); + } + + + + if (!strncmp(line, "image", 5)) { + char rend[100], path[100]; + int attr = 1; + if (sscanf(line, "image %s %s", rend, path) != 2) + continue; + if (!strcmp(rend, "tile")) + attr = 2; + else if (!strcmp(rend, "center")) + attr = 3; + else if (!strcmp(rend, "full")) + attr = 4; + else + continue; + + QString qline(line); + backgndLine->setText(locate("wallpaper", qline.mid( qline.find(" ",7)+1 ) )); + modeCombo->setCurrentItem(attr - 2); + + } + + + if (!strncmp(line, "transparency", 12)) { + float rx; + int rr, rg, rb; + // Transparency needs 4 parameters: fade strength and the 3 + // components of the fade color. + if (sscanf(line, "transparency %g %d %d %d", &rx, &rr, &rg, &rb) != 4) + continue; + + transparencyCheck->setChecked(true); + shadeSlide->setValue((int)(100 - rx * 100)); + shadeColor->setColor(QColor(rr, rg, rb)); + + } + if (!strncmp(line,"rcolor",6)) { + int fi,ch,cs,cv,tr,bo; + if(sscanf(line,"rcolor %d %d %d %d %d",&fi,&cs,&cv,&tr,&bo) != 5) + continue; + if (!(0 <= fi && fi <= TABLE_COLORS)) + continue; + ch = 0; // Random hue - set to zero + if (!(0 <= cs && cs <= 255 )) + continue; + if (!(0 <= cv && cv <= 255 )) + continue; + if (!(0 <= tr && tr <= 1 )) + continue; + if (!(0 <= bo && bo <= 1 )) + continue; + color[fi] = QColor(); + color[fi].setHsv(ch,cs,cv); + transparent[fi] = tr; + bold[fi] = bo; + type[fi] = 3; + } + if (!strncmp(line, "color", 5)) { + int fi, cr, cg, cb, tr, bo; + if (sscanf(line, "color %d %d %d %d %d %d", &fi, &cr, &cg, &cb, &tr, &bo) != 6) + continue; + if (!(0 <= fi && fi <= TABLE_COLORS)) + continue; + if (!(0 <= cr && cr <= 255)) + continue; + if (!(0 <= cg && cg <= 255)) + continue; + if (!(0 <= cb && cb <= 255)) + continue; + if (!(0 <= tr && tr <= 1)) + continue; + if (!(0 <= bo && bo <= 1)) + continue; + color[fi] = QColor(cr, cg, cb); + transparent[fi] = tr; + bold[fi] = bo; + type[fi] = 0; + + } + if (!strncmp(line, "sysfg", 5)) { + int fi, tr, bo; + if (sscanf(line, "sysfg %d %d %d", &fi, &tr, &bo) != 3) + continue; + if (!(0 <= fi && fi <= TABLE_COLORS)) + continue; + if (!(0 <= tr && tr <= 1)) + continue; + if (!(0 <= bo && bo <= 1)) + continue; + color[fi] = kapp->palette().active().text(); + transparent[fi] = tr; + bold[fi] = bo; + type[fi] = 1; + } + if (!strncmp(line, "sysbg", 5)) { + int fi, tr, bo; + if (sscanf(line, "sysbg %d %d %d", &fi, &tr, &bo) != 3) + continue; + if (!(0 <= fi && fi <= TABLE_COLORS)) + continue; + if (!(0 <= tr && tr <= 1)) + continue; + if (!(0 <= bo && bo <= 1)) + continue; + color[fi] = kapp->palette().active().base(); + transparent[fi] = tr; + bold[fi] = bo; + type[fi] = 2; + } + } + } + fclose(sysin); + int ii = colorCombo->currentItem(); + transparentCheck->setChecked(transparent[ii]); + boldCheck->setChecked(bold[ii]); + typeCombo->setCurrentItem(type[ii]); + colorButton->setColor(color[ii]); + + bool inactive = type[ii] == 1 || type[ii] == 2; + boldCheck->setDisabled(inactive); + transparentCheck->setDisabled(inactive); + colorButton->setDisabled(inactive); + + oldSchema = num; + updatePreview(); + schMod=false; + return; +} + diff --git a/kcontrol/konsole/schemaeditor.h b/kcontrol/konsole/schemaeditor.h new file mode 100644 index 000000000..550f51762 --- /dev/null +++ b/kcontrol/konsole/schemaeditor.h @@ -0,0 +1,84 @@ +/*************************************************************************** + schemaeditor.h - description + ------------------- + begin : mar apr 17 16:44:59 CEST 2001 + copyright : (C) 2001 by Andrea Rizzi + email : rizzi@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef SCHEMAEDITOR_H +#define SCHEMAEDITOR_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +class QPixmap; +class KSharedPixmap; + +#include "schemadialog.h" + +/** SchemaEditor is the base class of the porject */ +class SchemaEditor : public SchemaDialog +{ + Q_OBJECT + public: + /** constructor */ + SchemaEditor(QWidget* parent=0, const char *name=0); + /** destructor */ + ~SchemaEditor(); + + QString schema(); + void setSchema(QString); + bool isModified() const { return schMod; } + void querySave(); + + signals: + void changed(); + void schemaListChanged(const QStringList &titles, const QStringList &filenames); + + public slots: + void slotColorChanged(int); + void imageSelect(); + void slotTypeChanged(int); + void readSchema(int); + void saveCurrent(); + void removeCurrent(); + void previewLoaded(bool l); + void getList(); + private slots: + void show(); + void schemaModified(); + void loadAllSchema(QString currentFile=""); + void updatePreview(); + private: + bool schMod; + QMemArray color; + QMemArray type; // 0= custom, 1= sysfg, 2=sysbg, 3=rcolor + QMemArray transparent; + QMemArray bold; + QPixmap pix; + KSharedPixmap *spix; + QString defaultSchema; + bool loaded; + bool schemaLoaded; + bool change; + int oldSchema; + int oldSlot; + QString readSchemaTitle(const QString& filename); + void schemaListChanged(); + +}; + +#endif diff --git a/kcontrol/konsole/sessiondialog.ui b/kcontrol/konsole/sessiondialog.ui new file mode 100644 index 000000000..a86a74077 --- /dev/null +++ b/kcontrol/konsole/sessiondialog.ui @@ -0,0 +1,446 @@ + +SessionDialog + + + SessionDialog + + + + 0 + 0 + 436 + 476 + + + + Konsole Session Editor + + + + + + + + unnamed + + + 0 + + + + layout8 + + + + unnamed + + + + propertiesGroup + + + Properties + + + + unnamed + + + + Layout29 + + + + unnamed + + + + + <Default> + + + + + Normal + + + + + Tiny + + + + + Small + + + + + Medium + + + + + Large + + + + + Huge + + + + + Linux + + + + + Unicode + + + + + Custom + + + + fontCombo + + + false + + + + + termLine + + + + 7 + 5 + 0 + 0 + + + + + + keytabCombo + + + + + TextLabel5 + + + &Font: + + + fontCombo + + + + + schemaCombo + + + + + TextLabel7 + + + S&chema: + + + schemaCombo + + + + + TextLabel8 + + + $&TERM: + + + termLine + + + + + TextLabel6 + + + &Keytab: + + + keytabCombo + + + + + + + previewIcon + + + + 100 + 100 + + + + + 100 + 100 + + + + + + + + + TextLabel4 + + + + 7 + 0 + 0 + 0 + + + + + 90 + 100 + + + + &Icon: + + + AlignTop|AlignLeft + + + previewIcon + + + + + + + sessionGroup + + + Session + + + + unnamed + + + + sessionList + + + + + Layout3 + + + + unnamed + + + + saveButton + + + Sa&ve Session... + + + + + removeButton + + + &Remove Session + + + + + Spacer7 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + + + + + generalGroup + + + + 5 + 5 + 0 + 0 + + + + General + + + + unnamed + + + + layout6 + + + + unnamed + + + + layout5 + + + + unnamed + + + + TextLabel1 + + + + 0 + 5 + 0 + 0 + + + + &Name: + + + nameLine + + + + + TextLabel2 + + + E&xecute: + + + executeLine + + + + + TextLabel3 + + + &Directory: + + + directoryLine + + + + + + + layout4 + + + + unnamed + + + + nameLine + + + + 7 + 5 + 0 + 0 + + + + + + executeLine + + + + 7 + 5 + 0 + 0 + + + + + + directoryLine + + + + + + + + + + + + + + nameLine + executeLine + directoryLine + sessionList + saveButton + removeButton + previewIcon + fontCombo + termLine + keytabCombo + schemaCombo + + + kcolorbutton.h + kdialog.h + + + + + kicondialog.h + kurlrequester.h + klineedit.h + kpushbutton.h + + diff --git a/kcontrol/konsole/sessioneditor.cpp b/kcontrol/konsole/sessioneditor.cpp new file mode 100644 index 000000000..8542adfcb --- /dev/null +++ b/kcontrol/konsole/sessioneditor.cpp @@ -0,0 +1,383 @@ +/*************************************************************************** + sessioneditor.cpp - description + ------------------- + begin : oct 28 2001 + copyright : (C) 2001 by Stephan Binner + email : binner@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#include "sessioneditor.h" +#include "sessioneditor.moc" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// SessionListBoxText is a list box text item with session filename +class SessionListBoxText : public QListBoxText +{ + public: + SessionListBoxText(const QString &title, const QString &filename): QListBoxText(title) + { + m_filename = filename; + }; + + const QString filename() { return m_filename; }; + + private: + QString m_filename; +}; + +SessionEditor::SessionEditor(QWidget * parent, const char *name) +:SessionDialog(parent, name) +{ + sesMod=false; + oldSession=-1; + loaded=false; + + KGlobal::locale()->insertCatalogue("konsole"); // For schema and keytab translations + KGlobal::iconLoader()->addAppDir( "konsole" ); + + directoryLine->setMode(KFile::Directory); + connect(sessionList, SIGNAL(highlighted(int)), this, SLOT(readSession(int))); + connect(saveButton, SIGNAL(clicked()), this, SLOT(saveCurrent())); + connect(removeButton, SIGNAL(clicked()), this, SLOT(removeCurrent())); + + connect(nameLine, SIGNAL(textChanged(const QString&)), this, SLOT(sessionModified())); + connect(directoryLine, SIGNAL(textChanged(const QString&)), this, SLOT(sessionModified())); + connect(executeLine, SIGNAL(textChanged(const QString&)), this, SLOT(sessionModified())); + connect(termLine, SIGNAL(textChanged(const QString&)), this, SLOT(sessionModified())); + + connect(previewIcon, SIGNAL(iconChanged(QString)), this, SLOT(sessionModified())); + + connect(fontCombo, SIGNAL(activated(int)), this, SLOT(sessionModified())); + connect(keytabCombo, SIGNAL(activated(int)), this, SLOT(sessionModified())); + connect(schemaCombo, SIGNAL(activated(int)), this, SLOT(sessionModified())); +} + +SessionEditor::~SessionEditor() +{ + keytabFilename.setAutoDelete(true); + schemaFilename.setAutoDelete(true); +} + +void SessionEditor::show() +{ + removeButton->setEnabled(sessionList->count()>1); + if (! loaded) { + loadAllKeytab(); + loadAllSession(); + readSession(0); + sessionList->setCurrentItem(0); + loaded = true; + } + SessionDialog::show(); +} + +void SessionEditor::loadAllKeytab() +{ + QStringList lst = KGlobal::dirs()->findAllResources("data", "konsole/*.keytab"); + keytabCombo->clear(); + keytabFilename.clear(); + + keytabCombo->insertItem(i18n("XTerm (XFree 4.x.x)"),0); + keytabFilename.append(new QString("")); + + int i=1; + for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) + { + QString name = (*it); + QString title = readKeymapTitle(name); + + name = name.section('/',-1); + name = name.section('.',0); + keytabFilename.append(new QString(name)); + + if (title.isNull() || title.isEmpty()) + title=i18n("untitled"); + + keytabCombo->insertItem(title,i); + + i++; + } +} + +QString SessionEditor::readKeymapTitle(const QString & file) +{ + QString fPath = locate("data", "konsole/" + file); + + if (fPath.isNull()) + fPath = locate("data", file); + removeButton->setEnabled( QFileInfo (fPath).isWritable () ); + + if (fPath.isNull()) + return 0; + + FILE *sysin = fopen(QFile::encodeName(fPath), "r"); + if (!sysin) + return 0; + + char line[100]; + int len; + while (fscanf(sysin, "%80[^\n]\n", line) > 0) + if ((len = strlen(line)) > 8) + if (!strncmp(line, "keyboard", 8)) { + fclose(sysin); + if(line[len-1] == '"') + line[len-1] = '\000'; + QString temp; + if(line[9] == '"') + temp=i18n(line+10); + else + temp=i18n(line+9); + return temp; + } + + return 0; +} + +void SessionEditor::loadAllSession(QString currentFile) +{ + QStringList list = KGlobal::dirs()->findAllResources("data", "konsole/*.desktop", false, true); + sessionList->clear(); + + QListBoxItem* currentItem = 0; + for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + + QString name = (*it); + + KSimpleConfig* co = new KSimpleConfig(name,true); + co->setDesktopGroup(); + QString sesname = co->readEntry("Name",i18n("Unnamed")); + delete co; + + sessionList->insertItem(new SessionListBoxText(sesname, name)); + + if (currentFile==name.section('/',-1)) + currentItem = sessionList->item( sessionList->count()-1 ); + } + sessionList->sort(); + sessionList->setCurrentItem(0); // select the first added item correctly too + sessionList->setCurrentItem(currentItem); + emit getList(); +} + +void SessionEditor::readSession(int num) +{ + int i,counter; + QString str; + KSimpleConfig* co; + + if(sesMod) { + disconnect(sessionList, SIGNAL(highlighted(int)), this, SLOT(readSession(int))); + + sessionList->setCurrentItem(oldSession); + querySave(); + sessionList->setCurrentItem(num); + connect(sessionList, SIGNAL(highlighted(int)), this, SLOT(readSession(int))); + sesMod=false; + } + if( sessionList->item(num) ) + { + removeButton->setEnabled( QFileInfo ( ((SessionListBoxText *)sessionList->item(num))->filename() ).isWritable () ); + co = new KSimpleConfig( ((SessionListBoxText *)sessionList->item(num))->filename(),true); + + co->setDesktopGroup(); + str = co->readEntry("Name"); + nameLine->setText(str); + + str = co->readPathEntry("Cwd"); + directoryLine->lineEdit()->setText(str); + + str = co->readPathEntry("Exec"); + executeLine->setText(str); + + str = co->readEntry("Icon","konsole"); + previewIcon->setIcon(str); + + i = co->readUnsignedNumEntry("Font",(unsigned int)-1); + fontCombo->setCurrentItem(i+1); + + str = co->readEntry("Term","xterm"); + termLine->setText(str); + + str = co->readEntry("KeyTab",""); + i=0; + counter=0; + for (QString *it = keytabFilename.first(); it != 0; it = keytabFilename.next()) { + if (str == (*it)) + i = counter; + counter++; + } + keytabCombo->setCurrentItem(i); + + str = co->readEntry("Schema",""); + i=0; + counter=0; + for (QString *it = schemaFilename.first(); it != 0; it = schemaFilename.next()) { + if (str == (*it)) + i = counter; + counter++; + } + schemaCombo->setCurrentItem(i); + delete co; + } + sesMod=false; + oldSession=num; +} + +void SessionEditor::querySave() +{ + int result = KMessageBox::questionYesNo(this, + i18n("The session has been modified.\n" + "Do you want to save the changes?"), + i18n("Session Modified"), + KStdGuiItem::save(), + KStdGuiItem::discard()); + if (result == KMessageBox::Yes) + { + saveCurrent(); + } +} + +void SessionEditor::schemaListChanged(const QStringList &titles, const QStringList &filenames) +{ + const QString text = schemaCombo->currentText(); + + schemaCombo->clear(); + schemaFilename.clear(); + + schemaCombo->insertItem(i18n("Konsole Default"),0); + schemaFilename.append(new QString("")); + + schemaCombo->insertStringList(titles, 1); + for (QStringList::const_iterator it = filenames.begin(); it != filenames.end(); ++it) + schemaFilename.append(new QString(*it)); + + // Restore current item + int item = 0; + for (int i = 0; i < schemaCombo->count(); i++) + if (schemaCombo->text(i) == text) { + item = i; + break; + } + schemaCombo->setCurrentItem(item); +} + +void SessionEditor::saveCurrent() +{ + // Verify Execute entry is valid; otherwise Konsole will ignore it. + // This code is take from konsole.cpp; if you change one, change both. + QString exec = executeLine->text(); + if ( !exec.isEmpty() ) // If Execute field is empty, default shell is used. + { + if ( exec.startsWith( "su -c \'" ) ) + exec = exec.mid( 7, exec.length() - 8 ); + exec = KRun::binaryName( exec, false ); + exec = KShell::tildeExpand( exec ); + QString pexec = KGlobal::dirs()->findExe( exec ); + + if ( pexec.isEmpty() ) + { + int result = KMessageBox::warningContinueCancel( this, + i18n( "The Execute entry is not a valid command.\n" + "You can still save this session, but it will not show up in Konsole's Session list." ), + i18n( "Invalid Execute Entry" ), + KStdGuiItem::save() ); + if ( result != KMessageBox::Continue ) + return; + } + + } + + QString fullpath; + if (sessionList->currentText() == nameLine->text()) { + fullpath = ( ((SessionListBoxText *)sessionList->item( sessionList->currentItem() ))->filename() ).section('/',-1); + } + else { + // Only ask for a name for changed nameLine, considered a "save as" + fullpath = nameLine->text().stripWhiteSpace().simplifyWhiteSpace()+".desktop"; + + bool ok; + fullpath = KInputDialog::getText( i18n( "Save Session" ), + i18n( "File name:" ), fullpath, &ok, this ); + if (!ok) return; + } + + if (fullpath[0] != '/') + fullpath = KGlobal::dirs()->saveLocation("data", "konsole/") + fullpath; + + KSimpleConfig* co = new KSimpleConfig(fullpath); + co->setDesktopGroup(); + co->writeEntry("Type","KonsoleApplication"); + co->writeEntry("Name",nameLine->text()); + co->writePathEntry("Cwd",directoryLine->lineEdit()->text()); + co->writePathEntry("Exec",executeLine->text()); + co->writeEntry("Icon",previewIcon->icon()); + if (fontCombo->currentItem()==0) + co->writeEntry("Font",""); + else + co->writeEntry("Font",fontCombo->currentItem()-1); + co->writeEntry("Term",termLine->text()); + co->writeEntry("KeyTab",*keytabFilename.at(keytabCombo->currentItem())); + co->writeEntry("Schema",*schemaFilename.at(schemaCombo->currentItem())); + co->sync(); + delete co; + sesMod=false; + loadAllSession(fullpath.section('/',-1)); + removeButton->setEnabled(sessionList->count()>1); +} + +void SessionEditor::removeCurrent() +{ + QString base = ((SessionListBoxText *)sessionList->item( sessionList->currentItem() ))->filename(); + + // Query if system sessions should be removed + if (locateLocal("data", "konsole/" + base.section('/', -1)) != base) { + int code = KMessageBox::warningContinueCancel(this, + i18n("You are trying to remove a system session. Are you sure?"), + i18n("Removing System Session"), + KGuiItem(i18n("&Delete"),"editdelete")); + if (code != KMessageBox::Continue) + return; + } + + if (!QFile::remove(base)) { + KMessageBox::error(this, + i18n("Cannot remove the session.\nMaybe it is a system session.\n"), + i18n("Error Removing Session")); + return; + } + removeButton->setEnabled(sessionList->count()>1); + loadAllSession(); + readSession(0); + sessionList->setCurrentItem(0); +} + +void SessionEditor::sessionModified() +{ + saveButton->setEnabled(nameLine->text().length() != 0); + sesMod=true; + emit changed(); +} diff --git a/kcontrol/konsole/sessioneditor.h b/kcontrol/konsole/sessioneditor.h new file mode 100644 index 000000000..15d1aee2b --- /dev/null +++ b/kcontrol/konsole/sessioneditor.h @@ -0,0 +1,68 @@ +/*************************************************************************** + sessioneditor.h - description + ------------------- + begin : oct 28 2001 + copyright : (C) 2001 by Stephan Binner + email : binner@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef SESSIONEDITOR_H +#define SESSIONEDITOR_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include "sessiondialog.h" + +class SessionEditor : public SessionDialog +{ + Q_OBJECT + public: + SessionEditor(QWidget* parent=0, const char *name=0); + ~SessionEditor(); + + bool isModified() const { return sesMod; } + void querySave(); + + signals: + void changed(); + void getList(); + + public slots: + void schemaListChanged(const QStringList &titles, const QStringList &filenames); + + private slots: + void readSession(int); + void saveCurrent(); + void removeCurrent(); + void sessionModified(); + + private: + void show(); + void loadAllKeytab(); + void loadAllSession(QString currentFile=""); + QString readKeymapTitle(const QString& filename); + + bool sesMod; + int oldSession; + bool loaded; + QPtrList keytabFilename; + QPtrList schemaFilename; +}; + +#endif -- cgit v1.2.1