[Xfce4-commits] r22402 - xarchiver/trunk/src
Author: colossus Date: 2006-07-11 11:27:07 + (Tue, 11 Jul 2006) New Revision: 22402 Modified: xarchiver/trunk/src/extract_dialog.c xarchiver/trunk/src/main.c Log: Fixed a missing space in the ZIP command string for single files in extract_dialog.c. Fixed a weird behaviour of switch -d. Modified: xarchiver/trunk/src/extract_dialog.c === --- xarchiver/trunk/src/extract_dialog.c2006-07-10 22:27:53 UTC (rev 22401) +++ xarchiver/trunk/src/extract_dialog.c2006-07-11 11:27:07 UTC (rev 22402) @@ -643,7 +643,7 @@ else command = g_strconcat ( unzip , archive-freshen ? -f : , archive-update ? -u : , - archive-overwrite ? -o : -n , + archive-overwrite ? -o : -n , archive-full_path ? : -j , archive-escaped_path , files-str, -d , path , NULL ); break; Modified: xarchiver/trunk/src/main.c === --- xarchiver/trunk/src/main.c 2006-07-10 22:27:53 UTC (rev 22401) +++ xarchiver/trunk/src/main.c 2006-07-11 11:27:07 UTC (rev 22402) @@ -135,7 +135,7 @@ gchar *_current_dir = NULL; archive = xa_init_structure_from_cmd_line ( archive_name ); - if (archive != NULL) + if (archive != NULL argv[1] != NULL) { GString *string = g_string_new ( ); for ( x = 1; x argc; x++) @@ -159,6 +159,7 @@ if (cli_command != NULL) error_output = SpawnSyncCommand ( cli_command ); g_string_free (string, TRUE); + } } /* Switch -a */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r22403 - in xarchiver/trunk: . src
Author: colossus Date: 2006-07-11 13:00:56 + (Tue, 11 Jul 2006) New Revision: 22403 Modified: xarchiver/trunk/TODO xarchiver/trunk/src/callbacks.c xarchiver/trunk/src/extract_dialog.c xarchiver/trunk/src/iso.c Log: Fixed bug #2005. The extract dialog is closed before the ISO extraction is performed. Have the progress bar pulse when extracting from an ISO. Updated TODO file. Modified: xarchiver/trunk/TODO === --- xarchiver/trunk/TODO2006-07-11 11:27:07 UTC (rev 22402) +++ xarchiver/trunk/TODO2006-07-11 13:00:56 UTC (rev 22403) @@ -1,6 +1,7 @@ + iso - add display of ID's inside the ISO plus image type [PARTIALLY DONE]. - fix the extraction of single files with full path. -- fix bugs #1736, #1937, #2005. +- fix bugs #1736, #1937. - switching by right clicking on the toolbar to icons with text/ no text/ small icons. -- ?? create a routine for handling the sensitiveness of the buttons, window title +- create a routine for handling the sensitiveness of the buttons, window title [MAYBE ??] + Modified: xarchiver/trunk/src/callbacks.c === --- xarchiver/trunk/src/callbacks.c 2006-07-11 11:27:07 UTC (rev 22402) +++ xarchiver/trunk/src/callbacks.c 2006-07-11 13:00:56 UTC (rev 22403) @@ -550,7 +550,8 @@ if (extract_path != NULL) gtk_entry_set_text (GTK_ENTRY(extract_window-destination_path_entry),extract_path); command = xa_parse_extract_dialog_options ( archive , extract_window, selection ); - gtk_widget_destroy ( extract_window-dialog1 ); + if (extract_window-dialog1 != NULL) + gtk_widget_destroy ( extract_window-dialog1 ); if (command != NULL) { ExtractAddDelete (command); Modified: xarchiver/trunk/src/extract_dialog.c === --- xarchiver/trunk/src/extract_dialog.c2006-07-11 11:27:07 UTC (rev 22402) +++ xarchiver/trunk/src/extract_dialog.c2006-07-11 13:00:56 UTC (rev 22403) @@ -494,7 +494,11 @@ break; case XARCHIVETYPE_ISO: - end = gtk_tree_model_get_iter_first (model,iter); + end = gtk_tree_model_get_iter_first (model , iter); + gtk_widget_show ( viewport2 ); + g_timeout_add (200, xa_progressbar_pulse, NULL ); + gtk_widget_destroy (dialog_data-dialog1); + dialog_data-dialog1 = NULL; while (end) { gtk_tree_model_get (model, iter, Modified: xarchiver/trunk/src/iso.c === --- xarchiver/trunk/src/iso.c 2006-07-11 11:27:07 UTC (rev 22402) +++ xarchiver/trunk/src/iso.c 2006-07-11 13:00:56 UTC (rev 22403) @@ -378,114 +378,98 @@ void parse_dir (gchar *dir_name , int extent, int len, XArchive *archive) { -char testname[256]; -struct todo *td; -int i; -struct iso_directory_record *idr; + char testname[256]; + struct todo *td; + int i; + struct iso_directory_record *idr; -while(len 0 ) -{ -lseek(fileno(iso_stream), (extent - sector_offset) 11, 0); -read(fileno(iso_stream), buffer, sizeof(buffer)); -len -= sizeof(buffer); -extent++; -i = 0; -while( 1==1 ) -{ -idr = (struct iso_directory_record *) buffer[i]; -if (idr-length[0] == 0) -break; -memset(fstat_buf, 0, sizeof(fstat_buf)); -name_buf[0] = xname[0] = 0; -fstat_buf.st_size = iso_733((unsigned char *)idr-size); -if( idr-flags[0] 2) -fstat_buf.st_mode |= S_IFDIR; -else -fstat_buf.st_mode |= S_IFREG; -if(idr-name_len[0] == 1 idr-name[0] == 0) -strcpy(name_buf, .); -else if(idr-name_len[0] == 1 idr-name[0] == 1) -strcpy(name_buf, ..); -else -{ -switch (ucs_level) -{ -case 3: -/* -* Unicode name. Convert as best we can. -
[Xfce4-commits] r22404 - xfwm4/trunk/src
Author: olivier Date: 2006-07-11 17:20:32 + (Tue, 11 Jul 2006) New Revision: 22404 Modified: xfwm4/trunk/src/compositor.c Log: Make sure the window pixmap is cleared out. Modified: xfwm4/trunk/src/compositor.c === --- xfwm4/trunk/src/compositor.c2006-07-11 13:00:56 UTC (rev 22403) +++ xfwm4/trunk/src/compositor.c2006-07-11 17:20:32 UTC (rev 22404) @@ -1974,12 +1974,6 @@ TRACE (entering resize_win); TRACE (resizing 0x%lx, (%i,%i) %ix%i, cw-id, x, y, width, height); -if (!WIN_IS_VISIBLE(cw)) -{ -set_size_attributes (cw, x, y, width, height, bw); -return; -} - screen_info = cw-screen_info; display_info = screen_info-display_info; @@ -2030,6 +2024,12 @@ set_size_attributes (cw, x, y, width, height, bw); +if (!WIN_IS_VISIBLE(cw)) +{ +/* 'nuff for invisible windows... */ +return; +} + cw-extents = win_extents (cw); XFixesUnionRegion (display_info-dpy, damage, damage, cw-extents); /* A shape notify will likely change the shadows too, so clear the extents */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r22405 - xfdesktop/trunk/common
Author: kelnos Date: 2006-07-11 19:00:52 + (Tue, 11 Jul 2006) New Revision: 22405 Modified: xfdesktop/trunk/common/xfdesktop-common.c Log: don't search for the locale-suffixed menu.xml version in the user's homedir (bug 2010) Modified: xfdesktop/trunk/common/xfdesktop-common.c === --- xfdesktop/trunk/common/xfdesktop-common.c 2006-07-11 17:20:32 UTC (rev 22404) +++ xfdesktop/trunk/common/xfdesktop-common.c 2006-07-11 19:00:52 UTC (rev 22405) @@ -137,6 +137,7 @@ XfceKiosk *kiosk; gboolean user_menu; gchar filename[PATH_MAX], searchpath[PATH_MAX*3+2], **all_dirs; +const gchar *userhome = xfce_get_homedir(); gint i; kiosk = xfce_kiosk_new(xfdesktop); @@ -144,17 +145,16 @@ xfce_kiosk_free(kiosk); if(!user_menu) { -const gchar *userhome = xfce_get_homedir(); all_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_CONFIG, -xfce4/desktop/); +xfce4/desktop/); for(i = 0; all_dirs[i]; i++) { if(strstr(all_dirs[i], userhome) != all_dirs[i]) { g_snprintf(searchpath, PATH_MAX*3+2, -%s%%F.%%L:%s%%F.%%l:%s%%F, -all_dirs[i], all_dirs[i], all_dirs[i]); + %s%%F.%%L:%s%%F.%%l:%s%%F, + all_dirs[i], all_dirs[i], all_dirs[i]); if(xfce_get_path_localized(filename, PATH_MAX, searchpath, -menu.xml, G_FILE_TEST_IS_REGULAR)) + menu.xml, G_FILE_TEST_IS_REGULAR)) { g_strfreev(all_dirs); return g_strdup(filename); @@ -164,24 +164,27 @@ g_strfreev(all_dirs); } else { gchar *menu_file = xfce_resource_save_location(XFCE_RESOURCE_CONFIG, -xfce4/desktop/menu.xml, FALSE); + xfce4/desktop/menu.xml, + FALSE); if(menu_file g_file_test(menu_file, G_FILE_TEST_IS_REGULAR)) return menu_file; else if(menu_file) g_free(menu_file); all_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_CONFIG, -xfce4/desktop/); +xfce4/desktop/); for(i = 0; all_dirs[i]; i++) { -g_snprintf(searchpath, PATH_MAX*3+2, -%s%%F.%%L:%s%%F.%%l:%s%%F, -all_dirs[i], all_dirs[i], all_dirs[i]); -if(xfce_get_path_localized(filename, PATH_MAX, searchpath, -menu.xml, G_FILE_TEST_IS_REGULAR)) -{ -g_strfreev(all_dirs); -return g_strdup(filename); -} +if(strstr(all_dirs[i], userhome) != all_dirs[i]) { +g_snprintf(searchpath, PATH_MAX*3+2, + %s%%F.%%L:%s%%F.%%l:%s%%F, + all_dirs[i], all_dirs[i], all_dirs[i]); +if(xfce_get_path_localized(filename, PATH_MAX, searchpath, + menu.xml, G_FILE_TEST_IS_REGULAR)) +{ +g_strfreev(all_dirs); +return g_strdup(filename); +} +} } g_strfreev(all_dirs); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r22407 - xfwm4/trunk/src
Author: olivier Date: 2006-07-11 21:47:03 + (Tue, 11 Jul 2006) New Revision: 22407 Modified: xfwm4/trunk/src/client.c xfwm4/trunk/src/tabwin.c xfwm4/trunk/src/tabwin.h Log: Make sure the icon selected in the tabwin matches the selected window in all cases (fix bug #2008) Modified: xfwm4/trunk/src/client.c === --- xfwm4/trunk/src/client.c2006-07-11 21:37:28 UTC (rev 22406) +++ xfwm4/trunk/src/client.c2006-07-11 21:47:03 UTC (rev 22407) @@ -4434,8 +4434,8 @@ TRACE (entering cycle loop); passdata.wireframe = wireframeCreate (passdata.c); icon = getAppIcon (display_info, passdata.c-window, 32, 32); -passdata.tabwin = tabwinCreate (passdata.c-screen_info-gscr, c, -passdata.cycle_range, +passdata.tabwin = tabwinCreate (passdata.c-screen_info-gscr, c, +passdata.c, passdata.cycle_range, screen_info-params-cycle_workspaces); eventFilterPush (display_info-xfilter, clientCycle_event_filter, passdata); gtk_main (); Modified: xfwm4/trunk/src/tabwin.c === --- xfwm4/trunk/src/tabwin.c2006-07-11 21:37:28 UTC (rev 22406) +++ xfwm4/trunk/src/tabwin.c2006-07-11 21:47:03 UTC (rev 22407) @@ -162,13 +162,13 @@ } static GtkWidget * -createWindowlist (GdkScreen * scr, Client * c, unsigned int cycle_range, Tabwin * t) +createWindowlist (GdkScreen * scr, Client * current, Client * new, unsigned int cycle_range, Tabwin * t) { ScreenInfo *screen_info; -Client *c2 = NULL; -GList *next; +Client *c2; GdkRectangle monitor_sz; GtkWidget *windowlist, *icon; +GList *next; unsigned int grid_cols; unsigned int n_clients; unsigned int grid_rows; @@ -176,13 +176,15 @@ int msx, msy; gint monitor; -g_return_val_if_fail (c != NULL, NULL); +g_return_val_if_fail (current != NULL, NULL); i = 0; packpos = 0; +c2 = NULL; +next = NULL; /* calculate the wrapping */ -screen_info = c-screen_info; +screen_info = current-screen_info; n_clients = screen_info-client_count; g_return_val_if_fail (n_clients 0, NULL); @@ -199,7 +201,7 @@ t-grid_cols = grid_cols; t-grid_rows = grid_rows; /* pack the client icons */ -for (c2 = c, i = 0; c2 i n_clients; i++, c2 = c2-next) +for (c2 = current, i = 0; c2 i n_clients; i++, c2 = c2-next) { if (!clientSelectMask (c2, cycle_range, WINDOW_REGULAR_FOCUSABLE)) continue; @@ -210,23 +212,21 @@ GTK_FILL, GTK_FILL, 7, 7); packpos++; t-head = g_list_append (t-head, icon); +if (c2 == new) +{ +next = g_list_last (t-head); +} } - -next = g_list_next (t-head); -if (!next) -{ -next = t-head; -} -t-current = next; if (next) { tabwinSetSelected (t, next-data); } +t-current = next; return windowlist; } Tabwin * -tabwinCreate (GdkScreen * scr, Client * c, unsigned int cycle_range, gboolean display_workspace) +tabwinCreate (GdkScreen * scr, Client * current, Client * new, unsigned int cycle_range, gboolean display_workspace) { Tabwin *tabwin; GtkWidget *frame; @@ -278,7 +278,7 @@ gtk_box_pack_start (GTK_BOX (vbox), tabwin-label, TRUE, TRUE, 0); gtk_widget_set_size_request (GTK_WIDGET (tabwin-label), 240, -1); -windowlist = createWindowlist (scr, c, cycle_range, tabwin); +windowlist = createWindowlist (scr, current, new, cycle_range, tabwin); tabwin-container = windowlist; gtk_container_add (GTK_CONTAINER (frame), windowlist); Modified: xfwm4/trunk/src/tabwin.h === --- xfwm4/trunk/src/tabwin.h2006-07-11 21:37:28 UTC (rev 22406) +++ xfwm4/trunk/src/tabwin.h2006-07-11 21:47:03 UTC (rev 22407) @@ -48,7 +48,7 @@ int grid_rows; }; -Tabwin *tabwinCreate (GdkScreen *, Client *, unsigned int, gboolean); +Tabwin *tabwinCreate (GdkScreen *, Client *, Client *, unsigned int, gboolean); Client *tabwinGetSelected (Tabwin *); Client *tabwinSelectNext (Tabwin *); Client *tabwinSelectPrev (Tabwin *); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r22408 - xfwm4/trunk/mcs-plugin
Author: olivier Date: 2006-07-11 21:59:55 + (Tue, 11 Jul 2006) New Revision: 22408 Modified: xfwm4/trunk/mcs-plugin/wmtweaks_plugin.c xfwm4/trunk/mcs-plugin/xfwm4_plugin.c Log: Fix compiler warnings (Nick Schermer [EMAIL PROTECTED]) Modified: xfwm4/trunk/mcs-plugin/wmtweaks_plugin.c === --- xfwm4/trunk/mcs-plugin/wmtweaks_plugin.c2006-07-11 21:47:03 UTC (rev 22407) +++ xfwm4/trunk/mcs-plugin/wmtweaks_plugin.c2006-07-11 21:59:55 UTC (rev 22408) @@ -271,7 +271,6 @@ GtkWidget *hbox; GtkWidget *label_widget; GtkWidget *omenu; -GtkWidget *item; guint n; hbox = gtk_hbox_new (FALSE, 0); Modified: xfwm4/trunk/mcs-plugin/xfwm4_plugin.c === --- xfwm4/trunk/mcs-plugin/xfwm4_plugin.c 2006-07-11 21:47:03 UTC (rev 22407) +++ xfwm4/trunk/mcs-plugin/xfwm4_plugin.c 2006-07-11 21:59:55 UTC (rev 22408) @@ -648,9 +648,7 @@ { GtkWidget *hbox; GtkWidget *vbox; -GtkWidget *menu; GtkWidget *omenu; -GtkWidget *item; guint n; vbox = gtk_vbox_new (FALSE, 0); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r22410 - in installit/trunk: . components i18n/po tools
Author: jannis Date: 2006-07-11 22:07:24 + (Tue, 11 Jul 2006) New Revision: 22410 Modified: installit/trunk/ChangeLog installit/trunk/components/packages.py installit/trunk/i18n/po/de.po installit/trunk/i18n/po/i2t.pot installit/trunk/tools/env.py Log: * i18n/po/de.po, i18n/po/i2t.po: New strings merged. * tools/env.py: Add link() and hasLibrary() methods. * components/packages.py: Use Environment.hasLibrary method to detect libraries using libtool. First tests look promising. Modified: installit/trunk/ChangeLog === --- installit/trunk/ChangeLog 2006-07-11 22:00:10 UTC (rev 22409) +++ installit/trunk/ChangeLog 2006-07-11 22:07:24 UTC (rev 22410) @@ -1,3 +1,10 @@ +2006-07-12 Jannis Pohlmann [EMAIL PROTECTED] + + * i18n/po/de.po, i18n/po/i2t.po: New strings merged. + * tools/env.py: Add link() and hasLibrary() methods. + * components/packages.py: Use Environment.hasLibrary method to detect + libraries using libtool. First tests look promising. + 2006-07-11 Jannis Pohlmann [EMAIL PROTECTED] * i18n/po/i2t.pot, i18n/po/de.po, i18n/po/POTFILES.in: New strings Modified: installit/trunk/components/packages.py === --- installit/trunk/components/packages.py 2006-07-11 22:00:10 UTC (rev 22409) +++ installit/trunk/components/packages.py 2006-07-11 22:07:24 UTC (rev 22410) @@ -151,6 +151,13 @@ self.path = path +class Library: + +def __init__(self, name, path): +self.name = name +self.path = path + + class ProgramNotFoundError(Exception): pass @@ -538,9 +545,13 @@ pkg = PkgConfig.resolve(dep[name], dep[version]) except PkgConfigModuleNotFound: if Config.get(UseLibrarySearch): -# TODO: Replace the line below with a call of the -# Library lookup class -pkg = UnresolvedPackage(dep[name], dep[version]) +## TODO: Replace the line below with a call of the +## Library lookup class +if Environment.hasLibrary(dep[name], dep[version]): +return Library(dep[name], dep[version]) +else: +return UnresolvedPackage(dep[name], +dep[version]) else: # Mark this dependency as unresolved and try resolving # it manually during installation. Modified: installit/trunk/i18n/po/de.po === --- installit/trunk/i18n/po/de.po 2006-07-11 22:00:10 UTC (rev 22409) +++ installit/trunk/i18n/po/de.po 2006-07-11 22:07:24 UTC (rev 22410) @@ -7,8 +7,8 @@ msgstr Project-Id-Version: InstallIt 0.1beta1\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2006-07-11 23:25+0200\n -PO-Revision-Date: 2006-07-11 23:27+0100\n +POT-Creation-Date: 2006-07-12 00:04+0200\n +PO-Revision-Date: 2006-07-12 00:07+0100\n Last-Translator: Jannis Pohlmann [EMAIL PROTECTED]\n Language-Team: German [EMAIL PROTECTED]\n MIME-Version: 1.0\n @@ -114,7 +114,7 @@ msgid Installing %(name)s %(version)s ... msgstr Installiere %(name)s %(version)s ... -#: ../..//components/packages.py:343 +#: ../..//components/packages.py:350 #, python-format msgid Could not parse package description %s: %s msgstr Konnte Paketbeschreibung %s nicht lesen: %s @@ -441,6 +441,16 @@ msgid Failed to compile %s. msgstr Konnte %s nicht übersetzen. +#: ../..//tools/env.py:105 +#, python-format +msgid Linking %s with %s +msgstr Verlinke %s mit %s + +#: ../..//tools/env.py:111 +#, python-format +msgid Failed to link %s. +msgstr Konnte %s nicht verlinken. + #: ../..//tools/pkgconfig.py:37 #, python-format msgid pkg-config module missing: %(name)s (%(version)s). Modified: installit/trunk/i18n/po/i2t.pot === --- installit/trunk/i18n/po/i2t.pot 2006-07-11 22:00:10 UTC (rev 22409) +++ installit/trunk/i18n/po/i2t.pot 2006-07-11 22:07:24 UTC (rev 22410) @@ -8,7 +8,7 @@ msgstr Project-Id-Version: PACKAGE VERSION\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2006-07-11 23:25+0200\n +POT-Creation-Date: 2006-07-12 00:04+0200\n PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n Last-Translator: FULL NAME [EMAIL PROTECTED]\n Language-Team: LANGUAGE [EMAIL PROTECTED]\n @@ -112,7 +112,7 @@ msgid Installing %(name)s %(version)s ... msgstr -#: ../..//components/packages.py:343 +#: ../..//components/packages.py:350 #, python-format msgid Could not parse package description %s: %s msgstr @@ -438,6 +438,16 @@ msgid Failed to compile %s. msgstr +#: ../..//tools/env.py:105 +#, python-format +msgid
[Xfce4-commits] r22412 - xfdesktop/trunk/panel-plugin
Author: kelnos Date: 2006-07-11 22:57:09 + (Tue, 11 Jul 2006) New Revision: 22412 Modified: xfdesktop/trunk/panel-plugin/desktop-menu-plugin.c Log: if using the default menu file, don't pass the file argument to xfce4-menueditor, cuz menueditor will just do the right thing (bug 1911) Modified: xfdesktop/trunk/panel-plugin/desktop-menu-plugin.c === --- xfdesktop/trunk/panel-plugin/desktop-menu-plugin.c 2006-07-11 22:23:36 UTC (rev 22411) +++ xfdesktop/trunk/panel-plugin/desktop-menu-plugin.c 2006-07-11 22:57:09 UTC (rev 22412) @@ -709,20 +709,30 @@ { DMPlugin *dmp = user_data; GError *err = NULL; -const gchar *menu_file; +const gchar *menu_file = NULL; gchar cmd[PATH_MAX]; g_return_if_fail(dmp dmp-desktop_menu); -menu_file = xfce_desktop_menu_get_menu_file(dmp-desktop_menu); -if(!menu_file) -return; -g_snprintf(cmd, PATH_MAX, %s/xfce4-menueditor \%s\, BINDIR, menu_file); +if(dmp-use_default_menu) +g_snprintf(cmd, PATH_MAX, %s/xfce4-menueditor, BINDIR); +else { +menu_file = xfce_desktop_menu_get_menu_file(dmp-desktop_menu); +if(!menu_file) +return; +g_snprintf(cmd, PATH_MAX, %s/xfce4-menueditor \%s\, BINDIR, + menu_file); +} + if(xfce_exec(cmd, FALSE, FALSE, NULL)) return; -g_snprintf(cmd, PATH_MAX, xfce4-menueditor \%s\, menu_file); +if(dmp-use_default_menu) +g_strlcpy(cmd, xfce4-menueditor, PATH_MAX); +else +g_snprintf(cmd, PATH_MAX, xfce4-menueditor \%s\, menu_file); + if(!xfce_exec(cmd, FALSE, FALSE, err)) { xfce_warn(_(Unable to launch xfce4-menueditor: %s), err-message); g_error_free(err); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r22413 - xfdesktop/trunk/src
Author: kelnos Date: 2006-07-11 23:39:26 + (Tue, 11 Jul 2006) New Revision: 22413 Modified: xfdesktop/trunk/src/xfdesktop-file-icon-manager.c xfdesktop/trunk/src/xfdesktop-file-icon.c xfdesktop/trunk/src/xfdesktop-file-utils.c xfdesktop/trunk/src/xfdesktop-file-utils.h xfdesktop/trunk/src/xfdesktop-icon.c xfdesktop/trunk/src/xfdesktop-icon.h Log: implement the backend portion to be able to show icon tooltips. haven't done the XfdesktopIconView part yet (bug 1526) Modified: xfdesktop/trunk/src/xfdesktop-file-icon-manager.c === --- xfdesktop/trunk/src/xfdesktop-file-icon-manager.c 2006-07-11 22:57:09 UTC (rev 22412) +++ xfdesktop/trunk/src/xfdesktop-file-icon-manager.c 2006-07-11 23:39:26 UTC (rev 22413) @@ -1103,17 +1103,7 @@ gtk_table_attach(GTK_TABLE(table), lbl, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0); -if(!strcmp(thunar_vfs_mime_info_get_name(info-mime_info), - inode/symlink)) -{ -str = g_strdup(_(broken link)); -is_link = TRUE; -} else if(info-flags THUNAR_VFS_FILE_FLAGS_SYMLINK) { -str = g_strdup_printf(_(link to %s), - thunar_vfs_mime_info_get_comment(info-mime_info)); -is_link = TRUE; -} else -str = g_strdup(thunar_vfs_mime_info_get_comment(info-mime_info)); +str = xfdesktop_file_utils_get_file_kind(info, is_link); lbl = gtk_label_new(str); g_free(str); gtk_misc_set_alignment(GTK_MISC(lbl), 0.0, 0.5); Modified: xfdesktop/trunk/src/xfdesktop-file-icon.c === --- xfdesktop/trunk/src/xfdesktop-file-icon.c 2006-07-11 22:57:09 UTC (rev 22412) +++ xfdesktop/trunk/src/xfdesktop-file-icon.c 2006-07-11 23:39:26 UTC (rev 22413) @@ -31,6 +31,10 @@ #include unistd.h #endif +#ifdef HAVE_TIME_H +#include time.h +#endif + #ifdef HAVE_LIBEXO #define EXO_API_SUBJECT_TO_CHANGE #include exo/exo.h @@ -63,6 +67,7 @@ gint16 row; gint16 col; GdkPixbuf *pix; +gchar *tooltip; guint pix_opacity; gint cur_pix_size; GdkRectangle extents; @@ -78,6 +83,7 @@ static GdkPixbuf *xfdesktop_file_icon_peek_pixbuf(XfdesktopIcon *icon, gint size); static G_CONST_RETURN gchar *xfdesktop_file_icon_peek_label(XfdesktopIcon *icon); +static G_CONST_RETURN gchar *xfdesktop_file_icon_peek_tooltip(XfdesktopIcon *icon); static void xfdesktop_file_icon_set_position(XfdesktopIcon *icon, gint16 row, gint16 col); @@ -93,7 +99,6 @@ XfdesktopIcon *src_icon, GdkDragAction action); - #ifdef HAVE_THUNARX static void xfdesktop_file_icon_tfi_init(ThunarxFileInfoIface *iface); static gchar *xfdesktop_file_icon_tfi_get_name(ThunarxFileInfo *file_info); @@ -211,6 +216,7 @@ { iface-peek_pixbuf = xfdesktop_file_icon_peek_pixbuf; iface-peek_label = xfdesktop_file_icon_peek_label; +iface-peek_tooltip = xfdesktop_file_icon_peek_tooltip; iface-set_position = xfdesktop_file_icon_set_position; iface-get_position = xfdesktop_file_icon_get_position; iface-set_extents = xfdesktop_file_icon_set_extents; @@ -638,6 +644,34 @@ return XFDESKTOP_ICON_DRAG_FAILED; } +static G_CONST_RETURN gchar * +xfdesktop_file_icon_peek_tooltip(XfdesktopIcon *icon) +{ +XfdesktopFileIcon *file_icon = XFDESKTOP_FILE_ICON(icon); + +if(!file_icon-priv-info) + return NULL; /* FIXME: implement something here */ + +if(!file_icon-priv-tooltip) { +gchar mod[64], *kind, sizebuf[64], *size; +struct tm *tm = localtime(file_icon-priv-info-mtime); + +strftime(mod, 64, %Y-%m-%d %H:%M:%S, tm); +kind = xfdesktop_file_utils_get_file_kind(file_icon-priv-info, NULL); +thunar_vfs_humanize_size(file_icon-priv-info-size, sizebuf, 64); +size = g_strdup_printf(_(%s (% G_GINT64_FORMAT Bytes)), sizebuf, + (gint64)file_icon-priv-info-size); + +file_icon-priv-tooltip = g_strdup_printf(_(Kind: %s\nModified:%s\nSize: %s), + kind, mod, size); + +g_free(kind); +g_free(size); +} + +return file_icon-priv-tooltip; +} + static void xfdesktop_delete_file_error(ThunarVfsJob *job, GError *error, Modified: xfdesktop/trunk/src/xfdesktop-file-utils.c === --- xfdesktop/trunk/src/xfdesktop-file-utils.c 2006-07-11 22:57:09 UTC (rev 22412) +++ xfdesktop/trunk/src/xfdesktop-file-utils.c 2006-07-11 23:39:26 UTC (rev 22413) @@ -22,6 +22,10 @@ #include config.h