#include <mainwindow.h>
|
| MainWindow (const QStringList &fileNames, bool disableSettings=false) |
|
QtGui::Molecule * | molecule () |
|
void | writeSettings () |
|
void | readSettings () |
|
void | setTranslationList (const QStringList &list, const QStringList &codes) |
|
bool | handleCommand (const QString &command, const QVariantMap &options) |
|
|
void | closeEvent (QCloseEvent *event) |
|
void | dragEnterEvent (QDragEnterEvent *event) |
|
void | dropEvent (QDropEvent *event) |
|
- Author
- Marcus D. Hanwell
The MainWindow class for the Avogadro application. Takes care of initializing the application and overall layout.
◆ markMoleculeDirty
void markMoleculeDirty |
( |
| ) |
|
|
slot |
Update internal state to reflect that the molecule has been modified.
◆ markMoleculeClean
void markMoleculeClean |
( |
| ) |
|
|
slot |
Update internal state to reflect that the molecule is not modified.
◆ updateWindowTitle
void updateWindowTitle |
( |
| ) |
|
|
slot |
Update the main window title.
◆ openFile [1/2]
bool openFile |
( |
const QString & |
fileName, |
|
|
Io::FileFormat * |
reader = nullptr |
|
) |
| |
|
slot |
Use the FileFormat reader to load fileName. This method takes ownership of reader and will delete it before returning.
◆ exportFile [1/2]
bool exportFile |
( |
const QString & |
fileName, |
|
|
bool |
async = true |
|
) |
| |
|
slot |
Export a file, using the full selection of formats capable of writing. The format will be guessed based on the filename extension. If async is true (default), the file is saved asynchronously.
- Returns
- If async is true, this function returns true if a suitable writer was found (not if the write was successful). If async is false, the return value indicates whether or not the file was written successfully.
◆ exportString
std::string exportString |
( |
const std::string & |
format | ) |
|
|
slot |
Export a file, using the full selection of formats capable of writing. Will use format to determine the file format to use.
- Returns
- String-representation of the exported file, or an empty string if the export failed.
◆ addScript
bool addScript |
( |
const QString & |
fileName | ) |
|
|
slot |
Move fileName as a plugin script (i.e. put it in the correct dir)
◆ writeSettings()
Write out all application settings, normally done as part of the application close event.
◆ readSettings()
Read in all settings, and initialize our application based on the stored settings.
◆ setTranslationList()
void setTranslationList |
( |
const QStringList & |
list, |
|
|
const QStringList & |
codes |
|
) |
| |
Set the list of possible translations
◆ handleCommand()
bool handleCommand |
( |
const QString & |
command, |
|
|
const QVariantMap & |
options |
|
) |
| |
Handle script commands
- Parameters
-
command | The command to execute |
options | The options to the command |
- Returns
- True if the command was handled, false otherwise
◆ moleculeChanged
void moleculeChanged |
( |
QtGui::Molecule * |
molecue | ) |
|
|
signal |
Emitted when the active molecule in the application has changed.
◆ setLocale
void setLocale |
( |
const QString & |
locale | ) |
|
|
protectedslot |
◆ moleculeReady
void moleculeReady |
( |
int |
number | ) |
|
|
protectedslot |
Slot provided for extensions to indicate a molecule is ready to be read in. This slot will then pass a molecule to the extension for the data to be read in to.
◆ newMolecule
Create a new molecule and make it the active molecule.
◆ openFile [2/2]
Prompt for a file location, and attempt to open the specified file using our native readers.
◆ importFile
Import a file, using the full selection of formats capable of reading.
◆ openRecentFile
Open file in the recent files list.
◆ updateRecentFiles
void updateRecentFiles |
( |
| ) |
|
|
protectedslot |
Update the list of recent files.
◆ saveFile
bool saveFile |
( |
bool |
async = true | ) |
|
|
protectedslot |
Save the current molecule to its current fileName. If it is not a standard format, offer to export and warn about possible data loss. If async is true (default), the file is saved asynchronously.
- Returns
- If async is true, this function returns true if a suitable writer was found (not if the write was successful). If async is false, the return value indicates whether or not the file was written successfully.
◆ saveFileAs [1/2]
bool saveFileAs |
( |
bool |
async = true | ) |
|
|
protectedslot |
Prompt for a file location, and attempt to save the active molecule to the specified location. If async is true (default), the file is saved asynchronously.
- Returns
- If async is true, this function returns true if a suitable writer was found (not if the write was successful). If async is false, the return value indicates whether or not the file was written successfully.
◆ exportFile [2/2]
bool exportFile |
( |
bool |
async = true | ) |
|
|
protectedslot |
Export a file, using the full selection of formats capable of writing. If async is true (default), the file is saved asynchronously.
- Returns
- If async is true, this function returns true if a suitable writer was found (not if the write was successful). If async is false, the return value indicates whether or not the file was written successfully.
◆ saveFileAs [2/2]
bool saveFileAs |
( |
const QString & |
fileName, |
|
|
Io::FileFormat * |
writer, |
|
|
bool |
async = true |
|
) |
| |
|
protectedslot |
If specified, use the FileFormat writer to save the file. This method takes ownership of writer and will delete it before returning. If async is true (default), the file is saved asynchronously.
- Returns
- If async is true, this function returns true if the write begins successfully (not if the writer completes). If async is false, the return value indicates whether or not the file was written successfully.
◆ setActiveTool
void setActiveTool |
( |
QString |
toolName | ) |
|
|
protectedslot |
Set the active tool for the currently active widget by name.
- Parameters
-
toolName | Name of the tool to select. |
◆ setActiveDisplayTypes
void setActiveDisplayTypes |
( |
QStringList |
displayTypes | ) |
|
|
protectedslot |
Set the active display types, and cause the scene to be updated.
- Parameters
-