chiark / gitweb /
Merge from Disobedience branch
authorRichard Kettlewell <rjk@greenend.org.uk>
Tue, 1 Dec 2009 20:13:10 +0000 (20:13 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Tue, 1 Dec 2009 20:13:10 +0000 (20:13 +0000)
  - manual updates
  - fix window size bug in compact mode

CHANGES.html
disobedience/disobedience.c
disobedience/manual/intro.html
disobedience/manual/menu-control.png
disobedience/manual/queue2.png
disobedience/manual/window.html

index e6312949c003bb9f8ffcf391c7df3e95cb3e9826..0598fc78e4be1aa539650d8b85d7eca945470219 100644 (file)
@@ -179,6 +179,11 @@ span.command {
           <td>Mac DisOrder uses wrong sound device</td>
         </tr>
 
+        <tr>
+          <td><a href="http://code.google.com/p/disorder/issues/detail?id=30">#30</a></d>
+          <td>mini disobedience interface</td>
+        </tr>
+
         <tr>
           <td><a href="http://code.google.com/p/disorder/issues/detail?id=32">#32</a></d>
           <td>Excessively verbose log chatter on shutdown</td>
index 8ca36e5b6aa975741c81d2baa9d75a11a5848099..6511b13555a15337df5cafb12ea912e10feb77d6 100644 (file)
@@ -175,27 +175,38 @@ static GtkWidget *notebook(void) {
 /* Tracking of window sizes */
 static int toplevel_width = 640, toplevel_height = 480;
 static int mini_width = 480, mini_height = 140;
+static struct timeval last_mode_switch;
 
 static void main_minimode(const char attribute((unused)) *event,
                           void attribute((unused)) *evendata,
                           void attribute((unused)) *callbackdata) {
   if(full_mode) {
+    gtk_window_resize(GTK_WINDOW(toplevel), toplevel_width, toplevel_height);
     gtk_widget_show(tabs);
     gtk_widget_hide(playing_mini);
     /* Show the queue (bit confusing otherwise!) */
     gtk_notebook_set_current_page(GTK_NOTEBOOK(tabs), 0);
-    gtk_window_resize(GTK_WINDOW(toplevel), toplevel_width, toplevel_height);
   } else {
+    gtk_window_resize(GTK_WINDOW(toplevel), mini_width, mini_height);
     gtk_widget_hide(tabs);
     gtk_widget_show(playing_mini);
-    gtk_window_resize(GTK_WINDOW(toplevel), mini_width, mini_height);
   }
+  xgettimeofday(&last_mode_switch, NULL);
 }
 
 /* Called when the window size is allocate */
 static void toplevel_size_allocate(GtkWidget attribute((unused)) *w,
                                    GtkAllocation *a,
                                    gpointer attribute((unused)) user_data) {
+  struct timeval now;
+  xgettimeofday(&now, NULL);
+  if(tvdouble(tvsub(now, last_mode_switch)) < 0.5) {
+    /* Suppress size-allocate signals that are within half a second of a mode
+     * switch: they are quite likely to be the result of re-arranging widgets
+     * within the old size, not the application of the new size.  Yes, this is
+     * a disgusting hack! */
+    return;                             /* OMG too soon! */
+  }
   if(full_mode) {
     toplevel_width = a->width;
     toplevel_height = a->height;
@@ -205,6 +216,18 @@ static void toplevel_size_allocate(GtkWidget attribute((unused)) *w,
   }
 }
 
+/* Periodically check the toplevel's size
+ * (the hack in toplevel_size_allocate() means we could in principle
+ * miss a user-initiated resize)
+ */
+static void check_toplevel_size(const char attribute((unused)) *event,
+                                void attribute((unused)) *evendata,
+                                void attribute((unused)) *callbackdata) {
+  GtkAllocation a;
+  gtk_window_get_size(GTK_WINDOW(toplevel), &a.width, &a.height);
+  toplevel_size_allocate(NULL, &a, NULL);
+}
+
 /** @brief Create and populate the main window */
 static void make_toplevel_window(void) {
   GtkWidget *const vbox = gtk_vbox_new(FALSE, 1);
@@ -251,6 +274,7 @@ static void make_toplevel_window(void) {
                    0);
   gtk_widget_set_style(toplevel, tool_style);
   event_register("mini-mode-changed", main_minimode, 0);
+  event_register("periodic-fast", check_toplevel_size, 0);
 }
 
 static void userinfo_rights_completed(void attribute((unused)) *v,
index 52d09158b73394a81e16d9c4bdf3201d8e198834..3fb0451d44d72b537dae64958a2d227819e294ee 100644 (file)
@@ -118,7 +118,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    <p>There is no Windows support (although the web interface can be
    used from Windows computers).</p>
 
-   <h2><a name=createloging>1.3 Getting a DisOrder login</a></h2>
+   <h2><a name=createlogin>1.3 Getting a DisOrder login</a></h2>
 
    <p>The easiest way to get a DisOrder login is to access the web
    interface and set one up using that.  To do this,
index a76ec69f6cdc1cf8185f9307ea434fdd94799366..c2da17bf7339ac820235dcc8552cbc8d3183c4c8 100644 (file)
Binary files a/disobedience/manual/menu-control.png and b/disobedience/manual/menu-control.png differ
index 536c253a1493572c0c5de54d6745a702ae297999..8f8b4c3764038f7824655ce0adabe1cda988ab83 100644 (file)
Binary files a/disobedience/manual/queue2.png and b/disobedience/manual/queue2.png differ
index 40c6f9846923badc7c9e4760ae850c129bdebaba..9e983f23608e280be644e698cdbc5f26197e55f0 100644 (file)
@@ -56,8 +56,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
    <p class=image><img src="queue2.png"></p>
 
-   <p>The first track is 4 minutes and 10 seconds long and so far, the
-   first 21 seconds of it has played.</p>
+   <p>The playing track is highlighted with a green backgroud.  It's 4
+   minutes and 10 seconds long and so far, the first 21 seconds of it
+   has played.</p>
 
    <h2><a name=buttons>2.2 Buttons</a></h2>
 
@@ -128,7 +129,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    first time it is run, <b>Manage Users</b> which allows
    adminstrators to do user management, and <b>Quit</b>.</p>
 
-   <!-- TODO link to use management -->
+   <!-- TODO link to user management -->
 
    <p class=image><img src="menu-edit.png"></p>
 
@@ -138,21 +139,17 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    mouse.</p>
 
    <p>The <b>Track Properties</b> option will create a window with
-   editable properties of each selected track and the <b>Edit
-   Playlists</b> option will create a window allowing editing of
-   playlists.</p>
-
-   <!-- TODO link to properties -->
-
-   <!-- TODO link to playlists -->
+   editable <a href="properties.html">properties</a> of each selected
+   track and the <b>Edit Playlists</b> option will create a window
+   allowing editing of <a href="playlists.html">playlists</a>.</p>
 
    <p class=image><img src="menu-control.png"></p>
 
    <p>The <b>Control</b> menu options are mostly equivalent to the
-   buttons described above.  The one exception is <b>Activate
-   Playlist</b> which allows you to play a playlist.</p>
-
-   <!-- TODO link to playlists -->
+   buttons described above.  The exceptions is <b>Activate
+   Playlist</b> which allows you to play
+   a <A href="playlists.html">playlist</a>, and <b>Compact Mode</b>
+   which switches Disobedience's window to a smaller format.</p>
 
    <p class=image><img src="menu-help.png"></p>