Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TabManager Class Reference

#include </home/clem/local/src/opie/noncore/unsupported/tabmanager/tabmanager.h>

Inheritance diagram for TabManager:

Inheritance graph
[legend]
Collaboration diagram for TabManager:

Collaboration graph
[legend]
List of all members.

Public Slots

void newFolder ()
void newApplication ()
void removeItem ()
void editCurrentItem ()

Public Member Functions

 TabManager (QWidget *parent=0, const char *name=0)
 ~TabManager ()

Public Attributes

bool changed

Protected Member Functions

void rescanFolder (QString directory, QListViewItem *parent=NULL)
bool findInstalledApplication (QString desktopFile, QString &installedAppFile)
void swapInstalledLocation (QString installedAppFile, QString desktopFile, QString newLocation)

Protected Attributes

QMap< QListViewItem *, QStringitemList

Private Slots

void moveApplication (QListViewItem *, QListViewItem *)
void editItem (QListViewItem *item)

Private Attributes

AppEdit * application

Constructor & Destructor Documentation

TabManager::TabManager QWidget *  parent = 0,
const char *  name = 0
 

Constructor. Sets up signals. Performs initial scan of applications and tabs

Definition at line 35 of file tabmanager.cpp.

References editItem(), HOME_APP_DIR, moveApplication(), rescanFolder(), and TabManagerBase::tabList.

TabManager::~TabManager  ) 
 

If anything in the tab's have been changed then update the system or alert the user.

Definition at line 48 of file tabmanager.cpp.

References changed.


Member Function Documentation

void TabManager::editCurrentItem  )  [slot]
 

Helper function. Edits the current item. calls editItem with the currently selected item.

Definition at line 234 of file tabmanager.cpp.

References editItem(), and TabManagerBase::tabList.

void TabManager::editItem QListViewItem *  item  )  [private, slot]
 

Edit the item that is passed in. Show application dialog and if anything changed

Parameters:
item the item to edit.

Definition at line 243 of file tabmanager.cpp.

References app, application, APPLICATION_EXTENSION, changed, AppLnk::comment(), QPtrListIterator< type >::current(), d, QDir::entryInfoList(), AppLnk::exec(), f, QFileInfo::fileName(), QDir::Files, i, QMap< Key, T >::insert(), QString::isEmpty(), AppLnk::isValid(), itemList, QString::length(), list, Resource::loadPixmap(), QString::mid(), AppLnk::name(), NEW_APPLICATION, NEW_FOLDER, NULL, odebug, oendl, AppLnk::pixmap(), TabAppLnk::pixmapString(), qApp, QPEApplication::qpeDir(), QMap< Key, T >::remove(), QDir::rename(), QString::right(), AppLnk::setComment(), AppLnk::setExec(), QDir::setFilter(), AppLnk::setIcon(), AppLnk::setName(), tr, and AppLnk::writeLink().

Referenced by editCurrentItem(), and TabManager().

bool TabManager::findInstalledApplication QString  desktopFile,
QString installedAppFile
[protected]
 

File the installed application that has this desktop file. Go through each file in HOME_APP_INSTALL_DIR and see if it contains desktop file

Parameters:
desktopFile - the .desktop file to search for [foo.desktop]
installedAppFile - location of the app install list
Returns:
true if successful, false if file not found.

Definition at line 443 of file tabmanager.cpp.

References QString::contains(), QPtrListIterator< type >::current(), d, QDir::entryInfoList(), QTextStream::eof(), QFileInfo::fileName(), QDir::Files, HOME_APP_INSTALL_DIR, IO_ReadOnly, list, odebug, oendl, QFile::open(), QTextStream::readLine(), QDir::setFilter(), QDir::setPath(), and stream.

Referenced by moveApplication().

void TabManager::moveApplication QListViewItem *  item,
QListViewItem *  newGroup
[private, slot]
 

Move an application from one directory to another. Move in the gui, move in the applnk file, move in the installer.

Parameters:
item the application to move newGroup the new parent of this application

Definition at line 383 of file tabmanager.cpp.

References app, changed, findInstalledApplication(), QString::findRev(), QMap< Key, T >::insert(), itemList, QString::length(), QString::mid(), newFolder(), odebug, oendl, QMap< Key, T >::remove(), QDir::rename(), AppLnk::setType(), swapInstalledLocation(), tr, and AppLnk::writeLink().

Referenced by TabManager().

void TabManager::newApplication  )  [slot]
 

Create a new blank application Make sure a tab is selected create physical file fill file with default information (entry, name, type).

Definition at line 149 of file tabmanager.cpp.

References APPLICATION_EXTENSION, changed, QString::findRev(), QMap< Key, T >::insert(), itemList, QString::length(), QString::mid(), NEW_APPLICATION, and TabManagerBase::tabList.

void TabManager::newFolder  )  [slot]
 

Create a new blank Tab. Create a physical folder with .directory file Create a item on the list

Definition at line 129 of file tabmanager.cpp.

References changed, HOME_APP_DIR, QMap< Key, T >::insert(), itemList, QDir::mkdir(), NEW_FOLDER, and TabManagerBase::tabList.

Referenced by moveApplication().

void TabManager::removeItem  )  [slot]
 

Remove the item. Check if we can Prompt user Delete physical file (Dir, remove .dir, then dir. File, remove file) Remove from installer if need too.

Definition at line 178 of file tabmanager.cpp.

References changed, itemList, NULL, odebug, oendl, QMap< Key, T >::remove(), QFile::remove(), QDir::rmdir(), TabManagerBase::tabList, tr, and warning().

void TabManager::rescanFolder QString  directory,
QListViewItem *  parent = NULL
[protected]
 

Scans root directory for any tabs or applications. Will recursivly go down, but will not follow symlinks.

Parameters:
directory - the directory to look in.
parent - the parent to place any new tabs or apps into. If parent is NULL then the item is a tab and should be placed as a child of the window.

Definition at line 67 of file tabmanager.cpp.

References app, APPLICATION_EXTENSION, APPLICATION_EXTENSION_LENGTH, QPtrListIterator< type >::current(), d, QDir::Dirs, QDir::entryInfoList(), QFileInfo::fileName(), QDir::Files, QDir::Hidden, HOME_APP_DIR, QMap< Key, T >::insert(), QFileInfo::isDir(), itemList, list, AppLnk::name(), AppLnk::pixmap(), QDir::setFilter(), QDir::setPath(), and TabManagerBase::tabList.

Referenced by TabManager().

void TabManager::swapInstalledLocation QString  installedAppFile,
QString  desktopFile,
QString  newLocation
[protected]
 

Open a file and replace a file containing the old desktop file with the new.

Parameters:
installedAppFile application installed list
desktopFile old .desktop file
newLocation new .desktop file

Definition at line 481 of file tabmanager.cpp.

References QString::contains(), QTextStream::eof(), IO_ReadOnly, IO_ReadWrite, odebug, oendl, QFile::open(), QTextStream::readLine(), and stream.

Referenced by moveApplication().


Member Data Documentation

AppEdit* TabManager::application [private]
 

Definition at line 36 of file tabmanager.h.

Referenced by editItem().

bool TabManager::changed
 

Definition at line 17 of file tabmanager.h.

Referenced by editItem(), moveApplication(), newApplication(), newFolder(), removeItem(), and ~TabManager().

QMap<QListViewItem *, QString> TabManager::itemList [protected]
 

Definition at line 31 of file tabmanager.h.

Referenced by editItem(), moveApplication(), newApplication(), newFolder(), removeItem(), and rescanFolder().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:53:07 2005 for OPIE by  doxygen 1.4.2