static ToolEntry *mk_htoolbar(kbool pub) { ToolEntry *te = (ToolEntry *) kmem_alloz(sizeof(ToolEntry)); te->create = htoolbar_create; te->destroy = htoolbar_destroy; te->type = 'L'; te->tool_tip = "Create vertical tool bar"; te->name = "VerticalToolBar"; if (pub) register_tool(te); return te; }
static ToolEntry *mk_button_play(kbool pub) { ToolEntry *te = (ToolEntry *) kmem_alloz(sizeof(ToolEntry)); te->create = button_play_create; te->destroy = button_play_destroy; te->type = 'T'; te->tool_tip = "Create play button"; te->name = "xbut"; if (pub) register_tool(te); return te; }
int main(int argc, char *argv[]) { // Create Application. QApplication app(argc, argv); if (!load_constants(app)) { app.exec(); return EXIT_FAILURE; } // Register QSettings information. app.setOrganizationName("qwinff"); if (Constants::getBool("Portable")) { // Portable App: Save settings in <exepath>/qwinff.ini. QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setPath(QSettings::IniFormat, QSettings::UserScope , app.applicationDirPath()); qDebug() << "Setting path: " + app.applicationDirPath(); } else { // Save settings in <home>/.qwinff/qwinff.ini QString settings_dir = QDir(QDir::homePath()).absoluteFilePath(".qwinff"); QDir().mkpath(settings_dir); QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settings_dir); qDebug() << "Setting path: " + settings_dir; } Paths::setAppPath(app.applicationDirPath()); // register external tools register_tool("ffmpeg"); register_tool("ffprobe"); register_tool("sox"); register_tool("ffplay"); register_tool("mplayer"); ExePath::loadSettings(); // Construct a string list containing all input filenames. QStringList inputFiles(app.arguments()); inputFiles.removeFirst(); // Exclude self executable name. // Setup translation QTranslator translator; QString translation_filename = find_translation_file(); if (!translation_filename.isEmpty()) { qDebug() << "Translation file: " << translation_filename; translator.load(translation_filename); app.installTranslator(&translator); } // Load translation for Qt library QTranslator translator_qt; translator_qt.load("qt_" + QLocale::system().name(), Paths::qtTranslationPath()); app.installTranslator(&translator_qt); // Setup notification Notification::init(); if (!Notification::setType(Notification::TYPE_LIBNOTIFY)) Notification::setType(Notification::TYPE_NOTIFYSEND); // Create main window. MainWindow window(0, inputFiles); window.show(); // Execute the main loop int status = app.exec(); // Tear down notification Notification::release(); #ifndef TOOLS_IN_DATA_PATH // Save path settings ExePath::saveSettings(); #endif return status; }