Added a button to refresh the monitors list

This commit is contained in:
Pierre Pronchery 2011-08-28 17:43:02 +00:00
parent 0b26e82596
commit 50081350c2
5 changed files with 170 additions and 148 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-15 01:39+0200\n"
"POT-Creation-Date: 2011-08-28 19:40+0200\n"
"PO-Revision-Date: 2010-03-29 23:28+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: English\n"
@ -206,7 +206,7 @@ msgstr ""
msgid "Shell scripts"
msgstr ""
#: ../src/browser.c:963 ../src/desktop.c:1716 ../src/view.c:436
#: ../src/browser.c:963 ../src/desktop.c:1717 ../src/view.c:436
msgid "All files"
msgstr "Alle Dateien"
@ -415,7 +415,7 @@ msgstr ""
msgid "Copying: "
msgstr ""
#: ../src/copy.c:152 ../src/desktop.c:1699
#: ../src/copy.c:152 ../src/desktop.c:1700
msgid "Filename: "
msgstr ""
@ -508,90 +508,90 @@ msgstr ""
msgid "Could not load preferences"
msgstr ""
#: ../src/desktop.c:1654
#: ../src/desktop.c:1655
msgid "Desktop preferences"
msgstr "Desktop Einstellungen"
#: ../src/desktop.c:1691
#: ../src/desktop.c:1692
msgid "Default color: "
msgstr ""
#: ../src/desktop.c:1703 ../src/desktop.c:1749
#: ../src/desktop.c:1704 ../src/desktop.c:1750
msgid "Background"
msgstr "Hintergrund"
#: ../src/desktop.c:1706
#: ../src/desktop.c:1707
msgid "Picture files"
msgstr "Bilder"
#: ../src/desktop.c:1728
#: ../src/desktop.c:1729
msgid "Position: "
msgstr ""
#: ../src/desktop.c:1734
#: ../src/desktop.c:1735
msgid "Centered"
msgstr ""
#: ../src/desktop.c:1736
#: ../src/desktop.c:1737
msgid "Scaled"
msgstr ""
#: ../src/desktop.c:1738
#: ../src/desktop.c:1739
msgid "Scaled (keep ratio)"
msgstr ""
#: ../src/desktop.c:1740
#: ../src/desktop.c:1741
msgid "Tiled"
msgstr ""
#: ../src/desktop.c:1745
#: ../src/desktop.c:1746
msgid "E_xtend background to all monitors"
msgstr ""
#: ../src/desktop.c:1770
#: ../src/desktop.c:1766
msgid "Monitor: "
msgstr "Bildschirm: "
#: ../src/desktop.c:1776
msgid "Whole screen"
msgstr ""
#: ../src/desktop.c:1781
#, c-format
msgid "Monitor %d"
msgstr "Bildschirm %d"
#: ../src/desktop.c:1792
#: ../src/desktop.c:1775
msgid "Resolution: "
msgstr "Auflösung: "
#: ../src/desktop.c:1803
#: ../src/desktop.c:1786
msgid "Size: "
msgstr "Größe: "
#: ../src/desktop.c:1817
#: ../src/desktop.c:1810
msgid "Monitors"
msgstr "Bildschirme"
#: ../src/desktop.c:1831
#: ../src/desktop.c:1824
msgid "Desktop font: "
msgstr ""
#: ../src/desktop.c:1840
#: ../src/desktop.c:1833
msgid "Theme"
msgstr ""
#: ../src/desktop.c:1876
#: ../src/desktop.c:1869
#, c-format
msgid "%dx%d (at %d,%d)"
msgstr ""
#: ../src/desktop.c:1879
#: ../src/desktop.c:1872
#, c-format
msgid "%dx%d mm (%.0lfx%.0lf DPI)"
msgstr ""
#: ../src/desktop.c:2029
#: ../src/desktop.c:1892
msgid "Whole screen"
msgstr ""
#: ../src/desktop.c:1897
#, c-format
msgid "Monitor %d"
msgstr "Bildschirm %d"
#: ../src/desktop.c:2051
msgid ""
"Usage: desktop [-H|-V][-a|-c|-f|-h|-n][-m monitor]\n"
" -H\tPlace icons horizontally\n"
@ -819,6 +819,6 @@ msgstr ""
msgid "Volumes"
msgstr ""
#: ../src/plugins/volumes.c:206
#: ../src/plugins/volumes.c:208
msgid "Root filesystem"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-15 01:39+0200\n"
"POT-Creation-Date: 2011-08-28 19:40+0200\n"
"PO-Revision-Date: 2010-03-30 01:04+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: Spanish\n"
@ -206,7 +206,7 @@ msgstr ""
msgid "Shell scripts"
msgstr ""
#: ../src/browser.c:963 ../src/desktop.c:1716 ../src/view.c:436
#: ../src/browser.c:963 ../src/desktop.c:1717 ../src/view.c:436
msgid "All files"
msgstr ""
@ -415,7 +415,7 @@ msgstr ""
msgid "Copying: "
msgstr ""
#: ../src/copy.c:152 ../src/desktop.c:1699
#: ../src/copy.c:152 ../src/desktop.c:1700
msgid "Filename: "
msgstr ""
@ -508,90 +508,90 @@ msgstr ""
msgid "Could not load preferences"
msgstr ""
#: ../src/desktop.c:1654
#: ../src/desktop.c:1655
msgid "Desktop preferences"
msgstr "Desktop preferencias"
#: ../src/desktop.c:1691
#: ../src/desktop.c:1692
msgid "Default color: "
msgstr ""
#: ../src/desktop.c:1703 ../src/desktop.c:1749
#: ../src/desktop.c:1704 ../src/desktop.c:1750
msgid "Background"
msgstr ""
#: ../src/desktop.c:1706
#: ../src/desktop.c:1707
msgid "Picture files"
msgstr ""
#: ../src/desktop.c:1728
#: ../src/desktop.c:1729
msgid "Position: "
msgstr ""
#: ../src/desktop.c:1734
#: ../src/desktop.c:1735
msgid "Centered"
msgstr ""
#: ../src/desktop.c:1736
#: ../src/desktop.c:1737
msgid "Scaled"
msgstr ""
#: ../src/desktop.c:1738
#: ../src/desktop.c:1739
msgid "Scaled (keep ratio)"
msgstr ""
#: ../src/desktop.c:1740
#: ../src/desktop.c:1741
msgid "Tiled"
msgstr ""
#: ../src/desktop.c:1745
#: ../src/desktop.c:1746
msgid "E_xtend background to all monitors"
msgstr ""
#: ../src/desktop.c:1770
#: ../src/desktop.c:1766
msgid "Monitor: "
msgstr ""
#: ../src/desktop.c:1776
msgid "Whole screen"
msgstr ""
#: ../src/desktop.c:1781
#, c-format
msgid "Monitor %d"
msgstr ""
#: ../src/desktop.c:1792
#: ../src/desktop.c:1775
msgid "Resolution: "
msgstr ""
#: ../src/desktop.c:1803
#: ../src/desktop.c:1786
msgid "Size: "
msgstr ""
#: ../src/desktop.c:1817
#: ../src/desktop.c:1810
msgid "Monitors"
msgstr ""
#: ../src/desktop.c:1831
#: ../src/desktop.c:1824
msgid "Desktop font: "
msgstr ""
#: ../src/desktop.c:1840
#: ../src/desktop.c:1833
msgid "Theme"
msgstr ""
#: ../src/desktop.c:1876
#: ../src/desktop.c:1869
#, c-format
msgid "%dx%d (at %d,%d)"
msgstr ""
#: ../src/desktop.c:1879
#: ../src/desktop.c:1872
#, c-format
msgid "%dx%d mm (%.0lfx%.0lf DPI)"
msgstr ""
#: ../src/desktop.c:2029
#: ../src/desktop.c:1892
msgid "Whole screen"
msgstr ""
#: ../src/desktop.c:1897
#, c-format
msgid "Monitor %d"
msgstr ""
#: ../src/desktop.c:2051
msgid ""
"Usage: desktop [-H|-V][-a|-c|-f|-h|-n][-m monitor]\n"
" -H\tPlace icons horizontally\n"
@ -819,6 +819,6 @@ msgstr ""
msgid "Volumes"
msgstr ""
#: ../src/plugins/volumes.c:206
#: ../src/plugins/volumes.c:208
msgid "Root filesystem"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-15 01:39+0200\n"
"POT-Creation-Date: 2011-08-28 19:40+0200\n"
"PO-Revision-Date: 2010-03-29 23:28+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n"
@ -206,7 +206,7 @@ msgstr "Fichiers exécutables"
msgid "Shell scripts"
msgstr "Scripts shell"
#: ../src/browser.c:963 ../src/desktop.c:1716 ../src/view.c:436
#: ../src/browser.c:963 ../src/desktop.c:1717 ../src/view.c:436
msgid "All files"
msgstr "Tous les fichiers"
@ -415,7 +415,7 @@ msgstr "Copie de fichier(s)"
msgid "Copying: "
msgstr "Copie de : "
#: ../src/copy.c:152 ../src/desktop.c:1699
#: ../src/copy.c:152 ../src/desktop.c:1700
msgid "Filename: "
msgstr "Nom de fichier : "
@ -528,90 +528,90 @@ msgstr "Applications"
msgid "Could not load preferences"
msgstr "Impossible de charger les préférences"
#: ../src/desktop.c:1654
#: ../src/desktop.c:1655
msgid "Desktop preferences"
msgstr "Préférences du bureau"
#: ../src/desktop.c:1691
#: ../src/desktop.c:1692
msgid "Default color: "
msgstr "Couleur par défaut :"
#: ../src/desktop.c:1703 ../src/desktop.c:1749
#: ../src/desktop.c:1704 ../src/desktop.c:1750
msgid "Background"
msgstr "Arrière-plan"
#: ../src/desktop.c:1706
#: ../src/desktop.c:1707
msgid "Picture files"
msgstr "Images"
#: ../src/desktop.c:1728
#: ../src/desktop.c:1729
msgid "Position: "
msgstr "Position : "
#: ../src/desktop.c:1734
#: ../src/desktop.c:1735
msgid "Centered"
msgstr "Centré"
#: ../src/desktop.c:1736
#: ../src/desktop.c:1737
msgid "Scaled"
msgstr "Étiré"
#: ../src/desktop.c:1738
#: ../src/desktop.c:1739
msgid "Scaled (keep ratio)"
msgstr "Étiré (sans déformer)"
#: ../src/desktop.c:1740
#: ../src/desktop.c:1741
msgid "Tiled"
msgstr "Mosaïque"
#: ../src/desktop.c:1745
#: ../src/desktop.c:1746
msgid "E_xtend background to all monitors"
msgstr "Étendre l'arrière-plan à tous les moniteurs"
#: ../src/desktop.c:1770
#: ../src/desktop.c:1766
msgid "Monitor: "
msgstr "Moniteur : "
#: ../src/desktop.c:1776
msgid "Whole screen"
msgstr "Écran complet"
#: ../src/desktop.c:1781
#, c-format
msgid "Monitor %d"
msgstr "Moniteur %d"
#: ../src/desktop.c:1792
#: ../src/desktop.c:1775
msgid "Resolution: "
msgstr "Résolution : "
#: ../src/desktop.c:1803
#: ../src/desktop.c:1786
msgid "Size: "
msgstr "Taille: "
#: ../src/desktop.c:1817
#: ../src/desktop.c:1810
msgid "Monitors"
msgstr "Moniteurs"
#: ../src/desktop.c:1831
#: ../src/desktop.c:1824
msgid "Desktop font: "
msgstr "Police du bureau : "
#: ../src/desktop.c:1840
#: ../src/desktop.c:1833
msgid "Theme"
msgstr "Thème"
#: ../src/desktop.c:1876
#: ../src/desktop.c:1869
#, c-format
msgid "%dx%d (at %d,%d)"
msgstr "%dx%d (à %d,%d)"
#: ../src/desktop.c:1879
#: ../src/desktop.c:1872
#, c-format
msgid "%dx%d mm (%.0lfx%.0lf DPI)"
msgstr "%dx%d mm (%.0lfx%.0lf DPI)"
#: ../src/desktop.c:2029
#: ../src/desktop.c:1892
msgid "Whole screen"
msgstr "Écran complet"
#: ../src/desktop.c:1897
#, c-format
msgid "Monitor %d"
msgstr "Moniteur %d"
#: ../src/desktop.c:2051
msgid ""
"Usage: desktop [-H|-V][-a|-c|-f|-h|-n][-m monitor]\n"
" -H\tPlace icons horizontally\n"
@ -853,6 +853,6 @@ msgstr "Prévisualisation"
msgid "Volumes"
msgstr "Volumes"
#: ../src/plugins/volumes.c:206
#: ../src/plugins/volumes.c:208
msgid "Root filesystem"
msgstr "Racine"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Browser 0.1.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-15 01:39+0200\n"
"POT-Creation-Date: 2011-08-28 19:40+0200\n"
"PO-Revision-Date: 2010-04-07 23:18+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: Italian\n"
@ -206,7 +206,7 @@ msgstr ""
msgid "Shell scripts"
msgstr ""
#: ../src/browser.c:963 ../src/desktop.c:1716 ../src/view.c:436
#: ../src/browser.c:963 ../src/desktop.c:1717 ../src/view.c:436
msgid "All files"
msgstr ""
@ -415,7 +415,7 @@ msgstr ""
msgid "Copying: "
msgstr ""
#: ../src/copy.c:152 ../src/desktop.c:1699
#: ../src/copy.c:152 ../src/desktop.c:1700
msgid "Filename: "
msgstr ""
@ -508,90 +508,90 @@ msgstr ""
msgid "Could not load preferences"
msgstr ""
#: ../src/desktop.c:1654
#: ../src/desktop.c:1655
msgid "Desktop preferences"
msgstr ""
#: ../src/desktop.c:1691
#: ../src/desktop.c:1692
msgid "Default color: "
msgstr ""
#: ../src/desktop.c:1703 ../src/desktop.c:1749
#: ../src/desktop.c:1704 ../src/desktop.c:1750
msgid "Background"
msgstr ""
#: ../src/desktop.c:1706
#: ../src/desktop.c:1707
msgid "Picture files"
msgstr ""
#: ../src/desktop.c:1728
#: ../src/desktop.c:1729
msgid "Position: "
msgstr ""
#: ../src/desktop.c:1734
#: ../src/desktop.c:1735
msgid "Centered"
msgstr ""
#: ../src/desktop.c:1736
#: ../src/desktop.c:1737
msgid "Scaled"
msgstr ""
#: ../src/desktop.c:1738
#: ../src/desktop.c:1739
msgid "Scaled (keep ratio)"
msgstr ""
#: ../src/desktop.c:1740
#: ../src/desktop.c:1741
msgid "Tiled"
msgstr ""
#: ../src/desktop.c:1745
#: ../src/desktop.c:1746
msgid "E_xtend background to all monitors"
msgstr ""
#: ../src/desktop.c:1770
#: ../src/desktop.c:1766
msgid "Monitor: "
msgstr ""
#: ../src/desktop.c:1776
msgid "Whole screen"
msgstr ""
#: ../src/desktop.c:1781
#, c-format
msgid "Monitor %d"
msgstr ""
#: ../src/desktop.c:1792
#: ../src/desktop.c:1775
msgid "Resolution: "
msgstr ""
#: ../src/desktop.c:1803
#: ../src/desktop.c:1786
msgid "Size: "
msgstr ""
#: ../src/desktop.c:1817
#: ../src/desktop.c:1810
msgid "Monitors"
msgstr ""
#: ../src/desktop.c:1831
#: ../src/desktop.c:1824
msgid "Desktop font: "
msgstr ""
#: ../src/desktop.c:1840
#: ../src/desktop.c:1833
msgid "Theme"
msgstr ""
#: ../src/desktop.c:1876
#: ../src/desktop.c:1869
#, c-format
msgid "%dx%d (at %d,%d)"
msgstr ""
#: ../src/desktop.c:1879
#: ../src/desktop.c:1872
#, c-format
msgid "%dx%d mm (%.0lfx%.0lf DPI)"
msgstr ""
#: ../src/desktop.c:2029
#: ../src/desktop.c:1892
msgid "Whole screen"
msgstr ""
#: ../src/desktop.c:1897
#, c-format
msgid "Monitor %d"
msgstr ""
#: ../src/desktop.c:2051
msgid ""
"Usage: desktop [-H|-V][-a|-c|-f|-h|-n][-m monitor]\n"
" -H\tPlace icons horizontally\n"
@ -819,6 +819,6 @@ msgstr ""
msgid "Volumes"
msgstr ""
#: ../src/plugins/volumes.c:206
#: ../src/plugins/volumes.c:208
msgid "Root filesystem"
msgstr ""

