paperbox r162 - in trunk: . src



Author: markoa
Date: Sat Jun  7 16:41:39 2008
New Revision: 162
URL: http://svn.gnome.org/viewvc/paperbox?rev=162&view=rev

Log:
Center the window, don't store its position

Modified:
   trunk/ChangeLog
   trunk/src/config.cc
   trunk/src/config.hh
   trunk/src/main-window.cc

Modified: trunk/src/config.cc
==============================================================================
--- trunk/src/config.cc	(original)
+++ trunk/src/config.cc	Sat Jun  7 16:41:39 2008
@@ -77,8 +77,6 @@
     {
         Glib::KeyFile keyfile_;
 
-        keyfile_.set_integer(UI_GROUP, "window_x", DEFAULT_X);
-        keyfile_.set_integer(UI_GROUP, "window_y", DEFAULT_Y);
         keyfile_.set_integer(UI_GROUP, "window_width", DEFAULT_WIDTH);
         keyfile_.set_integer(UI_GROUP, "window_height", DEFAULT_HEIGHT);
         keyfile_.set_integer(UI_GROUP, "main_paned_position",
@@ -106,9 +104,7 @@
     KeyFileConfig::has_all_fields()
     {
         try {
-            return keyfile_.has_key(UI_GROUP, "window_x") &&
-                keyfile_.has_key(UI_GROUP, "window_y") &&
-                keyfile_.has_key(UI_GROUP, "window_width") &&
+            return keyfile_.has_key(UI_GROUP, "window_width") &&
                 keyfile_.has_key(UI_GROUP, "window_height") &&
                 keyfile_.has_key(UI_GROUP, "main_paned_position") &&
                 keyfile_.has_key(UI_GROUP, "category_paned_position");
@@ -120,20 +116,6 @@
     }
 
     void
-    KeyFileConfig::get_window_position(int& x, int& y)
-    {
-        x = keyfile_.get_integer(UI_GROUP, "window_x");
-        y = keyfile_.get_integer(UI_GROUP, "window_y");
-    }
-
-    void
-    KeyFileConfig::set_window_position(const int x, const int y)
-    {
-        keyfile_.set_integer(UI_GROUP, "window_x", x);
-        keyfile_.set_integer(UI_GROUP, "window_y", y);
-    }
-
-    void
     KeyFileConfig::get_window_size(int& width, int& height)
     {
         width = keyfile_.get_integer(UI_GROUP, "window_width");

Modified: trunk/src/config.hh
==============================================================================
--- trunk/src/config.hh	(original)
+++ trunk/src/config.hh	Sat Jun  7 16:41:39 2008
@@ -32,9 +32,6 @@
         Config() {}
         virtual ~Config() {}
 
-        virtual void get_window_position(int& x, int& y) = 0;
-        virtual void set_window_position(const int x, const int y) = 0;
-
         virtual void get_window_size(int& width, int& height) = 0;
         virtual void set_window_size(const int width, const int height) = 0;
  
@@ -61,9 +58,6 @@
         explicit KeyFileConfig();
         virtual ~KeyFileConfig();
 
-        virtual void get_window_position(int& x, int& y);
-        virtual void set_window_position(const int x, const int y);
-
         virtual void get_window_size(int& width, int& height);
         virtual void set_window_size(const int width, const int height);
 

Modified: trunk/src/main-window.cc
==============================================================================
--- trunk/src/main-window.cc	(original)
+++ trunk/src/main-window.cc	Sat Jun  7 16:41:39 2008
@@ -119,9 +119,7 @@
         shared_ptr<Config> cfg = get_default_config();
         init_gui(cfg);
 
-        int x, y;
-        cfg->get_window_position(x, y);
-        move(x, y);
+        set_position(Gtk::WIN_POS_CENTER_ALWAYS);
 
         int width, height;
         cfg->get_window_size(width, height);
@@ -144,11 +142,6 @@
         // save layout in the config file
         shared_ptr<Config> cfg = get_default_config();
 
-        int x, y;
-        get_position(x, y);
-        g_debug("%d, %d", x, y);
-        cfg->set_window_position(x, y);
-        
         int width, height;
         get_size(width, height);
         cfg->set_window_size(width, height);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]