Remove dash plugin

This commit is contained in:
Jesse van den Kieboom 2013-03-01 12:58:21 +01:00
parent 0d9ed25643
commit 86b8dc043a
8 changed files with 0 additions and 832 deletions

View file

@ -1,53 +0,0 @@
INCLUDES = \
-I$(top_srcdir) \
-I$(srcdir) \
$(GITG_PLUGIN_CFLAGS) \
$(WARN_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
plugindir = $(GITG_PLUGIN_LIBDIR)
plugin_LTLIBRARIES = libdash.la
plugin_DATA = dash.plugin
AM_VALAFLAGS = $(GITG_PLUGIN_VALAFLAGS)
VALA_SOURCES = \
gitg-dash.vala \
gitg-dash-navigation.vala
libdash_la_LDFLAGS = $(GITG_PLUGIN_LIBTOOL_FLAGS)
libdash_la_LIBADD = $(GITG_PLUGIN_LIBS)
libdash_la_CFLAGS = -w
libdash_la_SOURCES = \
$(VALA_SOURCES) \
gitg-dash-resources.c
BUILT_SOURCES = \
gitg-dash-resources.c \
gitg-dash-resources.h
gitg-dash-resources.c: resources/resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/resources resources/resources.xml)
$(GLIB_COMPILE_RESOURCES) --generate-source \
--sourcedir $(srcdir)/resources \
--target "$@" "$<"
gitg-dash-resources.h: resources/resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/resources resources/resources.xml)
$(GLIB_COMPILE_RESOURCES) --generate-header \
--sourcedir $(srcdir)/resources \
--target "$@" "$<"
EXTRA_DIST = $(plugin_DATA) \
resources/resources.xml \
$(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/resources resources/resources.xml)
CLEANFILES = \
$(VALA_SOURCES:.vala=.c) \
$(BUILT_SOURCES) \
libdash_la_vala.stamp
install-data-hook:
rm -f $(GITG_PLUGIN_LIBDIR)/libdash.la
-include $(top_srcdir)/git.mk

View file

@ -1,11 +0,0 @@
[Plugin]
Loader=C
Module=dash
Name=Dash
Description=gitg Dash
Authors=Jesse van den Kieboom <jessevdk@gnome.org>
Copyright=Copyright © 2012 Jesse van den Kieboom
Website=
Hidden=1
Builtin=1
Version=1.0

View file

@ -1,115 +0,0 @@
/*
* This file is part of gitg
*
* Copyright (C) 2012 - Jesse van den Kieboom
*
* gitg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* gitg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with gitg. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GitgDash
{
private class Navigation : Object, GitgExt.Navigation
{
// Do this to pull in config.h before glib.h (for gettext...)
private const string version = Gitg.Config.VERSION;
public GitgExt.Application? application { owned get; construct set; }
public signal void show_open();
public signal void show_create();
public signal void show_recent(string uri);
public signal void activate_recent(string uri);
public Navigation(GitgExt.Application app)
{
Object(application: app);
}
public void populate(GitgExt.NavigationTreeModel model)
{
model.begin_header(_("Repository"), null)
.append_default(_("Open"), "document-open-symbolic", (c) => { show_open(); })
.append(_("Create"), "list-add-symbolic", (c) => { show_create(); })
.end_header();
model.begin_header(_("Recent"), null);
var manager = Gtk.RecentManager.get_default();
var list = new List<Gtk.RecentInfo>();
Gee.HashSet<string> uris = new Gee.HashSet<string>();
foreach (var item in manager.get_items())
{
if (!item.has_application("gitg") ||
!item.exists())
{
continue;
}
if (uris.add(item.get_uri()))
{
list.prepend(item);
}
}
list.sort((a, b) => {
if (a.get_visited() < b.get_visited())
{
return 1;
}
else if (a.get_visited() > b.get_visited())
{
return -1;
}
else
{
return 0;
}
});
foreach (var item in list)
{
string uri = item.get_uri();
model.append(item.get_display_name(),
null,
(c) => {
if (c == 1)
{
show_recent(uri);
}
else
{
activate_recent(uri);
}
});
}
model.end_header();
}
public GitgExt.NavigationSide navigation_side
{
get { return GitgExt.NavigationSide.LEFT; }
}
public bool available
{
get { return true; }
}
}
}
// ex: ts=4 noet

View file

@ -1,288 +0,0 @@
/*
* This file is part of gitg
*
* Copyright (C) 2012 - Jesse van den Kieboom
*
* gitg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* gitg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with gitg. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GitgDash
{
public class View : Object
{
// Do this to pull in config.h before glib.h (for gettext...)
private const string version = Gitg.Config.VERSION;
public GitgExt.Application? application { owned get; construct set; }
private Gtk.Notebook d_main;
private Gtk.Widget? d_open;
private int d_openidx;
private Gtk.Widget? d_create;
private int d_createidx;
private Gtk.Widget? d_recent;
private Gtk.Label? d_recent_path;
private Gtk.Label? d_recent_last_used;
private Gtk.Label? d_recent_current_branch;
private File? d_recent_current_file;
private int d_recentidx;
private HashTable<File, Gitg.Repository> d_repos;
private File? d_open_folder;
construct
{
d_main = new Gtk.Notebook();
d_main.set_show_tabs(false);
d_main.show();
d_repos = new HashTable<File, Gitg.Repository>(File.hash, File.equal);
}
public string id
{
owned get { return "/org/gnome/gitg/Views/Dash"; }
}
public bool is_available()
{
// The dash is always available
return true;
}
public string display_name
{
owned get { return _("Dashboard"); }
}
public string? icon
{
owned get
{
return "document-open-recent-symbolic";
}
}
public Gtk.Widget? widget
{
owned get
{
return d_main;
}
}
public GitgExt.Navigation? navigation
{
owned get
{
var ret = new Navigation(application);
ret.show_open.connect(show_open);
ret.show_create.connect(show_create);
ret.show_recent.connect(show_recent);
ret.activate_recent.connect(activate_recent);
return ret;
}
}
public bool is_default_for(GitgExt.ViewAction action)
{
return application.repository == null;
}
private void connect_chooser_folder(Gtk.FileChooser ch)
{
if (d_open_folder == null)
{
var path = Environment.get_home_dir();
d_open_folder = File.new_for_path(path);
}
ch.unmap.connect((w) => {
d_open_folder = ch.get_current_folder_file();
});
ch.map.connect((w) => {
if (d_open_folder != null)
{
try
{
ch.set_current_folder_file(d_open_folder);
} catch {};
}
});
}
public void show_open()
{
if (d_open == null)
{
var ret = GitgExt.UI.from_builder("dash/view-open.ui",
"view",
"file_chooser",
"button_open");
d_open = ret["view"] as Gtk.Widget;
var ch = ret["file_chooser"] as Gtk.FileChooser;
connect_chooser_folder(ch);
(ret["button_open"] as Gtk.Button).clicked.connect((b) => {
application.open(ch.get_current_folder_file());
});
d_openidx = d_main.append_page(d_open, null);
}
d_main.set_current_page(d_openidx);
}
public void show_create()
{
if (d_create == null)
{
var ret = GitgExt.UI.from_builder("dash/view-create.ui",
"view",
"file_chooser",
"button_create");
d_create = ret["view"] as Gtk.Widget;
var ch = ret["file_chooser"] as Gtk.FileChooser;
connect_chooser_folder(ch);
(ret["button_create"] as Gtk.Button).clicked.connect((b) => {
application.create(ch.get_current_folder_file());
});
d_createidx = d_main.append_page(d_create, null);
}
d_main.set_current_page(d_createidx);
}
public void show_recent(string uri)
{
var manager = Gtk.RecentManager.get_default();
Gtk.RecentInfo? info = null;
foreach (var item in manager.get_items())
{
if (item.get_uri() == uri &&
item.has_application("gitg") && item.exists())
{
info = item;
break;
}
}
if (info == null)
{
return;
}
File f = File.new_for_uri(info.get_uri());
Gitg.Repository? repo;
if (!d_repos.lookup_extended(f, null, out repo))
{
// Try to open the repo
try
{
repo = new Gitg.Repository(f, null);
d_repos.insert(f, repo);
}
catch
{
return;
}
}
if (repo == null)
{
return;
}
if (d_recent == null)
{
var ret = GitgExt.UI.from_builder("dash/view-recent.ui",
"view",
"label_path_i",
"label_last_used_i",
"label_current_branch_i",
"button_open");
d_recent = ret["view"] as Gtk.Widget;
d_recent_path = ret["label_path_i"] as Gtk.Label;
d_recent_last_used = ret["label_last_used_i"] as Gtk.Label;
d_recent_current_branch = ret["label_current_branch_i"] as Gtk.Label;
(ret["button_open"] as Gtk.Button).clicked.connect((b) => {
application.open(d_recent_current_file);
});
d_recentidx = d_main.append_page(d_recent, null);
}
d_recent_path.label = Filename.display_name(f.get_path());
d_recent_current_file = f;
var dt = new DateTime.from_unix_utc(info.get_visited());
d_recent_last_used.label = dt.format("%c");
d_recent_current_branch.label = _("(no branch)");
try
{
var r = repo.get_head();
if (r != null)
{
d_recent_current_branch.label = r.parsed_name.shortname;
}
}
catch {}
d_main.set_current_page(d_recentidx);
}
public void activate_recent(string uri)
{
File f = File.new_for_uri(uri);
application.open(f);
}
public bool is_enabled()
{
return true;
}
}
}
[ModuleInit]
public void peas_register_types(TypeModule module)
{
//Peas.ObjectModule mod = module as Peas.ObjectModule;
//mod.register_extension_type(typeof(GitgExt.View),
// typeof(GitgDash.View));
}
// ex: ts=4 noet

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/gitg/dash">
<file compressed="true" preprocess="xml-stripblanks">view-open.ui</file>
<file compressed="true" preprocess="xml-stripblanks">view-create.ui</file>
<file compressed="true" preprocess="xml-stripblanks">view-recent.ui</file>
</gresource>
</gresources>
<!-- ex: et ts=2 -->

View file

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.3 -->
<!-- interface-requires gitg 0.2 -->
<object class="GtkGrid" id="view">
<property name="visible">True</property>
<property name="row-spacing">6</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Create repository</property>
<property name="xalign">0</property>
<style>
<class name="title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_description">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Select a folder in which you want to create a new git repository.</property>
<property name="xalign">0</property>
<style>
<class name="description"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="file_chooser">
<property name="visible">True</property>
<property name="local-only">True</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<property name="action">select-folder</property>
<property name="create-folders">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="buttons">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="halign">end</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton" id="button_create">
<property name="visible">True</property>
<property name="label" translatable="yes">Create</property>
<property name="use-stock">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</interface>
<!-- ex:set ts=2 et: -->

View file

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.3 -->
<!-- interface-requires gitg 0.2 -->
<object class="GtkGrid" id="view">
<property name="visible">True</property>
<property name="row-spacing">6</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Open repository</property>
<property name="xalign">0</property>
<style>
<class name="title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_description">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Select a folder to open the corresponding git repository.</property>
<property name="xalign">0</property>
<style>
<class name="description"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="file_chooser">
<property name="visible">True</property>
<property name="local-only">True</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<property name="action">select-folder</property>
<property name="create-folders">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="buttons">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="halign">end</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton" id="button_open">
<property name="visible">True</property>
<property name="label">gtk-open</property>
<property name="use-stock">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</interface>
<!-- ex:set ts=2 et: -->

View file

@ -1,173 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.3 -->
<object class="GtkGrid" id="view">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Recent repository</property>
<style>
<class name="title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_description">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Open a recently used repository.</property>
<style>
<class name="description"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_path">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Path:</property>
<style>
<class name="grid_title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_path_i">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_last_used">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Last used:</property>
<style>
<class name="grid_title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_last_used_i">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_current_branch">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Current branch:</property>
<style>
<class name="grid_title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_current_branch_i">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="buttons">
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="halign">end</property>
<property name="valign">end</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton" id="button_open">
<property name="visible">True</property>
<property name="label">gtk-open</property>
<property name="use-stock">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
</object>
</interface>