View File

@ -1629,6 +1629,7 @@ static void _preferences_theme(Desktop * desktop, GtkWidget * notebook);
static void _preferences_set(Desktop * desktop);
static gboolean _on_preferences_closex(gpointer data);
static void _on_preferences_monitors_changed(gpointer data);
static void _on_preferences_monitors_refresh(gpointer data);
static void _on_preferences_response(GtkWidget * widget, gint response,
gpointer data);
static void _on_preferences_ok(gpointer data);
@ -1755,12 +1756,7 @@ static void _preferences_monitors(Desktop * desktop, GtkWidget * notebook)
GtkWidget * vbox2;
GtkWidget * hbox;
GtkWidget * label;
#if GTK_CHECK_VERSION(2, 14, 0)
gint n;
gint i;
char * name;
char buf[32];
#endif
GtkWidget * widget;
group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
vbox2 = gtk_vbox_new(FALSE, 4);
@ -1772,19 +1768,6 @@ static void _preferences_monitors(Desktop * desktop, GtkWidget * notebook)
gtk_size_group_add_widget(group, label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0);
desktop->pr_monitors = gtk_combo_box_new_text();
gtk_combo_box_append_text(GTK_COMBO_BOX(desktop->pr_monitors),
_("Whole screen"));
#if GTK_CHECK_VERSION(2, 14, 0)
n = gdk_screen_get_n_monitors(desktop->screen);
for(i = 0; i < n; i++)
{
snprintf(buf, sizeof(buf), _("Monitor %d"), i);
name = gdk_screen_get_monitor_plug_name(desktop->screen, i);
gtk_combo_box_append_text(GTK_COMBO_BOX(desktop->pr_monitors),
(name != NULL) ? name : buf);
g_free(name);
}
#endif
gtk_box_pack_start(GTK_BOX(hbox), desktop->pr_monitors, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, TRUE, 0);
/* geometry */
@ -1810,9 +1793,19 @@ static void _preferences_monitors(Desktop * desktop, GtkWidget * notebook)
0);
gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, TRUE, 0);
/* refresh */
hbox = gtk_hbox_new(FALSE, 0);
label = gtk_label_new(NULL);
gtk_size_group_add_widget(group, label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0);
widget = gtk_button_new_from_stock(GTK_STOCK_REFRESH);
g_signal_connect_swapped(widget, "clicked", G_CALLBACK(
_on_preferences_monitors_refresh), desktop);
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, TRUE, 0);
/* updates */
g_signal_connect_swapped(desktop->pr_monitors, "changed", G_CALLBACK(
_on_preferences_monitors_changed), desktop);
gtk_combo_box_set_active(GTK_COMBO_BOX(desktop->pr_monitors), 0);
_on_preferences_monitors_refresh(desktop);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(
_("Monitors")));
}
@ -1882,6 +1875,35 @@ static void _on_preferences_monitors_changed(gpointer data)
gtk_label_set_text(GTK_LABEL(desktop->pr_monitors_size), buf);
}
static void _on_preferences_monitors_refresh(gpointer data)
{
Desktop * desktop = data;
GtkTreeModel * model;
#if GTK_CHECK_VERSION(2, 14, 0)
gint n;
gint i;
char * name;
char buf[32];
#endif
model = gtk_combo_box_get_model(GTK_COMBO_BOX(desktop->pr_monitors));
gtk_list_store_clear(GTK_LIST_STORE(model));
gtk_combo_box_append_text(GTK_COMBO_BOX(desktop->pr_monitors),
_("Whole screen"));
#if GTK_CHECK_VERSION(2, 14, 0)
n = gdk_screen_get_n_monitors(desktop->screen);
for(i = 0; i < n; i++)
{
snprintf(buf, sizeof(buf), _("Monitor %d"), i);
name = gdk_screen_get_monitor_plug_name(desktop->screen, i);
gtk_combo_box_append_text(GTK_COMBO_BOX(desktop->pr_monitors),
(name != NULL) ? name : buf);
g_free(name);
}
#endif
gtk_combo_box_set_active(GTK_COMBO_BOX(desktop->pr_monitors), 0);
}
static void _on_preferences_response(GtkWidget * widget, gint response,
gpointer data)
{