Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ristretto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Avinash Sonawane
ristretto
Commits
062b0f1f
Commit
062b0f1f
authored
Sep 26, 2009
by
Stephan Arts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Images can only be opened once
parent
2366de5b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
15 deletions
+76
-15
ChangeLog
ChangeLog
+6
-0
src/image_list.c
src/image_list.c
+42
-15
src/main_window.c
src/main_window.c
+21
-0
src/thumbnail_bar.c
src/thumbnail_bar.c
+7
-0
No files found.
ChangeLog
View file @
062b0f1f
2009-09-26 Stephan Arts <stephan@xfce.org>
* src/main_window.c,
src/image_list.c,
src/thumbnailbar.c: Images can only be opened once
2009-09-26 Stephan Arts <stephan@xfce.org>
* src/wallpaper_manager.h,
...
...
src/image_list.c
View file @
062b0f1f
...
...
@@ -5,7 +5,8 @@
* 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.
* * This program is distributed in the hope that it will be useful,
*
* This program 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 Library General Public License for more details.
...
...
@@ -47,6 +48,8 @@ static gint
cb_rstto_image_list_image_name_compare_func
(
RsttoImage
*
a
,
RsttoImage
*
b
);
static
gint
cb_rstto_image_list_exif_date_compare_func
(
RsttoImage
*
a
,
RsttoImage
*
b
);
static
gint
cb_rstto_image_list_file_compare_func
(
RsttoImage
*
a
,
GFile
*
file
);
static
GObjectClass
*
parent_class
=
NULL
;
static
GObjectClass
*
iter_parent_class
=
NULL
;
...
...
@@ -181,26 +184,36 @@ rstto_image_list_new (void)
gboolean
rstto_image_list_add_file
(
RsttoImageList
*
image_list
,
GFile
*
file
,
GError
**
error
)
{
RsttoImage
*
image
=
rstto_image_new
(
file
);
if
(
image
)
{
image_list
->
priv
->
images
=
g_list_insert_sorted
(
image_list
->
priv
->
images
,
image
,
rstto_image_list_get_compare_func
(
image_list
));
image_list
->
priv
->
n_images
++
;
RsttoImage
*
image
=
NULL
;
GList
*
image_iter
=
g_list_find_custom
(
image_list
->
priv
->
images
,
file
,
(
GCompareFunc
)
cb_rstto_image_list_file_compare_func
);
g_signal_emit
(
G_OBJECT
(
image_list
),
rstto_image_list_signals
[
RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE
],
0
,
image
,
NULL
);
if
(
image_list
->
priv
->
n_images
==
1
)
if
(
!
image_iter
)
{
image
=
rstto_image_new
(
file
);
if
(
image
)
{
/** TODO: update all iterators */
GSList
*
iter
=
image_list
->
priv
->
iterators
;
while
(
iter
)
image_list
->
priv
->
images
=
g_list_insert_sorted
(
image_list
->
priv
->
images
,
image
,
rstto_image_list_get_compare_func
(
image_list
));
image_list
->
priv
->
n_images
++
;
g_signal_emit
(
G_OBJECT
(
image_list
),
rstto_image_list_signals
[
RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE
],
0
,
image
,
NULL
);
if
(
image_list
->
priv
->
n_images
==
1
)
{
g_signal_emit
(
G_OBJECT
(
iter
->
data
),
rstto_image_list_iter_signals
[
RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED
],
0
,
NULL
);
iter
=
g_slist_next
(
iter
);
/** TODO: update all iterators */
GSList
*
iter
=
image_list
->
priv
->
iterators
;
while
(
iter
)
{
g_signal_emit
(
G_OBJECT
(
iter
->
data
),
rstto_image_list_iter_signals
[
RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED
],
0
,
NULL
);
iter
=
g_slist_next
(
iter
);
}
}
return
TRUE
;
}
return
TRU
E
;
return
FALS
E
;
}
return
FALSE
;
g_signal_emit
(
G_OBJECT
(
image_list
),
rstto_image_list_signals
[
RSTTO_IMAGE_LIST_SIGNAL_NEW_IMAGE
],
0
,
image_iter
->
data
,
NULL
);
return
TRUE
;
}
gint
...
...
@@ -570,3 +583,17 @@ cb_rstto_image_list_exif_date_compare_func (RsttoImage *a, RsttoImage *b)
g_object_unref
(
file_info_b
);
return
result
;
}
static
gint
cb_rstto_image_list_file_compare_func
(
RsttoImage
*
a
,
GFile
*
file
)
{
gchar
*
a_base
=
g_file_get_uri
(
rstto_image_get_file
(
a
));
gchar
*
b_base
=
g_file_get_uri
(
file
);
gint
result
=
0
;
result
=
g_strcasecmp
(
a_base
,
b_base
);
g_free
(
a_base
);
g_free
(
b_base
);
return
result
;
}
src/main_window.c
View file @
062b0f1f
...
...
@@ -64,6 +64,7 @@ struct _RsttoMainWindowPriv
guint
show_fs_toolbar_timeout_id
;
gint
window_save_geometry_timer_id
;
gint
open_image_timer_id
;
gboolean
fs_toolbar_sticky
;
...
...
@@ -138,6 +139,8 @@ rstto_main_window_get_property (GObject *object,
static
gboolean
rstto_window_save_geometry_timer
(
gpointer
user_data
);
static
gboolean
rstto_window_open_image_timer
(
gpointer
user_data
);
static
void
rstto_main_window_image_list_iter_changed
(
RsttoMainWindow
*
window
);
...
...
@@ -1075,6 +1078,14 @@ rstto_window_save_geometry_timer (gpointer user_data)
return
FALSE
;
}
static
gboolean
rstto_window_open_image_timer
(
gpointer
user_data
)
{
RsttoMainWindow
*
window
=
RSTTO_MAIN_WINDOW
(
user_data
);
window
->
priv
->
open_image_timer_id
=
0
;
return
FALSE
;
}
static
void
rstto_main_window_set_navigationbar_position
(
RsttoMainWindow
*
window
,
guint
orientation
)
{
...
...
@@ -1601,6 +1612,16 @@ cb_rstto_main_window_image_list_new_image (RsttoImageList *image_list, RsttoImag
{
if
(
rstto_image_list_iter_get_position
(
window
->
priv
->
iter
)
==
-
1
)
rstto_image_list_iter_set_position
(
window
->
priv
->
iter
,
0
);
if
(
window
->
priv
->
open_image_timer_id
>
0
)
{
g_source_remove
(
window
->
priv
->
open_image_timer_id
);
}
else
{
rstto_image_list_iter_find_image
(
window
->
priv
->
iter
,
image
);
}
window
->
priv
->
open_image_timer_id
=
g_timeout_add
(
1000
,
rstto_window_open_image_timer
,
window
);
rstto_main_window_image_list_iter_changed
(
window
);
}
...
...
src/thumbnail_bar.c
View file @
062b0f1f
...
...
@@ -777,9 +777,16 @@ cb_rstto_thumbnail_bar_image_list_new_image (RsttoImageList *image_list, RsttoIm
{
RsttoThumbnailBar
*
bar
=
RSTTO_THUMBNAIL_BAR
(
user_data
);
GtkWidget
*
thumb
;
GList
*
iter
;
g_return_if_fail
(
rstto_image_list_iter_find_image
(
bar
->
priv
->
internal_iter
,
image
));
for
(
iter
=
bar
->
priv
->
thumbs
;
iter
!=
NULL
;
iter
=
g_list_next
(
iter
))
{
if
(
image
==
rstto_thumbnail_get_image
(
iter
->
data
))
return
;
}
thumb
=
rstto_thumbnail_new
(
image
);
gtk_container_add
(
GTK_CONTAINER
(
bar
),
thumb
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment