Skip to content
☰
  • Home
  • Blog
    • Justicia para Pedro
    • Architecture
    • Español
    • Faith
    • Leadership
    • Microsoft
    • Music and Arts
    • Philosophy
    • Open Source
    • Poetry
    • Politics
    • Uncategorized
  • About Me
    • Skills & Experience
    • Open-source Projects
  • Contact Me
     .----.   @   @
   / .-"-.`.  \v/
   | | '\ \ \_/ )
 ,-\ `-.' /.'  /
'---`----'----'

Angel Hernandez

Angel Hernandez

  • Home
  • Blog
    • Justicia para Pedro
    • Architecture
    • Español
    • Faith
    • Leadership
    • Microsoft
    • Music and Arts
    • Philosophy
    • Open Source
    • Poetry
    • Politics
    • Uncategorized
  • About Me
    • Skills & Experience
    • Open-source Projects
  • Contact Me
 
nixMetaFS

Metadata File System for Linux is a project similar to MetaFS.

The concept is to provide users the ability to being able to capture information of their files from the shell of the operating system. In this particular case it’ll be an extra tab in Nautilus.
Metadata will be stored in a MySQL Database. This is currently work in progress.
Below code for Window controller.

#include "MainWindowController.h"

using namespace nixMetaFS::Core;

MainWindowController *MainWindowController::m_Self;
GtkApplication *MainWindowController::m_Application;

MainWindowController::MainWindowController() {
    m_Self = this;
    m_repository = std::unique_ptr<Repository>(new Repository);
}

MainWindowController::~MainWindowController() {

}

void MainWindowController::Initialize() {
    // This doesn't apply for this class
}

void MainWindowController::SetupUI(GtkBuilder *builder) {
    auto controlNames = {"frmMain-nixMetaFS", "txtDescription"};

    std::for_each(controlNames.begin(), controlNames.end(), [&](std::string controlName) {
        m_Controls.insert(std::pair<std::string, GtkWidget*>(controlName,
                          GTK_WIDGET (gtk_builder_get_object(builder, controlName.c_str()))));
    });
}

void MainWindowController::StartUp(GtkApplication &app, gpointer user_data) {
    m_Application = &app;

    try {
        auto builder = gtk_builder_new_from_resource(Main_Window_Resource_Name);
        m_Self->SetupUI(builder);
        g_object_unref(G_OBJECT (builder));
        auto frmMainWindow = m_Self->m_Controls.at("frmMain-nixMetaFS");
        gtk_application_add_window(&app, reinterpret_cast<GtkWindow *>(frmMainWindow));
        gtk_widget_show(frmMainWindow);
    } catch(std::exception& ex) {
        throw std::runtime_error("Unable to load UI. Please ensure resource file was linked to application.");
    }
 }

Share this:

  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on X (Opens in new window) X
  • Click to email a link to a friend (Opens in new window) Email
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • More
  • Click to share on Facebook (Opens in new window) Facebook

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


Filed under: Open-Source - @ August 4, 2020 9:48 pm

Tags: C++, CLION, CMAKE, FileSystem, Glade, GNOME, GTK, Linux, Metadata


 
 
 
Proudly powered by WordPress and RetroGeek-Theme