]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikwindow.c
Add tooltip to new zoom level combo
[andy/viking.git] / src / vikwindow.c
index 6810fa7ba3934b6a40308aee4216292d3ca2f93d..22bb63cdf440715d45c839dfaf9e97340c60d7de 100644 (file)
@@ -344,7 +344,7 @@ static void open_window ( VikWindow *vw, GSList *files )
     if (vw != NULL && check_file_magic_vik ( file_name ) ) {
       VikWindow *newvw = vik_window_new_window ();
       if (newvw)
-       vik_window_open_file ( newvw, file_name, change_fn );
+        vik_window_open_file ( newvw, file_name, TRUE );
     }
     else {
       vik_window_open_file ( vw, file_name, change_fn );
@@ -450,6 +450,9 @@ static GtkWidget *create_zoom_combo_all_levels ()
   gtk_combo_box_append_text ( combo, "8192");
   gtk_combo_box_append_text ( combo, "16384");
   gtk_combo_box_append_text ( combo, "32768");
+  /* Create tooltip */
+  GtkTooltips *tooltips = gtk_tooltips_new ();
+  gtk_tooltips_set_tip ( tooltips, GTK_WIDGET (combo), _("Select zoom level"), NULL);
   return zoom_combo;
 }
 
@@ -2343,11 +2346,28 @@ static void load_file ( GtkAction *a, VikWindow *vw )
     else {
       files = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER(vw->open_dia) );
       gboolean change_fn = newwindow && (g_slist_length(files)==1); /* only change fn if one file */
-      
+      gboolean first_vik_file = TRUE;
       cur_file = files;
       while ( cur_file ) {
+
         gchar *file_name = cur_file->data;
-        vik_window_open_file ( vw, file_name, change_fn );
+        if ( newwindow && check_file_magic_vik ( file_name ) ) {
+          // Load first of many .vik files in current window
+          if ( first_vik_file ) {
+            vik_window_open_file ( vw, file_name, TRUE );
+            first_vik_file = FALSE;
+          }
+          else {
+            // Load each subsequent .vik file in a separate window
+            VikWindow *newvw = vik_window_new_window ();
+            if (newvw)
+              vik_window_open_file ( newvw, file_name, TRUE );
+          }
+        }
+        else
+          // Other file types
+          vik_window_open_file ( vw, file_name, change_fn );
+
         g_free (file_name);
         cur_file = g_slist_next (cur_file);
       }