]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Merge branch 'master' into freediving-tweaks
authorMaximilian Güntner <maximilian.guentner@gmail.com>
Tue, 21 Aug 2012 23:15:41 +0000 (01:15 +0200)
committerMaximilian Güntner <maximilian.guentner@gmail.com>
Tue, 21 Aug 2012 23:15:41 +0000 (01:15 +0200)
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
1  2 
gtk-gui.c
profile.c

diff --cc gtk-gui.c
index 4b9f002af60d5967c30338e607ed229e0b9fbd78,306e1a5e715ab8e5a6e890c3ce431cc2970ac218..f25fbaa53f6588a7968219784190d0cdcf4fff26
+++ b/gtk-gui.c
@@@ -21,8 -21,9 +21,10 @@@ GtkWidget *main_vbox
  GtkWidget *error_info_bar;
  GtkWidget *error_label;
  GtkWidget *vpane, *hpane;
+ GtkWidget *notebook;
  int        error_count;
 +extern char zoomed_plot;
  
  const char *divelist_font;
  
@@@ -604,31 -661,32 +662,39 @@@ static void view_info(GtkWidget *w, gpo
        gtk_paned_set_position(GTK_PANED(hpane), 65535);
  }
  
- /* Ooh. I don't know how to get the half-way size. So I'm just using random numbers */
  static void view_three(GtkWidget *w, gpointer data)
  {
-       gtk_paned_set_position(GTK_PANED(hpane), 400);
-       gtk_paned_set_position(GTK_PANED(vpane), 200);
+       GtkAllocation alloc;
+       GtkRequisition requisition;
+       gtk_widget_get_allocation(hpane, &alloc);
+       gtk_paned_set_position(GTK_PANED(hpane), alloc.width/2);
+       gtk_widget_get_allocation(vpane, &alloc);
+       gtk_widget_size_request(notebook, &requisition);
+       /* pick the requested size for the notebook plus 6 pixels for frame */
+       gtk_paned_set_position(GTK_PANED(vpane), requisition.height + 6);
  }
  
 +static void toggle_zoom(GtkWidget *w, gpointer data)
 +{
 +      zoomed_plot = (zoomed_plot)?0 : 1;
 +      /*Update dive*/
 +      repaint_dive();
 +}
 +
  static GtkActionEntry menu_items[] = {
-       { "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL},
-       { "LogMenuAction",  GTK_STOCK_FILE, "Log", NULL, NULL, NULL},
-       { "ViewMenuAction",  GTK_STOCK_FILE, "View", NULL, NULL, NULL},
-       { "FilterMenuAction",  GTK_STOCK_FILE, "Filter", NULL, NULL, NULL},
-       { "HelpMenuAction", GTK_STOCK_HELP, "Help", NULL, NULL, NULL},
+       { "FileMenuAction", NULL, "File", NULL, NULL, NULL},
+       { "LogMenuAction",  NULL, "Log", NULL, NULL, NULL},
+       { "ViewMenuAction",  NULL, "View", NULL, NULL, NULL},
+       { "FilterMenuAction",  NULL, "Filter", NULL, NULL, NULL},
+       { "HelpMenuAction", NULL, "Help", NULL, NULL, NULL},
        { "OpenFile",       GTK_STOCK_OPEN, NULL,   CTRLCHAR "O", NULL, G_CALLBACK(file_open) },
        { "SaveFile",       GTK_STOCK_SAVE, NULL,   CTRLCHAR "S", NULL, G_CALLBACK(file_save) },
+       { "SaveAsFile",     GTK_STOCK_SAVE_AS, NULL,   SHIFTCHAR CTRLCHAR "S", NULL, G_CALLBACK(file_save_as) },
        { "Print",          GTK_STOCK_PRINT, NULL,  CTRLCHAR "P", NULL, G_CALLBACK(do_print) },
        { "Import",         NULL, "Import", NULL, NULL, G_CALLBACK(import_dialog) },
-       { "Preferences",    NULL, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) },
+       { "AddDive",        GTK_STOCK_ADD, "Add Dive", NULL, NULL, G_CALLBACK(add_dive_cb) },
+       { "Preferences",    GTK_STOCK_PREFERENCES, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) },
        { "Renumber",       NULL, "Renumber", NULL, NULL, G_CALLBACK(renumber_dialog) },
        { "SelectEvents",   NULL, "SelectEvents", NULL, NULL, G_CALLBACK(selectevents_dialog) },
        { "Quit",           GTK_STOCK_QUIT, NULL,   CTRLCHAR "Q", NULL, G_CALLBACK(quit) },
@@@ -655,9 -713,9 +722,10 @@@ static const gchar* ui_string = " 
                        </menu> \
                        <menu name=\"LogMenu\" action=\"LogMenuAction\"> \
                                <menuitem name=\"Import\" action=\"Import\" /> \
+                               <menuitem name=\"Add Dive\" action=\"AddDive\" /> \
                                <separator name=\"Separator\"/> \
                                <menuitem name=\"Renumber\" action=\"Renumber\" /> \
 +                              <menuitem name=\"Toggle Zoom\" action=\"ToggleZoom\" /> \
                                <menu name=\"View\" action=\"ViewMenuAction\"> \
                                        <menuitem name=\"List\" action=\"ViewList\" /> \
                                        <menuitem name=\"Profile\" action=\"ViewProfile\" /> \
diff --cc profile.c
Simple merge