/** @file
* @brief New From Template abstract tab implementation
*/
/* Authors:
* Jan Darowski <jan.darowski@gmail.com>, supervised by Krzysztof KosiĆski
*
* Copyright (C) 2013 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "template-widget.h"
#include "template-load-tab.h"
#include "new-from-template.h"
#include <gtkmm/messagedialog.h>
#include <gtkmm/scrolledwindow.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <glibmm/stringutils.h>
#include <iostream>
#include <list>
#include "inkscape.h"
#include "ui/interface.h"
#include "file.h"
#include "path-prefix.h"
#include "preferences.h"
#include "xml/document.h"
namespace Inkscape {
namespace UI {
: _current_keyword("")
, _keywords_combo(true)
{
set_border_width(10);
this->show_all();
_loading_path = "";
_initLists();
}
{
}
{
_info_widget->create();
}
{
}
{
if (templateSelectionRef->get_selected()) {
}
}
{
}
}
{
_tlist_view.set_headers_visible(false);
}
{
if (_current_keyword == ""){
}
else
}
{
_tlist_store->clear();
switch (_current_search_type){
case ALL :{
for (std::map<Glib::ustring, TemplateData>::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) {
}
break;
}
case LIST_KEYWORD: {
for (std::map<Glib::ustring, TemplateData>::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) {
}
}
break;
}
case USER_SPECIFIED : {
for (std::map<Glib::ustring, TemplateData>::iterator it = _tdata.begin() ; it != _tdata.end() ; ++it) {
it->second.short_description.lowercase().find(_current_keyword.lowercase()) != Glib::ustring::npos ||
{
}
}
break;
}
}
// reselect item
for (Gtk::TreeModel::Children::iterator it = _tlist_store->children().begin(); it != _tlist_store->children().end(); ++it) {
break;
}
}
}
if (item_to_select) {
delete item_to_select;
} else {
_current_template = "";
_info_widget->clear();
_parent_widget->setCreateButtonSensitive(false);
}
}
{
// user's local dir
// system templates dir
// procedural templates
}
{
result.is_procedural = false;
// convert path into valid template name
gsize n = 0;
}
if (rdoc){
return result;
}
return result;
}
return result;
}
{
return;
if (Glib::str_has_suffix(file, ".svg") && !Glib::str_has_prefix(Glib::path_get_basename(file), "default.")){
}
}
}
{
if (myRoot){
result.is_procedural = true;
}
++it;
}
}
{
while (!tplKeywords.empty()){
break;
}
}
}
}
}