MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / main

Function main

src/main.cpp:75–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, int nCmdShow) {
74#else
75int main(int argc, char** argv) {
76#endif
77 int runState;
78 std::string homeDir;
79
80 #ifdef __APPLE__
81 fl_mac_set_about(&CsvApplication::aboutCB, NULL);
82 #endif
83
84 homeDir = Helper::getHomeDir();
85 app.setWorkDir( app.getPreference(&preferences, TCRUNCHER_PREF_WORKDIR, homeDir) );
86 app.setTheme( app.getPreference(&preferences, TCRUNCHER_PREF_THEME, "Bright") );
87 app.setFont( app.getPreference(&preferences, TCRUNCHER_PREF_GRID_TEXT_FONT, TCRUNCHER_FALLBACK_FONT) );
88
89 // Opens file dropped on the icon
90 fl_open_callback(CsvApplication::droppedFileCB);
91
92 #ifndef __APPLE__
93 //Fl::scheme("gleam");
94 #endif
95
96 // Open an initial window
97 app.createNewWindow();
98
99 // Onboarding
100 if( app.getPreference(&preferences, TCRUNCHER_PREF_SHOWED_ONBOARDING, "no") == "no" ) {
101 if( app.showOnboardingProcess() ) {
102 preferences.set(TCRUNCHER_PREF_SHOWED_ONBOARDING, "MY_VERSION");
103 }
104 }
105
106 // Check Update
107 if( app.getPreference(&preferences, TCRUNCHER_PREF_UPDATE_CHECK_ALLOWED, "no") == "yes" ) {
108 app.setUpdateCheck(true);
109 } else {
110 app.setUpdateCheck(false);
111 }
112 app.checkUpdate();
113
114 #ifdef _WIN64
115 // Set Theme needed on Windows
116 app.setTheme(app.getTheme());
117 #endif
118
119 #ifndef _WIN64
120 for( int i = 1; i < argc; ++i ) {
121 // open all files passed on the command line
122 CsvApplication::droppedFileCB(argv[i]);
123 }
124 #endif
125
126 // run
127 runState = Fl::run();
128
129 return runState;
130}
131
132

Callers

nothing calls this directly

Calls 10

setWorkDirMethod · 0.80
getPreferenceMethod · 0.80
setThemeMethod · 0.80
setFontMethod · 0.80
createNewWindowMethod · 0.80
showOnboardingProcessMethod · 0.80
setMethod · 0.80
setUpdateCheckMethod · 0.80
checkUpdateMethod · 0.80
getThemeMethod · 0.80

Tested by

no test coverage detected