[Goodies-commits] r6536 - in ristretto/branches/ristretto-gio: . docs docs/manual docs/manual/C docs/manual/C/images src
Stephan Arts
stephan at xfce.org
Sat Jan 24 11:55:30 CET 2009
Author: stephan
Date: 2009-01-24 10:55:30 +0000 (Sat, 24 Jan 2009)
New Revision: 6536
Added:
ristretto/branches/ristretto-gio/docs/
ristretto/branches/ristretto-gio/docs/Makefile.am
ristretto/branches/ristretto-gio/docs/manual/
ristretto/branches/ristretto-gio/docs/manual/C/
ristretto/branches/ristretto-gio/docs/manual/C/Makefile.am
ristretto/branches/ristretto-gio/docs/manual/C/images/
ristretto/branches/ristretto-gio/docs/manual/C/images/Makefile.am
ristretto/branches/ristretto-gio/docs/manual/C/ristretto.xml.in
ristretto/branches/ristretto-gio/docs/manual/Makefile.am
ristretto/branches/ristretto-gio/docs/manual/ristretto.css
ristretto/branches/ristretto-gio/docs/manual/ristretto.xsl
Modified:
ristretto/branches/ristretto-gio/Makefile.am
ristretto/branches/ristretto-gio/configure.in.in
ristretto/branches/ristretto-gio/src/main_window.c
ristretto/branches/ristretto-gio/src/main_window_ui.xml
Log:
Add template for ristretto manual
Modified: ristretto/branches/ristretto-gio/Makefile.am
===================================================================
--- ristretto/branches/ristretto-gio/Makefile.am 2009-01-24 08:57:28 UTC (rev 6535)
+++ ristretto/branches/ristretto-gio/Makefile.am 2009-01-24 10:55:30 UTC (rev 6536)
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = src po icons
+SUBDIRS = src po icons docs
desktopdir = $(datadir)/applications
desktop_in_files = ristretto.desktop.in
@@ -21,3 +21,5 @@
intltool-merge \
intltool-update \
$(desktop_DATA)
+
+DISTCHECK_CONFIGURE_FLAGS=--enable-xsltproc
Modified: ristretto/branches/ristretto-gio/configure.in.in
===================================================================
--- ristretto/branches/ristretto-gio/configure.in.in 2009-01-24 08:57:28 UTC (rev 6535)
+++ ristretto/branches/ristretto-gio/configure.in.in 2009-01-24 10:55:30 UTC (rev 6536)
@@ -1,4 +1,4 @@
-;nl
+dnl
dnl Copyright (c) 2006-2009
dnl The Xfce development team. All rights reserved.
dnl
@@ -45,6 +45,7 @@
AC_PROG_CC
AC_PROG_INTLTOOL([0.31], [no-xml])
+
AC_HEADER_STDC
dnl Check for i18n support
@@ -62,7 +63,20 @@
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.5.93])
+dnl **************************
+dnl *** Check for xsltproc ***
+dnl **************************
+AC_ARG_ENABLE([xsltproc], [AC_HELP_STRING([--enable-xsltproc], [Use xsltproc to build documentation @<:@default=no@:>@])],, [enable_xsltproc=no])
+if test x"$enable_xsltproc" = x"yes"; then
+ AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
+ if test x"$XSLTPROC" = x"no"; then
+ enable_xsltproc=no
+ fi
+fi
+AM_CONDITIONAL([ENABLE_XSLTPROC], [test x"$enable_xsltproc" = x"yes"])
+
+
dnl check for debugging support
XDT_FEATURE_DEBUG
@@ -70,6 +84,11 @@
Makefile
po/Makefile.in
src/Makefile
+docs/Makefile
+docs/manual/Makefile
+docs/manual/C/Makefile
+docs/manual/C/ristretto.xml
+docs/manual/C/images/Makefile
icons/Makefile
icons/16x16/Makefile
icons/22x22/Makefile
Added: ristretto/branches/ristretto-gio/docs/Makefile.am
===================================================================
--- ristretto/branches/ristretto-gio/docs/Makefile.am (rev 0)
+++ ristretto/branches/ristretto-gio/docs/Makefile.am 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1 @@
+SUBDIRS = manual
Added: ristretto/branches/ristretto-gio/docs/manual/C/Makefile.am
===================================================================
--- ristretto/branches/ristretto-gio/docs/manual/C/Makefile.am (rev 0)
+++ ristretto/branches/ristretto-gio/docs/manual/C/Makefile.am 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1,66 @@
+# Copied from Thunar, original author: Benedict Meurer
+
+SUBDIRS = \
+ images
+
+TARGET_DIR = $(datadir)/doc/ristretto/html/C
+STYLESHEET = ../ristretto.xsl
+DOCUMENT = ristretto.xml
+
+# We set GPATH here; this gives us semantics for GNU make
+# which are more like other make's VPATH, when it comes to
+# whether a source that is a target of one rule is then
+# searched for in VPATH/GPATH.
+GPATH = $(srcdir)
+
+DOC_STAMPS = html-build.stamp
+
+EXTRA_DIST = $(DOCUMENT)
+CLEANFILES = $(DOC_STAMPS)
+
+if ENABLE_XSLTPROC
+all-local: html-build.stamp
+
+html-build.stamp: $(srcdir)/$(DOCUMENT) $(srcdir)/$(STYLESHEET)
+ @echo "*** Building HTML ***"
+ @-chmod -R u+w $(srcdir)
+ rm -rf $(srcdir)/html
+ mkdir $(srcdir)/html
+ $(XSLTPROC) --nonet -o $(srcdir)/html/ $(srcdir)/$(STYLESHEET) \
+ $(srcdir)/$(DOCUMENT)
+ touch html-build.stamp
+else
+all-local:
+endif
+
+maintainer-clean-local: clean
+ (cd $(srcdir) && rm -rf html)
+
+install-data-local:
+ installfiles=`echo $(srcdir)/html/*`; \
+ if test "$$installfiles" = '$(srcdir)/html/*'; then \
+ echo "--- Nothing to install"; \
+ else \
+ $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
+ for file in $$installfiles; do \
+ echo "--- Installing "$$file; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(TARGET_DIR); \
+ done; \
+ fi
+
+uninstall-local:
+ rm -rf $(DESTDIR)$(TARGET_DIR)/*
+
+if ENABLE_XSLTPROC
+dist-check-xsltproc: all
+else
+dist-check-xsltproc:
+ @echo "*** xsltproc must be installed and enabled in order to make dist"
+ @false
+endif
+
+dist-hook: dist-check-xsltproc dist-hook-local
+ mkdir $(distdir)/html
+ -cp $(srcdir)/html/* $(distdir)/html
+
+.PHONY: dist-hook-local
Added: ristretto/branches/ristretto-gio/docs/manual/C/images/Makefile.am
===================================================================
--- ristretto/branches/ristretto-gio/docs/manual/C/images/Makefile.am (rev 0)
+++ ristretto/branches/ristretto-gio/docs/manual/C/images/Makefile.am 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1,7 @@
+
+imagesdir = $(datadir)/doc/ristretto/html/C/images
+images_DATA =
+
+EXTRA_DIST = \
+ $(images_DATA)
+
Added: ristretto/branches/ristretto-gio/docs/manual/C/ristretto.xml.in
===================================================================
--- ristretto/branches/ristretto-gio/docs/manual/C/ristretto.xml.in (rev 0)
+++ ristretto/branches/ristretto-gio/docs/manual/C/ristretto.xml.in 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+ <!ENTITY date "Januari 2009">
+ <!ENTITY version "@PACKAGE_VERSION@">
+ <!ENTITY application "@PACKAGE_NAME@">
+]>
+<article id="index" lang="en">
+
+ <!-- Header -->
+ <articleinfo>
+ <title>Ristretto Image Viewer</title>
+
+ <pubdate>&date;</pubdate>
+
+ <copyright>
+ <year>2006</year>
+ <year>2007</year>
+ <year>2008</year>
+ <year>2008</year>
+ <holder>Stephan Arts</holder>
+ </copyright>
+
+ <legalnotice id="legalnotice">
+ <para>
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1 or
+ any later version published by the Free Software Foundation; with no
+ Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+ Texts. The complete license text is available from the <ulink
+ type="http" url="http://www.gnu.org/">Free Software Foundation</ulink>.
+ </para>
+ </legalnotice>
+
+ <authorgroup>
+ <author>
+ <firstname>Stephan</firstname>
+ <surname>Arts</surname>
+ <affiliation>
+ <address><email>stephan at xfce.org</email></address>
+ <!--
+ <orgname>os-cillation</orgname>
+ <orgdiv>System development</orgdiv>
+ <jobtitle>Software developer</jobtitle>
+ -->
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <releaseinfo>
+ This manual describes version &version; of &application;.
+ </releaseinfo>
+ </articleinfo>
+
+ <sect1 id="intro">
+ <title>Introduction to &application;</title>
+
+ <para>
+ </para>
+
+ </sect1>
+
+</article>
+<!--
+ vim:set ts=2 sw=2 et ai encoding=UTF-8:
+-->
Added: ristretto/branches/ristretto-gio/docs/manual/Makefile.am
===================================================================
--- ristretto/branches/ristretto-gio/docs/manual/Makefile.am (rev 0)
+++ ristretto/branches/ristretto-gio/docs/manual/Makefile.am 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1,2 @@
+SUBDIRS = \
+ C
Added: ristretto/branches/ristretto-gio/docs/manual/ristretto.css
===================================================================
--- ristretto/branches/ristretto-gio/docs/manual/ristretto.css (rev 0)
+++ ristretto/branches/ristretto-gio/docs/manual/ristretto.css 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1,101 @@
+/* Copied from Thunar written by Benedict Meurer */
+
+body address
+{
+ line-height: 1.3;
+ margin: .6em 0;
+}
+
+body blockquote
+{
+ margin-top: .75em;
+ line-height: 1.5;
+ margin-bottom: .75em;
+}
+
+html body
+{
+ margin: 1em 8% 1em 10%;
+ line-height: 1.2;
+ background-color: #ffffff;
+}
+
+body pre
+{
+ margin: .75em 0;
+ line-height: 1.3;
+ color: #4f3f3f;
+ font-weight: bold;
+}
+
+body div
+{
+ margin: 0;
+}
+
+dl
+{
+ margin: .8em 0;
+ line-height: 1.2;
+}
+
+.legalnotice
+{
+ font-size: small;
+ font-variant: small-caps;
+}
+
+h1,h2,h3,h4,h5,h6,
+div.example p b,
+.question,
+div.table p b,
+div.procedure p b
+{
+ color: #990000;
+}
+
+.option
+{
+ color: #0000ca;
+ font-weight: bold;
+}
+
+.parameter
+{
+ color: #007a00;
+ font-weight: bold;
+}
+
+a
+{
+ color: #000000;
+}
+
+a:hover
+{
+ color: #3c3c3c;
+ border-bottom: 1px dotted #dc0000;
+}
+
+hr
+{
+ background-color: #9c9c9c;
+ border-style: none;
+ height: 1px;
+}
+
+ul li
+{
+ list-style-type: square;
+}
+
+.programlisting, .screen
+{
+ background-color: #F8F9FD;
+ border-color: #907777;
+ border-width: 1px;
+ border-style: solid;
+ padding: 0.5em;
+}
+
+/* vim:set ts=2 sw=2 et ai: */
Added: ristretto/branches/ristretto-gio/docs/manual/ristretto.xsl
===================================================================
--- ristretto/branches/ristretto-gio/docs/manual/ristretto.xsl (rev 0)
+++ ristretto/branches/ristretto-gio/docs/manual/ristretto.xsl 2009-01-24 10:55:30 UTC (rev 6536)
@@ -0,0 +1,255 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'
+ xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ exclude-result-prefixes="#default">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
+
+<!-- XSL copied from Thunar written by Bennedict Meurer-->
+<!-- Use stylesheet -->
+<xsl:param name="html.stylesheet" select="'../ristretto.css'"/>
+
+<!-- labels and numbering -->
+<xsl:param name="autotoc.label.separator" select="'. '"/>
+<xsl:param name="chapter.autolabel" select="1"/>
+
+<!-- Don't force the use of index.html as root filename -->
+<xsl:param name="root.filename" select="''"/>
+
+<!-- Use element id (if present) as file name -->
+<xsl:variable name="use.id.as.filename">1</xsl:variable>
+
+<xsl:template match="releaseinfo" mode="titlepage.mode">
+ <span class="{name(.)}">
+ <br/>
+ <xsl:apply-templates mode="titlepage.mode"/>
+ <br/>
+ </span>
+</xsl:template>
+
+<!-- Use graphics in admonitions (note, warning, etc) -->
+<xsl:variable name="admon.graphics">0</xsl:variable>
+
+<xsl:param name="admon.style">
+ <xsl:text>text-align: left;</xsl:text></xsl:param>
+
+<xsl:variable name="admon.graphics.path">stylesheet-images/</xsl:variable>
+
+<xsl:variable name="admon.graphics.extension">.gif</xsl:variable>
+
+<xsl:param name="table.border.thickness" select="'0.2pt'"/>
+
+<xsl:param name="graphic.default.extension" select="png"/>
+
+<!-- This requires an adapted template for tgroup (see end of stylesheet) -->
+<xsl:attribute-set name="table.style">
+ <xsl:attribute name="bgcolor">#fdf9f8</xsl:attribute>
+ <xsl:attribute name="cellspacing">0</xsl:attribute>
+ <xsl:attribute name="cellpadding">4</xsl:attribute>
+</xsl:attribute-set>
+
+
+<xsl:param name="generate.legalnotice.link" select="0"/>
+
+<!-- set font styles for various tags -->
+<xsl:template match="guibutton">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="guiicon">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="guilabel">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="guimenu">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="guimenuitem">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="guisubmenu">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="application">
+<xsl:call-template name="inline.boldmonoseq"/>
+</xsl:template>
+
+<xsl:template match="caption">
+<xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<!-- Adapted template for tgroup. The only change is the addition of -->
+<!-- table.style attributes -->
+<xsl:template match="tgroup">
+ <table xsl:use-attribute-sets="table.style">
+ <xsl:choose>
+ <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for
+ the HTML table summary attribute -->
+ <xsl:when test="processing-instruction('dbhtml')">
+ <xsl:variable name="summary">
+ <xsl:call-template name="dbhtml-attribute">
+ <xsl:with-param name="pis"
+ select="processing-instruction('dbhtml')[1]"/>
+ <xsl:with-param name="attribute" select="'table-summary'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$summary != ''">
+ <xsl:attribute name="summary">
+ <xsl:value-of select="$summary"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <!-- Otherwise, if there's a title, use that -->
+ <xsl:when test="../title">
+ <xsl:attribute name="summary">
+ <xsl:value-of select="string(../title)"/>
+ </xsl:attribute>
+ </xsl:when>
+ <!-- Otherwise, forget the whole idea -->
+ <xsl:otherwise><!-- nevermind --></xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="../@pgwide=1">
+ <xsl:attribute name="width">100%</xsl:attribute>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="../@frame='none'">
+ <xsl:attribute name="border">0</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$table.borders.with.css != 0">
+ <xsl:attribute name="border">0</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="../@frame='topbot' or ../@frame='top'">
+ <xsl:attribute name="style">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'top'"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../@frame='sides'">
+ <xsl:attribute name="style">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'left'"/>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'right'"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="border">1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:variable name="colgroup">
+ <colgroup>
+ <xsl:call-template name="generate.colgroup">
+ <xsl:with-param name="cols" select="@cols"/>
+ </xsl:call-template>
+ </colgroup>
+ </xsl:variable>
+
+ <xsl:variable name="explicit.table.width">
+ <xsl:call-template name="dbhtml-attribute">
+ <xsl:with-param name="pis"
+ select="../processing-instruction('dbhtml')[1]"/>
+ <xsl:with-param name="attribute" select="'table-width'"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="table.width">
+ <xsl:choose>
+ <xsl:when test="$explicit.table.width != ''">
+ <xsl:value-of select="$explicit.table.width"/>
+ </xsl:when>
+ <xsl:when test="$default.table.width = ''">
+ <xsl:text>100%</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$default.table.width"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:if test="$default.table.width != ''
+ or $explicit.table.width != ''">
+ <xsl:attribute name="width">
+ <xsl:choose>
+ <xsl:when test="contains($table.width, '%')">
+ <xsl:value-of select="$table.width"/>
+ </xsl:when>
+ <xsl:when test="$use.extensions != 0
+ and $tablecolumns.extension != 0">
+ <xsl:choose>
+ <xsl:when test="function-available('stbl:convertLength')">
+ <xsl:value-of select="stbl:convertLength($table.width)"/>
+ </xsl:when>
+ <xsl:when test="function-available('xtbl:convertLength')">
+ <xsl:value-of select="xtbl:convertLength($table.width)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>No convertLength function available.</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$table.width"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="$use.extensions != 0
+ and $tablecolumns.extension != 0">
+ <xsl:choose>
+ <xsl:when test="function-available('stbl:adjustColumnWidths')">
+ <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
+ </xsl:when>
+ <xsl:when test="function-available('xtbl:adjustColumnWidths')">
+ <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>No adjustColumnWidths function available.</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$colgroup"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:apply-templates select="thead"/>
+ <xsl:apply-templates select="tbody"/>
+ <xsl:apply-templates select="tfoot"/>
+
+ <xsl:if test=".//footnote">
+ <tbody class="footnotes">
+ <tr>
+ <td colspan="{@cols}">
+ <xsl:apply-templates select=".//footnote"
+ mode="table.footnote.mode"/>
+ </td>
+ </tr>
+ </tbody>
+ </xsl:if>
+ </table>
+</xsl:template>
+
+
+</xsl:stylesheet>
+
Modified: ristretto/branches/ristretto-gio/src/main_window.c
===================================================================
--- ristretto/branches/ristretto-gio/src/main_window.c 2009-01-24 08:57:28 UTC (rev 6535)
+++ ristretto/branches/ristretto-gio/src/main_window.c 2009-01-24 10:55:30 UTC (rev 6536)
@@ -98,6 +98,8 @@
rstto_window_save_geometry_timer (gpointer user_data);
static gboolean
cb_rstto_main_window_configure_event (GtkWidget *widget, GdkEventConfigure *event);
+static void
+cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event, gpointer user_data);
static void
cb_rstto_main_window_navigator_new_image (RsttoNavigator *navigator, RsttoImage *image, RsttoMainWindow *window);
@@ -132,6 +134,8 @@
static void
cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window);
static void
+cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow *window);
+static void
cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
static void
cb_rstto_main_window_close_all (GtkWidget *widget, RsttoMainWindow *window);
@@ -164,12 +168,13 @@
{ "open", GTK_STOCK_OPEN, N_ ("_Open"), "<control>O", N_ ("Open an image"), G_CALLBACK (cb_rstto_main_window_open_image), },
{ "open-folder", NULL, N_ ("Open _Folder"), NULL, N_ ("Open a folder"), G_CALLBACK (cb_rstto_main_window_open_folder), },
{ "open-recent-menu", NULL, N_ ("Open _Recent"), NULL, },
+ { "file-properties", GTK_STOCK_PROPERTIES, N_ ("_Properties"), NULL, NULL, G_CALLBACK (cb_rstto_main_window_file_properties), },
{ "close", GTK_STOCK_CLOSE, N_ ("_Close"), "<control>W", N_ ("Close this image"), G_CALLBACK (cb_rstto_main_window_close), },
{ "close-all", NULL, N_ ("_Close All"), NULL, N_ ("Close all images"), G_CALLBACK (cb_rstto_main_window_close_all), },
{ "quit", GTK_STOCK_QUIT, N_ ("_Quit"), "<control>Q", N_ ("Quit Ristretto"), G_CALLBACK (cb_rstto_main_window_quit), },
/* Edit Menu */
{ "edit-menu", NULL, N_ ("_Edit"), NULL, },
- { "undo", GTK_STOCK_UNDO, N_ ("_Undo"), NULL, NULL, NULL, },
+ { "open-with-menu", NULL, N_ ("_Open with..."), NULL, },
{ "preferences", GTK_STOCK_PREFERENCES, N_ ("_Preferences"), NULL, NULL, G_CALLBACK (cb_rstto_main_window_preferences), },
/* View Menu */
{ "view-menu", NULL, N_ ("_View"), NULL, },
@@ -177,9 +182,6 @@
{ "set-as-wallpaper", NULL, N_ ("_Set as Wallpaper"), NULL, NULL, NULL, },
/* Thumbnailbar submenu */
{ "thumbnailbar-menu", NULL, N_ ("_Thumbnail Bar"), NULL, },
- { "thumbnailbar-show-vertical", NULL, N_ ("Show _Vertically"), NULL, NULL, NULL, },
- { "thumbnailbar-show-horizontal", NULL, N_ ("_Show Horizontally"), NULL, NULL, NULL, },
- { "thumbnailbar-hide", NULL, N_ ("_Hide"), NULL, NULL, NULL, },
/* Zoom submenu */
{ "zoom-menu", NULL, N_ ("_Zooming"), NULL, },
{ "zoom-in", GTK_STOCK_ZOOM_IN, N_ ("Zoom _In"), "<control>plus", NULL, G_CALLBACK (cb_rstto_main_window_zoom_in),},
@@ -214,6 +216,7 @@
static const GtkToggleActionEntry toggle_action_entries[] =
{
{ "show-toolbar", NULL, N_ ("Show _Toolbar"), NULL, NULL, G_CALLBACK (cb_rstto_main_window_toggle_show_toolbar), TRUE, },
+ { "show-thumbnailbar", NULL, N_ ("Show Thumb_nailbar"), NULL, NULL, NULL, FALSE},
};
@@ -329,6 +332,7 @@
}
g_signal_connect(G_OBJECT(window), "configure-event", G_CALLBACK(cb_rstto_main_window_configure_event), NULL);
+ g_signal_connect(G_OBJECT(window), "window-state-event", G_CALLBACK(cb_rstto_main_window_state_event), NULL);
}
static void
@@ -445,6 +449,23 @@
static void
rstto_main_window_set_sensitive (RsttoMainWindow *window, gboolean sensitive)
{
+
+ gtk_widget_set_sensitive (
+ gtk_ui_manager_get_widget (
+ window->priv->ui_manager,
+ "/main-menu/file-menu/close"),
+ sensitive);
+ gtk_widget_set_sensitive (
+ gtk_ui_manager_get_widget (
+ window->priv->ui_manager,
+ "/main-menu/file-menu/close-all"),
+ sensitive);
+ gtk_widget_set_sensitive (
+ gtk_ui_manager_get_widget (
+ window->priv->ui_manager,
+ "/main-menu/file-menu/file-properties"),
+ sensitive);
+
/* Go Menu */
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/main-menu/go-menu/forward"), sensitive);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/main-menu/go-menu/back"), sensitive);
@@ -798,7 +819,30 @@
static void
cb_rstto_main_window_open_folder (GtkWidget *widget, RsttoMainWindow *window)
{
- g_debug ("%s", __FUNCTION__);
+ gint response;
+ GFile *file;
+ GValue current_uri_val = {0, };
+
+ g_value_init (¤t_uri_val, G_TYPE_STRING);
+ g_object_get_property (G_OBJECT(window->priv->settings_manager), "current-uri", ¤t_uri_val);
+
+ GtkWidget *dialog = gtk_file_chooser_dialog_new(_("Open folder"),
+ GTK_WINDOW(window),
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+ NULL);
+
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+ if(response == GTK_RESPONSE_OK)
+ {
+ gtk_widget_hide(dialog);
+ file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
+
+ g_value_set_string (¤t_uri_val, gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (dialog)));
+ g_object_set_property (G_OBJECT(window->priv->settings_manager), "current-uri", ¤t_uri_val);
+ }
+
}
/**
@@ -901,7 +945,21 @@
g_debug ("%s", __FUNCTION__);
}
+
/**
+ * cb_rstto_main_window_file_properties:
+ * @widget:
+ * @window:
+ *
+ *
+ */
+static void
+cb_rstto_main_window_file_properties (GtkWidget *widget, RsttoMainWindow *window)
+{
+
+}
+
+/**
* cb_rstto_main_window_quit:
* @widget:
* @window:
@@ -1097,3 +1155,36 @@
}
return FALSE;
}
+
+static void
+cb_rstto_main_window_state_event(GtkWidget *widget, GdkEventWindowState *event, gpointer user_data)
+{
+ RsttoMainWindow *window = RSTTO_MAIN_WINDOW(widget);
+ GValue show_toolbar_val = {0,};
+
+ if(event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
+ {
+ if(event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)
+ {
+ gtk_widget_hide (window->priv->menubar);
+ gtk_widget_hide (window->priv->toolbar);
+ gtk_widget_hide (window->priv->statusbar);
+ }
+ else
+ {
+ g_value_init (&show_toolbar_val, G_TYPE_BOOLEAN);
+ g_object_get_property (G_OBJECT(window->priv->settings_manager), "show-toolbar", &show_toolbar_val);
+
+ gtk_widget_show (window->priv->menubar);
+ gtk_widget_show (window->priv->statusbar);
+
+ if (g_value_get_boolean (&show_toolbar_val))
+ gtk_widget_show (window->priv->toolbar);
+
+ g_value_reset (&show_toolbar_val);
+ }
+ }
+ if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED)
+ {
+ }
+}
Modified: ristretto/branches/ristretto-gio/src/main_window_ui.xml
===================================================================
--- ristretto/branches/ristretto-gio/src/main_window_ui.xml 2009-01-24 08:57:28 UTC (rev 6535)
+++ ristretto/branches/ristretto-gio/src/main_window_ui.xml 2009-01-24 10:55:30 UTC (rev 6536)
@@ -11,23 +11,22 @@
<placeholder name="placeholder-open-recent"/>
</menu>
<separator/>
+ <menuitem action="file-properties"/>
+ <separator/>
<menuitem action="close"/>
<menuitem action="close-all"/>
- <separator/>
<menuitem action="quit"/>
</menu>
<menu action="edit-menu">
- <menuitem action="undo"/>
+ <menu action="open-with-menu">
+ <placeholder name="open-with-apps" />
+ </menu>
<separator/>
<menuitem action="preferences"/>
</menu>
<menu action="view-menu">
<menuitem action="show-toolbar"/>
- <menu action="thumbnailbar-menu">
- <menuitem action="thumbnailbar-show-vertical"/>
- <menuitem action="thumbnailbar-show-horizontal"/>
- <menuitem action="thumbnailbar-hide"/>
- </menu>
+ <menuitem action="show-thumbnailbar"/>
<separator/>
<menu action="zoom-menu">
<menuitem action="zoom-in"/>
More information about the Goodies-commits
mailing list