kexi

#include <KexiStartup.h>

Inheritance diagram for KexiStartupHandler:
KexiStartupData Kexi::ObjectStatus

Public Types

enum  DetectDriverForFileOptions {
  DontConvert = 1 , ThisIsAProjectFile = 2 , ThisIsAShortcutToAProjectFile = 4 , ThisIsAShortcutToAConnectionData = 8 ,
  SkipMessages = 16
}
 
- Public Types inherited from KexiStartupData
enum  Action {
  DoNothing , CreateBlankProject , CreateFromTemplate , OpenProject ,
  ImportProject , Exit
}
 

Public Member Functions

virtual tristate init (int argc, char **argv)
 
KexiProjectData * selectProject (KexiDB::ConnectionData *cdata, bool &cancelled, TQWidget *parent=0)
 
- Public Member Functions inherited from KexiStartupData
virtual bool init ()
 
Action action () const
 
KexiProjectData * projectData () const
 
KexiStartupData::Import importActionData () const
 
bool forcedDesignMode () const
 
bool forcedUserMode () const
 
bool isProjectNavigatorVisible () const
 
- Public Member Functions inherited from Kexi::ObjectStatus
 ObjectStatus (const TQString &message, const TQString &description)
 
 ObjectStatus (KexiDB::Object *dbObject, const TQString &message, const TQString &description)
 
const ObjectStatus & status () const
 
bool error () const
 
void setStatus (const TQString &message, const TQString &description)
 
void setStatus (KexiDB::Object *dbObject, const TQString &message=TQString(), const TQString &description=TQString())
 
void setStatus (KexiDB::ResultInfo *result, const TQString &message=TQString(), const TQString &description=TQString())
 
void setStatus (KexiDB::Object *dbObject, KexiDB::ResultInfo *result, const TQString &message=TQString(), const TQString &description=TQString())
 
void clearStatus ()
 
TQString singleStatusString () const
 
void append (const ObjectStatus &otherStatus)
 
KexiDB::Object * dbObject () const
 
 operator KexiDB::MessageHandler * ()
 

Static Public Member Functions

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

Protected Slots

void slotSaveShortcutFileChanges ()
 

Protected Member Functions

bool getAutoopenObjects (TDECmdLineArgs *args, const TQCString &action_name)
 

Protected Attributes

KexiStartupHandlerPrivate * d
 
- Protected Attributes inherited from KexiStartupData
KexiProjectData * m_projectData
 
Action m_action
 
KexiStartupData::Import m_importActionData
 
bool m_forcedUserMode: 1
 
bool m_forcedDesignMode: 1
 
bool m_isProjectNavigatorVisible: 1
 
bool m_createDB: 1
 
bool m_dropDB: 1
 
bool m_alsoOpenDB: 1
 
- Protected Attributes inherited from Kexi::ObjectStatus
TQGuardedPtr< TQObject > dbObj
 
KexiDB::MessageHandler * msgHandler
 

Additional Inherited Members

- Public Attributes inherited from Kexi::ObjectStatus
TQString message
 
TQString description
 

Detailed Description

Handles startup actions for Kexi application.

Definition at line 61 of file KexiStartup.h.

Member Enumeration Documentation

◆ DetectDriverForFileOptions

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

SkipMessages 

do not display error or warning messages

Definition at line 85 of file KexiStartup.h.

Constructor & Destructor Documentation

◆ KexiStartupHandler()

KexiStartupHandler::KexiStartupHandler ( )

Definition at line 197 of file KexiStartup.cpp.

◆ ~KexiStartupHandler()

KexiStartupHandler::~KexiStartupHandler ( )
virtual

Definition at line 204 of file KexiStartup.cpp.

Member Function Documentation

◆ detectActionForFile()

tristate KexiStartupHandler::detectActionForFile ( KexiStartupData::Import &  detectedImportAction,
TQString &  detectedDriverName,
const TQString &  _suggestedDriverName,
const TQString &  dbFileName,
TQWidget *  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. options should be a combination of DetectDriverForFileOptions enum values.

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 740 of file KexiStartup.cpp.

◆ getAutoopenObjects()

bool KexiStartupHandler::getAutoopenObjects ( TDECmdLineArgs *  args,
const TQCString &  action_name 
)
protected

Definition at line 209 of file KexiStartup.cpp.

◆ init()

tristate KexiStartupHandler::init ( int  argc,
char **  argv 
)
virtual
Todo:
Show error message from KexiDBConnShortcutFile when there's one implemented. For we're displaying generic error msg.
Todo:

Definition at line 267 of file KexiStartup.cpp.

◆ selectProject()

KexiProjectData * KexiStartupHandler::selectProject ( KexiDB::ConnectionData *  cdata,
bool &  cancelled,
TQWidget *  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 895 of file KexiStartup.cpp.

◆ slotSaveShortcutFileChanges

void KexiStartupHandler::slotSaveShortcutFileChanges ( )
protectedslot

Definition at line 940 of file KexiStartup.cpp.

Member Data Documentation

◆ d

KexiStartupHandlerPrivate* KexiStartupHandler::d
protected

Definition at line 128 of file KexiStartup.h.


The documentation for this class was generated from the following files: