Search in sources :

Example 1 with StoryMakerDB

use of org.storymaker.app.db.StoryMakerDB in project storymaker by StoryMaker.

the class SceneEditorActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.exportProjectFiles:
            exportProjectFiles();
            return true;
        case R.id.itemInfo:
            Intent intent = new Intent(this, StoryInfoActivity.class);
            intent.putExtra("pid", mProject.getId());
            startActivity(intent);
            return true;
        case R.id.purgePublishTables:
            // NEW/CACHEWORD
            SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", CACHEWORD_TIMEOUT));
            mCacheWordHandler = new CacheWordHandler(getBaseContext(), this, timeout);
            mCacheWordHandler.connectToService();
            SQLiteDatabase db = new StoryMakerDB(mCacheWordHandler, getBaseContext()).getWritableDatabase();
            JobTable foo;
            (new PublishJobTable(db)).debugPurgeTable();
            (new JobTable(db)).debugPurgeTable();
            db.close();
            return true;
    }
    return super.onOptionsItemSelected(item);
}
Also used : PublishJobTable(org.storymaker.app.model.PublishJobTable) JobTable(org.storymaker.app.model.JobTable) PublishJobTable(org.storymaker.app.model.PublishJobTable) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) CacheWordHandler(info.guardianproject.cacheword.CacheWordHandler) Intent(android.content.Intent) StoryMakerDB(org.storymaker.app.db.StoryMakerDB)

Aggregations

Intent (android.content.Intent)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 CacheWordHandler (info.guardianproject.cacheword.CacheWordHandler)1 StoryMakerDB (org.storymaker.app.db.StoryMakerDB)1 JobTable (org.storymaker.app.model.JobTable)1 PublishJobTable (org.storymaker.app.model.PublishJobTable)1