C# Class GnomeSubtitles.Ui.MainUi

Show file Open project: GNOME/gnome-subtitles Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes the open file.

Kill ( ) : void

Kills the window in the most quick and unfriendly way.

MainUi ( EventHandlers handlers, Glade &glade ) : GnomeSubtitles.Core
New ( ) : void

Creates a new subtitles document for the specified path.

If there's a document open with unsaved changes, a warning dialog is shown.

Open ( ) : void

Shows the open dialog and possibly opens a subtitle.

If there's a document currently open with unsaved changes, a warning dialog is shown before opening the new file.

Open ( string filename ) : void

Opens a subtitle.

If there's a document currently open with unsaved changes, a warning dialog is shown before opening the new file.

OpenVideo ( ) : void
Quit ( ) : void

Quits the application.

Save ( ) : bool

Executes a Save operation.

If the document hasn't been saved before, a SaveAs is executed.

SaveAs ( ) : bool

Executes a SaveAs operation.

After saving, the timing mode is set to the timing mode of the subtitle format using when saving.

Start ( ) : void

Starts the GUI

TranslationClose ( ) : void

Closes a translation.

If there's a translation open with unsaved changes, a warning dialog is shown.

TranslationNew ( ) : void

Starts a new translation.

If there's a translation open with unsaved changes, a warning dialog is shown.

TranslationOpen ( ) : void

Shows the open translation dialog and possibly opens a file.

If there's a translation currently open with unsaved changes, a warning dialog is shown before opening the new file.

TranslationReload ( ) : void

Reloads the current translation file.

If there's a translation currently open with unsaved changes, a warning dialog is shown before opening the new file.

TranslationSave ( ) : bool

Executes a Save operation regarding the translation.

If the translation hasn't been saved before, a TranslationSaveAs is executed.

TranslationSaveAs ( ) : bool

Executes a translation SaveAs operation.

Private Methods

Method Description
CodePageToEncoding ( int codePage ) : Encoding

Creates an Encoding from a code page.

ExistTextUnsavedChanges ( ) : bool

Whether there are unsaved normal changes.

ExistTranslationUnsavedChanges ( ) : bool

Whether there are unsaved translation changes.

GetFileOpenCodePageFromConfig ( ) : int
GetSubtitleFileArg ( string args ) : string
OnBaseDocumentLoaded ( Document document ) : void
OnBaseDocumentModificationStatusChanged ( bool modified ) : void
OnBaseDocumentUnloaded ( Document document ) : void
OnBaseInitFinished ( ) : void
Open ( string path, int codePage, Uri videoUri ) : void

Opens a subtitle file, given its filename, code page and video filename.

An error dialog is presented if an exception is caught during open.

OpenTranslation ( string path, int codePage ) : void

Opens a translation file, given its filename and code page.

An error dialog is presented if an exception is caught during open.

Save ( FileProperties fileProperties ) : void
SaveTranslation ( FileProperties fileProperties ) : void
ShowSaveAsDialog ( SubtitleFileSaveAsDialog dialog ) : FileProperties

Displays a SaveAs dialog and gets the chosen options as .

ToCloseAfterWarning ( ) : bool

Whether the program should be closed, after choosing the respective confirmation dialog.

ToCloseTranslationAfterWarning ( ) : bool

Whether a translation should be closed, after choosing the respective confirmation dialog.

ToCreateNewAfterWarning ( ) : bool

Whether a new document should be created, after choosing the respective confirmation dialog.

ToCreateNewTranslationAfterWarning ( ) : bool

Whether a new translation should be created, after choosing the respective confirmation dialog.

ToOpenAfterWarning ( ) : bool

Whether a document should be opened, after choosing the respective confirmation dialog.

ToOpenTranslationAfterWarning ( ) : bool

Whether a translation should be opened, after choosing the respective confirmation dialog.

UpdateTitleModificationStatus ( bool showFilename, bool modified ) : void

Method Details

Close() public method

Closes the open file.
public Close ( ) : void
return void

Kill() public method

Kills the window in the most quick and unfriendly way.
public Kill ( ) : void
return void

MainUi() public method

public MainUi ( EventHandlers handlers, Glade &glade ) : GnomeSubtitles.Core
handlers EventHandlers
glade Glade
return GnomeSubtitles.Core

New() public method

Creates a new subtitles document for the specified path.
If there's a document open with unsaved changes, a warning dialog is shown.
public New ( ) : void
return void

Open() public method

Shows the open dialog and possibly opens a subtitle.
If there's a document currently open with unsaved changes, a warning dialog is shown before opening the new file.
public Open ( ) : void
return void

Open() public method

Opens a subtitle.
If there's a document currently open with unsaved changes, a warning dialog is shown before opening the new file.
public Open ( string filename ) : void
filename string The path of the subtitles file to open.
return void

OpenVideo() public method

public OpenVideo ( ) : void
return void

Quit() public method

Quits the application.
public Quit ( ) : void
return void

Save() public method

Executes a Save operation.
If the document hasn't been saved before, a SaveAs is executed.
public Save ( ) : bool
return bool

SaveAs() public method

Executes a SaveAs operation.
After saving, the timing mode is set to the timing mode of the subtitle format using when saving.
public SaveAs ( ) : bool
return bool

Start() public method

Starts the GUI
public Start ( ) : void
return void

TranslationClose() public method

Closes a translation.
If there's a translation open with unsaved changes, a warning dialog is shown.
public TranslationClose ( ) : void
return void

TranslationNew() public method

Starts a new translation.
If there's a translation open with unsaved changes, a warning dialog is shown.
public TranslationNew ( ) : void
return void

TranslationOpen() public method

Shows the open translation dialog and possibly opens a file.
If there's a translation currently open with unsaved changes, a warning dialog is shown before opening the new file.
public TranslationOpen ( ) : void
return void

TranslationReload() public method

Reloads the current translation file.
If there's a translation currently open with unsaved changes, a warning dialog is shown before opening the new file.
public TranslationReload ( ) : void
return void

TranslationSave() public method

Executes a Save operation regarding the translation.
If the translation hasn't been saved before, a TranslationSaveAs is executed.
public TranslationSave ( ) : bool
return bool

TranslationSaveAs() public method

Executes a translation SaveAs operation.
public TranslationSaveAs ( ) : bool
return bool