|
|
The base class for Kmp3db application windows. It sets up the main window and reads the config file as well as providing a menubar, toolbar and statusbar. An instance of Kmp3dbView creates your center view, which is connected to the window's Doc object. Kmp3dbApp reimplements the methods that KMainWindow provides for main window handling and supports full session management as well as using KActions.
See also: KMainWindow, KApplication, KConfig
Kmp3dbApp (QWidget* parent=0, const char* name=0) |
construtor of Kmp3dbApp, calls all init functions to create the application.
void openDocumentFile (const KURL& url=0) |
opens a file specified by commandline option
Kmp3dbDoc * getDocument () |
returns a pointer to the current document connected to the KTMainWindow instance and is used by the View class to access the document object's methods
void saveOptions () |
save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration file
void readOptions () |
read general Options again and initialize all variables like the recent file list
void initActions () |
initializes the KActions of the application
void initStatusBar () |
sets up the statusbar for the main window by initialzing a statuslabel.
void initDocument () |
initializes the document object of the main window that is connected to the view in initView().
See also: initView();
void initView () |
creates the centerwidget of the KTMainWindow instance and sets it as the view
bool queryClose () |
queryClose is called by KTMainWindow on each closeEvent of a window. Against the default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall be saved if Modified; on cancel the closeEvent is rejected.
See also: KTMainWindow#queryClose, KTMainWindow#closeEvent
bool queryExit () |
queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent(). Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's properties.
See also: KTMainWindow#queryExit, KTMainWindow#closeEvent
void saveProperties (KConfig *_cfg) |
saves the window properties for each open window during session end to the session config file, including saving the currently opened file by a temporary filename provided by KApplication.
See also: KTMainWindow#saveProperties
void readProperties (KConfig *_cfg) |
reads the session config file and restores the application's state including the last opened files and documents by reading the temporary files saved by saveProperties()
See also: KTMainWindow#readProperties
void slotFileNewWindow () |
open a new application window by creating a new instance of Kmp3dbApp
void slotFileNew () |
clears the document in the actual view to reuse it as the new document
void slotFileOpen () |
open a file and load it into the document
void slotFileOpenRecent (const KURL& url) |
opens a file from the recent files menu
void slotFileSave () |
save a document
void slotFileSaveAs () |
save a document by a new filename
void slotFileClose () |
asks for saving if the file is modified, then closes the actual file and window
void slotFilePrint () |
print the actual file
void slotFileQuit () |
closes all open windows by calling close() on each memberList item until the list is empty, then quits the application. If queryClose() returns false because the user canceled the saveModified() dialog, the closing breaks.
void slotEditCut () |
put the marked text/object into the clipboard and remove it from the document
void slotEditCopy () |
put the marked text/object into the clipboard
void slotEditPaste () |
paste the clipboard into the document
void slotViewToolBar () |
toggles the toolbar
void slotViewStatusBar () |
toggles the statusbar
void slotStatusMsg (const QString &text) |
changes the statusbar contents for the standard label permanently, used to indicate current actions.
Parameters:
text | the text that is displayed in the statusbar |
KConfig * config |
the configuration object of the application
Kmp3dbView * view |
view is the main widget which represents your working area. The View class should handle all events of the view widget. It is kept empty so you can create your view according to your application's needs by changing the view class.
Kmp3dbDoc * doc |
doc represents your actual document and is created only once. It keeps information such as filename and does the serialization of your files.