Kitlist  1.1.0
Namespaces | Typedefs | Functions | Variables
kitlistgui.cpp File Reference
#include "kitlistgui.hpp"
#include "printing.hpp"
#include "yamlconfig.hpp"
#include <cassert>
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/aboutdialog.h>
#include <gtkmm/cellrenderertoggle.h>
#include <gtkmm/clipboard.h>
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/menuitem.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/stock.h>
#include <gtkmm/targetentry.h>
#include <gtkmm/window.h>
#include <libglademm/xml.h>
#include <libxml++/libxml++.h>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys/stat.h>
#include <config.h>

Go to the source code of this file.

Namespaces

 anonymous_namespace{kitlistgui.cpp}
 

Typedefs

typedef Gtk::TreeModel::Children type_children
 

Functions

const bool file_exists (const Glib::ustring &filename)
 Returns true if the passed file exists. More...
 
const string load_resource_glade_file (const Glib::ustring &filename)
 Locate the Glade resource file from a list of potential locations. More...
 
Glib::RefPtr< Gnome::Glade::Xml > get_glade_ref_ptr (const string &filename, const Glib::ustring &root=Glib::ustring(), const Glib::ustring &domain=Glib::ustring())
 Returns a reference to the Glade resource file. More...
 

Variables

const string anonymous_namespace{kitlistgui.cpp}::GLADE_APP_FILE = "kitlist.glade"
 Resource file name. More...
 
const guint anonymous_namespace{kitlistgui.cpp}::SB_ITEM_COUNT = 1000
 Status bar message constant for displaying item counts. More...
 
const guint anonymous_namespace{kitlistgui.cpp}::SB_SAVE = SB_ITEM_COUNT + 1
 Status bar message constant for save notifications. More...
 
const guint anonymous_namespace{kitlistgui.cpp}::SB_MSG = SB_SAVE + 1
 Status bar message constant for general messages. More...
 
const guint anonymous_namespace{kitlistgui.cpp}::SB_PRINT = SB_MSG + 1
 Status bar message constant for printer messages. More...
 
const char anonymous_namespace{kitlistgui.cpp}::item_target_custom [] = "kitlistclipboard"
 Key used for custom clipboard. More...
 
const char anonymous_namespace{kitlistgui.cpp}::item_target_text [] = "text/plain"
 Mime type for clipboard content. More...
 
const char anonymous_namespace{kitlistgui.cpp}::XML_ELEMENT_ID [] = "id"
 Tag name for the ID element in the clipbard XML document. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::DEFAULT_FILENAME_EXTENSION = ".kit"
 Default filename extension. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::PDF_FILENAME_EXTENSION = ".pdf"
 PDF filename extension. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::DEFAULT_FILENAME = "kitlist" + DEFAULT_FILENAME_EXTENSION
 The default filename. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY = "/apps/kitlist"
 The application's root key in the GConf hierarchy. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_CURRENT_FILENAME = GCONF_KEY + "/current_filename"
 GConf entry for the current filename. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_PAGE_TITLE = GCONF_KEY + "/page_title"
 GConf entry for the page title. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_RECENT_FILES = GCONF_KEY + "/recent_files"
 GConf entry for recent files. More...
 
const Glib::ustring anonymous_namespace{kitlistgui.cpp}::GCONF_KEY_MAX_RECENT_FILES = GCONF_KEY + "/max_recent_files"
 GConf entry for max recent files. More...
 

Typedef Documentation

◆ type_children

typedef Gtk::TreeModel::Children type_children

Definition at line 124 of file kitlistgui.cpp.

Function Documentation

◆ file_exists()

const bool file_exists ( const Glib::ustring &  filename)

Returns true if the passed file exists.

Note: We do not test for the file type, just it's existence regardless of whether it's a directory etc.

Parameters
filenameThe file to test for existence.
Returns
true if the file exists.

Definition at line 135 of file kitlistgui.cpp.

Referenced by KitListGui::choose_filename(), KitListGui::choose_pdf_filename(), KitListGui::init(), and load_resource_glade_file().

◆ get_glade_ref_ptr()

Glib::RefPtr<Gnome::Glade::Xml> get_glade_ref_ptr ( const string &  filename,
const Glib::ustring &  root = Glib::ustring(),
const Glib::ustring &  domain = Glib::ustring() 
)

Returns a reference to the Glade resource file.

Attempts to locate the external Glade resource file from a number of common locations.

Definition at line 164 of file kitlistgui.cpp.

References load_resource_glade_file().

Referenced by KitListGui::init().

◆ load_resource_glade_file()

const string load_resource_glade_file ( const Glib::ustring &  filename)

Locate the Glade resource file from a list of potential locations.

Definition at line 145 of file kitlistgui.cpp.

References file_exists().

Referenced by get_glade_ref_ptr().


Copyright 2008-2021 Frank Dean