kexi

KexiStartupHandler Class Reference

#include <KexiStartup.h>

Inheritance diagram for KexiStartupHandler:

KexiStartupData Kexi::ObjectStatus List of all members.

Detailed Description

Handles startup actions for Kexi application.

Definition at line 60 of file KexiStartup.h.


Public Types

 DontConvert = 1
 ThisIsAProjectFile = 2
 ThisIsAShortcutToAProjectFile = 4
 ThisIsAShortcutToAConnectionData = 8
enum  DetectDriverForFileOptions { DontConvert = 1, ThisIsAProjectFile = 2, ThisIsAShortcutToAProjectFile = 4, ThisIsAShortcutToAConnectionData = 8 }

Public Member Functions

 KexiStartupHandler ()
virtual ~KexiStartupHandler ()
virtual tristate init (int argc, char **argv)
KexiProjectDataselectProject (KexiDB::ConnectionData *cdata, bool &cancelled, QWidget *parent=0)

Static Public Member Functions

static tristate detectActionForFile (KexiStartupData::Import &detectedImportAction, QString &detectedDriverName, const QString &_suggestedDriverName, const QString &dbFileName, QWidget *parent=0, int options=0)

Protected Slots

void slotSaveShortcutFileChanges ()

Protected Member Functions

bool getAutoopenObjects (KCmdLineArgs *args, const QCString &action_name)

Protected Attributes

KexiStartupHandlerPrivate * d

Member Enumeration Documentation

Options for detectDriverForFile()

Enumerator:
DontConvert  skip asking for conversion (used e.g. when dropdb is called)
ThisIsAProjectFile  a hint, forces detection of the file as a project file
ThisIsAShortcutToAProjectFile  a hint, forces detection of the file as a shortcut to a project file
ThisIsAShortcutToAConnectionData  a hint, forces detection of the file as a shortcut to a connection data

Definition at line 83 of file KexiStartup.h.


Member Function Documentation

tristate KexiStartupHandler::detectActionForFile ( KexiStartupData::Import detectedImportAction,
QString &  detectedDriverName,
const QString &  _suggestedDriverName,
const QString &  dbFileName,
QWidget *  parent = 0,
int  options = 0 
) [static]

Used for opening existing file-based projects. Detects actions that should be performed for by looking at the file's mime type.

Returns:
true if actions should be performed or cancelled if action should be cancelled In this case there are two possibilities:
  • detectedImportAction == true means "import action" should be performed
  • nonempty detectedDriverName means "open action" should be performed.
detectedDriverName can contain following special strings:
  • "shortcut" if the file looks like a shortcut to a project/connection file
  • "connection" if the file looks like a connection data file.

parent is passed as a parent for potential error message boxes. driverName is a preferred driver name.

Todo:
rather check this using migration drivers' X-KexiSupportedMimeTypes [strlist] property

Todo:
if file is ro: change project mode (but do not care if we're jsut importing)

Definition at line 733 of file KexiStartup.cpp.

tristate KexiStartupHandler::init ( int  argc,
char **  argv 
) [virtual]

Definition at line 264 of file KexiStartup.cpp.

KexiProjectData * KexiStartupHandler::selectProject ( KexiDB::ConnectionData cdata,
bool &  cancelled,
QWidget *  parent = 0 
)

Allows user to select a project with KexiProjectSelectorDialog.

Returns:
selected project's data Returns NULL and sets cancelled to true if the dialog was cancelled. Returns NULL and sets cancelled to false if there was an error.

Definition at line 883 of file KexiStartup.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys