summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rhimport.glade31
-rwxr-xr-xrhimport.pl35
2 files changed, 40 insertions, 26 deletions
diff --git a/rhimport.glade b/rhimport.glade
index 5743022..999ac1a 100644
--- a/rhimport.glade
+++ b/rhimport.glade
@@ -3,9 +3,15 @@
<!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy project-wide -->
<widget class="GtkWindow" id="appwin">
- <property name="title" translatable="yes">rhimport</property>
+ <property name="width_request">640</property>
+ <property name="height_request">480</property>
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="title">rhimport</property>
+ <property name="gravity">center</property>
+ <property name="startup_id">1</property>
<child>
- <widget class="GtkFrame" id="frame1">
+ <widget class="GtkFrame" id="mainframe">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
@@ -22,9 +28,10 @@
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
- <widget class="GtkLabel" id="label_dropbox">
+ <widget class="GtkLabel" id="l_dropbox">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Dropbox&lt;/b&gt;</property>
+ <property name="sensitive">False</property>
+ <property name="label">&lt;b&gt;Dropbox&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
@@ -42,9 +49,10 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label_playlist">
+ <widget class="GtkLabel" id="l_playlist">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Playlist&lt;/b&gt;</property>
+ <property name="sensitive">False</property>
+ <property name="label">&lt;b&gt;Playlist&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
@@ -53,7 +61,7 @@
</packing>
</child>
<child>
- <widget class="GtkFileChooserWidget" id="filechooserwidget">
+ <widget class="GtkFileChooserWidget" id="filechooser">
<property name="visible">True</property>
<property name="orientation">vertical</property>
</widget>
@@ -79,6 +87,7 @@
<child>
<widget class="GtkProgressBar" id="progressbar">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -99,7 +108,7 @@
<child>
<widget class="GtkButton" id="b_cancel">
<property name="label">gtk-cancel</property>
- <property name="width_request">120</property>
+ <property name="width_request">130</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -113,7 +122,7 @@
<child>
<widget class="GtkButton" id="b_ok">
<property name="label">gtk-ok</property>
- <property name="width_request">120</property>
+ <property name="width_request">130</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -135,9 +144,9 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label_main">
+ <widget class="GtkLabel" id="l_main">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;rhimport - Radio Helsinki Importtool&lt;/b&gt;</property>
+ <property name="label">&lt;big&gt;&lt;b&gt;rhimport - Radio Helsinki Importtool&lt;/b&gt;&lt;/big&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
diff --git a/rhimport.pl b/rhimport.pl
index 8f8a4ed..5c3b2ca 100755
--- a/rhimport.pl
+++ b/rhimport.pl
@@ -40,37 +40,42 @@ EOF
my $user = 'martinland';#$ENV{'USER'};
$user or die "Username not found in environment";
-my $dbh = DBI->connect( "DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr";
+# my $dbh = DBI->connect( "DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr";
-my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH from USER_PERMS, DROPBOXES where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME;};
+# my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH from USER_PERMS, DROPBOXES where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME;};
-my $sth = $dbh->prepare($sql);
-$sth->execute();
+# my $sth = $dbh->prepare($sql);
+# $sth->execute();
my @allowed_dbs;
-while(my ($group, $path) = $sth->fetchrow_array()) {
- $path =~ s/\/\*$//;
- my $perm = {};
- $perm->{'GROUP'} = $group;
- $perm->{'PATH'} = $path;
- push @allowed_dbs, $perm;
-}
-$sth->finish();
+# while(my ($group, $path) = $sth->fetchrow_array()) {
+# $path =~ s/\/\*$//;
+# my $perm = {};
+# $perm->{'GROUP'} = $group;
+# $perm->{'PATH'} = $path;
+# push @allowed_dbs, $perm;
+# }
+# $sth->finish();
if($LISTALLOWED) {
for my $href ( @allowed_dbs ) {
print "$href->{'PATH'}\n";
}
- $dbh->disconnect();
+# $dbh->disconnect();
exit 0;
}
## GUI mode
if(!$M3U) {
- my $gui = Gtk2::GladeXML->new('rhimport.glade');
+ my $guixml = Gtk2::GladeXML->new('rhimport.glade');
+ $guixml or die "can't load glade xml file";
+# my $widget = $guixml->get_widget('appwin');
+# $widget or die "can't find main GUI Widget";
+
Gtk2->main;
+# $dbh->disconnect();
exit 0;
}
@@ -83,5 +88,5 @@ if($DONTCONCAT) {
print "Will import $M3U (concatenated), with user $user\n\n";
}
-$dbh->disconnect();
+# $dbh->disconnect();
exit 0;