Changeset 295
- Timestamp:
- 07/05/08 03:37:22 (3 months ago)
- Files:
-
- GtkRadiant/trunk/contrib/prtview/ConfigDialog.cpp (modified) (16 diffs)
- GtkRadiant/trunk/radiant/gtkdlgs.cpp (modified) (1 diff)
- GtkRadiant/trunk/radiant/gtkfilesel-linux.c (modified) (158 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/trunk/contrib/prtview/ConfigDialog.cpp
r229 r295 29 29 //static char THIS_FILE[] = __FILE__; 30 30 #endif 31 #include <glib/gi18n.h> 31 32 32 33 ///////////////////////////////////////////////////////////////////////////// … … 291 292 292 293 dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL); 293 gtk_window_set_title (GTK_WINDOW (dlg), "Portal Viewer Configuration");294 gtk_window_set_title (GTK_WINDOW (dlg), _("Portal Viewer Configuration")); 294 295 gtk_signal_connect (GTK_OBJECT (dlg), "delete_event", 295 296 GTK_SIGNAL_FUNC (dialog_delete_callback), NULL); … … 304 305 gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); 305 306 306 frame = gtk_frame_new ( "3D View");307 frame = gtk_frame_new (_("3D View")); 307 308 gtk_widget_show (frame); 308 309 gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); … … 334 335 gtk_table_set_col_spacings (GTK_TABLE (table), 5); 335 336 336 button = gtk_button_new_with_label ( "Color");337 button = gtk_button_new_with_label (_("Color")); 337 338 gtk_widget_show (button); 338 339 gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, … … 341 342 gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColor3d), NULL); 342 343 343 button = gtk_button_new_with_label ( "Depth Color");344 button = gtk_button_new_with_label (_("Depth Color")); 344 345 gtk_widget_show (button); 345 346 gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, … … 355 356 gtk_signal_connect (GTK_OBJECT (aa3check), "toggled", GTK_SIGNAL_FUNC (OnAntiAlias3d), NULL); 356 357 357 depthcheck = gtk_check_button_new_with_label ( "Depth Cue");358 depthcheck = gtk_check_button_new_with_label (_("Depth Cue")); 358 359 gtk_widget_show (depthcheck); 359 360 gtk_table_attach (GTK_TABLE (table), depthcheck, 1, 2, 1, 2, … … 362 363 gtk_signal_connect (GTK_OBJECT (depthcheck), "toggled", GTK_SIGNAL_FUNC (OnFog), NULL); 363 364 364 linescheck = gtk_check_button_new_with_label ( "Lines");365 linescheck = gtk_check_button_new_with_label (_("Lines")); 365 366 gtk_widget_show (linescheck); 366 367 gtk_table_attach (GTK_TABLE (table), linescheck, 2, 3, 1, 2, … … 369 370 gtk_signal_connect (GTK_OBJECT (linescheck), "toggled", GTK_SIGNAL_FUNC (OnLines), NULL); 370 371 371 polyscheck = gtk_check_button_new_with_label ( "Polygons");372 polyscheck = gtk_check_button_new_with_label (_("Polygons")); 372 373 gtk_widget_show (polyscheck); 373 374 gtk_table_attach (GTK_TABLE (table), polyscheck, 3, 4, 1, 2, … … 384 385 gtk_option_menu_set_menu (GTK_OPTION_MENU (zlist), menu); 385 386 386 item = gtk_menu_item_new_with_label ( "Z-Buffer Test and Write (recommended for solid or no polygons)");387 item = gtk_menu_item_new_with_label (_("Z-Buffer Test and Write (recommended for solid or no polygons)")); 387 388 gtk_widget_show (item); 388 389 gtk_signal_connect (GTK_OBJECT (item), "activate", … … 390 391 gtk_menu_append (GTK_MENU (menu), item); 391 392 392 item = gtk_menu_item_new_with_label ( "Z-Buffer Test Only (recommended for transparent polygons)");393 item = gtk_menu_item_new_with_label (_("Z-Buffer Test Only (recommended for transparent polygons)")); 393 394 gtk_widget_show (item); 394 395 gtk_signal_connect (GTK_OBJECT (item), "activate", … … 396 397 gtk_menu_append (GTK_MENU (menu), item); 397 398 398 item = gtk_menu_item_new_with_label ( "Z-Buffer Off");399 item = gtk_menu_item_new_with_label (_("Z-Buffer Off")); 399 400 gtk_widget_show (item); 400 401 gtk_signal_connect (GTK_OBJECT (item), "activate", … … 444 445 gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); 445 446 446 show3check = gtk_check_button_new_with_label ( "Show");447 show3check = gtk_check_button_new_with_label (_("Show")); 447 448 gtk_widget_show (show3check); 448 449 gtk_box_pack_start (GTK_BOX (hbox), show3check, TRUE, TRUE, 0); 449 450 gtk_signal_connect (GTK_OBJECT (show3check), "toggled", GTK_SIGNAL_FUNC (OnConfig3d), NULL); 450 451 451 portalcheck = gtk_check_button_new_with_label ( "Portal cubic clipper");452 portalcheck = gtk_check_button_new_with_label (_("Portal cubic clipper")); 452 453 gtk_widget_show (portalcheck); 453 454 gtk_box_pack_start (GTK_BOX (hbox), portalcheck, TRUE, TRUE, 0); 454 455 gtk_signal_connect (GTK_OBJECT (portalcheck), "toggled", GTK_SIGNAL_FUNC (OnClip), NULL); 455 456 456 frame = gtk_frame_new ( "2D View");457 frame = gtk_frame_new (_("2D View")); 457 458 gtk_widget_show (frame); 458 459 gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); … … 482 483 gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); 483 484 484 button = gtk_button_new_with_label ( "Color");485 button = gtk_button_new_with_label (_("Color")); 485 486 gtk_widget_show (button); 486 487 gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); … … 488 489 gtk_widget_set_usize (button, 60, -2); 489 490 490 aa2check = gtk_check_button_new_with_label ( "Anti-Alias (May not work on some video cards)");491 aa2check = gtk_check_button_new_with_label (_("Anti-Alias (May not work on some video cards)")); 491 492 gtk_widget_show (aa2check); 492 493 gtk_box_pack_start (GTK_BOX (hbox), aa2check, TRUE, TRUE, 0); … … 497 498 gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0); 498 499 499 show2check = gtk_check_button_new_with_label ( "Show");500 show2check = gtk_check_button_new_with_label (_("Show")); 500 501 gtk_widget_show (show2check); 501 502 gtk_box_pack_start (GTK_BOX (hbox), show2check, FALSE, FALSE, 0); … … 506 507 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); 507 508 508 button = gtk_button_new_with_label ( "OK");509 button = gtk_button_new_with_label (_("OK")); 509 510 gtk_widget_show (button); 510 511 gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); GtkRadiant/trunk/radiant/gtkdlgs.cpp
r289 r295 2645 2645 gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, FALSE, 0); 2646 2646 2647 frame = gtk_frame_new ( (char*)NULL);2647 frame = gtk_frame_new (NULL); 2648 2648 gtk_widget_show (frame); 2649 2649 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); GtkRadiant/trunk/radiant/gtkfilesel-linux.c
r183 r295 22 22 * file for a list of people on the GTK+ Team. See the ChangeLog 23 23 * files for a list of changes. These files are distributed with 24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 25 25 */ 26 26 #define LEO … … 310 310 #define TIME_STRING_BUF 50 311 311 312 /* I've put this here so it doesn't get confused with the 312 /* I've put this here so it doesn't get confused with the 313 313 * file completion interface */ 314 314 typedef struct _HistoryCallbackArg HistoryCallbackArg; … … 455 455 456 456 /* pixmap creation function */ 457 GtkWidget* create_pixmap (GtkWidget *widget, 457 GtkWidget* create_pixmap (GtkWidget *widget, 458 458 const gchar *pixmap_char); 459 459 … … 525 525 gchar** remaining_text, 526 526 CompletionState* cmpl_state); 527 static gboolean check_dir (gchar *dir_name, 528 struct stat *result, 527 static gboolean check_dir (gchar *dir_name, 528 struct stat *result, 529 529 gboolean *stat_subdirs); 530 530 static CompletionDir* open_dir (gchar* dir_name, … … 534 534 static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir, 535 535 CompletionState *cmpl_state); 536 static CompletionDirSent* open_new_dir (gchar* dir_name, 536 static CompletionDirSent* open_new_dir (gchar* dir_name, 537 537 struct stat* sbuf, 538 538 gboolean stat_subdirs); … … 573 573 574 574 static void gtk_file_selection_file_button (GtkWidget *widget, 575 gint row, 576 gint column, 575 gint row, 576 gint column, 577 577 GdkEventButton *bevent, 578 578 gpointer user_data); … … 619 619 620 620 //static void gtk_file_selection_home_button (GtkWidget *widget, gpointer data); 621 static void gtk_file_selection_bookmark_button (GtkWidget *widget, 621 static void gtk_file_selection_bookmark_button (GtkWidget *widget, 622 622 GtkFileSelection *fs); 623 623 … … 639 639 static void gtk_file_selection_load_masks(GtkFileSelection *fs); 640 640 641 static gint gtk_file_selection_show_fileop_menu (GtkCList *clist, 642 GdkEvent *event, 641 static gint gtk_file_selection_show_fileop_menu (GtkCList *clist, 642 GdkEvent *event, 643 643 GtkFileSelection *fs); 644 644 645 645 646 646 static GtkWindowClass *parent_class = NULL; 647 647 … … 695 695 696 696 /* 697 * Now, replace backslashes with forward slashes 697 * Now, replace backslashes with forward slashes 698 698 * if necessary. 699 699 */ … … 704 704 if (path[index] == '\\') 705 705 path[index] = '/'; 706 706 707 707 updated = 1; 708 708 } 709 709 710 710 return updated; 711 711 } … … 795 795 796 796 tc = 0; mc = 0; 797 797 798 798 if (mask[0] == 0 && text[0] == 0) return 1; 799 799 800 800 if (mask[0] == '*') 801 801 { … … 926 926 item->desc=g_strdup(bookmark_data+lp); 927 927 lp=++cp; 928 928 929 929 while (cp < file_info.st_size && bookmark_data[cp] != '>' ) 930 930 cp++; … … 956 956 } 957 957 958 static void 959 gtk_file_selection_add_bookmark (GtkFileSelection *fs, gchar *desc, gchar *path) 958 static void 959 gtk_file_selection_add_bookmark (GtkFileSelection *fs, gchar *desc, gchar *path) 960 960 { 961 961 /* Add item to menu */ … … 973 973 } 974 974 975 gint 975 gint 976 976 gtk_file_selection_save_bookmarks (GtkFileSelection *fs) 977 977 { … … 994 994 g_free(item_data); 995 995 } 996 996 997 997 close(file); 998 998 } else { … … 1171 1171 char *dir_title [2]; 1172 1172 char *file_title [2]; 1173 1173 1174 1174 filesel->cmpl_state = cmpl_init_state (); 1175 1175 … … 1196 1196 gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0); 1197 1197 gtk_widget_show (pulldown_hbox); 1198 1198 1199 1199 /* The horizontal box containing create, rename etc. buttons */ 1200 1200 … … 1228 1228 gtk_container_set_border_width (GTK_CONTAINER (list_vbox),2); 1229 1229 gtk_widget_show (list_vbox); 1230 1230 1231 1231 /* The horizontal box containing the directory and file listboxes */ 1232 1232 // list_hbox = gtk_hbox_new (FALSE, 3); … … 1260 1260 1261 1261 /* Here we add the bookmark menu button */ 1262 #define If we're going to make bookmark a menu, we don't need 1262 #define If we're going to make bookmark a menu, we don't need 1263 1263 #define to keep it in the filesel structure 1264 1264 button=gtk_button_new_with_label(_("Bookmarks")); … … 1268 1268 (GtkSignalFunc) gtk_file_selection_bookmark_button, 1269 1269 (gpointer) filesel); 1270 1270 1271 1271 hbox2 = gtk_hbox_new (FALSE, 2); 1272 1272 gtk_box_pack_start (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0); … … 1319 1319 /* menu for right click file operations */ 1320 1320 filesel->fileop_menu = gtk_menu_new(); 1321 1322 menu_item = gtk_menu_item_new_with_label ( "Rename...");1321 1322 menu_item = gtk_menu_item_new_with_label (_("Rename...")); 1323 1323 gtk_widget_show(menu_item); 1324 1324 gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", … … 1327 1327 gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); 1328 1328 1329 menu_item = gtk_menu_item_new_with_label ( "Delete");1329 menu_item = gtk_menu_item_new_with_label (_("Delete")); 1330 1330 gtk_widget_show(menu_item); 1331 1331 gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); … … 1338 1338 gtk_menu_append (GTK_MENU (filesel->fileop_menu), menu_item); 1339 1339 1340 menu_item = gtk_menu_item_new_with_label ( "Create Directory...");1340 menu_item = gtk_menu_item_new_with_label (_("Create Directory...")); 1341 1341 gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", 1342 (GtkSignalFunc) gtk_file_selection_create_dir, 1342 (GtkSignalFunc) gtk_file_selection_create_dir, 1343 1343 (gpointer) filesel); 1344 1344 gtk_widget_show(menu_item); … … 1349 1349 gtk_widget_show(menu_item); 1350 1350 1351 menu_item = gtk_menu_item_new_with_label ( "Properties...");1351 menu_item = gtk_menu_item_new_with_label (_("Properties...")); 1352 1352 gtk_signal_connect_object (GTK_OBJECT (menu_item), "activate", 1353 1353 (GtkSignalFunc) gtk_file_selection_properties, … … 1368 1368 (gpointer) filesel); 1369 1369 gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "button_press_event", 1370 GTK_SIGNAL_FUNC(gtk_file_selection_show_fileop_menu), 1370 GTK_SIGNAL_FUNC(gtk_file_selection_show_fileop_menu), 1371 1371 (gpointer) filesel); 1372 1372 … … 1379 1379 gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE,TRUE, 0); 1380 1380 //gtk_container_add(GTK_CONTAINER(hpaned), scrolled_win); 1381 1381 1382 1382 gtk_widget_show (filesel->dir_list); 1383 1383 gtk_widget_show (scrolled_win); … … 1411 1411 (GtkSignalFunc) gtk_file_selection_mask_entry_callback, 1412 1412 (gpointer) filesel); 1413 gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->mask_entry)->entry),"key-press-event", 1413 gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->mask_entry)->entry),"key-press-event", 1414 1414 (GtkSignalFunc) gtk_file_selection_mask_entry_key_callback, 1415 1415 (gpointer) filesel); … … 1430 1430 gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT); 1431 1431 gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", 1432 (GtkSignalFunc) gtk_file_selection_file_button, 1432 (GtkSignalFunc) gtk_file_selection_file_button, 1433 1433 (gpointer) filesel); 1434 1434 gtk_signal_connect (GTK_OBJECT (filesel->file_list), "key-press-event", 1435 1435 (GtkSignalFunc) gtk_file_selection_files_list_key_callback, 1436 1436 (gpointer) filesel); 1437 1437 1438 1438 gtk_signal_connect (GTK_OBJECT (filesel->file_list), "button_press_event", 1439 GTK_SIGNAL_FUNC(gtk_file_selection_show_fileop_menu), 1439 GTK_SIGNAL_FUNC(gtk_file_selection_show_fileop_menu), 1440 1440 (gpointer) filesel); 1441 1441 … … 1452 1452 /* action area for packing buttons into. */ 1453 1453 filesel->action_area = gtk_hbox_new (TRUE, 0); 1454 gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, 1454 gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, 1455 1455 FALSE, FALSE, 2); 1456 1456 gtk_widget_show (filesel->action_area); … … 1463 1463 1464 1464 /* The selection entry widget */ 1465 1465 1466 1466 entry_vbox = gtk_vbox_new (FALSE, 0); 1467 1467 gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0); … … 1496 1496 (GtkAttachOptions) (0), 0, 0); 1497 1497 gtk_widget_show (label); 1498 1498 1499 1499 1500 1500 filesel->history_combo = gtk_combo_new(); … … 1505 1505 gtk_widget_show(filesel->history_combo); 1506 1506 1507 gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->entry),"key-press-event", 1507 gtk_signal_connect(GTK_OBJECT(((GtkCombo *)filesel->history_combo)->entry),"key-press-event", 1508 1508 (GtkSignalFunc) gtk_file_selection_history_combo_callback, 1509 1509 (gpointer) filesel); … … 1583 1583 gtk_window_set_title (GTK_WINDOW (filesel), title); 1584 1584 /* !!! put check here to figure out if screen > 640x480, if true 1585 We need to make the file selection dialog bigger. much bigger.. 1585 We need to make the file selection dialog bigger. much bigger.. 1586 1586 or maybe we should keep it at a certan percentage of the screen 1587 1587 size? */ … … 1598 1598 1599 1599 return; 1600 1600 1601 1601 /* delete, create directory, and rename */ 1602 1602 /* 1603 if (!filesel->fileop_c_dir) 1603 if (!filesel->fileop_c_dir) 1604 1604 { 1605 1605 filesel->fileop_c_dir = gtk_button_new_with_label (_("MkDir")); 1606 1606 gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked", 1607 (GtkSignalFunc) gtk_file_selection_create_dir, 1607 (GtkSignalFunc) gtk_file_selection_create_dir, 1608 1608 (gpointer) filesel); 1609 gtk_box_pack_start (GTK_BOX (filesel->button_area), 1609 gtk_box_pack_start (GTK_BOX (filesel->button_area), 1610 1610 filesel->fileop_c_dir, TRUE,TRUE, 0); 1611 1611 gtk_widget_show (filesel->fileop_c_dir); 1612 1612 } 1613 1614 if (!filesel->fileop_del_file) 1613 1614 if (!filesel->fileop_del_file) 1615 1615 { 1616 1616 filesel->fileop_del_file = gtk_button_new_with_label (_("Delete")); 1617 1617 gtk_signal_connect (GTK_OBJECT (filesel->fileop_del_file), "clicked", 1618 (GtkSignalFunc) gtk_file_selection_delete_file, 1618 (GtkSignalFunc) gtk_file_selection_delete_file, 1619 1619 (gpointer) filesel); 1620 gtk_box_pack_start (GTK_BOX (filesel->button_area), 1620 gtk_box_pack_start (GTK_BOX (filesel->button_area), 1621 1621 filesel->fileop_del_file, TRUE,TRUE, 0); 1622 1622 gtk_widget_show (filesel->fileop_del_file); … … 1627 1627 filesel->fileop_ren_file = gtk_button_new_with_label (_("Rename")); 1628 1628 gtk_signal_connect (GTK_OBJECT (filesel->fileop_ren_file), "clicked", 1629 (GtkSignalFunc) gtk_file_selection_rename_file, 1629 (GtkSignalFunc) gtk_file_selection_rename_file, 1630 1630 (gpointer) filesel); 1631 gtk_box_pack_start (GTK_BOX (filesel->button_area), 1631 gtk_box_pack_start (GTK_BOX (filesel->button_area), 1632 1632 filesel->fileop_ren_file, TRUE,TRUE, 0); 1633 1633 gtk_widget_show (filesel->fileop_ren_file); … … 1638 1638 } 1639 1639 1640 void 1640 void 1641 1641 gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel) 1642 1642 { 1643 1643 g_return_if_fail (filesel != NULL); 1644 1644 g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); 1645 1645 1646 1646 return; 1647 1647 /* 1648 if (filesel->fileop_ren_file) 1648 if (filesel->fileop_ren_file) 1649 1649 { 1650 1650 gtk_widget_destroy (filesel->fileop_ren_file); … … 1728 1728 gchar *new_pattern; 1729 1729 gint x; 1730 1730 1731 1731 g_return_if_fail (filesel != NULL); 1732 1732 g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); … … 1735 1735 if (filesel->selection_entry) 1736 1736 gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); 1737 1737 1738 1738 if(strchr(pattern,'*') || strchr(pattern,'?')) 1739 1739 { … … 1743 1743 } 1744 1744 gtk_entry_set_text(GTK_ENTRY(filesel->mask_entry),g_strdup(pattern+x+1)); 1745 1745 1746 1746 if(filesel->mask) g_free(filesel->mask); 1747 1747 1748 1748 filesel->mask=g_strdup(pattern+x+1); 1749 1749 new_pattern=g_strdup(pattern); … … 1791 1791 1792 1792 filesel = GTK_FILE_SELECTION (object); 1793 1793 1794 1794 if (filesel->fileop_dialog) 1795 1795 gtk_widget_destroy (filesel->fileop_dialog); 1796 1796 1797 1797 if (filesel->next_history) 1798 1798 { … … 1824 1824 filesel->mask = NULL; 1825 1825 } 1826 1826 1827 1827 cmpl_free_state (filesel->cmpl_state); 1828 1828 filesel->cmpl_state = NULL; … … 1844 1844 g_return_val_if_fail (fs != NULL, FALSE); 1845 1845 g_return_val_if_fail (GTK_FILE_SELECTION (fs), FALSE); 1846 1846 1847 1847 if (event->type == GDK_BUTTON_PRESS) 1848 1848 { … … 1851 1851 { 1852 1852 1853 gtk_menu_popup (GTK_MENU (fs->fileop_menu), NULL, NULL, NULL, NULL, 1853 gtk_menu_popup (GTK_MENU (fs->fileop_menu), NULL, NULL, NULL, NULL, 1854 1854 event_button->button, event_button->time); 1855 1855 return TRUE; 1856 1856 } 1857 1857 } 1858 1858 1859 1859 return FALSE; 1860 1860 } … … 1867 1867 GtkWidget *button; 1868 1868 GtkWidget *dialog; 1869 1869 1870 1870 g_return_if_fail (error_message != NULL); 1871 1871 1872 1872 /* main dialog */ 1873 1873 dialog = gtk_dialog_new (); 1874 1874 /* 1875 1875 gtk_signal_connect (GTK_OBJECT (dialog), "destroy", 1876 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 1876 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 1877 1877 (gpointer) fs); 1878 1878 */ 1879 1879 gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); 1880 1880 gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); 1881 1881 1882 1882 /* If file dialog is grabbed, make this dialog modal too */ 1883 1883 /* When error dialog is closed, file dialog will be grabbed again */ … … 1898 1898 /* yes, we free it */ 1899 1899 g_free (error_message); 1900 1900 1901 1901 /* close button */ 1902 1902 button = gtk_button_new_with_label (_("Close")); 1903 1903 gtk_signal_connect_object (GTK_OBJECT (button), "clicked", 1904 (GtkSignalFunc) gtk_widget_destroy, 1904 (GtkSignalFunc) gtk_widget_destroy, 1905 1905 (gpointer) dialog); 1906 1906 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 1920 1920 g_return_if_fail (fs != NULL); 1921 1921 g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); 1922 1922 1923 1923 fs->fileop_dialog = NULL; 1924 1924 g_free (fs->fileop_data); … … 1936 1936 gchar *buf; 1937 1937 CompletionState *cmpl_state; 1938 1938 1939 1939 g_return_if_fail (fs != NULL); 1940 1940 g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); … … 1943 1943 cmpl_state = (CompletionState*) fs->cmpl_state; 1944 1944 path = cmpl_reference_position (cmpl_state); 1945 1945 1946 1946 full_path = g_strconcat (path, "/", dirname, NULL); 1947 if ( (mkdir (full_path, 0755) < 0) ) 1948 { 1949 buf = g_strconcat ("Error creating directory \"", dirname, "\": ", 1947 if ( (mkdir (full_path, 0755) < 0) ) 1948 { 1949 buf = g_strconcat ("Error creating directory \"", dirname, "\": ", 1950 1950 g_strerror(errno), NULL); 1951 1951 gtk_file_selection_fileop_error (fs, buf); 1952 1952 } 1953 1953 g_free (full_path); 1954 1954 1955 1955 gtk_widget_destroy (fs->fileop_dialog); 1956 1956 gtk_file_selection_populate (fs, "", FALSE); 1957 1957 } 1958 1958 1959 1959 static void 1960 1960 gtk_file_selection_create_dir (gpointer data) … … 1971 1971 if (fs->fileop_dialog) 1972 1972 return; 1973 1973 1974 1974 /* main dialog */ 1975 1975 fs->fileop_dialog = dialog = gtk_dialog_new (); 1976 1976 gtk_signal_connect (GTK_OBJECT (dialog), "destroy", 1977 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 1977 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 1978 1978 (gpointer) fs); 1979 1979 gtk_window_set_title (GTK_WINDOW (dialog), _("Create Directory")); … … 1990 1990 FALSE, FALSE, 0); 1991 1991 gtk_widget_show(vbox); 1992 1992 1993 1993 label = gtk_label_new(_("Directory name:")); 1994 1994 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); … … 1998 1998 /* The directory entry widget */ 1999 1999 fs->fileop_entry = gtk_entry_new (); 2000 gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, 2000 gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, 2001 2001 TRUE, TRUE, 5); 2002 2002 GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); 2003 2003 gtk_widget_show (fs->fileop_entry); 2004 2004 2005 2005 /* buttons */ 2006 2006 button = gtk_button_new_with_label (_("Create")); 2007 2007 gtk_signal_connect (GTK_OBJECT (button), "clicked", 2008 (GtkSignalFunc) gtk_file_selection_create_dir_confirmed, 2008 (GtkSignalFunc) gtk_file_selection_create_dir_confirmed, 2009 2009 (gpointer) fs); 2010 2010 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 2012 2012 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); 2013 2013 gtk_widget_show(button); 2014 2014 2015 2015 button = gtk_button_new_with_label (_("Cancel")); 2016 2016 gtk_signal_connect_object (GTK_OBJECT (button), "clicked", 2017 (GtkSignalFunc) gtk_widget_destroy, 2017 (GtkSignalFunc) gtk_widget_destroy, 2018 2018 (gpointer) dialog); 2019 2019 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 2034 2034 gchar *full_path; 2035 2035 gchar *buf; 2036 2036 2037 2037 g_return_if_fail (fs != NULL); 2038 2038 g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); … … 2040 2040 cmpl_state = (CompletionState*) fs->cmpl_state; 2041 2041 path = cmpl_reference_position (cmpl_state); 2042 2042 2043 2043 full_path = g_strconcat (path, "/", fs->fileop_file, NULL); 2044 if ( (unlink (full_path) < 0) ) 2045 { 2046 buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", 2044 if ( (unlink (full_path) < 0) ) 2045 { 2046 buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", 2047 2047 g_strerror(errno), NULL); 2048 2048 gtk_file_selection_fileop_error (fs, buf); 2049 2049 } 2050 2050 g_free (full_path); 2051 2051 2052 2052 gtk_widget_destroy (fs->fileop_dialog); 2053 2053 gtk_file_selection_populate (fs, "", FALSE); … … 2064 2064 gchar *filename; 2065 2065 gchar *buf; 2066 2066 2067 2067 g_return_if_fail (fs != NULL); 2068 2068 g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); … … 2076 2076 2077 2077 fs->fileop_file = filename; 2078 2078 2079 2079 /* main dialog */ 2080 2080 fs->fileop_dialog = dialog = gtk_dialog_new (); 2081 2081 gtk_signal_connect (GTK_OBJECT (dialog), "destroy", 2082 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 2082 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 2083 2083 (gpointer) fs); 2084 2084 gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File")); … … 2089 2089 if (GTK_WINDOW(fs)->modal) 2090 2090 gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); 2091 2091 2092 2092 vbox = gtk_vbox_new(FALSE, 0); 2093 2093 gtk_container_set_border_width(GTK_CONTAINER(vbox), 8); … … 2102 2102 gtk_widget_show(label); 2103 2103 g_free(buf); 2104 2104 2105 2105 /* buttons */ 2106 2106 button = gtk_button_new_with_label (_("Delete")); 2107 2107 gtk_signal_connect (GTK_OBJECT (button), "clicked", 2108 (GtkSignalFunc) gtk_file_selection_delete_file_confirmed, 2108 (GtkSignalFunc) gtk_file_selection_delete_file_confirmed, 2109 2109 (gpointer) fs); 2110 2110 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 2112 2112 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); 2113 2113 gtk_widget_show(button); 2114 2114 2115 2115 button = gtk_button_new_with_label (_("Cancel")); 2116 2116 gtk_signal_connect_object (GTK_OBJECT (button), "clicked", 2117 (GtkSignalFunc) gtk_widget_destroy, 2117 (GtkSignalFunc) gtk_widget_destroy, 2118 2118 (gpointer) dialog); 2119 2119 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 2137 2137 gchar *old_filename; 2138 2138 CompletionState *cmpl_state; 2139 2139 2140 2140 g_return_if_fail (fs != NULL); 2141 2141 g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); … … 2144 2144 cmpl_state = (CompletionState*) fs->cmpl_state; 2145 2145 path = cmpl_reference_position (cmpl_state); 2146 2146 2147 2147 new_filename = g_strconcat (path, "/", file, NULL); 2148 2148 old_filename = g_strconcat (path, "/", fs->fileop_file, NULL); 2149 2149 2150 2150 if (strcmp (new_filename, old_filename)) 2151 if ((rename (old_filename, new_filename)) < 0) 2151 if ((rename (old_filename, new_filename)) < 0) 2152 2152 { 2153 buf = g_strconcat ("Error renaming file \"", file, "\": ", 2153 buf = g_strconcat ("Error renaming file \"", file, "\": ", 2154 2154 g_strerror(errno), NULL); 2155 2155 gtk_file_selection_fileop_error (fs, buf); … … 2157 2157 g_free (new_filename); 2158 2158 g_free (old_filename); 2159 2159 2160 2160 gtk_widget_destroy (fs->fileop_dialog); 2161 2161 gtk_file_selection_populate (fs, "", FALSE); 2162 2162 } 2163 2163 2164 2164 static void 2165 2165 gtk_file_selection_file_mode_confirmed (GtkWidget *widget, gpointer data) … … 2180 2180 if (chmod (filename, mode) == -1) 2181 2181 { 2182 gchar *buf = g_strconcat ("Error changing file mode of \"", filename, "\": ", 2182 gchar *buf = g_strconcat ("Error changing file mode of \"", filename, "\": ", 2183 2183 g_strerror (errno), NULL); 2184 2184 gtk_file_selection_fileop_error (fs, buf); … … 2201 2201 GtkWidget *button; 2202 2202 gchar *buf; 2203 2203 2204 2204 g_return_if_fail (fs != NULL); 2205 2205 g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); … … 2211 2211 if (strlen(fs->fileop_file) < 1) 2212 2212 return; 2213 2213 2214 2214 /* main dialog */ 2215 2215 fs->fileop_dialog = dialog = gtk_dialog_new (); 2216 2216 gtk_signal_connect (GTK_OBJECT (dialog), "destroy", 2217 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 2217 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 2218 2218 (gpointer) fs); 2219 2219 gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File")); … … 2224 2224 if (GTK_WINDOW(fs)->modal) 2225 2225 gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); 2226 2226 2227 2227 vbox = gtk_vbox_new(FALSE, 0); 2228 2228 gtk_container_set_border_width (GTK_CONTAINER(vbox), 8); … … 2230 2230 FALSE, FALSE, 0); 2231 2231 gtk_widget_show(vbox); 2232 2232 2233 2233 buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL); 2234 2234 label = gtk_label_new(buf); … … 2240 2240 /* New filename entry */ 2241 2241 fs->fileop_entry = gtk_entry_new (); 2242 gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, 2242 gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, 2243 2243 TRUE, TRUE, 5); 2244 2244 GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT); 2245 2245 gtk_widget_show (fs->fileop_entry); 2246 2246 2247 2247 gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file); 2248 2248 gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry), … … 2252 2252 button = gtk_button_new_with_label (_("Rename")); 2253 2253 gtk_signal_connect (GTK_OBJECT (button), "clicked", 2254 (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, 2254 (GtkSignalFunc) gtk_file_selection_rename_file_confirmed, 2255 2255 (gpointer) fs); 2256 2256 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 2258 2258 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); 2259 2259 gtk_widget_show(button); 2260 2260 2261 2261 button = gtk_button_new_with_label (_("Cancel")); 2262 2262 gtk_signal_connect_object (GTK_OBJECT (button), "clicked", 2263 (GtkSignalFunc) gtk_widget_destroy, 2263 (GtkSignalFunc) gtk_widget_destroy, 2264 2264 (gpointer) dialog); 2265 2265 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), … … 2346 2346 if (fs->fileop_dialog) 2347 2347 return; 2348 2348 2349 2349 /* main dialog */ 2350 2350 fs->fileop_dialog = dialog = gtk_dialog_new (); 2351 2351 gtk_signal_connect (GTK_OBJECT (dialog), "destroy", 2352 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 2352 (GtkSignalFunc) gtk_file_selection_fileop_destroy, 2353 2353 (gpointer) fs); 2354 2354 priv = fs->fileop_data = g_malloc (sizeof (PropertiesPrivate)); … … 2361 2361 if (GTK_WINDOW(fs)->modal) 2362 2362 gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); 2363 2363 2364 2364 /* Dialog guts go here */ 2365 2365 notebook = gtk_notebook_new (); … … 2371 2371 fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); 2372 2372 filename = g_strconcat(path, "/", fs->fileop_file, NULL); 2373 if (strlen(fs->fileop_file) > 0 && !(stat(filename, &statbuf))) 2373 if (strlen(fs->fileop_file) > 0 && !(stat(filename, &statbuf))) 2374 2374 { 2375 2375 /* stats page */ … … 2380 2380 gtk_table_set_row_spacings (GTK_TABLE (table), 4); 2381 2381 gtk_table_set_col_spacings (GTK_TABLE (table), 6); 2382 2382 2383 2383 label = gtk_label_new (_("Statistics")); 2384 2384 gtk_widget_show (label); … … 2392 2392 (GtkAttachOptions) (0), 0, 0); 2393 2393 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 2394 2394 2395 2395 label = gtk_label_new (_(path)); 2396 2396 gtk_widget_show (label); … … 2400 2400 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); 2401 2401 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 2402 2402 2403 2403 label = gtk_label_new (_("File Name:")); 2404 2404 gtk_widget_show (label); … … 2407 2407 (GtkAttachOptions) (0), 0, 0); 2408 2408 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 2409 2409 2410 2410 fs->fileop_entry = entry = gtk_entry_new (); 2411 2411 gtk_widget_show (entry); … … 2416 2416 if (access (filename, W_OK)) 2417 2417 gtk_widget_set_sensitive( GTK_WIDGET (entry), FALSE); 2418 2418 2419 2419 hseparator = gtk_hseparator_new (); 2420 2420 gtk_widget_show (hseparator); … … 2422 2422 (GtkAttachOptions) (GTK_FILL), 2423 2423 (GtkAttachOptions) (GTK_FILL), 0, 0); 2424 2424 2425 2425 /* file type and size */ 2426 2426 label = gtk_label_new (_("Type:")); … … 2465 2465 (GtkAttachOptions) (0), 0, 0); 2466 2466 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 2467 2467 2468 2468 label = gtk_label_new (_("Size:")); 2469 2469 gtk_widget_show (label); … … 2472 2472 (GtkAttachOptions) (0), 0, 0); 2473 2473 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 2474 2474 2475 2475 label = gtk_label_new (_(g_strdup_printf ("%ld bytes", statbuf.st_size))); 2476 2476 gtk_widget_show (label); … … 2479 2479 (GtkAttachOptions) (0), 0, 0); 2480 2480 gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); 2481 2481 2482 2482 hseparator = gtk_hseparator_new (); 2483 2483 gtk_widget_show (hseparator); … … 2485 2485 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 2486 2486 (GtkAttachOptions) (GTK_FILL), 0, 0); 2487 2487 2488 2488 /* file dates */ 2489 2489 label = gtk_label_new (_("Created:")); … … 2493 2493
