Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 33e1a53c authored by Robert Knight's avatar Robert Knight

Fix crash when changing color scheme if none in the list were previously...

Fix crash when changing color scheme if none in the list were previously checked.  Add API documentation.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=663366
parent c43d476a
......@@ -54,6 +54,7 @@ Application::Application()
KeyboardTranslatorManager::setInstance( new KeyboardTranslatorManager() );
// old keyboard translator manager
// (for use until the new one is completed)
KeyTrans::loadAll();
// check for compositing functionality
......
......@@ -40,6 +40,15 @@ class ColorScheme;
/**
* A dialog for editing color schemes.
*
* After creation, the dialog can be initialised with the settings
* of a color scheme using the setup() method.
*
* The dialog creates a copy of the supplied color scheme to which
* any changes made are applied. The modified color scheme
* can be retrieved using the colorScheme() method.
*
* When changes are made the colorsChanged() signal is emitted.
*/
class ColorSchemeEditor : public QWidget
{
......@@ -50,9 +59,9 @@ public:
ColorSchemeEditor(QWidget* parent = 0);
virtual ~ColorSchemeEditor();
/** Initialises the dialog with the properties of the specified color scheme. */
/** Initialises the dialog with the properties of the specified color scheme. */
void setup(const ColorScheme* scheme);
/** Returns the edited color scheme. */
/** Returns the modified color scheme. */
ColorScheme* colorScheme() const;
signals:
......
......@@ -536,8 +536,10 @@ void EditProfileDialog::changeCheckedItem( QAbstractItemModel* model , const QMo
{
// uncheck current active item
QModelIndexList list = model->match( model->index(0,0) , Qt::CheckStateRole , Qt::Checked );
Q_ASSERT( list.count() == 1 );
model->setData( list.first() , Qt::Unchecked , Qt::CheckStateRole );
QListIterator<QModelIndex> iter(list);
while ( iter.hasNext() )
model->setData( iter.next() , Qt::Unchecked , Qt::CheckStateRole );
// check new active item
model->setData( to , Qt::Checked , Qt::CheckStateRole );
......
......@@ -43,6 +43,16 @@ class Profile;
/**
* A dialog which allows the user to edit a profile.
* After the dialog is created, it can be initialised with the settings
* for a profile using setProfile(). When the user makes changes to the
* dialog and accepts the changes, the dialog will update the
* profile in the SessionManager by calling the SessionManager's
* changeProfile() method.
*
* Some changes made in the dialog are preview-only changes which cause
* the SessionManager's changeProfile() method to be called with
* the persistant argument set to false. These changes are then
* un-done when the dialog is closed.
*
* TODO: More documentation
*/
......@@ -67,7 +77,9 @@ public:
void setProfile(const QString& key);
public slots:
// reimplemented
virtual void accept();
// reimplemented
virtual void reject();
protected:
......
......@@ -33,18 +33,42 @@ namespace Konsole
class KeyboardTranslator;
/**
* A dialog which allows the user to edit a key bindings list,
* which maps between key combinations and text produced
* in the shell when those combinations are pressed.
*
* The dialog can be initialised with the settings of an
* existing key bindings list using the setup() method.
*
* The dialog creates a copy of the supplied keyboard translator
* to which any changes are applied. The modified translator
* can be retrieved using the translator() method.
*/
class KeyBindingEditor : public QWidget
{
Q_OBJECT
public:
/** Constructs a new key bindings editor with the specified parent. */
KeyBindingEditor(QWidget* parent = 0);
virtual ~KeyBindingEditor();
/**
* Intialises the dialog with the bindings and other settings
* from the specified @p translator.
*/
void setup(const KeyboardTranslator* translator);
/**
* Returns the modified translator describing the changes to the bindings
* and other settings which the user made.
*/
KeyboardTranslator* translator() const;
/**
* Returns the text of the editor's description field.
*/
QString description() const;
public slots:
......
......@@ -170,6 +170,7 @@ bool KDE4ProfileWriter::writeProfile(const QString& path , const Profile* profil
{
KConfig config(path,KConfig::NoGlobals);
// Basic Profile Settings
KConfigGroup general = config.group("General");
if ( profile->isPropertySet(Profile::Name) )
......@@ -184,37 +185,46 @@ bool KDE4ProfileWriter::writeProfile(const QString& path , const Profile* profil
general.writeEntry("Directory",profile->defaultWorkingDirectory());
writeStandardElement( general , "Icon" , profile , Profile::Icon );
// Tab Titles
writeStandardElement( general , "LocalTabTitleFormat" , profile , Profile::LocalTabTitleFormat );
writeStandardElement( general , "RemoteTabTitleFormat" , profile , Profile::RemoteTabTitleFormat );
// Menu and Tab Bar
writeStandardElement( general , "TabBarMode" , profile , Profile::TabBarMode );
writeStandardElement( general , "ShowMenuBar" , profile , Profile::ShowMenuBar );
// Keyboard
KConfigGroup keyboard = config.group("Keyboard");
writeStandardElement( keyboard , "KeyBindings" , profile , Profile::KeyBindings );
// Appearance
KConfigGroup appearance = config.group("Appearance");
writeStandardElement( appearance , "ColorScheme" , profile , Profile::ColorScheme );
writeStandardElement( appearance , "Font" , profile , Profile::Font );
// Scrolling
KConfigGroup scrolling = config.group("Scrolling");
writeStandardElement( scrolling , "HistoryMode" , profile , Profile::HistoryMode );
writeStandardElement( scrolling , "HistorySize" , profile , Profile::HistorySize );
writeStandardElement( scrolling , "ScrollBarPosition" , profile , Profile::ScrollBarPosition );
// Terminal Features
KConfigGroup terminalFeatures = config.group("Terminal Features");
writeStandardElement( terminalFeatures , "FlowControl" , profile , Profile::FlowControlEnabled );
writeStandardElement( terminalFeatures , "BlinkingCursor" , profile , Profile::BlinkingCursorEnabled );
// Cursor
KConfigGroup cursorOptions = config.group("Cursor Options");
writeStandardElement( cursorOptions , "UseCustomCursorColor" , profile , Profile::UseCustomCursorColor );
writeStandardElement( cursorOptions , "CustomCursorColor" , profile , Profile::CustomCursorColor );
writeStandardElement( cursorOptions , "CursorShape" , profile , Profile::CursorShape );
// Interaction
KConfigGroup interactionOptions = config.group("Interaction Options");
writeStandardElement( interactionOptions , "WordCharacters" , profile , Profile::WordCharacters );
......
This diff is collapsed.
......@@ -26,7 +26,27 @@
namespace Konsole
{
/** A class to parse and extract information about shell commands. */
/**
* A class to parse and extract information about shell commands.
*
* ShellCommand can be used to:
*
* <ul>
* <li>Take a command-line (eg "/bin/sh -c /path/to/my/script") and split it
* into its component parts (eg. the command "/bin/sh" and the arguments
* "-c","/path/to/my/script")
* </li>
* <li>Take a command and a list of arguments and combine them to
* form a complete command line.
* </li>
* <li>Determine whether the binary specified by a command exists in the
* user's PATH.
* </li>
* <li>Determine whether a command-line specifies the execution of
* another command as the root user using su/sudo etc.
* </li>
* </ul>
*/
class ShellCommand
{
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment