Advertisement
Guest User

Untitled

a guest
Aug 1st, 2021
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. #include "mainwindow.h"
  2. #include "../models/configuration.h"
  3.  
  4. using namespace NickvisionApplication::Views;
  5. using namespace NickvisionApplication::Models;
  6.  
  7. MainWindow::MainWindow() :  m_helpCheckForUpdates("Check for Updates"), m_helpGitHubRepo("GitHub Repo"), m_helpReportABug("Report a Bug"), m_helpBuyMeACoffee("Buy Me a Coffee"), m_helpChangelog("Changelog"), m_helpAbout("About")
  8. {
  9.     //==Settings==//
  10.     set_default_size(800, 600);
  11.     maximize();
  12.     //==HeaderBar==//
  13.     m_headerBar.set_title("Nickvision Application");
  14.     m_headerBar.set_subtitle("Subtitle here");
  15.     m_headerBar.set_show_close_button(true);
  16.     m_helpMenu.append(m_helpCheckForUpdates);
  17.     m_helpMenu.append(m_helpSeparator1);
  18.     m_helpMenu.append(m_helpGitHubRepo);
  19.     m_helpMenu.append(m_helpReportABug);
  20.     m_helpMenu.append(m_helpBuyMeACoffee);
  21.     m_helpMenu.append(m_helpSeparator2);
  22.     m_helpMenu.append(m_helpChangelog);
  23.     m_helpMenu.append(m_helpAbout);
  24.     m_btnHelpMenu.set_menu(m_helpMenu);
  25.     m_btnHelpMenu.set_image_from_icon_name("open-menu");
  26.     m_btnOpen.set_image_from_icon_name("document-new");
  27.     m_headerBar.pack_start(m_btnOpen);
  28.     m_headerBar.pack_end(m_btnHelpMenu);
  29.     //==Layout==//
  30.     set_titlebar(m_headerBar);
  31.     realize_if_needed();
  32.     //==Configuration==//
  33.     Configuration config = Configuration::load();
  34.     if(config.isFirstTimeOpen())
  35.     {
  36.  
  37.     }
  38. }
  39.  
  40. MainWindow::~MainWindow()
  41. {
  42.     Configuration config = Configuration::load();
  43.     config.save();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement