C# Class subtitleMemorize.MainClass

Datei anzeigen Open project: ChangSpivey/SubtitleMemorize

Public Methods

Method Description
GetTextViewByLanguageType ( UtilsCommon languageType ) : Gtk.TextView
GlibUnhandledException ( GLib args ) : void
Main ( string args ) : void
MainClass ( ) : System
PreviewWindowSelectLines ( String conditionExpr, bool isIncrementalSearch, bool selectAction ) : void

Selects preview lines in Gtk.TreeView based on a condtion like "episode=3 and contains(sub1, 'Bye')".

Private Methods

Method Description
AddFilesToEntry ( String originalString, String filesToAdd, String errorMessagePrefix ) : String
ClearErrorMessages ( ) : void
CloseProgressWindow ( ) : void

Closes/Hides the progress window.

ComputationThread ( Settings settings ) : void
ComputationThreadSafe ( Settings settings ) : void
ConnectEventsMainWindow ( ) : void
ConnectEventsPreviewWindowOptions ( ) : void
ConnectEventsProgressWindow ( ) : void
ConnectEventsSubitleWindowOptions ( ) : void
GenerateCardInfo ( Settings settings, List episodeInfos, InfoProgress progressInfo ) : List

This reads all subtitles, matches them and saves them to the "m_cardInfos"

GenerateEpisodeInfos ( Settings settings ) : List
GetSelectedRows ( ) : List
GetTreeIterByIndex ( int index ) : Gtk.TreeIter

XXX: documentation missing

InitializeGtkObjects ( Gtk b ) : void
IsSettingsValid ( Settings settings ) : void

Validates all gui-fields in main window.

LoadSaveStateFromFile ( string filename ) : void
OpenFileChooser ( String title ) : String[]

Opens the file chooser to select multiple files.

OpenProgressWindow ( PendingOperation thisOperation ) : bool

Opens the progress window and sets the current pending operation.

OpenSubtitleWindow ( int subIndex ) : void
PopulatePreviewList ( ) : void
PreviewButtonClicked ( ) : void
PreviewWindowRegexReplace ( bool inSub1, bool inSub2, bool onlyInSelected, String pattern, String replaceTo ) : void

Replace text in sub1 and/or sub2 by using regexes.

ProgressHandler ( String name, double percentage ) : void
ReadAllSubtitleFiles ( Settings settings, PerSubtitleSettings thisSubtitleSettings, List episodeInfos, int subtileIndex, InfoProgress progressInfo ) : List>

Reads all subtitle files.

ReadGui ( Settings settings ) : void

Reads the GUI fields and saves them to settings.

ReadResourceString ( String resourceName ) : string
SaveStateToFile ( string filename ) : void
SelectCard ( ) : void

Finds first selected entry in preview list and then calls "SelectCard(int)" with this entry number in another thread.

SelectCard ( int selectedIndex ) : void

Update image and text view to match "selectedIndex". Can be in a different thread then Gtk-Thread. It will extract the image, so it can take 1-2 seconds.

SetErrorMessage ( string msg ) : void
SetMarkupOfLabelInInfo ( String markup ) : void
ShowAllSelectedCardInfos ( ) : void
TryParseInputFilesString ( String str, String errorMessagePrefix ) : void

Tries to parse and evaluate an attributed file path. If one of the files does not exist, an exception will be thrown.

UpdateGui ( Settings settings ) : void

Updates the GUI, so that all GUI fields are now set to the values found in "settings".

UpdatePreviewImage ( int selectedIndex, CardInfo cardInfo ) : void
UpdatePreviewListEntry ( int index, CardInfo cardInfo, Gtk.TreeIter treeIter = null, bool updateSelectedEntryTextView = false ) : void

XXX: documentation missing

UpdatePreviewListViewByChangeList ( List list, bool updateTextBuffer = true ) : void

This function sets all lines in the Gtk.TreeView to the values in m_cardInfos.

UpdatePreviewWidgetLabels ( ) : void

Changes names of Search&Replace Buttons to "Select", "Deselect", ... dependent on Shift and Ctrl.

on_imagemenuitem_open_activate ( object o, EventArgs args ) : void

Method Details

GetTextViewByLanguageType() public method

public GetTextViewByLanguageType ( UtilsCommon languageType ) : Gtk.TextView
languageType UtilsCommon
return Gtk.TextView

GlibUnhandledException() public method

public GlibUnhandledException ( GLib args ) : void
args GLib
return void

Main() public static method

public static Main ( string args ) : void
args string
return void

MainClass() public method

public MainClass ( ) : System
return System

PreviewWindowSelectLines() public method

Selects preview lines in Gtk.TreeView based on a condtion like "episode=3 and contains(sub1, 'Bye')".
public PreviewWindowSelectLines ( String conditionExpr, bool isIncrementalSearch, bool selectAction ) : void
conditionExpr String Condition expr.
isIncrementalSearch bool Only change selection state for lines with matching expressions.
selectAction bool true -> select matching lines, false -> deselect matching lines
return void